@dotobokuri/fleet-console 1.5.5 → 1.7.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 (68) hide show
  1. package/AGENTS.md +14 -11
  2. package/README.md +9 -4
  3. package/dist/cli-bin.mjs +1915 -689
  4. package/dist/cli.d.ts +10 -1
  5. package/dist/cli.mjs +1915 -689
  6. package/dist/client/assets/{_baseUniq-CpEjig2A.js → _baseUniq-DaRHKvkJ.js} +1 -1
  7. package/dist/client/assets/{arc-BmymS_Kz.js → arc-ByrjrNFZ.js} +1 -1
  8. package/dist/client/assets/{architectureDiagram-Q4EWVU46-D1d0KVz1.js → architectureDiagram-Q4EWVU46-yRDXYtYq.js} +1 -1
  9. package/dist/client/assets/{blockDiagram-DXYQGD6D-Cwuv0sNk.js → blockDiagram-DXYQGD6D-B3Ud4HmY.js} +1 -1
  10. package/dist/client/assets/{c4Diagram-AHTNJAMY-Bsk-GjC_.js → c4Diagram-AHTNJAMY-BWtT7uJ6.js} +1 -1
  11. package/dist/client/assets/channel-D1hUfR86.js +1 -0
  12. package/dist/client/assets/{chunk-4BX2VUAB-ZM4i9T4D.js → chunk-4BX2VUAB-Cdk_k5EX.js} +1 -1
  13. package/dist/client/assets/{chunk-4TB4RGXK-Sw5ODKRj.js → chunk-4TB4RGXK-CfeLiRAa.js} +1 -1
  14. package/dist/client/assets/{chunk-55IACEB6-DDDLwVg4.js → chunk-55IACEB6-B26kabv5.js} +1 -1
  15. package/dist/client/assets/{chunk-EDXVE4YY-BNk5Xk1Q.js → chunk-EDXVE4YY-CZ5hqsgg.js} +1 -1
  16. package/dist/client/assets/{chunk-FMBD7UC4-C_CC6grw.js → chunk-FMBD7UC4-CuCp-r0v.js} +1 -1
  17. package/dist/client/assets/{chunk-OYMX7WX6-DTbaYVUc.js → chunk-OYMX7WX6-Dy5T8Uzb.js} +1 -1
  18. package/dist/client/assets/{chunk-QZHKN3VN-i7z9jXPR.js → chunk-QZHKN3VN-PNRzwWoU.js} +1 -1
  19. package/dist/client/assets/{chunk-YZCP3GAM-cTSeZOtz.js → chunk-YZCP3GAM-BjJxIVvV.js} +1 -1
  20. package/dist/client/assets/classDiagram-6PBFFD2Q-B7ZtwAd2.js +1 -0
  21. package/dist/client/assets/classDiagram-v2-HSJHXN6E-B7ZtwAd2.js +1 -0
  22. package/dist/client/assets/clone-BggxG0Ng.js +1 -0
  23. package/dist/client/assets/{cose-bilkent-S5V4N54A-uVW4wTRq.js → cose-bilkent-S5V4N54A-CIL2KUnC.js} +1 -1
  24. package/dist/client/assets/{dagre-KV5264BT-CclQ97X6.js → dagre-KV5264BT-BoekxdN3.js} +1 -1
  25. package/dist/client/assets/{diagram-5BDNPKRD-eZaXK0Xj.js → diagram-5BDNPKRD-8Uqn3Uve.js} +1 -1
  26. package/dist/client/assets/{diagram-G4DWMVQ6-DIQ8qOFv.js → diagram-G4DWMVQ6-CWZp4Fw1.js} +1 -1
  27. package/dist/client/assets/{diagram-MMDJMWI5-B_EbeR8B.js → diagram-MMDJMWI5-Cxxmq5lR.js} +1 -1
  28. package/dist/client/assets/{diagram-TYMM5635-DI64qX-Y.js → diagram-TYMM5635-BDL3SVhp.js} +1 -1
  29. package/dist/client/assets/{erDiagram-SMLLAGMA-DLkwbOsk.js → erDiagram-SMLLAGMA-Bm_XDDZi.js} +1 -1
  30. package/dist/client/assets/{flowDiagram-DWJPFMVM-BWvMzejD.js → flowDiagram-DWJPFMVM-z3JhyUpl.js} +1 -1
  31. package/dist/client/assets/fraunces-latin-ext-standard-italic-CGbN9UgK.woff2 +0 -0
  32. package/dist/client/assets/fraunces-latin-standard-italic-lSdLDfvT.woff2 +0 -0
  33. package/dist/client/assets/fraunces-vietnamese-standard-italic-DxWqP7Ku.woff2 +0 -0
  34. package/dist/client/assets/{ganttDiagram-T4ZO3ILL-B4qUxmRl.js → ganttDiagram-T4ZO3ILL-DVfDRTRP.js} +1 -1
  35. package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-CnvcLURP.js → gitGraphDiagram-UUTBAWPF-_gni8LDF.js} +1 -1
  36. package/dist/client/assets/{graph-N4oFFLXe.js → graph-Beq1lcyq.js} +1 -1
  37. package/dist/client/assets/index-3nhZQ9tb.css +1 -0
  38. package/dist/client/assets/index-DFffaVk9.js +734 -0
  39. package/dist/client/assets/{infoDiagram-42DDH7IO-3uxP8aX_.js → infoDiagram-42DDH7IO-B-TP33al.js} +1 -1
  40. package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-DQomHvSO.js → ishikawaDiagram-UXIWVN3A-1YDVINPA.js} +1 -1
  41. package/dist/client/assets/{journeyDiagram-VCZTEJTY-C_Ogwo77.js → journeyDiagram-VCZTEJTY-CZJuR6NC.js} +1 -1
  42. package/dist/client/assets/{kanban-definition-6JOO6SKY-CGOeur5D.js → kanban-definition-6JOO6SKY-_sSHU_-t.js} +1 -1
  43. package/dist/client/assets/{layout-DKlBkSB9.js → layout-UzmHJbGX.js} +1 -1
  44. package/dist/client/assets/{linear-2pQUtBdp.js → linear-BHitegAT.js} +1 -1
  45. package/dist/client/assets/{mermaid.core-BrseLPLb.js → mermaid.core-ptwBQDH8.js} +4 -4
  46. package/dist/client/assets/{min-OFtHLPyF.js → min-CBjwmJst.js} +1 -1
  47. package/dist/client/assets/{mindmap-definition-QFDTVHPH-DQk9T3wA.js → mindmap-definition-QFDTVHPH-C8NIvAO1.js} +1 -1
  48. package/dist/client/assets/{pieDiagram-DEJITSTG-Btu4aJWj.js → pieDiagram-DEJITSTG-paebhRXC.js} +1 -1
  49. package/dist/client/assets/{quadrantDiagram-34T5L4WZ-BHMDVip9.js → quadrantDiagram-34T5L4WZ-Bk0pN-T7.js} +1 -1
  50. package/dist/client/assets/{requirementDiagram-MS252O5E-CbXi80dX.js → requirementDiagram-MS252O5E-CkPyeOJB.js} +1 -1
  51. package/dist/client/assets/{sankeyDiagram-XADWPNL6-D5c7vUw4.js → sankeyDiagram-XADWPNL6-tJsRZl9C.js} +1 -1
  52. package/dist/client/assets/{sequenceDiagram-FGHM5R23-CGuRanG_.js → sequenceDiagram-FGHM5R23-D1V2Qnb3.js} +1 -1
  53. package/dist/client/assets/{stateDiagram-FHFEXIEX-CVD3CB69.js → stateDiagram-FHFEXIEX-DdEFxPzQ.js} +1 -1
  54. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-CpqK8Q3C.js +1 -0
  55. package/dist/client/assets/{timeline-definition-GMOUNBTQ-DMTeeglq.js → timeline-definition-GMOUNBTQ-D8sNtFqY.js} +1 -1
  56. package/dist/client/assets/{vennDiagram-DHZGUBPP-CQ6TwRhb.js → vennDiagram-DHZGUBPP-DoTEQk3E.js} +1 -1
  57. package/dist/client/assets/{wardley-RL74JXVD-DdgusU4o.js → wardley-RL74JXVD-BuEgLJ7M.js} +1 -1
  58. package/dist/client/assets/{wardleyDiagram-NUSXRM2D-BFsWqK49.js → wardleyDiagram-NUSXRM2D-B0Gl34Zh.js} +1 -1
  59. package/dist/client/assets/{xychartDiagram-5P7HB3ND-Hca3jUV6.js → xychartDiagram-5P7HB3ND-Bf4nAMbM.js} +1 -1
  60. package/dist/client/index.html +2 -2
  61. package/package.json +1 -1
  62. package/dist/client/assets/channel--qpYuR58.js +0 -1
  63. package/dist/client/assets/classDiagram-6PBFFD2Q-BAI-fNQ3.js +0 -1
  64. package/dist/client/assets/classDiagram-v2-HSJHXN6E-BAI-fNQ3.js +0 -1
  65. package/dist/client/assets/clone-CqNqlAzp.js +0 -1
  66. package/dist/client/assets/index-DfJLxHX8.js +0 -734
  67. package/dist/client/assets/index-uNbiLDxs.css +0 -1
  68. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-BevvDvg0.js +0 -1
@@ -1,734 +0,0 @@
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 S of y.addedNodes)S.tagName==="LINK"&&S.rel==="modulepreload"&&o(S)}).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 Xy(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Lk(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var n=t.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(t).forEach(function(o){var l=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(s,o,l.get?l:{enumerable:!0,get:function(){return t[o]}})}),s}var gd={exports:{}},No={};var Um;function Zy(){if(Um)return No;Um=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function s(o,l,y){var S=null;if(y!==void 0&&(S=""+y),l.key!==void 0&&(S=""+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:t,type:o,key:S,ref:l!==void 0?l:null,props:y}}return No.Fragment=n,No.jsx=s,No.jsxs=s,No}var jm;function Qy(){return jm||(jm=1,gd.exports=Zy()),gd.exports}var N=Qy(),md={exports:{}},je={};var Pm;function Jy(){if(Pm)return je;Pm=1;var t=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"),S=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),C=Symbol.iterator;function E(M){return M===null||typeof M!="object"?null:(M=C&&M[C]||M["@@iterator"],typeof M=="function"?M:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,p={};function b(M,U,Y){this.props=M,this.context=U,this.refs=p,this.updater=Y||T}b.prototype.isReactComponent={},b.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")},b.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function _(){}_.prototype=b.prototype;function m(M,U,Y){this.props=M,this.context=U,this.refs=p,this.updater=Y||T}var x=m.prototype=new _;x.constructor=m,w(x,b.prototype),x.isPureReactComponent=!0;var R=Array.isArray;function k(){}var D={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function B(M,U,Y){var ae=Y.ref;return{$$typeof:t,type:M,key:U,ref:ae!==void 0?ae:null,props:Y}}function W(M,U){return B(M.type,U,M.props)}function j(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function F(M){var U={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(Y){return U[Y]})}var H=/\/+/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(k,k):(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 P(M,U,Y,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 t:case n:Q=!0;break;case g:return Q=M._init,P(Q(M._payload),U,Y,ae,ce)}}if(Q)return ce=ce(M),Q=ae===""?"."+Z(M,0):ae,R(ce)?(Y="",Q!=null&&(Y=Q.replace(H,"$&/")+"/"),P(ce,U,Y,"",function(_e){return _e})):ce!=null&&(j(ce)&&(ce=W(ce,Y+(ce.key==null||M&&M.key===ce.key?"":(""+ce.key).replace(H,"$&/")+"/")+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+=P(ae,U,Y,me,ce);else if(oe=E(M),typeof oe=="function")for(M=oe.call(M),oe=0;!(ae=M.next()).done;)ae=ae.value,me=$+Z(ae,oe++),Q+=P(ae,U,Y,me,ce);else if(me==="object"){if(typeof M.then=="function")return P(ee(M),U,Y,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 V(M,U,Y){if(M==null)return M;var ae=[],ce=0;return P(M,ae,"","",function(me){return U.call(Y,me,ce++)}),ae}function K(M){if(M._status===-1){var U=M._result;U=U(),U.then(function(Y){(M._status===0||M._status===-1)&&(M._status=1,M._result=Y)},function(Y){(M._status===0||M._status===-1)&&(M._status=2,M._result=Y)}),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)},z={map:V,forEach:function(M,U,Y){V(M,function(){U.apply(this,arguments)},Y)},count:function(M){var U=0;return V(M,function(){U++}),U},toArray:function(M){return V(M,function(U){return U})||[]},only:function(M){if(!j(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return je.Activity=f,je.Children=z,je.Component=b,je.Fragment=s,je.Profiler=l,je.PureComponent=m,je.StrictMode=o,je.Suspense=u,je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,je.__COMPILER_RUNTIME={__proto__:null,c:function(M){return D.H.useMemoCache(M)}},je.cache=function(M){return function(){return M.apply(null,arguments)}},je.cacheSignal=function(){return null},je.cloneElement=function(M,U,Y){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)!A.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=Y;else if(1<me){for(var Q=Array(me),$=0;$<me;$++)Q[$]=arguments[$+2];ae.children=Q}return B(M.type,ce,ae)},je.createContext=function(M){return M={$$typeof:S,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:y,_context:M},M},je.createElement=function(M,U,Y){var ae,ce={},me=null;if(U!=null)for(ae in U.key!==void 0&&(me=""+U.key),U)A.call(U,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ce[ae]=U[ae]);var Q=arguments.length-2;if(Q===1)ce.children=Y;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)},je.createRef=function(){return{current:null}},je.forwardRef=function(M){return{$$typeof:c,render:M}},je.isValidElement=j,je.lazy=function(M){return{$$typeof:g,_payload:{_status:-1,_result:M},_init:K}},je.memo=function(M,U){return{$$typeof:h,type:M,compare:U===void 0?null:U}},je.startTransition=function(M){var U=D.T,Y={};D.T=Y;try{var ae=M(),ce=D.S;ce!==null&&ce(Y,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(k,O)}catch(me){O(me)}finally{U!==null&&Y.types!==null&&(U.types=Y.types),D.T=U}},je.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},je.use=function(M){return D.H.use(M)},je.useActionState=function(M,U,Y){return D.H.useActionState(M,U,Y)},je.useCallback=function(M,U){return D.H.useCallback(M,U)},je.useContext=function(M){return D.H.useContext(M)},je.useDebugValue=function(){},je.useDeferredValue=function(M,U){return D.H.useDeferredValue(M,U)},je.useEffect=function(M,U){return D.H.useEffect(M,U)},je.useEffectEvent=function(M){return D.H.useEffectEvent(M)},je.useId=function(){return D.H.useId()},je.useImperativeHandle=function(M,U,Y){return D.H.useImperativeHandle(M,U,Y)},je.useInsertionEffect=function(M,U){return D.H.useInsertionEffect(M,U)},je.useLayoutEffect=function(M,U){return D.H.useLayoutEffect(M,U)},je.useMemo=function(M,U){return D.H.useMemo(M,U)},je.useOptimistic=function(M,U){return D.H.useOptimistic(M,U)},je.useReducer=function(M,U,Y){return D.H.useReducer(M,U,Y)},je.useRef=function(M){return D.H.useRef(M)},je.useState=function(M){return D.H.useState(M)},je.useSyncExternalStore=function(M,U,Y){return D.H.useSyncExternalStore(M,U,Y)},je.useTransition=function(){return D.H.useTransition()},je.version="19.2.7",je}var Fm;function kf(){return Fm||(Fm=1,md.exports=Jy()),md.exports}var te=kf(),vd={exports:{}},Io={},bd={exports:{}},Sd={};var qm;function eC(){return qm||(qm=1,(function(t){function n(P,V){var K=P.length;P.push(V);e:for(;0<K;){var O=K-1>>>1,z=P[O];if(0<l(z,V))P[O]=V,P[K]=z,K=O;else break e}}function s(P){return P.length===0?null:P[0]}function o(P){if(P.length===0)return null;var V=P[0],K=P.pop();if(K!==V){P[0]=K;e:for(var O=0,z=P.length,M=z>>>1;O<M;){var U=2*(O+1)-1,Y=P[U],ae=U+1,ce=P[ae];if(0>l(Y,K))ae<z&&0>l(ce,Y)?(P[O]=ce,P[ae]=K,O=ae):(P[O]=Y,P[U]=K,O=U);else if(ae<z&&0>l(ce,K))P[O]=ce,P[ae]=K,O=ae;else break e}}return V}function l(P,V){var K=P.sortIndex-V.sortIndex;return K!==0?K:P.id-V.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var y=performance;t.unstable_now=function(){return y.now()}}else{var S=Date,c=S.now();t.unstable_now=function(){return S.now()-c}}var u=[],h=[],g=1,f=null,C=3,E=!1,T=!1,w=!1,p=!1,b=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;function x(P){for(var V=s(h);V!==null;){if(V.callback===null)o(h);else if(V.startTime<=P)o(h),V.sortIndex=V.expirationTime,n(u,V);else break;V=s(h)}}function R(P){if(w=!1,x(P),!T)if(s(u)!==null)T=!0,k||(k=!0,F());else{var V=s(h);V!==null&&ee(R,V.startTime-P)}}var k=!1,D=-1,A=5,B=-1;function W(){return p?!0:!(t.unstable_now()-B<A)}function j(){if(p=!1,k){var P=t.unstable_now();B=P;var V=!0;try{e:{T=!1,w&&(w=!1,_(D),D=-1),E=!0;var K=C;try{t:{for(x(P),f=s(u);f!==null&&!(f.expirationTime>P&&W());){var O=f.callback;if(typeof O=="function"){f.callback=null,C=f.priorityLevel;var z=O(f.expirationTime<=P);if(P=t.unstable_now(),typeof z=="function"){f.callback=z,x(P),V=!0;break t}f===s(u)&&o(u),x(P)}else o(u);f=s(u)}if(f!==null)V=!0;else{var M=s(h);M!==null&&ee(R,M.startTime-P),V=!1}}break e}finally{f=null,C=K,E=!1}V=void 0}}finally{V?F():k=!1}}}var F;if(typeof m=="function")F=function(){m(j)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,Z=H.port2;H.port1.onmessage=j,F=function(){Z.postMessage(null)}}else F=function(){b(j,0)};function ee(P,V){D=b(function(){P(t.unstable_now())},V)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(P){P.callback=null},t.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<P?Math.floor(1e3/P):5},t.unstable_getCurrentPriorityLevel=function(){return C},t.unstable_next=function(P){switch(C){case 1:case 2:case 3:var V=3;break;default:V=C}var K=C;C=V;try{return P()}finally{C=K}},t.unstable_requestPaint=function(){p=!0},t.unstable_runWithPriority=function(P,V){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var K=C;C=P;try{return V()}finally{C=K}},t.unstable_scheduleCallback=function(P,V,K){var O=t.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?O+K:O):K=O,P){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=K+z,P={id:g++,callback:V,priorityLevel:P,startTime:K,expirationTime:z,sortIndex:-1},K>O?(P.sortIndex=K,n(h,P),s(u)===null&&P===s(h)&&(w?(_(D),D=-1):w=!0,ee(R,K-O))):(P.sortIndex=z,n(u,P),T||E||(T=!0,k||(k=!0,F()))),P},t.unstable_shouldYield=W,t.unstable_wrapCallback=function(P){var V=C;return function(){var K=C;C=V;try{return P.apply(this,arguments)}finally{C=K}}}})(Sd)),Sd}var Wm;function tC(){return Wm||(Wm=1,bd.exports=eC()),bd.exports}var yd={exports:{}},Ri={};var Gm;function iC(){if(Gm)return Ri;Gm=1;var t=kf();function n(u){var h="https://react.dev/errors/"+u;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}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,g){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:g}}var S=t.__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 g=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,g)},Ri.flushSync=function(u){var h=S.T,g=o.p;try{if(S.T=null,o.p=2,u)return u()}finally{S.T=h,o.p=g,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 g=h.as,f=c(g,h.crossOrigin),C=typeof h.integrity=="string"?h.integrity:void 0,E=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?o.d.S(u,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:f,integrity:C,fetchPriority:E}):g==="script"&&o.d.X(u,{crossOrigin:f,integrity:C,fetchPriority:E,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 g=c(h.as,h.crossOrigin);o.d.M(u,{crossOrigin:g,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 g=h.as,f=c(g,h.crossOrigin);o.d.L(u,g,{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 g=c(h.as,h.crossOrigin);o.d.m(u,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,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,g){return S.H.useFormState(u,h,g)},Ri.useFormStatus=function(){return S.H.useHostTransitionStatus()},Ri.version="19.2.7",Ri}var Km;function nC(){if(Km)return yd.exports;Km=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),yd.exports=iC(),yd.exports}var Vm;function rC(){if(Vm)return Io;Vm=1;var t=tC(),n=kf(),s=nC();function o(e){var i="https://react.dev/errors/"+e;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)i+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+i+" 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 i=e,r=e;if(e.alternate)for(;i.return;)i=i.return;else{e=i;do i=e,(i.flags&4098)!==0&&(r=i.return),e=i.return;while(e)}return i.tag===3?r:null}function S(e){if(e.tag===13){var i=e.memoizedState;if(i===null&&(e=e.alternate,e!==null&&(i=e.memoizedState)),i!==null)return i.dehydrated}return null}function c(e){if(e.tag===31){var i=e.memoizedState;if(i===null&&(e=e.alternate,e!==null&&(i=e.memoizedState)),i!==null)return i.dehydrated}return null}function u(e){if(y(e)!==e)throw Error(o(188))}function h(e){var i=e.alternate;if(!i){if(i=y(e),i===null)throw Error(o(188));return i!==e?null:e}for(var r=e,a=i;;){var d=r.return;if(d===null)break;var v=d.alternate;if(v===null){if(a=d.return,a!==null){r=a;continue}break}if(d.child===v.child){for(v=d.child;v;){if(v===r)return u(d),e;if(v===a)return u(d),i;v=v.sibling}throw Error(o(188))}if(r.return!==a.return)r=d,a=v;else{for(var L=!1,I=d.child;I;){if(I===r){L=!0,r=d,a=v;break}if(I===a){L=!0,a=d,r=v;break}I=I.sibling}if(!L){for(I=v.child;I;){if(I===r){L=!0,r=v,a=d;break}if(I===a){L=!0,a=v,r=d;break}I=I.sibling}if(!L)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:i}function g(e){var i=e.tag;if(i===5||i===26||i===27||i===6)return e;for(e=e.child;e!==null;){if(i=g(e),i!==null)return i;e=e.sibling}return null}var f=Object.assign,C=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),m=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),j=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=j&&e[j]||e["@@iterator"],typeof e=="function"?e:null)}var H=Symbol.for("react.client.reference");function Z(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===H?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case b:return"Profiler";case p:return"StrictMode";case R:return"Suspense";case k:return"SuspenseList";case B:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case m:return e.displayName||"Context";case _:return(e._context.displayName||"Context")+".Consumer";case x:var i=e.render;return e=e.displayName,e||(e=i.displayName||i.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return i=e.displayName||null,i!==null?i:Z(e.type)||"Memo";case A:i=e._payload,e=e._init;try{return Z(e(i))}catch{}}return null}var ee=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},O=[],z=-1;function M(e){return{current:e}}function U(e){0>z||(e.current=O[z],O[z]=null,z--)}function Y(e,i){z++,O[z]=e.current,e.current=i}var ae=M(null),ce=M(null),me=M(null),Q=M(null);function $(e,i){switch(Y(me,i),Y(ce,e),Y(ae,null),i.nodeType){case 9:case 11:e=(e=i.documentElement)&&(e=e.namespaceURI)?cm(e):0;break;default:if(e=i.tagName,i=i.namespaceURI)i=cm(i),e=um(i,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(ae),Y(ae,e)}function oe(){U(ae),U(ce),U(me)}function _e(e){e.memoizedState!==null&&Y(Q,e);var i=ae.current,r=um(i,e.type);i!==r&&(Y(ce,e),Y(ae,r))}function Se(e){ce.current===e&&(U(ae),U(ce)),Q.current===e&&(U(Q),Mo._currentValue=K)}var be,$e;function Pe(e){if(be===void 0)try{throw Error()}catch(r){var i=r.stack.trim().match(/\n( *(at )?)/);be=i&&i[1]||"",$e=-1<r.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+be+e+$e}var Ke=!1;function Ct(e,i){if(!e||Ke)return"";Ke=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(i){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 v=a.DetermineComponentFrameRoot(),L=v[0],I=v[1];if(L&&I){var G=L.split(`
4
- `),re=I.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:"")?Pe(r):""}function Be(e,i){switch(e.tag){case 26:case 27:case 5:return Pe(e.type);case 16:return Pe("Lazy");case 13:return e.child!==i&&i!==null?Pe("Suspense Fallback"):Pe("Suspense");case 19:return Pe("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 Pe("Activity");default:return""}}function Qt(e){try{var i="",r=null;do i+=Be(e,r),r=e,e=e.return;while(e);return i}catch(a){return`
7
- Error generating stack: `+a.message+`
8
- `+a.stack}}var gi=Object.prototype.hasOwnProperty,mi=t.unstable_scheduleCallback,un=t.unstable_cancelCallback,An=t.unstable_shouldYield,Jt=t.unstable_requestPaint,ct=t.unstable_now,Gt=t.unstable_getCurrentPriorityLevel,It=t.unstable_ImmediatePriority,Ht=t.unstable_UserBlockingPriority,ei=t.unstable_NormalPriority,Rn=t.unstable_LowPriority,Ti=t.unstable_IdlePriority,Zi=t.log,ht=t.unstable_setDisableYieldValue,Ii=null,Kt=null;function Vt(e){if(typeof Zi=="function"&&ht(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 kn=256,jn=262144,tr=4194304;function ti(e){var i=e&42;if(i!==0)return i;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,i,r){var a=e.pendingLanes;if(a===0)return 0;var d=0,v=e.suspendedLanes,L=e.pingedLanes;e=e.warmLanes;var I=a&134217727;return I!==0?(a=I&~v,a!==0?d=ti(a):(L&=I,L!==0?d=ti(L):r||(r=I&~e,r!==0&&(d=ti(r))))):(I=a&~v,I!==0?d=ti(I):L!==0?d=ti(L):r||(r=a&~e,r!==0&&(d=ti(r)))),d===0?0:i!==0&&i!==d&&(i&v)===0&&(v=d&-d,r=i&-i,v>=r||v===32&&(r&4194048)!==0)?i:d}function he(e,i){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&i)===0}function ve(e,i){switch(e){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 Ie(){var e=tr;return tr<<=1,(tr&62914560)===0&&(tr=4194304),e}function St(e){for(var i=[],r=0;31>r;r++)i.push(e);return i}function dt(e,i){e.pendingLanes|=i,i!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ee(e,i,r,a,d,v){var L=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 I=e.entanglements,G=e.expirationTimes,re=e.hiddenUpdates;for(r=L&~r;0<r;){var ue=31-zt(r),fe=1<<ue;I[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),v!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=v&~(L&~i))}function Ce(e,i,r){e.pendingLanes|=i,e.suspendedLanes&=~i;var a=31-zt(i);e.entangledLanes|=i,e.entanglements[a]=e.entanglements[a]|1073741824|r&261930}function He(e,i){var r=e.entangledLanes|=i;for(e=e.entanglements;r;){var a=31-zt(r),d=1<<a;d&i|e[a]&i&&(e[a]|=i),r&=~d}}function Bt(e,i){var r=i&-i;return r=(r&42)!==0?1:Qe(r),(r&(e.suspendedLanes|i))!==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=V.p;return e!==0?e:(e=window.event,e===void 0?32:Om(e.type))}function nr(e,i){var r=V.p;try{return V.p=e,i()}finally{V.p=r}}var Hi=Math.random().toString(36).slice(2),xt="__reactFiber$"+Hi,wt="__reactProps$"+Hi,Ln="__reactContainer$"+Hi,Mr="__reactEvents$"+Hi,Fs="__reactListeners$"+Hi,rr="__reactHandles$"+Hi,hs="__reactResources$"+Hi,Pn="__reactMarker$"+Hi;function De(e){delete e[xt],delete e[wt],delete e[Mr],delete e[Fs],delete e[rr]}function q(e){var i=e[xt];if(i)return i;for(var r=e.parentNode;r;){if(i=r[Ln]||r[xt]){if(r=i.alternate,i.child!==null||r!==null&&r.child!==null)for(e=mm(e);e!==null;){if(r=e[xt])return r;e=mm(e)}return i}e=r,r=e.parentNode}return null}function pe(e){if(e=e[xt]||e[Ln]){var i=e.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return e}return null}function we(e){var i=e.tag;if(i===5||i===26||i===27||i===6)return e.stateNode;throw Error(o(33))}function it(e){var i=e[hs];return i||(i=e[hs]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Ve(e){e[Pn]=!0}var Tt=new Set,$t={};function Ut(e,i){ge(e,i),ge(e+"Capture",i)}function ge(e,i){for($t[e]=i,e=0;e<i.length;e++)Tt.add(i[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]*$"),Oe={},st={};function Mt(e){return gi.call(st,e)?!0:gi.call(Oe,e)?!1:Le.test(e)?st[e]=!0:(Oe[e]=!0,!1)}function Ai(e,i,r){if(Mt(i))if(r===null)e.removeAttribute(i);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(i);return;case"boolean":var a=i.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(i);return}}e.setAttribute(i,""+r)}}function Qi(e,i,r){if(r===null)e.removeAttribute(i);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttribute(i,""+r)}}function zi(e,i,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(i,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 Ji(e){var i=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function hl(e,i,r){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,i);if(!e.hasOwnProperty(i)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var d=a.get,v=a.set;return Object.defineProperty(e,i,{configurable:!0,get:function(){return d.call(this)},set:function(L){r=""+L,v.call(this,L)}}),Object.defineProperty(e,i,{enumerable:a.enumerable}),{getValue:function(){return r},setValue:function(L){r=""+L},stopTracking:function(){e._valueTracker=null,delete e[i]}}}}function qs(e){if(!e._valueTracker){var i=Ji(e)?"checked":"value";e._valueTracker=hl(e,i,""+e[i])}}function Fa(e){if(!e)return!1;var i=e._valueTracker;if(!i)return!0;var r=i.getValue(),a="";return e&&(a=Ji(e)?e.checked?"true":"false":e.value),e=a,e!==r?(i.setValue(e),!0):!1}function Ws(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 _u=/[\n"\\]/g;function $i(e){return e.replace(_u,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function qa(e,i,r,a,d,v,L,I){e.name="",L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?e.type=L:e.removeAttribute("type"),i!=null?L==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+Et(i)):e.value!==""+Et(i)&&(e.value=""+Et(i)):L!=="submit"&&L!=="reset"||e.removeAttribute("value"),i!=null?Gs(e,L,Et(i)):r!=null?Gs(e,L,Et(r)):a!=null&&e.removeAttribute("value"),d==null&&v!=null&&(e.defaultChecked=!!v),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?e.name=""+Et(I):e.removeAttribute("name")}function ds(e,i,r,a,d,v,L,I){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.type=v),i!=null||r!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){qs(e);return}r=r!=null?""+Et(r):"",i=i!=null?""+Et(i):r,I||i===e.value||(e.value=i),e.defaultValue=i}a=a??d,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=I?e.checked:!!a,e.defaultChecked=!!a,L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"&&(e.name=L),qs(e)}function Gs(e,i,r){i==="number"&&Ws(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function bi(e,i,r,a){if(e=e.options,i){i={};for(var d=0;d<r.length;d++)i["$"+r[d]]=!0;for(r=0;r<e.length;r++)d=i.hasOwnProperty("$"+e[r].value),e[r].selected!==d&&(e[r].selected=d),d&&a&&(e[r].defaultSelected=!0)}else{for(r=""+Et(r),i=null,d=0;d<e.length;d++){if(e[d].value===r){e[d].selected=!0,a&&(e[d].defaultSelected=!0);return}i!==null||e[d].disabled||(i=e[d])}i!==null&&(i.selected=!0)}}function dl(e,i,r){if(i!=null&&(i=""+Et(i),i!==e.value&&(e.value=i),r==null)){e.defaultValue!==i&&(e.defaultValue=i);return}e.defaultValue=r!=null?""+Et(r):""}function Ks(e,i,r,a){if(i==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=""),i=r}r=Et(i),e.defaultValue=r,a=e.textContent,a===r&&a!==""&&a!==null&&(e.value=a),qs(e)}function Ue(e,i){if(i){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=i;return}}e.textContent=i}var fl=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,i,r){var a=i.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?a?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="":a?e.setProperty(i,r):typeof r!="number"||r===0||fl.has(i)?i==="float"?e.cssFloat=r:e[i]=(""+r).trim():e[i]=r+"px"}function ft(e,i,r){if(i!=null&&typeof i!="object")throw Error(o(62));if(e=e.style,r!=null){for(var a in r)!r.hasOwnProperty(a)||i!=null&&i.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var d in i)a=i[d],i.hasOwnProperty(d)&&r[d]!==a&&ii(e,d,a)}else for(var v in i)i.hasOwnProperty(v)&&ii(e,v,i[v])}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"]]),Wa=/^[\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 Wa.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 i=pe(e);if(i&&(e=i.stateNode)){var r=e[wt]||null;e:switch(e=i.stateNode,i.type){case"input":if(qa(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),i=r.name,r.type==="radio"&&i!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+$i(""+i)+'"][type="radio"]'),i=0;i<r.length;i++){var a=r[i];if(a!==e&&a.form===e.form){var d=a[wt]||null;if(!d)throw Error(o(90));qa(a,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(i=0;i<r.length;i++)a=r[i],a.form===e.form&&Fa(a)}break e;case"textarea":dl(e,r.value,r.defaultValue);break e;case"select":i=r.value,i!=null&&bi(e,!!r.multiple,i,!1)}}}var Ga=!1;function pl(e,i,r){if(Ga)return e(i,r);Ga=!0;try{var a=e(i);return a}finally{if(Ga=!1,(Je!==null||Nt!==null)&&(tc(),Je&&(i=Je,e=Nt,Nt=Je=null,hn(i),e)))for(i=0;i<e.length;i++)hn(e[i])}}function Ka(e,i){var r=e.stateNode;if(r===null)return null;var a=r[wt]||null;if(a===null)return null;r=a[i];e:switch(i){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,i,typeof r));return r}var ar=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gu=!1;if(ar)try{var Va={};Object.defineProperty(Va,"passive",{get:function(){gu=!0}}),window.addEventListener("test",Va,Va),window.removeEventListener("test",Va,Va)}catch{gu=!1}var Br=null,mu=null,_l=null;function up(){if(_l)return _l;var e,i=mu,r=i.length,a,d="value"in Br?Br.value:Br.textContent,v=d.length;for(e=0;e<r&&i[e]===d[e];e++);var L=r-e;for(a=1;a<=L&&i[r-a]===d[v-a];a++);return _l=d.slice(e,1<a?1-a:void 0)}function gl(e){var i=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&i===13&&(e=13)):e=i,e===10&&(e=13),32<=e||e===13?e:0}function ml(){return!0}function hp(){return!1}function Ui(e){function i(r,a,d,v,L){this._reactName=r,this._targetInst=d,this.type=a,this.nativeEvent=v,this.target=L,this.currentTarget=null;for(var I in e)e.hasOwnProperty(I)&&(r=e[I],this[I]=r?r(v):v[I]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?ml:hp,this.isPropagationStopped=hp,this}return f(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=ml)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=ml)},persist:function(){},isPersistent:ml}),i}var fs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vl=Ui(fs),Ya=f({},fs,{view:0,detail:0}),Vb=Ui(Ya),vu,bu,Xa,bl=f({},Ya,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yu,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!==Xa&&(Xa&&e.type==="mousemove"?(vu=e.screenX-Xa.screenX,bu=e.screenY-Xa.screenY):bu=vu=0,Xa=e),vu)},movementY:function(e){return"movementY"in e?e.movementY:bu}}),dp=Ui(bl),Yb=f({},bl,{dataTransfer:0}),Xb=Ui(Yb),Zb=f({},Ya,{relatedTarget:0}),Su=Ui(Zb),Qb=f({},fs,{animationName:0,elapsedTime:0,pseudoElement:0}),Jb=Ui(Qb),eS=f({},fs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),tS=Ui(eS),iS=f({},fs,{data:0}),fp=Ui(iS),nS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},rS={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"},sS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function aS(e){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(e):(e=sS[e])?!!i[e]:!1}function yu(){return aS}var oS=f({},Ya,{key:function(e){if(e.key){var i=nS[e.key]||e.key;if(i!=="Unidentified")return i}return e.type==="keypress"?(e=gl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?rS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yu,charCode:function(e){return e.type==="keypress"?gl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?gl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),lS=Ui(oS),cS=f({},bl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pp=Ui(cS),uS=f({},Ya,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yu}),hS=Ui(uS),dS=f({},fs,{propertyName:0,elapsedTime:0,pseudoElement:0}),fS=Ui(dS),pS=f({},bl,{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}),_S=Ui(pS),gS=f({},fs,{newState:0,oldState:0}),mS=Ui(gS),vS=[9,13,27,32],Cu=ar&&"CompositionEvent"in window,Za=null;ar&&"documentMode"in document&&(Za=document.documentMode);var bS=ar&&"TextEvent"in window&&!Za,_p=ar&&(!Cu||Za&&8<Za&&11>=Za),gp=" ",mp=!1;function vp(e,i){switch(e){case"keyup":return vS.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Vs=!1;function SS(e,i){switch(e){case"compositionend":return bp(i);case"keypress":return i.which!==32?null:(mp=!0,gp);case"textInput":return e=i.data,e===gp&&mp?null:e;default:return null}}function yS(e,i){if(Vs)return e==="compositionend"||!Cu&&vp(e,i)?(e=up(),_l=mu=Br=null,Vs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return _p&&i.locale!=="ko"?null:i.data;default:return null}}var CS={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 Sp(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i==="input"?!!CS[e.type]:i==="textarea"}function yp(e,i,r,a){Je?Nt?Nt.push(a):Nt=[a]:Je=a,i=lc(i,"onChange"),0<i.length&&(r=new vl("onChange","change",null,r,a),e.push({event:r,listeners:i}))}var Qa=null,Ja=null;function wS(e){nm(e,0)}function Sl(e){var i=we(e);if(Fa(i))return e}function Cp(e,i){if(e==="change")return i}var wp=!1;if(ar){var wu;if(ar){var Eu="oninput"in document;if(!Eu){var Ep=document.createElement("div");Ep.setAttribute("oninput","return;"),Eu=typeof Ep.oninput=="function"}wu=Eu}else wu=!1;wp=wu&&(!document.documentMode||9<document.documentMode)}function xp(){Qa&&(Qa.detachEvent("onpropertychange",Tp),Ja=Qa=null)}function Tp(e){if(e.propertyName==="value"&&Sl(Ja)){var i=[];yp(i,Ja,e,Fe(e)),pl(wS,i)}}function ES(e,i,r){e==="focusin"?(xp(),Qa=i,Ja=r,Qa.attachEvent("onpropertychange",Tp)):e==="focusout"&&xp()}function xS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Sl(Ja)}function TS(e,i){if(e==="click")return Sl(i)}function AS(e,i){if(e==="input"||e==="change")return Sl(i)}function RS(e,i){return e===i&&(e!==0||1/e===1/i)||e!==e&&i!==i}var en=typeof Object.is=="function"?Object.is:RS;function eo(e,i){if(en(e,i))return!0;if(typeof e!="object"||e===null||typeof i!="object"||i===null)return!1;var r=Object.keys(e),a=Object.keys(i);if(r.length!==a.length)return!1;for(a=0;a<r.length;a++){var d=r[a];if(!gi.call(i,d)||!en(e[d],i[d]))return!1}return!0}function Ap(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Rp(e,i){var r=Ap(e);e=0;for(var a;r;){if(r.nodeType===3){if(a=e+r.textContent.length,e<=i&&a>=i)return{node:r,offset:i-e};e=a}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ap(r)}}function kp(e,i){return e&&i?e===i?!0:e&&e.nodeType===3?!1:i&&i.nodeType===3?kp(e,i.parentNode):"contains"in e?e.contains(i):e.compareDocumentPosition?!!(e.compareDocumentPosition(i)&16):!1:!1}function Lp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var i=Ws(e.document);i instanceof e.HTMLIFrameElement;){try{var r=typeof i.contentWindow.location.href=="string"}catch{r=!1}if(r)e=i.contentWindow;else break;i=Ws(e.document)}return i}function xu(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i&&(i==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||i==="textarea"||e.contentEditable==="true")}var kS=ar&&"documentMode"in document&&11>=document.documentMode,Ys=null,Tu=null,to=null,Au=!1;function Mp(e,i,r){var a=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Au||Ys==null||Ys!==Ws(a)||(a=Ys,"selectionStart"in a&&xu(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}),to&&eo(to,a)||(to=a,a=lc(Tu,"onSelect"),0<a.length&&(i=new vl("onSelect","select",null,i,r),e.push({event:i,listeners:a}),i.target=Ys)))}function ps(e,i){var r={};return r[e.toLowerCase()]=i.toLowerCase(),r["Webkit"+e]="webkit"+i,r["Moz"+e]="moz"+i,r}var Xs={animationend:ps("Animation","AnimationEnd"),animationiteration:ps("Animation","AnimationIteration"),animationstart:ps("Animation","AnimationStart"),transitionrun:ps("Transition","TransitionRun"),transitionstart:ps("Transition","TransitionStart"),transitioncancel:ps("Transition","TransitionCancel"),transitionend:ps("Transition","TransitionEnd")},Ru={},Dp={};ar&&(Dp=document.createElement("div").style,"AnimationEvent"in window||(delete Xs.animationend.animation,delete Xs.animationiteration.animation,delete Xs.animationstart.animation),"TransitionEvent"in window||delete Xs.transitionend.transition);function _s(e){if(Ru[e])return Ru[e];if(!Xs[e])return e;var i=Xs[e],r;for(r in i)if(i.hasOwnProperty(r)&&r in Dp)return Ru[e]=i[r];return e}var Op=_s("animationend"),Bp=_s("animationiteration"),Np=_s("animationstart"),LS=_s("transitionrun"),MS=_s("transitionstart"),DS=_s("transitioncancel"),Ip=_s("transitionend"),Hp=new Map,ku="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(" ");ku.push("scrollEnd");function Mn(e,i){Hp.set(e,i),Ut(i,[e])}var yl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=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(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},dn=[],Zs=0,Lu=0;function Cl(){for(var e=Zs,i=Lu=Zs=0;i<e;){var r=dn[i];dn[i++]=null;var a=dn[i];dn[i++]=null;var d=dn[i];dn[i++]=null;var v=dn[i];if(dn[i++]=null,a!==null&&d!==null){var L=a.pending;L===null?d.next=d:(d.next=L.next,L.next=d),a.pending=d}v!==0&&zp(r,d,v)}}function wl(e,i,r,a){dn[Zs++]=e,dn[Zs++]=i,dn[Zs++]=r,dn[Zs++]=a,Lu|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Mu(e,i,r,a){return wl(e,i,r,a),El(e)}function gs(e,i){return wl(e,null,null,i),El(e)}function zp(e,i,r){e.lanes|=r;var a=e.alternate;a!==null&&(a.lanes|=r);for(var d=!1,v=e.return;v!==null;)v.childLanes|=r,a=v.alternate,a!==null&&(a.childLanes|=r),v.tag===22&&(e=v.stateNode,e===null||e._visibility&1||(d=!0)),e=v,v=v.return;return e.tag===3?(v=e.stateNode,d&&i!==null&&(d=31-zt(r),e=v.hiddenUpdates,a=e[d],a===null?e[d]=[i]:a.push(i),i.lane=r|536870912),v):null}function El(e){if(50<Eo)throw Eo=0,Uh=null,Error(o(185));for(var i=e.return;i!==null;)e=i,i=e.return;return e.tag===3?e.stateNode:null}var Qs={};function OS(e,i,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=i,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 tn(e,i,r,a){return new OS(e,i,r,a)}function Du(e){return e=e.prototype,!(!e||!e.isReactComponent)}function or(e,i){var r=e.alternate;return r===null?(r=tn(e.tag,i,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=i,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,i=e.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function $p(e,i){e.flags&=65011714;var r=e.alternate;return r===null?(e.childLanes=0,e.lanes=i,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,i=r.dependencies,e.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),e}function xl(e,i,r,a,d,v){var L=0;if(a=e,typeof e=="function")Du(e)&&(L=1);else if(typeof e=="string")L=zy(e,r,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case B:return e=tn(31,r,i,d),e.elementType=B,e.lanes=v,e;case w:return ms(r.children,d,v,i);case p:L=8,d|=24;break;case b:return e=tn(12,r,i,d|2),e.elementType=b,e.lanes=v,e;case R:return e=tn(13,r,i,d),e.elementType=R,e.lanes=v,e;case k:return e=tn(19,r,i,d),e.elementType=k,e.lanes=v,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case m:L=10;break e;case _:L=9;break e;case x:L=11;break e;case D:L=14;break e;case A:L=16,a=null;break e}L=29,r=Error(o(130,e===null?"null":typeof e,"")),a=null}return i=tn(L,r,i,d),i.elementType=e,i.type=a,i.lanes=v,i}function ms(e,i,r,a){return e=tn(7,e,a,i),e.lanes=r,e}function Ou(e,i,r){return e=tn(6,e,null,i),e.lanes=r,e}function Up(e){var i=tn(18,null,null,0);return i.stateNode=e,i}function Bu(e,i,r){return i=tn(4,e.children!==null?e.children:[],e.key,i),i.lanes=r,i.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},i}var jp=new WeakMap;function fn(e,i){if(typeof e=="object"&&e!==null){var r=jp.get(e);return r!==void 0?r:(i={value:e,source:i,stack:Qt(i)},jp.set(e,i),i)}return{value:e,source:i,stack:Qt(i)}}var Js=[],ea=0,Tl=null,io=0,pn=[],_n=0,Nr=null,Fn=1,qn="";function lr(e,i){Js[ea++]=io,Js[ea++]=Tl,Tl=e,io=i}function Pp(e,i,r){pn[_n++]=Fn,pn[_n++]=qn,pn[_n++]=Nr,Nr=e;var a=Fn;e=qn;var d=32-zt(a)-1;a&=~(1<<d),r+=1;var v=32-zt(i)+d;if(30<v){var L=d-d%5;v=(a&(1<<L)-1).toString(32),a>>=L,d-=L,Fn=1<<32-zt(i)+d|r<<d|a,qn=v+e}else Fn=1<<v|r<<d|a,qn=e}function Nu(e){e.return!==null&&(lr(e,1),Pp(e,1,0))}function Iu(e){for(;e===Tl;)Tl=Js[--ea],Js[ea]=null,io=Js[--ea],Js[ea]=null;for(;e===Nr;)Nr=pn[--_n],pn[_n]=null,qn=pn[--_n],pn[_n]=null,Fn=pn[--_n],pn[_n]=null}function Fp(e,i){pn[_n++]=Fn,pn[_n++]=qn,pn[_n++]=Nr,Fn=i.id,qn=i.overflow,Nr=e}var Si=null,At=null,nt=!1,Ir=null,gn=!1,Hu=Error(o(519));function Hr(e){var i=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw no(fn(i,e)),Hu}function qp(e){var i=e.stateNode,r=e.type,a=e.memoizedProps;switch(i[xt]=e,i[wt]=a,r){case"dialog":Xe("cancel",i),Xe("close",i);break;case"iframe":case"object":case"embed":Xe("load",i);break;case"video":case"audio":for(r=0;r<To.length;r++)Xe(To[r],i);break;case"source":Xe("error",i);break;case"img":case"image":case"link":Xe("error",i),Xe("load",i);break;case"details":Xe("toggle",i);break;case"input":Xe("invalid",i),ds(i,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Xe("invalid",i);break;case"textarea":Xe("invalid",i),Ks(i,a.value,a.defaultValue,a.children)}r=a.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||i.textContent===""+r||a.suppressHydrationWarning===!0||om(i.textContent,r)?(a.popover!=null&&(Xe("beforetoggle",i),Xe("toggle",i)),a.onScroll!=null&&Xe("scroll",i),a.onScrollEnd!=null&&Xe("scrollend",i),a.onClick!=null&&(i.onclick=ye),i=!0):i=!1,i||Hr(e,!0)}function Wp(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 ta(e){if(e!==Si)return!1;if(!nt)return Wp(e),nt=!0,!1;var i=e.tag,r;if((r=i!==3&&i!==27)&&((r=i===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||td(e.type,e.memoizedProps)),r=!r),r&&At&&Hr(e),Wp(e),i===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));At=gm(e)}else if(i===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));At=gm(e)}else i===27?(i=At,Zr(e.type)?(e=ad,ad=null,At=e):At=i):At=Si?vn(e.stateNode.nextSibling):null;return!0}function vs(){At=Si=null,nt=!1}function zu(){var e=Ir;return e!==null&&(qi===null?qi=e:qi.push.apply(qi,e),Ir=null),e}function no(e){Ir===null?Ir=[e]:Ir.push(e)}var $u=M(null),bs=null,cr=null;function zr(e,i,r){Y($u,i._currentValue),i._currentValue=r}function ur(e){e._currentValue=$u.current,U($u)}function Uu(e,i,r){for(;e!==null;){var a=e.alternate;if((e.childLanes&i)!==i?(e.childLanes|=i,a!==null&&(a.childLanes|=i)):a!==null&&(a.childLanes&i)!==i&&(a.childLanes|=i),e===r)break;e=e.return}}function ju(e,i,r,a){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var v=d.dependencies;if(v!==null){var L=d.child;v=v.firstContext;e:for(;v!==null;){var I=v;v=d;for(var G=0;G<i.length;G++)if(I.context===i[G]){v.lanes|=r,I=v.alternate,I!==null&&(I.lanes|=r),Uu(v.return,r,e),a||(L=null);break e}v=I.next}}else if(d.tag===18){if(L=d.return,L===null)throw Error(o(341));L.lanes|=r,v=L.alternate,v!==null&&(v.lanes|=r),Uu(L,r,e),L=null}else L=d.child;if(L!==null)L.return=d;else for(L=d;L!==null;){if(L===e){L=null;break}if(d=L.sibling,d!==null){d.return=L.return,L=d;break}L=L.return}d=L}}function ia(e,i,r,a){e=null;for(var d=i,v=!1;d!==null;){if(!v){if((d.flags&524288)!==0)v=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var L=d.alternate;if(L===null)throw Error(o(387));if(L=L.memoizedProps,L!==null){var I=d.type;en(d.pendingProps.value,L.value)||(e!==null?e.push(I):e=[I])}}else if(d===Q.current){if(L=d.alternate,L===null)throw Error(o(387));L.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Mo):e=[Mo])}d=d.return}e!==null&&ju(i,e,r,a),i.flags|=262144}function Al(e){for(e=e.firstContext;e!==null;){if(!en(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 Gp(bs,e)}function Rl(e,i){return bs===null&&Ss(e),Gp(e,i)}function Gp(e,i){var r=i._currentValue;if(i={context:i,memoizedValue:r,next:null},cr===null){if(e===null)throw Error(o(308));cr=i,e.dependencies={lanes:0,firstContext:i},e.flags|=524288}else cr=cr.next=i;return r}var BS=typeof AbortController<"u"?AbortController:function(){var e=[],i=this.signal={aborted:!1,addEventListener:function(r,a){e.push(a)}};this.abort=function(){i.aborted=!0,e.forEach(function(r){return r()})}},NS=t.unstable_scheduleCallback,IS=t.unstable_NormalPriority,ni={$$typeof:m,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pu(){return{controller:new BS,data:new Map,refCount:0}}function ro(e){e.refCount--,e.refCount===0&&NS(IS,function(){e.controller.abort()})}var so=null,Fu=0,na=0,ra=null;function HS(e,i){if(so===null){var r=so=[];Fu=0,na=Gh(),ra={status:"pending",value:void 0,then:function(a){r.push(a)}}}return Fu++,i.then(Kp,Kp),i}function Kp(){if(--Fu===0&&so!==null){ra!==null&&(ra.status="fulfilled");var e=so;so=null,na=0,ra=null;for(var i=0;i<e.length;i++)(0,e[i])()}}function zS(e,i){var r=[],a={status:"pending",value:null,reason:null,then:function(d){r.push(d)}};return e.then(function(){a.status="fulfilled",a.value=i;for(var d=0;d<r.length;d++)(0,r[d])(i)},function(d){for(a.status="rejected",a.reason=d,d=0;d<r.length;d++)(0,r[d])(void 0)}),a}var Vp=P.S;P.S=function(e,i){Mg=ct(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&HS(e,i),Vp!==null&&Vp(e,i)};var ys=M(null);function qu(){var e=ys.current;return e!==null?e:yt.pooledCache}function kl(e,i){i===null?Y(ys,ys.current):Y(ys,i.pool)}function Yp(){var e=qu();return e===null?null:{parent:ni._currentValue,pool:e}}var sa=Error(o(460)),Wu=Error(o(474)),Ll=Error(o(542)),Ml={then:function(){}};function Xp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Zp(e,i,r){switch(r=e[r],r===void 0?e.push(i):r!==i&&(i.then(ye,ye),i=r),i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,Jp(e),e;default:if(typeof i.status=="string")i.then(ye,ye);else{if(e=yt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=i,e.status="pending",e.then(function(a){if(i.status==="pending"){var d=i;d.status="fulfilled",d.value=a}},function(a){if(i.status==="pending"){var d=i;d.status="rejected",d.reason=a}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,Jp(e),e}throw ws=i,sa}}function Cs(e){try{var i=e._init;return i(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(ws=r,sa):r}}var ws=null;function Qp(){if(ws===null)throw Error(o(459));var e=ws;return ws=null,e}function Jp(e){if(e===sa||e===Ll)throw Error(o(483))}var aa=null,ao=0;function Dl(e){var i=ao;return ao+=1,aa===null&&(aa=[]),Zp(aa,e,i)}function oo(e,i){i=i.props.ref,e.ref=i!==void 0?i:null}function Ol(e,i){throw i.$$typeof===C?Error(o(525)):(e=Object.prototype.toString.call(i),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":e)))}function e_(e){function i(ie,J){if(e){var ne=ie.deletions;ne===null?(ie.deletions=[J],ie.flags|=16):ne.push(J)}}function r(ie,J){if(!e)return null;for(;J!==null;)i(ie,J),J=J.sibling;return null}function a(ie){for(var J=new Map;ie!==null;)ie.key!==null?J.set(ie.key,ie):J.set(ie.index,ie),ie=ie.sibling;return J}function d(ie,J){return ie=or(ie,J),ie.index=0,ie.sibling=null,ie}function v(ie,J,ne){return ie.index=ne,e?(ne=ie.alternate,ne!==null?(ne=ne.index,ne<J?(ie.flags|=67108866,J):ne):(ie.flags|=67108866,J)):(ie.flags|=1048576,J)}function L(ie){return e&&ie.alternate===null&&(ie.flags|=67108866),ie}function I(ie,J,ne,de){return J===null||J.tag!==6?(J=Ou(ne,ie.mode,de),J.return=ie,J):(J=d(J,ne),J.return=ie,J)}function G(ie,J,ne,de){var Ne=ne.type;return Ne===w?ue(ie,J,ne.props.children,de,ne.key):J!==null&&(J.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===A&&Cs(Ne)===J.type)?(J=d(J,ne.props),oo(J,ne),J.return=ie,J):(J=xl(ne.type,ne.key,ne.props,null,ie.mode,de),oo(J,ne),J.return=ie,J)}function re(ie,J,ne,de){return J===null||J.tag!==4||J.stateNode.containerInfo!==ne.containerInfo||J.stateNode.implementation!==ne.implementation?(J=Bu(ne,ie.mode,de),J.return=ie,J):(J=d(J,ne.children||[]),J.return=ie,J)}function ue(ie,J,ne,de,Ne){return J===null||J.tag!==7?(J=ms(ne,ie.mode,de,Ne),J.return=ie,J):(J=d(J,ne),J.return=ie,J)}function fe(ie,J,ne){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=Ou(""+J,ie.mode,ne),J.return=ie,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case E:return ne=xl(J.type,J.key,J.props,null,ie.mode,ne),oo(ne,J),ne.return=ie,ne;case T:return J=Bu(J,ie.mode,ne),J.return=ie,J;case A:return J=Cs(J),fe(ie,J,ne)}if(ee(J)||F(J))return J=ms(J,ie.mode,ne,null),J.return=ie,J;if(typeof J.then=="function")return fe(ie,Dl(J),ne);if(J.$$typeof===m)return fe(ie,Rl(ie,J),ne);Ol(ie,J)}return null}function se(ie,J,ne,de){var Ne=J!==null?J.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return Ne!==null?null:I(ie,J,""+ne,de);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case E:return ne.key===Ne?G(ie,J,ne,de):null;case T:return ne.key===Ne?re(ie,J,ne,de):null;case A:return ne=Cs(ne),se(ie,J,ne,de)}if(ee(ne)||F(ne))return Ne!==null?null:ue(ie,J,ne,de,null);if(typeof ne.then=="function")return se(ie,J,Dl(ne),de);if(ne.$$typeof===m)return se(ie,J,Rl(ie,ne),de);Ol(ie,ne)}return null}function le(ie,J,ne,de,Ne){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return ie=ie.get(ne)||null,I(J,ie,""+de,Ne);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case E:return ie=ie.get(de.key===null?ne:de.key)||null,G(J,ie,de,Ne);case T:return ie=ie.get(de.key===null?ne:de.key)||null,re(J,ie,de,Ne);case A:return de=Cs(de),le(ie,J,ne,de,Ne)}if(ee(de)||F(de))return ie=ie.get(ne)||null,ue(J,ie,de,Ne,null);if(typeof de.then=="function")return le(ie,J,ne,Dl(de),Ne);if(de.$$typeof===m)return le(ie,J,ne,Rl(J,de),Ne);Ol(J,de)}return null}function xe(ie,J,ne,de){for(var Ne=null,at=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 ot=se(ie,Re,ne[We],de);if(ot===null){Re===null&&(Re=tt);break}e&&Re&&ot.alternate===null&&i(ie,Re),J=v(ot,J,We),at===null?Ne=ot:at.sibling=ot,at=ot,Re=tt}if(We===ne.length)return r(ie,Re),nt&&lr(ie,We),Ne;if(Re===null){for(;We<ne.length;We++)Re=fe(ie,ne[We],de),Re!==null&&(J=v(Re,J,We),at===null?Ne=Re:at.sibling=Re,at=Re);return nt&&lr(ie,We),Ne}for(Re=a(Re);We<ne.length;We++)tt=le(Re,ie,We,ne[We],de),tt!==null&&(e&&tt.alternate!==null&&Re.delete(tt.key===null?We:tt.key),J=v(tt,J,We),at===null?Ne=tt:at.sibling=tt,at=tt);return e&&Re.forEach(function(is){return i(ie,is)}),nt&&lr(ie,We),Ne}function ze(ie,J,ne,de){if(ne==null)throw Error(o(151));for(var Ne=null,at=null,Re=J,We=J=0,tt=null,ot=ne.next();Re!==null&&!ot.done;We++,ot=ne.next()){Re.index>We?(tt=Re,Re=null):tt=Re.sibling;var is=se(ie,Re,ot.value,de);if(is===null){Re===null&&(Re=tt);break}e&&Re&&is.alternate===null&&i(ie,Re),J=v(is,J,We),at===null?Ne=is:at.sibling=is,at=is,Re=tt}if(ot.done)return r(ie,Re),nt&&lr(ie,We),Ne;if(Re===null){for(;!ot.done;We++,ot=ne.next())ot=fe(ie,ot.value,de),ot!==null&&(J=v(ot,J,We),at===null?Ne=ot:at.sibling=ot,at=ot);return nt&&lr(ie,We),Ne}for(Re=a(Re);!ot.done;We++,ot=ne.next())ot=le(Re,ie,We,ot.value,de),ot!==null&&(e&&ot.alternate!==null&&Re.delete(ot.key===null?We:ot.key),J=v(ot,J,We),at===null?Ne=ot:at.sibling=ot,at=ot);return e&&Re.forEach(function(Yy){return i(ie,Yy)}),nt&&lr(ie,We),Ne}function vt(ie,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 E:e:{for(var Ne=ne.key;J!==null;){if(J.key===Ne){if(Ne=ne.type,Ne===w){if(J.tag===7){r(ie,J.sibling),de=d(J,ne.props.children),de.return=ie,ie=de;break e}}else if(J.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===A&&Cs(Ne)===J.type){r(ie,J.sibling),de=d(J,ne.props),oo(de,ne),de.return=ie,ie=de;break e}r(ie,J);break}else i(ie,J);J=J.sibling}ne.type===w?(de=ms(ne.props.children,ie.mode,de,ne.key),de.return=ie,ie=de):(de=xl(ne.type,ne.key,ne.props,null,ie.mode,de),oo(de,ne),de.return=ie,ie=de)}return L(ie);case T:e:{for(Ne=ne.key;J!==null;){if(J.key===Ne)if(J.tag===4&&J.stateNode.containerInfo===ne.containerInfo&&J.stateNode.implementation===ne.implementation){r(ie,J.sibling),de=d(J,ne.children||[]),de.return=ie,ie=de;break e}else{r(ie,J);break}else i(ie,J);J=J.sibling}de=Bu(ne,ie.mode,de),de.return=ie,ie=de}return L(ie);case A:return ne=Cs(ne),vt(ie,J,ne,de)}if(ee(ne))return xe(ie,J,ne,de);if(F(ne)){if(Ne=F(ne),typeof Ne!="function")throw Error(o(150));return ne=Ne.call(ne),ze(ie,J,ne,de)}if(typeof ne.then=="function")return vt(ie,J,Dl(ne),de);if(ne.$$typeof===m)return vt(ie,J,Rl(ie,ne),de);Ol(ie,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,J!==null&&J.tag===6?(r(ie,J.sibling),de=d(J,ne),de.return=ie,ie=de):(r(ie,J),de=Ou(ne,ie.mode,de),de.return=ie,ie=de),L(ie)):r(ie,J)}return function(ie,J,ne,de){try{ao=0;var Ne=vt(ie,J,ne,de);return aa=null,Ne}catch(Re){if(Re===sa||Re===Ll)throw Re;var at=tn(29,Re,null,ie.mode);return at.lanes=de,at.return=ie,at}}}var Es=e_(!0),t_=e_(!1),$r=!1;function Gu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ku(e,i){e=e.updateQueue,i.updateQueue===e&&(i.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 jr(e,i,r){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ut&2)!==0){var d=a.pending;return d===null?i.next=i:(i.next=d.next,d.next=i),a.pending=i,i=El(e),zp(e,null,r),i}return wl(e,a,i,r),El(e)}function lo(e,i,r){if(i=i.updateQueue,i!==null&&(i=i.shared,(r&4194048)!==0)){var a=i.lanes;a&=e.pendingLanes,r|=a,i.lanes=r,He(e,r)}}function Vu(e,i){var r=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,r===a)){var d=null,v=null;if(r=r.firstBaseUpdate,r!==null){do{var L={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};v===null?d=v=L:v=v.next=L,r=r.next}while(r!==null);v===null?d=v=i:v=v.next=i}else d=v=i;r={baseState:a.baseState,firstBaseUpdate:d,lastBaseUpdate:v,shared:a.shared,callbacks:a.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=i:e.next=i,r.lastBaseUpdate=i}var Yu=!1;function co(){if(Yu){var e=ra;if(e!==null)throw e}}function uo(e,i,r,a){Yu=!1;var d=e.updateQueue;$r=!1;var v=d.firstBaseUpdate,L=d.lastBaseUpdate,I=d.shared.pending;if(I!==null){d.shared.pending=null;var G=I,re=G.next;G.next=null,L===null?v=re:L.next=re,L=G;var ue=e.alternate;ue!==null&&(ue=ue.updateQueue,I=ue.lastBaseUpdate,I!==L&&(I===null?ue.firstBaseUpdate=re:I.next=re,ue.lastBaseUpdate=G))}if(v!==null){var fe=d.baseState;L=0,ue=re=G=null,I=v;do{var se=I.lane&-536870913,le=se!==I.lane;if(le?(et&se)===se:(a&se)===se){se!==0&&se===na&&(Yu=!0),ue!==null&&(ue=ue.next={lane:0,tag:I.tag,payload:I.payload,callback:null,next:null});e:{var xe=e,ze=I;se=i;var vt=r;switch(ze.tag){case 1:if(xe=ze.payload,typeof xe=="function"){fe=xe.call(vt,fe,se);break e}fe=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=ze.payload,se=typeof xe=="function"?xe.call(vt,fe,se):xe,se==null)break e;fe=f({},fe,se);break e;case 2:$r=!0}}se=I.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:I.tag,payload:I.payload,callback:I.callback,next:null},ue===null?(re=ue=le,G=fe):ue=ue.next=le,L|=se;if(I=I.next,I===null){if(I=d.shared.pending,I===null)break;le=I,I=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,v===null&&(d.shared.lanes=0),Gr|=L,e.lanes=L,e.memoizedState=fe}}function i_(e,i){if(typeof e!="function")throw Error(o(191,e));e.call(i)}function n_(e,i){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)i_(r[e],i)}var oa=M(null),Bl=M(0);function r_(e,i){e=br,Y(Bl,e),Y(oa,i),br=e|i.baseLanes}function Xu(){Y(Bl,br),Y(oa,oa.current)}function Zu(){br=Bl.current,U(oa),U(Bl)}var nn=M(null),mn=null;function Pr(e){var i=e.alternate;Y(Yt,Yt.current&1),Y(nn,e),mn===null&&(i===null||oa.current!==null||i.memoizedState!==null)&&(mn=e)}function Qu(e){Y(Yt,Yt.current),Y(nn,e),mn===null&&(mn=e)}function s_(e){e.tag===22?(Y(Yt,Yt.current),Y(nn,e),mn===null&&(mn=e)):Fr()}function Fr(){Y(Yt,Yt.current),Y(nn,nn.current)}function rn(e){U(nn),mn===e&&(mn=null),U(Yt)}var Yt=M(0);function Nl(e){for(var i=e;i!==null;){if(i.tag===13){var r=i.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||rd(r)||sd(r)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break;for(;i.sibling===null;){if(i.return===null||i.return===e)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var hr=0,qe=null,gt=null,ri=null,Il=!1,la=!1,xs=!1,Hl=0,ho=0,ca=null,$S=0;function jt(){throw Error(o(321))}function Ju(e,i){if(i===null)return!1;for(var r=0;r<i.length&&r<e.length;r++)if(!en(e[r],i[r]))return!1;return!0}function eh(e,i,r,a,d,v){return hr=v,qe=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,P.H=e===null||e.memoizedState===null?P_:_h,xs=!1,v=r(a,d),xs=!1,la&&(v=o_(i,r,a,d)),a_(e),v}function a_(e){P.H=_o;var i=gt!==null&&gt.next!==null;if(hr=0,ri=gt=qe=null,Il=!1,ho=0,ca=null,i)throw Error(o(300));e===null||si||(e=e.dependencies,e!==null&&Al(e)&&(si=!0))}function o_(e,i,r,a){qe=e;var d=0;do{if(la&&(ca=null),ho=0,la=!1,25<=d)throw Error(o(301));if(d+=1,ri=gt=null,e.updateQueue!=null){var v=e.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}P.H=F_,v=i(r,a)}while(la);return v}function US(){var e=P.H,i=e.useState()[0];return i=typeof i.then=="function"?fo(i):i,e=e.useState()[0],(gt!==null?gt.memoizedState:null)!==e&&(qe.flags|=1024),i}function th(){var e=Hl!==0;return Hl=0,e}function ih(e,i,r){i.updateQueue=e.updateQueue,i.flags&=-2053,e.lanes&=~r}function nh(e){if(Il){for(e=e.memoizedState;e!==null;){var i=e.queue;i!==null&&(i.pending=null),e=e.next}Il=!1}hr=0,ri=gt=qe=null,la=!1,ho=Hl=0,ca=null}function Li(){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(gt===null){var e=qe.alternate;e=e!==null?e.memoizedState:null}else e=gt.next;var i=ri===null?qe.memoizedState:ri.next;if(i!==null)ri=i,gt=e;else{if(e===null)throw qe.alternate===null?Error(o(467)):Error(o(310));gt=e,e={memoizedState:gt.memoizedState,baseState:gt.baseState,baseQueue:gt.baseQueue,queue:gt.queue,next:null},ri===null?qe.memoizedState=ri=e:ri=ri.next=e}return ri}function zl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fo(e){var i=ho;return ho+=1,ca===null&&(ca=[]),e=Zp(ca,e,i),i=qe,(ri===null?i.memoizedState:ri.next)===null&&(i=i.alternate,P.H=i===null||i.memoizedState===null?P_:_h),e}function $l(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return fo(e);if(e.$$typeof===m)return yi(e)}throw Error(o(438,String(e)))}function rh(e){var i=null,r=qe.updateQueue;if(r!==null&&(i=r.memoCache),i==null){var a=qe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(i={data:a.data.map(function(d){return d.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),r===null&&(r=zl(),qe.updateQueue=r),r.memoCache=i,r=i.data[i.index],r===void 0)for(r=i.data[i.index]=Array(e),a=0;a<e;a++)r[a]=W;return i.index++,r}function dr(e,i){return typeof i=="function"?i(e):i}function Ul(e){var i=Xt();return sh(i,gt,e)}function sh(e,i,r){var a=e.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=r;var d=e.baseQueue,v=a.pending;if(v!==null){if(d!==null){var L=d.next;d.next=v.next,v.next=L}i.baseQueue=d=v,a.pending=null}if(v=e.baseState,d===null)e.memoizedState=v;else{i=d.next;var I=L=null,G=null,re=i,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===na&&(ue=!0);else if((hr&se)===se){re=re.next,se===na&&(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?(I=G=fe,L=v):G=G.next=fe,qe.lanes|=se,Gr|=se;fe=re.action,xs&&r(v,fe),v=re.hasEagerState?re.eagerState:r(v,fe)}else se={lane:fe,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},G===null?(I=G=se,L=v):G=G.next=se,qe.lanes|=fe,Gr|=fe;re=re.next}while(re!==null&&re!==i);if(G===null?L=v:G.next=I,!en(v,e.memoizedState)&&(si=!0,ue&&(r=ra,r!==null)))throw r;e.memoizedState=v,e.baseState=L,e.baseQueue=G,a.lastRenderedState=v}return d===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function ah(e){var i=Xt(),r=i.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=e;var a=r.dispatch,d=r.pending,v=i.memoizedState;if(d!==null){r.pending=null;var L=d=d.next;do v=e(v,L.action),L=L.next;while(L!==d);en(v,i.memoizedState)||(si=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),r.lastRenderedState=v}return[v,a]}function l_(e,i,r){var a=qe,d=Xt(),v=nt;if(v){if(r===void 0)throw Error(o(407));r=r()}else r=i();var L=!en((gt||d).memoizedState,r);if(L&&(d.memoizedState=r,si=!0),d=d.queue,ch(h_.bind(null,a,d,e),[e]),d.getSnapshot!==i||L||ri!==null&&ri.memoizedState.tag&1){if(a.flags|=2048,ua(9,{destroy:void 0},u_.bind(null,a,d,r,i),null),yt===null)throw Error(o(349));v||(hr&127)!==0||c_(a,i,r)}return r}function c_(e,i,r){e.flags|=16384,e={getSnapshot:i,value:r},i=qe.updateQueue,i===null?(i=zl(),qe.updateQueue=i,i.stores=[e]):(r=i.stores,r===null?i.stores=[e]:r.push(e))}function u_(e,i,r,a){i.value=r,i.getSnapshot=a,d_(i)&&f_(e)}function h_(e,i,r){return r(function(){d_(i)&&f_(e)})}function d_(e){var i=e.getSnapshot;e=e.value;try{var r=i();return!en(e,r)}catch{return!0}}function f_(e){var i=gs(e,2);i!==null&&Wi(i,e,2)}function oh(e){var i=Li();if(typeof e=="function"){var r=e;if(e=r(),xs){Vt(!0);try{r()}finally{Vt(!1)}}}return i.memoizedState=i.baseState=e,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dr,lastRenderedState:e},i}function p_(e,i,r,a){return e.baseState=r,sh(e,gt,typeof a=="function"?a:dr)}function jS(e,i,r,a,d){if(Fl(e))throw Error(o(485));if(e=i.action,e!==null){var v={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(L){v.listeners.push(L)}};P.T!==null?r(!0):v.isTransition=!1,a(v),r=i.pending,r===null?(v.next=i.pending=v,__(i,v)):(v.next=r.next,i.pending=r.next=v)}}function __(e,i){var r=i.action,a=i.payload,d=e.state;if(i.isTransition){var v=P.T,L={};P.T=L;try{var I=r(d,a),G=P.S;G!==null&&G(L,I),g_(e,i,I)}catch(re){lh(e,i,re)}finally{v!==null&&L.types!==null&&(v.types=L.types),P.T=v}}else try{v=r(d,a),g_(e,i,v)}catch(re){lh(e,i,re)}}function g_(e,i,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(a){m_(e,i,a)},function(a){return lh(e,i,a)}):m_(e,i,r)}function m_(e,i,r){i.status="fulfilled",i.value=r,v_(i),e.state=r,i=e.pending,i!==null&&(r=i.next,r===i?e.pending=null:(r=r.next,i.next=r,__(e,r)))}function lh(e,i,r){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do i.status="rejected",i.reason=r,v_(i),i=i.next;while(i!==a)}e.action=null}function v_(e){e=e.listeners;for(var i=0;i<e.length;i++)(0,e[i])()}function b_(e,i){return i}function S_(e,i){if(nt){var r=yt.formState;if(r!==null){e:{var a=qe;if(nt){if(At){t:{for(var d=At,v=gn;d.nodeType!==8;){if(!v){d=null;break t}if(d=vn(d.nextSibling),d===null){d=null;break t}}v=d.data,d=v==="F!"||v==="F"?d:null}if(d){At=vn(d.nextSibling),a=d.data==="F!";break e}}Hr(a)}a=!1}a&&(i=r[0])}}return r=Li(),r.memoizedState=r.baseState=i,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:b_,lastRenderedState:i},r.queue=a,r=$_.bind(null,qe,a),a.dispatch=r,a=oh(!1),v=ph.bind(null,qe,!1,a.queue),a=Li(),d={state:i,dispatch:null,action:e,pending:null},a.queue=d,r=jS.bind(null,qe,d,v,r),d.dispatch=r,a.memoizedState=e,[i,r,!1]}function y_(e){var i=Xt();return C_(i,gt,e)}function C_(e,i,r){if(i=sh(e,i,b_)[0],e=Ul(dr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var a=fo(i)}catch(L){throw L===sa?Ll:L}else a=i;i=Xt();var d=i.queue,v=d.dispatch;return r!==i.memoizedState&&(qe.flags|=2048,ua(9,{destroy:void 0},PS.bind(null,d,r),null)),[a,v,e]}function PS(e,i){e.action=i}function w_(e){var i=Xt(),r=gt;if(r!==null)return C_(i,r,e);Xt(),i=i.memoizedState,r=Xt();var a=r.queue.dispatch;return r.memoizedState=e,[i,a,!1]}function ua(e,i,r,a){return e={tag:e,create:r,deps:a,inst:i,next:null},i=qe.updateQueue,i===null&&(i=zl(),qe.updateQueue=i),r=i.lastEffect,r===null?i.lastEffect=e.next=e:(a=r.next,r.next=e,e.next=a,i.lastEffect=e),e}function E_(){return Xt().memoizedState}function jl(e,i,r,a){var d=Li();qe.flags|=e,d.memoizedState=ua(1|i,{destroy:void 0},r,a===void 0?null:a)}function Pl(e,i,r,a){var d=Xt();a=a===void 0?null:a;var v=d.memoizedState.inst;gt!==null&&a!==null&&Ju(a,gt.memoizedState.deps)?d.memoizedState=ua(i,v,r,a):(qe.flags|=e,d.memoizedState=ua(1|i,v,r,a))}function x_(e,i){jl(8390656,8,e,i)}function ch(e,i){Pl(2048,8,e,i)}function FS(e){qe.flags|=4;var i=qe.updateQueue;if(i===null)i=zl(),qe.updateQueue=i,i.events=[e];else{var r=i.events;r===null?i.events=[e]:r.push(e)}}function T_(e){var i=Xt().memoizedState;return FS({ref:i,nextImpl:e}),function(){if((ut&2)!==0)throw Error(o(440));return i.impl.apply(void 0,arguments)}}function A_(e,i){return Pl(4,2,e,i)}function R_(e,i){return Pl(4,4,e,i)}function k_(e,i){if(typeof i=="function"){e=e();var r=i(e);return function(){typeof r=="function"?r():i(null)}}if(i!=null)return e=e(),i.current=e,function(){i.current=null}}function L_(e,i,r){r=r!=null?r.concat([e]):null,Pl(4,4,k_.bind(null,i,e),r)}function uh(){}function M_(e,i){var r=Xt();i=i===void 0?null:i;var a=r.memoizedState;return i!==null&&Ju(i,a[1])?a[0]:(r.memoizedState=[e,i],e)}function D_(e,i){var r=Xt();i=i===void 0?null:i;var a=r.memoizedState;if(i!==null&&Ju(i,a[1]))return a[0];if(a=e(),xs){Vt(!0);try{e()}finally{Vt(!1)}}return r.memoizedState=[a,i],a}function hh(e,i,r){return r===void 0||(hr&1073741824)!==0&&(et&261930)===0?e.memoizedState=i:(e.memoizedState=r,e=Og(),qe.lanes|=e,Gr|=e,r)}function O_(e,i,r,a){return en(r,i)?r:oa.current!==null?(e=hh(e,r,a),en(e,i)||(si=!0),e):(hr&42)===0||(hr&1073741824)!==0&&(et&261930)===0?(si=!0,e.memoizedState=r):(e=Og(),qe.lanes|=e,Gr|=e,i)}function B_(e,i,r,a,d){var v=V.p;V.p=v!==0&&8>v?v:8;var L=P.T,I={};P.T=I,ph(e,!1,i,r);try{var G=d(),re=P.S;if(re!==null&&re(I,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var ue=zS(G,a);po(e,i,ue,on(e))}else po(e,i,a,on(e))}catch(fe){po(e,i,{then:function(){},status:"rejected",reason:fe},on())}finally{V.p=v,L!==null&&I.types!==null&&(L.types=I.types),P.T=L}}function qS(){}function dh(e,i,r,a){if(e.tag!==5)throw Error(o(476));var d=N_(e).queue;B_(e,d,i,K,r===null?qS:function(){return I_(e),r(a)})}function N_(e){var i=e.memoizedState;if(i!==null)return i;i={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dr,lastRenderedState:K},next:null};var r={};return i.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dr,lastRenderedState:r},next:null},e.memoizedState=i,e=e.alternate,e!==null&&(e.memoizedState=i),i}function I_(e){var i=N_(e);i.next===null&&(i=e.alternate.memoizedState),po(e,i.next.queue,{},on())}function fh(){return yi(Mo)}function H_(){return Xt().memoizedState}function z_(){return Xt().memoizedState}function WS(e){for(var i=e.return;i!==null;){switch(i.tag){case 24:case 3:var r=on();e=Ur(r);var a=jr(i,e,r);a!==null&&(Wi(a,i,r),lo(a,i,r)),i={cache:Pu()},e.payload=i;return}i=i.return}}function GS(e,i,r){var a=on();r={lane:a,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Fl(e)?U_(i,r):(r=Mu(e,i,r,a),r!==null&&(Wi(r,e,a),j_(r,i,a)))}function $_(e,i,r){var a=on();po(e,i,r,a)}function po(e,i,r,a){var d={lane:a,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Fl(e))U_(i,d);else{var v=e.alternate;if(e.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var L=i.lastRenderedState,I=v(L,r);if(d.hasEagerState=!0,d.eagerState=I,en(I,L))return wl(e,i,d,0),yt===null&&Cl(),!1}catch{}if(r=Mu(e,i,d,a),r!==null)return Wi(r,e,a),j_(r,i,a),!0}return!1}function ph(e,i,r,a){if(a={lane:2,revertLane:Gh(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Fl(e)){if(i)throw Error(o(479))}else i=Mu(e,r,a,2),i!==null&&Wi(i,e,2)}function Fl(e){var i=e.alternate;return e===qe||i!==null&&i===qe}function U_(e,i){la=Il=!0;var r=e.pending;r===null?i.next=i:(i.next=r.next,r.next=i),e.pending=i}function j_(e,i,r){if((r&4194048)!==0){var a=i.lanes;a&=e.pendingLanes,r|=a,i.lanes=r,He(e,r)}}var _o={readContext:yi,use:$l,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useLayoutEffect:jt,useInsertionEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useSyncExternalStore:jt,useId:jt,useHostTransitionStatus:jt,useFormState:jt,useActionState:jt,useOptimistic:jt,useMemoCache:jt,useCacheRefresh:jt};_o.useEffectEvent=jt;var P_={readContext:yi,use:$l,useCallback:function(e,i){return Li().memoizedState=[e,i===void 0?null:i],e},useContext:yi,useEffect:x_,useImperativeHandle:function(e,i,r){r=r!=null?r.concat([e]):null,jl(4194308,4,k_.bind(null,i,e),r)},useLayoutEffect:function(e,i){return jl(4194308,4,e,i)},useInsertionEffect:function(e,i){jl(4,2,e,i)},useMemo:function(e,i){var r=Li();i=i===void 0?null:i;var a=e();if(xs){Vt(!0);try{e()}finally{Vt(!1)}}return r.memoizedState=[a,i],a},useReducer:function(e,i,r){var a=Li();if(r!==void 0){var d=r(i);if(xs){Vt(!0);try{r(i)}finally{Vt(!1)}}}else d=i;return a.memoizedState=a.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},a.queue=e,e=e.dispatch=GS.bind(null,qe,e),[a.memoizedState,e]},useRef:function(e){var i=Li();return e={current:e},i.memoizedState=e},useState:function(e){e=oh(e);var i=e.queue,r=$_.bind(null,qe,i);return i.dispatch=r,[e.memoizedState,r]},useDebugValue:uh,useDeferredValue:function(e,i){var r=Li();return hh(r,e,i)},useTransition:function(){var e=oh(!1);return e=B_.bind(null,qe,e.queue,!0,!1),Li().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,i,r){var a=qe,d=Li();if(nt){if(r===void 0)throw Error(o(407));r=r()}else{if(r=i(),yt===null)throw Error(o(349));(et&127)!==0||c_(a,i,r)}d.memoizedState=r;var v={value:r,getSnapshot:i};return d.queue=v,x_(h_.bind(null,a,v,e),[e]),a.flags|=2048,ua(9,{destroy:void 0},u_.bind(null,a,v,r,i),null),r},useId:function(){var e=Li(),i=yt.identifierPrefix;if(nt){var r=qn,a=Fn;r=(a&~(1<<32-zt(a)-1)).toString(32)+r,i="_"+i+"R_"+r,r=Hl++,0<r&&(i+="H"+r.toString(32)),i+="_"}else r=$S++,i="_"+i+"r_"+r.toString(32)+"_";return e.memoizedState=i},useHostTransitionStatus:fh,useFormState:S_,useActionState:S_,useOptimistic:function(e){var i=Li();i.memoizedState=i.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=r,i=ph.bind(null,qe,!0,r),r.dispatch=i,[e,i]},useMemoCache:rh,useCacheRefresh:function(){return Li().memoizedState=WS.bind(null,qe)},useEffectEvent:function(e){var i=Li(),r={impl:e};return i.memoizedState=r,function(){if((ut&2)!==0)throw Error(o(440));return r.impl.apply(void 0,arguments)}}},_h={readContext:yi,use:$l,useCallback:M_,useContext:yi,useEffect:ch,useImperativeHandle:L_,useInsertionEffect:A_,useLayoutEffect:R_,useMemo:D_,useReducer:Ul,useRef:E_,useState:function(){return Ul(dr)},useDebugValue:uh,useDeferredValue:function(e,i){var r=Xt();return O_(r,gt.memoizedState,e,i)},useTransition:function(){var e=Ul(dr)[0],i=Xt().memoizedState;return[typeof e=="boolean"?e:fo(e),i]},useSyncExternalStore:l_,useId:H_,useHostTransitionStatus:fh,useFormState:y_,useActionState:y_,useOptimistic:function(e,i){var r=Xt();return p_(r,gt,e,i)},useMemoCache:rh,useCacheRefresh:z_};_h.useEffectEvent=T_;var F_={readContext:yi,use:$l,useCallback:M_,useContext:yi,useEffect:ch,useImperativeHandle:L_,useInsertionEffect:A_,useLayoutEffect:R_,useMemo:D_,useReducer:ah,useRef:E_,useState:function(){return ah(dr)},useDebugValue:uh,useDeferredValue:function(e,i){var r=Xt();return gt===null?hh(r,e,i):O_(r,gt.memoizedState,e,i)},useTransition:function(){var e=ah(dr)[0],i=Xt().memoizedState;return[typeof e=="boolean"?e:fo(e),i]},useSyncExternalStore:l_,useId:H_,useHostTransitionStatus:fh,useFormState:w_,useActionState:w_,useOptimistic:function(e,i){var r=Xt();return gt!==null?p_(r,gt,e,i):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:rh,useCacheRefresh:z_};F_.useEffectEvent=T_;function gh(e,i,r,a){i=e.memoizedState,r=r(a,i),r=r==null?i:f({},i,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var mh={enqueueSetState:function(e,i,r){e=e._reactInternals;var a=on(),d=Ur(a);d.payload=i,r!=null&&(d.callback=r),i=jr(e,d,a),i!==null&&(Wi(i,e,a),lo(i,e,a))},enqueueReplaceState:function(e,i,r){e=e._reactInternals;var a=on(),d=Ur(a);d.tag=1,d.payload=i,r!=null&&(d.callback=r),i=jr(e,d,a),i!==null&&(Wi(i,e,a),lo(i,e,a))},enqueueForceUpdate:function(e,i){e=e._reactInternals;var r=on(),a=Ur(r);a.tag=2,i!=null&&(a.callback=i),i=jr(e,a,r),i!==null&&(Wi(i,e,r),lo(i,e,r))}};function q_(e,i,r,a,d,v,L){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,v,L):i.prototype&&i.prototype.isPureReactComponent?!eo(r,a)||!eo(d,v):!0}function W_(e,i,r,a){e=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(r,a),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(r,a),i.state!==e&&mh.enqueueReplaceState(i,i.state,null)}function Ts(e,i){var r=i;if("ref"in i){r={};for(var a in i)a!=="ref"&&(r[a]=i[a])}if(e=e.defaultProps){r===i&&(r=f({},r));for(var d in e)r[d]===void 0&&(r[d]=e[d])}return r}function G_(e){yl(e)}function K_(e){console.error(e)}function V_(e){yl(e)}function ql(e,i){try{var r=e.onUncaughtError;r(i.value,{componentStack:i.stack})}catch(a){setTimeout(function(){throw a})}}function Y_(e,i,r){try{var a=e.onCaughtError;a(r.value,{componentStack:r.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function vh(e,i,r){return r=Ur(r),r.tag=3,r.payload={element:null},r.callback=function(){ql(e,i)},r}function X_(e){return e=Ur(e),e.tag=3,e}function Z_(e,i,r,a){var d=r.type.getDerivedStateFromError;if(typeof d=="function"){var v=a.value;e.payload=function(){return d(v)},e.callback=function(){Y_(i,r,a)}}var L=r.stateNode;L!==null&&typeof L.componentDidCatch=="function"&&(e.callback=function(){Y_(i,r,a),typeof d!="function"&&(Kr===null?Kr=new Set([this]):Kr.add(this));var I=a.stack;this.componentDidCatch(a.value,{componentStack:I!==null?I:""})})}function KS(e,i,r,a,d){if(r.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(i=r.alternate,i!==null&&ia(i,r,d,!0),r=nn.current,r!==null){switch(r.tag){case 31:case 13:return mn===null?ic():r.alternate===null&&Pt===0&&(Pt=3),r.flags&=-257,r.flags|=65536,r.lanes=d,a===Ml?r.flags|=16384:(i=r.updateQueue,i===null?r.updateQueue=new Set([a]):i.add(a),Fh(e,a,d)),!1;case 22:return r.flags|=65536,a===Ml?r.flags|=16384:(i=r.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([a])},r.updateQueue=i):(r=i.retryQueue,r===null?i.retryQueue=new Set([a]):r.add(a)),Fh(e,a,d)),!1}throw Error(o(435,r.tag))}return Fh(e,a,d),ic(),!1}if(nt)return i=nn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=d,a!==Hu&&(e=Error(o(422),{cause:a}),no(fn(e,r)))):(a!==Hu&&(i=Error(o(423),{cause:a}),no(fn(i,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,a=fn(a,r),d=vh(e.stateNode,a,d),Vu(e,d),Pt!==4&&(Pt=2)),!1;var v=Error(o(520),{cause:a});if(v=fn(v,r),wo===null?wo=[v]:wo.push(v),Pt!==4&&(Pt=2),i===null)return!0;a=fn(a,r),r=i;do{switch(r.tag){case 3:return r.flags|=65536,e=d&-d,r.lanes|=e,e=vh(r.stateNode,a,e),Vu(r,e),!1;case 1:if(i=r.type,v=r.stateNode,(r.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Kr===null||!Kr.has(v))))return r.flags|=65536,d&=-d,r.lanes|=d,d=X_(d),Z_(d,e,r,a),Vu(r,d),!1}r=r.return}while(r!==null);return!1}var bh=Error(o(461)),si=!1;function Ci(e,i,r,a){i.child=e===null?t_(i,null,r,a):Es(i,e.child,r,a)}function Q_(e,i,r,a,d){r=r.render;var v=i.ref;if("ref"in a){var L={};for(var I in a)I!=="ref"&&(L[I]=a[I])}else L=a;return Ss(i),a=eh(e,i,r,L,v,d),I=th(),e!==null&&!si?(ih(e,i,d),fr(e,i,d)):(nt&&I&&Nu(i),i.flags|=1,Ci(e,i,a,d),i.child)}function J_(e,i,r,a,d){if(e===null){var v=r.type;return typeof v=="function"&&!Du(v)&&v.defaultProps===void 0&&r.compare===null?(i.tag=15,i.type=v,eg(e,i,v,a,d)):(e=xl(r.type,null,a,i,i.mode,d),e.ref=i.ref,e.return=i,i.child=e)}if(v=e.child,!Ah(e,d)){var L=v.memoizedProps;if(r=r.compare,r=r!==null?r:eo,r(L,a)&&e.ref===i.ref)return fr(e,i,d)}return i.flags|=1,e=or(v,a),e.ref=i.ref,e.return=i,i.child=e}function eg(e,i,r,a,d){if(e!==null){var v=e.memoizedProps;if(eo(v,a)&&e.ref===i.ref)if(si=!1,i.pendingProps=a=v,Ah(e,d))(e.flags&131072)!==0&&(si=!0);else return i.lanes=e.lanes,fr(e,i,d)}return Sh(e,i,r,a,d)}function tg(e,i,r,a){var d=a.children,v=e!==null?e.memoizedState:null;if(e===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|r:r,e!==null){for(a=i.child=e.child,d=0;a!==null;)d=d|a.lanes|a.childLanes,a=a.sibling;a=d&~v}else a=0,i.child=null;return ig(e,i,v,r,a)}if((r&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},e!==null&&kl(i,v!==null?v.cachePool:null),v!==null?r_(i,v):Xu(),s_(i);else return a=i.lanes=536870912,ig(e,i,v!==null?v.baseLanes|r:r,r,a)}else v!==null?(kl(i,v.cachePool),r_(i,v),Fr(),i.memoizedState=null):(e!==null&&kl(i,null),Xu(),Fr());return Ci(e,i,d,r),i.child}function go(e,i){return e!==null&&e.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function ig(e,i,r,a,d){var v=qu();return v=v===null?null:{parent:ni._currentValue,pool:v},i.memoizedState={baseLanes:r,cachePool:v},e!==null&&kl(i,null),Xu(),s_(i),e!==null&&ia(e,i,a,!0),i.childLanes=d,null}function Wl(e,i){return i=Kl({mode:i.mode,children:i.children},e.mode),i.ref=e.ref,e.child=i,i.return=e,i}function ng(e,i,r){return Es(i,e.child,null,r),e=Wl(i,i.pendingProps),e.flags|=2,rn(i),i.memoizedState=null,e}function VS(e,i,r){var a=i.pendingProps,d=(i.flags&128)!==0;if(i.flags&=-129,e===null){if(nt){if(a.mode==="hidden")return e=Wl(i,a),i.lanes=536870912,go(null,e);if(Qu(i),(e=At)?(e=_m(e,gn),e=e!==null&&e.data==="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:Nr!==null?{id:Fn,overflow:qn}:null,retryLane:536870912,hydrationErrors:null},r=Up(e),r.return=i,i.child=r,Si=i,At=null)):e=null,e===null)throw Hr(i);return i.lanes=536870912,null}return Wl(i,a)}var v=e.memoizedState;if(v!==null){var L=v.dehydrated;if(Qu(i),d)if(i.flags&256)i.flags&=-257,i=ng(e,i,r);else if(i.memoizedState!==null)i.child=e.child,i.flags|=128,i=null;else throw Error(o(558));else if(si||ia(e,i,r,!1),d=(r&e.childLanes)!==0,si||d){if(a=yt,a!==null&&(L=Bt(a,r),L!==0&&L!==v.retryLane))throw v.retryLane=L,gs(e,L),Wi(a,e,L),bh;ic(),i=ng(e,i,r)}else e=v.treeContext,At=vn(L.nextSibling),Si=i,nt=!0,Ir=null,gn=!1,e!==null&&Fp(i,e),i=Wl(i,a),i.flags|=4096;return i}return e=or(e.child,{mode:a.mode,children:a.children}),e.ref=i.ref,i.child=e,e.return=i,e}function Gl(e,i){var r=i.ref;if(r===null)e!==null&&e.ref!==null&&(i.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(o(284));(e===null||e.ref!==r)&&(i.flags|=4194816)}}function Sh(e,i,r,a,d){return Ss(i),r=eh(e,i,r,a,void 0,d),a=th(),e!==null&&!si?(ih(e,i,d),fr(e,i,d)):(nt&&a&&Nu(i),i.flags|=1,Ci(e,i,r,d),i.child)}function rg(e,i,r,a,d,v){return Ss(i),i.updateQueue=null,r=o_(i,a,r,d),a_(e),a=th(),e!==null&&!si?(ih(e,i,v),fr(e,i,v)):(nt&&a&&Nu(i),i.flags|=1,Ci(e,i,r,v),i.child)}function sg(e,i,r,a,d){if(Ss(i),i.stateNode===null){var v=Qs,L=r.contextType;typeof L=="object"&&L!==null&&(v=yi(L)),v=new r(a,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=mh,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=a,v.state=i.memoizedState,v.refs={},Gu(i),L=r.contextType,v.context=typeof L=="object"&&L!==null?yi(L):Qs,v.state=i.memoizedState,L=r.getDerivedStateFromProps,typeof L=="function"&&(gh(i,r,L,a),v.state=i.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(L=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),L!==v.state&&mh.enqueueReplaceState(v,v.state,null),uo(i,a,v,d),co(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),a=!0}else if(e===null){v=i.stateNode;var I=i.memoizedProps,G=Ts(r,I);v.props=G;var re=v.context,ue=r.contextType;L=Qs,typeof ue=="object"&&ue!==null&&(L=yi(ue));var fe=r.getDerivedStateFromProps;ue=typeof fe=="function"||typeof v.getSnapshotBeforeUpdate=="function",I=i.pendingProps!==I,ue||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(I||re!==L)&&W_(i,v,a,L),$r=!1;var se=i.memoizedState;v.state=se,uo(i,a,v,d),co(),re=i.memoizedState,I||se!==re||$r?(typeof fe=="function"&&(gh(i,r,fe,a),re=i.memoizedState),(G=$r||q_(i,r,G,a,se,re,L))?(ue||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=a,i.memoizedState=re),v.props=a,v.state=re,v.context=L,a=G):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),a=!1)}else{v=i.stateNode,Ku(e,i),L=i.memoizedProps,ue=Ts(r,L),v.props=ue,fe=i.pendingProps,se=v.context,re=r.contextType,G=Qs,typeof re=="object"&&re!==null&&(G=yi(re)),I=r.getDerivedStateFromProps,(re=typeof I=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(L!==fe||se!==G)&&W_(i,v,a,G),$r=!1,se=i.memoizedState,v.state=se,uo(i,a,v,d),co();var le=i.memoizedState;L!==fe||se!==le||$r||e!==null&&e.dependencies!==null&&Al(e.dependencies)?(typeof I=="function"&&(gh(i,r,I,a),le=i.memoizedState),(ue=$r||q_(i,r,ue,a,se,le,G)||e!==null&&e.dependencies!==null&&Al(e.dependencies))?(re||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(a,le,G),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(a,le,G)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||L===e.memoizedProps&&se===e.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||L===e.memoizedProps&&se===e.memoizedState||(i.flags|=1024),i.memoizedProps=a,i.memoizedState=le),v.props=a,v.state=le,v.context=G,a=ue):(typeof v.componentDidUpdate!="function"||L===e.memoizedProps&&se===e.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||L===e.memoizedProps&&se===e.memoizedState||(i.flags|=1024),a=!1)}return v=a,Gl(e,i),a=(i.flags&128)!==0,v||a?(v=i.stateNode,r=a&&typeof r.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,e!==null&&a?(i.child=Es(i,e.child,null,d),i.child=Es(i,null,r,d)):Ci(e,i,r,d),i.memoizedState=v.state,e=i.child):e=fr(e,i,d),e}function ag(e,i,r,a){return vs(),i.flags|=256,Ci(e,i,r,a),i.child}var yh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ch(e){return{baseLanes:e,cachePool:Yp()}}function wh(e,i,r){return e=e!==null?e.childLanes&~r:0,i&&(e|=an),e}function og(e,i,r){var a=i.pendingProps,d=!1,v=(i.flags&128)!==0,L;if((L=v)||(L=e!==null&&e.memoizedState===null?!1:(Yt.current&2)!==0),L&&(d=!0,i.flags&=-129),L=(i.flags&32)!==0,i.flags&=-33,e===null){if(nt){if(d?Pr(i):Fr(),(e=At)?(e=_m(e,gn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:Nr!==null?{id:Fn,overflow:qn}:null,retryLane:536870912,hydrationErrors:null},r=Up(e),r.return=i,i.child=r,Si=i,At=null)):e=null,e===null)throw Hr(i);return sd(e)?i.lanes=32:i.lanes=536870912,null}var I=a.children;return a=a.fallback,d?(Fr(),d=i.mode,I=Kl({mode:"hidden",children:I},d),a=ms(a,d,r,null),I.return=i,a.return=i,I.sibling=a,i.child=I,a=i.child,a.memoizedState=Ch(r),a.childLanes=wh(e,L,r),i.memoizedState=yh,go(null,a)):(Pr(i),Eh(i,I))}var G=e.memoizedState;if(G!==null&&(I=G.dehydrated,I!==null)){if(v)i.flags&256?(Pr(i),i.flags&=-257,i=xh(e,i,r)):i.memoizedState!==null?(Fr(),i.child=e.child,i.flags|=128,i=null):(Fr(),I=a.fallback,d=i.mode,a=Kl({mode:"visible",children:a.children},d),I=ms(I,d,r,null),I.flags|=2,a.return=i,I.return=i,a.sibling=I,i.child=a,Es(i,e.child,null,r),a=i.child,a.memoizedState=Ch(r),a.childLanes=wh(e,L,r),i.memoizedState=yh,i=go(null,a));else if(Pr(i),sd(I)){if(L=I.nextSibling&&I.nextSibling.dataset,L)var re=L.dgst;L=re,a=Error(o(419)),a.stack="",a.digest=L,no({value:a,source:null,stack:null}),i=xh(e,i,r)}else if(si||ia(e,i,r,!1),L=(r&e.childLanes)!==0,si||L){if(L=yt,L!==null&&(a=Bt(L,r),a!==0&&a!==G.retryLane))throw G.retryLane=a,gs(e,a),Wi(L,e,a),bh;rd(I)||ic(),i=xh(e,i,r)}else rd(I)?(i.flags|=192,i.child=e.child,i=null):(e=G.treeContext,At=vn(I.nextSibling),Si=i,nt=!0,Ir=null,gn=!1,e!==null&&Fp(i,e),i=Eh(i,a.children),i.flags|=4096);return i}return d?(Fr(),I=a.fallback,d=i.mode,G=e.child,re=G.sibling,a=or(G,{mode:"hidden",children:a.children}),a.subtreeFlags=G.subtreeFlags&65011712,re!==null?I=or(re,I):(I=ms(I,d,r,null),I.flags|=2),I.return=i,a.return=i,a.sibling=I,i.child=a,go(null,a),a=i.child,I=e.child.memoizedState,I===null?I=Ch(r):(d=I.cachePool,d!==null?(G=ni._currentValue,d=d.parent!==G?{parent:G,pool:G}:d):d=Yp(),I={baseLanes:I.baseLanes|r,cachePool:d}),a.memoizedState=I,a.childLanes=wh(e,L,r),i.memoizedState=yh,go(e.child,a)):(Pr(i),r=e.child,e=r.sibling,r=or(r,{mode:"visible",children:a.children}),r.return=i,r.sibling=null,e!==null&&(L=i.deletions,L===null?(i.deletions=[e],i.flags|=16):L.push(e)),i.child=r,i.memoizedState=null,r)}function Eh(e,i){return i=Kl({mode:"visible",children:i},e.mode),i.return=e,e.child=i}function Kl(e,i){return e=tn(22,e,null,i),e.lanes=0,e}function xh(e,i,r){return Es(i,e.child,null,r),e=Eh(i,i.pendingProps.children),e.flags|=2,i.memoizedState=null,e}function lg(e,i,r){e.lanes|=i;var a=e.alternate;a!==null&&(a.lanes|=i),Uu(e.return,i,r)}function Th(e,i,r,a,d,v){var L=e.memoizedState;L===null?e.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:a,tail:r,tailMode:d,treeForkCount:v}:(L.isBackwards=i,L.rendering=null,L.renderingStartTime=0,L.last=a,L.tail=r,L.tailMode=d,L.treeForkCount=v)}function cg(e,i,r){var a=i.pendingProps,d=a.revealOrder,v=a.tail;a=a.children;var L=Yt.current,I=(L&2)!==0;if(I?(L=L&1|2,i.flags|=128):L&=1,Y(Yt,L),Ci(e,i,a,r),a=nt?io:0,!I&&e!==null&&(e.flags&128)!==0)e:for(e=i.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&lg(e,r,i);else if(e.tag===19)lg(e,r,i);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break e;for(;e.sibling===null;){if(e.return===null||e.return===i)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(r=i.child,d=null;r!==null;)e=r.alternate,e!==null&&Nl(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=i.child,i.child=null):(d=r.sibling,r.sibling=null),Th(i,!1,d,r,v,a);break;case"backwards":case"unstable_legacy-backwards":for(r=null,d=i.child,i.child=null;d!==null;){if(e=d.alternate,e!==null&&Nl(e)===null){i.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}Th(i,!0,r,null,v,a);break;case"together":Th(i,!1,null,null,void 0,a);break;default:i.memoizedState=null}return i.child}function fr(e,i,r){if(e!==null&&(i.dependencies=e.dependencies),Gr|=i.lanes,(r&i.childLanes)===0)if(e!==null){if(ia(e,i,r,!1),(r&i.childLanes)===0)return null}else return null;if(e!==null&&i.child!==e.child)throw Error(o(153));if(i.child!==null){for(e=i.child,r=or(e,e.pendingProps),i.child=r,r.return=i;e.sibling!==null;)e=e.sibling,r=r.sibling=or(e,e.pendingProps),r.return=i;r.sibling=null}return i.child}function Ah(e,i){return(e.lanes&i)!==0?!0:(e=e.dependencies,!!(e!==null&&Al(e)))}function YS(e,i,r){switch(i.tag){case 3:$(i,i.stateNode.containerInfo),zr(i,ni,e.memoizedState.cache),vs();break;case 27:case 5:_e(i);break;case 4:$(i,i.stateNode.containerInfo);break;case 10:zr(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Qu(i),null;break;case 13:var a=i.memoizedState;if(a!==null)return a.dehydrated!==null?(Pr(i),i.flags|=128,null):(r&i.child.childLanes)!==0?og(e,i,r):(Pr(i),e=fr(e,i,r),e!==null?e.sibling:null);Pr(i);break;case 19:var d=(e.flags&128)!==0;if(a=(r&i.childLanes)!==0,a||(ia(e,i,r,!1),a=(r&i.childLanes)!==0),d){if(a)return cg(e,i,r);i.flags|=128}if(d=i.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Y(Yt,Yt.current),a)break;return null;case 22:return i.lanes=0,tg(e,i,r,i.pendingProps);case 24:zr(i,ni,e.memoizedState.cache)}return fr(e,i,r)}function ug(e,i,r){if(e!==null)if(e.memoizedProps!==i.pendingProps)si=!0;else{if(!Ah(e,r)&&(i.flags&128)===0)return si=!1,YS(e,i,r);si=(e.flags&131072)!==0}else si=!1,nt&&(i.flags&1048576)!==0&&Pp(i,io,i.index);switch(i.lanes=0,i.tag){case 16:e:{var a=i.pendingProps;if(e=Cs(i.elementType),i.type=e,typeof e=="function")Du(e)?(a=Ts(e,a),i.tag=1,i=sg(null,i,e,a,r)):(i.tag=0,i=Sh(null,i,e,a,r));else{if(e!=null){var d=e.$$typeof;if(d===x){i.tag=11,i=Q_(null,i,e,a,r);break e}else if(d===D){i.tag=14,i=J_(null,i,e,a,r);break e}}throw i=Z(e)||e,Error(o(306,i,""))}}return i;case 0:return Sh(e,i,i.type,i.pendingProps,r);case 1:return a=i.type,d=Ts(a,i.pendingProps),sg(e,i,a,d,r);case 3:e:{if($(i,i.stateNode.containerInfo),e===null)throw Error(o(387));a=i.pendingProps;var v=i.memoizedState;d=v.element,Ku(e,i),uo(i,a,null,r);var L=i.memoizedState;if(a=L.cache,zr(i,ni,a),a!==v.cache&&ju(i,[ni],r,!0),co(),a=L.element,v.isDehydrated)if(v={element:a,isDehydrated:!1,cache:L.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=ag(e,i,a,r);break e}else if(a!==d){d=fn(Error(o(424)),i),no(d),i=ag(e,i,a,r);break e}else for(e=i.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,At=vn(e.firstChild),Si=i,nt=!0,Ir=null,gn=!0,r=t_(i,null,a,r),i.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(vs(),a===d){i=fr(e,i,r);break e}Ci(e,i,a,r)}i=i.child}return i;case 26:return Gl(e,i),e===null?(r=ym(i.type,null,i.pendingProps,null))?i.memoizedState=r:nt||(r=i.type,e=i.pendingProps,a=cc(me.current).createElement(r),a[xt]=i,a[wt]=e,wi(a,r,e),Ve(a),i.stateNode=a):i.memoizedState=ym(i.type,e.memoizedProps,i.pendingProps,e.memoizedState),null;case 27:return _e(i),e===null&&nt&&(a=i.stateNode=vm(i.type,i.pendingProps,me.current),Si=i,gn=!0,d=At,Zr(i.type)?(ad=d,At=vn(a.firstChild)):At=d),Ci(e,i,i.pendingProps.children,r),Gl(e,i),e===null&&(i.flags|=4194304),i.child;case 5:return e===null&&nt&&((d=a=At)&&(a=xy(a,i.type,i.pendingProps,gn),a!==null?(i.stateNode=a,Si=i,At=vn(a.firstChild),gn=!1,d=!0):d=!1),d||Hr(i)),_e(i),d=i.type,v=i.pendingProps,L=e!==null?e.memoizedProps:null,a=v.children,td(d,v)?a=null:L!==null&&td(d,L)&&(i.flags|=32),i.memoizedState!==null&&(d=eh(e,i,US,null,null,r),Mo._currentValue=d),Gl(e,i),Ci(e,i,a,r),i.child;case 6:return e===null&&nt&&((e=r=At)&&(r=Ty(r,i.pendingProps,gn),r!==null?(i.stateNode=r,Si=i,At=null,e=!0):e=!1),e||Hr(i)),null;case 13:return og(e,i,r);case 4:return $(i,i.stateNode.containerInfo),a=i.pendingProps,e===null?i.child=Es(i,null,a,r):Ci(e,i,a,r),i.child;case 11:return Q_(e,i,i.type,i.pendingProps,r);case 7:return Ci(e,i,i.pendingProps,r),i.child;case 8:return Ci(e,i,i.pendingProps.children,r),i.child;case 12:return Ci(e,i,i.pendingProps.children,r),i.child;case 10:return a=i.pendingProps,zr(i,i.type,a.value),Ci(e,i,a.children,r),i.child;case 9:return d=i.type._context,a=i.pendingProps.children,Ss(i),d=yi(d),a=a(d),i.flags|=1,Ci(e,i,a,r),i.child;case 14:return J_(e,i,i.type,i.pendingProps,r);case 15:return eg(e,i,i.type,i.pendingProps,r);case 19:return cg(e,i,r);case 31:return VS(e,i,r);case 22:return tg(e,i,r,i.pendingProps);case 24:return Ss(i),a=yi(ni),e===null?(d=qu(),d===null&&(d=yt,v=Pu(),d.pooledCache=v,v.refCount++,v!==null&&(d.pooledCacheLanes|=r),d=v),i.memoizedState={parent:a,cache:d},Gu(i),zr(i,ni,d)):((e.lanes&r)!==0&&(Ku(e,i),uo(i,null,null,r),co()),d=e.memoizedState,v=i.memoizedState,d.parent!==a?(d={parent:a,cache:a},i.memoizedState=d,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=d),zr(i,ni,a)):(a=v.cache,zr(i,ni,a),a!==d.cache&&ju(i,[ni],r,!0))),Ci(e,i,i.pendingProps.children,r),i.child;case 29:throw i.pendingProps}throw Error(o(156,i.tag))}function pr(e){e.flags|=4}function Rh(e,i,r,a,d){if((i=(e.mode&32)!==0)&&(i=!1),i){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(Hg())e.flags|=8192;else throw ws=Ml,Wu}else e.flags&=-16777217}function hg(e,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Tm(i))if(Hg())e.flags|=8192;else throw ws=Ml,Wu}function Vl(e,i){i!==null&&(e.flags|=4),e.flags&16384&&(i=e.tag!==22?Ie():536870912,e.lanes|=i,pa|=i)}function mo(e,i){if(!nt)switch(e.tailMode){case"hidden":i=e.tail;for(var r=null;i!==null;)i.alternate!==null&&(r=i),i=i.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?i||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Rt(e){var i=e.alternate!==null&&e.alternate.child===e.child,r=0,a=0;if(i)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,i}function XS(e,i,r){var a=i.pendingProps;switch(Iu(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rt(i),null;case 1:return Rt(i),null;case 3:return r=i.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),i.memoizedState.cache!==a&&(i.flags|=2048),ur(ni),oe(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ta(i)?pr(i):e===null||e.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,zu())),Rt(i),null;case 26:var d=i.type,v=i.memoizedState;return e===null?(pr(i),v!==null?(Rt(i),hg(i,v)):(Rt(i),Rh(i,d,null,a,r))):v?v!==e.memoizedState?(pr(i),Rt(i),hg(i,v)):(Rt(i),i.flags&=-16777217):(e=e.memoizedProps,e!==a&&pr(i),Rt(i),Rh(i,d,e,a,r)),null;case 27:if(Se(i),r=me.current,d=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==a&&pr(i);else{if(!a){if(i.stateNode===null)throw Error(o(166));return Rt(i),null}e=ae.current,ta(i)?qp(i):(e=vm(d,a,r),i.stateNode=e,pr(i))}return Rt(i),null;case 5:if(Se(i),d=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==a&&pr(i);else{if(!a){if(i.stateNode===null)throw Error(o(166));return Rt(i),null}if(v=ae.current,ta(i))qp(i);else{var L=cc(me.current);switch(v){case 1:v=L.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:v=L.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":v=L.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":v=L.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":v=L.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof a.is=="string"?L.createElement("select",{is:a.is}):L.createElement("select"),a.multiple?v.multiple=!0:a.size&&(v.size=a.size);break;default:v=typeof a.is=="string"?L.createElement(d,{is:a.is}):L.createElement(d)}}v[xt]=i,v[wt]=a;e:for(L=i.child;L!==null;){if(L.tag===5||L.tag===6)v.appendChild(L.stateNode);else if(L.tag!==4&&L.tag!==27&&L.child!==null){L.child.return=L,L=L.child;continue}if(L===i)break e;for(;L.sibling===null;){if(L.return===null||L.return===i)break e;L=L.return}L.sibling.return=L.return,L=L.sibling}i.stateNode=v;e:switch(wi(v,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&&pr(i)}}return Rt(i),Rh(i,i.type,e===null?null:e.memoizedProps,i.pendingProps,r),null;case 6:if(e&&i.stateNode!=null)e.memoizedProps!==a&&pr(i);else{if(typeof a!="string"&&i.stateNode===null)throw Error(o(166));if(e=me.current,ta(i)){if(e=i.stateNode,r=i.memoizedProps,a=null,d=Si,d!==null)switch(d.tag){case 27:case 5:a=d.memoizedProps}e[xt]=i,e=!!(e.nodeValue===r||a!==null&&a.suppressHydrationWarning===!0||om(e.nodeValue,r)),e||Hr(i,!0)}else e=cc(e).createTextNode(a),e[xt]=i,i.stateNode=e}return Rt(i),null;case 31:if(r=i.memoizedState,e===null||e.memoizedState!==null){if(a=ta(i),r!==null){if(e===null){if(!a)throw Error(o(318));if(e=i.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[xt]=i}else vs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Rt(i),e=!1}else r=zu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return i.flags&256?(rn(i),i):(rn(i),null);if((i.flags&128)!==0)throw Error(o(558))}return Rt(i),null;case 13:if(a=i.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=ta(i),a!==null&&a.dehydrated!==null){if(e===null){if(!d)throw Error(o(318));if(d=i.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(o(317));d[xt]=i}else vs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Rt(i),d=!1}else d=zu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return i.flags&256?(rn(i),i):(rn(i),null)}return rn(i),(i.flags&128)!==0?(i.lanes=r,i):(r=a!==null,e=e!==null&&e.memoizedState!==null,r&&(a=i.child,d=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(d=a.alternate.memoizedState.cachePool.pool),v=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(v=a.memoizedState.cachePool.pool),v!==d&&(a.flags|=2048)),r!==e&&r&&(i.child.flags|=8192),Vl(i,i.updateQueue),Rt(i),null);case 4:return oe(),e===null&&Xh(i.stateNode.containerInfo),Rt(i),null;case 10:return ur(i.type),Rt(i),null;case 19:if(U(Yt),a=i.memoizedState,a===null)return Rt(i),null;if(d=(i.flags&128)!==0,v=a.rendering,v===null)if(d)mo(a,!1);else{if(Pt!==0||e!==null&&(e.flags&128)!==0)for(e=i.child;e!==null;){if(v=Nl(e),v!==null){for(i.flags|=128,mo(a,!1),e=v.updateQueue,i.updateQueue=e,Vl(i,e),i.subtreeFlags=0,e=r,r=i.child;r!==null;)$p(r,e),r=r.sibling;return Y(Yt,Yt.current&1|2),nt&&lr(i,a.treeForkCount),i.child}e=e.sibling}a.tail!==null&&ct()>Jl&&(i.flags|=128,d=!0,mo(a,!1),i.lanes=4194304)}else{if(!d)if(e=Nl(v),e!==null){if(i.flags|=128,d=!0,e=e.updateQueue,i.updateQueue=e,Vl(i,e),mo(a,!0),a.tail===null&&a.tailMode==="hidden"&&!v.alternate&&!nt)return Rt(i),null}else 2*ct()-a.renderingStartTime>Jl&&r!==536870912&&(i.flags|=128,d=!0,mo(a,!1),i.lanes=4194304);a.isBackwards?(v.sibling=i.child,i.child=v):(e=a.last,e!==null?e.sibling=v:i.child=v,a.last=v)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ct(),e.sibling=null,r=Yt.current,Y(Yt,d?r&1|2:r&1),nt&&lr(i,a.treeForkCount),e):(Rt(i),null);case 22:case 23:return rn(i),Zu(),a=i.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(i.flags|=8192):a&&(i.flags|=8192),a?(r&536870912)!==0&&(i.flags&128)===0&&(Rt(i),i.subtreeFlags&6&&(i.flags|=8192)):Rt(i),r=i.updateQueue,r!==null&&Vl(i,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),a=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),a!==r&&(i.flags|=2048),e!==null&&U(ys),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),i.memoizedState.cache!==r&&(i.flags|=2048),ur(ni),Rt(i),null;case 25:return null;case 30:return null}throw Error(o(156,i.tag))}function ZS(e,i){switch(Iu(i),i.tag){case 1:return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 3:return ur(ni),oe(),e=i.flags,(e&65536)!==0&&(e&128)===0?(i.flags=e&-65537|128,i):null;case 26:case 27:case 5:return Se(i),null;case 31:if(i.memoizedState!==null){if(rn(i),i.alternate===null)throw Error(o(340));vs()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 13:if(rn(i),e=i.memoizedState,e!==null&&e.dehydrated!==null){if(i.alternate===null)throw Error(o(340));vs()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 19:return U(Yt),null;case 4:return oe(),null;case 10:return ur(i.type),null;case 22:case 23:return rn(i),Zu(),e!==null&&U(ys),e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 24:return ur(ni),null;case 25:return null;default:return null}}function dg(e,i){switch(Iu(i),i.tag){case 3:ur(ni),oe();break;case 26:case 27:case 5:Se(i);break;case 4:oe();break;case 31:i.memoizedState!==null&&rn(i);break;case 13:rn(i);break;case 19:U(Yt);break;case 10:ur(i.type);break;case 22:case 23:rn(i),Zu(),e!==null&&U(ys);break;case 24:ur(ni)}}function vo(e,i){try{var r=i.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 v=r.create,L=r.inst;a=v(),L.destroy=a}r=r.next}while(r!==d)}}catch(I){_t(i,i.return,I)}}function qr(e,i,r){try{var a=i.updateQueue,d=a!==null?a.lastEffect:null;if(d!==null){var v=d.next;a=v;do{if((a.tag&e)===e){var L=a.inst,I=L.destroy;if(I!==void 0){L.destroy=void 0,d=i;var G=r,re=I;try{re()}catch(ue){_t(d,G,ue)}}}a=a.next}while(a!==v)}}catch(ue){_t(i,i.return,ue)}}function fg(e){var i=e.updateQueue;if(i!==null){var r=e.stateNode;try{n_(i,r)}catch(a){_t(e,e.return,a)}}}function pg(e,i,r){r.props=Ts(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(a){_t(e,i,a)}}function bo(e,i){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,i,d)}}function Wn(e,i){var r=e.ref,a=e.refCleanup;if(r!==null)if(typeof a=="function")try{a()}catch(d){_t(e,i,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,i,d)}else r.current=null}function _g(e){var i=e.type,r=e.memoizedProps,a=e.stateNode;try{e:switch(i){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 kh(e,i,r){try{var a=e.stateNode;by(a,e.type,r,i),a[wt]=i}catch(d){_t(e,e.return,d)}}function gg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zr(e.type)||e.tag===4}function Lh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gg(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 Mh(e,i,r){var a=e.tag;if(a===5||a===6)e=e.stateNode,i?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,i):(i=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,i.appendChild(e),r=r._reactRootContainer,r!=null||i.onclick!==null||(i.onclick=ye));else if(a!==4&&(a===27&&Zr(e.type)&&(r=e.stateNode,i=null),e=e.child,e!==null))for(Mh(e,i,r),e=e.sibling;e!==null;)Mh(e,i,r),e=e.sibling}function Yl(e,i,r){var a=e.tag;if(a===5||a===6)e=e.stateNode,i?r.insertBefore(e,i):r.appendChild(e);else if(a!==4&&(a===27&&Zr(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(Yl(e,i,r),e=e.sibling;e!==null;)Yl(e,i,r),e=e.sibling}function mg(e){var i=e.stateNode,r=e.memoizedProps;try{for(var a=e.type,d=i.attributes;d.length;)i.removeAttributeNode(d[0]);wi(i,a,r),i[xt]=e,i[wt]=r}catch(v){_t(e,e.return,v)}}var _r=!1,ai=!1,Dh=!1,vg=typeof WeakSet=="function"?WeakSet:Set,hi=null;function QS(e,i){if(e=e.containerInfo,Jh=gc,e=Lp(e),xu(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,v=a.focusNode;a=a.focusOffset;try{r.nodeType,v.nodeType}catch{r=null;break e}var L=0,I=-1,G=-1,re=0,ue=0,fe=e,se=null;t:for(;;){for(var le;fe!==r||d!==0&&fe.nodeType!==3||(I=L+d),fe!==v||a!==0&&fe.nodeType!==3||(G=L+a),fe.nodeType===3&&(L+=fe.nodeValue.length),(le=fe.firstChild)!==null;)se=fe,fe=le;for(;;){if(fe===e)break t;if(se===r&&++re===d&&(I=L),se===v&&++ue===a&&(G=L),(le=fe.nextSibling)!==null)break;fe=se,se=fe.parentNode}fe=le}r=I===-1||G===-1?null:{start:I,end:G}}else r=null}r=r||{start:0,end:0}}else r=null;for(ed={focusedElem:e,selectionRange:r},gc=!1,hi=i;hi!==null;)if(i=hi,e=i.child,(i.subtreeFlags&1028)!==0&&e!==null)e.return=i,hi=e;else for(;hi!==null;){switch(i=hi,v=i.alternate,e=i.flags,i.tag){case 0:if((e&4)!==0&&(e=i.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&&v!==null){e=void 0,r=i,d=v.memoizedProps,v=v.memoizedState,a=r.stateNode;try{var xe=Ts(r.type,d);e=a.getSnapshotBeforeUpdate(xe,v),a.__reactInternalSnapshotBeforeUpdate=e}catch(ze){_t(r,r.return,ze)}}break;case 3:if((e&1024)!==0){if(e=i.stateNode.containerInfo,r=e.nodeType,r===9)nd(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":nd(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=i.sibling,e!==null){e.return=i.return,hi=e;break}hi=i.return}}function bg(e,i,r){var a=r.flags;switch(r.tag){case 0:case 11:case 15:mr(e,r),a&4&&vo(5,r);break;case 1:if(mr(e,r),a&4)if(e=r.stateNode,i===null)try{e.componentDidMount()}catch(L){_t(r,r.return,L)}else{var d=Ts(r.type,i.memoizedProps);i=i.memoizedState;try{e.componentDidUpdate(d,i,e.__reactInternalSnapshotBeforeUpdate)}catch(L){_t(r,r.return,L)}}a&64&&fg(r),a&512&&bo(r,r.return);break;case 3:if(mr(e,r),a&64&&(e=r.updateQueue,e!==null)){if(i=null,r.child!==null)switch(r.child.tag){case 27:case 5:i=r.child.stateNode;break;case 1:i=r.child.stateNode}try{n_(e,i)}catch(L){_t(r,r.return,L)}}break;case 27:i===null&&a&4&&mg(r);case 26:case 5:mr(e,r),i===null&&a&4&&_g(r),a&512&&bo(r,r.return);break;case 12:mr(e,r);break;case 31:mr(e,r),a&4&&Cg(e,r);break;case 13:mr(e,r),a&4&&wg(e,r),a&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=oy.bind(null,r),Ay(e,r))));break;case 22:if(a=r.memoizedState!==null||_r,!a){i=i!==null&&i.memoizedState!==null||ai,d=_r;var v=ai;_r=a,(ai=i)&&!v?vr(e,r,(r.subtreeFlags&8772)!==0):mr(e,r),_r=d,ai=v}break;case 30:break;default:mr(e,r)}}function Sg(e){var i=e.alternate;i!==null&&(e.alternate=null,Sg(i)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(i=e.stateNode,i!==null&&De(i)),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,ji=!1;function gr(e,i,r){for(r=r.child;r!==null;)yg(e,i,r),r=r.sibling}function yg(e,i,r){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount(Ii,r)}catch{}switch(r.tag){case 26:ai||Wn(r,i),gr(e,i,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:ai||Wn(r,i);var a=Dt,d=ji;Zr(r.type)&&(Dt=r.stateNode,ji=!1),gr(e,i,r),Ro(r.stateNode),Dt=a,ji=d;break;case 5:ai||Wn(r,i);case 6:if(a=Dt,d=ji,Dt=null,gr(e,i,r),Dt=a,ji=d,Dt!==null)if(ji)try{(Dt.nodeType===9?Dt.body:Dt.nodeName==="HTML"?Dt.ownerDocument.body:Dt).removeChild(r.stateNode)}catch(v){_t(r,i,v)}else try{Dt.removeChild(r.stateNode)}catch(v){_t(r,i,v)}break;case 18:Dt!==null&&(ji?(e=Dt,fm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Ca(e)):fm(Dt,r.stateNode));break;case 4:a=Dt,d=ji,Dt=r.stateNode.containerInfo,ji=!0,gr(e,i,r),Dt=a,ji=d;break;case 0:case 11:case 14:case 15:qr(2,r,i),ai||qr(4,r,i),gr(e,i,r);break;case 1:ai||(Wn(r,i),a=r.stateNode,typeof a.componentWillUnmount=="function"&&pg(r,i,a)),gr(e,i,r);break;case 21:gr(e,i,r);break;case 22:ai=(a=ai)||r.memoizedState!==null,gr(e,i,r),ai=a;break;default:gr(e,i,r)}}function Cg(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ca(e)}catch(r){_t(i,i.return,r)}}}function wg(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ca(e)}catch(r){_t(i,i.return,r)}}function JS(e){switch(e.tag){case 31:case 13:case 19:var i=e.stateNode;return i===null&&(i=e.stateNode=new vg),i;case 22:return e=e.stateNode,i=e._retryCache,i===null&&(i=e._retryCache=new vg),i;default:throw Error(o(435,e.tag))}}function Xl(e,i){var r=JS(e);i.forEach(function(a){if(!r.has(a)){r.add(a);var d=ly.bind(null,e,a);a.then(d,d)}})}function Pi(e,i){var r=i.deletions;if(r!==null)for(var a=0;a<r.length;a++){var d=r[a],v=e,L=i,I=L;e:for(;I!==null;){switch(I.tag){case 27:if(Zr(I.type)){Dt=I.stateNode,ji=!1;break e}break;case 5:Dt=I.stateNode,ji=!1;break e;case 3:case 4:Dt=I.stateNode.containerInfo,ji=!0;break e}I=I.return}if(Dt===null)throw Error(o(160));yg(v,L,d),Dt=null,ji=!1,v=d.alternate,v!==null&&(v.return=null),d.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Eg(i,e),i=i.sibling}var Dn=null;function Eg(e,i){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Pi(i,e),Fi(e),a&4&&(qr(3,e,e.return),vo(3,e),qr(5,e,e.return));break;case 1:Pi(i,e),Fi(e),a&512&&(ai||r===null||Wn(r,r.return)),a&64&&_r&&(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=Dn;if(Pi(i,e),Fi(e),a&512&&(ai||r===null||Wn(r,r.return)),a&4){var v=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":v=d.getElementsByTagName("title")[0],(!v||v[Pn]||v[xt]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=d.createElement(a),d.head.insertBefore(v,d.querySelector("head > title"))),wi(v,a,r),v[xt]=e,Ve(v),a=v;break e;case"link":var L=Em("link","href",d).get(a+(r.href||""));if(L){for(var I=0;I<L.length;I++)if(v=L[I],v.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&v.getAttribute("rel")===(r.rel==null?null:r.rel)&&v.getAttribute("title")===(r.title==null?null:r.title)&&v.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){L.splice(I,1);break t}}v=d.createElement(a),wi(v,a,r),d.head.appendChild(v);break;case"meta":if(L=Em("meta","content",d).get(a+(r.content||""))){for(I=0;I<L.length;I++)if(v=L[I],v.getAttribute("content")===(r.content==null?null:""+r.content)&&v.getAttribute("name")===(r.name==null?null:r.name)&&v.getAttribute("property")===(r.property==null?null:r.property)&&v.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&v.getAttribute("charset")===(r.charSet==null?null:r.charSet)){L.splice(I,1);break t}}v=d.createElement(a),wi(v,a,r),d.head.appendChild(v);break;default:throw Error(o(468,a))}v[xt]=e,Ve(v),a=v}e.stateNode=a}else xm(d,e.type,e.stateNode);else e.stateNode=wm(d,a,e.memoizedProps);else v!==a?(v===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):v.count--,a===null?xm(d,e.type,e.stateNode):wm(d,a,e.memoizedProps)):a===null&&e.stateNode!==null&&kh(e,e.memoizedProps,r.memoizedProps)}break;case 27:Pi(i,e),Fi(e),a&512&&(ai||r===null||Wn(r,r.return)),r!==null&&a&4&&kh(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Pi(i,e),Fi(e),a&512&&(ai||r===null||Wn(r,r.return)),e.flags&32){d=e.stateNode;try{Ue(d,"")}catch(xe){_t(e,e.return,xe)}}a&4&&e.stateNode!=null&&(d=e.memoizedProps,kh(e,d,r!==null?r.memoizedProps:d)),a&1024&&(Dh=!0);break;case 6:if(Pi(i,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(dc=null,d=Dn,Dn=uc(i.containerInfo),Pi(i,e),Dn=d,Fi(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Ca(i.containerInfo)}catch(xe){_t(e,e.return,xe)}Dh&&(Dh=!1,xg(e));break;case 4:a=Dn,Dn=uc(e.stateNode.containerInfo),Pi(i,e),Fi(e),Dn=a;break;case 12:Pi(i,e),Fi(e);break;case 31:Pi(i,e),Fi(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Xl(e,a)));break;case 13:Pi(i,e),Fi(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Ql=ct()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Xl(e,a)));break;case 22:d=e.memoizedState!==null;var G=r!==null&&r.memoizedState!==null,re=_r,ue=ai;if(_r=re||d,ai=ue||G,Pi(i,e),ai=ue,_r=re,Fi(e),a&8192)e:for(i=e.stateNode,i._visibility=d?i._visibility&-2:i._visibility|1,d&&(r===null||G||_r||ai||As(e)),r=null,i=e;;){if(i.tag===5||i.tag===26){if(r===null){G=r=i;try{if(v=G.stateNode,d)L=v.style,typeof L.setProperty=="function"?L.setProperty("display","none","important"):L.display="none";else{I=G.stateNode;var fe=G.memoizedProps.style,se=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;I.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(xe){_t(G,G.return,xe)}}}else if(i.tag===6){if(r===null){G=i;try{G.stateNode.nodeValue=d?"":G.memoizedProps}catch(xe){_t(G,G.return,xe)}}}else if(i.tag===18){if(r===null){G=i;try{var le=G.stateNode;d?pm(le,!0):pm(G.stateNode,!1)}catch(xe){_t(G,G.return,xe)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===e)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break e;for(;i.sibling===null;){if(i.return===null||i.return===e)break e;r===i&&(r=null),i=i.return}r===i&&(r=null),i.sibling.return=i.return,i=i.sibling}a&4&&(a=e.updateQueue,a!==null&&(r=a.retryQueue,r!==null&&(a.retryQueue=null,Xl(e,r))));break;case 19:Pi(i,e),Fi(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Xl(e,a)));break;case 30:break;case 21:break;default:Pi(i,e),Fi(e)}}function Fi(e){var i=e.flags;if(i&2){try{for(var r,a=e.return;a!==null;){if(gg(a)){r=a;break}a=a.return}if(r==null)throw Error(o(160));switch(r.tag){case 27:var d=r.stateNode,v=Lh(e);Yl(e,v,d);break;case 5:var L=r.stateNode;r.flags&32&&(Ue(L,""),r.flags&=-33);var I=Lh(e);Yl(e,I,L);break;case 3:case 4:var G=r.stateNode.containerInfo,re=Lh(e);Mh(e,re,G);break;default:throw Error(o(161))}}catch(ue){_t(e,e.return,ue)}e.flags&=-3}i&4096&&(e.flags&=-4097)}function xg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var i=e;xg(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),e=e.sibling}}function mr(e,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)bg(e,i.alternate,i),i=i.sibling}function As(e){for(e=e.child;e!==null;){var i=e;switch(i.tag){case 0:case 11:case 14:case 15:qr(4,i,i.return),As(i);break;case 1:Wn(i,i.return);var r=i.stateNode;typeof r.componentWillUnmount=="function"&&pg(i,i.return,r),As(i);break;case 27:Ro(i.stateNode);case 26:case 5:Wn(i,i.return),As(i);break;case 22:i.memoizedState===null&&As(i);break;case 30:As(i);break;default:As(i)}e=e.sibling}}function vr(e,i,r){for(r=r&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var a=i.alternate,d=e,v=i,L=v.flags;switch(v.tag){case 0:case 11:case 15:vr(d,v,r),vo(4,v);break;case 1:if(vr(d,v,r),a=v,d=a.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(re){_t(a,a.return,re)}if(a=v,d=a.updateQueue,d!==null){var I=a.stateNode;try{var G=d.shared.hiddenCallbacks;if(G!==null)for(d.shared.hiddenCallbacks=null,d=0;d<G.length;d++)i_(G[d],I)}catch(re){_t(a,a.return,re)}}r&&L&64&&fg(v),bo(v,v.return);break;case 27:mg(v);case 26:case 5:vr(d,v,r),r&&a===null&&L&4&&_g(v),bo(v,v.return);break;case 12:vr(d,v,r);break;case 31:vr(d,v,r),r&&L&4&&Cg(d,v);break;case 13:vr(d,v,r),r&&L&4&&wg(d,v);break;case 22:v.memoizedState===null&&vr(d,v,r),bo(v,v.return);break;case 30:break;default:vr(d,v,r)}i=i.sibling}}function Oh(e,i){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(e=i.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&ro(r))}function Bh(e,i){e=null,i.alternate!==null&&(e=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==e&&(i.refCount++,e!=null&&ro(e))}function On(e,i,r,a){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Tg(e,i,r,a),i=i.sibling}function Tg(e,i,r,a){var d=i.flags;switch(i.tag){case 0:case 11:case 15:On(e,i,r,a),d&2048&&vo(9,i);break;case 1:On(e,i,r,a);break;case 3:On(e,i,r,a),d&2048&&(e=null,i.alternate!==null&&(e=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==e&&(i.refCount++,e!=null&&ro(e)));break;case 12:if(d&2048){On(e,i,r,a),e=i.stateNode;try{var v=i.memoizedProps,L=v.id,I=v.onPostCommit;typeof I=="function"&&I(L,i.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(G){_t(i,i.return,G)}}else On(e,i,r,a);break;case 31:On(e,i,r,a);break;case 13:On(e,i,r,a);break;case 23:break;case 22:v=i.stateNode,L=i.alternate,i.memoizedState!==null?v._visibility&2?On(e,i,r,a):So(e,i):v._visibility&2?On(e,i,r,a):(v._visibility|=2,ha(e,i,r,a,(i.subtreeFlags&10256)!==0||!1)),d&2048&&Oh(L,i);break;case 24:On(e,i,r,a),d&2048&&Bh(i.alternate,i);break;default:On(e,i,r,a)}}function ha(e,i,r,a,d){for(d=d&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=e,L=i,I=r,G=a,re=L.flags;switch(L.tag){case 0:case 11:case 15:ha(v,L,I,G,d),vo(8,L);break;case 23:break;case 22:var ue=L.stateNode;L.memoizedState!==null?ue._visibility&2?ha(v,L,I,G,d):So(v,L):(ue._visibility|=2,ha(v,L,I,G,d)),d&&re&2048&&Oh(L.alternate,L);break;case 24:ha(v,L,I,G,d),d&&re&2048&&Bh(L.alternate,L);break;default:ha(v,L,I,G,d)}i=i.sibling}}function So(e,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var r=e,a=i,d=a.flags;switch(a.tag){case 22:So(r,a),d&2048&&Oh(a.alternate,a);break;case 24:So(r,a),d&2048&&Bh(a.alternate,a);break;default:So(r,a)}i=i.sibling}}var yo=8192;function da(e,i,r){if(e.subtreeFlags&yo)for(e=e.child;e!==null;)Ag(e,i,r),e=e.sibling}function Ag(e,i,r){switch(e.tag){case 26:da(e,i,r),e.flags&yo&&e.memoizedState!==null&&$y(r,Dn,e.memoizedState,e.memoizedProps);break;case 5:da(e,i,r);break;case 3:case 4:var a=Dn;Dn=uc(e.stateNode.containerInfo),da(e,i,r),Dn=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=yo,yo=16777216,da(e,i,r),yo=a):da(e,i,r));break;default:da(e,i,r)}}function Rg(e){var i=e.alternate;if(i!==null&&(e=i.child,e!==null)){i.child=null;do i=e.sibling,e.sibling=null,e=i;while(e!==null)}}function Co(e){var i=e.deletions;if((e.flags&16)!==0){if(i!==null)for(var r=0;r<i.length;r++){var a=i[r];hi=a,Lg(a,e)}Rg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)kg(e),e=e.sibling}function kg(e){switch(e.tag){case 0:case 11:case 15:Co(e),e.flags&2048&&qr(9,e,e.return);break;case 3:Co(e);break;case 12:Co(e);break;case 22:var i=e.stateNode;e.memoizedState!==null&&i._visibility&2&&(e.return===null||e.return.tag!==13)?(i._visibility&=-3,Zl(e)):Co(e);break;default:Co(e)}}function Zl(e){var i=e.deletions;if((e.flags&16)!==0){if(i!==null)for(var r=0;r<i.length;r++){var a=i[r];hi=a,Lg(a,e)}Rg(e)}for(e=e.child;e!==null;){switch(i=e,i.tag){case 0:case 11:case 15:qr(8,i,i.return),Zl(i);break;case 22:r=i.stateNode,r._visibility&2&&(r._visibility&=-3,Zl(i));break;default:Zl(i)}e=e.sibling}}function Lg(e,i){for(;hi!==null;){var r=hi;switch(r.tag){case 0:case 11:case 15:qr(8,r,i);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:ro(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,v=a.return;if(Sg(a),a===r){hi=null;break e}if(d!==null){d.return=v,hi=d;break e}hi=v}}}var ey={getCacheForType:function(e){var i=yi(ni),r=i.data.get(e);return r===void 0&&(r=e(),i.data.set(e,r)),r},cacheSignal:function(){return yi(ni).controller.signal}},ty=typeof WeakMap=="function"?WeakMap:Map,ut=0,yt=null,Ye=null,et=0,pt=0,sn=null,Wr=!1,fa=!1,Nh=!1,br=0,Pt=0,Gr=0,Rs=0,Ih=0,an=0,pa=0,wo=null,qi=null,Hh=!1,Ql=0,Mg=0,Jl=1/0,ec=null,Kr=null,ui=0,Vr=null,_a=null,Sr=0,zh=0,$h=null,Dg=null,Eo=0,Uh=null;function on(){return(ut&2)!==0&&et!==0?et&-et:P.T!==null?Gh():ir()}function Og(){if(an===0)if((et&536870912)===0||nt){var e=jn;jn<<=1,(jn&3932160)===0&&(jn=262144),an=e}else an=536870912;return e=nn.current,e!==null&&(e.flags|=32),an}function Wi(e,i,r){(e===yt&&(pt===2||pt===9)||e.cancelPendingCommit!==null)&&(ga(e,0),Yr(e,et,an,!1)),dt(e,r),((ut&2)===0||e!==yt)&&(e===yt&&((ut&2)===0&&(Rs|=r),Pt===4&&Yr(e,et,an,!1)),Gn(e))}function Bg(e,i,r){if((ut&6)!==0)throw Error(o(327));var a=!r&&(i&127)===0&&(i&e.expiredLanes)===0||he(e,i),d=a?ry(e,i):Ph(e,i,!0),v=a;do{if(d===0){fa&&!a&&Yr(e,i,0,!1);break}else{if(r=e.current.alternate,v&&!iy(r)){d=Ph(e,i,!1),v=!1;continue}if(d===2){if(v=i,e.errorRecoveryDisabledLanes&v)var L=0;else L=e.pendingLanes&-536870913,L=L!==0?L:L&536870912?536870912:0;if(L!==0){i=L;e:{var I=e;d=wo;var G=I.current.memoizedState.isDehydrated;if(G&&(ga(I,L).flags|=256),L=Ph(I,L,!1),L!==2){if(Nh&&!G){I.errorRecoveryDisabledLanes|=v,Rs|=v,d=4;break e}v=qi,qi=d,v!==null&&(qi===null?qi=v:qi.push.apply(qi,v))}d=L}if(v=!1,d!==2)continue}}if(d===1){ga(e,0),Yr(e,i,0,!0);break}e:{switch(a=e,v=d,v){case 0:case 1:throw Error(o(345));case 4:if((i&4194048)!==i)break;case 6:Yr(a,i,an,!Wr);break e;case 2:qi=null;break;case 3:case 5:break;default:throw Error(o(329))}if((i&62914560)===i&&(d=Ql+300-ct(),10<d)){if(Yr(a,i,an,!Wr),X(a,0,!0)!==0)break e;Sr=i,a.timeoutHandle=hm(Ng.bind(null,a,r,qi,ec,Hh,i,an,Rs,pa,Wr,v,"Throttled",-0,0),d);break e}Ng(a,r,qi,ec,Hh,i,an,Rs,pa,Wr,v,null,-0,0)}}break}while(!0);Gn(e)}function Ng(e,i,r,a,d,v,L,I,G,re,ue,fe,se,le){if(e.timeoutHandle=-1,fe=i.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ye},Ag(i,v,fe);var xe=(v&62914560)===v?Ql-ct():(v&4194048)===v?Mg-ct():0;if(xe=Uy(fe,xe),xe!==null){Sr=v,e.cancelPendingCommit=xe(Fg.bind(null,e,i,v,r,a,d,L,I,G,ue,fe,null,se,le)),Yr(e,v,L,!re);return}}Fg(e,i,v,r,a,d,L,I,G)}function iy(e){for(var i=e;;){var r=i.tag;if((r===0||r===11||r===15)&&i.flags&16384&&(r=i.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var a=0;a<r.length;a++){var d=r[a],v=d.getSnapshot;d=d.value;try{if(!en(v(),d))return!1}catch{return!1}}if(r=i.child,i.subtreeFlags&16384&&r!==null)r.return=i,i=r;else{if(i===e)break;for(;i.sibling===null;){if(i.return===null||i.return===e)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Yr(e,i,r,a){i&=~Ih,i&=~Rs,e.suspendedLanes|=i,e.pingedLanes&=~i,a&&(e.warmLanes|=i),a=e.expirationTimes;for(var d=i;0<d;){var v=31-zt(d),L=1<<v;a[v]=-1,d&=~L}r!==0&&Ce(e,r,i)}function tc(){return(ut&6)===0?(xo(0),!1):!0}function jh(){if(Ye!==null){if(pt===0)var e=Ye.return;else e=Ye,cr=bs=null,nh(e),aa=null,ao=0,e=Ye;for(;e!==null;)dg(e.alternate,e),e=e.return;Ye=null}}function ga(e,i){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,Cy(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),Sr=0,jh(),yt=e,Ye=r=or(e.current,null),et=i,pt=0,sn=null,Wr=!1,fa=he(e,i),Nh=!1,pa=an=Ih=Rs=Gr=Pt=0,qi=wo=null,Hh=!1,(i&8)!==0&&(i|=i&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=i;0<a;){var d=31-zt(a),v=1<<d;i|=e[d],a&=~v}return br=i,Cl(),r}function Ig(e,i){qe=null,P.H=_o,i===sa||i===Ll?(i=Qp(),pt=3):i===Wu?(i=Qp(),pt=4):pt=i===bh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,sn=i,Ye===null&&(Pt=1,ql(e,fn(i,e.current)))}function Hg(){var e=nn.current;return e===null?!0:(et&4194048)===et?mn===null:(et&62914560)===et||(et&536870912)!==0?e===mn:!1}function zg(){var e=P.H;return P.H=_o,e===null?_o:e}function $g(){var e=P.A;return P.A=ey,e}function ic(){Pt=4,Wr||(et&4194048)!==et&&nn.current!==null||(fa=!0),(Gr&134217727)===0&&(Rs&134217727)===0||yt===null||Yr(yt,et,an,!1)}function Ph(e,i,r){var a=ut;ut|=2;var d=zg(),v=$g();(yt!==e||et!==i)&&(ec=null,ga(e,i)),i=!1;var L=Pt;e:do try{if(pt!==0&&Ye!==null){var I=Ye,G=sn;switch(pt){case 8:jh(),L=6;break e;case 3:case 2:case 9:case 6:nn.current===null&&(i=!0);var re=pt;if(pt=0,sn=null,ma(e,I,G,re),r&&fa){L=0;break e}break;default:re=pt,pt=0,sn=null,ma(e,I,G,re)}}ny(),L=Pt;break}catch(ue){Ig(e,ue)}while(!0);return i&&e.shellSuspendCounter++,cr=bs=null,ut=a,P.H=d,P.A=v,Ye===null&&(yt=null,et=0,Cl()),L}function ny(){for(;Ye!==null;)Ug(Ye)}function ry(e,i){var r=ut;ut|=2;var a=zg(),d=$g();yt!==e||et!==i?(ec=null,Jl=ct()+500,ga(e,i)):fa=he(e,i);e:do try{if(pt!==0&&Ye!==null){i=Ye;var v=sn;t:switch(pt){case 1:pt=0,sn=null,ma(e,i,v,1);break;case 2:case 9:if(Xp(v)){pt=0,sn=null,jg(i);break}i=function(){pt!==2&&pt!==9||yt!==e||(pt=7),Gn(e)},v.then(i,i);break e;case 3:pt=7;break e;case 4:pt=5;break e;case 7:Xp(v)?(pt=0,sn=null,jg(i)):(pt=0,sn=null,ma(e,i,v,7));break;case 5:var L=null;switch(Ye.tag){case 26:L=Ye.memoizedState;case 5:case 27:var I=Ye;if(L?Tm(L):I.stateNode.complete){pt=0,sn=null;var G=I.sibling;if(G!==null)Ye=G;else{var re=I.return;re!==null?(Ye=re,nc(re)):Ye=null}break t}}pt=0,sn=null,ma(e,i,v,5);break;case 6:pt=0,sn=null,ma(e,i,v,6);break;case 8:jh(),Pt=6;break e;default:throw Error(o(462))}}sy();break}catch(ue){Ig(e,ue)}while(!0);return cr=bs=null,P.H=a,P.A=d,ut=r,Ye!==null?0:(yt=null,et=0,Cl(),Pt)}function sy(){for(;Ye!==null&&!An();)Ug(Ye)}function Ug(e){var i=ug(e.alternate,e,br);e.memoizedProps=e.pendingProps,i===null?nc(e):Ye=i}function jg(e){var i=e,r=i.alternate;switch(i.tag){case 15:case 0:i=rg(r,i,i.pendingProps,i.type,void 0,et);break;case 11:i=rg(r,i,i.pendingProps,i.type.render,i.ref,et);break;case 5:nh(i);default:dg(r,i),i=Ye=$p(i,br),i=ug(r,i,br)}e.memoizedProps=e.pendingProps,i===null?nc(e):Ye=i}function ma(e,i,r,a){cr=bs=null,nh(i),aa=null,ao=0;var d=i.return;try{if(KS(e,d,i,r,et)){Pt=1,ql(e,fn(r,e.current)),Ye=null;return}}catch(v){if(d!==null)throw Ye=d,v;Pt=1,ql(e,fn(r,e.current)),Ye=null;return}i.flags&32768?(nt||a===1?e=!0:fa||(et&536870912)!==0?e=!1:(Wr=e=!0,(a===2||a===9||a===3||a===6)&&(a=nn.current,a!==null&&a.tag===13&&(a.flags|=16384))),Pg(i,e)):nc(i)}function nc(e){var i=e;do{if((i.flags&32768)!==0){Pg(i,Wr);return}e=i.return;var r=XS(i.alternate,i,br);if(r!==null){Ye=r;return}if(i=i.sibling,i!==null){Ye=i;return}Ye=i=e}while(i!==null);Pt===0&&(Pt=5)}function Pg(e,i){do{var r=ZS(e.alternate,e);if(r!==null){r.flags&=32767,Ye=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!i&&(e=e.sibling,e!==null)){Ye=e;return}Ye=e=r}while(e!==null);Pt=6,Ye=null}function Fg(e,i,r,a,d,v,L,I,G){e.cancelPendingCommit=null;do rc();while(ui!==0);if((ut&6)!==0)throw Error(o(327));if(i!==null){if(i===e.current)throw Error(o(177));if(v=i.lanes|i.childLanes,v|=Lu,Ee(e,r,v,L,I,G),e===yt&&(Ye=yt=null,et=0),_a=i,Vr=e,Sr=r,zh=v,$h=d,Dg=a,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,cy(ei,function(){return Vg(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||a){a=P.T,P.T=null,d=V.p,V.p=2,L=ut,ut|=4;try{QS(e,i,r)}finally{ut=L,V.p=d,P.T=a}}ui=1,qg(),Wg(),Gg()}}function qg(){if(ui===1){ui=0;var e=Vr,i=_a,r=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||r){r=P.T,P.T=null;var a=V.p;V.p=2;var d=ut;ut|=4;try{Eg(i,e);var v=ed,L=Lp(e.containerInfo),I=v.focusedElem,G=v.selectionRange;if(L!==I&&I&&I.ownerDocument&&kp(I.ownerDocument.documentElement,I)){if(G!==null&&xu(I)){var re=G.start,ue=G.end;if(ue===void 0&&(ue=re),"selectionStart"in I)I.selectionStart=re,I.selectionEnd=Math.min(ue,I.value.length);else{var fe=I.ownerDocument||document,se=fe&&fe.defaultView||window;if(se.getSelection){var le=se.getSelection(),xe=I.textContent.length,ze=Math.min(G.start,xe),vt=G.end===void 0?ze:Math.min(G.end,xe);!le.extend&&ze>vt&&(L=vt,vt=ze,ze=L);var ie=Rp(I,ze),J=Rp(I,vt);if(ie&&J&&(le.rangeCount!==1||le.anchorNode!==ie.node||le.anchorOffset!==ie.offset||le.focusNode!==J.node||le.focusOffset!==J.offset)){var ne=fe.createRange();ne.setStart(ie.node,ie.offset),le.removeAllRanges(),ze>vt?(le.addRange(ne),le.extend(J.node,J.offset)):(ne.setEnd(J.node,J.offset),le.addRange(ne))}}}}for(fe=[],le=I;le=le.parentNode;)le.nodeType===1&&fe.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof I.focus=="function"&&I.focus(),I=0;I<fe.length;I++){var de=fe[I];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}gc=!!Jh,ed=Jh=null}finally{ut=d,V.p=a,P.T=r}}e.current=i,ui=2}}function Wg(){if(ui===2){ui=0;var e=Vr,i=_a,r=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||r){r=P.T,P.T=null;var a=V.p;V.p=2;var d=ut;ut|=4;try{bg(e,i.alternate,i)}finally{ut=d,V.p=a,P.T=r}}ui=3}}function Gg(){if(ui===4||ui===3){ui=0,Jt();var e=Vr,i=_a,r=Sr,a=Dg;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?ui=5:(ui=0,_a=Vr=null,Kg(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Kr=null),vi(r),i=i.stateNode,Kt&&typeof Kt.onCommitFiberRoot=="function")try{Kt.onCommitFiberRoot(Ii,i,void 0,(i.current.flags&128)===128)}catch{}if(a!==null){i=P.T,d=V.p,V.p=2,P.T=null;try{for(var v=e.onRecoverableError,L=0;L<a.length;L++){var I=a[L];v(I.value,{componentStack:I.stack})}}finally{P.T=i,V.p=d}}(Sr&3)!==0&&rc(),Gn(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===Uh?Eo++:(Eo=0,Uh=e):Eo=0,xo(0)}}function Kg(e,i){(e.pooledCacheLanes&=i)===0&&(i=e.pooledCache,i!=null&&(e.pooledCache=null,ro(i)))}function rc(){return qg(),Wg(),Gg(),Vg()}function Vg(){if(ui!==5)return!1;var e=Vr,i=zh;zh=0;var r=vi(Sr),a=P.T,d=V.p;try{V.p=32>r?32:r,P.T=null,r=$h,$h=null;var v=Vr,L=Sr;if(ui=0,_a=Vr=null,Sr=0,(ut&6)!==0)throw Error(o(331));var I=ut;if(ut|=4,kg(v.current),Tg(v,v.current,L,r),ut=I,xo(0,!1),Kt&&typeof Kt.onPostCommitFiberRoot=="function")try{Kt.onPostCommitFiberRoot(Ii,v)}catch{}return!0}finally{V.p=d,P.T=a,Kg(e,i)}}function Yg(e,i,r){i=fn(r,i),i=vh(e.stateNode,i,2),e=jr(e,i,2),e!==null&&(dt(e,2),Gn(e))}function _t(e,i,r){if(e.tag===3)Yg(e,e,r);else for(;i!==null;){if(i.tag===3){Yg(i,e,r);break}else if(i.tag===1){var a=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Kr===null||!Kr.has(a))){e=fn(r,e),r=X_(2),a=jr(i,r,2),a!==null&&(Z_(r,a,i,e),dt(a,2),Gn(a));break}}i=i.return}}function Fh(e,i,r){var a=e.pingCache;if(a===null){a=e.pingCache=new ty;var d=new Set;a.set(i,d)}else d=a.get(i),d===void 0&&(d=new Set,a.set(i,d));d.has(r)||(Nh=!0,d.add(r),e=ay.bind(null,e,i,r),i.then(e,e))}function ay(e,i,r){var a=e.pingCache;a!==null&&a.delete(i),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,yt===e&&(et&r)===r&&(Pt===4||Pt===3&&(et&62914560)===et&&300>ct()-Ql?(ut&2)===0&&ga(e,0):Ih|=r,pa===et&&(pa=0)),Gn(e)}function Xg(e,i){i===0&&(i=Ie()),e=gs(e,i),e!==null&&(dt(e,i),Gn(e))}function oy(e){var i=e.memoizedState,r=0;i!==null&&(r=i.retryLane),Xg(e,r)}function ly(e,i){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(i),Xg(e,r)}function cy(e,i){return mi(e,i)}var sc=null,va=null,qh=!1,ac=!1,Wh=!1,Xr=0;function Gn(e){e!==va&&e.next===null&&(va===null?sc=va=e:va=va.next=e),ac=!0,qh||(qh=!0,hy())}function xo(e,i){if(!Wh&&ac){Wh=!0;do for(var r=!1,a=sc;a!==null;){if(e!==0){var d=a.pendingLanes;if(d===0)var v=0;else{var L=a.suspendedLanes,I=a.pingedLanes;v=(1<<31-zt(42|e)+1)-1,v&=d&~(L&~I),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(r=!0,em(a,v))}else v=et,v=X(a,a===yt?v:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(v&3)===0||he(a,v)||(r=!0,em(a,v));a=a.next}while(r);Wh=!1}}function uy(){Zg()}function Zg(){ac=qh=!1;var e=0;Xr!==0&&yy()&&(e=Xr);for(var i=ct(),r=null,a=sc;a!==null;){var d=a.next,v=Qg(a,i);v===0?(a.next=null,r===null?sc=d:r.next=d,d===null&&(va=r)):(r=a,(e!==0||(v&3)!==0)&&(ac=!0)),a=d}ui!==0&&ui!==5||xo(e),Xr!==0&&(Xr=0)}function Qg(e,i){for(var r=e.suspendedLanes,a=e.pingedLanes,d=e.expirationTimes,v=e.pendingLanes&-62914561;0<v;){var L=31-zt(v),I=1<<L,G=d[L];G===-1?((I&r)===0||(I&a)!==0)&&(d[L]=ve(I,i)):G<=i&&(e.expiredLanes|=I),v&=~I}if(i=yt,r=et,r=X(e,e===i?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,r===0||e===i&&(pt===2||pt===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(i=r&-r,i===e.callbackPriority)return i;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=Jg.bind(null,e),r=mi(r,a),e.callbackPriority=i,e.callbackNode=r,i}return a!==null&&a!==null&&un(a),e.callbackPriority=2,e.callbackNode=null,2}function Jg(e,i){if(ui!==0&&ui!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(rc()&&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:(Bg(e,a,i),Qg(e,ct()),e.callbackNode!=null&&e.callbackNode===r?Jg.bind(null,e):null)}function em(e,i){if(rc())return null;Bg(e,i,!0)}function hy(){wy(function(){(ut&6)!==0?mi(It,uy):Zg()})}function Gh(){if(Xr===0){var e=na;e===0&&(e=kn,kn<<=1,(kn&261888)===0&&(kn=256)),Xr=e}return Xr}function tm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Or(""+e)}function im(e,i){var r=i.ownerDocument.createElement("input");return r.name=i.name,r.value=i.value,e.id&&r.setAttribute("form",e.id),i.parentNode.insertBefore(r,i),e=new FormData(e),r.parentNode.removeChild(r),e}function dy(e,i,r,a,d){if(i==="submit"&&r&&r.stateNode===d){var v=tm((d[wt]||null).action),L=a.submitter;L&&(i=(i=L[wt]||null)?tm(i.formAction):L.getAttribute("formAction"),i!==null&&(v=i,L=null));var I=new vl("action","action",null,a,d);e.push({event:I,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Xr!==0){var G=L?im(d,L):new FormData(d);dh(r,{pending:!0,data:G,method:d.method,action:v},null,G)}}else typeof v=="function"&&(I.preventDefault(),G=L?im(d,L):new FormData(d),dh(r,{pending:!0,data:G,method:d.method,action:v},v,G))},currentTarget:d}]})}}for(var Kh=0;Kh<ku.length;Kh++){var Vh=ku[Kh],fy=Vh.toLowerCase(),py=Vh[0].toUpperCase()+Vh.slice(1);Mn(fy,"on"+py)}Mn(Op,"onAnimationEnd"),Mn(Bp,"onAnimationIteration"),Mn(Np,"onAnimationStart"),Mn("dblclick","onDoubleClick"),Mn("focusin","onFocus"),Mn("focusout","onBlur"),Mn(LS,"onTransitionRun"),Mn(MS,"onTransitionStart"),Mn(DS,"onTransitionCancel"),Mn(Ip,"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 To="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(" "),_y=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(To));function nm(e,i){i=(i&4)!==0;for(var r=0;r<e.length;r++){var a=e[r],d=a.event;a=a.listeners;e:{var v=void 0;if(i)for(var L=a.length-1;0<=L;L--){var I=a[L],G=I.instance,re=I.currentTarget;if(I=I.listener,G!==v&&d.isPropagationStopped())break e;v=I,d.currentTarget=re;try{v(d)}catch(ue){yl(ue)}d.currentTarget=null,v=G}else for(L=0;L<a.length;L++){if(I=a[L],G=I.instance,re=I.currentTarget,I=I.listener,G!==v&&d.isPropagationStopped())break e;v=I,d.currentTarget=re;try{v(d)}catch(ue){yl(ue)}d.currentTarget=null,v=G}}}}function Xe(e,i){var r=i[Mr];r===void 0&&(r=i[Mr]=new Set);var a=e+"__bubble";r.has(a)||(rm(i,e,2,!1),r.add(a))}function Yh(e,i,r){var a=0;i&&(a|=4),rm(r,e,a,i)}var oc="_reactListening"+Math.random().toString(36).slice(2);function Xh(e){if(!e[oc]){e[oc]=!0,Tt.forEach(function(r){r!=="selectionchange"&&(_y.has(r)||Yh(r,!1,e),Yh(r,!0,e))});var i=e.nodeType===9?e:e.ownerDocument;i===null||i[oc]||(i[oc]=!0,Yh("selectionchange",!1,i))}}function rm(e,i,r,a){switch(Om(i)){case 2:var d=Fy;break;case 8:d=qy;break;default:d=hd}r=d.bind(null,i,r,e),d=void 0,!gu||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(d=!0),a?d!==void 0?e.addEventListener(i,r,{capture:!0,passive:d}):e.addEventListener(i,r,!0):d!==void 0?e.addEventListener(i,r,{passive:d}):e.addEventListener(i,r,!1)}function Zh(e,i,r,a,d){var v=a;if((i&1)===0&&(i&2)===0&&a!==null)e:for(;;){if(a===null)return;var L=a.tag;if(L===3||L===4){var I=a.stateNode.containerInfo;if(I===d)break;if(L===4)for(L=a.return;L!==null;){var G=L.tag;if((G===3||G===4)&&L.stateNode.containerInfo===d)return;L=L.return}for(;I!==null;){if(L=q(I),L===null)return;if(G=L.tag,G===5||G===6||G===26||G===27){a=v=L;continue e}I=I.parentNode}}a=a.return}pl(function(){var re=v,ue=Fe(r),fe=[];e:{var se=Hp.get(e);if(se!==void 0){var le=vl,xe=e;switch(e){case"keypress":if(gl(r)===0)break e;case"keydown":case"keyup":le=lS;break;case"focusin":xe="focus",le=Su;break;case"focusout":xe="blur",le=Su;break;case"beforeblur":case"afterblur":le=Su;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=dp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=Xb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=hS;break;case Op:case Bp:case Np:le=Jb;break;case Ip:le=fS;break;case"scroll":case"scrollend":le=Vb;break;case"wheel":le=_S;break;case"copy":case"cut":case"paste":le=tS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=pp;break;case"toggle":case"beforetoggle":le=mS}var ze=(i&4)!==0,vt=!ze&&(e==="scroll"||e==="scrollend"),ie=ze?se!==null?se+"Capture":null:se;ze=[];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||ie===null||(de=Ka(J,ie),de!=null&&ze.push(Ao(J,de,ne))),vt)break;J=J.return}0<ze.length&&(se=new le(se,xe,null,r,ue),fe.push({event:se,listeners:ze}))}}if((i&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&&(vt=y(xe),ze=xe.tag,xe!==vt||ze!==5&&ze!==27&&ze!==6)&&(xe=null)):(le=null,xe=re),le!==xe)){if(ze=dp,de="onMouseLeave",ie="onMouseEnter",J="mouse",(e==="pointerout"||e==="pointerover")&&(ze=pp,de="onPointerLeave",ie="onPointerEnter",J="pointer"),vt=le==null?se:we(le),ne=xe==null?se:we(xe),se=new ze(de,J+"leave",le,r,ue),se.target=vt,se.relatedTarget=ne,de=null,q(ue)===re&&(ze=new ze(ie,J+"enter",xe,r,ue),ze.target=ne,ze.relatedTarget=vt,de=ze),vt=de,le&&xe)t:{for(ze=gy,ie=le,J=xe,ne=0,de=ie;de;de=ze(de))ne++;de=0;for(var Ne=J;Ne;Ne=ze(Ne))de++;for(;0<ne-de;)ie=ze(ie),ne--;for(;0<de-ne;)J=ze(J),de--;for(;ne--;){if(ie===J||J!==null&&ie===J.alternate){ze=ie;break t}ie=ze(ie),J=ze(J)}ze=null}else ze=null;le!==null&&sm(fe,se,le,ze,!1),xe!==null&&vt!==null&&sm(fe,vt,xe,ze,!0)}}e:{if(se=re?we(re):window,le=se.nodeName&&se.nodeName.toLowerCase(),le==="select"||le==="input"&&se.type==="file")var at=Cp;else if(Sp(se))if(wp)at=AS;else{at=xS;var Re=ES}else le=se.nodeName,!le||le.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?re&&Dr(re.elementType)&&(at=Cp):at=TS;if(at&&(at=at(e,re))){yp(fe,at,r,ue);break e}Re&&Re(e,se,re),e==="focusout"&&re&&se.type==="number"&&re.memoizedProps.value!=null&&Gs(se,"number",se.value)}switch(Re=re?we(re):window,e){case"focusin":(Sp(Re)||Re.contentEditable==="true")&&(Ys=Re,Tu=re,to=null);break;case"focusout":to=Tu=Ys=null;break;case"mousedown":Au=!0;break;case"contextmenu":case"mouseup":case"dragend":Au=!1,Mp(fe,r,ue);break;case"selectionchange":if(kS)break;case"keydown":case"keyup":Mp(fe,r,ue)}var We;if(Cu)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 Vs?vp(e,r)&&(tt="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(tt="onCompositionStart");tt&&(_p&&r.locale!=="ko"&&(Vs||tt!=="onCompositionStart"?tt==="onCompositionEnd"&&Vs&&(We=up()):(Br=ue,mu="value"in Br?Br.value:Br.textContent,Vs=!0)),Re=lc(re,tt),0<Re.length&&(tt=new fp(tt,e,null,r,ue),fe.push({event:tt,listeners:Re}),We?tt.data=We:(We=bp(r),We!==null&&(tt.data=We)))),(We=bS?SS(e,r):yS(e,r))&&(tt=lc(re,"onBeforeInput"),0<tt.length&&(Re=new fp("onBeforeInput","beforeinput",null,r,ue),fe.push({event:Re,listeners:tt}),Re.data=We)),dy(fe,e,re,r,ue)}nm(fe,i)})}function Ao(e,i,r){return{instance:e,listener:i,currentTarget:r}}function lc(e,i){for(var r=i+"Capture",a=[];e!==null;){var d=e,v=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||v===null||(d=Ka(e,r),d!=null&&a.unshift(Ao(e,d,v)),d=Ka(e,i),d!=null&&a.push(Ao(e,d,v))),e.tag===3)return a;e=e.return}return[]}function gy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function sm(e,i,r,a,d){for(var v=i._reactName,L=[];r!==null&&r!==a;){var I=r,G=I.alternate,re=I.stateNode;if(I=I.tag,G!==null&&G===a)break;I!==5&&I!==26&&I!==27||re===null||(G=re,d?(re=Ka(r,v),re!=null&&L.unshift(Ao(r,re,G))):d||(re=Ka(r,v),re!=null&&L.push(Ao(r,re,G)))),r=r.return}L.length!==0&&e.push({event:i,listeners:L})}var my=/\r\n?/g,vy=/\u0000|\uFFFD/g;function am(e){return(typeof e=="string"?e:""+e).replace(my,`
9
- `).replace(vy,"")}function om(e,i){return i=am(i),am(e)===i}function mt(e,i,r,a,d,v){switch(r){case"children":typeof a=="string"?i==="body"||i==="textarea"&&a===""||Ue(e,a):(typeof a=="number"||typeof a=="bigint")&&i!=="body"&&Ue(e,""+a);break;case"className":Qi(e,"class",a);break;case"tabIndex":Qi(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Qi(e,r,a);break;case"style":ft(e,a,v);break;case"data":if(i!=="object"){Qi(e,"data",a);break}case"src":case"href":if(a===""&&(i!=="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 v=="function"&&(r==="formAction"?(i!=="input"&&mt(e,i,"name",d.name,d,null),mt(e,i,"formEncType",d.formEncType,d,null),mt(e,i,"formMethod",d.formMethod,d,null),mt(e,i,"formTarget",d.formTarget,d,null)):(mt(e,i,"encType",d.encType,d,null),mt(e,i,"method",d.method,d,null),mt(e,i,"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 Qh(e,i,r,a,d,v){switch(r){case"style":ft(e,a,v);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"?Ue(e,a):(typeof a=="number"||typeof a=="bigint")&&Ue(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"),i=r.slice(2,d?r.length-7:void 0),v=e[wt]||null,v=v!=null?v[r]:null,typeof v=="function"&&e.removeEventListener(i,v,d),typeof a=="function")){typeof v!="function"&&v!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(i,a,d);break e}r in e?e[r]=a:a===!0?e.setAttribute(r,""):Ai(e,r,a)}}}function wi(e,i,r){switch(i){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,v;for(v in r)if(r.hasOwnProperty(v)){var L=r[v];if(L!=null)switch(v){case"src":a=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,i));default:mt(e,i,v,L,r,null)}}d&&mt(e,i,"srcSet",r.srcSet,r,null),a&&mt(e,i,"src",r.src,r,null);return;case"input":Xe("invalid",e);var I=v=L=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":L=ue;break;case"checked":G=ue;break;case"defaultChecked":re=ue;break;case"value":v=ue;break;case"defaultValue":I=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(o(137,i));break;default:mt(e,i,a,ue,r,null)}}ds(e,v,I,G,re,L,d,!1);return;case"select":Xe("invalid",e),a=L=v=null;for(d in r)if(r.hasOwnProperty(d)&&(I=r[d],I!=null))switch(d){case"value":v=I;break;case"defaultValue":L=I;break;case"multiple":a=I;default:mt(e,i,d,I,r,null)}i=v,r=L,e.multiple=!!a,i!=null?bi(e,!!a,i,!1):r!=null&&bi(e,!!a,r,!0);return;case"textarea":Xe("invalid",e),v=d=a=null;for(L in r)if(r.hasOwnProperty(L)&&(I=r[L],I!=null))switch(L){case"value":a=I;break;case"defaultValue":d=I;break;case"children":v=I;break;case"dangerouslySetInnerHTML":if(I!=null)throw Error(o(91));break;default:mt(e,i,L,I,r,null)}Ks(e,a,d,v);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":mt(e,i,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<To.length;a++)Xe(To[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,i));default:mt(e,i,re,a,r,null)}return;default:if(Dr(i)){for(ue in r)r.hasOwnProperty(ue)&&(a=r[ue],a!==void 0&&Qh(e,i,ue,a,r,void 0));return}}for(I in r)r.hasOwnProperty(I)&&(a=r[I],a!=null&&mt(e,i,I,a,r,null))}function by(e,i,r,a){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,v=null,L=null,I=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)||mt(e,i,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":v=le;break;case"name":d=le;break;case"checked":re=le;break;case"defaultChecked":ue=le;break;case"value":L=le;break;case"defaultValue":I=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(o(137,i));break;default:le!==fe&&mt(e,i,se,le,a,fe)}}qa(e,L,I,G,re,ue,v,d);return;case"select":le=L=I=se=null;for(v in r)if(G=r[v],r.hasOwnProperty(v)&&G!=null)switch(v){case"value":break;case"multiple":le=G;default:a.hasOwnProperty(v)||mt(e,i,v,null,a,G)}for(d in a)if(v=a[d],G=r[d],a.hasOwnProperty(d)&&(v!=null||G!=null))switch(d){case"value":se=v;break;case"defaultValue":I=v;break;case"multiple":L=v;default:v!==G&&mt(e,i,d,v,a,G)}i=I,r=L,a=le,se!=null?bi(e,!!r,se,!1):!!a!=!!r&&(i!=null?bi(e,!!r,i,!0):bi(e,!!r,r?[]:"",!1));return;case"textarea":le=se=null;for(I in r)if(d=r[I],r.hasOwnProperty(I)&&d!=null&&!a.hasOwnProperty(I))switch(I){case"value":break;case"children":break;default:mt(e,i,I,null,a,d)}for(L in a)if(d=a[L],v=r[L],a.hasOwnProperty(L)&&(d!=null||v!=null))switch(L){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!==v&&mt(e,i,L,d,a,v)}dl(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:mt(e,i,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":mt(e,i,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 ze in r)se=r[ze],r.hasOwnProperty(ze)&&se!=null&&!a.hasOwnProperty(ze)&&mt(e,i,ze,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,i));break;default:mt(e,i,re,se,a,le)}return;default:if(Dr(i)){for(var vt in r)se=r[vt],r.hasOwnProperty(vt)&&se!==void 0&&!a.hasOwnProperty(vt)&&Qh(e,i,vt,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||Qh(e,i,ue,se,a,le);return}}for(var ie in r)se=r[ie],r.hasOwnProperty(ie)&&se!=null&&!a.hasOwnProperty(ie)&&mt(e,i,ie,null,a,se);for(fe in a)se=a[fe],le=r[fe],!a.hasOwnProperty(fe)||se===le||se==null&&le==null||mt(e,i,fe,se,a,le)}function lm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Sy(){if(typeof performance.getEntriesByType=="function"){for(var e=0,i=0,r=performance.getEntriesByType("resource"),a=0;a<r.length;a++){var d=r[a],v=d.transferSize,L=d.initiatorType,I=d.duration;if(v&&I&&lm(L)){for(L=0,I=d.responseEnd,a+=1;a<r.length;a++){var G=r[a],re=G.startTime;if(re>I)break;var ue=G.transferSize,fe=G.initiatorType;ue&&lm(fe)&&(G=G.responseEnd,L+=ue*(G<I?1:(I-re)/(G-re)))}if(--a,i+=8*(v+L)/(d.duration/1e3),e++,10<e)break}}if(0<e)return i/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Jh=null,ed=null;function cc(e){return e.nodeType===9?e:e.ownerDocument}function cm(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 um(e,i){if(e===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&i==="foreignObject"?0:e}function td(e,i){return e==="textarea"||e==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var id=null;function yy(){var e=window.event;return e&&e.type==="popstate"?e===id?!1:(id=e,!0):(id=null,!1)}var hm=typeof setTimeout=="function"?setTimeout:void 0,Cy=typeof clearTimeout=="function"?clearTimeout:void 0,dm=typeof Promise=="function"?Promise:void 0,wy=typeof queueMicrotask=="function"?queueMicrotask:typeof dm<"u"?function(e){return dm.resolve(null).then(e).catch(Ey)}:hm;function Ey(e){setTimeout(function(){throw e})}function Zr(e){return e==="head"}function fm(e,i){var r=i,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),Ca(i);return}a--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")a++;else if(r==="html")Ro(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,Ro(r);for(var v=r.firstChild;v;){var L=v.nextSibling,I=v.nodeName;v[Pn]||I==="SCRIPT"||I==="STYLE"||I==="LINK"&&v.rel.toLowerCase()==="stylesheet"||r.removeChild(v),v=L}}else r==="body"&&Ro(e.ownerDocument.body);r=d}while(r);Ca(i)}function pm(e,i){var r=e;e=0;do{var a=r.nextSibling;if(r.nodeType===1?i?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(i?(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 nd(e){var i=e.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var r=i;switch(i=i.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":nd(r),De(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function xy(e,i,r,a){for(;e.nodeType===1;){var d=r;if(e.nodeName.toLowerCase()!==i.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[Pn])switch(i){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(v=e.getAttribute("rel"),v==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(v!==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(v=e.getAttribute("src"),(v!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&v&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(i==="input"&&e.type==="hidden"){var v=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===v)return e}else return e;if(e=vn(e.nextSibling),e===null)break}return null}function Ty(e,i,r){if(i==="")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 _m(e,i){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=vn(e.nextSibling),e===null))return null;return e}function rd(e){return e.data==="$?"||e.data==="$~"}function sd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Ay(e,i){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=i;else if(e.data!=="$?"||r.readyState!=="loading")i();else{var a=function(){i(),r.removeEventListener("DOMContentLoaded",a)};r.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function vn(e){for(;e!=null;e=e.nextSibling){var i=e.nodeType;if(i===1||i===3)break;if(i===8){if(i=e.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return e}var ad=null;function gm(e){e=e.nextSibling;for(var i=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(i===0)return vn(e.nextSibling);i--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||i++}e=e.nextSibling}return null}function mm(e){e=e.previousSibling;for(var i=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(i===0)return e;i--}else r!=="/$"&&r!=="/&"||i++}e=e.previousSibling}return null}function vm(e,i,r){switch(i=cc(r),e){case"html":if(e=i.documentElement,!e)throw Error(o(452));return e;case"head":if(e=i.head,!e)throw Error(o(453));return e;case"body":if(e=i.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Ro(e){for(var i=e.attributes;i.length;)e.removeAttributeNode(i[0]);De(e)}var bn=new Map,bm=new Set;function uc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var yr=V.d;V.d={f:Ry,r:ky,D:Ly,C:My,L:Dy,m:Oy,X:Ny,S:By,M:Iy};function Ry(){var e=yr.f(),i=tc();return e||i}function ky(e){var i=pe(e);i!==null&&i.tag===5&&i.type==="form"?I_(i):yr.r(e)}var ba=typeof document>"u"?null:document;function Sm(e,i,r){var a=ba;if(a&&typeof i=="string"&&i){var d=$i(i);d='link[rel="'+e+'"][href="'+d+'"]',typeof r=="string"&&(d+='[crossorigin="'+r+'"]'),bm.has(d)||(bm.add(d),e={rel:e,crossOrigin:r,href:i},a.querySelector(d)===null&&(i=a.createElement("link"),wi(i,"link",e),Ve(i),a.head.appendChild(i)))}}function Ly(e){yr.D(e),Sm("dns-prefetch",e,null)}function My(e,i){yr.C(e,i),Sm("preconnect",e,i)}function Dy(e,i,r){yr.L(e,i,r);var a=ba;if(a&&e&&i){var d='link[rel="preload"][as="'+$i(i)+'"]';i==="image"&&r&&r.imageSrcSet?(d+='[imagesrcset="'+$i(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(d+='[imagesizes="'+$i(r.imageSizes)+'"]')):d+='[href="'+$i(e)+'"]';var v=d;switch(i){case"style":v=Sa(e);break;case"script":v=ya(e)}bn.has(v)||(e=f({rel:"preload",href:i==="image"&&r&&r.imageSrcSet?void 0:e,as:i},r),bn.set(v,e),a.querySelector(d)!==null||i==="style"&&a.querySelector(ko(v))||i==="script"&&a.querySelector(Lo(v))||(i=a.createElement("link"),wi(i,"link",e),Ve(i),a.head.appendChild(i)))}}function Oy(e,i){yr.m(e,i);var r=ba;if(r&&e){var a=i&&typeof i.as=="string"?i.as:"script",d='link[rel="modulepreload"][as="'+$i(a)+'"][href="'+$i(e)+'"]',v=d;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=ya(e)}if(!bn.has(v)&&(e=f({rel:"modulepreload",href:e},i),bn.set(v,e),r.querySelector(d)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Lo(v)))return}a=r.createElement("link"),wi(a,"link",e),Ve(a),r.head.appendChild(a)}}}function By(e,i,r){yr.S(e,i,r);var a=ba;if(a&&e){var d=it(a).hoistableStyles,v=Sa(e);i=i||"default";var L=d.get(v);if(!L){var I={loading:0,preload:null};if(L=a.querySelector(ko(v)))I.loading=5;else{e=f({rel:"stylesheet",href:e,"data-precedence":i},r),(r=bn.get(v))&&od(e,r);var G=L=a.createElement("link");Ve(G),wi(G,"link",e),G._p=new Promise(function(re,ue){G.onload=re,G.onerror=ue}),G.addEventListener("load",function(){I.loading|=1}),G.addEventListener("error",function(){I.loading|=2}),I.loading|=4,hc(L,i,a)}L={type:"stylesheet",instance:L,count:1,state:I},d.set(v,L)}}}function Ny(e,i){yr.X(e,i);var r=ba;if(r&&e){var a=it(r).hoistableScripts,d=ya(e),v=a.get(d);v||(v=r.querySelector(Lo(d)),v||(e=f({src:e,async:!0},i),(i=bn.get(d))&&ld(e,i),v=r.createElement("script"),Ve(v),wi(v,"link",e),r.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},a.set(d,v))}}function Iy(e,i){yr.M(e,i);var r=ba;if(r&&e){var a=it(r).hoistableScripts,d=ya(e),v=a.get(d);v||(v=r.querySelector(Lo(d)),v||(e=f({src:e,async:!0,type:"module"},i),(i=bn.get(d))&&ld(e,i),v=r.createElement("script"),Ve(v),wi(v,"link",e),r.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},a.set(d,v))}}function ym(e,i,r,a){var d=(d=me.current)?uc(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"?(i=Sa(r.href),r=it(d).hoistableStyles,a=r.get(i),a||(a={type:"style",instance:null,count:0,state:null},r.set(i,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=Sa(r.href);var v=it(d).hoistableStyles,L=v.get(e);if(L||(d=d.ownerDocument||d,L={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(e,L),(v=d.querySelector(ko(e)))&&!v._p&&(L.instance=v,L.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),v||Hy(d,e,r,L.state))),i&&a===null)throw Error(o(528,""));return L}if(i&&a!==null)throw Error(o(529,""));return null;case"script":return i=r.async,r=r.src,typeof r=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ya(r),r=it(d).hoistableScripts,a=r.get(i),a||(a={type:"script",instance:null,count:0,state:null},r.set(i,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Sa(e){return'href="'+$i(e)+'"'}function ko(e){return'link[rel="stylesheet"]['+e+"]"}function Cm(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Hy(e,i,r,a){e.querySelector('link[rel="preload"][as="style"]['+i+"]")?a.loading=1:(i=e.createElement("link"),a.preload=i,i.addEventListener("load",function(){return a.loading|=1}),i.addEventListener("error",function(){return a.loading|=2}),wi(i,"link",r),Ve(i),e.head.appendChild(i))}function ya(e){return'[src="'+$i(e)+'"]'}function Lo(e){return"script[async]"+e}function wm(e,i,r){if(i.count++,i.instance===null)switch(i.type){case"style":var a=e.querySelector('style[data-href~="'+$i(r.href)+'"]');if(a)return i.instance=a,Ve(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"),Ve(a),wi(a,"style",d),hc(a,r.precedence,e),i.instance=a;case"stylesheet":d=Sa(r.href);var v=e.querySelector(ko(d));if(v)return i.state.loading|=4,i.instance=v,Ve(v),v;a=Cm(r),(d=bn.get(d))&&od(a,d),v=(e.ownerDocument||e).createElement("link"),Ve(v);var L=v;return L._p=new Promise(function(I,G){L.onload=I,L.onerror=G}),wi(v,"link",a),i.state.loading|=4,hc(v,r.precedence,e),i.instance=v;case"script":return v=ya(r.src),(d=e.querySelector(Lo(v)))?(i.instance=d,Ve(d),d):(a=r,(d=bn.get(v))&&(a=f({},r),ld(a,d)),e=e.ownerDocument||e,d=e.createElement("script"),Ve(d),wi(d,"link",a),e.head.appendChild(d),i.instance=d);case"void":return null;default:throw Error(o(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(a=i.instance,i.state.loading|=4,hc(a,r.precedence,e));return i.instance}function hc(e,i,r){for(var a=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=a.length?a[a.length-1]:null,v=d,L=0;L<a.length;L++){var I=a[L];if(I.dataset.precedence===i)v=I;else if(v!==d)break}v?v.parentNode.insertBefore(e,v.nextSibling):(i=r.nodeType===9?r.head:r,i.insertBefore(e,i.firstChild))}function od(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.title==null&&(e.title=i.title)}function ld(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.integrity==null&&(e.integrity=i.integrity)}var dc=null;function Em(e,i,r){if(dc===null){var a=new Map,d=dc=new Map;d.set(r,a)}else d=dc,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 v=r[d];if(!(v[Pn]||v[xt]||e==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var L=v.getAttribute(i)||"";L=e+L;var I=a.get(L);I?I.push(v):a.set(L,[v])}}return a}function xm(e,i,r){e=e.ownerDocument||e,e.head.insertBefore(r,i==="title"?e.querySelector("head > title"):null)}function zy(e,i,r){if(r===1||i.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(e=i.disabled,typeof i.precedence=="string"&&e==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Tm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function $y(e,i,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=Sa(a.href),v=i.querySelector(ko(d));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(e.count++,e=fc.bind(e),i.then(e,e)),r.state.loading|=4,r.instance=v,Ve(v);return}v=i.ownerDocument||i,a=Cm(a),(d=bn.get(d))&&od(a,d),v=v.createElement("link"),Ve(v);var L=v;L._p=new Promise(function(I,G){L.onload=I,L.onerror=G}),wi(v,"link",a),r.instance=v}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,i),(i=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=fc.bind(e),i.addEventListener("load",r),i.addEventListener("error",r))}}var cd=0;function Uy(e,i){return e.stylesheets&&e.count===0&&_c(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var a=setTimeout(function(){if(e.stylesheets&&_c(e,e.stylesheets),e.unsuspend){var v=e.unsuspend;e.unsuspend=null,v()}},6e4+i);0<e.imgBytes&&cd===0&&(cd=62500*Sy());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&_c(e,e.stylesheets),e.unsuspend)){var v=e.unsuspend;e.unsuspend=null,v()}},(e.imgBytes>cd?50:800)+i);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(d)}}:null}function fc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)_c(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var pc=null;function _c(e,i){e.stylesheets=null,e.unsuspend!==null&&(e.count++,pc=new Map,i.forEach(jy,e),pc=null,fc.call(e))}function jy(e,i){if(!(i.state.loading&4)){var r=pc.get(e);if(r)var a=r.get(null);else{r=new Map,pc.set(e,r);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<d.length;v++){var L=d[v];(L.nodeName==="LINK"||L.getAttribute("media")!=="not all")&&(r.set(L.dataset.precedence,L),a=L)}a&&r.set(null,a)}d=i.instance,L=d.getAttribute("data-precedence"),v=r.get(L)||a,v===a&&r.set(null,d),r.set(L,d),this.count++,a=fc.bind(this),d.addEventListener("load",a),d.addEventListener("error",a),v?v.parentNode.insertBefore(d,v.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),i.state.loading|=4}}var Mo={$$typeof:m,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function Py(e,i,r,a,d,v,L,I,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=v,this.onRecoverableError=L,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function Am(e,i,r,a,d,v,L,I,G,re,ue,fe){return e=new Py(e,i,r,L,G,re,ue,fe,I),i=1,v===!0&&(i|=24),v=tn(3,null,null,i),e.current=v,v.stateNode=e,i=Pu(),i.refCount++,e.pooledCache=i,i.refCount++,v.memoizedState={element:a,isDehydrated:r,cache:i},Gu(v),e}function Rm(e){return e?(e=Qs,e):Qs}function km(e,i,r,a,d,v){d=Rm(d),a.context===null?a.context=d:a.pendingContext=d,a=Ur(i),a.payload={element:r},v=v===void 0?null:v,v!==null&&(a.callback=v),r=jr(e,a,i),r!==null&&(Wi(r,e,i),lo(r,e,i))}function Lm(e,i){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<i?r:i}}function ud(e,i){Lm(e,i),(e=e.alternate)&&Lm(e,i)}function Mm(e){if(e.tag===13||e.tag===31){var i=gs(e,67108864);i!==null&&Wi(i,e,67108864),ud(e,67108864)}}function Dm(e){if(e.tag===13||e.tag===31){var i=on();i=Qe(i);var r=gs(e,i);r!==null&&Wi(r,e,i),ud(e,i)}}var gc=!0;function Fy(e,i,r,a){var d=P.T;P.T=null;var v=V.p;try{V.p=2,hd(e,i,r,a)}finally{V.p=v,P.T=d}}function qy(e,i,r,a){var d=P.T;P.T=null;var v=V.p;try{V.p=8,hd(e,i,r,a)}finally{V.p=v,P.T=d}}function hd(e,i,r,a){if(gc){var d=dd(a);if(d===null)Zh(e,i,a,mc,r),Bm(e,a);else if(Gy(d,e,i,r,a))a.stopPropagation();else if(Bm(e,a),i&4&&-1<Wy.indexOf(e)){for(;d!==null;){var v=pe(d);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var L=ti(v.pendingLanes);if(L!==0){var I=v;for(I.pendingLanes|=2,I.entangledLanes|=2;L;){var G=1<<31-zt(L);I.entanglements[1]|=G,L&=~G}Gn(v),(ut&6)===0&&(Jl=ct()+500,xo(0))}}break;case 31:case 13:I=gs(v,2),I!==null&&Wi(I,v,2),tc(),ud(v,2)}if(v=dd(a),v===null&&Zh(e,i,a,mc,r),v===d)break;d=v}d!==null&&a.stopPropagation()}else Zh(e,i,a,null,r)}}function dd(e){return e=Fe(e),fd(e)}var mc=null;function fd(e){if(mc=null,e=q(e),e!==null){var i=y(e);if(i===null)e=null;else{var r=i.tag;if(r===13){if(e=S(i),e!==null)return e;e=null}else if(r===31){if(e=c(i),e!==null)return e;e=null}else if(r===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;e=null}else i!==e&&(e=null)}}return mc=e,null}function Om(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 Rn:return 32;case Ti:return 268435456;default:return 32}default:return 32}}var pd=!1,Qr=null,Jr=null,es=null,Do=new Map,Oo=new Map,ts=[],Wy="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 Bm(e,i){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":Do.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oo.delete(i.pointerId)}}function Bo(e,i,r,a,d,v){return e===null||e.nativeEvent!==v?(e={blockedOn:i,domEventName:r,eventSystemFlags:a,nativeEvent:v,targetContainers:[d]},i!==null&&(i=pe(i),i!==null&&Mm(i)),e):(e.eventSystemFlags|=a,i=e.targetContainers,d!==null&&i.indexOf(d)===-1&&i.push(d),e)}function Gy(e,i,r,a,d){switch(i){case"focusin":return Qr=Bo(Qr,e,i,r,a,d),!0;case"dragenter":return Jr=Bo(Jr,e,i,r,a,d),!0;case"mouseover":return es=Bo(es,e,i,r,a,d),!0;case"pointerover":var v=d.pointerId;return Do.set(v,Bo(Do.get(v)||null,e,i,r,a,d)),!0;case"gotpointercapture":return v=d.pointerId,Oo.set(v,Bo(Oo.get(v)||null,e,i,r,a,d)),!0}return!1}function Nm(e){var i=q(e.target);if(i!==null){var r=y(i);if(r!==null){if(i=r.tag,i===13){if(i=S(r),i!==null){e.blockedOn=i,nr(e.priority,function(){Dm(r)});return}}else if(i===31){if(i=c(r),i!==null){e.blockedOn=i,nr(e.priority,function(){Dm(r)});return}}else if(i===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function vc(e){if(e.blockedOn!==null)return!1;for(var i=e.targetContainers;0<i.length;){var r=dd(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 i=pe(r),i!==null&&Mm(i),e.blockedOn=r,!1;i.shift()}return!0}function Im(e,i,r){vc(e)&&r.delete(i)}function Ky(){pd=!1,Qr!==null&&vc(Qr)&&(Qr=null),Jr!==null&&vc(Jr)&&(Jr=null),es!==null&&vc(es)&&(es=null),Do.forEach(Im),Oo.forEach(Im)}function bc(e,i){e.blockedOn===i&&(e.blockedOn=null,pd||(pd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ky)))}var Sc=null;function Hm(e){Sc!==e&&(Sc=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Sc===e&&(Sc=null);for(var i=0;i<e.length;i+=3){var r=e[i],a=e[i+1],d=e[i+2];if(typeof a!="function"){if(fd(a||r)===null)continue;break}var v=pe(r);v!==null&&(e.splice(i,3),i-=3,dh(v,{pending:!0,data:d,method:r.method,action:a},a,d))}}))}function Ca(e){function i(G){return bc(G,e)}Qr!==null&&bc(Qr,e),Jr!==null&&bc(Jr,e),es!==null&&bc(es,e),Do.forEach(i),Oo.forEach(i);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);)Nm(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],v=r[a+1],L=d[wt]||null;if(typeof v=="function")L||Hm(r);else if(L){var I=null;if(v&&v.hasAttribute("formAction")){if(d=v,L=v[wt]||null)I=L.formAction;else if(fd(d)!==null)continue}else I=L.action;typeof I=="function"?r[a+1]=I:(r.splice(a,3),a-=3),Hm(r)}}}function zm(){function e(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(L){return d=L})},focusReset:"manual",scroll:"manual"})}function i(){d!==null&&(d(),d=null),a||setTimeout(r,20)}function r(){if(!a&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(r,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),d!==null&&(d(),d=null)}}}function _d(e){this._internalRoot=e}yc.prototype.render=_d.prototype.render=function(e){var i=this._internalRoot;if(i===null)throw Error(o(409));var r=i.current,a=on();km(r,a,e,i,null,null)},yc.prototype.unmount=_d.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var i=e.containerInfo;km(e.current,2,null,e,null,null),tc(),i[Ln]=null}};function yc(e){this._internalRoot=e}yc.prototype.unstable_scheduleHydration=function(e){if(e){var i=ir();e={blockedOn:null,target:e,priority:i};for(var r=0;r<ts.length&&i!==0&&i<ts[r].priority;r++);ts.splice(r,0,e),r===0&&Nm(e)}};var $m=n.version;if($m!=="19.2.7")throw Error(o(527,$m,"19.2.7"));V.findDOMNode=function(e){var i=e._reactInternals;if(i===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=h(i),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var Vy={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Cc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Cc.isDisabled&&Cc.supportsFiber)try{Ii=Cc.inject(Vy),Kt=Cc}catch{}}return Io.createRoot=function(e,i){if(!l(e))throw Error(o(299));var r=!1,a="",d=G_,v=K_,L=V_;return i!=null&&(i.unstable_strictMode===!0&&(r=!0),i.identifierPrefix!==void 0&&(a=i.identifierPrefix),i.onUncaughtError!==void 0&&(d=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(L=i.onRecoverableError)),i=Am(e,1,!1,null,null,r,a,null,d,v,L,zm),e[Ln]=i.current,Xh(e),new _d(i)},Io.hydrateRoot=function(e,i,r){if(!l(e))throw Error(o(299));var a=!1,d="",v=G_,L=K_,I=V_,G=null;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(v=r.onUncaughtError),r.onCaughtError!==void 0&&(L=r.onCaughtError),r.onRecoverableError!==void 0&&(I=r.onRecoverableError),r.formState!==void 0&&(G=r.formState)),i=Am(e,1,!0,i,r??null,a,d,G,v,L,I,zm),i.context=Rm(null),r=i.current,a=on(),a=Qe(a),d=Ur(a),d.callback=null,jr(r,d,a),r=a,i.current.lanes=r,dt(i,r),Gn(i),e[Ln]=i.current,Xh(e),new yc(i)},Io.version="19.2.7",Io}var Ym;function sC(){if(Ym)return vd.exports;Ym=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),vd.exports=rC(),vd.exports}var aC=sC();var Xm="popstate";function Zm(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function oC(t={}){function n(o,l){let y=l.state?.masked,{pathname:S,search:c,hash:u}=y||o.location;return nf("",{pathname:S,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:nl(l)}return cC(n,s,null,t)}function Ot(t,n){if(t===!1||t===null||typeof t>"u")throw new Error(n)}function zn(t,n){if(!t){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function lC(){return Math.random().toString(36).substring(2,10)}function Qm(t,n){return{usr:t.state,key:t.key,idx:n,masked:t.mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function nf(t,n,s=null,o,l){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof n=="string"?Ia(n):n,state:s,key:n&&n.key||o||lC(),mask:l}}function nl({pathname:t="/",search:n="",hash:s=""}){return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function Ia(t){let n={};if(t){let s=t.indexOf("#");s>=0&&(n.hash=t.substring(s),t=t.substring(0,s));let o=t.indexOf("?");o>=0&&(n.search=t.substring(o),t=t.substring(0,o)),t&&(n.pathname=t)}return n}function cC(t,n,s,o={}){let{window:l=document.defaultView,v5Compat:y=!1}=o,S=l.history,c="POP",u=null,h=g();h==null&&(h=0,S.replaceState({...S.state,idx:h},""));function g(){return(S.state||{idx:null}).idx}function f(){c="POP";let p=g(),b=p==null?null:p-h;h=p,u&&u({action:c,location:w.location,delta:b})}function C(p,b){c="PUSH";let _=Zm(p)?p:nf(w.location,p,b);h=g()+1;let m=Qm(_,h),x=w.createHref(_.mask||_);try{S.pushState(m,"",x)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;l.location.assign(x)}y&&u&&u({action:c,location:w.location,delta:1})}function E(p,b){c="REPLACE";let _=Zm(p)?p:nf(w.location,p,b);h=g();let m=Qm(_,h),x=w.createHref(_.mask||_);S.replaceState(m,"",x),y&&u&&u({action:c,location:w.location,delta:0})}function T(p){return uC(l,p)}let w={get action(){return c},get location(){return t(l,S)},listen(p){if(u)throw new Error("A history only accepts one active listener");return l.addEventListener(Xm,f),u=p,()=>{l.removeEventListener(Xm,f),u=null}},createHref(p){return n(l,p)},createURL:T,encodeLocation(p){let b=T(p);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:C,replace:E,go(p){return S.go(p)}};return w}function uC(t,n,s=!1){let o="http://localhost";t&&(o=t.location.origin!=="null"?t.location.origin:t.location.href),Ot(o,"No window.location.(origin|href) available to create URL");let l=typeof n=="string"?n:nl(n);return l=l.replace(/ $/,"%20"),!s&&l.startsWith("//")&&(l=o+l),new URL(l,o)}function M0(t,n,s="/"){return hC(t,n,s,!1)}function hC(t,n,s,o,l){let y=typeof n=="string"?Ia(n):n,S=kr(y.pathname||"/",s);if(S==null)return null;let c=dC(t),u=null,h=EC(S);for(let g=0;u==null&&g<c.length;++g)u=CC(c[g],h,o);return u}function dC(t){let n=D0(t);return fC(n),n}function D0(t,n=[],s=[],o="",l=!1){let y=(S,c,u=l,h)=>{let g={relativePath:h===void 0?S.path||"":h,caseSensitive:S.caseSensitive===!0,childrenIndex:c,route:S};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(o)&&u)return;Ot(g.relativePath.startsWith(o),`Absolute route path "${g.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(o.length)}let f=Hn([o,g.relativePath]),C=s.concat(g);S.children&&S.children.length>0&&(Ot(S.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),D0(S.children,n,C,f,u)),!(S.path==null&&!S.index)&&n.push({path:f,score:SC(f,S.index),routesMeta:C})};return t.forEach((S,c)=>{if(S.path===""||!S.path?.includes("?"))y(S,c);else for(let u of O0(S.path))y(S,c,!0,u)}),n}function O0(t){let n=t.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 S=O0(o.join("/")),c=[];return c.push(...S.map(u=>u===""?y:[y,u].join("/"))),l&&c.push(...S),c.map(u=>t.startsWith("/")&&u===""?"/":u)}function fC(t){t.sort((n,s)=>n.score!==s.score?s.score-n.score:yC(n.routesMeta.map(o=>o.childrenIndex),s.routesMeta.map(o=>o.childrenIndex)))}var pC=/^:[\w-]+$/,_C=3,gC=2,mC=1,vC=10,bC=-2,Jm=t=>t==="*";function SC(t,n){let s=t.split("/"),o=s.length;return s.some(Jm)&&(o+=bC),n&&(o+=gC),s.filter(l=>!Jm(l)).reduce((l,y)=>l+(pC.test(y)?_C:y===""?mC:vC),o)}function yC(t,n){return t.length===n.length&&t.slice(0,-1).every((o,l)=>o===n[l])?t[t.length-1]-n[n.length-1]:0}function CC(t,n,s=!1){let{routesMeta:o}=t,l={},y="/",S=[];for(let c=0;c<o.length;++c){let u=o[c],h=c===o.length-1,g=y==="/"?n:n.slice(y.length)||"/",f=Kc({path:u.relativePath,caseSensitive:u.caseSensitive,end:h},g),C=u.route;if(!f&&h&&s&&!o[o.length-1].route.index&&(f=Kc({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},g)),!f)return null;Object.assign(l,f.params),S.push({params:l,pathname:Hn([y,f.pathname]),pathnameBase:RC(Hn([y,f.pathnameBase])),route:C}),f.pathnameBase!=="/"&&(y=Hn([y,f.pathnameBase]))}return S}function Kc(t,n){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[s,o]=wC(t.path,t.caseSensitive,t.end),l=n.match(s);if(!l)return null;let y=l[0],S=y.replace(/(.)\/+$/,"$1"),c=l.slice(1);return{params:o.reduce((h,{paramName:g,isOptional:f},C)=>{if(g==="*"){let T=c[C]||"";S=y.slice(0,y.length-T.length).replace(/(.)\/+$/,"$1")}const E=c[C];return f&&!E?h[g]=void 0:h[g]=(E||"").replace(/%2F/g,"/"),h},{}),pathname:y,pathnameBase:S,pattern:t}}function wC(t,n=!1,s=!0){zn(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let o=[],l="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(S,c,u,h,g)=>{if(o.push({paramName:c,isOptional:u!=null}),u){let f=g.charAt(h+S.length);return f&&f!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(o.push({paramName:"*"}),l+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?l+="\\/*$":t!==""&&t!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,n?void 0:"i"),o]}function EC(t){try{return t.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return zn(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),t}}function kr(t,n){if(n==="/")return t;if(!t.toLowerCase().startsWith(n.toLowerCase()))return null;let s=n.endsWith("/")?n.length-1:n.length,o=t.charAt(s);return o&&o!=="/"?null:t.slice(s)||"/"}var xC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function TC(t,n="/"){let{pathname:s,search:o="",hash:l=""}=typeof t=="string"?Ia(t):t,y;return s?(s=B0(s),s.startsWith("/")?y=ev(s.substring(1),"/"):y=ev(s,n)):y=n,{pathname:y,search:kC(o),hash:LC(l)}}function ev(t,n){let s=Vc(n).split("/");return t.split("/").forEach(l=>{l===".."?s.length>1&&s.pop():l!=="."&&s.push(l)}),s.length>1?s.join("/"):"/"}function Cd(t,n,s,o){return`Cannot include a '${t}' 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 AC(t){return t.filter((n,s)=>s===0||n.route.path&&n.route.path.length>0)}function Lf(t){let n=AC(t);return n.map((s,o)=>o===n.length-1?s.pathname:s.pathnameBase)}function ou(t,n,s,o=!1){let l;typeof t=="string"?l=Ia(t):(l={...t},Ot(!l.pathname||!l.pathname.includes("?"),Cd("?","pathname","search",l)),Ot(!l.pathname||!l.pathname.includes("#"),Cd("#","pathname","hash",l)),Ot(!l.search||!l.search.includes("#"),Cd("#","search","hash",l)));let y=t===""||l.pathname==="",S=y?"/":l.pathname,c;if(S==null)c=s;else{let f=n.length-1;if(!o&&S.startsWith("..")){let C=S.split("/");for(;C[0]==="..";)C.shift(),f-=1;l.pathname=C.join("/")}c=f>=0?n[f]:"/"}let u=TC(l,c),h=S&&S!=="/"&&S.endsWith("/"),g=(y||S===".")&&s.endsWith("/");return!u.pathname.endsWith("/")&&(h||g)&&(u.pathname+="/"),u}var B0=t=>t.replace(/\/\/+/g,"/"),Hn=t=>B0(t.join("/")),Vc=t=>t.replace(/\/+$/,""),RC=t=>Vc(t).replace(/^\/*/,"/"),kC=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,LC=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,MC=class{constructor(t,n,s,o=!1){this.status=t,this.statusText=n||"",this.internal=o,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function DC(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function OC(t){let n=t.map(s=>s.route.path).filter(Boolean);return Hn(n)||"/"}var N0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function I0(t,n){let s=t;if(typeof s!="string"||!xC.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let o=s,l=!1;if(N0)try{let y=new URL(window.location.href),S=s.startsWith("//")?new URL(y.protocol+s):new URL(s),c=kr(S.pathname,n);S.origin===y.origin&&c!=null?s=c+S.search+S.hash:l=!0}catch{zn(!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 H0=["POST","PUT","PATCH","DELETE"];new Set(H0);var BC=["GET",...H0];new Set(BC);var Ha=te.createContext(null);Ha.displayName="DataRouter";var lu=te.createContext(null);lu.displayName="DataRouterState";var z0=te.createContext(!1);function NC(){return te.useContext(z0)}var $0=te.createContext({isTransitioning:!1});$0.displayName="ViewTransition";var IC=te.createContext(new Map);IC.displayName="Fetchers";var HC=te.createContext(null);HC.displayName="Await";var cn=te.createContext(null);cn.displayName="Navigation";var ol=te.createContext(null);ol.displayName="Location";var Zn=te.createContext({outlet:null,matches:[],isDataRoute:!1});Zn.displayName="Route";var Mf=te.createContext(null);Mf.displayName="RouteError";var U0="REACT_ROUTER_ERROR",zC="REDIRECT",$C="ROUTE_ERROR_RESPONSE";function UC(t){if(t.startsWith(`${U0}:${zC}:{`))try{let n=JSON.parse(t.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 jC(t){if(t.startsWith(`${U0}:${$C}:{`))try{let n=JSON.parse(t.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new MC(n.status,n.statusText,n.data)}catch{}}function PC(t,{relative:n}={}){Ot(za(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:o}=te.useContext(cn),{hash:l,pathname:y,search:S}=ll(t,{relative:n}),c=y;return s!=="/"&&(c=y==="/"?s:Hn([s,y])),o.createHref({pathname:c,search:S,hash:l})}function za(){return te.useContext(ol)!=null}function Un(){return Ot(za(),"useLocation() may be used only in the context of a <Router> component."),te.useContext(ol).location}var j0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function P0(t){te.useContext(cn).static||te.useLayoutEffect(t)}function F0(){let{isDataRoute:t}=te.useContext(Zn);return t?tw():FC()}function FC(){Ot(za(),"useNavigate() may be used only in the context of a <Router> component.");let t=te.useContext(Ha),{basename:n,navigator:s}=te.useContext(cn),{matches:o}=te.useContext(Zn),{pathname:l}=Un(),y=JSON.stringify(Lf(o)),S=te.useRef(!1);return P0(()=>{S.current=!0}),te.useCallback((u,h={})=>{if(zn(S.current,j0),!S.current)return;if(typeof u=="number"){s.go(u);return}let g=ou(u,JSON.parse(y),l,h.relative==="path");t==null&&n!=="/"&&(g.pathname=g.pathname==="/"?n:Hn([n,g.pathname])),(h.replace?s.replace:s.push)(g,h.state,h)},[n,s,y,l,t])}te.createContext(null);function ll(t,{relative:n}={}){let{matches:s}=te.useContext(Zn),{pathname:o}=Un(),l=JSON.stringify(Lf(s));return te.useMemo(()=>ou(t,JSON.parse(l),o,n==="path"),[t,l,o,n])}function qC(t,n){return q0(t,n)}function q0(t,n,s){Ot(za(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=te.useContext(cn),{matches:l}=te.useContext(Zn),y=l[l.length-1],S=y?y.params:{},c=y?y.pathname:"/",u=y?y.pathnameBase:"/",h=y&&y.route;{let p=h&&h.path||"";G0(c,!h||p.endsWith("*")||p.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${p}">) 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="${p}"> to <Route path="${p==="/"?"*":`${p}/*`}">.`)}let g=Un(),f;if(n){let p=typeof n=="string"?Ia(n):n;Ot(u==="/"||p.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 "${p.pathname}" was given in the \`location\` prop.`),f=p}else f=g;let C=f.pathname||"/",E=C;if(u!=="/"){let p=u.replace(/^\//,"").split("/");E="/"+C.replace(/^\//,"").split("/").slice(p.length).join("/")}let T=s&&s.state.matches.length?s.state.matches.map(p=>Object.assign(p,{route:s.manifest[p.route.id]||p.route})):M0(t,{pathname:E});zn(h||T!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),zn(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.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=YC(T&&T.map(p=>Object.assign({},p,{params:Object.assign({},S,p.params),pathname:Hn([u,o.encodeLocation?o.encodeLocation(p.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?u:Hn([u,o.encodeLocation?o.encodeLocation(p.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathnameBase])})),l,s);return n&&w?te.createElement(ol.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...f},navigationType:"POP"}},w):w}function WC(){let t=ew(),n=DC(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),s=t instanceof Error?t.stack:null,o="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:o},y={padding:"2px 4px",backgroundColor:o},S=null;return console.error("Error handled by React Router default ErrorBoundary:",t),S=te.createElement(te.Fragment,null,te.createElement("p",null,"💿 Hey developer 👋"),te.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",te.createElement("code",{style:y},"ErrorBoundary")," or"," ",te.createElement("code",{style:y},"errorElement")," prop on your route.")),te.createElement(te.Fragment,null,te.createElement("h2",null,"Unexpected Application Error!"),te.createElement("h3",{style:{fontStyle:"italic"}},n),s?te.createElement("pre",{style:l},s):null,S)}var GC=te.createElement(WC,null),W0=class extends te.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){this.props.onError?this.props.onError(t,n):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const s=jC(t.digest);s&&(t=s)}let n=t!==void 0?te.createElement(Zn.Provider,{value:this.props.routeContext},te.createElement(Mf.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?te.createElement(KC,{error:t},n):n}};W0.contextType=z0;var wd=new WeakMap;function KC({children:t,error:n}){let{basename:s}=te.useContext(cn);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let o=UC(n.digest);if(o){let l=wd.get(n);if(l)throw l;let y=I0(o.location,s);if(N0&&!wd.get(n))if(y.isExternal||o.reloadDocument)window.location.href=y.absoluteURL||y.to;else{const S=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(y.to,{replace:o.replace}));throw wd.set(n,S),S}return te.createElement("meta",{httpEquiv:"refresh",content:`0;url=${y.absoluteURL||y.to}`})}}return t}function VC({routeContext:t,match:n,children:s}){let o=te.useContext(Ha);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),te.createElement(Zn.Provider,{value:t},s)}function YC(t,n=[],s){let o=s?.state;if(t==null){if(!o)return null;if(o.errors)t=o.matches;else if(n.length===0&&!o.initialized&&o.matches.length>0)t=o.matches;else return null}let l=t,y=o?.errors;if(y!=null){let g=l.findIndex(f=>f.route.id&&y?.[f.route.id]!==void 0);Ot(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(y).join(",")}`),l=l.slice(0,Math.min(l.length,g+1))}let S=!1,c=-1;if(s&&o){S=o.renderFallback;for(let g=0;g<l.length;g++){let f=l[g];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=g),f.route.id){let{loaderData:C,errors:E}=o,T=f.route.loader&&!C.hasOwnProperty(f.route.id)&&(!E||E[f.route.id]===void 0);if(f.route.lazy||T){s.isStatic&&(S=!0),c>=0?l=l.slice(0,c+1):l=[l[0]];break}}}}let u=s?.onError,h=o&&u?(g,f)=>{u(g,{location:o.location,params:o.matches?.[0]?.params??{},pattern:OC(o.matches),errorInfo:f})}:void 0;return l.reduceRight((g,f,C)=>{let E,T=!1,w=null,p=null;o&&(E=y&&f.route.id?y[f.route.id]:void 0,w=f.route.errorElement||GC,S&&(c<0&&C===0?(G0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,p=null):c===C&&(T=!0,p=f.route.hydrateFallbackElement||null)));let b=n.concat(l.slice(0,C+1)),_=()=>{let m;return E?m=w:T?m=p:f.route.Component?m=te.createElement(f.route.Component,null):f.route.element?m=f.route.element:m=g,te.createElement(VC,{match:f,routeContext:{outlet:g,matches:b,isDataRoute:o!=null},children:m})};return o&&(f.route.ErrorBoundary||f.route.errorElement||C===0)?te.createElement(W0,{location:o.location,revalidation:o.revalidation,component:w,error:E,children:_(),routeContext:{outlet:null,matches:b,isDataRoute:!0},onError:h}):_()},null)}function Df(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function XC(t){let n=te.useContext(Ha);return Ot(n,Df(t)),n}function ZC(t){let n=te.useContext(lu);return Ot(n,Df(t)),n}function QC(t){let n=te.useContext(Zn);return Ot(n,Df(t)),n}function Of(t){let n=QC(t),s=n.matches[n.matches.length-1];return Ot(s.route.id,`${t} can only be used on routes that contain a unique "id"`),s.route.id}function JC(){return Of("useRouteId")}function ew(){let t=te.useContext(Mf),n=ZC("useRouteError"),s=Of("useRouteError");return t!==void 0?t:n.errors?.[s]}function tw(){let{router:t}=XC("useNavigate"),n=Of("useNavigate"),s=te.useRef(!1);return P0(()=>{s.current=!0}),te.useCallback(async(l,y={})=>{zn(s.current,j0),s.current&&(typeof l=="number"?await t.navigate(l):await t.navigate(l,{fromRouteId:n,...y}))},[t,n])}var tv={};function G0(t,n,s){!n&&!tv[t]&&(tv[t]=!0,zn(!1,s))}te.memo(iw);function iw({routes:t,manifest:n,future:s,state:o,isStatic:l,onError:y}){return q0(t,void 0,{manifest:n,state:o,isStatic:l,onError:y})}function nw({to:t,replace:n,state:s,relative:o}){Ot(za(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=te.useContext(cn);zn(!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}=te.useContext(Zn),{pathname:S}=Un(),c=F0(),u=ou(t,Lf(y),S,o==="path"),h=JSON.stringify(u);return te.useEffect(()=>{c(JSON.parse(h),{replace:n,state:s,relative:o})},[c,h,o,n,s]),null}function Vo(t){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 rw({basename:t="/",children:n=null,location:s,navigationType:o="POP",navigator:l,static:y=!1,useTransitions:S}){Ot(!za(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=t.replace(/^\/*/,"/"),u=te.useMemo(()=>({basename:c,navigator:l,static:y,useTransitions:S,future:{}}),[c,l,y,S]);typeof s=="string"&&(s=Ia(s));let{pathname:h="/",search:g="",hash:f="",state:C=null,key:E="default",mask:T}=s,w=te.useMemo(()=>{let p=kr(h,c);return p==null?null:{location:{pathname:p,search:g,hash:f,state:C,key:E,mask:T},navigationType:o}},[c,h,g,f,C,E,o,T]);return zn(w!=null,`<Router basename="${c}"> is not able to match the URL "${h}${g}${f}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:te.createElement(cn.Provider,{value:u},te.createElement(ol.Provider,{children:n,value:w}))}function sw({children:t,location:n}){return qC(rf(t),n)}function rf(t,n=[]){let s=[];return te.Children.forEach(t,(o,l)=>{if(!te.isValidElement(o))return;let y=[...n,l];if(o.type===te.Fragment){s.push.apply(s,rf(o.props.children,y));return}Ot(o.type===Vo,`[${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 S={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&&(S.children=rf(o.props.children,y)),s.push(S)}),s}var Ic="get",Hc="application/x-www-form-urlencoded";function cu(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function aw(t){return cu(t)&&t.tagName.toLowerCase()==="button"}function ow(t){return cu(t)&&t.tagName.toLowerCase()==="form"}function lw(t){return cu(t)&&t.tagName.toLowerCase()==="input"}function cw(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function uw(t,n){return t.button===0&&(!n||n==="_self")&&!cw(t)}var wc=null;function hw(){if(wc===null)try{new FormData(document.createElement("form"),0),wc=!1}catch{wc=!0}return wc}var dw=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ed(t){return t!=null&&!dw.has(t)?(zn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Hc}"`),null):t}function fw(t,n){let s,o,l,y,S;if(ow(t)){let c=t.getAttribute("action");o=c?kr(c,n):null,s=t.getAttribute("method")||Ic,l=Ed(t.getAttribute("enctype"))||Hc,y=new FormData(t)}else if(aw(t)||lw(t)&&(t.type==="submit"||t.type==="image")){let c=t.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=t.getAttribute("formaction")||c.getAttribute("action");if(o=u?kr(u,n):null,s=t.getAttribute("formmethod")||c.getAttribute("method")||Ic,l=Ed(t.getAttribute("formenctype"))||Ed(c.getAttribute("enctype"))||Hc,y=new FormData(c,t),!hw()){let{name:h,type:g,value:f}=t;if(g==="image"){let C=h?`${h}.`:"";y.append(`${C}x`,"0"),y.append(`${C}y`,"0")}else h&&y.append(h,f)}}else{if(cu(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=Ic,o=null,l=Hc,S=t}return y&&l==="text/plain"&&(S=y,y=void 0),{action:o,method:s.toLowerCase(),encType:l,formData:y,body:S}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Bf(t,n){if(t===!1||t===null||typeof t>"u")throw new Error(n)}function K0(t,n,s,o){let l=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return s?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${o}`:l.pathname=`${l.pathname}.${o}`:l.pathname==="/"?l.pathname=`_root.${o}`:n&&kr(l.pathname,n)==="/"?l.pathname=`${Vc(n)}/_root.${o}`:l.pathname=`${Vc(l.pathname)}.${o}`,l}async function pw(t,n){if(t.id in n)return n[t.id];try{let s=await import(t.module);return n[t.id]=s,s}catch(s){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function _w(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function gw(t,n,s){let o=await Promise.all(t.map(async l=>{let y=n.routes[l.route.id];if(y){let S=await pw(y,s);return S.links?S.links():[]}return[]}));return Sw(o.flat(1).filter(_w).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function iv(t,n,s,o,l,y){let S=(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)=>S(u,h)||c(u,h)):y==="data"?n.filter((u,h)=>{let g=o.routes[u.route.id];if(!g||!g.hasLoader)return!1;if(S(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(t,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function mw(t,n,{includeHydrateFallback:s}={}){return vw(t.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 vw(t){return[...new Set(t)]}function bw(t){let n={},s=Object.keys(t).sort();for(let o of s)n[o]=t[o];return n}function Sw(t,n){let s=new Set;return new Set(n),t.reduce((o,l)=>{let y=JSON.stringify(bw(l));return s.has(y)||(s.add(y),o.push({key:y,link:l})),o},[])}function Nf(){let t=te.useContext(Ha);return Bf(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function yw(){let t=te.useContext(lu);return Bf(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var If=te.createContext(void 0);If.displayName="FrameworkContext";function Hf(){let t=te.useContext(If);return Bf(t,"You must render this element inside a <HydratedRouter> element"),t}function Cw(t,n){let s=te.useContext(If),[o,l]=te.useState(!1),[y,S]=te.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:h,onMouseLeave:g,onTouchStart:f}=n,C=te.useRef(null);te.useEffect(()=>{if(t==="render"&&S(!0),t==="viewport"){let w=b=>{b.forEach(_=>{S(_.isIntersecting)})},p=new IntersectionObserver(w,{threshold:.5});return C.current&&p.observe(C.current),()=>{p.disconnect()}}},[t]),te.useEffect(()=>{if(o){let w=setTimeout(()=>{S(!0)},100);return()=>{clearTimeout(w)}}},[o]);let E=()=>{l(!0)},T=()=>{l(!1),S(!1)};return s?t!=="intent"?[y,C,{}]:[y,C,{onFocus:Ho(c,E),onBlur:Ho(u,T),onMouseEnter:Ho(h,E),onMouseLeave:Ho(g,T),onTouchStart:Ho(f,E)}]:[!1,C,{}]}function Ho(t,n){return s=>{t&&t(s),s.defaultPrevented||n(s)}}function ww({page:t,...n}){let s=NC(),{router:o}=Nf(),l=te.useMemo(()=>M0(o.routes,t,o.basename),[o.routes,t,o.basename]);return l?s?te.createElement(xw,{page:t,matches:l,...n}):te.createElement(Tw,{page:t,matches:l,...n}):null}function Ew(t){let{manifest:n,routeModules:s}=Hf(),[o,l]=te.useState([]);return te.useEffect(()=>{let y=!1;return gw(t,n,s).then(S=>{y||l(S)}),()=>{y=!0}},[t,n,s]),o}function xw({page:t,matches:n,...s}){let o=Un(),{future:l}=Hf(),{basename:y}=Nf(),S=te.useMemo(()=>{if(t===o.pathname+o.search+o.hash)return[];let c=K0(t,y,l.v8_trailingSlashAwareDataRequests,"rsc"),u=!1,h=[];for(let g of n)typeof g.route.shouldRevalidate=="function"?u=!0:h.push(g.route.id);return u&&h.length>0&&c.searchParams.set("_routes",h.join(",")),[c.pathname+c.search]},[y,l.v8_trailingSlashAwareDataRequests,t,o,n]);return te.createElement(te.Fragment,null,S.map(c=>te.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...s})))}function Tw({page:t,matches:n,...s}){let o=Un(),{future:l,manifest:y,routeModules:S}=Hf(),{basename:c}=Nf(),{loaderData:u,matches:h}=yw(),g=te.useMemo(()=>iv(t,n,h,y,o,"data"),[t,n,h,y,o]),f=te.useMemo(()=>iv(t,n,h,y,o,"assets"),[t,n,h,y,o]),C=te.useMemo(()=>{if(t===o.pathname+o.search+o.hash)return[];let w=new Set,p=!1;if(n.forEach(_=>{let m=y.routes[_.route.id];!m||!m.hasLoader||(!g.some(x=>x.route.id===_.route.id)&&_.route.id in u&&S[_.route.id]?.shouldRevalidate||m.hasClientLoader?p=!0:w.add(_.route.id))}),w.size===0)return[];let b=K0(t,c,l.v8_trailingSlashAwareDataRequests,"data");return p&&w.size>0&&b.searchParams.set("_routes",n.filter(_=>w.has(_.route.id)).map(_=>_.route.id).join(",")),[b.pathname+b.search]},[c,l.v8_trailingSlashAwareDataRequests,u,o,y,g,n,t,S]),E=te.useMemo(()=>mw(f,y),[f,y]),T=Ew(f);return te.createElement(te.Fragment,null,C.map(w=>te.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...s})),E.map(w=>te.createElement("link",{key:w,rel:"modulepreload",href:w,...s})),T.map(({key:w,link:p})=>te.createElement("link",{key:w,nonce:s.nonce,...p,crossOrigin:p.crossOrigin??s.crossOrigin})))}function Aw(...t){return n=>{t.forEach(s=>{typeof s=="function"?s(n):s!=null&&(s.current=n)})}}var Rw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Rw&&(window.__reactRouterVersion="7.17.0")}catch{}function kw({basename:t,children:n,useTransitions:s,window:o}){let l=te.useRef();l.current==null&&(l.current=oC({window:o,v5Compat:!0}));let y=l.current,[S,c]=te.useState({action:y.action,location:y.location}),u=te.useCallback(h=>{s===!1?c(h):te.startTransition(()=>c(h))},[s]);return te.useLayoutEffect(()=>y.listen(u),[y,u]),te.createElement(rw,{basename:t,children:n,location:S.location,navigationType:S.action,navigator:y,useTransitions:s})}var V0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,zf=te.forwardRef(function({onClick:n,discover:s="render",prefetch:o="none",relative:l,reloadDocument:y,replace:S,mask:c,state:u,target:h,to:g,preventScrollReset:f,viewTransition:C,defaultShouldRevalidate:E,...T},w){let{basename:p,navigator:b,useTransitions:_}=te.useContext(cn),m=typeof g=="string"&&V0.test(g),x=I0(g,p);g=x.to;let R=PC(g,{relative:l}),k=Un(),D=null;if(c){let ee=ou(c,[],k.mask?k.mask.pathname:"/",!0);p!=="/"&&(ee.pathname=ee.pathname==="/"?p:Hn([p,ee.pathname])),D=b.createHref(ee)}let[A,B,W]=Cw(o,T),j=Dw(g,{replace:S,mask:c,state:u,target:h,preventScrollReset:f,relative:l,viewTransition:C,defaultShouldRevalidate:E,useTransitions:_});function F(ee){n&&n(ee),ee.defaultPrevented||j(ee)}let H=!(x.isExternal||y),Z=te.createElement("a",{...T,...W,href:(H?D:void 0)||x.absoluteURL||R,onClick:H?F:n,ref:Aw(w,B),target:h,"data-discover":!m&&s==="render"?"true":void 0});return A&&!m?te.createElement(te.Fragment,null,Z,te.createElement(ww,{page:R})):Z});zf.displayName="Link";var Y0=te.forwardRef(function({"aria-current":n="page",caseSensitive:s=!1,className:o="",end:l=!1,style:y,to:S,viewTransition:c,children:u,...h},g){let f=ll(S,{relative:h.relative}),C=Un(),E=te.useContext(lu),{navigator:T,basename:w}=te.useContext(cn),p=E!=null&&Hw(f)&&c===!0,b=T.encodeLocation?T.encodeLocation(f).pathname:f.pathname,_=C.pathname,m=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;s||(_=_.toLowerCase(),m=m?m.toLowerCase():null,b=b.toLowerCase()),m&&w&&(m=kr(m,w)||m);const x=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let R=_===b||!l&&_.startsWith(b)&&_.charAt(x)==="/",k=m!=null&&(m===b||!l&&m.startsWith(b)&&m.charAt(b.length)==="/"),D={isActive:R,isPending:k,isTransitioning:p},A=R?n:void 0,B;typeof o=="function"?B=o(D):B=[o,R?"active":null,k?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let W=typeof y=="function"?y(D):y;return te.createElement(zf,{...h,"aria-current":A,className:B,ref:g,style:W,to:S,viewTransition:c},typeof u=="function"?u(D):u)});Y0.displayName="NavLink";var Lw=te.forwardRef(({discover:t="render",fetcherKey:n,navigate:s,reloadDocument:o,replace:l,state:y,method:S=Ic,action:c,onSubmit:u,relative:h,preventScrollReset:g,viewTransition:f,defaultShouldRevalidate:C,...E},T)=>{let{useTransitions:w}=te.useContext(cn),p=Nw(),b=Iw(c,{relative:h}),_=S.toLowerCase()==="get"?"get":"post",m=typeof c=="string"&&V0.test(c),x=R=>{if(u&&u(R),R.defaultPrevented)return;R.preventDefault();let k=R.nativeEvent.submitter,D=k?.getAttribute("formmethod")||S,A=()=>p(k||R.currentTarget,{fetcherKey:n,method:D,navigate:s,replace:l,state:y,relative:h,preventScrollReset:g,viewTransition:f,defaultShouldRevalidate:C});w&&s!==!1?te.startTransition(()=>A()):A()};return te.createElement("form",{ref:T,method:_,action:b,onSubmit:o?u:x,...E,"data-discover":!m&&t==="render"?"true":void 0})});Lw.displayName="Form";function Mw(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function X0(t){let n=te.useContext(Ha);return Ot(n,Mw(t)),n}function Dw(t,{target:n,replace:s,mask:o,state:l,preventScrollReset:y,relative:S,viewTransition:c,defaultShouldRevalidate:u,useTransitions:h}={}){let g=F0(),f=Un(),C=ll(t,{relative:S});return te.useCallback(E=>{if(uw(E,n)){E.preventDefault();let T=s!==void 0?s:nl(f)===nl(C),w=()=>g(t,{replace:T,mask:o,state:l,preventScrollReset:y,relative:S,viewTransition:c,defaultShouldRevalidate:u});h?te.startTransition(()=>w()):w()}},[f,g,C,s,o,l,n,t,y,S,c,u,h])}var Ow=0,Bw=()=>`__${String(++Ow)}__`;function Nw(){let{router:t}=X0("useSubmit"),{basename:n}=te.useContext(cn),s=JC(),o=t.fetch,l=t.navigate;return te.useCallback(async(y,S={})=>{let{action:c,method:u,encType:h,formData:g,body:f}=fw(y,n);if(S.navigate===!1){let C=S.fetcherKey||Bw();await o(C,s,S.action||c,{defaultShouldRevalidate:S.defaultShouldRevalidate,preventScrollReset:S.preventScrollReset,formData:g,body:f,formMethod:S.method||u,formEncType:S.encType||h,flushSync:S.flushSync})}else await l(S.action||c,{defaultShouldRevalidate:S.defaultShouldRevalidate,preventScrollReset:S.preventScrollReset,formData:g,body:f,formMethod:S.method||u,formEncType:S.encType||h,replace:S.replace,state:S.state,fromRouteId:s,flushSync:S.flushSync,viewTransition:S.viewTransition})},[o,l,n,s])}function Iw(t,{relative:n}={}){let{basename:s}=te.useContext(cn),o=te.useContext(Zn);Ot(o,"useFormAction must be used inside a RouteContext");let[l]=o.matches.slice(-1),y={...ll(t||".",{relative:n})},S=Un();if(t==null){y.search=S.search;let c=new URLSearchParams(y.search),u=c.getAll("index");if(u.some(g=>g==="")){c.delete("index"),u.filter(f=>f).forEach(f=>c.append("index",f));let g=c.toString();y.search=g?`?${g}`:""}}return(!t||t===".")&&l.route.index&&(y.search=y.search?y.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(y.pathname=y.pathname==="/"?s:Hn([s,y.pathname])),nl(y)}function Hw(t,{relative:n}={}){let s=te.useContext($0);Ot(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=X0("useViewTransitionState"),l=ll(t,{relative:n});if(!s.isTransitioning)return!1;let y=kr(s.currentLocation.pathname,o)||s.currentLocation.pathname,S=kr(s.nextLocation.pathname,o)||s.nextLocation.pathname;return Kc(l.pathname,S)!=null||Kc(l.pathname,y)!=null}class Yi extends Error{status;constructor(n,s){super(s),this.name="ApiError",this.status=n}}async function Z0(t){const n=await fetch("/observer/tenants",{signal:t});await Tn(n);const s=await n.json();if(!Array.isArray(s.tenants))throw new Yi(n.status,"Invalid tenants response");return s.tenants.map(o=>Xw(o,n.status))}async function zw(t){const n=await fetch("/observer/jobs",{signal:t});return await Tn(n),(await n.json()).tenants}async function $w(t){const n=await fetch("/observer/events",{signal:t});if(await Tn(n),!n.body)throw new Yi(n.status,"Observer stream unavailable");return n.body.getReader()}async function Uw(t){const n=await fetch("/observer/theaters",{signal:t});await Tn(n);const s=await n.json();if(!Array.isArray(s.theaters))throw new Yi(n.status,"Invalid Theater response");const o=Array.isArray(s.agentClis)?s.agentClis.map(l=>Yw(l,n.status)):[];return{theaters:s.theaters.map(l=>J0(l,n.status)),agentClis:o}}async function Q0(t,n){const s=t?`?theaterId=${encodeURIComponent(t)}`:"",o=await fetch(`/observer/status${s}`,{signal:n});return await Tn(o),Zw(await o.json(),o.status)}async function jw(t){const n=await fetch("/observer/carriers",{signal:t});await Tn(n);const s=await n.json();if(!Array.isArray(s.carriers))throw new Yi(n.status,"Invalid carrier readiness response");return s.carriers.map(o=>Qw(o,n.status))}async function Pw(t){const n=await fetch("/observer/theaters",{method:"POST",signal:t});await Tn(n);const s=await n.json();return typeof s=="object"&&s!==null&&s.cancelled===!0?{cancelled:!0}:J0(s,n.status)}async function Fw(t,n,s){const o=await fetch(`/observer/theaters/${encodeURIComponent(t)}/sessions`,{method:"POST",...n?{headers:{"Content-Type":"application/json"},body:JSON.stringify({cliId:n})}:{},signal:s});return await Tn(o),$f(await o.json(),o.status)}async function qw(t,n){const s=await fetch(`/terminal/sessions/${encodeURIComponent(t)}`,{method:"DELETE",signal:n});await Tn(s)}async function Ww(t,n){const s=await fetch(`/terminal/sessions/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({label:n})});return await Tn(s),$f(await s.json(),s.status)}async function Gw(t){const n=await fetch("/terminal/sessions",{signal:t});await Tn(n);const s=await n.json();if(!Array.isArray(s.sessions))throw new Yi(n.status,"Invalid terminal sessions response");return s.sessions.map(o=>$f(o,n.status))}async function Kw(t,n){const s=Vw(n),o=await fetch("/terminal/ticket",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:t,...s.kind?{kind:s.kind}:{}}),signal:s.signal});await Tn(o);const l=await o.json();if(typeof l.ticket!="string"||typeof l.ttlMs!="number")throw new Yi(o.status,"Invalid terminal ticket response");return{ticket:l.ticket,ttlMs:l.ttlMs}}function Vw(t){return t?t instanceof AbortSignal?{signal:t}:t:{}}function $f(t,n){const s=t;if(!s||typeof s.sessionId!="string"||typeof s.cwdLabel!="string"||typeof s.sequence!="number"||typeof s.status!="string"||typeof s.createdAt!="number"||"cwd"in s||"canonicalCwd"in s)throw new Yi(n,"Invalid terminal session response");return{sessionId:s.sessionId,terminalSessionId:typeof s.terminalSessionId=="string"?s.terminalSessionId:s.sessionId,cwdLabel:s.cwdLabel,sequence:s.sequence,label:typeof s.label=="string"?s.label:void 0,cliId:typeof s.cliId=="string"?s.cliId:void 0,cliLabel:typeof s.cliLabel=="string"?s.cliLabel:void 0,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 Yw(t,n){const s=t;if(!s||typeof s.id!="string"||typeof s.label!="string")throw new Yi(n,"Invalid Agent CLI metadata response");return{id:s.id,label:s.label}}function Xw(t,n){const s=t;if(!s||typeof s.tenantId!="string"||typeof s.tenantLabel!="string"||typeof s.createdAt!="number"||typeof s.sessions!="number"||"cwd"in s)throw new Yi(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(t,n){const s=t;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.updateAvailable!="boolean"||s.latestVersion!==void 0&&typeof s.latestVersion!="string"||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 Yi(n,"Invalid observer status response");return{workspaces:s.workspaces,jobs:s.jobs,version:s.version,channel:s.channel,updateAvailable:s.updateAvailable,...s.latestVersion!==void 0?{latestVersion:s.latestVersion}:{},port:s.port,wikiServerStatus:s.wikiServerStatus}}function Qw(t,n){const s=t;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 Yi(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 J0(t,n){const s=t;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 Yi(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 Tn(t){if(t.ok)return;let n=t.statusText;try{n=(await t.json()).error??n}catch{}throw new Yi(t.status,n||`HTTP ${t.status}`)}const nv=120,Jw="active",sf=new Set(["done","error","aborted"]);function e2(t,n){let s=t1(t,n.jobId,n.updatedAt);for(const o of n.events)s=e1(s,o);return sf.has(n.status)&&!sf.has(s.status)&&(s={...s,status:n.status}),s}function e1(t,n){if(n.id<=t.lastEventId)return t;const s=n.event,o={...t,updatedAt:n.at,lastEventId:n.id,recentEvents:n2(t.recentEvents,n)};switch(n.type){case"job:registered":return t2(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 wa(o,s,l=>({...l,startedAt:ss(s.startedAt)??n.at,requestPreview:oi(s.requestPreview)}));case"track:status":return wa(o,s,l=>({...l,status:oi(s.status)??l.status}));case"track:text":return wa(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 wa(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 wa(o,s,l=>({...l,status:"stream",tools:i2(l.tools,s)}));case"track:finalized":return wa(o,s,l=>{const y=rv(l.text,l.sentTextLength,oi(s.fallbackText),ss(s.fallbackTextLength)),S=rv(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:S.text,sentThoughtLength:S.sentLength}});default:return o}}function t1(t,n,s){return{jobId:n,tenantId:t,status:Jw,updatedAt:s,trackOrder:[],tracks:{},lastEventId:0,recentEvents:[]}}function Oa(t){return sf.has(t)}function t2(t,n){const s=Array.isArray(n.tracks)?n.tracks:[];let o=t.trackOrder,l=t.tracks;for(const y of s){if(!y.trackId)continue;const S=l[y.trackId],c={...S??i1(y.trackId),displayName:y.displayName??S?.displayName??y.trackId,displayCli:y.displayCli??S?.displayCli,model:y.model??S?.model,effort:y.effort??S?.effort,subtitle:y.subtitle??S?.subtitle,kind:y.kind??S?.kind,startedAt:y.startedAt??S?.startedAt};S||(o=[...o,y.trackId]),l={...l,[y.trackId]:c}}return{...t,label:oi(n.label)??t.label,ownerCarrierId:oi(n.ownerCarrierId)??t.ownerCarrierId,kind:oi(n.kind)??t.kind,startedAt:ss(n.startedAt)??t.startedAt,trackOrder:o,tracks:l}}function wa(t,n,s){const o=oi(n.trackId);if(!o)return t;const l=t.tracks[o],y=s(l??i1(o));return{...t,trackOrder:l?t.trackOrder:[...t.trackOrder,o],tracks:{...t.tracks,[o]:y}}}function i1(t){return{trackId:t,displayName:t,status:"queued",text:"",thought:"",sentTextLength:0,sentThoughtLength:0,tools:[]}}function rv(t,n,s,o){const l=o??s?.length??0;return s!==void 0&&l>t.length?{text:s,sentLength:Math.max(l,n)}:{text:t,sentLength:Math.max(n,l)}}function i2(t,n){const s=oi(n.title)??"tool",o=oi(n.status)??"",l=oi(n.toolCallId),y=l??`${s}#${t.length}`;if(l){const S=t.findIndex(c=>c.key===l);if(S>=0){const c=[...t];return c[S]={key:l,title:s,status:o},c}}return[...t,{key:y,title:s,status:o}]}function n2(t,n){const s=[...t,n];return s.length>nv?s.slice(-nv):s}function oi(t){return typeof t=="string"?t:void 0}function ss(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0}const af=200,of="fleet-console.activeTheaterId",n1="fleet-console.activeTheme",r1="fleet-console.terminalRenderer",s1="fleet-console.expandedSessions",xd="maritime",Td="webgl",sv="shell",lf=new Set;let ke={connection:"connecting",connectionError:null,activeTheme:g1(),terminalRenderer:l2(),updateAvailable:!1,latestVersion:null,tenants:[],theaters:[],agentClis:[],activeTheaterId:null,addingTheater:!1,theaterError:null,sessions:{},sessionOrder:[],activeTerminalSessionId:null,creatingTerminalSession:!1,terminalSessionError:null,tenantJobs:{},tenantOrder:[],timelineOpen:!1,shellOpen:!1,selectedJobId:null,expandedSessionIds:O2()};function av(){return ke}function r2(t){return lf.add(t),()=>{lf.delete(t)}}function rt(t){ke={...ke,...t},v1()}function s2(){a1(g1())}function a2(t){B2(t),a1(t),rt({activeTheme:t})}function o2(t){N2(t),rt({terminalRenderer:t})}function l2(){if(typeof window>"u")return Td;try{const t=window.localStorage.getItem(r1);return t==="webgl"||t==="dom"?t:Td}catch{return Td}}function c2(t){rt({updateAvailable:t.updateAvailable,latestVersion:t.latestVersion??null})}function a1(t){if(!(typeof document>"u")){if(t==="maritime"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",t)}}function u2(t){const n={};for(const l of t)n[l.sessionId]=jf(l);const s=[...t].sort((l,y)=>y.createdAt-l.createdAt).map(l=>l.sessionId),o=p1(n,ke.tenants);rt({sessions:o,sessionOrder:s,activeTerminalSessionId:$a(ke.activeTheaterId,o,s,ke.activeTerminalSessionId)})}function h2(t){const n=M2(t.theaters,ke.activeTheaterId);rt({theaters:t.theaters,agentClis:t.agentClis,activeTheaterId:n,activeTerminalSessionId:$a(n,ke.sessions,ke.sessionOrder,ke.activeTerminalSessionId),selectedJobId:null})}function d2(t){_1(t),rt({activeTheaterId:t,activeTerminalSessionId:$a(t,ke.sessions,ke.sessionOrder,null),selectedJobId:null})}function f2(){rt({addingTheater:!0,theaterError:null})}function p2(t){const n=[t,...ke.theaters.filter(s=>s.id!==t.id)];_1(t.id),rt({theaters:n,activeTheaterId:t.id,addingTheater:!1,theaterError:null,activeTerminalSessionId:$a(t.id,ke.sessions,ke.sessionOrder,null),selectedJobId:null})}function _2(){rt({addingTheater:!1,theaterError:null})}function g2(t){rt({addingTheater:!1,theaterError:t})}function m2(t){rt({activeTerminalSessionId:t,selectedJobId:null})}function v2(){rt({creatingTerminalSession:!0,terminalSessionError:null})}function b2(t){const n=jf(t);rt({sessions:{...ke.sessions,[n.sessionId]:n},sessionOrder:[n.sessionId,...ke.sessionOrder.filter(s=>s!==n.sessionId)],activeTerminalSessionId:!ke.activeTheaterId||Yc(n,ke.activeTheaterId)?n.sessionId:ke.activeTerminalSessionId,creatingTerminalSession:!1,terminalSessionError:null,selectedJobId:null})}function o1(t){const n=ke.sessions[t.sessionId],s=jf({...n??{},...t}),o=!!n,l={...ke.sessions,[s.sessionId]:s},y=o?ke.sessionOrder:[s.sessionId,...ke.sessionOrder.filter(S=>S!==s.sessionId)];rt({sessions:l,sessionOrder:y,activeTerminalSessionId:$a(ke.activeTheaterId,l,y,ke.activeTerminalSessionId)})}function S2(t){rt({creatingTerminalSession:!1,terminalSessionError:t})}function y2(){rt({timelineOpen:!ke.timelineOpen})}function l1(){if(ke.shellOpen){Yo();return}rt({shellOpen:!0})}function Yo(){ke.shellOpen&&rt({shellOpen:!1})}function C2(t){const n=ke.expandedSessionIds.includes(t)?ke.expandedSessionIds.filter(s=>s!==t):[...ke.expandedSessionIds,t];m1(n),rt({expandedSessionIds:n})}function w2(t){rt({terminalSessionError:t})}function E2(t){rt({terminalSessionError:t})}function c1(t){if(!ke.sessions[t])return;const n={...ke.sessions};delete n[t];const s=ke.sessionOrder.filter(y=>y!==t),o=ke.expandedSessionIds.filter(y=>y!==t),l=ke.activeTerminalSessionId===t;m1(o),rt({sessions:n,sessionOrder:s,activeTerminalSessionId:l?s[0]??null:ke.activeTerminalSessionId,selectedJobId:l?null:ke.selectedJobId,expandedSessionIds:o})}function u1(t){rt({selectedJobId:ke.selectedJobId===t?null:t})}function Ad(){rt({selectedJobId:null})}function h1(t){const n=new Set(t.map(l=>l.tenantId)),s=p1(ke.sessions,t),o=[...t.map(l=>l.tenantId),...ke.tenantOrder.filter(l=>!n.has(l)&&ke.tenantJobs[l])];rt({tenants:t,sessions:s,tenantOrder:o,activeTerminalSessionId:$a(ke.activeTheaterId,s,ke.sessionOrder,ke.activeTerminalSessionId)})}function x2(t){const n={},s=[];for(const l of t){const y={};for(const c of l.jobs)y[c.jobId]=e2(l.tenantId,c);const S=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:S,jobs:y,truncation:l.truncation},s.push(l.tenantId)}const o=[...ke.tenantOrder.filter(l=>n[l]),...s.filter(l=>!ke.tenantOrder.includes(l))];rt({tenantJobs:n,tenantOrder:o.length>0?o:s})}function T2(t,n){const s=ke.tenantJobs[t.tenantId],o=!s&&!ke.tenants.some(c=>c.tenantId===t.tenantId),l=s??{tenantId:t.tenantId,tenantLabel:n,jobOrder:[],jobs:{},truncation:{droppedCount:0}};let y=n&&l.tenantLabel!==n?{...l,tenantLabel:n}:l;if(t.jobId){const c=y.jobs[t.jobId],u=e1(c??t1(t.tenantId,t.jobId,t.at),t),h=c?y.jobOrder:[...y.jobOrder,t.jobId];y={...y,jobs:I2({...y.jobs,[t.jobId]:u},h),jobOrder:h.slice(-af)}}const S={...ke.tenantJobs,[t.tenantId]:y};return ke={...ke,connection:"live",connectionError:null,tenantJobs:S,tenantOrder:ke.tenantOrder.includes(t.tenantId)?ke.tenantOrder:[...ke.tenantOrder,t.tenantId]},v1(),{unknownTenant:o}}function A2(t,n,s){const o=ke.tenantJobs[t]??{tenantId:t,tenantLabel:n,jobOrder:[],jobs:{},truncation:{droppedCount:0}};rt({tenantJobs:{...ke.tenantJobs,[t]:{...o,truncation:s}},tenantOrder:ke.tenantOrder.includes(t)?ke.tenantOrder:[...ke.tenantOrder,t]})}function R2(t){if(!t.selectedJobId||t.activeTheaterId&&t.activeTerminalSessionId&&!Uf(t).includes(t.activeTerminalSessionId))return null;const n=k2(t);return n?t.tenantJobs[n]?.jobs[t.selectedJobId]??null:null}function k2(t){return t.activeTerminalSessionId?f1(t.sessions[t.activeTerminalSessionId]):null}function Uf(t){return t.activeTheaterId?t.sessionOrder.filter(n=>Yc(t.sessions[n],t.activeTheaterId)):[]}function d1(t,n){const s=f1(n);if(!s)return[];const o=t.tenantJobs[s];if(!o)return[];const l=[];for(const y of o.jobOrder){const S=o.jobs[y];S&&l.push({job:S,tenant:o})}return l}function L2(t,n){return n?t.expandedSessionIds.includes(n):!1}function f1(t){return t?.tenantId??t?.sessionId??null}function jf(t){return{...t,terminalSessionId:t.terminalSessionId??t.sessionId,status:t.status==="starting"&&t.tenantId?"registered":t.status}}function p1(t,n){const s={...t};for(const o of n){if(!o.terminalSessionId)continue;const l=s[o.terminalSessionId];l&&(s[o.terminalSessionId]={...l,status:o.status==="closed"?"closed":"registered",tenantId:o.tenantId,registrationId:o.registrationId,theaterId:o.theaterId??l.theaterId})}return s}function M2(t,n){const s=new Set(t.map(l=>l.id)),o=D2();return o&&s.has(o)?o:n&&s.has(n)?n:t[0]?.id??null}function $a(t,n,s,o){return t?o&&Yc(n[o],t)?o:s.find(l=>Yc(n[l],t))??null:o&&n[o]?o:s[0]??null}function Yc(t,n){return!t||!n?!1:t.theaterId===n}function D2(){if(typeof window>"u")return null;try{return window.localStorage.getItem(of)}catch{return null}}function _1(t){if(!(typeof window>"u"))try{t?window.localStorage.setItem(of,t):window.localStorage.removeItem(of)}catch{}}function g1(){if(typeof window>"u")return xd;try{const t=window.localStorage.getItem(n1);return t==="maritime"||t==="carbon"?t:xd}catch{return xd}}function O2(){if(typeof window>"u")return[];try{const t=window.localStorage.getItem(s1);if(!t)return[];const n=JSON.parse(t);return Array.isArray(n)?n.filter(s=>typeof s=="string"):[]}catch{return[]}}function B2(t){if(!(typeof window>"u"))try{window.localStorage.setItem(n1,t)}catch{}}function N2(t){if(!(typeof window>"u"))try{window.localStorage.setItem(r1,t)}catch{}}function m1(t){if(!(typeof window>"u"))try{window.localStorage.setItem(s1,JSON.stringify(t))}catch{}}function I2(t,n){if(n.length<=af)return t;const s=new Set(n.slice(-af)),o={};for(const l of Object.keys(t))s.has(l)&&(o[l]=t[l]);return o}function v1(){for(const t of lf)t()}var Rd={exports:{}},ov;function H2(){return ov||(ov=1,(function(t,n){(function(s,o){t.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 S=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"))),g=window.getComputedStyle(this._terminal.element),f=u-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),C=h-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-S;return{cols:Math.max(2,Math.floor(C/y.css.cell.width)),rows:Math.max(1,Math.floor(f/y.css.cell.height))}}}})(),s})()))})(Rd)),Rd.exports}var z2=H2(),zc={exports:{}},$2=zc.exports,lv;function U2(){return lv||(lv=1,(function(t,n){(function(s,o){t.exports=o()})($2,(()=>(()=>{var s={433:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV11=void 0;const h=u(938),g=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],f=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],C=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],E=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let T;function w(p,b){let _,m=0,x=b.length-1;if(p<b[0][0]||p>b[x][1])return!1;for(;x>=m;)if(_=m+x>>1,p>b[_][1])m=_+1;else{if(!(p<b[_][0]))return!0;x=_-1}return!1}c.UnicodeV11=class{constructor(){if(this.version="11",!T){T=new Uint8Array(65536),T.fill(1),T[0]=0,T.fill(0,1,32),T.fill(0,127,160);for(let p=0;p<g.length;++p)T.fill(0,g[p][0],g[p][1]+1);for(let p=0;p<C.length;++p)T.fill(2,C[p][0],C[p][1]+1)}}wcwidth(p){return p<32?0:p<127?1:p<65536?T[p]:w(p,f)?0:w(p,E)?2:1}charProperties(p,b){let _=this.wcwidth(p),m=_===0&&b!==0;if(m){const x=h.UnicodeService.extractWidth(b);x===0?m=!1:x>_&&(_=x)}return h.UnicodeService.createPropertyValue(0,_,m)}}},345:(S,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 g=[];for(let f=0;f<this._listeners.length;f++)g.push(this._listeners[f]);for(let f=0;f<g.length;f++)g[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((g=>h.fire(g)))},c.runAndSubscribe=function(u,h){return h(void 0),u((g=>h(g)))}},490:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const h=u(938),g=[[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 E=0;E<g.length;++E)C.fill(0,g[E][0],g[E][1]+1)}}wcwidth(E){return E<32?0:E<127?1:E<65536?C[E]:(function(T,w){let p,b=0,_=w.length-1;if(T<w[0][0]||T>w[_][1])return!1;for(;_>=b;)if(p=b+_>>1,T>w[p][1])b=p+1;else{if(!(T<w[p][0]))return!0;_=p-1}return!1})(E,f)?0:E>=131072&&E<=196605||E>=196608&&E<=262141?2:1}charProperties(E,T){let w=this.wcwidth(E),p=w===0&&T!==0;if(p){const b=h.UnicodeService.extractWidth(T);b===0?p=!1:b>w&&(w=b)}return h.UnicodeService.createPropertyValue(0,w,p)}}},938:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const h=u(345),g=u(490);class f{static extractShouldJoin(E){return(1&E)!=0}static extractWidth(E){return E>>1&3}static extractCharKind(E){return E>>3}static createPropertyValue(E,T,w=!1){return(16777215&E)<<3|(3&T)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const E=new g.UnicodeV6;this.register(E),this._active=E.version,this._activeProvider=E}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(E){if(!this._providers[E])throw new Error(`unknown Unicode version "${E}"`);this._active=E,this._activeProvider=this._providers[E],this._onChange.fire(E)}register(E){this._providers[E.version]=E}wcwidth(E){return this._activeProvider.wcwidth(E)}getStringCellWidth(E){let T=0,w=0;const p=E.length;for(let b=0;b<p;++b){let _=E.charCodeAt(b);if(55296<=_&&_<=56319){if(++b>=p)return T+this.wcwidth(_);const R=E.charCodeAt(b);56320<=R&&R<=57343?_=1024*(_-55296)+R-56320+65536:T+=this.wcwidth(R)}const m=this.charProperties(_,w);let x=f.extractWidth(m);f.extractShouldJoin(m)&&(x-=f.extractWidth(w)),T+=x,w=m}return T}charProperties(E,T){return this._activeProvider.charProperties(E,T)}}c.UnicodeService=f}},o={};function l(S){var c=o[S];if(c!==void 0)return c.exports;var u=o[S]={exports:{}};return s[S](u,u.exports,l),u.exports}var y={};return(()=>{var S=y;Object.defineProperty(S,"__esModule",{value:!0}),S.Unicode11Addon=void 0;const c=l(433);S.Unicode11Addon=class{activate(u){u.unicode.register(new c.UnicodeV11)}dispose(){}}})(),y})()))})(zc)),zc.exports}var j2=U2();var P2=(t,n,s,o)=>{for(var l=n,y=t.length-1,S;y>=0;y--)(S=t[y])&&(l=S(l)||l);return l},F2=(t,n)=>(s,o)=>n(s,o,t),q2=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?cv.isErrorNoTelemetry(t)?new cv(t.message+`
12
-
13
- `+t.stack):new Error(t.message+`
14
-
15
- `+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(n=>{n(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},W2=new q2;function kd(t){G2(t)||W2.onUnexpectedError(t)}var cf="Canceled";function G2(t){return t instanceof K2?!0:t instanceof Error&&t.name===cf&&t.message===cf}var K2=class extends Error{constructor(){super(cf),this.name=this.message}},cv=class uf extends Error{constructor(n){super(n),this.name="CodeExpectedError"}static fromError(n){if(n instanceof uf)return n;let s=new uf;return s.message=n.message,s.stack=n.stack,s}static isErrorNoTelemetry(n){return n.name==="CodeExpectedError"}},V2;(t=>{function n(y){return y<0}t.isLessThan=n;function s(y){return y<=0}t.isLessThanOrEqual=s;function o(y){return y>0}t.isGreaterThan=o;function l(y){return y===0}t.isNeitherLessOrGreaterThan=l,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(V2||={});function Y2(t,n){let s=this,o=!1,l;return function(){return o||(o=!0,n||(l=t.apply(s,arguments))),l}}var b1;(t=>{function n(x){return x&&typeof x=="object"&&typeof x[Symbol.iterator]=="function"}t.is=n;let s=Object.freeze([]);function o(){return s}t.empty=o;function*l(x){yield x}t.single=l;function y(x){return n(x)?x:l(x)}t.wrap=y;function S(x){return x||s}t.from=S;function*c(x){for(let R=x.length-1;R>=0;R--)yield x[R]}t.reverse=c;function u(x){return!x||x[Symbol.iterator]().next().done===!0}t.isEmpty=u;function h(x){return x[Symbol.iterator]().next().value}t.first=h;function g(x,R){let k=0;for(let D of x)if(R(D,k++))return!0;return!1}t.some=g;function f(x,R){for(let k of x)if(R(k))return k}t.find=f;function*C(x,R){for(let k of x)R(k)&&(yield k)}t.filter=C;function*E(x,R){let k=0;for(let D of x)yield R(D,k++)}t.map=E;function*T(x,R){let k=0;for(let D of x)yield*R(D,k++)}t.flatMap=T;function*w(...x){for(let R of x)yield*R}t.concat=w;function p(x,R,k){let D=k;for(let A of x)D=R(D,A);return D}t.reduce=p;function*b(x,R,k=x.length){for(R<0&&(R+=x.length),k<0?k+=x.length:k>x.length&&(k=x.length);R<k;R++)yield x[R]}t.slice=b;function _(x,R=Number.POSITIVE_INFINITY){let k=[];if(R===0)return[k,x];let D=x[Symbol.iterator]();for(let A=0;A<R;A++){let B=D.next();if(B.done)return[k,t.empty()];k.push(B.value)}return[k,{[Symbol.iterator](){return D}}]}t.consume=_;async function m(x){let R=[];for await(let k of x)R.push(k);return Promise.resolve(R)}t.asyncToArray=m})(b1||={});function S1(t){if(b1.is(t)){let n=[];for(let s of t)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(t)?[]:t}else if(t)return t.dispose(),t}function y1(...t){return ki(()=>S1(t))}function ki(t){return{dispose:Y2(()=>{t()})}}var C1=class w1{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{S1(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?w1.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)}};C1.DISABLE_DISPOSED_WARNING=!1;var Ba=C1,$n=class{constructor(){this._store=new Ba,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)}};$n.None=Object.freeze({dispose(){}});var zo=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}},Pf=typeof process<"u"&&"title"in process,uu=Pf?"node":navigator.userAgent,X2=Pf?"node":navigator.platform,Z2=uu.includes("Firefox"),Q2=uu.includes("Edge"),E1=/^((?!chrome|android).)*safari/i.test(uu);function J2(){if(!E1)return 0;let t=uu.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}X2.indexOf("Linux")>=0;var eE="",fi=0,pi=0,_i=0,Wt=0,yn={css:"#00000000",rgba:0},Oi;(t=>{function n(l,y,S,c){return c!==void 0?`#${ks(l)}${ks(y)}${ks(S)}${ks(c)}`:`#${ks(l)}${ks(y)}${ks(S)}`}t.toCss=n;function s(l,y,S,c=255){return(l<<24|y<<16|S<<8|c)>>>0}t.toRgba=s;function o(l,y,S,c){return{css:t.toCss(l,y,S,c),rgba:t.toRgba(l,y,S,c)}}t.toColor=o})(Oi||={});var Xo;(t=>{function n(u,h){if(Wt=(h.rgba&255)/255,Wt===1)return{css:h.css,rgba:h.rgba};let g=h.rgba>>24&255,f=h.rgba>>16&255,C=h.rgba>>8&255,E=u.rgba>>24&255,T=u.rgba>>16&255,w=u.rgba>>8&255;fi=E+Math.round((g-E)*Wt),pi=T+Math.round((f-T)*Wt),_i=w+Math.round((C-w)*Wt);let p=Oi.toCss(fi,pi,_i),b=Oi.toRgba(fi,pi,_i);return{css:p,rgba:b}}t.blend=n;function s(u){return(u.rgba&255)===255}t.isOpaque=s;function o(u,h,g){let f=Os.ensureContrastRatio(u.rgba,h.rgba,g);if(f)return Oi.toColor(f>>24&255,f>>16&255,f>>8&255)}t.ensureContrastRatio=o;function l(u){let h=(u.rgba|255)>>>0;return[fi,pi,_i]=Os.toChannels(h),{css:Oi.toCss(fi,pi,_i),rgba:h}}t.opaque=l;function y(u,h){return Wt=Math.round(h*255),[fi,pi,_i]=Os.toChannels(u.rgba),{css:Oi.toCss(fi,pi,_i,Wt),rgba:Oi.toRgba(fi,pi,_i,Wt)}}t.opacity=y;function S(u,h){return Wt=u.rgba&255,y(u,Wt*h/255)}t.multiplyOpacity=S;function c(u){return[u.rgba>>24&255,u.rgba>>16&255,u.rgba>>8&255]}t.toColorRGB=c})(Xo||={});var tE;(t=>{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),pi=parseInt(l.slice(2,3).repeat(2),16),_i=parseInt(l.slice(3,4).repeat(2),16),Oi.toColor(fi,pi,_i);case 5:return fi=parseInt(l.slice(1,2).repeat(2),16),pi=parseInt(l.slice(2,3).repeat(2),16),_i=parseInt(l.slice(3,4).repeat(2),16),Wt=parseInt(l.slice(4,5).repeat(2),16),Oi.toColor(fi,pi,_i,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]),pi=parseInt(y[2]),_i=parseInt(y[3]),Wt=Math.round((y[5]===void 0?1:parseFloat(y[5]))*255),Oi.toColor(fi,pi,_i,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,pi,_i,Wt]=n.getImageData(0,0,1,1).data,Wt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Oi.toRgba(fi,pi,_i,Wt),css:l}}t.toColor=o})(tE||={});var Mi;(t=>{function n(o){return s(o>>16&255,o>>8&255,o&255)}t.relativeLuminance=n;function s(o,l,y){let S=o/255,c=l/255,u=y/255,h=S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4),g=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+g*.7152+f*.0722}t.relativeLuminance2=s})(Mi||={});var Os;(t=>{function n(S,c){if(Wt=(c&255)/255,Wt===1)return c;let u=c>>24&255,h=c>>16&255,g=c>>8&255,f=S>>24&255,C=S>>16&255,E=S>>8&255;return fi=f+Math.round((u-f)*Wt),pi=C+Math.round((h-C)*Wt),_i=E+Math.round((g-E)*Wt),Oi.toRgba(fi,pi,_i)}t.blend=n;function s(S,c,u){let h=Mi.relativeLuminance(S>>8),g=Mi.relativeLuminance(c>>8);if(Cr(h,g)<u){if(g<h){let E=o(S,c,u),T=Cr(h,Mi.relativeLuminance(E>>8));if(T<u){let w=l(S,c,u),p=Cr(h,Mi.relativeLuminance(w>>8));return T>p?E:w}return E}let f=l(S,c,u),C=Cr(h,Mi.relativeLuminance(f>>8));if(C<u){let E=o(S,c,u),T=Cr(h,Mi.relativeLuminance(E>>8));return C>T?f:E}return f}}t.ensureContrastRatio=s;function o(S,c,u){let h=S>>24&255,g=S>>16&255,f=S>>8&255,C=c>>24&255,E=c>>16&255,T=c>>8&255,w=Cr(Mi.relativeLuminance2(C,E,T),Mi.relativeLuminance2(h,g,f));for(;w<u&&(C>0||E>0||T>0);)C-=Math.max(0,Math.ceil(C*.1)),E-=Math.max(0,Math.ceil(E*.1)),T-=Math.max(0,Math.ceil(T*.1)),w=Cr(Mi.relativeLuminance2(C,E,T),Mi.relativeLuminance2(h,g,f));return(C<<24|E<<16|T<<8|255)>>>0}t.reduceLuminance=o;function l(S,c,u){let h=S>>24&255,g=S>>16&255,f=S>>8&255,C=c>>24&255,E=c>>16&255,T=c>>8&255,w=Cr(Mi.relativeLuminance2(C,E,T),Mi.relativeLuminance2(h,g,f));for(;w<u&&(C<255||E<255||T<255);)C=Math.min(255,C+Math.ceil((255-C)*.1)),E=Math.min(255,E+Math.ceil((255-E)*.1)),T=Math.min(255,T+Math.ceil((255-T)*.1)),w=Cr(Mi.relativeLuminance2(C,E,T),Mi.relativeLuminance2(h,g,f));return(C<<24|E<<16|T<<8|255)>>>0}t.increaseLuminance=l;function y(S){return[S>>24&255,S>>16&255,S>>8&255,S&255]}t.toChannels=y})(Os||={});function ks(t){let n=t.toString(16);return n.length<2?"0"+n:n}function Cr(t,n){return t<n?(n+.05)/(t+.05):(t+.05)/(n+.05)}function li(t){if(!t)throw new Error("value must not be falsy");return t}function Ff(t){return 57508<=t&&t<=57558}function iE(t){return 57520<=t&&t<=57527}function nE(t){return 57344<=t&&t<=63743}function rE(t){return 9472<=t&&t<=9631}function sE(t){return t>=128512&&t<=128591||t>=127744&&t<=128511||t>=128640&&t<=128767||t>=9728&&t<=9983||t>=9984&&t<=10175||t>=65024&&t<=65039||t>=129280&&t<=129535||t>=127462&&t<=127487}function aE(t,n,s,o){return n===1&&s>Math.ceil(o*1.5)&&t!==void 0&&t>255&&!sE(t)&&!Ff(t)&&!nE(t)}function x1(t){return Ff(t)||rE(t)}function oE(){return{css:{canvas:Ec(),cell:Ec()},device:{canvas:Ec(),cell:Ec(),char:{width:0,height:0,left:0,top:0}}}}function Ec(){return{width:0,height:0}}function lE(t,n,s=0){return(t-(Math.round(n)*2-s))%(Math.round(n)*2)}var Ei=0,di=0,Kn=!1,wr=!1,xc=!1,Gi,Ld=0,cE=class{constructor(t,n,s,o,l,y){this._terminal=t,this._optionService=n,this._selectionRenderModel=s,this._decorationService=o,this._coreBrowserService=l,this._themeService=y,this.result={fg:0,bg:0,ext:0}}resolve(t,n,s,o){if(this.result.bg=t.bg,this.result.fg=t.fg,this.result.ext=t.bg&268435456?t.extended.ext:0,di=0,Ei=0,wr=!1,Kn=!1,xc=!1,Gi=this._themeService.colors,Ld=0,t.getCode()!==0&&t.extended.underlineStyle===4){let l=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));Ld=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)}),xc=this._selectionRenderModel.isCellSelected(this._terminal,n,s),xc){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),x1(t.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&&(xc?di=t.bg&-16777216&-134217729|di|50331648:di=t.bg&-16777216|di|50331648),Kn&&(Ei=t.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|=Ld<<29&3758096384}},uE=.5,T1=Z2||Q2?"bottom":"ideographic",hE={"▀":[{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}]},dE={"░":[[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]]},fE={"─":{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:(t,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"║":{1:(t,n)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╒":{1:(t,n)=>`M.5,1 L.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╓":{1:(t,n)=>`M${.5-t},1 L${.5-t},.5 L1,.5 M${.5+t},.5 L${.5+t},1`},"╔":{1:(t,n)=>`M1,${.5-n} L${.5-t},${.5-n} L${.5-t},1 M1,${.5+n} L${.5+t},${.5+n} L${.5+t},1`},"╕":{1:(t,n)=>`M0,${.5-n} L.5,${.5-n} L.5,1 M0,${.5+n} L.5,${.5+n}`},"╖":{1:(t,n)=>`M${.5+t},1 L${.5+t},.5 L0,.5 M${.5-t},.5 L${.5-t},1`},"╗":{1:(t,n)=>`M0,${.5+n} L${.5-t},${.5+n} L${.5-t},1 M0,${.5-n} L${.5+t},${.5-n} L${.5+t},1`},"╘":{1:(t,n)=>`M.5,0 L.5,${.5+n} L1,${.5+n} M.5,${.5-n} L1,${.5-n}`},"╙":{1:(t,n)=>`M1,.5 L${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╚":{1:(t,n)=>`M1,${.5-n} L${.5+t},${.5-n} L${.5+t},0 M1,${.5+n} L${.5-t},${.5+n} L${.5-t},0`},"╛":{1:(t,n)=>`M0,${.5+n} L.5,${.5+n} L.5,0 M0,${.5-n} L.5,${.5-n}`},"╜":{1:(t,n)=>`M0,.5 L${.5+t},.5 L${.5+t},0 M${.5-t},.5 L${.5-t},0`},"╝":{1:(t,n)=>`M0,${.5-n} L${.5-t},${.5-n} L${.5-t},0 M0,${.5+n} L${.5+t},${.5+n} L${.5+t},0`},"╞":{1:(t,n)=>`M.5,0 L.5,1 M.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╟":{1:(t,n)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1 M${.5+t},.5 L1,.5`},"╠":{1:(t,n)=>`M${.5-t},0 L${.5-t},1 M1,${.5+n} L${.5+t},${.5+n} L${.5+t},1 M1,${.5-n} L${.5+t},${.5-n} L${.5+t},0`},"╡":{1:(t,n)=>`M.5,0 L.5,1 M0,${.5-n} L.5,${.5-n} M0,${.5+n} L.5,${.5+n}`},"╢":{1:(t,n)=>`M0,.5 L${.5-t},.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╣":{1:(t,n)=>`M${.5+t},0 L${.5+t},1 M0,${.5+n} L${.5-t},${.5+n} L${.5-t},1 M0,${.5-n} L${.5-t},${.5-n} L${.5-t},0`},"╤":{1:(t,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n} M.5,${.5+n} L.5,1`},"╥":{1:(t,n)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},1 M${.5+t},.5 L${.5+t},1`},"╦":{1:(t,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L${.5-t},${.5+n} L${.5-t},1 M1,${.5+n} L${.5+t},${.5+n} L${.5+t},1`},"╧":{1:(t,n)=>`M.5,0 L.5,${.5-n} M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╨":{1:(t,n)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╩":{1:(t,n)=>`M0,${.5+n} L1,${.5+n} M0,${.5-n} L${.5-t},${.5-n} L${.5-t},0 M1,${.5-n} L${.5+t},${.5-n} L${.5+t},0`},"╪":{1:(t,n)=>`M.5,0 L.5,1 M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╫":{1:(t,n)=>`M0,.5 L1,.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╬":{1:(t,n)=>`M0,${.5+n} L${.5-t},${.5+n} L${.5-t},1 M1,${.5+n} L${.5+t},${.5+n} L${.5+t},1 M0,${.5-n} L${.5-t},${.5-n} L${.5-t},0 M1,${.5-n} L${.5+t},${.5-n} L${.5+t},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:(t,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,1,.5`},"╮":{1:(t,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,0,.5`},"╯":{1:(t,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,0,.5`},"╰":{1:(t,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,1,.5`}},rl={"":{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}};rl[""]=rl[""];rl[""]=rl[""];function pE(t,n,s,o,l,y,S,c){let u=hE[n];if(u)return _E(t,u,s,o,l,y),!0;let h=dE[n];if(h)return gE(t,h,s,o,l,y),!0;let g=fE[n];if(g)return mE(t,g,s,o,l,y,c),!0;let f=rl[n];return f?(vE(t,f,s,o,l,y,S,c),!0):!1}function _E(t,n,s,o,l,y){for(let S=0;S<n.length;S++){let c=n[S],u=l/8,h=y/8;t.fillRect(s+c.x*u,o+c.y*h,c.w*u,c.h*h)}}var uv=new Map;function gE(t,n,s,o,l,y){let S=uv.get(n);S||(S=new Map,uv.set(n,S));let c=t.fillStyle;if(typeof c!="string")throw new Error(`Unexpected fillStyle type "${c}"`);let u=S.get(c);if(!u){let h=n[0].length,g=n.length,f=t.canvas.ownerDocument.createElement("canvas");f.width=h,f.height=g;let C=li(f.getContext("2d")),E=new ImageData(h,g),T,w,p,b;if(c.startsWith("#"))T=parseInt(c.slice(1,3),16),w=parseInt(c.slice(3,5),16),p=parseInt(c.slice(5,7),16),b=c.length>7&&parseInt(c.slice(7,9),16)||1;else if(c.startsWith("rgba"))[T,w,p,b]=c.substring(5,c.length-1).split(",").map(_=>parseFloat(_));else throw new Error(`Unexpected fillStyle color format "${c}" when drawing pattern glyph`);for(let _=0;_<g;_++)for(let m=0;m<h;m++)E.data[(_*h+m)*4]=T,E.data[(_*h+m)*4+1]=w,E.data[(_*h+m)*4+2]=p,E.data[(_*h+m)*4+3]=n[_][m]*(b*255);C.putImageData(E,0,0),u=li(t.createPattern(f,null)),S.set(c,u)}t.fillStyle=u,t.fillRect(s,o,l,y)}function mE(t,n,s,o,l,y,S){t.strokeStyle=t.fillStyle;for(let[c,u]of Object.entries(n)){t.beginPath(),t.lineWidth=S*Number.parseInt(c);let h;if(typeof u=="function"){let g=.15/y*l;h=u(.15,g)}else h=u;for(let g of h.split(" ")){let f=g[0],C=A1[f];if(!C){console.error(`Could not find drawing instructions for "${f}"`);continue}let E=g.substring(1).split(",");!E[0]||!E[1]||C(t,R1(E,l,y,s,o,!0,S))}t.stroke(),t.closePath()}}function vE(t,n,s,o,l,y,S,c){let u=new Path2D;u.rect(s,o,l,y),t.clip(u),t.beginPath();let h=S/12;t.lineWidth=c*h;for(let g of n.d.split(" ")){let f=g[0],C=A1[f];if(!C){console.error(`Could not find drawing instructions for "${f}"`);continue}let E=g.substring(1).split(",");!E[0]||!E[1]||C(t,R1(E,l,y,s,o,!1,c,(n.leftPadding??0)*(h/2),(n.rightPadding??0)*(h/2)))}n.type===1?(t.strokeStyle=t.fillStyle,t.stroke()):t.fill(),t.closePath()}function hv(t,n,s=0){return Math.max(Math.min(t,n),s)}var A1={C:(t,n)=>t.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]),L:(t,n)=>t.lineTo(n[0],n[1]),M:(t,n)=>t.moveTo(n[0],n[1])};function R1(t,n,s,o,l,y,S,c=0,u=0){let h=t.map(g=>parseFloat(g)||parseInt(g));if(h.length<2)throw new Error("Too few arguments for instruction");for(let g=0;g<h.length;g+=2)h[g]*=n-c*S-u*S,y&&h[g]!==0&&(h[g]=hv(Math.round(h[g]+.5)-.5,n,0)),h[g]+=o+c*S;for(let g=1;g<h.length;g+=2)h[g]*=s,y&&h[g]!==0&&(h[g]=hv(Math.round(h[g]+.5)-.5,s,0)),h[g]+=l;return h}var dv=class{constructor(){this._data={}}set(t,n,s){this._data[t]||(this._data[t]={}),this._data[t][n]=s}get(t,n){return this._data[t]?this._data[t][n]:void 0}clear(){this._data={}}},fv=class{constructor(){this._data=new dv}set(t,n,s,o,l){this._data.get(t,n)||this._data.set(t,n,new dv),this._data.get(t,n).set(s,o,l)}get(t,n,s,o){return this._data.get(t,n)?.get(s,o)}clear(){this._data.clear()}},k1=class{constructor(){this._tasks=[],this._i=0}enqueue(t){this._tasks.push(t),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(t){this._idleCallback=void 0;let n=0,s=0,o=t.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=t.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()}},bE=class extends k1{_requestCallback(t){return setTimeout(()=>t(this._createDeadline(16)))}_cancelCallback(t){clearTimeout(t)}_createDeadline(t){let n=performance.now()+t;return{timeRemaining:()=>Math.max(0,n-performance.now())}}},SE=class extends k1{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},yE=!Pf&&"requestIdleCallback"in window?SE:bE,La=class L1{constructor(){this.fg=0,this.bg=0,this.extended=new M1}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 L1;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}},M1=class D1{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 D1(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},CE=globalThis.performance&&typeof globalThis.performance.now=="function",wE=class O1{static create(n){return new O1(n)}constructor(n){this._now=CE&&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;(t=>{t.None=()=>$n.None;function n(F,H){return f(F,()=>{},0,void 0,!0,void 0,H)}t.defer=n;function s(F){return(H,Z=null,ee)=>{let P=!1,V;return V=F(K=>{if(!P)return V?V.dispose():P=!0,H.call(Z,K)},null,ee),P&&V.dispose(),V}}t.once=s;function o(F,H,Z){return h((ee,P=null,V)=>F(K=>ee.call(P,H(K)),null,V),Z)}t.map=o;function l(F,H,Z){return h((ee,P=null,V)=>F(K=>{H(K),ee.call(P,K)},null,V),Z)}t.forEach=l;function y(F,H,Z){return h((ee,P=null,V)=>F(K=>H(K)&&ee.call(P,K),null,V),Z)}t.filter=y;function S(F){return F}t.signal=S;function c(...F){return(H,Z=null,ee)=>{let P=y1(...F.map(V=>V(K=>H.call(Z,K))));return g(P,ee)}}t.any=c;function u(F,H,Z,ee){let P=Z;return o(F,V=>(P=H(P,V),P),ee)}t.reduce=u;function h(F,H){let Z,ee={onWillAddFirstListener(){Z=F(P.fire,P)},onDidRemoveLastListener(){Z?.dispose()}},P=new Lt(ee);return H?.add(P),P.event}function g(F,H){return H instanceof Array?H.push(F):H&&H.add(F),F}function f(F,H,Z=100,ee=!1,P=!1,V,K){let O,z,M,U=0,Y,ae={leakWarningThreshold:V,onWillAddFirstListener(){O=F(me=>{U++,z=H(z,me),ee&&!M&&(ce.fire(z),z=void 0),Y=()=>{let Q=z;z=void 0,M=void 0,(!ee||U>1)&&ce.fire(Q),U=0},typeof Z=="number"?(clearTimeout(M),M=setTimeout(Y,Z)):M===void 0&&(M=0,queueMicrotask(Y))})},onWillRemoveListener(){P&&U>0&&Y?.()},onDidRemoveLastListener(){Y=void 0,O.dispose()}},ce=new Lt(ae);return K?.add(ce),ce.event}t.debounce=f;function C(F,H=0,Z){return t.debounce(F,(ee,P)=>ee?(ee.push(P),ee):[P],H,void 0,!0,void 0,Z)}t.accumulate=C;function E(F,H=(ee,P)=>ee===P,Z){let ee=!0,P;return y(F,V=>{let K=ee||!H(V,P);return ee=!1,P=V,K},Z)}t.latch=E;function T(F,H,Z){return[t.filter(F,H,Z),t.filter(F,ee=>!H(ee),Z)]}t.split=T;function w(F,H=!1,Z=[],ee){let P=Z.slice(),V=F(z=>{P?P.push(z):O.fire(z)});ee&&ee.add(V);let K=()=>{P?.forEach(z=>O.fire(z)),P=null},O=new Lt({onWillAddFirstListener(){V||(V=F(z=>O.fire(z)),ee&&ee.add(V))},onDidAddFirstListener(){P&&(H?setTimeout(K):K())},onDidRemoveLastListener(){V&&V.dispose(),V=null}});return ee&&ee.add(O),O.event}t.buffer=w;function p(F,H){return(Z,ee,P)=>{let V=H(new _);return F(function(K){let O=V.evaluate(K);O!==b&&Z.call(ee,O)},void 0,P)}}t.chain=p;let b=Symbol("HaltChainable");class _{constructor(){this.steps=[]}map(H){return this.steps.push(H),this}forEach(H){return this.steps.push(Z=>(H(Z),Z)),this}filter(H){return this.steps.push(Z=>H(Z)?Z:b),this}reduce(H,Z){let ee=Z;return this.steps.push(P=>(ee=H(ee,P),ee)),this}latch(H=(Z,ee)=>Z===ee){let Z=!0,ee;return this.steps.push(P=>{let V=Z||!H(P,ee);return Z=!1,ee=P,V?P:b}),this}evaluate(H){for(let Z of this.steps)if(H=Z(H),H===b)break;return H}}function m(F,H,Z=ee=>ee){let ee=(...O)=>K.fire(Z(...O)),P=()=>F.on(H,ee),V=()=>F.removeListener(H,ee),K=new Lt({onWillAddFirstListener:P,onDidRemoveLastListener:V});return K.event}t.fromNodeEventEmitter=m;function x(F,H,Z=ee=>ee){let ee=(...O)=>K.fire(Z(...O)),P=()=>F.addEventListener(H,ee),V=()=>F.removeEventListener(H,ee),K=new Lt({onWillAddFirstListener:P,onDidRemoveLastListener:V});return K.event}t.fromDOMEventEmitter=x;function R(F){return new Promise(H=>s(F)(H))}t.toPromise=R;function k(F){let H=new Lt;return F.then(Z=>{H.fire(Z)},()=>{H.fire(void 0)}).finally(()=>{H.dispose()}),H.event}t.fromPromise=k;function D(F,H){return F(Z=>H.fire(Z))}t.forward=D;function A(F,H,Z){return H(Z),F(ee=>H(ee))}t.runAndSubscribe=A;class B{constructor(H,Z){this._observable=H,this._counter=0,this._hasChanged=!1;let ee={onWillAddFirstListener:()=>{H.addObserver(this)},onDidRemoveLastListener:()=>{H.removeObserver(this)}};this.emitter=new Lt(ee),Z&&Z.add(this.emitter)}beginUpdate(H){this._counter++}handlePossibleChange(H){}handleChange(H,Z){this._hasChanged=!0}endUpdate(H){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function W(F,H){return new B(F,H).emitter.event}t.fromObservable=W;function j(F){return(H,Z,ee)=>{let P=0,V=!1,K={beginUpdate(){P++},endUpdate(){P--,P===0&&(F.reportChanges(),V&&(V=!1,H.call(Z)))},handlePossibleChange(){},handleChange(){V=!0}};F.addObserver(K),F.reportChanges();let O={dispose(){F.removeObserver(K)}};return ee instanceof Ba?ee.add(O):Array.isArray(ee)&&ee.push(O),O}}t.fromObservableLight=j})(Rr||={});var hf=class df{constructor(n){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${n}_${df._idPool++}`,df.all.add(this)}start(n){this._stopWatch=new wE,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}}};hf.all=new Set,hf._idPool=0;var EE=hf,xE=-1,B1=class N1{constructor(n,s,o=(N1._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,S]=this.getMostFrequentStack(),c=`[${this.name}] potential listener LEAK detected, having ${s} listeners already. MOST frequent listener (${S}):`;console.warn(c),console.warn(y);let u=new RE(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}};B1._idPool=1;var TE=B1,AE=class I1{constructor(n){this.value=n}static create(){let n=new Error;return new I1(n.stack??"")}print(){console.warn(this.value.split(`
16
- `).slice(2).join(`
17
- `))}},RE=class extends Error{constructor(t,n){super(t),this.name="ListenerLeakError",this.stack=n}},kE=class extends Error{constructor(t,n){super(t),this.name="ListenerRefusalError",this.stack=n}},LE=0,Md=class{constructor(n){this.value=n,this.id=LE++}},ME=2,DE,Lt=class{constructor(n){this._size=0,this._options=n,this._leakageMon=this._options?.leakWarningThreshold?new TE(n?.onListenerError??kd,this._options?.leakWarningThreshold??xE):void 0,this._perfMon=this._options?._profName?new EE(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 kE(`${c}. HINT: Stack shows most frequent listener (${u[1]}-times)`,u[0]);return(this._options?.onListenerError||kd)(h),$n.None}if(this._disposed)return $n.None;s&&(n=n.bind(s));let l=new Md(n),y;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(l.stack=AE.create(),y=this._leakageMon.check(l.stack,this._size+1)),this._listeners?this._listeners instanceof Md?(this._deliveryQueue??=new OE,this._listeners=[this._listeners,l]):this._listeners.push(l):(this._options?.onWillAddFirstListener?.(this),this._listeners=l,this._options?.onDidAddFirstListener?.(this)),this._size++;let S=ki(()=>{y?.(),this._removeListener(l)});return o instanceof Ba?o.add(S):Array.isArray(o)&&o.push(S),S},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*ME<=s.length){let y=0;for(let S=0;S<s.length;S++)s[S]?s[y++]=s[S]: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||kd;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 Md)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}},OE=class{constructor(){this.i=-1,this.end=0}enqueue(t,n,s){this.i=0,this.end=s,this.current=t,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},pv={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}},$o=2,Uo,as=class Aa{constructor(n,s,o){this._document=n,this._config=s,this._unicodeService=o,this._didWarmUp=!1,this._cacheMap=new fv,this._cacheMapCombined=new fv,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new La,this._textureSize=512,this._onAddTextureAtlasCanvas=new Lt,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Lt,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=H1(n,this._config.deviceCellWidth*4+$o*2,this._config.deviceCellHeight+$o*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 yE;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(Aa.maxAtlasPages&&this._pages.length>=Math.max(4,Aa.maxAtlasPages)){let s=this._pages.filter(h=>h.canvas.width*2<=(Aa.maxTextureSize||4096)).sort((h,g)=>g.canvas.width!==h.canvas.width?g.canvas.width-h.canvas.width:g.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),S=y.map(h=>h.glyphs[0].texturePage).sort((h,g)=>h>g?1:-1),c=this.pages.length-y.length,u=this._mergePages(y,c);u.version++;for(let h=S.length-1;h>=0;h--)this._deletePage(S[h]);this.pages.push(u),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(u.canvas)}let n=new Dd(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 Dd(this._document,o,n);for(let[y,S]of n.entries()){let c=y*S.canvas.width%o,u=Math.floor(y/2)*S.canvas.height;l.ctx.drawImage(S.canvas,c,u);for(let g of S.glyphs)g.texturePage=s,g.sizeClipSpace.x=g.size.x/o,g.sizeClipSpace.y=g.size.y/o,g.texturePosition.x+=c,g.texturePosition.y+=u,g.texturePositionClipSpace.x=g.texturePosition.x/o,g.texturePositionClipSpace.y=g.texturePosition.y/o;this._onRemoveTextureAtlasCanvas.fire(S.canvas);let h=this._activePages.indexOf(S);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,S){return this._getFromCacheMap(this._cacheMapCombined,n,s,o,l,y,S)}getRasterizedGlyph(n,s,o,l,y,S){return this._getFromCacheMap(this._cacheMap,n,s,o,l,y,S)}_getFromCacheMap(n,s,o,l,y,S,c){return Uo=n.get(s,o,l,y),Uo||(Uo=this._drawToCache(s,o,l,y,S,c),n.set(s,o,l,y,Uo)),Uo}_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 S=La.toColorRGB(s);y=Oi.toColor(S[0],S[1],S[2]);break;default:o?y=Xo.opaque(this._config.colors.foreground):y=this._config.colors.background;break}return this._config.allowTransparency||(y=Xo.opaque(y)),y}_getForegroundColor(n,s,o,l,y,S,c,u,h,g){let f=this._getMinimumContrastColor(n,s,o,l,y,S,c,h,u,g);if(f)return f;let C;switch(y){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&h&&S<8&&(S+=8),C=this._getColorFromAnsiIndex(S);break;case 50331648:let E=La.toColorRGB(S);C=Oi.toColor(E[0],E[1],E[2]);break;default:c?C=this._config.colors.background:C=this._config.colors.foreground}return this._config.allowTransparency&&(C=Xo.opaque(C)),u&&(C=Xo.multiplyOpacity(C,uE)),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,S,c,u,h,g){if(this._config.minimumContrastRatio===1||g)return;let f=this._getContrastCache(h),C=f.getColor(n,l);if(C!==void 0)return C||void 0;let E=this._resolveBackgroundRgba(s,o,c),T=this._resolveForegroundRgba(y,S,c,u),w=Os.ensureContrastRatio(E,T,this._config.minimumContrastRatio/(h?2:1));if(!w){f.setColor(n,l,null);return}let p=Oi.toColor(w>>24&255,w>>16&255,w>>8&255);return f.setColor(n,l,p),p}_getContrastCache(n){return n?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(n,s,o,l,y,S){let c=typeof n=="number"?String.fromCharCode(n):n;S&&this._tmpCanvas.parentElement!==S&&(this._tmpCanvas.style.display="none",S.append(this._tmpCanvas));let u=Math.min(this._config.deviceCellWidth*Math.max(c.length,2)+$o*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<u&&(this._tmpCanvas.width=u);let h=Math.min(this._config.deviceCellHeight+$o*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 pv;let g=!!this._workAttributeData.isBold(),f=!!this._workAttributeData.isInverse(),C=!!this._workAttributeData.isDim(),E=!!this._workAttributeData.isItalic(),T=!!this._workAttributeData.isUnderline(),w=!!this._workAttributeData.isStrikethrough(),p=!!this._workAttributeData.isOverline(),b=this._workAttributeData.getFgColor(),_=this._workAttributeData.getFgColorMode(),m=this._workAttributeData.getBgColor(),x=this._workAttributeData.getBgColorMode();if(f){let z=b;b=m,m=z;let M=_;_=x,x=M}let R=this._getBackgroundColor(x,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 k=g?this._config.fontWeightBold:this._config.fontWeight,D=E?"italic":"";this._tmpCtx.font=`${D} ${k} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=T1;let A=c.length===1&&Ff(c.charCodeAt(0)),B=c.length===1&&iE(c.charCodeAt(0)),W=this._getForegroundColor(s,x,m,o,_,b,f,C,g,x1(c.charCodeAt(0)));this._tmpCtx.fillStyle=W.css;let j=B?0:$o*2,F=!1;this._config.customGlyphs!==!1&&(F=pE(this._tmpCtx,c,j,j,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let H=!A,Z;if(typeof n=="number"?Z=this._unicodeService.wcwidth(n):Z=this._unicodeService.getStringCellWidth(n),T){this._tmpCtx.save();let z=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),M=z%2===1?.5:0;if(this._tmpCtx.lineWidth=z,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())H=!1,this._tmpCtx.strokeStyle=`rgb(${La.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{H=!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=j,Y=Math.ceil(j+this._config.deviceCharHeight)-M-(y?z*2:0),ae=Y+z,ce=Y+z*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,_e=$+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo($,Y),this._tmpCtx.lineTo(oe,Y),this._tmpCtx.moveTo($,ce),this._tmpCtx.lineTo(oe,ce);break;case 3:let Se=z<=1?ce:Math.ceil(j+this._config.deviceCharHeight-z/2)-M,be=z<=1?Y:Math.ceil(j+this._config.deviceCharHeight+z/2)-M,$e=new Path2D;$e.rect($,Y,this._config.deviceCellWidth,ce-Y),this._tmpCtx.clip($e),this._tmpCtx.moveTo($-this._config.deviceCellWidth/2,ae),this._tmpCtx.bezierCurveTo($-this._config.deviceCellWidth/2,be,$,be,$,ae),this._tmpCtx.bezierCurveTo($,Se,_e,Se,_e,ae),this._tmpCtx.bezierCurveTo(_e,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 Pe=me===0?0:me>=z?z*2-me:z-me;me>=z||Pe===0?(this._tmpCtx.setLineDash([Math.round(z),Math.round(z)]),this._tmpCtx.moveTo($+Pe,Y),this._tmpCtx.lineTo(oe,Y)):(this._tmpCtx.setLineDash([Math.round(z),Math.round(z)]),this._tmpCtx.moveTo($,Y),this._tmpCtx.lineTo($+Pe,Y),this._tmpCtx.moveTo($+Pe+z,Y),this._tmpCtx.lineTo(oe,Y)),me=lE(oe-$,z,me);break;case 5:let Ke=.6,Ct=.3,Be=oe-$,Qt=Math.floor(Ke*Be),gi=Math.floor(Ct*Be),mi=Be-Qt-gi;this._tmpCtx.setLineDash([Qt,gi,mi]),this._tmpCtx.moveTo($,Y),this._tmpCtx.lineTo(oe,Y);break;default:this._tmpCtx.moveTo($,Y),this._tmpCtx.lineTo(oe,Y);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,Y-Math.ceil(z/2),this._config.deviceCellWidth*Z,ce-Y+Math.ceil(z/2)),this._tmpCtx.clip($),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=R.css,this._tmpCtx.strokeText(c,j,j+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(p){let z=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),M=z%2===1?.5:0;this._tmpCtx.lineWidth=z,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(j,j+M),this._tmpCtx.lineTo(j+this._config.deviceCharWidth*Z,j+M),this._tmpCtx.stroke()}if(F||this._tmpCtx.fillText(c,j,j+this._config.deviceCharHeight),c==="_"&&!this._config.allowTransparency){let z=Od(this._tmpCtx.getImageData(j,j,this._config.deviceCellWidth,this._config.deviceCellHeight),R,W,H);if(z)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,j,j+this._config.deviceCharHeight-M),z=Od(this._tmpCtx.getImageData(j,j,this._config.deviceCellWidth,this._config.deviceCellHeight),R,W,H),!!z);M++);}if(w){let z=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),M=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=z,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(j,j+Math.floor(this._config.deviceCharHeight/2)-M),this._tmpCtx.lineTo(j+this._config.deviceCharWidth*Z,j+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),P;if(this._config.allowTransparency?P=BE(ee):P=Od(ee,R,W,H),P)return pv;let V=this._findGlyphBoundingBox(ee,this._workBoundingBox,u,B,F,j),K,O;for(;;){if(this._activePages.length===0){let z=this._createNewPage();K=z,O=z.currentRow,O.height=V.size.y;break}K=this._activePages[this._activePages.length-1],O=K.currentRow;for(let z of this._activePages)V.size.y<=z.currentRow.height&&(K=z,O=z.currentRow);for(let z=this._activePages.length-1;z>=0;z--)for(let M of this._activePages[z].fixedRows)M.height<=O.height&&V.size.y<=M.height&&(K=this._activePages[z],O=M);if(V.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new Dd(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+V.size.x>=K.canvas.width&&(O.x=0,O.y+=O.height,O.height=0);break}if(O.y+V.size.y>=K.canvas.height||O.height>V.size.y+2){let z=!1;if(K.currentRow.y+K.currentRow.height+V.size.y>=K.canvas.height){let M;for(let U of this._activePages)if(U.currentRow.y+U.currentRow.height+V.size.y<U.canvas.height){M=U;break}if(M)K=M;else if(Aa.maxAtlasPages&&this._pages.length>=Aa.maxAtlasPages&&O.y+V.size.y<=K.canvas.height&&O.height>=V.size.y&&O.x+V.size.x<=K.canvas.width)z=!0;else{let U=this._createNewPage();K=U,O=U.currentRow,O.height=V.size.y,z=!0}}z||(K.currentRow.height>0&&K.fixedRows.push(K.currentRow),O={x:0,y:K.currentRow.y+K.currentRow.height,height:V.size.y},K.fixedRows.push(O),K.currentRow={x:0,y:O.y+O.height,height:0})}if(O.x+V.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 V.texturePage=this._pages.indexOf(K),V.texturePosition.x=O.x,V.texturePosition.y=O.y,V.texturePositionClipSpace.x=O.x/K.canvas.width,V.texturePositionClipSpace.y=O.y/K.canvas.height,V.sizeClipSpace.x/=K.canvas.width,V.sizeClipSpace.y/=K.canvas.height,O.height=Math.max(O.height,V.size.y),O.x+=V.size.x,K.ctx.putImageData(ee,V.texturePosition.x-this._workBoundingBox.left,V.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,V.size.x,V.size.y),K.addGlyph(V),K.version++,V}_findGlyphBoundingBox(n,s,o,l,y,S){s.top=0;let c=l?this._config.deviceCellHeight:this._tmpCanvas.height,u=l?this._config.deviceCellWidth:o,h=!1;for(let g=0;g<c;g++){for(let f=0;f<u;f++){let C=g*this._tmpCanvas.width*4+f*4+3;if(n.data[C]!==0){s.top=g,h=!0;break}}if(h)break}s.left=0,h=!1;for(let g=0;g<S+u;g++){for(let f=0;f<c;f++){let C=f*this._tmpCanvas.width*4+g*4+3;if(n.data[C]!==0){s.left=g,h=!0;break}}if(h)break}s.right=u,h=!1;for(let g=S+u-1;g>=S;g--){for(let f=0;f<c;f++){let C=f*this._tmpCanvas.width*4+g*4+3;if(n.data[C]!==0){s.right=g,h=!0;break}}if(h)break}s.bottom=c,h=!1;for(let g=c-1;g>=0;g--){for(let f=0;f<u;f++){let C=g*this._tmpCanvas.width*4+f*4+3;if(n.data[C]!==0){s.bottom=g,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+S+(l||y?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-s.top+S+(l||y?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},Dd=class{constructor(t,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=H1(t,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(t){this._glyphs.push(t),this._usedPixels+=t.size.x*t.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 Od(t,n,s,o){let l=n.rgba>>>24,y=n.rgba>>>16&255,S=n.rgba>>>8&255,c=s.rgba>>>24,u=s.rgba>>>16&255,h=s.rgba>>>8&255,g=Math.floor((Math.abs(l-c)+Math.abs(y-u)+Math.abs(S-h))/12),f=!0;for(let C=0;C<t.data.length;C+=4)t.data[C]===l&&t.data[C+1]===y&&t.data[C+2]===S||o&&Math.abs(t.data[C]-l)+Math.abs(t.data[C+1]-y)+Math.abs(t.data[C+2]-S)<g?t.data[C+3]=0:f=!1;return f}function BE(t){for(let n=0;n<t.data.length;n+=4)if(t.data[n+3]>0)return!1;return!0}function H1(t,n,s){let o=t.createElement("canvas");return o.width=n,o.height=s,o}function NE(t,n,s,o,l,y,S,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:S,deviceMaxTextureSize:c,letterSpacing:l.letterSpacing,lineHeight:l.lineHeight,deviceCellWidth:t,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 _v(t,n){for(let s=0;s<t.colors.ansi.length;s++)if(t.colors.ansi[s].rgba!==n.colors.ansi[s].rgba)return!1;return t.devicePixelRatio===n.devicePixelRatio&&t.customGlyphs===n.customGlyphs&&t.lineHeight===n.lineHeight&&t.letterSpacing===n.letterSpacing&&t.fontFamily===n.fontFamily&&t.fontSize===n.fontSize&&t.fontWeight===n.fontWeight&&t.fontWeightBold===n.fontWeightBold&&t.allowTransparency===n.allowTransparency&&t.deviceCharWidth===n.deviceCharWidth&&t.deviceCharHeight===n.deviceCharHeight&&t.drawBoldTextInBrightColors===n.drawBoldTextInBrightColors&&t.minimumContrastRatio===n.minimumContrastRatio&&t.colors.foreground.rgba===n.colors.foreground.rgba&&t.colors.background.rgba===n.colors.background.rgba}function IE(t){return(t&50331648)===16777216||(t&50331648)===33554432}var En=[];function z1(t,n,s,o,l,y,S,c,u){let h=NE(o,l,y,S,n,s,c,u);for(let C=0;C<En.length;C++){let E=En[C],T=E.ownedBy.indexOf(t);if(T>=0){if(_v(E.config,h))return E.atlas;E.ownedBy.length===1?(E.atlas.dispose(),En.splice(C,1)):E.ownedBy.splice(T,1);break}}for(let C=0;C<En.length;C++){let E=En[C];if(_v(E.config,h))return E.ownedBy.push(t),E.atlas}let g=t._core,f={atlas:new as(document,h,g.unicodeService),config:h,ownedBy:[t]};return En.push(f),f.atlas}function gv(t){for(let n=0;n<En.length;n++){let s=En[n].ownedBy.indexOf(t);if(s!==-1){En[n].ownedBy.length===1?(En[n].atlas.dispose(),En.splice(n,1)):En[n].ownedBy.splice(s,1);break}}}var Tc=600,HE=class{constructor(t,n){this._renderCallback=t,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(t=Tc){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let n=Tc-(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=Tc-(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})},Tc)},t)}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 mv(t,n,s){let o=new n.ResizeObserver(l=>{let y=l.find(u=>u.target===t);if(!y)return;if(!("devicePixelContentBoxSize"in y)){o?.disconnect(),o=void 0;return}let S=y.devicePixelContentBoxSize[0].inlineSize,c=y.devicePixelContentBoxSize[0].blockSize;S>0&&c>0&&s(S,c)});try{o.observe(t,{box:["device-pixel-content-box"]})}catch{o.disconnect(),o=void 0}return ki(()=>o?.disconnect())}function zE(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}var vv=class $1 extends La{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new M1,this.combinedData=""}static fromCharData(n){let s=new $1;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?zE(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()]}},U1=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function j1(t,n,s){let o=li(t.createProgram());if(t.attachShader(o,li(bv(t,t.VERTEX_SHADER,n))),t.attachShader(o,li(bv(t,t.FRAGMENT_SHADER,s))),t.linkProgram(o),t.getProgramParameter(o,t.LINK_STATUS))return o;console.error(t.getProgramInfoLog(o)),t.deleteProgram(o)}function bv(t,n,s){let o=li(t.createShader(n));if(t.shaderSource(o,s),t.compileShader(o),t.getShaderParameter(o,t.COMPILE_STATUS))return o;console.error(t.getShaderInfoLog(o)),t.deleteShader(o)}function $E(t,n){let s=Math.min(t.length*2,n),o=new Float32Array(s);for(let l=0;l<t.length;l++)o[l]=t[l];return o}var UE=class{constructor(t){this.texture=t,this.version=-1}},jE=`#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 PE(t){let n="";for(let s=1;s<t;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[${t}];
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,Ea=os*Float32Array.BYTES_PER_ELEMENT,FE=2,Ft=0,kt,Bd=0,jo=0,qE=class extends $n{constructor(t,n,s,o){super(),this._terminal=t,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(j1(l,jE,PE(as.maxAtlasPages))),this._register(ki(()=>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]),S=l.createBuffer();this._register(ki(()=>l.deleteBuffer(S))),l.bindBuffer(l.ARRAY_BUFFER,S),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(ki(()=>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(ki(()=>l.deleteBuffer(this._attributesBuffer))),l.bindBuffer(l.ARRAY_BUFFER,this._attributesBuffer),l.enableVertexAttribArray(2),l.vertexAttribPointer(2,2,l.FLOAT,!1,Ea,0),l.vertexAttribDivisor(2,1),l.enableVertexAttribArray(3),l.vertexAttribPointer(3,2,l.FLOAT,!1,Ea,2*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(3,1),l.enableVertexAttribArray(4),l.vertexAttribPointer(4,1,l.FLOAT,!1,Ea,4*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(4,1),l.enableVertexAttribArray(5),l.vertexAttribPointer(5,2,l.FLOAT,!1,Ea,5*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(5,1),l.enableVertexAttribArray(6),l.vertexAttribPointer(6,2,l.FLOAT,!1,Ea,7*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(6,1),l.enableVertexAttribArray(1),l.vertexAttribPointer(1,2,l.FLOAT,!1,Ea,9*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(1,1),l.useProgram(this._program);let h=new Int32Array(as.maxAtlasPages);for(let g=0;g<as.maxAtlasPages;g++)h[g]=g;l.uniform1iv(this._textureLocation,h),l.uniformMatrix4fv(this._projectionLocation,!1,U1),this._atlasTextures=[];for(let g=0;g<as.maxAtlasPages;g++){let f=new UE(li(l.createTexture()));this._register(ki(()=>l.deleteTexture(f.texture))),l.activeTexture(l.TEXTURE0+g),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[g]=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(t,n,s,o,l,y,S,c,u){this._updateCell(this._vertices.attributes,t,n,s,o,l,y,S,c,u)}_updateCell(t,n,s,o,l,y,S,c,u,h){if(Ft=(s*this._terminal.cols+n)*os,o===0||o===void 0){t.fill(0,Ft,Ft+os-1-FE);return}this._atlas&&(c&&c.length>1?kt=this._atlas.getRasterizedGlyphCombinedChar(c,l,y,S,!1,this._terminal.element):kt=this._atlas.getRasterizedGlyph(o,l,y,S,!1,this._terminal.element),Bd=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),l!==h&&kt.offset.x>Bd?(jo=kt.offset.x-Bd,t[Ft]=-(kt.offset.x-jo)+this._dimensions.device.char.left,t[Ft+1]=-kt.offset.y+this._dimensions.device.char.top,t[Ft+2]=(kt.size.x-jo)/this._dimensions.device.canvas.width,t[Ft+3]=kt.size.y/this._dimensions.device.canvas.height,t[Ft+4]=kt.texturePage,t[Ft+5]=kt.texturePositionClipSpace.x+jo/this._atlas.pages[kt.texturePage].canvas.width,t[Ft+6]=kt.texturePositionClipSpace.y,t[Ft+7]=kt.sizeClipSpace.x-jo/this._atlas.pages[kt.texturePage].canvas.width,t[Ft+8]=kt.sizeClipSpace.y):(t[Ft]=-kt.offset.x+this._dimensions.device.char.left,t[Ft+1]=-kt.offset.y+this._dimensions.device.char.top,t[Ft+2]=kt.size.x/this._dimensions.device.canvas.width,t[Ft+3]=kt.size.y/this._dimensions.device.canvas.height,t[Ft+4]=kt.texturePage,t[Ft+5]=kt.texturePositionClipSpace.x,t[Ft+6]=kt.texturePositionClipSpace.y,t[Ft+7]=kt.sizeClipSpace.x,t[Ft+8]=kt.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&aE(o,u,kt.size.x,this._dimensions.device.cell.width)&&(t[Ft+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let t=this._terminal,n=t.cols*t.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<t.rows;o++)for(let l=0;l<t.cols;l++)this._vertices.attributes[s+9]=l/t.cols,this._vertices.attributes[s+10]=o/t.rows,s+=os}handleResize(){let t=this._gl;t.useProgram(this._program),t.viewport(0,0,t.canvas.width,t.canvas.height),t.uniform2f(this._resolutionLocation,t.canvas.width,t.canvas.height),this.clear()}render(t){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<t.lineLengths.length;l++){let y=l*this._terminal.cols*os,S=this._vertices.attributes.subarray(y,y+t.lineLengths[l]*os);s.set(S,o),o+=S.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(t){this._atlas=t;for(let n of this._atlasTextures)n.version=-1}_bindAtlasPageTexture(t,n,s){t.activeTexture(t.TEXTURE0+s),t.bindTexture(t.TEXTURE_2D,this._atlasTextures[s].texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n.pages[s].canvas),t.generateMipmap(t.TEXTURE_2D),this._atlasTextures[s].version=n.pages[s].version}setDimensions(t){this._dimensions=t}},WE=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(t,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=t.buffers.active.ydisp,y=n[1]-l,S=s[1]-l,c=Math.max(y,0),u=Math.min(S,t.rows-1);if(c>=t.rows||u<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=o,this.viewportStartRow=y,this.viewportEndRow=S,this.viewportCappedStartRow=c,this.viewportCappedEndRow=u,this.startCol=n[0],this.endCol=s[0]}isCellSelected(t,n,s){return this.hasSelection?(s-=t.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 GE(){return new WE}var Xc=4,$c=1,Uc=2,Nd=3,KE=2147483648,VE=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=GE()}resize(t,n){let s=t*n*Xc;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)}},YE=`#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
- }`,XE=`#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,Id=Ar*Float32Array.BYTES_PER_ELEMENT,ZE=20*Ar,Sv=class{constructor(){this.attributes=new Float32Array(ZE),this.count=0}},Er=0,yv=0,Cv=0,wv=0,Ev=0,xv=0,Tv=0,QE=class extends $n{constructor(t,n,s,o){super(),this._terminal=t,this._gl=n,this._dimensions=s,this._themeService=o,this._vertices=new Sv,this._verticesCursor=new Sv;let l=this._gl;this._program=li(j1(l,YE,XE)),this._register(ki(()=>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]),S=l.createBuffer();this._register(ki(()=>l.deleteBuffer(S))),l.bindBuffer(l.ARRAY_BUFFER,S),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(ki(()=>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(ki(()=>l.deleteBuffer(this._attributesBuffer))),l.bindBuffer(l.ARRAY_BUFFER,this._attributesBuffer),l.enableVertexAttribArray(0),l.vertexAttribPointer(0,2,l.FLOAT,!1,Id,0),l.vertexAttribDivisor(0,1),l.enableVertexAttribArray(1),l.vertexAttribPointer(1,2,l.FLOAT,!1,Id,2*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(1,1),l.enableVertexAttribArray(2),l.vertexAttribPointer(2,4,l.FLOAT,!1,Id,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(t){let n=this._gl;n.useProgram(this._program),n.bindVertexArray(this._vertexArrayObject),n.uniformMatrix4fv(this._projectionLocation,!1,U1),n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,t.attributes,n.DYNAMIC_DRAW),n.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,n.UNSIGNED_BYTE,0,t.count)}handleResize(){this._updateViewportRectangle()}setDimensions(t){this._dimensions=t}_updateCachedColors(t){this._bgFloat=this._colorToFloat32Array(t.background),this._cursorFloat=this._colorToFloat32Array(t.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(t){let n=this._terminal,s=this._vertices,o=1,l,y,S,c,u,h,g,f,C,E,T;for(l=0;l<n.rows;l++){for(S=-1,c=0,u=0,h=!1,y=0;y<n.cols;y++)g=(l*n.cols+y)*Xc,f=t.cells[g+$c],C=t.cells[g+Uc],E=!!(C&67108864),(f!==c||C!==u&&(h||E))&&((c!==0||h&&u!==0)&&(T=o++*Ar,this._updateRectangle(s,T,u,c,S,y,l)),S=y,c=f,u=C,h=E);(c!==0||h&&u!==0)&&(T=o++*Ar,this._updateRectangle(s,T,u,c,S,n.cols,l))}s.count=o}updateCursor(t){let n=this._verticesCursor,s=t.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(t,n,s,o,l,y,S){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}t.attributes.length<n+4&&(t.attributes=$E(t.attributes,this._terminal.rows*this._terminal.cols*Ar)),yv=l*this._dimensions.device.cell.width,Cv=S*this._dimensions.device.cell.height,wv=(Er>>24&255)/255,Ev=(Er>>16&255)/255,xv=(Er>>8&255)/255,Tv=1,this._addRectangle(t.attributes,n,yv,Cv,(y-l)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,wv,Ev,xv,Tv)}_addRectangle(t,n,s,o,l,y,S,c,u,h){t[n]=s/this._dimensions.device.canvas.width,t[n+1]=o/this._dimensions.device.canvas.height,t[n+2]=l/this._dimensions.device.canvas.width,t[n+3]=y/this._dimensions.device.canvas.height,t[n+4]=S,t[n+5]=c,t[n+6]=u,t[n+7]=h}_addRectangleFloat(t,n,s,o,l,y,S){t[n]=s/this._dimensions.device.canvas.width,t[n+1]=o/this._dimensions.device.canvas.height,t[n+2]=l/this._dimensions.device.canvas.width,t[n+3]=y/this._dimensions.device.canvas.height,t[n+4]=S[0],t[n+5]=S[1],t[n+6]=S[2],t[n+7]=S[3]}_colorToFloat32Array(t){return new Float32Array([(t.rgba>>24&255)/255,(t.rgba>>16&255)/255,(t.rgba>>8&255)/255,(t.rgba&255)/255])}},JE=class extends $n{constructor(t,n,s,o,l,y,S,c){super(),this._container=n,this._alpha=l,this._coreBrowserService=y,this._optionsService=S,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(t,u),this.reset(t)})),this._register(ki(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=li(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(t){}handleFocus(t){}handleCursorMove(t){}handleGridChanged(t,n,s){}handleSelectionChanged(t,n,s,o=!1){}_setTransparency(t,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(t,this._themeService.colors),this.handleGridChanged(t,0,t.rows-1)}_refreshCharAtlas(t,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=z1(t,this._optionsService.rawOptions,n,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(t,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(t,this._themeService.colors)}_fillBottomLineAtCells(t,n,s=1){this._ctx.fillRect(t*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(t,n,s,o){this._alpha?this._ctx.clearRect(t*this._deviceCellWidth,n*this._deviceCellHeight,s*this._deviceCellWidth,o*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(t*this._deviceCellWidth,n*this._deviceCellHeight,s*this._deviceCellWidth,o*this._deviceCellHeight))}_fillCharTrueColor(t,n,s,o){this._ctx.font=this._getFont(t,!1,!1),this._ctx.textBaseline=T1,this._clipCell(s,o,n.getWidth()),this._ctx.fillText(n.getChars(),s*this._deviceCellWidth+this._deviceCharLeft,o*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(t,n,s){this._ctx.beginPath(),this._ctx.rect(t*this._deviceCellWidth,n*this._deviceCellHeight,s*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(t,n,s){let o=n?t.options.fontWeightBold:t.options.fontWeight;return`${s?"italic":""} ${o} ${t.options.fontSize*this._coreBrowserService.dpr}px ${t.options.fontFamily}`}},e5=class extends JE{constructor(t,n,s,o,l,y,S){super(s,t,"link",n,!0,l,y,S),this._register(o.onShowLinkUnderline(c=>this._handleShowLinkUnderline(c))),this._register(o.onHideLinkUnderline(c=>this._handleHideLinkUnderline(c)))}resize(t,n){super.resize(t,n),this._state=void 0}reset(t){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let t=this._state.y2-this._state.y1-1;t>0&&this._clearCells(0,this._state.y1+1,this._state.cols,t),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(t){if(t.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:t.fg!==void 0&&IE(t.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[t.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,t.y1===t.y2)this._fillBottomLineAtCells(t.x1,t.y1,t.x2-t.x1);else{this._fillBottomLineAtCells(t.x1,t.y1,t.cols-t.x1);for(let n=t.y1+1;n<t.y2;n++)this._fillBottomLineAtCells(0,n,t.cols);this._fillBottomLineAtCells(0,t.y2,t.x2)}this._state=t}_handleHideLinkUnderline(t){this._clearCurrentLink()}},Ds=typeof window=="object"?window:globalThis,ff=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Lt,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Lt,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}};ff.INSTANCE=new ff;var P1=ff;function t5(t,n,s){typeof n=="string"&&(n=t.matchMedia(n)),n.addEventListener("change",s)}P1.INSTANCE.onDidChangeZoomLevel;P1.INSTANCE.onDidChangeFullscreen;var Ua=typeof navigator=="object"?navigator.userAgent:"";Ua.indexOf("Firefox")>=0;Ua.indexOf("AppleWebKit")>=0;var i5=Ua.indexOf("Chrome")>=0;!i5&&Ua.indexOf("Safari")>=0;Ua.indexOf("Electron/")>=0;Ua.indexOf("Android")>=0;var Hd=!1;if(typeof Ds.matchMedia=="function"){let t=Ds.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),n=Ds.matchMedia("(display-mode: fullscreen)");Hd=t.matches,t5(Ds,t,({matches:s})=>{Hd&&n.matches||(Hd=s)})}var Ma="en",zd=!1,F1=!1,Ac,jc=Ma,Av=Ma,n5,xr,Bs=globalThis,ln;typeof Bs.vscode<"u"&&typeof Bs.vscode.process<"u"?ln=Bs.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(ln=process);var r5=typeof ln?.versions?.electron=="string",s5=r5&&ln?.type==="renderer";if(typeof ln=="object"){ln.platform,ln.platform,zd=ln.platform==="linux",zd&&ln.env.SNAP&&ln.env.SNAP_REVISION,ln.env.CI||ln.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Ac=Ma,jc=Ma;let t=ln.env.VSCODE_NLS_CONFIG;if(t)try{let n=JSON.parse(t);Ac=n.userLocale,Av=n.osLocale,jc=n.resolvedLanguage||Ma,n5=n.languagePack?.translationsConfigFile}catch{}F1=!0}else typeof navigator=="object"&&!s5?(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,zd=xr.indexOf("Linux")>=0,xr?.indexOf("Mobi")>=0,jc=globalThis._VSCODE_NLS_LANGUAGE||Ma,Ac=navigator.language.toLowerCase(),Av=Ac):console.error("Unable to resolve platform.");var Rv=F1,Yn=xr,ns=jc,a5;(t=>{function n(){return ns}t.value=n;function s(){return ns.length===2?ns==="en":ns.length>=3?ns[0]==="e"&&ns[1]==="n"&&ns[2]==="-":!1}t.isDefaultVariant=s;function o(){return ns==="en"}t.isDefault=o})(a5||={});var o5=typeof Bs.postMessage=="function"&&!Bs.importScripts;(()=>{if(o5){let t=[];Bs.addEventListener("message",s=>{if(s.data&&s.data.vscodeScheduleAsyncWork)for(let o=0,l=t.length;o<l;o++){let y=t[o];if(y.id===s.data.vscodeScheduleAsyncWork){t.splice(o,1),y.callback();return}}});let n=0;return s=>{let o=++n;t.push({id:o,callback:s}),Bs.postMessage({vscodeScheduleAsyncWork:o},"*")}}return t=>setTimeout(t)})();var l5=!!(Yn&&Yn.indexOf("Chrome")>=0);Yn&&Yn.indexOf("Firefox")>=0;!l5&&Yn&&Yn.indexOf("Safari")>=0;Yn&&Yn.indexOf("Edg/")>=0;Yn&&Yn.indexOf("Android")>=0;var xa=typeof navigator=="object"?navigator:{};Rv||document.queryCommandSupported&&document.queryCommandSupported("copy")||xa&&xa.clipboard&&xa.clipboard.writeText,Rv||xa&&xa.clipboard&&xa.clipboard.readText;var qf=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(t,n){this._keyCodeToStr[t]=n,this._strToKeyCode[n.toLowerCase()]=t}keyCodeToStr(t){return this._keyCodeToStr[t]}strToKeyCode(t){return this._strToKeyCode[t.toLowerCase()]||0}},$d=new qf,kv=new qf,Lv=new qf;new Array(230);var c5;(t=>{function n(c){return $d.keyCodeToStr(c)}t.toString=n;function s(c){return $d.strToKeyCode(c)}t.fromString=s;function o(c){return kv.keyCodeToStr(c)}t.toUserSettingsUS=o;function l(c){return Lv.keyCodeToStr(c)}t.toUserSettingsGeneral=l;function y(c){return kv.strToKeyCode(c)||Lv.strToKeyCode(c)}t.fromUserSettings=y;function S(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 $d.keyCodeToStr(c)}t.toElectronAccelerator=S})(c5||={});var q1=Object.freeze(function(t,n){let s=setTimeout(t.bind(n),0);return{dispose(){clearTimeout(s)}}}),u5;(t=>{function n(s){return s===t.None||s===t.Cancelled||s instanceof h5?!0:!s||typeof s!="object"?!1:typeof s.isCancellationRequested=="boolean"&&typeof s.onCancellationRequested=="function"}t.isCancellationToken=n,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Rr.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:q1})})(u5||={});var h5=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?q1:(this._emitter||(this._emitter=new Lt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},d5;(t=>{async function n(o){let l,y=await Promise.all(o.map(S=>S.then(c=>c,c=>{l||(l=c)})));if(typeof l<"u")throw l;return y}t.settled=n;function s(o){return new Promise(async(l,y)=>{try{await o(l,y)}catch(S){y(S)}})}t.withAsyncBody=s})(d5||={});var Mv=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 Lt,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())}};Mv.EMPTY=Mv.fromArray([]);var{getWindow:f5}=(function(){let t=new Map,n={window:Ds,disposables:new Ba};t.set(Ds.vscodeWindowId,n);let s=new Lt,o=new Lt,l=new Lt;function y(S,c){return(typeof S=="number"?t.get(S):void 0)??(c?n:void 0)}return{onDidRegisterWindow:s.event,onWillUnregisterWindow:l.event,onDidUnregisterWindow:o.event,registerWindow(S){if(t.has(S.vscodeWindowId))return $n.None;let c=new Ba,u={window:S,disposables:c.add(new Ba)};return t.set(S.vscodeWindowId,u),c.add(ki(()=>{t.delete(S.vscodeWindowId),o.fire(S)})),c.add(pf(S,_5.BEFORE_UNLOAD,()=>{l.fire(S)})),s.fire(u),c},getWindows(){return t.values()},getWindowsCount(){return t.size},getWindowId(S){return S.vscodeWindowId},hasWindow(S){return t.has(S)},getWindowById:y,getWindow(S){let c=S;if(c?.ownerDocument?.defaultView)return c.ownerDocument.defaultView.window;let u=S;return u?.view?u.view.window:Ds},getDocument(S){return f5(S).document}}})(),p5=class{constructor(t,n,s,o){this._node=t,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 pf(t,n,s,o){return new p5(t,n,s,o)}var _5={BEFORE_UNLOAD:"beforeunload"},g5=class extends $n{constructor(t,n,s,o,l,y,S,c,u){super(),this._terminal=t,this._characterJoinerService=n,this._charSizeService=s,this._coreBrowserService=o,this._coreService=l,this._decorationService=y,this._optionsService=S,this._themeService=c,this._cursorBlinkStateManager=new zo,this._charAtlasDisposable=this._register(new zo),this._observerDisposable=this._register(new zo),this._model=new VE,this._workCell=new vv,this._workCell2=new vv,this._rectangleRenderer=this._register(new zo),this._glyphRenderer=this._register(new zo),this._onChangeTextureAtlas=this._register(new Lt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Lt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Lt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Lt),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Lt),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 cE(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new e5(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,S,this._themeService)],this.dimensions=oE(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(S.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(pf(this._canvas,"webglcontextlost",g=>{console.log("webglcontextlost event received"),g.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(g)},3e3)})),this._register(pf(this._canvas,"webglcontextrestored",g=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,gv(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=mv(this._canvas,this._coreBrowserService.window,(g,f)=>this._setCanvasDevicePixelDimensions(g,f)),this._register(this._coreBrowserService.onWindowChange(g=>{this._observerDisposable.value=mv(this._canvas,g,(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(ki(()=>{for(let g of this._renderLayers)g.dispose();this._canvas.parentElement?.removeChild(this._canvas),gv(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(t,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 t of this._renderLayers)t.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let t of this._renderLayers)t.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(t,n,s){for(let o of this._renderLayers)o.handleSelectionChanged(this._terminal,t,n,s);this._model.selection.update(this._core,t,n,s),this._requestRedrawViewport()}handleCursorMove(){for(let t of this._renderLayers)t.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new QE(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new qE(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 t=z1(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!==t&&(this._onChangeTextureAtlas.fire(t.pages[0].canvas),this._charAtlasDisposable.value=y1(Rr.forward(t.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Rr.forward(t.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=t,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(t){this._model.clear(),t&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let t of this._renderLayers)t.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(t,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,t,n);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(t,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 HE(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(t,n){let s=this._core,o=this._workCell,l,y,S,c,u,h,g=0,f=!0,C,E,T,w,p,b,_,m,x;t=Dv(t,s.rows-1,0),n=Dv(n,s.rows-1,0);let R=this._coreService.decPrivateModes.cursorStyle??s.options.cursorStyle??"block",k=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,D=k-s.buffer.ydisp,A=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 j=!1;for(y=t;y<=n;y++)for(S=y+s.buffer.ydisp,c=s.buffer.lines.get(S),this._model.lineLengths[y]=0,T=k===S,g=0,u=this._characterJoinerService.getJoinedCharacters(S),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>=g,C=m,u.length>0&&m===u[0][0]&&f){E=u.shift();let F=this._model.selection.isCellSelected(this._terminal,E[0],S);for(_=E[0]+1;_<E[1];_++)f&&=F===this._model.selection.isCellSelected(this._terminal,_,S);f&&=!T||A<E[0]||A>=E[1],f?(h=!0,o=new m5(o,c.translateToString(!0,E[0],E[1]),E[1]-E[0]),C=E[1]-1):g=E[1]}if(w=o.getChars(),p=o.getCode(),_=(y*s.cols+m)*Xc,this._cellColorResolver.resolve(o,m,S,this.dimensions.device.cell.width),W&&S===k&&(m===A&&(this._model.cursor={x:A,y:D,width:o.getWidth(),style:this._coreBrowserService.isFocused?R:s.options.cursorInactiveStyle,cursorWidth:s.options.cursorWidth,dpr:this._devicePixelRatio},B=A+o.getWidth()-1),m>=A&&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)),p!==0&&(this._model.lineLengths[y]=m+1),!(this._model.cells[_]===p&&this._model.cells[_+$c]===this._cellColorResolver.result.bg&&this._model.cells[_+Uc]===this._cellColorResolver.result.fg&&this._model.cells[_+Nd]===this._cellColorResolver.result.ext)&&(j=!0,w.length>1&&(p|=KE),this._model.cells[_]=p,this._model.cells[_+$c]=this._cellColorResolver.result.bg,this._model.cells[_+Uc]=this._cellColorResolver.result.fg,this._model.cells[_+Nd]=this._cellColorResolver.result.ext,b=o.getWidth(),this._glyphRenderer.value.updateCell(m,y,p,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,w,b,l),h)){for(o=this._workCell,m++;m<=C;m++)x=(y*s.cols+m)*Xc,this._glyphRenderer.value.updateCell(m,y,0,0,0,0,eE,0,0),this._model.cells[x]=0,this._model.cells[x+$c]=this._cellColorResolver.result.bg,this._model.cells[x+Uc]=this._cellColorResolver.result.fg,this._model.cells[x+Nd]=this._cellColorResolver.result.ext;m--}}j&&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(t,n){this._canvas.width===t&&this._canvas.height===n||(this._canvas.width=t,this._canvas.height=n,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let t=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:t,end:t})}},m5=class extends La{constructor(t,n,s){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=n,this._width=s}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function Dv(t,n,s=0){return Math.max(Math.min(t,n),s)}var Ov="di$target",Bv="di$dependencies",Ud=new Map;function Qn(t){if(Ud.has(t))return Ud.get(t);let n=function(s,o,l){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");v5(n,s,l)};return n._id=t,Ud.set(t,n),n}function v5(t,n,s){n[Ov]===n?n[Bv].push({id:t,index:s}):(n[Bv]=[{id:t,index:s}],n[Ov]=n)}Qn("BufferService");Qn("CoreMouseService");Qn("CoreService");Qn("CharsetService");Qn("InstantiationService");Qn("LogService");var b5=Qn("OptionsService");Qn("OscLinkService");Qn("UnicodeService");Qn("DecorationService");var S5={trace:0,debug:1,info:2,warn:3,error:4,off:5},y5="xterm.js: ",Nv=class extends $n{constructor(t){super(),this._optionsService=t,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=S5[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let n=0;n<t.length;n++)typeof t[n]=="function"&&(t[n]=t[n]())}_log(t,n,s){this._evalLazyOptionalParams(s),t.call(console,(this._optionsService.options.logger?"":y5)+n,...s)}trace(t,...n){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,t,n)}debug(t,...n){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,t,n)}info(t,...n){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,t,n)}warn(t,...n){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,t,n)}error(t,...n){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,t,n)}};Nv=P2([F2(0,b5)],Nv);var C5=class extends $n{constructor(t){if(E1&&J2()<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=t,this._onChangeTextureAtlas=this._register(new Lt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Lt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Lt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Lt),this.onContextLoss=this._onContextLoss.event}activate(t){let n=t._core;if(!t.element){this._register(n.onWillOpen(()=>this.activate(t)));return}this._terminal=t;let s=n.coreService,o=n.optionsService,l=n,y=l._renderService,S=l._characterJoinerService,c=l._charSizeService,u=l._coreBrowserService,h=l._decorationService;l._logService;let g=l._themeService;this._renderer=this._register(new g5(t,S,c,u,s,h,o,g,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(ki(()=>{if(this._terminal._core._store._isDisposed)return;let f=this._terminal._core._renderService;f.setRenderer(this._terminal._core._createRenderer()),f.handleResize(t.cols,t.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},jd={exports:{}},Iv;function w5(){return Iv||(Iv=1,(function(t,n){(function(s,o){t.exports=o()})(globalThis,(()=>(()=>{var s={4567:function(S,c,u){var h=this&&this.__decorate||function(_,m,x,R){var k,D=arguments.length,A=D<3?m:R===null?R=Object.getOwnPropertyDescriptor(m,x):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(_,m,x,R);else for(var B=_.length-1;B>=0;B--)(k=_[B])&&(A=(D<3?k(A):D>3?k(m,x,A):k(m,x))||A);return D>3&&A&&Object.defineProperty(m,x,A),A},g=this&&this.__param||function(_,m){return function(x,R){m(x,R,_)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const f=u(9042),C=u(9924),E=u(844),T=u(4725),w=u(2585),p=u(3656);let b=c.AccessibilityManager=class extends E.Disposable{constructor(_,m,x,R){super(),this._terminal=_,this._coreBrowserService=x,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 k=0;k<this._terminal.rows;k++)this._rowElements[k]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[k]);if(this._topBoundaryFocusListener=k=>this._handleBoundaryFocus(k,0),this._bottomBoundaryFocusListener=k=>this._handleBoundaryFocus(k,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((k=>this._handleResize(k.rows)))),this.register(this._terminal.onRender((k=>this._refreshRows(k.start,k.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((k=>this._handleChar(k)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
75
- `)))),this.register(this._terminal.onA11yTab((k=>this._handleTab(k)))),this.register(this._terminal.onKey((k=>this._handleKey(k.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,p.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,E.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(_){for(let m=0;m<_;m++)this._handleChar(" ")}_handleChar(_){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==_&&(this._charsToAnnounce+=_):this._charsToAnnounce+=_,_===`
76
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(_){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(_)||this._charsToConsume.push(_)}_refreshRows(_,m){this._liveRegionDebouncer.refresh(_,m,this._terminal.rows)}_renderRows(_,m){const x=this._terminal.buffer,R=x.lines.length.toString();for(let k=_;k<=m;k++){const D=x.lines.get(x.ydisp+k),A=[],B=D?.translateToString(!0,void 0,void 0,A)||"",W=(x.ydisp+k+1).toString(),j=this._rowElements[k];j&&(B.length===0?(j.innerText=" ",this._rowColumns.set(j,[0,1])):(j.textContent=B,this._rowColumns.set(j,A)),j.setAttribute("aria-posinset",W),j.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(_,m){const x=_.target,R=this._rowElements[m===0?1:this._rowElements.length-2];if(x.getAttribute("aria-posinset")===(m===0?"1":`${this._terminal.buffer.lines.length}`)||_.relatedTarget!==R)return;let k,D;if(m===0?(k=x,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(k=this._rowElements.shift(),D=x,this._rowContainer.removeChild(k)),k.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),m===0){const A=this._createAccessibilityTreeNode();this._rowElements.unshift(A),this._rowContainer.insertAdjacentElement("afterbegin",A)}else{const A=this._createAccessibilityTreeNode();this._rowElements.push(A),this._rowContainer.appendChild(A)}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(),_.preventDefault(),_.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const _=document.getSelection();if(!_)return;if(_.isCollapsed)return void(this._rowContainer.contains(_.anchorNode)&&this._terminal.clearSelection());if(!_.anchorNode||!_.focusNode)return void console.error("anchorNode and/or focusNode are null");let m={node:_.anchorNode,offset:_.anchorOffset},x={node:_.focusNode,offset:_.focusOffset};if((m.node.compareDocumentPosition(x.node)&Node.DOCUMENT_POSITION_PRECEDING||m.node===x.node&&m.offset>x.offset)&&([m,x]=[x,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(x.node.compareDocumentPosition(R)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(x={node:R,offset:R.textContent?.length??0}),!this._rowContainer.contains(x.node))return;const k=({node:B,offset:W})=>{const j=B instanceof Text?B.parentNode:B;let F=parseInt(j?.getAttribute("aria-posinset"),10)-1;if(isNaN(F))return console.warn("row is invalid. Race condition?"),null;const H=this._rowColumns.get(j);if(!H)return console.warn("columns is null. Race condition?"),null;let Z=W<H.length?H[W]:H.slice(-1)[0]+1;return Z>=this._terminal.cols&&(++F,Z=0),{row:F,column:Z}},D=k(m),A=k(x);if(D&&A){if(D.row>A.row||D.row===A.row&&D.column>=A.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(A.row-D.row)*this._terminal.cols-D.column+A.column)}}_handleResize(_){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>_;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const _=this._coreBrowserService.mainDocument.createElement("div");return _.setAttribute("role","listitem"),_.tabIndex=-1,this._refreshRowDimensions(_),_}_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 _=0;_<this._terminal.rows;_++)this._refreshRowDimensions(this._rowElements[_])}}_refreshRowDimensions(_){_.style.height=`${this._renderService.dimensions.css.cell.height}px`}};c.AccessibilityManager=b=h([g(1,w.IInstantiationService),g(2,T.ICoreBrowserService),g(3,T.IRenderService)],b)},3614:(S,c)=>{function u(C){return C.replace(/\r?\n/g,"\r")}function h(C,E){return E?"\x1B[200~"+C+"\x1B[201~":C}function g(C,E,T,w){C=h(C=u(C),T.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),T.triggerDataEvent(C,!0),E.value=""}function f(C,E,T){const w=T.getBoundingClientRect(),p=C.clientX-w.left-10,b=C.clientY-w.top-10;E.style.width="20px",E.style.height="20px",E.style.left=`${p}px`,E.style.top=`${b}px`,E.style.zIndex="1000",E.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,E){C.clipboardData&&C.clipboardData.setData("text/plain",E.selectionText),C.preventDefault()},c.handlePasteEvent=function(C,E,T,w){C.stopPropagation(),C.clipboardData&&g(C.clipboardData.getData("text/plain"),E,T,w)},c.paste=g,c.moveTextAreaUnderMouseCursor=f,c.rightClickHandler=function(C,E,T,w,p){f(C,E,T),p&&w.rightClickSelect(C),E.value=w.selectionText,E.select()}},7239:(S,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(g,f,C){this._css.set(g,f,C)}getCss(g,f){return this._css.get(g,f)}setColor(g,f,C){this._color.set(g,f,C)}getColor(g,f){return this._color.get(g,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(S,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(u,h,g,f){u.addEventListener(h,g,f);let C=!1;return{dispose:()=>{C||(C=!0,u.removeEventListener(h,g,f))}}}},3551:function(S,c,u){var h=this&&this.__decorate||function(b,_,m,x){var R,k=arguments.length,D=k<3?_:x===null?x=Object.getOwnPropertyDescriptor(_,m):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(b,_,m,x);else for(var A=b.length-1;A>=0;A--)(R=b[A])&&(D=(k<3?R(D):k>3?R(_,m,D):R(_,m))||D);return k>3&&D&&Object.defineProperty(_,m,D),D},g=this&&this.__param||function(b,_){return function(m,x){_(m,x,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const f=u(3656),C=u(8460),E=u(844),T=u(2585),w=u(4725);let p=c.Linkifier=class extends E.Disposable{get currentLink(){return this._currentLink}constructor(b,_,m,x,R){super(),this._element=b,this._mouseService=_,this._renderService=m,this._bufferService=x,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,E.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,E.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(b){this._lastMouseEvent=b;const _=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!_)return;this._isMouseOut=!1;const m=b.composedPath();for(let x=0;x<m.length;x++){const R=m[x];if(R.classList.contains("xterm"))break;if(R.classList.contains("xterm-hover"))return}this._lastBufferCell&&_.x===this._lastBufferCell.x&&_.y===this._lastBufferCell.y||(this._handleHover(_),this._lastBufferCell=_)}_handleHover(b){if(this._activeLine!==b.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(b,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,b)||(this._clearCurrentLink(),this._askForLink(b,!0))}_askForLink(b,_){this._activeProviderReplies&&_||(this._activeProviderReplies?.forEach((x=>{x?.forEach((R=>{R.link.dispose&&R.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let m=!1;for(const[x,R]of this._linkProviderService.linkProviders.entries())_?this._activeProviderReplies?.get(x)&&(m=this._checkLinkProviderResult(x,b,m)):R.provideLinks(b.y,(k=>{if(this._isMouseOut)return;const D=k?.map((A=>({link:A})));this._activeProviderReplies?.set(x,D),m=this._checkLinkProviderResult(x,b,m),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,_){const m=new Set;for(let x=0;x<_.size;x++){const R=_.get(x);if(R)for(let k=0;k<R.length;k++){const D=R[k],A=D.link.range.start.y<b?0:D.link.range.start.x,B=D.link.range.end.y>b?this._bufferService.cols:D.link.range.end.x;for(let W=A;W<=B;W++){if(m.has(W)){R.splice(k--,1);break}m.add(W)}}}}_checkLinkProviderResult(b,_,m){if(!this._activeProviderReplies)return m;const x=this._activeProviderReplies.get(b);let R=!1;for(let k=0;k<b;k++)this._activeProviderReplies.has(k)&&!this._activeProviderReplies.get(k)||(R=!0);if(!R&&x){const k=x.find((D=>this._linkAtPosition(D.link,_)));k&&(m=!0,this._handleNewLink(k))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!m)for(let k=0;k<this._activeProviderReplies.size;k++){const D=this._activeProviderReplies.get(k)?.find((A=>this._linkAtPosition(A.link,_)));if(D){m=!0,this._handleNewLink(D);break}}return m}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const _=this._positionFromMouseEvent(b,this._element,this._mouseService);_&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,_)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,_){this._currentLink&&this._lastMouseEvent&&(!b||!_||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=_)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,E.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const _=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);_&&this._linkAtPosition(b.link,_)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.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(b.link,m))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((m=>{if(!this._currentLink)return;const x=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>=x&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(x,R),this._lastMouseEvent)){const k=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);k&&this._askForLink(k,!1)}}))))}_linkHover(b,_,m){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(_,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),_.hover&&_.hover(m,_.text)}_fireUnderlineEvent(b,_){const m=b.range,x=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(m.start.x-1,m.start.y-x-1,m.end.x,m.end.y-x-1,void 0);(_?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(b,_,m){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(_,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),_.leave&&_.leave(m,_.text)}_linkAtPosition(b,_){const m=b.range.start.y*this._bufferService.cols+b.range.start.x,x=b.range.end.y*this._bufferService.cols+b.range.end.x,R=_.y*this._bufferService.cols+_.x;return m<=R&&R<=x}_positionFromMouseEvent(b,_,m){const x=m.getCoords(b,_,this._bufferService.cols,this._bufferService.rows);if(x)return{x:x[0],y:x[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,_,m,x,R){return{x1:b,y1:_,x2:m,y2:x,cols:this._bufferService.cols,fg:R}}};c.Linkifier=p=h([g(1,w.IMouseService),g(2,w.IRenderService),g(3,T.IBufferService),g(4,w.ILinkProviderService)],p)},9042:(S,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(S,c,u){var h=this&&this.__decorate||function(w,p,b,_){var m,x=arguments.length,R=x<3?p:_===null?_=Object.getOwnPropertyDescriptor(p,b):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(w,p,b,_);else for(var k=w.length-1;k>=0;k--)(m=w[k])&&(R=(x<3?m(R):x>3?m(p,b,R):m(p,b))||R);return x>3&&R&&Object.defineProperty(p,b,R),R},g=this&&this.__param||function(w,p){return function(b,_){p(b,_,w)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const f=u(511),C=u(2585);let E=c.OscLinkProvider=class{constructor(w,p,b){this._bufferService=w,this._optionsService=p,this._oscLinkService=b}provideLinks(w,p){const b=this._bufferService.buffer.lines.get(w-1);if(!b)return void p(void 0);const _=[],m=this._optionsService.rawOptions.linkHandler,x=new f.CellData,R=b.getTrimmedLength();let k=-1,D=-1,A=!1;for(let B=0;B<R;B++)if(D!==-1||b.hasContent(B)){if(b.loadCell(B,x),x.hasExtendedAttrs()&&x.extended.urlId){if(D===-1){D=B,k=x.extended.urlId;continue}A=x.extended.urlId!==k}else D!==-1&&(A=!0);if(A||D!==-1&&B===R-1){const W=this._oscLinkService.getLinkData(k)?.uri;if(W){const j={start:{x:D+1,y:w},end:{x:B+(A||B!==R-1?0:1),y:w}};let F=!1;if(!m?.allowNonHttpProtocols)try{const H=new URL(W);["http:","https:"].includes(H.protocol)||(F=!0)}catch{F=!0}F||_.push({text:W,range:j,activate:(H,Z)=>m?m.activate(H,Z,j):T(0,Z),hover:(H,Z)=>m?.hover?.(H,Z,j),leave:(H,Z)=>m?.leave?.(H,Z,j)})}A=!1,x.hasExtendedAttrs()&&x.extended.urlId?(D=B,k=x.extended.urlId):(D=-1,k=-1)}}p(_)}};function T(w,p){if(confirm(`Do you want to navigate to ${p}?
77
-
78
- WARNING: This link could potentially be dangerous`)){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=p}else console.warn("Opening link blocked as opener could not be cleared")}}c.OscLinkProvider=E=h([g(0,C.IBufferService),g(1,C.IOptionsService),g(2,C.IOscLinkService)],E)},6193:(S,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,g){this._rowCount=g,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:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const h=u(3614),g=u(3656),f=u(3551),C=u(9042),E=u(3730),T=u(1680),w=u(3107),p=u(5744),b=u(2950),_=u(1296),m=u(428),x=u(4269),R=u(5114),k=u(8934),D=u(3230),A=u(9312),B=u(4725),W=u(6731),j=u(8055),F=u(8969),H=u(8460),Z=u(844),ee=u(6114),P=u(8437),V=u(2584),K=u(7399),O=u(5941),z=u(9074),M=u(2585),U=u(5435),Y=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 H.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new H.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new H.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new H.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new H.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new H.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new H.EventEmitter),this._onBlur=this.register(new H.EventEmitter),this._onA11yCharEmitter=this.register(new H.EventEmitter),this._onA11yTabEmitter=this.register(new H.EventEmitter),this._onWillOpen=this.register(new H.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(z.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(E.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,H.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,H.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,H.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,_e="";switch($.index){case 256:oe="foreground",_e="10";break;case 257:oe="background",_e="11";break;case 258:oe="cursor",_e="12";break;default:oe="ansi",_e="4;"+$.index}switch($.type){case 0:const Se=j.color.toColorRGB(oe==="ansi"?this._themeService.colors.ansi[$.index]:this._themeService.colors[oe]);this.coreService.triggerDataEvent(`${V.C0.ESC}]${_e};${(0,O.toRgbString)(Se)}${V.C1_ESCAPED.ST}`);break;case 1:if(oe==="ansi")this._themeService.modifyColors((be=>be.ansi[$.index]=j.channels.toColor(...$.color)));else{const be=oe;this._themeService.modifyColors(($e=>$e[be]=j.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(Y.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Q){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(V.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(V.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),_e=this._renderService.dimensions.css.cell.height,Se=$.getWidth(oe),be=this._renderService.dimensions.css.cell.width*Se,$e=this.buffer.y*this._renderService.dimensions.css.cell.height,Pe=oe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Pe+"px",this.textarea.style.top=$e+"px",this.textarea.style.width=be+"px",this.textarea.style.height=_e+"px",this.textarea.style.lineHeight=_e+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.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,g.addDisposableDomListener)(this.textarea,"paste",Q)),this.register((0,g.addDisposableDomListener)(this.element,"paste",Q)),ee.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",($=>{$.button===2&&(0,h.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",($=>{(0,h.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),ee.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",($=>{$.button===1&&(0,h.moveTextAreaUnderMouseCursor)($,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(Q=>this._keyUp(Q)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(Q=>this._keyDown(Q)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(Q=>this._keyPress(Q)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(Q=>this._compositionHelper.compositionupdate(Q)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.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,g.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,g.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,g.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(x.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(b.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(k.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(T.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(A.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,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,g.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(Y.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(p.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(p.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(_.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Q=this,$=this.element;function oe(be){const $e=Q._mouseService.getMouseReportCoords(be,Q.screenElement);if(!$e)return!1;let Pe,Ke;switch(be.overrideType||be.type){case"mousemove":Ke=32,be.buttons===void 0?(Pe=3,be.button!==void 0&&(Pe=be.button<3?be.button:3)):Pe=1&be.buttons?0:4&be.buttons?1:2&be.buttons?2:3;break;case"mouseup":Ke=0,Pe=be.button<3?be.button:3;break;case"mousedown":Ke=1,Pe=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,Pe=4;break;default:return!1}return!(Ke===void 0||Pe===void 0||Pe>4)&&Q.coreMouseService.triggerMouseEvent({col:$e.col,row:$e.row,x:$e.x,y:$e.y,button:Pe,action:Ke,ctrl:be.ctrlKey,alt:be.altKey,shift:be.shiftKey})}const _e={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Se={mouseup:be=>(oe(be),be.buttons||(this._document.removeEventListener("mouseup",_e.mouseup),_e.mousedrag&&this._document.removeEventListener("mousemove",_e.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?_e.mousemove||($.addEventListener("mousemove",Se.mousemove),_e.mousemove=Se.mousemove):($.removeEventListener("mousemove",_e.mousemove),_e.mousemove=null),16&be?_e.wheel||($.addEventListener("wheel",Se.wheel,{passive:!1}),_e.wheel=Se.wheel):($.removeEventListener("wheel",_e.wheel),_e.wheel=null),2&be?_e.mouseup||(_e.mouseup=Se.mouseup):(this._document.removeEventListener("mouseup",_e.mouseup),_e.mouseup=null),4&be?_e.mousedrag||(_e.mousedrag=Se.mousedrag):(this._document.removeEventListener("mousemove",_e.mousedrag),_e.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)($,"mousedown",(be=>{if(be.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(be))return oe(be),_e.mouseup&&this._document.addEventListener("mouseup",_e.mouseup),_e.mousedrag&&this._document.addEventListener("mousemove",_e.mousedrag),this.cancel(be)}))),this.register((0,g.addDisposableDomListener)($,"wheel",(be=>{if(!_e.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(be)===!1)return!1;if(!this.buffer.hasScrollback){const $e=this.viewport.getLinesScrolled(be);if($e===0)return;const Pe=V.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(be.deltaY<0?"A":"B");let Ke="";for(let Ct=0;Ct<Math.abs($e);Ct++)Ke+=Pe;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,g.addDisposableDomListener)($,"touchstart",(be=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(be),this.cancel(be)}),{passive:!0})),this.register((0,g.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 _e=this.rows-1;return this.scrollLines(oe.type===2?-_e:_e),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!==V.C0.ETX&&oe.key!==V.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(P.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(V.C0.ESC+"[I"):this.coreService.triggerDataEvent(V.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(`${V.C0.ESC}[4;${oe};${$}t`);break;case U.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const _e=this._renderService.dimensions.css.cell.width.toFixed(0),Se=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${V.C0.ESC}[6;${Se};${_e}t`)}}cancel(Q,$){if(this.options.cancelEvents||$)return Q.preventDefault(),Q.stopPropagation(),!1}}c.Terminal=ce},9924:(S,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,g){this._rowCount=g,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,E=this._debounceThresholdMS-C;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),E)}}_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(S,c,u){var h=this&&this.__decorate||function(b,_,m,x){var R,k=arguments.length,D=k<3?_:x===null?x=Object.getOwnPropertyDescriptor(_,m):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(b,_,m,x);else for(var A=b.length-1;A>=0;A--)(R=b[A])&&(D=(k<3?R(D):k>3?R(_,m,D):R(_,m))||D);return k>3&&D&&Object.defineProperty(_,m,D),D},g=this&&this.__param||function(b,_){return function(m,x){_(m,x,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const f=u(3656),C=u(4725),E=u(8460),T=u(844),w=u(2585);let p=c.Viewport=class extends T.Disposable{constructor(b,_,m,x,R,k,D,A){super(),this._viewportElement=b,this._scrollArea=_,this._bufferService=m,this._optionsService=x,this._charSizeService=R,this._renderService=k,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 E.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(A.colors),this.register(A.onChangeColors((B=>this._handleThemeChange(B)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(b){this._viewportElement.style.backgroundColor=b.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(b){if(b)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 _=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==_&&(this._lastRecordedBufferHeight=_,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const b=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==b&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=b),this._refreshAnimationFrame=null}syncScrollArea(b=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(b);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(b)}_handleScroll(b){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 _=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:_,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const b=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(b*(this._smoothScrollState.target-this._smoothScrollState.origin)),b<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(b,_){const m=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(_<0&&this._viewportElement.scrollTop!==0||_>0&&m<this._lastRecordedBufferHeight)||(b.cancelable&&b.preventDefault(),!1)}handleWheel(b){const _=this._getPixelsScrolled(b);return _!==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+_:this._smoothScrollState.target+=_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=_,this._bubbleScroll(b,_))}scrollLines(b){if(b!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const _=b*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:b,suppressScrollEvent:!1})}_getPixelsScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let _=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_LINE?_*=this._currentRowHeight:b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._currentRowHeight*this._bufferService.rows),_}getBufferElements(b,_){let m,x="";const R=[],k=_??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let A=b;A<k;A++){const B=D.get(A);if(!B)continue;const W=D.get(A+1)?.isWrapped;if(x+=B.translateToString(!W),!W||A===D.length-1){const j=document.createElement("div");j.textContent=x,R.push(j),x.length>0&&(m=j),x=""}}return{bufferElements:R,cursorElement:m}}getLinesScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let _=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(_/=this._currentRowHeight+0,this._wheelPartialScroll+=_,_=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._bufferService.rows),_}_applyScrollModifier(b,_){const m=this._optionsService.rawOptions.fastScrollModifier;return m==="alt"&&_.altKey||m==="ctrl"&&_.ctrlKey||m==="shift"&&_.shiftKey?b*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:b*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(b){this._lastTouchY=b.touches[0].pageY}handleTouchMove(b){const _=this._lastTouchY-b.touches[0].pageY;return this._lastTouchY=b.touches[0].pageY,_!==0&&(this._viewportElement.scrollTop+=_,this._bubbleScroll(b,_))}};c.Viewport=p=h([g(2,w.IBufferService),g(3,w.IOptionsService),g(4,C.ICharSizeService),g(5,C.IRenderService),g(6,C.ICoreBrowserService),g(7,C.IThemeService)],p)},3107:function(S,c,u){var h=this&&this.__decorate||function(w,p,b,_){var m,x=arguments.length,R=x<3?p:_===null?_=Object.getOwnPropertyDescriptor(p,b):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(w,p,b,_);else for(var k=w.length-1;k>=0;k--)(m=w[k])&&(R=(x<3?m(R):x>3?m(p,b,R):m(p,b))||R);return x>3&&R&&Object.defineProperty(p,b,R),R},g=this&&this.__param||function(w,p){return function(b,_){p(b,_,w)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const f=u(4725),C=u(844),E=u(2585);let T=c.BufferDecorationRenderer=class extends C.Disposable{constructor(w,p,b,_,m){super(),this._screenElement=w,this._bufferService=p,this._coreBrowserService=b,this._decorationService=_,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((x=>this._removeDecoration(x)))),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 p=this._coreBrowserService.mainDocument.createElement("div");p.classList.add("xterm-decoration"),p.classList.toggle("xterm-decoration-top-layer",w?.options?.layer==="top"),p.style.width=`${Math.round((w.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,p.style.height=(w.options.height||1)*this._renderService.dimensions.css.cell.height+"px",p.style.top=(w.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",p.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const b=w.options.x??0;return b&&b>this._bufferService.cols&&(p.style.display="none"),this._refreshXPosition(w,p),p}_refreshStyle(w){const p=w.marker.line-this._bufferService.buffers.active.ydisp;if(p<0||p>=this._bufferService.rows)w.element&&(w.element.style.display="none",w.onRenderEmitter.fire(w.element));else{let b=this._decorationElements.get(w);b||(b=this._createElement(w),w.element=b,this._decorationElements.set(w,b),this._container.appendChild(b),w.onDispose((()=>{this._decorationElements.delete(w),b.remove()}))),b.style.top=p*this._renderService.dimensions.css.cell.height+"px",b.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(b)}}_refreshXPosition(w,p=w.element){if(!p)return;const b=w.options.x??0;(w.options.anchor||"left")==="right"?p.style.right=b?b*this._renderService.dimensions.css.cell.width+"px":"":p.style.left=b?b*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(w){this._decorationElements.get(w)?.remove(),this._decorationElements.delete(w),w.dispose()}};c.BufferDecorationRenderer=T=h([g(1,E.IBufferService),g(2,f.ICoreBrowserService),g(3,E.IDecorationService),g(4,f.IRenderService)],T)},5871:(S,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,g){return h>=u.startBufferLine-this._linePadding[g||"full"]&&h<=u.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(u,h){u.startBufferLine=Math.min(u.startBufferLine,h),u.endBufferLine=Math.max(u.endBufferLine,h)}}},5744:function(S,c,u){var h=this&&this.__decorate||function(m,x,R,k){var D,A=arguments.length,B=A<3?x:k===null?k=Object.getOwnPropertyDescriptor(x,R):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(m,x,R,k);else for(var W=m.length-1;W>=0;W--)(D=m[W])&&(B=(A<3?D(B):A>3?D(x,R,B):D(x,R))||B);return A>3&&B&&Object.defineProperty(x,R,B),B},g=this&&this.__param||function(m,x){return function(R,k){x(R,k,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const f=u(5871),C=u(4725),E=u(844),T=u(2585),w={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0};let _=c.OverviewRulerRenderer=class extends E.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(m,x,R,k,D,A,B){super(),this._viewportElement=m,this._screenElement=x,this._bufferService=R,this._decorationService=k,this._renderService=D,this._optionsService=A,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,E.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),x=Math.ceil(this._canvas.width/3);p.full=this._canvas.width,p.left=m,p.center=x,p.right=m,this._refreshDrawHeightConstants(),b.full=0,b.left=0,b.center=p.left,b.right=p.left+p.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const m=this._canvas.height/this._bufferService.buffer.lines.length,x=Math.round(Math.max(Math.min(m,12),6)*this._coreBrowserService.dpr);w.left=x,w.center=x,w.right=x}_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 x of this._decorationService.decorations)this._colorZoneStore.addDecoration(x);this._ctx.lineWidth=1;const m=this._colorZoneStore.zones;for(const x of m)x.position!=="full"&&this._renderColorZone(x);for(const x of m)x.position==="full"&&this._renderColorZone(x);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(m){this._ctx.fillStyle=m.color,this._ctx.fillRect(b[m.position||"full"],Math.round((this._canvas.height-1)*(m.startBufferLine/this._bufferService.buffers.active.lines.length)-w[m.position||"full"]/2),p[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,x){this._shouldUpdateDimensions=m||this._shouldUpdateDimensions,this._shouldUpdateAnchor=x||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};c.OverviewRulerRenderer=_=h([g(2,T.IBufferService),g(3,T.IDecorationService),g(4,C.IRenderService),g(5,T.IOptionsService),g(6,C.ICoreBrowserService)],_)},2950:function(S,c,u){var h=this&&this.__decorate||function(w,p,b,_){var m,x=arguments.length,R=x<3?p:_===null?_=Object.getOwnPropertyDescriptor(p,b):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(w,p,b,_);else for(var k=w.length-1;k>=0;k--)(m=w[k])&&(R=(x<3?m(R):x>3?m(p,b,R):m(p,b))||R);return x>3&&R&&Object.defineProperty(p,b,R),R},g=this&&this.__param||function(w,p){return function(b,_){p(b,_,w)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const f=u(4725),C=u(2585),E=u(2584);let T=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,p,b,_,m,x){this._textarea=w,this._compositionView=p,this._bufferService=b,this._optionsService=_,this._coreService=m,this._renderService=x,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 p={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let b;this._isSendingComposition=!1,p.start+=this._dataAlreadySent.length,b=this._isComposing?this._textarea.value.substring(p.start,p.end):this._textarea.value.substring(p.start),b.length>0&&this._coreService.triggerDataEvent(b,!0)}}),0)}else{this._isSendingComposition=!1;const p=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(p,!0)}}_handleAnyTextareaChanges(){const w=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const p=this._textarea.value,b=p.replace(w,"");this._dataAlreadySent=b,p.length>w.length?this._coreService.triggerDataEvent(b,!0):p.length<w.length?this._coreService.triggerDataEvent(`${E.C0.DEL}`,!0):p.length===w.length&&p!==w&&this._coreService.triggerDataEvent(p,!0)}}),0)}updateCompositionElements(w){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const p=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),b=this._renderService.dimensions.css.cell.height,_=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,m=p*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=m+"px",this._compositionView.style.top=_+"px",this._compositionView.style.height=b+"px",this._compositionView.style.lineHeight=b+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const x=this._compositionView.getBoundingClientRect();this._textarea.style.left=m+"px",this._textarea.style.top=_+"px",this._textarea.style.width=Math.max(x.width,1)+"px",this._textarea.style.height=Math.max(x.height,1)+"px",this._textarea.style.lineHeight=x.height+"px"}w||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};c.CompositionHelper=T=h([g(2,C.IBufferService),g(3,C.IOptionsService),g(4,C.ICoreService),g(5,f.IRenderService)],T)},9806:(S,c)=>{function u(h,g,f){const C=f.getBoundingClientRect(),E=h.getComputedStyle(f),T=parseInt(E.getPropertyValue("padding-left")),w=parseInt(E.getPropertyValue("padding-top"));return[g.clientX-C.left-T,g.clientY-C.top-w]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=u,c.getCoords=function(h,g,f,C,E,T,w,p,b){if(!T)return;const _=u(h,g,f);return _?(_[0]=Math.ceil((_[0]+(b?w/2:0))/w),_[1]=Math.ceil(_[1]/p),_[0]=Math.min(Math.max(_[0],1),C+(b?1:0)),_[1]=Math.min(Math.max(_[1],1),E),_):void 0}},9504:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const h=u(2584);function g(p,b,_,m){const x=p-f(p,_),R=b-f(b,_),k=Math.abs(x-R)-(function(D,A,B){let W=0;const j=D-f(D,B),F=A-f(A,B);for(let H=0;H<Math.abs(j-F);H++){const Z=C(D,A)==="A"?-1:1;B.buffer.lines.get(j+Z*H)?.isWrapped&&W++}return W})(p,b,_);return w(k,T(C(p,b),m))}function f(p,b){let _=0,m=b.buffer.lines.get(p),x=m?.isWrapped;for(;x&&p>=0&&p<b.rows;)_++,m=b.buffer.lines.get(--p),x=m?.isWrapped;return _}function C(p,b){return p>b?"A":"B"}function E(p,b,_,m,x,R){let k=p,D=b,A="";for(;k!==_||D!==m;)k+=x?1:-1,x&&k>R.cols-1?(A+=R.buffer.translateBufferLineToString(D,!1,p,k),k=0,p=0,D++):!x&&k<0&&(A+=R.buffer.translateBufferLineToString(D,!1,0,p+1),k=R.cols-1,p=k,D--);return A+R.buffer.translateBufferLineToString(D,!1,p,k)}function T(p,b){const _=b?"O":"[";return h.C0.ESC+_+p}function w(p,b){p=Math.floor(p);let _="";for(let m=0;m<p;m++)_+=b;return _}c.moveToCellSequence=function(p,b,_,m){const x=_.buffer.x,R=_.buffer.y;if(!_.buffer.hasScrollback)return(function(A,B,W,j,F,H){return g(B,j,F,H).length===0?"":w(E(A,B,A,B-f(B,F),!1,F).length,T("D",H))})(x,R,0,b,_,m)+g(R,b,_,m)+(function(A,B,W,j,F,H){let Z;Z=g(B,j,F,H).length>0?j-f(j,F):B;const ee=j,P=(function(V,K,O,z,M,U){let Y;return Y=g(O,z,M,U).length>0?z-f(z,M):K,V<O&&Y<=z||V>=O&&Y<z?"C":"D"})(A,B,W,j,F,H);return w(E(A,Z,W,ee,P==="C",F).length,T(P,H))})(x,R,p,b,_,m);let k;if(R===b)return k=x>p?"D":"C",w(Math.abs(x-p),T(k,m));k=R>b?"D":"C";const D=Math.abs(R-b);return w((function(A,B){return B.cols-A})(R>b?p:x,_)+(D-1)*_.cols+1+((R>b?x:p)-1),T(k,m))}},1296:function(S,c,u){var h=this&&this.__decorate||function(H,Z,ee,P){var V,K=arguments.length,O=K<3?Z:P===null?P=Object.getOwnPropertyDescriptor(Z,ee):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(H,Z,ee,P);else for(var z=H.length-1;z>=0;z--)(V=H[z])&&(O=(K<3?V(O):K>3?V(Z,ee,O):V(Z,ee))||O);return K>3&&O&&Object.defineProperty(Z,ee,O),O},g=this&&this.__param||function(H,Z){return function(ee,P){Z(ee,P,H)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const f=u(3787),C=u(2550),E=u(2223),T=u(6171),w=u(6052),p=u(4725),b=u(8055),_=u(8460),m=u(844),x=u(2585),R="xterm-dom-renderer-owner-",k="xterm-rows",D="xterm-fg-",A="xterm-bg-",B="xterm-focus",W="xterm-selection";let j=1,F=c.DomRenderer=class extends m.Disposable{constructor(H,Z,ee,P,V,K,O,z,M,U,Y,ae,ce){super(),this._terminal=H,this._document=Z,this._element=ee,this._screenElement=P,this._viewportElement=V,this._helperContainer=K,this._linkifier2=O,this._charSizeService=M,this._optionsService=U,this._bufferService=Y,this._coreBrowserService=ae,this._themeService=ce,this._terminalClass=j++,this._rowElements=[],this._selectionRenderModel=(0,w.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new _.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(k),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,T.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=z.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 H=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*H,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*H),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/H),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/H),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} .${k} 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(H){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Z=`${this._terminalSelector} .${k} { color: ${H.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Z+=`${this._terminalSelector} .${k} .xterm-dim { color: ${b.color.multiplyOpacity(H.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}`,P=`blink_bar_${this._terminalClass}`,V=`blink_block_${this._terminalClass}`;Z+=`@keyframes ${ee} { 50% { border-bottom-style: hidden; }}`,Z+=`@keyframes ${P} { 50% { box-shadow: none; }}`,Z+=`@keyframes ${V} { 0% { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css}; } 50% { background-color: inherit; color: ${H.cursor.css}; }}`,Z+=`${this._terminalSelector} .${k}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${ee} 1s step-end infinite;}${this._terminalSelector} .${k}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${P} 1s step-end infinite;}${this._terminalSelector} .${k}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css};}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${H.cursor.css} !important; color: ${H.cursorAccent.css} !important;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${H.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${H.cursor.css} inset;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${H.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: ${H.selectionBackgroundOpaque.css};}${this._terminalSelector} .${W} div { position: absolute; background-color: ${H.selectionInactiveBackgroundOpaque.css};}`;for(const[K,O]of H.ansi.entries())Z+=`${this._terminalSelector} .${D}${K} { color: ${O.css}; }${this._terminalSelector} .${D}${K}.xterm-dim { color: ${b.color.multiplyOpacity(O,.5).css}; }${this._terminalSelector} .${A}${K} { background-color: ${O.css}; }`;Z+=`${this._terminalSelector} .${D}${E.INVERTED_DEFAULT_COLOR} { color: ${b.color.opaque(H.background).css}; }${this._terminalSelector} .${D}${E.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${b.color.multiplyOpacity(b.color.opaque(H.background),.5).css}; }${this._terminalSelector} .${A}${E.INVERTED_DEFAULT_COLOR} { background-color: ${H.foreground.css}; }`,this._themeStyleElement.textContent=Z}_setDefaultSpacing(){const H=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${H}px`,this._rowFactory.defaultSpacing=H}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(H,Z){for(let ee=this._rowElements.length;ee<=Z;ee++){const P=this._document.createElement("div");this._rowContainer.appendChild(P),this._rowElements.push(P)}for(;this._rowElements.length>Z;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(H,Z){this._refreshRowElements(H,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(H,Z,ee){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(H,Z,ee),this.renderRows(0,this._bufferService.rows-1),!H||!Z)return;this._selectionRenderModel.update(this._terminal,H,Z,ee);const P=this._selectionRenderModel.viewportStartRow,V=this._selectionRenderModel.viewportEndRow,K=this._selectionRenderModel.viewportCappedStartRow,O=this._selectionRenderModel.viewportCappedEndRow;if(K>=this._bufferService.rows||O<0)return;const z=this._document.createDocumentFragment();if(ee){const M=H[0]>Z[0];z.appendChild(this._createSelectionElement(K,M?Z[0]:H[0],M?H[0]:Z[0],O-K+1))}else{const M=P===K?H[0]:0,U=K===V?Z[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(K,M,U));const Y=O-K-1;if(z.appendChild(this._createSelectionElement(K+1,0,this._bufferService.cols,Y)),K!==O){const ae=V===O?Z[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(O,0,ae))}}this._selectionContainer.appendChild(z)}_createSelectionElement(H,Z,ee,P=1){const V=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),V.style.height=P*this.dimensions.css.cell.height+"px",V.style.top=H*this.dimensions.css.cell.height+"px",V.style.left=`${K}px`,V.style.width=`${O}px`,V}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 H of this._rowElements)H.replaceChildren()}renderRows(H,Z){const ee=this._bufferService.buffer,P=ee.ybase+ee.y,V=Math.min(ee.x,this._bufferService.cols-1),K=this._optionsService.rawOptions.cursorBlink,O=this._optionsService.rawOptions.cursorStyle,z=this._optionsService.rawOptions.cursorInactiveStyle;for(let M=H;M<=Z;M++){const U=M+ee.ydisp,Y=this._rowElements[M],ae=ee.lines.get(U);if(!Y||!ae)break;Y.replaceChildren(...this._rowFactory.createRow(ae,U,U===P,O,z,V,K,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${this._terminalClass}`}_handleLinkHover(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!0)}_handleLinkLeave(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!1)}_setCellUnderline(H,Z,ee,P,V,K){ee<0&&(H=0),P<0&&(Z=0);const O=this._bufferService.rows-1;ee=Math.max(Math.min(ee,O),0),P=Math.max(Math.min(P,O),0),V=Math.min(V,this._bufferService.cols);const z=this._bufferService.buffer,M=z.ybase+z.y,U=Math.min(z.x,V-1),Y=this._optionsService.rawOptions.cursorBlink,ae=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let me=ee;me<=P;++me){const Q=me+z.ydisp,$=this._rowElements[me],oe=z.lines.get(Q);if(!$||!oe)break;$.replaceChildren(...this._rowFactory.createRow(oe,Q,Q===M,ae,ce,U,Y,this.dimensions.css.cell.width,this._widthCache,K?me===ee?H:0:-1,K?(me===P?Z:V)-1:-1))}}};c.DomRenderer=F=h([g(7,x.IInstantiationService),g(8,p.ICharSizeService),g(9,x.IOptionsService),g(10,x.IBufferService),g(11,p.ICoreBrowserService),g(12,p.IThemeService)],F)},3787:function(S,c,u){var h=this&&this.__decorate||function(k,D,A,B){var W,j=arguments.length,F=j<3?D:B===null?B=Object.getOwnPropertyDescriptor(D,A):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(k,D,A,B);else for(var H=k.length-1;H>=0;H--)(W=k[H])&&(F=(j<3?W(F):j>3?W(D,A,F):W(D,A))||F);return j>3&&F&&Object.defineProperty(D,A,F),F},g=this&&this.__param||function(k,D){return function(A,B){D(A,B,k)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const f=u(2223),C=u(643),E=u(511),T=u(2585),w=u(8055),p=u(4725),b=u(4269),_=u(6171),m=u(3734);let x=c.DomRendererRowFactory=class{constructor(k,D,A,B,W,j,F){this._document=k,this._characterJoinerService=D,this._optionsService=A,this._coreBrowserService=B,this._coreService=W,this._decorationService=j,this._themeService=F,this._workCell=new E.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(k,D,A){this._selectionStart=k,this._selectionEnd=D,this._columnSelectMode=A}createRow(k,D,A,B,W,j,F,H,Z,ee,P){const V=[],K=this._characterJoinerService.getJoinedCharacters(D),O=this._themeService.colors;let z,M=k.getNoBgTrimmedLength();A&&M<j+1&&(M=j+1);let U=0,Y="",ae=0,ce=0,me=0,Q=!1,$=0,oe=!1,_e=0;const Se=[],be=ee!==-1&&P!==-1;for(let $e=0;$e<M;$e++){k.loadCell($e,this._workCell);let Pe=this._workCell.getWidth();if(Pe===0)continue;let Ke=!1,Ct=$e,Be=this._workCell;if(K.length>0&&$e===K[0][0]){Ke=!0;const ht=K.shift();Be=new b.JoinedCellData(this._workCell,k.translateToString(!0,ht[0],ht[1]),ht[1]-ht[0]),Ct=ht[1]-1,Pe=Be.getWidth()}const Qt=this._isCellInSelection($e,D),gi=A&&$e===j,mi=be&&$e>=ee&&$e<=P;let un=!1;this._decorationService.forEachDecorationAtCell($e,D,void 0,(ht=>{un=!0}));let An=Be.getChars()||C.WHITESPACE_CELL_CHAR;if(An===" "&&(Be.isUnderline()||Be.isOverline())&&(An=" "),_e=Pe*H-Z.get(An,Be.isBold(),Be.isItalic()),z){if(U&&(Qt&&oe||!Qt&&!oe&&Be.bg===ae)&&(Qt&&oe&&O.selectionForeground||Be.fg===ce)&&Be.extended.ext===me&&mi===Q&&_e===$&&!gi&&!Ke&&!un){Be.isInvisible()?Y+=C.WHITESPACE_CELL_CHAR:Y+=An,U++;continue}U&&(z.textContent=Y),z=this._document.createElement("span"),U=0,Y=""}else z=this._document.createElement("span");if(ae=Be.bg,ce=Be.fg,me=Be.extended.ext,Q=mi,$=_e,oe=Qt,Ke&&j>=$e&&j<=Ct&&(j=$e),!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(Be.isBold()&&Se.push("xterm-bold"),Be.isItalic()&&Se.push("xterm-italic"),Be.isDim()&&Se.push("xterm-dim"),Y=Be.isInvisible()?C.WHITESPACE_CELL_CHAR:Be.getChars()||C.WHITESPACE_CELL_CHAR,Be.isUnderline()&&(Se.push(`xterm-underline-${Be.extended.underlineStyle}`),Y===" "&&(Y=" "),!Be.isUnderlineColorDefault()))if(Be.isUnderlineColorRGB())z.style.textDecorationColor=`rgb(${m.AttributeData.toColorRGB(Be.getUnderlineColor()).join(",")})`;else{let ht=Be.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Be.isBold()&&ht<8&&(ht+=8),z.style.textDecorationColor=O.ansi[ht].css}Be.isOverline()&&(Se.push("xterm-overline"),Y===" "&&(Y=" ")),Be.isStrikethrough()&&Se.push("xterm-strikethrough"),mi&&(z.style.textDecoration="underline");let Jt=Be.getFgColor(),ct=Be.getFgColorMode(),Gt=Be.getBgColor(),It=Be.getBgColorMode();const Ht=!!Be.isInverse();if(Ht){const ht=Jt;Jt=Gt,Gt=ht;const Ii=ct;ct=It,It=Ii}let ei,Rn,Ti,Zi=!1;switch(this._decorationService.forEachDecorationAtCell($e,D,void 0,(ht=>{ht.options.layer!=="top"&&Zi||(ht.backgroundColorRGB&&(It=50331648,Gt=ht.backgroundColorRGB.rgba>>8&16777215,ei=ht.backgroundColorRGB),ht.foregroundColorRGB&&(ct=50331648,Jt=ht.foregroundColorRGB.rgba>>8&16777215,Rn=ht.foregroundColorRGB),Zi=ht.options.layer==="top")})),!Zi&&Qt&&(ei=this._coreBrowserService.isFocused?O.selectionBackgroundOpaque:O.selectionInactiveBackgroundOpaque,Gt=ei.rgba>>8&16777215,It=50331648,Zi=!0,O.selectionForeground&&(ct=50331648,Jt=O.selectionForeground.rgba>>8&16777215,Rn=O.selectionForeground)),Zi&&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(z,`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||Be.isDim()&&(ei=w.color.multiplyOpacity(Ti,.5)),ct){case 16777216:case 33554432:Be.isBold()&&Jt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Jt+=8),this._applyMinimumContrast(z,Ti,O.ansi[Jt],Be,ei,void 0)||Se.push(`xterm-fg-${Jt}`);break;case 50331648:const ht=w.channels.toColor(Jt>>16&255,Jt>>8&255,255&Jt);this._applyMinimumContrast(z,Ti,ht,Be,ei,Rn)||this._addStyle(z,`color:#${R(Jt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(z,Ti,O.foreground,Be,ei,Rn)||Ht&&Se.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}Se.length&&(z.className=Se.join(" "),Se.length=0),gi||Ke||un?z.textContent=Y:U++,_e!==this.defaultSpacing&&(z.style.letterSpacing=`${_e}px`),V.push(z),$e=Ct}return z&&U&&(z.textContent=Y),V}_applyMinimumContrast(k,D,A,B,W,j){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,_.treatGlyphAsBackgroundColor)(B.getCode()))return!1;const F=this._getContrastCache(B);let H;if(W||j||(H=F.getColor(D.rgba,A.rgba)),H===void 0){const Z=this._optionsService.rawOptions.minimumContrastRatio/(B.isDim()?2:1);H=w.color.ensureContrastRatio(W||D,j||A,Z),F.setColor((W||D).rgba,(j||A).rgba,H??null)}return!!H&&(this._addStyle(k,`color:${H.css}`),!0)}_getContrastCache(k){return k.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(k,D){k.setAttribute("style",`${k.getAttribute("style")||""}${D};`)}_isCellInSelection(k,D){const A=this._selectionStart,B=this._selectionEnd;return!(!A||!B)&&(this._columnSelectMode?A[0]<=B[0]?k>=A[0]&&D>=A[1]&&k<B[0]&&D<=B[1]:k<A[0]&&D>=A[1]&&k>=B[0]&&D<=B[1]:D>A[1]&&D<B[1]||A[1]===B[1]&&D===A[1]&&k>=A[0]&&k<B[0]||A[1]<B[1]&&D===B[1]&&k<B[0]||A[1]<B[1]&&D===A[1]&&k>=A[0])}};function R(k,D,A){for(;k.length<A;)k=D+k;return k}c.DomRendererRowFactory=x=h([g(1,p.ICharacterJoinerService),g(2,T.IOptionsService),g(3,p.ICoreBrowserService),g(4,T.ICoreService),g(5,T.IDecorationService),g(6,p.IThemeService)],x)},2550:(S,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 g=u.createElement("span");g.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 E=u.createElement("span");E.classList.add("xterm-char-measure-element"),E.style.fontWeight="bold",E.style.fontStyle="italic",this._measureElements=[g,f,C,E],this._container.appendChild(g),this._container.appendChild(f),this._container.appendChild(C),this._container.appendChild(E),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,g,f){u===this._font&&h===this._fontSize&&g===this._weight&&f===this._weightBold||(this._font=u,this._fontSize=h,this._weight=g,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(u,h,g){let f=0;if(!h&&!g&&u.length===1&&(f=u.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const T=this._measure(u,0);return T>0&&(this._flat[f]=T),T}let C=u;h&&(C+="B"),g&&(C+="I");let E=this._holey.get(C);if(E===void 0){let T=0;h&&(T|=1),g&&(T|=2),E=this._measure(u,T),E>0&&this._holey.set(C,E)}return E}_measure(u,h){const g=this._measureElements[h];return g.textContent=u.repeat(32),g.offsetWidth/32}}},2223:(S,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:(S,c)=>{function u(g){return 57508<=g&&g<=57558}function h(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=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(g){if(!g)throw new Error("value must not be falsy");return g},c.isPowerlineGlyph=u,c.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},c.isEmoji=h,c.allowRescaling=function(g,f,C,E){return f===1&&C>Math.ceil(1.5*E)&&g!==void 0&&g>255&&!h(g)&&!u(g)&&!(function(T){return 57344<=T&&T<=63743})(g)},c.treatGlyphAsBackgroundColor=function(g){return u(g)||(function(f){return 9472<=f&&f<=9631})(g)},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(g,f,C=0){return(g-(2*Math.round(f)-C))%(2*Math.round(f))}},6052:(S,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(g,f,C,E=!1){if(this.selectionStart=f,this.selectionEnd=C,!f||!C||f[0]===C[0]&&f[1]===C[1])return void this.clear();const T=g.buffers.active.ydisp,w=f[1]-T,p=C[1]-T,b=Math.max(w,0),_=Math.min(p,g.rows-1);b>=g.rows||_<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=E,this.viewportStartRow=w,this.viewportEndRow=p,this.viewportCappedStartRow=b,this.viewportCappedEndRow=_,this.startCol=f[0],this.endCol=C[0])}isCellSelected(g,f,C){return!!this.hasSelection&&(C-=g.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:(S,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(S,c,u){var h=this&&this.__decorate||function(_,m,x,R){var k,D=arguments.length,A=D<3?m:R===null?R=Object.getOwnPropertyDescriptor(m,x):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(_,m,x,R);else for(var B=_.length-1;B>=0;B--)(k=_[B])&&(A=(D<3?k(A):D>3?k(m,x,A):k(m,x))||A);return D>3&&A&&Object.defineProperty(m,x,A),A},g=this&&this.__param||function(_,m){return function(x,R){m(x,R,_)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const f=u(2585),C=u(8460),E=u(844);let T=c.CharSizeService=class extends E.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(_,m,x){super(),this._optionsService=x,this.width=0,this.height=0,this._onCharSizeChange=this.register(new C.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new b(this._optionsService))}catch{this._measureStrategy=this.register(new p(_,m,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const _=this._measureStrategy.measure();_.width===this.width&&_.height===this.height||(this.width=_.width,this.height=_.height,this._onCharSizeChange.fire())}};c.CharSizeService=T=h([g(2,f.IOptionsService)],T);class w extends E.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(m,x){m!==void 0&&m>0&&x!==void 0&&x>0&&(this._result.width=m,this._result.height=x)}}class p extends w{constructor(m,x,R){super(),this._document=m,this._parentElement=x,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 b extends w{constructor(m){super(),this._optionsService=m,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const x=this._ctx.measureText("W");if(!("width"in x&&"fontBoundingBoxAscent"in x&&"fontBoundingBoxDescent"in x))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(S,c,u){var h=this&&this.__decorate||function(b,_,m,x){var R,k=arguments.length,D=k<3?_:x===null?x=Object.getOwnPropertyDescriptor(_,m):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(b,_,m,x);else for(var A=b.length-1;A>=0;A--)(R=b[A])&&(D=(k<3?R(D):k>3?R(_,m,D):R(_,m))||D);return k>3&&D&&Object.defineProperty(_,m,D),D},g=this&&this.__param||function(b,_){return function(m,x){_(m,x,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const f=u(3734),C=u(643),E=u(511),T=u(2585);class w extends f.AttributeData{constructor(_,m,x){super(),this.content=0,this.combinedData="",this.fg=_.fg,this.bg=_.bg,this.combinedData=m,this._width=x}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(_){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.JoinedCellData=w;let p=c.CharacterJoinerService=class W1{constructor(_){this._bufferService=_,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new E.CellData}register(_){const m={id:this._nextCharacterJoinerId++,handler:_};return this._characterJoiners.push(m),m.id}deregister(_){for(let m=0;m<this._characterJoiners.length;m++)if(this._characterJoiners[m].id===_)return this._characterJoiners.splice(m,1),!0;return!1}getJoinedCharacters(_){if(this._characterJoiners.length===0)return[];const m=this._bufferService.buffer.lines.get(_);if(!m||m.length===0)return[];const x=[],R=m.translateToString(!0);let k=0,D=0,A=0,B=m.getFg(0),W=m.getBg(0);for(let j=0;j<m.getTrimmedLength();j++)if(m.loadCell(j,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==B||this._workCell.bg!==W){if(j-k>1){const F=this._getJoinedRanges(R,A,D,m,k);for(let H=0;H<F.length;H++)x.push(F[H])}k=j,A=D,B=this._workCell.fg,W=this._workCell.bg}D+=this._workCell.getChars().length||C.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-k>1){const j=this._getJoinedRanges(R,A,D,m,k);for(let F=0;F<j.length;F++)x.push(j[F])}return x}_getJoinedRanges(_,m,x,R,k){const D=_.substring(m,x);let A=[];try{A=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 j=0;j<W.length;j++)W1._mergeRanges(A,W[j])}catch(W){console.error(W)}return this._stringRangesToCellRanges(A,R,k),A}_stringRangesToCellRanges(_,m,x){let R=0,k=!1,D=0,A=_[R];if(A){for(let B=x;B<this._bufferService.cols;B++){const W=m.getWidth(B),j=m.getString(B).length||C.WHITESPACE_CELL_CHAR.length;if(W!==0){if(!k&&A[0]<=D&&(A[0]=B,k=!0),A[1]<=D){if(A[1]=B,A=_[++R],!A)break;A[0]<=D?(A[0]=B,k=!0):k=!1}D+=j}}A&&(A[1]=this._bufferService.cols)}}static _mergeRanges(_,m){let x=!1;for(let R=0;R<_.length;R++){const k=_[R];if(x){if(m[1]<=k[0])return _[R-1][1]=m[1],_;if(m[1]<=k[1])return _[R-1][1]=Math.max(m[1],k[1]),_.splice(R,1),_;_.splice(R,1),R--}else{if(m[1]<=k[0])return _.splice(R,0,m),_;if(m[1]<=k[1])return k[0]=Math.min(m[0],k[0]),_;m[0]<k[1]&&(k[0]=Math.min(m[0],k[0]),x=!0)}}return x?_[_.length-1][1]=m[1]:_.push(m),_}};c.CharacterJoinerService=p=h([g(0,T.IBufferService)],p)},5114:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const h=u(844),g=u(8460),f=u(3656);class C extends h.Disposable{constructor(w,p,b){super(),this._textarea=w,this._window=p,this.mainDocument=b,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new E(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((_=>this._screenDprMonitor.setWindow(_)))),this.register((0,g.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 E extends h.Disposable{constructor(w){super(),this._parentWindow=w,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new g.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:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.LinkProviderService=void 0;const h=u(844);class g 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 E=this.linkProviders.indexOf(C);E!==-1&&this.linkProviders.splice(E,1)}}}}c.LinkProviderService=g},8934:function(S,c,u){var h=this&&this.__decorate||function(T,w,p,b){var _,m=arguments.length,x=m<3?w:b===null?b=Object.getOwnPropertyDescriptor(w,p):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(T,w,p,b);else for(var R=T.length-1;R>=0;R--)(_=T[R])&&(x=(m<3?_(x):m>3?_(w,p,x):_(w,p))||x);return m>3&&x&&Object.defineProperty(w,p,x),x},g=this&&this.__param||function(T,w){return function(p,b){w(p,b,T)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const f=u(4725),C=u(9806);let E=c.MouseService=class{constructor(T,w){this._renderService=T,this._charSizeService=w}getCoords(T,w,p,b,_){return(0,C.getCoords)(window,T,w,p,b,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,_)}getMouseReportCoords(T,w){const p=(0,C.getCoordsRelativeToElement)(window,T,w);if(this._charSizeService.hasValidSize)return p[0]=Math.min(Math.max(p[0],0),this._renderService.dimensions.css.canvas.width-1),p[1]=Math.min(Math.max(p[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(p[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(p[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(p[0]),y:Math.floor(p[1])}}};c.MouseService=E=h([g(0,f.IRenderService),g(1,f.ICharSizeService)],E)},3230:function(S,c,u){var h=this&&this.__decorate||function(_,m,x,R){var k,D=arguments.length,A=D<3?m:R===null?R=Object.getOwnPropertyDescriptor(m,x):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(_,m,x,R);else for(var B=_.length-1;B>=0;B--)(k=_[B])&&(A=(D<3?k(A):D>3?k(m,x,A):k(m,x))||A);return D>3&&A&&Object.defineProperty(m,x,A),A},g=this&&this.__param||function(_,m){return function(x,R){m(x,R,_)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const f=u(6193),C=u(4725),E=u(8460),T=u(844),w=u(7226),p=u(2585);let b=c.RenderService=class extends T.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(_,m,x,R,k,D,A,B){super(),this._rowCount=_,this._charSizeService=R,this._renderer=this.register(new T.MutableDisposable),this._pausedResizeTask=new w.DebouncedIdleTask,this._observerDisposable=this.register(new T.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 E.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new E.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new E.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new E.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((W,j)=>this._renderRows(W,j)),A),this.register(this._renderDebouncer),this.register(A.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(x.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(k.onDecorationRegistered((()=>this._fullRefresh()))),this.register(k.onDecorationRemoved((()=>this._fullRefresh()))),this.register(x.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(x.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(B.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(A.window,m),this.register(A.onWindowChange((W=>this._registerIntersectionObserver(W,m))))}_registerIntersectionObserver(_,m){if("IntersectionObserver"in _){const x=new _.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});x.observe(m),this._observerDisposable.value=(0,T.toDisposable)((()=>x.disconnect()))}}_handleIntersectionChange(_){this._isPaused=_.isIntersecting===void 0?_.intersectionRatio===0:!_.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(_,m,x=!1){this._isPaused?this._needsFullRefresh=!0:(x||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(_,m,this._rowCount))}_renderRows(_,m){this._renderer.value&&(_=Math.min(_,this._rowCount-1),m=Math.min(m,this._rowCount-1),this._renderer.value.renderRows(_,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:_,end:m}),this._onRender.fire({start:_,end:m}),this._isNextRenderRedrawOnly=!0)}resize(_,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(_){this._renderer.value=_,this._renderer.value&&(this._renderer.value.onRequestRedraw((m=>this.refreshRows(m.start,m.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(_){return this._renderDebouncer.addRefreshCallback(_)}_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(_,m){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(_,m))):this._renderer.value.handleResize(_,m),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(_,m,x){this._selectionState.start=_,this._selectionState.end=m,this._selectionState.columnSelectMode=x,this._renderer.value?.handleSelectionChanged(_,m,x)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};c.RenderService=b=h([g(2,p.IOptionsService),g(3,C.ICharSizeService),g(4,p.IDecorationService),g(5,p.IBufferService),g(6,C.ICoreBrowserService),g(7,C.IThemeService)],b)},9312:function(S,c,u){var h=this&&this.__decorate||function(A,B,W,j){var F,H=arguments.length,Z=H<3?B:j===null?j=Object.getOwnPropertyDescriptor(B,W):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(A,B,W,j);else for(var ee=A.length-1;ee>=0;ee--)(F=A[ee])&&(Z=(H<3?F(Z):H>3?F(B,W,Z):F(B,W))||Z);return H>3&&Z&&Object.defineProperty(B,W,Z),Z},g=this&&this.__param||function(A,B){return function(W,j){B(W,j,A)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const f=u(9806),C=u(9504),E=u(456),T=u(4725),w=u(8460),p=u(844),b=u(6114),_=u(4841),m=u(511),x=u(2585),R=" ",k=new RegExp(R,"g");let D=c.SelectionService=class extends p.Disposable{constructor(A,B,W,j,F,H,Z,ee,P){super(),this._element=A,this._screenElement=B,this._linkifier=W,this._bufferService=j,this._coreService=F,this._mouseService=H,this._optionsService=Z,this._renderService=ee,this._coreBrowserService=P,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=V=>this._handleMouseMove(V),this._mouseUpListener=V=>this._handleMouseUp(V),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((V=>this._handleTrim(V))),this.register(this._bufferService.buffers.onBufferActivate((V=>this._handleBufferActivate(V)))),this.enable(),this._model=new E.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,p.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 A=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!A||!B||A[0]===B[0]&&A[1]===B[1])}get selectionText(){const A=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;if(!A||!B)return"";const W=this._bufferService.buffer,j=[];if(this._activeSelectionMode===3){if(A[0]===B[0])return"";const F=A[0]<B[0]?A[0]:B[0],H=A[0]<B[0]?B[0]:A[0];for(let Z=A[1];Z<=B[1];Z++){const ee=W.translateBufferLineToString(Z,!0,F,H);j.push(ee)}}else{const F=A[1]===B[1]?B[0]:void 0;j.push(W.translateBufferLineToString(A[1],!0,A[0],F));for(let H=A[1]+1;H<=B[1]-1;H++){const Z=W.lines.get(H),ee=W.translateBufferLineToString(H,!0);Z?.isWrapped?j[j.length-1]+=ee:j.push(ee)}if(A[1]!==B[1]){const H=W.lines.get(B[1]),Z=W.translateBufferLineToString(B[1],!0,0,B[0]);H&&H.isWrapped?j[j.length-1]+=Z:j.push(Z)}}return j.map((F=>F.replace(k," "))).join(b.isWindows?`\r
79
- `:`
80
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(A){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.isLinux&&A&&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(A){const B=this._getMouseBufferCoords(A),W=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!!(W&&j&&B)&&this._areCoordsInSelection(B,W,j)}isCellInSelection(A,B){const W=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!W||!j)&&this._areCoordsInSelection([A,B],W,j)}_areCoordsInSelection(A,B,W){return A[1]>B[1]&&A[1]<W[1]||B[1]===W[1]&&A[1]===B[1]&&A[0]>=B[0]&&A[0]<W[0]||B[1]<W[1]&&A[1]===W[1]&&A[0]<W[0]||B[1]<W[1]&&A[1]===B[1]&&A[0]>=B[0]}_selectWordAtCursor(A,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,_.getRangeLength)(W,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const j=this._getMouseBufferCoords(A);return!!j&&(this._selectWordAt(j,B),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(A,B){this._model.clearSelection(),A=Math.max(A,0),B=Math.min(B,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,A],this._model.selectionEnd=[this._bufferService.cols,B],this.refresh(),this._onSelectionChange.fire()}_handleTrim(A){this._model.handleTrim(A)&&this.refresh()}_getMouseBufferCoords(A){const B=this._mouseService.getCoords(A,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(B)return B[0]--,B[1]--,B[1]+=this._bufferService.buffer.ydisp,B}_getMouseEventScrollAmount(A){let B=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,A,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(A){return b.isMac?A.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:A.shiftKey}handleMouseDown(A){if(this._mouseDownTimeStamp=A.timeStamp,(A.button!==2||!this.hasSelection)&&A.button===0){if(!this._enabled){if(!this.shouldForceSelection(A))return;A.stopPropagation()}A.preventDefault(),this._dragScrollAmount=0,this._enabled&&A.shiftKey?this._handleIncrementalClick(A):A.detail===1?this._handleSingleClick(A):A.detail===2?this._handleDoubleClick(A):A.detail===3&&this._handleTripleClick(A),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(A){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(A))}_handleSingleClick(A){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(A)?3:0,this._model.selectionStart=this._getMouseBufferCoords(A),!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(A){this._selectWordAtCursor(A,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(A){const B=this._getMouseBufferCoords(A);B&&(this._activeSelectionMode=2,this._selectLineAt(B[1]))}shouldColumnSelect(A){return A.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(A){if(A.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(A),!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(A),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 j=W.lines.get(this._model.selectionEnd[1]);j&&j.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 A=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(A.ydisp+this._bufferService.rows,A.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=A.ydisp),this.refresh()}}_handleMouseUp(A){const B=A.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&B<500&&A.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const W=this._mouseService.getCoords(A,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(W&&W[0]!==void 0&&W[1]!==void 0){const j=(0,C.moveToCellSequence)(W[0]-1,W[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(j,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const A=this._model.finalSelectionStart,B=this._model.finalSelectionEnd,W=!(!A||!B||A[0]===B[0]&&A[1]===B[1]);W?A&&B&&(this._oldSelectionStart&&this._oldSelectionEnd&&A[0]===this._oldSelectionStart[0]&&A[1]===this._oldSelectionStart[1]&&B[0]===this._oldSelectionEnd[0]&&B[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(A,B,W)):this._oldHasSelection&&this._fireOnSelectionChange(A,B,W)}_fireOnSelectionChange(A,B,W){this._oldSelectionStart=A,this._oldSelectionEnd=B,this._oldHasSelection=W,this._onSelectionChange.fire()}_handleBufferActivate(A){this.clearSelection(),this._trimListener.dispose(),this._trimListener=A.activeBuffer.lines.onTrim((B=>this._handleTrim(B)))}_convertViewportColToCharacterIndex(A,B){let W=B;for(let j=0;B>=j;j++){const F=A.loadCell(j,this._workCell).getChars().length;this._workCell.getWidth()===0?W--:F>1&&B!==j&&(W+=F-1)}return W}setSelection(A,B,W){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[A,B],this._model.selectionStartLength=W,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(A){this._isClickInSelection(A)||(this._selectWordAtCursor(A,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(A,B,W=!0,j=!0){if(A[0]>=this._bufferService.cols)return;const F=this._bufferService.buffer,H=F.lines.get(A[1]);if(!H)return;const Z=F.translateBufferLineToString(A[1],!1);let ee=this._convertViewportColToCharacterIndex(H,A[0]),P=ee;const V=A[0]-ee;let K=0,O=0,z=0,M=0;if(Z.charAt(ee)===" "){for(;ee>0&&Z.charAt(ee-1)===" ";)ee--;for(;P<Z.length&&Z.charAt(P+1)===" ";)P++}else{let ae=A[0],ce=A[0];H.getWidth(ae)===0&&(K++,ae--),H.getWidth(ce)===2&&(O++,ce++);const me=H.getString(ce).length;for(me>1&&(M+=me-1,P+=me-1);ae>0&&ee>0&&!this._isCharWordSeparator(H.loadCell(ae-1,this._workCell));){H.loadCell(ae-1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===0?(K++,ae--):Q>1&&(z+=Q-1,ee-=Q-1),ee--,ae--}for(;ce<H.length&&P+1<Z.length&&!this._isCharWordSeparator(H.loadCell(ce+1,this._workCell));){H.loadCell(ce+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(O++,ce++):Q>1&&(M+=Q-1,P+=Q-1),P++,ce++}}P++;let U=ee+V-K+z,Y=Math.min(this._bufferService.cols,P-ee+K+O-z-M);if(B||Z.slice(ee,P).trim()!==""){if(W&&U===0&&H.getCodePoint(0)!==32){const ae=F.lines.get(A[1]-1);if(ae&&H.isWrapped&&ae.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,A[1]-1],!1,!0,!1);if(ce){const me=this._bufferService.cols-ce.start;U-=me,Y+=me}}}if(j&&U+Y===this._bufferService.cols&&H.getCodePoint(this._bufferService.cols-1)!==32){const ae=F.lines.get(A[1]+1);if(ae?.isWrapped&&ae.getCodePoint(0)!==32){const ce=this._getWordAt([0,A[1]+1],!1,!1,!0);ce&&(Y+=ce.length)}}return{start:U,length:Y}}}_selectWordAt(A,B){const W=this._getWordAt(A,B);if(W){for(;W.start<0;)W.start+=this._bufferService.cols,A[1]--;this._model.selectionStart=[W.start,A[1]],this._model.selectionStartLength=W.length}}_selectToWordAt(A){const B=this._getWordAt(A,!0);if(B){let W=A[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(A){return A.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(A.getChars())>=0}_selectLineAt(A){const B=this._bufferService.buffer.getWrappedRangeForLine(A),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,_.getRangeLength)(W,this._bufferService.cols)}};c.SelectionService=D=h([g(3,x.IBufferService),g(4,x.ICoreService),g(5,T.IMouseService),g(6,x.IOptionsService),g(7,T.IRenderService),g(8,T.ICoreBrowserService)],D)},4725:(S,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(S,c,u){var h=this&&this.__decorate||function(D,A,B,W){var j,F=arguments.length,H=F<3?A:W===null?W=Object.getOwnPropertyDescriptor(A,B):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(D,A,B,W);else for(var Z=D.length-1;Z>=0;Z--)(j=D[Z])&&(H=(F<3?j(H):F>3?j(A,B,H):j(A,B))||H);return F>3&&H&&Object.defineProperty(A,B,H),H},g=this&&this.__param||function(D,A){return function(B,W){A(B,W,D)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const f=u(7239),C=u(8055),E=u(8460),T=u(844),w=u(2585),p=C.css.toColor("#ffffff"),b=C.css.toColor("#000000"),_=C.css.toColor("#ffffff"),m=C.css.toColor("#000000"),x={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")],A=[0,95,135,175,215,255];for(let B=0;B<216;B++){const W=A[B/36%6|0],j=A[B/6%6|0],F=A[B%6];D.push({css:C.channels.toCss(W,j,F),rgba:C.channels.toRgba(W,j,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 T.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 E.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:p,background:b,cursor:_,cursorAccent:m,selectionForeground:void 0,selectionBackgroundTransparent:x,selectionBackgroundOpaque:C.color.blend(b,x),selectionInactiveBackgroundTransparent:x,selectionInactiveBackgroundOpaque:C.color.blend(b,x),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 A=this._colors;if(A.foreground=k(D.foreground,p),A.background=k(D.background,b),A.cursor=k(D.cursor,_),A.cursorAccent=k(D.cursorAccent,m),A.selectionBackgroundTransparent=k(D.selectionBackground,x),A.selectionBackgroundOpaque=C.color.blend(A.background,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundTransparent=k(D.selectionInactiveBackground,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundOpaque=C.color.blend(A.background,A.selectionInactiveBackgroundTransparent),A.selectionForeground=D.selectionForeground?k(D.selectionForeground,C.NULL_COLOR):void 0,A.selectionForeground===C.NULL_COLOR&&(A.selectionForeground=void 0),C.color.isOpaque(A.selectionBackgroundTransparent)&&(A.selectionBackgroundTransparent=C.color.opacity(A.selectionBackgroundTransparent,.3)),C.color.isOpaque(A.selectionInactiveBackgroundTransparent)&&(A.selectionInactiveBackgroundTransparent=C.color.opacity(A.selectionInactiveBackgroundTransparent,.3)),A.ansi=c.DEFAULT_ANSI_COLORS.slice(),A.ansi[0]=k(D.black,c.DEFAULT_ANSI_COLORS[0]),A.ansi[1]=k(D.red,c.DEFAULT_ANSI_COLORS[1]),A.ansi[2]=k(D.green,c.DEFAULT_ANSI_COLORS[2]),A.ansi[3]=k(D.yellow,c.DEFAULT_ANSI_COLORS[3]),A.ansi[4]=k(D.blue,c.DEFAULT_ANSI_COLORS[4]),A.ansi[5]=k(D.magenta,c.DEFAULT_ANSI_COLORS[5]),A.ansi[6]=k(D.cyan,c.DEFAULT_ANSI_COLORS[6]),A.ansi[7]=k(D.white,c.DEFAULT_ANSI_COLORS[7]),A.ansi[8]=k(D.brightBlack,c.DEFAULT_ANSI_COLORS[8]),A.ansi[9]=k(D.brightRed,c.DEFAULT_ANSI_COLORS[9]),A.ansi[10]=k(D.brightGreen,c.DEFAULT_ANSI_COLORS[10]),A.ansi[11]=k(D.brightYellow,c.DEFAULT_ANSI_COLORS[11]),A.ansi[12]=k(D.brightBlue,c.DEFAULT_ANSI_COLORS[12]),A.ansi[13]=k(D.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),A.ansi[14]=k(D.brightCyan,c.DEFAULT_ANSI_COLORS[14]),A.ansi[15]=k(D.brightWhite,c.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const B=Math.min(A.ansi.length-16,D.extendedAnsi.length);for(let W=0;W<B;W++)A.ansi[W+16]=k(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 A=0;A<this._restoreColors.ansi.length;++A)this._colors.ansi[A]=this._restoreColors.ansi[A]}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 k(D,A){if(D!==void 0)try{return C.css.toColor(D)}catch{}return A}c.ThemeService=R=h([g(0,w.IOptionsService)],R)},6349:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const h=u(8460),g=u(844);class f extends g.Disposable{constructor(E){super(),this._maxLength=E,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(E){if(this._maxLength===E)return;const T=new Array(E);for(let w=0;w<Math.min(E,this.length);w++)T[w]=this._array[this._getCyclicIndex(w)];this._array=T,this._maxLength=E,this._startIndex=0}get length(){return this._length}set length(E){if(E>this._length)for(let T=this._length;T<E;T++)this._array[T]=void 0;this._length=E}get(E){return this._array[this._getCyclicIndex(E)]}set(E,T){this._array[this._getCyclicIndex(E)]=T}push(E){this._array[this._getCyclicIndex(this._length)]=E,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(E,T,...w){if(T){for(let p=E;p<this._length-T;p++)this._array[this._getCyclicIndex(p)]=this._array[this._getCyclicIndex(p+T)];this._length-=T,this.onDeleteEmitter.fire({index:E,amount:T})}for(let p=this._length-1;p>=E;p--)this._array[this._getCyclicIndex(p+w.length)]=this._array[this._getCyclicIndex(p)];for(let p=0;p<w.length;p++)this._array[this._getCyclicIndex(E+p)]=w[p];if(w.length&&this.onInsertEmitter.fire({index:E,amount:w.length}),this._length+w.length>this._maxLength){const p=this._length+w.length-this._maxLength;this._startIndex+=p,this._length=this._maxLength,this.onTrimEmitter.fire(p)}else this._length+=w.length}trimStart(E){E>this._length&&(E=this._length),this._startIndex+=E,this._length-=E,this.onTrimEmitter.fire(E)}shiftElements(E,T,w){if(!(T<=0)){if(E<0||E>=this._length)throw new Error("start argument out of range");if(E+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let b=T-1;b>=0;b--)this.set(E+b+w,this.get(E+b));const p=E+T+w-this._length;if(p>0)for(this._length+=p;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let p=0;p<T;p++)this.set(E+p+w,this.get(E+p))}}_getCyclicIndex(E){return(this._startIndex+E)%this._maxLength}}c.CircularList=f},1439:(S,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.clone=void 0,c.clone=function u(h,g=5){if(typeof h!="object")return h;const f=Array.isArray(h)?[]:{};for(const C in h)f[C]=g<=1?h[C]:h[C]&&u(h[C],g-1);return f}},8055:(S,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,g=0,f=0;var C,E,T,w,p;function b(m){const x=m.toString(16);return x.length<2?"0"+x:x}function _(m,x){return m<x?(x+.05)/(m+.05):(m+.05)/(x+.05)}c.NULL_COLOR={css:"#00000000",rgba:0},(function(m){m.toCss=function(x,R,k,D){return D!==void 0?`#${b(x)}${b(R)}${b(k)}${b(D)}`:`#${b(x)}${b(R)}${b(k)}`},m.toRgba=function(x,R,k,D=255){return(x<<24|R<<16|k<<8|D)>>>0},m.toColor=function(x,R,k,D){return{css:m.toCss(x,R,k,D),rgba:m.toRgba(x,R,k,D)}}})(C||(c.channels=C={})),(function(m){function x(R,k){return f=Math.round(255*k),[u,h,g]=p.toChannels(R.rgba),{css:C.toCss(u,h,g,f),rgba:C.toRgba(u,h,g,f)}}m.blend=function(R,k){if(f=(255&k.rgba)/255,f===1)return{css:k.css,rgba:k.rgba};const D=k.rgba>>24&255,A=k.rgba>>16&255,B=k.rgba>>8&255,W=R.rgba>>24&255,j=R.rgba>>16&255,F=R.rgba>>8&255;return u=W+Math.round((D-W)*f),h=j+Math.round((A-j)*f),g=F+Math.round((B-F)*f),{css:C.toCss(u,h,g),rgba:C.toRgba(u,h,g)}},m.isOpaque=function(R){return(255&R.rgba)==255},m.ensureContrastRatio=function(R,k,D){const A=p.ensureContrastRatio(R.rgba,k.rgba,D);if(A)return C.toColor(A>>24&255,A>>16&255,A>>8&255)},m.opaque=function(R){const k=(255|R.rgba)>>>0;return[u,h,g]=p.toChannels(k),{css:C.toCss(u,h,g),rgba:k}},m.opacity=x,m.multiplyOpacity=function(R,k){return f=255&R.rgba,x(R,f*k/255)},m.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(E||(c.color=E={})),(function(m){let x,R;try{const k=document.createElement("canvas");k.width=1,k.height=1;const D=k.getContext("2d",{willReadFrequently:!0});D&&(x=D,x.globalCompositeOperation="copy",R=x.createLinearGradient(0,0,1,1))}catch{}m.toColor=function(k){if(k.match(/#[\da-f]{3,8}/i))switch(k.length){case 4:return u=parseInt(k.slice(1,2).repeat(2),16),h=parseInt(k.slice(2,3).repeat(2),16),g=parseInt(k.slice(3,4).repeat(2),16),C.toColor(u,h,g);case 5:return u=parseInt(k.slice(1,2).repeat(2),16),h=parseInt(k.slice(2,3).repeat(2),16),g=parseInt(k.slice(3,4).repeat(2),16),f=parseInt(k.slice(4,5).repeat(2),16),C.toColor(u,h,g,f);case 7:return{css:k,rgba:(parseInt(k.slice(1),16)<<8|255)>>>0};case 9:return{css:k,rgba:parseInt(k.slice(1),16)>>>0}}const D=k.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]),g=parseInt(D[3]),f=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),C.toColor(u,h,g,f);if(!x||!R)throw new Error("css.toColor: Unsupported css format");if(x.fillStyle=R,x.fillStyle=k,typeof x.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(x.fillRect(0,0,1,1),[u,h,g,f]=x.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:C.toRgba(u,h,g,f),css:k}}})(T||(c.css=T={})),(function(m){function x(R,k,D){const A=R/255,B=k/255,W=D/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.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 x(R>>16&255,R>>8&255,255&R)},m.relativeLuminance2=x})(w||(c.rgb=w={})),(function(m){function x(k,D,A){const B=k>>24&255,W=k>>16&255,j=k>>8&255;let F=D>>24&255,H=D>>16&255,Z=D>>8&255,ee=_(w.relativeLuminance2(F,H,Z),w.relativeLuminance2(B,W,j));for(;ee<A&&(F>0||H>0||Z>0);)F-=Math.max(0,Math.ceil(.1*F)),H-=Math.max(0,Math.ceil(.1*H)),Z-=Math.max(0,Math.ceil(.1*Z)),ee=_(w.relativeLuminance2(F,H,Z),w.relativeLuminance2(B,W,j));return(F<<24|H<<16|Z<<8|255)>>>0}function R(k,D,A){const B=k>>24&255,W=k>>16&255,j=k>>8&255;let F=D>>24&255,H=D>>16&255,Z=D>>8&255,ee=_(w.relativeLuminance2(F,H,Z),w.relativeLuminance2(B,W,j));for(;ee<A&&(F<255||H<255||Z<255);)F=Math.min(255,F+Math.ceil(.1*(255-F))),H=Math.min(255,H+Math.ceil(.1*(255-H))),Z=Math.min(255,Z+Math.ceil(.1*(255-Z))),ee=_(w.relativeLuminance2(F,H,Z),w.relativeLuminance2(B,W,j));return(F<<24|H<<16|Z<<8|255)>>>0}m.blend=function(k,D){if(f=(255&D)/255,f===1)return D;const A=D>>24&255,B=D>>16&255,W=D>>8&255,j=k>>24&255,F=k>>16&255,H=k>>8&255;return u=j+Math.round((A-j)*f),h=F+Math.round((B-F)*f),g=H+Math.round((W-H)*f),C.toRgba(u,h,g)},m.ensureContrastRatio=function(k,D,A){const B=w.relativeLuminance(k>>8),W=w.relativeLuminance(D>>8);if(_(B,W)<A){if(W<B){const H=x(k,D,A),Z=_(B,w.relativeLuminance(H>>8));if(Z<A){const ee=R(k,D,A);return Z>_(B,w.relativeLuminance(ee>>8))?H:ee}return H}const j=R(k,D,A),F=_(B,w.relativeLuminance(j>>8));if(F<A){const H=x(k,D,A);return F>_(B,w.relativeLuminance(H>>8))?j:H}return j}},m.reduceLuminance=x,m.increaseLuminance=R,m.toChannels=function(k){return[k>>24&255,k>>16&255,k>>8&255,255&k]}})(p||(c.rgba=p={})),c.toPaddedHex=b,c.contrastRatio=_},8969:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const h=u(844),g=u(2585),f=u(4348),C=u(7866),E=u(744),T=u(7302),w=u(6975),p=u(8460),b=u(1753),_=u(1480),m=u(7994),x=u(9282),R=u(5435),k=u(5981),D=u(2660);let A=!1;class B extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new p.EventEmitter),this._onScroll.event((j=>{this._onScrollApi?.fire(j.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(j){for(const F in j)this.optionsService.options[F]=j[F]}constructor(j){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new p.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new p.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new T.OptionsService(j)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(E.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(C.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(_.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(m.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(g.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,p.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,p.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,p.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,p.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 k.WriteBuffer(((F,H)=>this._inputHandler.parse(F,H)))),this.register((0,p.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(j,F){this._writeBuffer.write(j,F)}writeSync(j,F){this._logService.logLevel<=g.LogLevelEnum.WARN&&!A&&(this._logService.warn("writeSync is unreliable and will be removed soon."),A=!0),this._writeBuffer.writeSync(j,F)}input(j,F=!0){this.coreService.triggerDataEvent(j,F)}resize(j,F){isNaN(j)||isNaN(F)||(j=Math.max(j,E.MINIMUM_COLS),F=Math.max(F,E.MINIMUM_ROWS),this._bufferService.resize(j,F))}scroll(j,F=!1){this._bufferService.scroll(j,F)}scrollLines(j,F,H){this._bufferService.scrollLines(j,F,H)}scrollPages(j){this.scrollLines(j*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(j){const F=j-this._bufferService.buffer.ydisp;F!==0&&this.scrollLines(F)}registerEscHandler(j,F){return this._inputHandler.registerEscHandler(j,F)}registerDcsHandler(j,F){return this._inputHandler.registerDcsHandler(j,F)}registerCsiHandler(j,F){return this._inputHandler.registerCsiHandler(j,F)}registerOscHandler(j,F){return this._inputHandler.registerOscHandler(j,F)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let j=!1;const F=this.optionsService.rawOptions.windowsPty;F&&F.buildNumber!==void 0&&F.buildNumber!==void 0?j=F.backend==="conpty"&&F.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(j=!0),j?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const j=[];j.push(this.onLineFeed(x.updateWindowsModeWrappedState.bind(null,this._bufferService))),j.push(this.registerCsiHandler({final:"H"},(()=>((0,x.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const F of j)F.dispose()}))}}}c.CoreTerminal=B},8460:(S,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 g=[];for(let f=0;f<this._listeners.length;f++)g.push(this._listeners[f]);for(let f=0;f<g.length;f++)g[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((g=>h.fire(g)))},c.runAndSubscribe=function(u,h){return h(void 0),u((g=>h(g)))}},5435:function(S,c,u){var h=this&&this.__decorate||function(K,O,z,M){var U,Y=arguments.length,ae=Y<3?O:M===null?M=Object.getOwnPropertyDescriptor(O,z):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ae=Reflect.decorate(K,O,z,M);else for(var ce=K.length-1;ce>=0;ce--)(U=K[ce])&&(ae=(Y<3?U(ae):Y>3?U(O,z,ae):U(O,z))||ae);return Y>3&&ae&&Object.defineProperty(O,z,ae),ae},g=this&&this.__param||function(K,O){return function(z,M){O(z,M,K)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const f=u(2584),C=u(7116),E=u(2015),T=u(844),w=u(482),p=u(8437),b=u(8460),_=u(643),m=u(511),x=u(3734),R=u(2585),k=u(1480),D=u(6242),A=u(6351),B=u(5941),W={"(":0,")":1,"*":2,"+":3,"-":1,".":2},j=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 H;(function(K){K[K.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",K[K.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(H||(c.WindowsOptionsReportType=H={}));let Z=0;class ee extends T.Disposable{getAttrData(){return this._curAttrData}constructor(O,z,M,U,Y,ae,ce,me,Q=new E.EscapeSequenceParser){super(),this._bufferService=O,this._charsetService=z,this._coreService=M,this._logService=U,this._optionsService=Y,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=p.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=p.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new b.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new b.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new b.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new b.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new b.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new b.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new b.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new b.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new b.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new b.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 P(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,_e)=>{this._logService.debug("Unknown OSC code: ",{identifier:$,action:oe,data:_e})})),this._parser.setDcsHandlerFallback((($,oe,_e)=>{oe==="HOOK"&&(_e=_e.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString($),action:oe,payload:_e})})),this._parser.setPrintHandler((($,oe,_e)=>this.print($,oe,_e))),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 A.DcsHandler((($,oe)=>this.requestStatusString($,oe))))}_preserveStack(O,z,M,U){this._parseStack.paused=!0,this._parseStack.cursorStartX=O,this._parseStack.cursorStartY=z,this._parseStack.decodedLength=M,this._parseStack.position=U}_logSlowResolvingAsync(O){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([O,new Promise(((z,M)=>setTimeout((()=>M("#SLOW_TIMEOUT")),5e3)))]).catch((z=>{if(z!=="#SLOW_TIMEOUT")throw z;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(O,z){let M,U=this._activeBuffer.x,Y=this._activeBuffer.y,ae=0;const ce=this._parseStack.paused;if(ce){if(M=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,z))return this._logSlowResolvingAsync(M),M;U=this._parseStack.cursorStartX,Y=this._parseStack.cursorStartY,this._parseStack.paused=!1,O.length>j&&(ae=this._parseStack.position+j)}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<j&&(this._parseBuffer=new Uint32Array(Math.min(O.length,j))),ce||this._dirtyRowTracker.clearRange(),O.length>j)for(let $=ae;$<O.length;$+=j){const oe=$+j<O.length?$+j:O.length,_e=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,_e))return this._preserveStack(U,Y,_e,$),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,Y,$,0),this._logSlowResolvingAsync(M),M}this._activeBuffer.x===U&&this._activeBuffer.y===Y||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,z,M){let U,Y;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 _e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&M-z>0&&_e.getWidth(this._activeBuffer.x-1)===2&&_e.setCellFromCodepoint(this._activeBuffer.x-1,0,1,oe);let Se=this._parser.precedingJoinState;for(let be=z;be<M;++be){if(U=O[be],U<127&&ae){const Ct=ae[String.fromCharCode(U)];Ct&&(U=Ct.charCodeAt(0))}const $e=this._unicodeService.charProperties(U,Se);Y=k.UnicodeService.extractWidth($e);const Pe=k.UnicodeService.extractShouldJoin($e),Ke=Pe?k.UnicodeService.extractWidth(Se):0;if(Se=$e,ce&&this._onA11yChar.fire((0,w.stringFromCodePoint)(U)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Y-Ke>me){if(Q){const Ct=_e;let Be=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),_e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ke>0&&_e instanceof p.BufferLine&&_e.copyCellsFrom(Ct,Be,0,Ke,!1);Be<me;)Ct.setCellFromCodepoint(Be++,0,1,oe)}else if(this._activeBuffer.x=me-1,Y===2)continue}if(Pe&&this._activeBuffer.x){const Ct=_e.getWidth(this._activeBuffer.x-1)?1:2;_e.addCodepointToCell(this._activeBuffer.x-Ct,U,Y);for(let Be=Y-Ke;--Be>=0;)_e.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}else if($&&(_e.insertCells(this._activeBuffer.x,Y-Ke,this._activeBuffer.getNullCell(oe)),_e.getWidth(me-1)===2&&_e.setCellFromCodepoint(me-1,_.NULL_CELL_CODE,_.NULL_CELL_WIDTH,oe)),_e.setCellFromCodepoint(this._activeBuffer.x++,U,Y,oe),Y>0)for(;--Y;)_e.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}this._parser.precedingJoinState=Se,this._activeBuffer.x<me&&M-z>0&&_e.getWidth(this._activeBuffer.x)===0&&!_e.hasContent(this._activeBuffer.x)&&_e.setCellFromCodepoint(this._activeBuffer.x,0,1,oe),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(O,z){return O.final!=="t"||O.prefix||O.intermediates?this._parser.registerCsiHandler(O,z):this._parser.registerCsiHandler(O,(M=>!F(M.params[0],this._optionsService.rawOptions.windowOptions)||z(M)))}registerDcsHandler(O,z){return this._parser.registerDcsHandler(O,new A.DcsHandler(z))}registerEscHandler(O,z){return this._parser.registerEscHandler(O,z)}registerOscHandler(O,z){return this._parser.registerOscHandler(O,new D.OscHandler(z))}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,z){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=O,this._activeBuffer.y=this._activeBuffer.scrollTop+z):(this._activeBuffer.x=O,this._activeBuffer.y=z),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(O,z){this._restrictCursor(),this._setCursor(this._activeBuffer.x+O,this._activeBuffer.y+z)}cursorUp(O){const z=this._activeBuffer.y-this._activeBuffer.scrollTop;return z>=0?this._moveCursor(0,-Math.min(z,O.params[0]||1)):this._moveCursor(0,-(O.params[0]||1)),!0}cursorDown(O){const z=this._activeBuffer.scrollBottom-this._activeBuffer.y;return z>=0?this._moveCursor(0,Math.min(z,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 z=O.params[0];return z===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:z===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(O){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let z=O.params[0]||1;for(;z--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(O){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let z=O.params[0]||1;for(;z--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(O){const z=O.params[0];return z===1&&(this._curAttrData.bg|=536870912),z!==2&&z!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(O,z,M,U=!1,Y=!1){const ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);ae.replaceCells(z,M,this._activeBuffer.getNullCell(this._eraseAttrData()),Y),U&&(ae.isWrapped=!1)}_resetBufferLine(O,z=!1){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);M&&(M.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),z),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+O),M.isWrapped=!1)}eraseInDisplay(O,z=!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,z);M<this._bufferService.rows;M++)this._resetBufferLine(M,z);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,z),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(M+1).isWrapped=!1);M--;)this._resetBufferLine(M,z);this._dirtyRowTracker.markDirty(0);break;case 2:for(M=this._bufferService.rows,this._dirtyRowTracker.markDirty(M-1);M--;)this._resetBufferLine(M,z);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,z=!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,z);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,z);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,z)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(O){this._restrictCursor();let z=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,Y=this._bufferService.rows-1+this._activeBuffer.ybase-U+1;for(;z--;)this._activeBuffer.lines.splice(Y-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 z=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;z--;)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 z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.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 z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.deleteCells(this._activeBuffer.x,O.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(O){let z=O.params[0]||1;for(;z--;)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 z=O.params[0]||1;for(;z--;)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(p.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 z=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,z,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 z=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,z,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 z=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,z,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 z=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,z,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(O){this._restrictCursor();const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.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 z=this._parser.precedingJoinState;if(!z)return!0;const M=O.params[0]||1,U=k.UnicodeService.extractWidth(z),Y=this._activeBuffer.x-U,ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Y),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 z=0;z<O.length;z++)switch(O.params[z]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(O){for(let z=0;z<O.length;z++)switch(O.params[z]){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 z=0;z<O.length;z++)switch(O.params[z]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(O){for(let z=0;z<O.length;z++)switch(O.params[z]){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[z]===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,z){const M=this._coreService.decPrivateModes,{activeProtocol:U,activeEncoding:Y}=this._coreMouseService,ae=this._coreService,{buffers:ce,cols:me}=this._bufferService,{active:Q,alt:$}=ce,oe=this._optionsService.rawOptions,_e=Pe=>Pe?1:2,Se=O.params[0];return be=Se,$e=z?Se===2?4:Se===4?_e(ae.modes.insertMode):Se===12?3:Se===20?_e(oe.convertEol):0:Se===1?_e(M.applicationCursorKeys):Se===3?oe.windowOptions.setWinLines?me===80?2:me===132?1:0:0:Se===6?_e(M.origin):Se===7?_e(M.wraparound):Se===8?3:Se===9?_e(U==="X10"):Se===12?_e(oe.cursorBlink):Se===25?_e(!ae.isCursorHidden):Se===45?_e(M.reverseWraparound):Se===66?_e(M.applicationKeypad):Se===67?4:Se===1e3?_e(U==="VT200"):Se===1002?_e(U==="DRAG"):Se===1003?_e(U==="ANY"):Se===1004?_e(M.sendFocus):Se===1005?4:Se===1006?_e(Y==="SGR"):Se===1015?4:Se===1016?_e(Y==="SGR_PIXELS"):Se===1048?1:Se===47||Se===1047||Se===1049?_e(Q===$):Se===2004?_e(M.bracketedPasteMode):0,ae.triggerDataEvent(`${f.C0.ESC}[${z?"":"?"}${be};${$e}$y`),!0;var be,$e}_updateAttrColor(O,z,M,U,Y){return z===2?(O|=50331648,O&=-16777216,O|=x.AttributeData.fromColorRGB([M,U,Y])):z===5&&(O&=-50331904,O|=33554432|255&M),O}_extractColor(O,z,M){const U=[0,0,-1,0,0,0];let Y=0,ae=0;do{if(U[ae+Y]=O.params[z+ae],O.hasSubParams(z+ae)){const ce=O.getSubParams(z+ae);let me=0;do U[1]===5&&(Y=1),U[ae+me+1+Y]=ce[me];while(++me<ce.length&&me+ae+1+Y<U.length);break}if(U[1]===5&&ae+Y>=2||U[1]===2&&ae+Y>=5)break;U[1]&&(Y=1)}while(++ae+z<O.length&&ae+Y<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,z){z.extended=z.extended.clone(),(!~O||O>5)&&(O=1),z.extended.underlineStyle=O,z.fg|=268435456,O===0&&(z.fg&=-268435457),z.updateExtended()}_processSGR0(O){O.fg=p.DEFAULT_ATTR_DATA.fg,O.bg=p.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 z=O.length;let M;const U=this._curAttrData;for(let Y=0;Y<z;Y++)M=O.params[Y],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(Y)?O.getSubParams(Y)[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&p.DEFAULT_ATTR_DATA.fg):M===49?(U.bg&=-67108864,U.bg|=16777215&p.DEFAULT_ATTR_DATA.bg):M===38||M===48||M===58?Y+=this._extractColor(O,Y,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&p.DEFAULT_ATTR_DATA.fg,U.bg&=-67108864,U.bg|=16777215&p.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 z=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${z};${M}R`)}return!0}deviceStatusPrivate(O){if(O.params[0]===6){const z=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${z};${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=p.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 z=O.params[0]||1;switch(z){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=z%2==1;return this._optionsService.options.cursorBlink=M,!0}setScrollRegion(O){const z=O.params[0]||1;let M;return(O.length<2||(M=O.params[1])>this._bufferService.rows||M===0)&&(M=this._bufferService.rows),M>z&&(this._activeBuffer.scrollTop=z-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 z=O.length>1?O.params[1]:0;switch(O.params[0]){case 14:z!==2&&this._onRequestWindowsOptionsReport.fire(H.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(H.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:z!==0&&z!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),z!==0&&z!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:z!==0&&z!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),z!==0&&z!==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 z=[],M=O.split(";");for(;M.length>1;){const U=M.shift(),Y=M.shift();if(/^\d+$/.exec(U)){const ae=parseInt(U);if(V(ae))if(Y==="?")z.push({type:0,index:ae});else{const ce=(0,B.parseColor)(Y);ce&&z.push({type:1,index:ae,color:ce})}}}return z.length&&this._onColor.fire(z),!0}setHyperlink(O){const z=O.split(";");return!(z.length<2)&&(z[1]?this._createHyperlink(z[0],z[1]):!z[0]&&this._finishHyperlink())}_createHyperlink(O,z){this._getCurrentLinkId()&&this._finishHyperlink();const M=O.split(":");let U;const Y=M.findIndex((ae=>ae.startsWith("id=")));return Y!==-1&&(U=M[Y].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:U,uri:z}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(O,z){const M=O.split(";");for(let U=0;U<M.length&&!(z>=this._specialColors.length);++U,++z)if(M[U]==="?")this._onColor.fire([{type:0,index:this._specialColors[z]}]);else{const Y=(0,B.parseColor)(M[U]);Y&&this._onColor.fire([{type:1,index:this._specialColors[z],color:Y}])}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 z=[],M=O.split(";");for(let U=0;U<M.length;++U)if(/^\d+$/.exec(M[U])){const Y=parseInt(M[U]);V(Y)&&z.push({type:2,index:Y})}return z.length&&this._onColor.fire(z),!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=p.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=p.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 z=0;z<this._bufferService.rows;++z){const M=this._activeBuffer.ybase+this._activeBuffer.y+z,U=this._activeBuffer.lines.get(M);U&&(U.fill(O),U.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(O,z){const M=this._bufferService.buffer,U=this._optionsService.rawOptions;return(Y=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${Y}${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,z){this._dirtyRowTracker.markRangeDirty(O,z)}}c.InputHandler=ee;let P=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 V(K){return 0<=K&&K<256}P=h([g(0,R.IBufferService)],P)},844:(S,c)=>{function u(h){for(const g of h)g.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 g=this._disposables.indexOf(h);g!==-1&&this._disposables.splice(g,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:(S,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FourKeyMap=c.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(g,f,C){this._data[g]||(this._data[g]={}),this._data[g][f]=C}get(g,f){return this._data[g]?this._data[g][f]:void 0}clear(){this._data={}}}c.TwoKeyMap=u,c.FourKeyMap=class{constructor(){this._data=new u}set(h,g,f,C,E){this._data.get(h,g)||this._data.set(h,g,new u),this._data.get(h,g).set(f,C,E)}get(h,g,f,C){return this._data.get(h,g)?.get(f,C)}clear(){this._data.clear()}}},6114:(S,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 g=u.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[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:(S,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 g=this._getKey(h);if(g===void 0||(u=this._search(g),u===-1)||this._getKey(this._array[u])!==g)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])===g);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,g){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do g(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===h)}values(){return[...this._array].values()}_search(h){let g=0,f=this._array.length-1;for(;f>=g;){let C=g+f>>1;const E=this._getKey(this._array[C]);if(E>h)f=C-1;else{if(!(E<h)){for(;C>0&&this._getKey(this._array[C-1])===h;)C--;return C}g=C+1}}return g}}},7226:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DebouncedIdleTask=c.IdleTaskQueue=c.PriorityTaskQueue=void 0;const h=u(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(E){this._tasks.push(E),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(E){this._idleCallback=void 0;let T=0,w=0,p=E.timeRemaining(),b=0;for(;this._i<this._tasks.length;){if(T=Date.now(),this._tasks[this._i]()||this._i++,T=Math.max(1,Date.now()-T),w=Math.max(T,w),b=E.timeRemaining(),1.5*w>b)return p-T<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(p-T))}ms`),void this._start();p=b}this.clear()}}class f extends g{_requestCallback(E){return setTimeout((()=>E(this._createDeadline(16))))}_cancelCallback(E){clearTimeout(E)}_createDeadline(E){const T=Date.now()+E;return{timeRemaining:()=>Math.max(0,T-Date.now())}}}c.PriorityTaskQueue=f,c.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends g{_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:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;const h=u(643);c.updateWindowsModeWrappedState=function(g){const f=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),C=f?.get(g.cols-1),E=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);E&&C&&(E.isWrapped=C[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&C[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(S,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:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Buffer=c.MAX_BUFFER_SIZE=void 0;const h=u(6349),g=u(7226),f=u(3734),C=u(8437),E=u(4634),T=u(511),w=u(643),p=u(4863),b=u(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(_,m,x){this._hasScrollback=_,this._optionsService=m,this._bufferService=x,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=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=T.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=T.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.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(_){return _?(this._nullCell.fg=_.fg,this._nullCell.bg=_.bg,this._nullCell.extended=_.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(_){return _?(this._whitespaceCell.fg=_.fg,this._whitespaceCell.bg=_.bg,this._whitespaceCell.extended=_.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(_,m){return new C.BufferLine(this._bufferService.cols,this.getNullCell(_),m)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const _=this.ybase+this.y-this.ydisp;return _>=0&&_<this._rows}_getCorrectBufferLength(_){if(!this._hasScrollback)return _;const m=_+this._optionsService.rawOptions.scrollback;return m>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:m}fillViewportRows(_){if(this.lines.length===0){_===void 0&&(_=C.DEFAULT_ATTR_DATA);let m=this._rows;for(;m--;)this.lines.push(this.getBlankLine(_))}}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(_,m){const x=this.getNullCell(C.DEFAULT_ATTR_DATA);let R=0;const k=this._getCorrectBufferLength(m);if(k>this.lines.maxLength&&(this.lines.maxLength=k),this.lines.length>0){if(this._cols<_)for(let A=0;A<this.lines.length;A++)R+=+this.lines.get(A).resize(_,x);let D=0;if(this._rows<m)for(let A=this._rows;A<m;A++)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(_,x)):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(_,x)));else for(let A=this._rows;A>m;A--)this.lines.length>m+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(k<this.lines.maxLength){const A=this.lines.length-k;A>0&&(this.lines.trimStart(A),this.ybase=Math.max(this.ybase-A,0),this.ydisp=Math.max(this.ydisp-A,0),this.savedY=Math.max(this.savedY-A,0)),this.lines.maxLength=k}this.x=Math.min(this.x,_-1),this.y=Math.min(this.y,m-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,_-1),this.scrollTop=0}if(this.scrollBottom=m-1,this._isReflowEnabled&&(this._reflow(_,m),this._cols>_))for(let D=0;D<this.lines.length;D++)R+=+this.lines.get(D).resize(_,x);this._cols=_,this._rows=m,this._memoryCleanupQueue.clear(),R>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let _=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,_=!1);let m=0;for(;this._memoryCleanupPosition<this.lines.length;)if(m+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),m>100)return!0;return _}get _isReflowEnabled(){const _=this._optionsService.rawOptions.windowsPty;return _&&_.buildNumber?this._hasScrollback&&_.backend==="conpty"&&_.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(_,m){this._cols!==_&&(_>this._cols?this._reflowLarger(_,m):this._reflowSmaller(_,m))}_reflowLarger(_,m){const x=(0,E.reflowLargerGetLinesToRemove)(this.lines,this._cols,_,this.ybase+this.y,this.getNullCell(C.DEFAULT_ATTR_DATA));if(x.length>0){const R=(0,E.reflowLargerCreateNewLayout)(this.lines,x);(0,E.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(_,m,R.countRemoved)}}_reflowLargerAdjustViewport(_,m,x){const R=this.getNullCell(C.DEFAULT_ATTR_DATA);let k=x;for(;k-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<m&&this.lines.push(new C.BufferLine(_,R))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-x,0)}_reflowSmaller(_,m){const x=this.getNullCell(C.DEFAULT_ATTR_DATA),R=[];let k=0;for(let D=this.lines.length-1;D>=0;D--){let A=this.lines.get(D);if(!A||!A.isWrapped&&A.getTrimmedLength()<=_)continue;const B=[A];for(;A.isWrapped&&D>0;)A=this.lines.get(--D),B.unshift(A);const W=this.ybase+this.y;if(W>=D&&W<D+B.length)continue;const j=B[B.length-1].getTrimmedLength(),F=(0,E.reflowSmallerGetNewLineLengths)(B,this._cols,_),H=F.length-B.length;let Z;Z=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+H):Math.max(0,this.lines.length-this.lines.maxLength+H);const ee=[];for(let M=0;M<H;M++){const U=this.getBlankLine(C.DEFAULT_ATTR_DATA,!0);ee.push(U)}ee.length>0&&(R.push({start:D+B.length+k,newLines:ee}),k+=ee.length),B.push(...ee);let P=F.length-1,V=F[P];V===0&&(P--,V=F[P]);let K=B.length-H-1,O=j;for(;K>=0;){const M=Math.min(O,V);if(B[P]===void 0)break;if(B[P].copyCellsFrom(B[K],O-M,V-M,M,!0),V-=M,V===0&&(P--,V=F[P]),O-=M,O===0){K--;const U=Math.max(K,0);O=(0,E.getWrappedLineTrimmedLength)(B,U,this._cols)}}for(let M=0;M<B.length;M++)F[M]<_&&B[M].setCell(F[M],x);let z=H-Z;for(;z-- >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+k)-m&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+H,this.ybase+m-1)}if(R.length>0){const D=[],A=[];for(let P=0;P<this.lines.length;P++)A.push(this.lines.get(P));const B=this.lines.length;let W=B-1,j=0,F=R[j];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+k);let H=0;for(let P=Math.min(this.lines.maxLength-1,B+k-1);P>=0;P--)if(F&&F.start>W+H){for(let V=F.newLines.length-1;V>=0;V--)this.lines.set(P--,F.newLines[V]);P++,D.push({index:W+1,amount:F.newLines.length}),H+=F.newLines.length,F=R[++j]}else this.lines.set(P,A[W--]);let Z=0;for(let P=D.length-1;P>=0;P--)D[P].index+=Z,this.lines.onInsertEmitter.fire(D[P]),Z+=D[P].amount;const ee=Math.max(0,B+k-this.lines.maxLength);ee>0&&this.lines.onTrimEmitter.fire(ee)}}translateBufferLineToString(_,m,x=0,R){const k=this.lines.get(_);return k?k.translateToString(m,x,R):""}getWrappedRangeForLine(_){let m=_,x=_;for(;m>0&&this.lines.get(m).isWrapped;)m--;for(;x+1<this.lines.length&&this.lines.get(x+1).isWrapped;)x++;return{first:m,last:x}}setupTabStops(_){for(_!=null?this.tabs[_]||(_=this.prevStop(_)):(this.tabs={},_=0);_<this._cols;_+=this._optionsService.rawOptions.tabStopWidth)this.tabs[_]=!0}prevStop(_){for(_==null&&(_=this.x);!this.tabs[--_]&&_>0;);return _>=this._cols?this._cols-1:_<0?0:_}nextStop(_){for(_==null&&(_=this.x);!this.tabs[++_]&&_<this._cols;);return _>=this._cols?this._cols-1:_<0?0:_}clearMarkers(_){this._isClearing=!0;for(let m=0;m<this.markers.length;m++)this.markers[m].line===_&&(this.markers[m].dispose(),this.markers.splice(m--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let _=0;_<this.markers.length;_++)this.markers[_].dispose(),this.markers.splice(_--,1);this._isClearing=!1}addMarker(_){const m=new p.Marker(_);return this.markers.push(m),m.register(this.lines.onTrim((x=>{m.line-=x,m.line<0&&m.dispose()}))),m.register(this.lines.onInsert((x=>{m.line>=x.index&&(m.line+=x.amount)}))),m.register(this.lines.onDelete((x=>{m.line>=x.index&&m.line<x.index+x.amount&&m.dispose(),m.line>x.index&&(m.line-=x.amount)}))),m.register(m.onDispose((()=>this._removeMarker(m)))),m}_removeMarker(_){this._isClearing||this.markers.splice(this.markers.indexOf(_),1)}}},8437:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const h=u(3734),g=u(511),f=u(643),C=u(482);c.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let E=0;class T{constructor(p,b,_=!1){this.isWrapped=_,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*p);const m=b||g.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let x=0;x<p;++x)this.setCell(x,m);this.length=p}get(p){const b=this._data[3*p+0],_=2097151&b;return[this._data[3*p+1],2097152&b?this._combined[p]:_?(0,C.stringFromCodePoint)(_):"",b>>22,2097152&b?this._combined[p].charCodeAt(this._combined[p].length-1):_]}set(p,b){this._data[3*p+1]=b[f.CHAR_DATA_ATTR_INDEX],b[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[p]=b[1],this._data[3*p+0]=2097152|p|b[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*p+0]=b[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(p){return this._data[3*p+0]>>22}hasWidth(p){return 12582912&this._data[3*p+0]}getFg(p){return this._data[3*p+1]}getBg(p){return this._data[3*p+2]}hasContent(p){return 4194303&this._data[3*p+0]}getCodePoint(p){const b=this._data[3*p+0];return 2097152&b?this._combined[p].charCodeAt(this._combined[p].length-1):2097151&b}isCombined(p){return 2097152&this._data[3*p+0]}getString(p){const b=this._data[3*p+0];return 2097152&b?this._combined[p]:2097151&b?(0,C.stringFromCodePoint)(2097151&b):""}isProtected(p){return 536870912&this._data[3*p+2]}loadCell(p,b){return E=3*p,b.content=this._data[E+0],b.fg=this._data[E+1],b.bg=this._data[E+2],2097152&b.content&&(b.combinedData=this._combined[p]),268435456&b.bg&&(b.extended=this._extendedAttrs[p]),b}setCell(p,b){2097152&b.content&&(this._combined[p]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[p]=b.extended),this._data[3*p+0]=b.content,this._data[3*p+1]=b.fg,this._data[3*p+2]=b.bg}setCellFromCodepoint(p,b,_,m){268435456&m.bg&&(this._extendedAttrs[p]=m.extended),this._data[3*p+0]=b|_<<22,this._data[3*p+1]=m.fg,this._data[3*p+2]=m.bg}addCodepointToCell(p,b,_){let m=this._data[3*p+0];2097152&m?this._combined[p]+=(0,C.stringFromCodePoint)(b):2097151&m?(this._combined[p]=(0,C.stringFromCodePoint)(2097151&m)+(0,C.stringFromCodePoint)(b),m&=-2097152,m|=2097152):m=b|4194304,_&&(m&=-12582913,m|=_<<22),this._data[3*p+0]=m}insertCells(p,b,_){if((p%=this.length)&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,_),b<this.length-p){const m=new g.CellData;for(let x=this.length-p-b-1;x>=0;--x)this.setCell(p+b+x,this.loadCell(p+x,m));for(let x=0;x<b;++x)this.setCell(p+x,_)}else for(let m=p;m<this.length;++m)this.setCell(m,_);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,_)}deleteCells(p,b,_){if(p%=this.length,b<this.length-p){const m=new g.CellData;for(let x=0;x<this.length-p-b;++x)this.setCell(p+x,this.loadCell(p+b+x,m));for(let x=this.length-b;x<this.length;++x)this.setCell(x,_)}else for(let m=p;m<this.length;++m)this.setCell(m,_);p&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,_),this.getWidth(p)!==0||this.hasContent(p)||this.setCellFromCodepoint(p,0,1,_)}replaceCells(p,b,_,m=!1){if(m)for(p&&this.getWidth(p-1)===2&&!this.isProtected(p-1)&&this.setCellFromCodepoint(p-1,0,1,_),b<this.length&&this.getWidth(b-1)===2&&!this.isProtected(b)&&this.setCellFromCodepoint(b,0,1,_);p<b&&p<this.length;)this.isProtected(p)||this.setCell(p,_),p++;else for(p&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,_),b<this.length&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b,0,1,_);p<b&&p<this.length;)this.setCell(p++,_)}resize(p,b){if(p===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const _=3*p;if(p>this.length){if(this._data.buffer.byteLength>=4*_)this._data=new Uint32Array(this._data.buffer,0,_);else{const m=new Uint32Array(_);m.set(this._data),this._data=m}for(let m=this.length;m<p;++m)this.setCell(m,b)}else{this._data=this._data.subarray(0,_);const m=Object.keys(this._combined);for(let R=0;R<m.length;R++){const k=parseInt(m[R],10);k>=p&&delete this._combined[k]}const x=Object.keys(this._extendedAttrs);for(let R=0;R<x.length;R++){const k=parseInt(x[R],10);k>=p&&delete this._extendedAttrs[k]}}return this.length=p,4*_*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const p=new Uint32Array(this._data.length);return p.set(this._data),this._data=p,1}return 0}fill(p,b=!1){if(b)for(let _=0;_<this.length;++_)this.isProtected(_)||this.setCell(_,p);else{this._combined={},this._extendedAttrs={};for(let _=0;_<this.length;++_)this.setCell(_,p)}}copyFrom(p){this.length!==p.length?this._data=new Uint32Array(p._data):this._data.set(p._data),this.length=p.length,this._combined={};for(const b in p._combined)this._combined[b]=p._combined[b];this._extendedAttrs={};for(const b in p._extendedAttrs)this._extendedAttrs[b]=p._extendedAttrs[b];this.isWrapped=p.isWrapped}clone(){const p=new T(0);p._data=new Uint32Array(this._data),p.length=this.length;for(const b in this._combined)p._combined[b]=this._combined[b];for(const b in this._extendedAttrs)p._extendedAttrs[b]=this._extendedAttrs[b];return p.isWrapped=this.isWrapped,p}getTrimmedLength(){for(let p=this.length-1;p>=0;--p)if(4194303&this._data[3*p+0])return p+(this._data[3*p+0]>>22);return 0}getNoBgTrimmedLength(){for(let p=this.length-1;p>=0;--p)if(4194303&this._data[3*p+0]||50331648&this._data[3*p+2])return p+(this._data[3*p+0]>>22);return 0}copyCellsFrom(p,b,_,m,x){const R=p._data;if(x)for(let D=m-1;D>=0;D--){for(let A=0;A<3;A++)this._data[3*(_+D)+A]=R[3*(b+D)+A];268435456&R[3*(b+D)+2]&&(this._extendedAttrs[_+D]=p._extendedAttrs[b+D])}else for(let D=0;D<m;D++){for(let A=0;A<3;A++)this._data[3*(_+D)+A]=R[3*(b+D)+A];268435456&R[3*(b+D)+2]&&(this._extendedAttrs[_+D]=p._extendedAttrs[b+D])}const k=Object.keys(p._combined);for(let D=0;D<k.length;D++){const A=parseInt(k[D],10);A>=b&&(this._combined[A-b+_]=p._combined[A])}}translateToString(p,b,_,m){b=b??0,_=_??this.length,p&&(_=Math.min(_,this.getTrimmedLength())),m&&(m.length=0);let x="";for(;b<_;){const R=this._data[3*b+0],k=2097151&R,D=2097152&R?this._combined[b]:k?(0,C.stringFromCodePoint)(k):f.WHITESPACE_CELL_CHAR;if(x+=D,m)for(let A=0;A<D.length;++A)m.push(b);b+=R>>22||1}return m&&m.push(b),x}}c.BufferLine=T},4841:(S,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:(S,c)=>{function u(h,g,f){if(g===h.length-1)return h[g].getTrimmedLength();const C=!h[g].hasContent(f-1)&&h[g].getWidth(f-1)===1,E=h[g+1].getWidth(0)===2;return C&&E?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,g,f,C,E){const T=[];for(let w=0;w<h.length-1;w++){let p=w,b=h.get(++p);if(!b.isWrapped)continue;const _=[h.get(w)];for(;p<h.length&&b.isWrapped;)_.push(b),b=h.get(++p);if(C>=w&&C<p){w+=_.length-1;continue}let m=0,x=u(_,m,g),R=1,k=0;for(;R<_.length;){const A=u(_,R,g),B=A-k,W=f-x,j=Math.min(B,W);_[m].copyCellsFrom(_[R],k,x,j,!1),x+=j,x===f&&(m++,x=0),k+=j,k===A&&(R++,k=0),x===0&&m!==0&&_[m-1].getWidth(f-1)===2&&(_[m].copyCellsFrom(_[m-1],f-1,x++,1,!1),_[m-1].setCell(f-1,E))}_[m].replaceCells(x,f,E);let D=0;for(let A=_.length-1;A>0&&(A>m||_[A].getTrimmedLength()===0);A--)D++;D>0&&(T.push(w+_.length-D),T.push(D)),w+=_.length-1}return T},c.reflowLargerCreateNewLayout=function(h,g){const f=[];let C=0,E=g[C],T=0;for(let w=0;w<h.length;w++)if(E===w){const p=g[++C];h.onDeleteEmitter.fire({index:w-T,amount:p}),w+=p-1,T+=p,E=g[++C]}else f.push(w);return{layout:f,countRemoved:T}},c.reflowLargerApplyNewLayout=function(h,g){const f=[];for(let C=0;C<g.length;C++)f.push(h.get(g[C]));for(let C=0;C<f.length;C++)h.set(C,f[C]);h.length=g.length},c.reflowSmallerGetNewLineLengths=function(h,g,f){const C=[],E=h.map(((b,_)=>u(h,_,g))).reduce(((b,_)=>b+_));let T=0,w=0,p=0;for(;p<E;){if(E-p<f){C.push(E-p);break}T+=f;const b=u(h,w,g);T>b&&(T-=b,w++);const _=h[w].getWidth(T-1)===2;_&&T--;const m=_?f-1:f;C.push(m),p+=m}return C},c.getWrappedLineTrimmedLength=u},5295:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const h=u(8460),g=u(844),f=u(9092);class C extends g.Disposable{constructor(T,w){super(),this._optionsService=T,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(T){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(T),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(T,w){this._normal.resize(T,w),this._alt.resize(T,w),this.setupTabStops(T)}setupTabStops(T){this._normal.setupTabStops(T),this._alt.setupTabStops(T)}}c.BufferSet=C},511:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CellData=void 0;const h=u(482),g=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(T){const w=new C;return w.setFromCharData(T),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(T){this.fg=T[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(T[g.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(T[g.CHAR_DATA_CHAR_INDEX].length===2){const p=T[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=p&&p<=56319){const b=T[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(p-55296)+b-56320+65536|T[g.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=T[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|T[g.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=T[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|T[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.CellData=C},643:(S,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:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;const h=u(8460),g=u(844);class f{get id(){return this._id}constructor(E){this.line=E,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,g.disposeArray)(this._disposables),this._disposables.length=0)}register(E){return this._disposables.push(E),E}}c.Marker=f,f._nextId=1},7116:(S,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:(S,c)=>{var u,h,g;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}\\`})(g||(c.C1_ESCAPED=g={}))},7399:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.evaluateKeyboardEvent=void 0;const h=u(2584),g={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,E,T){const w={type:0,cancel:!1,key:void 0},p=(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;p?(w.key=h.C0.ESC+"[1;"+(p+1)+"D",w.key===h.C0.ESC+"[1;3D"&&(w.key=h.C0.ESC+(E?"b":"[1;5D"))):w.key=C?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(f.metaKey)break;p?(w.key=h.C0.ESC+"[1;"+(p+1)+"C",w.key===h.C0.ESC+"[1;3C"&&(w.key=h.C0.ESC+(E?"f":"[1;5C"))):w.key=C?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(f.metaKey)break;p?(w.key=h.C0.ESC+"[1;"+(p+1)+"A",E||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;p?(w.key=h.C0.ESC+"[1;"+(p+1)+"B",E||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=p?h.C0.ESC+"[3;"+(p+1)+"~":h.C0.ESC+"[3~";break;case 36:w.key=p?h.C0.ESC+"[1;"+(p+1)+"H":C?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:w.key=p?h.C0.ESC+"[1;"+(p+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;"+(p+1)+"~":w.key=h.C0.ESC+"[5~";break;case 34:f.shiftKey?w.type=3:f.ctrlKey?w.key=h.C0.ESC+"[6;"+(p+1)+"~":w.key=h.C0.ESC+"[6~";break;case 112:w.key=p?h.C0.ESC+"[1;"+(p+1)+"P":h.C0.ESC+"OP";break;case 113:w.key=p?h.C0.ESC+"[1;"+(p+1)+"Q":h.C0.ESC+"OQ";break;case 114:w.key=p?h.C0.ESC+"[1;"+(p+1)+"R":h.C0.ESC+"OR";break;case 115:w.key=p?h.C0.ESC+"[1;"+(p+1)+"S":h.C0.ESC+"OS";break;case 116:w.key=p?h.C0.ESC+"[15;"+(p+1)+"~":h.C0.ESC+"[15~";break;case 117:w.key=p?h.C0.ESC+"[17;"+(p+1)+"~":h.C0.ESC+"[17~";break;case 118:w.key=p?h.C0.ESC+"[18;"+(p+1)+"~":h.C0.ESC+"[18~";break;case 119:w.key=p?h.C0.ESC+"[19;"+(p+1)+"~":h.C0.ESC+"[19~";break;case 120:w.key=p?h.C0.ESC+"[20;"+(p+1)+"~":h.C0.ESC+"[20~";break;case 121:w.key=p?h.C0.ESC+"[21;"+(p+1)+"~":h.C0.ESC+"[21~";break;case 122:w.key=p?h.C0.ESC+"[23;"+(p+1)+"~":h.C0.ESC+"[23~";break;case 123:w.key=p?h.C0.ESC+"[24;"+(p+1)+"~":h.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(E&&!T||!f.altKey||f.metaKey)!E||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 b=g[f.keyCode],_=b?.[f.shiftKey?1:0];if(_)w.key=h.C0.ESC+_;else if(f.keyCode>=65&&f.keyCode<=90){const m=f.ctrlKey?f.keyCode-64:f.keyCode+32;let x=String.fromCharCode(m);f.shiftKey&&(x=x.toUpperCase()),w.key=h.C0.ESC+x}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:(S,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,g=u.length){let f="";for(let C=h;C<g;++C){let E=u[C];E>65535?(E-=65536,f+=String.fromCharCode(55296+(E>>10))+String.fromCharCode(E%1024+56320)):f+=String.fromCharCode(E)}return f},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,h){const g=u.length;if(!g)return 0;let f=0,C=0;if(this._interim){const E=u.charCodeAt(C++);56320<=E&&E<=57343?h[f++]=1024*(this._interim-55296)+E-56320+65536:(h[f++]=this._interim,h[f++]=E),this._interim=0}for(let E=C;E<g;++E){const T=u.charCodeAt(E);if(55296<=T&&T<=56319){if(++E>=g)return this._interim=T,f;const w=u.charCodeAt(E);56320<=w&&w<=57343?h[f++]=1024*(T-55296)+w-56320+65536:(h[f++]=T,h[f++]=w)}else T!==65279&&(h[f++]=T)}return f}},c.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,h){const g=u.length;if(!g)return 0;let f,C,E,T,w=0,p=0,b=0;if(this.interim[0]){let x=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let k,D=0;for(;(k=63&this.interim[++D])&&D<4;)R<<=6,R|=k;const A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,B=A-D;for(;b<B;){if(b>=g)return 0;if(k=u[b++],(192&k)!=128){b--,x=!0;break}this.interim[D++]=k,R<<=6,R|=63&k}x||(A===2?R<128?b--:h[w++]=R:A===3?R<2048||R>=55296&&R<=57343||R===65279||(h[w++]=R):R<65536||R>1114111||(h[w++]=R)),this.interim.fill(0)}const _=g-4;let m=b;for(;m<g;){for(;!(!(m<_)||128&(f=u[m])||128&(C=u[m+1])||128&(E=u[m+2])||128&(T=u[m+3]));)h[w++]=f,h[w++]=C,h[w++]=E,h[w++]=T,m+=4;if(f=u[m++],f<128)h[w++]=f;else if((224&f)==192){if(m>=g)return this.interim[0]=f,w;if(C=u[m++],(192&C)!=128){m--;continue}if(p=(31&f)<<6|63&C,p<128){m--;continue}h[w++]=p}else if((240&f)==224){if(m>=g)return this.interim[0]=f,w;if(C=u[m++],(192&C)!=128){m--;continue}if(m>=g)return this.interim[0]=f,this.interim[1]=C,w;if(E=u[m++],(192&E)!=128){m--;continue}if(p=(15&f)<<12|(63&C)<<6|63&E,p<2048||p>=55296&&p<=57343||p===65279)continue;h[w++]=p}else if((248&f)==240){if(m>=g)return this.interim[0]=f,w;if(C=u[m++],(192&C)!=128){m--;continue}if(m>=g)return this.interim[0]=f,this.interim[1]=C,w;if(E=u[m++],(192&E)!=128){m--;continue}if(m>=g)return this.interim[0]=f,this.interim[1]=C,this.interim[2]=E,w;if(T=u[m++],(192&T)!=128){m--;continue}if(p=(7&f)<<18|(63&C)<<12|(63&E)<<6|63&T,p<65536||p>1114111)continue;h[w++]=p}}return w}}},225:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const h=u(1480),g=[[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 E=0;E<g.length;++E)C.fill(0,g[E][0],g[E][1]+1)}}wcwidth(E){return E<32?0:E<127?1:E<65536?C[E]:(function(T,w){let p,b=0,_=w.length-1;if(T<w[0][0]||T>w[_][1])return!1;for(;_>=b;)if(p=b+_>>1,T>w[p][1])b=p+1;else{if(!(T<w[p][0]))return!0;_=p-1}return!1})(E,f)?0:E>=131072&&E<=196605||E>=196608&&E<=262141?2:1}charProperties(E,T){let w=this.wcwidth(E),p=w===0&&T!==0;if(p){const b=h.UnicodeService.extractWidth(T);b===0?p=!1:b>w&&(w=b)}return h.UnicodeService.createPropertyValue(0,w,p)}}},5981:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const h=u(8460),g=u(844);class f extends g.Disposable{constructor(E){super(),this._action=E,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(E,T){if(T!==void 0&&this._syncCalls>T)return void(this._syncCalls=0);if(this._pendingData+=E.length,this._writeBuffer.push(E),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const p=this._callbacks.shift();p&&p()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(E,T){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+=E.length,this._writeBuffer.push(E),this._callbacks.push(T),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=E.length,this._writeBuffer.push(E),this._callbacks.push(T)}_innerWrite(E=0,T=!0){const w=E||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const p=this._writeBuffer[this._bufferOffset],b=this._action(p,T);if(b){const m=x=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,x))):this._innerWrite(w,x);return void b.catch((x=>(queueMicrotask((()=>{throw x})),Promise.resolve(!1)))).then(m)}const _=this._callbacks[this._bufferOffset];if(_&&_(),this._bufferOffset++,this._pendingData-=p.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:(S,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 g(f,C){const E=f.toString(16),T=E.length<2?"0"+E:E;switch(C){case 4:return E[0];case 8:return T;case 12:return(T+T).slice(0,3);default:return T+T}}c.parseColor=function(f){if(!f)return;let C=f.toLowerCase();if(C.indexOf("rgb:")===0){C=C.slice(4);const E=u.exec(C);if(E){const T=E[1]?15:E[4]?255:E[7]?4095:65535;return[Math.round(parseInt(E[1]||E[4]||E[7]||E[10],16)/T*255),Math.round(parseInt(E[2]||E[5]||E[8]||E[11],16)/T*255),Math.round(parseInt(E[3]||E[6]||E[9]||E[12],16)/T*255)]}}else if(C.indexOf("#")===0&&(C=C.slice(1),h.exec(C)&&[3,6,9,12].includes(C.length))){const E=C.length/3,T=[0,0,0];for(let w=0;w<3;++w){const p=parseInt(C.slice(E*w,E*w+E),16);T[w]=E===1?p<<4:E===2?p:E===3?p>>4:p>>8}return T}},c.toRgbString=function(f,C=16){const[E,T,w]=f;return`rgb:${g(E,C)}/${g(T,C)}/${g(w,C)}`}},5770:(S,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},6351:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;const h=u(482),g=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(T,w){this._handlers[T]===void 0&&(this._handlers[T]=[]);const p=this._handlers[T];return p.push(w),{dispose:()=>{const b=p.indexOf(w);b!==-1&&p.splice(b,1)}}}clearHandler(T){this._handlers[T]&&delete this._handlers[T]}setHandlerFallback(T){this._handlerFb=T}reset(){if(this._active.length)for(let T=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;T>=0;--T)this._active[T].unhook(!1);this._stack.paused=!1,this._active=C,this._ident=0}hook(T,w){if(this.reset(),this._ident=T,this._active=this._handlers[T]||C,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(T,w,p){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(T,w,p);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(T,w,p))}unhook(T,w=!0){if(this._active.length){let p=!1,b=this._active.length-1,_=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,p=w,_=this._stack.fallThrough,this._stack.paused=!1),!_&&p===!1){for(;b>=0&&(p=this._active[b].unhook(T),p!==!0);b--)if(p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,p;b--}for(;b>=0;b--)if(p=this._active[b].unhook(!1),p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,p}else this._handlerFb(this._ident,"UNHOOK",T);this._active=C,this._ident=0}};const E=new g.Params;E.addParam(0),c.DcsHandler=class{constructor(T){this._handler=T,this._data="",this._params=E,this._hitLimit=!1}hook(T){this._params=T.length>1||T.params[0]?T.clone():E,this._data="",this._hitLimit=!1}put(T,w,p){this._hitLimit||(this._data+=(0,h.utf32ToString)(T,w,p),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(T){let w=!1;if(this._hitLimit)w=!1;else if(T&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((p=>(this._params=E,this._data="",this._hitLimit=!1,p)));return this._params=E,this._data="",this._hitLimit=!1,w}}},2015:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.EscapeSequenceParser=c.VT500_TRANSITION_TABLE=c.TransitionTable=void 0;const h=u(844),g=u(8742),f=u(6242),C=u(6351);class E{constructor(b){this.table=new Uint8Array(b)}setDefault(b,_){this.table.fill(b<<4|_)}add(b,_,m,x){this.table[_<<8|b]=m<<4|x}addMany(b,_,m,x){for(let R=0;R<b.length;R++)this.table[_<<8|b[R]]=m<<4|x}}c.TransitionTable=E;const T=160;c.VT500_TRANSITION_TABLE=(function(){const p=new E(4095),b=Array.apply(null,Array(256)).map(((D,A)=>A)),_=(D,A)=>b.slice(D,A),m=_(32,127),x=_(0,24);x.push(25),x.push.apply(x,_(28,32));const R=_(0,14);let k;for(k in p.setDefault(1,0),p.addMany(m,0,2,0),R)p.addMany([24,26,153,154],k,3,0),p.addMany(_(128,144),k,3,0),p.addMany(_(144,152),k,3,0),p.add(156,k,0,0),p.add(27,k,11,1),p.add(157,k,4,8),p.addMany([152,158,159],k,0,7),p.add(155,k,11,3),p.add(144,k,11,9);return p.addMany(x,0,3,0),p.addMany(x,1,3,1),p.add(127,1,0,1),p.addMany(x,8,0,8),p.addMany(x,3,3,3),p.add(127,3,0,3),p.addMany(x,4,3,4),p.add(127,4,0,4),p.addMany(x,6,3,6),p.addMany(x,5,3,5),p.add(127,5,0,5),p.addMany(x,2,3,2),p.add(127,2,0,2),p.add(93,1,4,8),p.addMany(m,8,5,8),p.add(127,8,5,8),p.addMany([156,27,24,26,7],8,6,0),p.addMany(_(28,32),8,0,8),p.addMany([88,94,95],1,0,7),p.addMany(m,7,0,7),p.addMany(x,7,0,7),p.add(156,7,0,0),p.add(127,7,0,7),p.add(91,1,11,3),p.addMany(_(64,127),3,7,0),p.addMany(_(48,60),3,8,4),p.addMany([60,61,62,63],3,9,4),p.addMany(_(48,60),4,8,4),p.addMany(_(64,127),4,7,0),p.addMany([60,61,62,63],4,0,6),p.addMany(_(32,64),6,0,6),p.add(127,6,0,6),p.addMany(_(64,127),6,0,0),p.addMany(_(32,48),3,9,5),p.addMany(_(32,48),5,9,5),p.addMany(_(48,64),5,0,6),p.addMany(_(64,127),5,7,0),p.addMany(_(32,48),4,9,5),p.addMany(_(32,48),1,9,2),p.addMany(_(32,48),2,9,2),p.addMany(_(48,127),2,10,0),p.addMany(_(48,80),1,10,0),p.addMany(_(81,88),1,10,0),p.addMany([89,90,92],1,10,0),p.addMany(_(96,127),1,10,0),p.add(80,1,11,9),p.addMany(x,9,0,9),p.add(127,9,0,9),p.addMany(_(28,32),9,0,9),p.addMany(_(32,48),9,9,12),p.addMany(_(48,60),9,8,10),p.addMany([60,61,62,63],9,9,10),p.addMany(x,11,0,11),p.addMany(_(32,128),11,0,11),p.addMany(_(28,32),11,0,11),p.addMany(x,10,0,10),p.add(127,10,0,10),p.addMany(_(28,32),10,0,10),p.addMany(_(48,60),10,8,10),p.addMany([60,61,62,63],10,0,11),p.addMany(_(32,48),10,9,12),p.addMany(x,12,0,12),p.add(127,12,0,12),p.addMany(_(28,32),12,0,12),p.addMany(_(32,48),12,9,12),p.addMany(_(48,64),12,0,11),p.addMany(_(64,127),12,12,13),p.addMany(_(64,127),10,12,13),p.addMany(_(64,127),9,12,13),p.addMany(x,13,13,13),p.addMany(m,13,13,13),p.add(127,13,0,13),p.addMany([27,156,24,26],13,14,0),p.add(T,0,2,0),p.add(T,8,5,8),p.add(T,6,0,6),p.add(T,11,0,11),p.add(T,13,13,13),p})();class w extends h.Disposable{constructor(b=c.VT500_TRANSITION_TABLE){super(),this._transitions=b,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(_,m,x)=>{},this._executeHandlerFb=_=>{},this._csiHandlerFb=(_,m)=>{},this._escHandlerFb=_=>{},this._errorHandlerFb=_=>_,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(b,_=[64,126]){let m=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(m=b.prefix.charCodeAt(0),m&&60>m||m>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(b.intermediates){if(b.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let R=0;R<b.intermediates.length;++R){const k=b.intermediates.charCodeAt(R);if(32>k||k>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");m<<=8,m|=k}}if(b.final.length!==1)throw new Error("final must be a single byte");const x=b.final.charCodeAt(0);if(_[0]>x||x>_[1])throw new Error(`final must be in range ${_[0]} .. ${_[1]}`);return m<<=8,m|=x,m}identToString(b){const _=[];for(;b;)_.push(String.fromCharCode(255&b)),b>>=8;return _.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,_){const m=this._identifier(b,[48,126]);this._escHandlers[m]===void 0&&(this._escHandlers[m]=[]);const x=this._escHandlers[m];return x.push(_),{dispose:()=>{const R=x.indexOf(_);R!==-1&&x.splice(R,1)}}}clearEscHandler(b){this._escHandlers[this._identifier(b,[48,126])]&&delete this._escHandlers[this._identifier(b,[48,126])]}setEscHandlerFallback(b){this._escHandlerFb=b}setExecuteHandler(b,_){this._executeHandlers[b.charCodeAt(0)]=_}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,_){const m=this._identifier(b);this._csiHandlers[m]===void 0&&(this._csiHandlers[m]=[]);const x=this._csiHandlers[m];return x.push(_),{dispose:()=>{const R=x.indexOf(_);R!==-1&&x.splice(R,1)}}}clearCsiHandler(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,_){return this._dcsParser.registerHandler(this._identifier(b),_)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,_){return this._oscParser.registerHandler(b,_)}clearOscHandler(b){this._oscParser.clearHandler(b)}setOscHandlerFallback(b){this._oscParser.setHandlerFallback(b)}setErrorHandler(b){this._errorHandler=b}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(b,_,m,x,R){this._parseStack.state=b,this._parseStack.handlers=_,this._parseStack.handlerPos=m,this._parseStack.transition=x,this._parseStack.chunkPos=R}parse(b,_,m){let x,R=0,k=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 A=this._parseStack.handlers;let B=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(m===!1&&B>-1){for(;B>=0&&(x=A[B](this._params),x!==!0);B--)if(x instanceof Promise)return this._parseStack.handlerPos=B,x}this._parseStack.handlers=[];break;case 4:if(m===!1&&B>-1){for(;B>=0&&(x=A[B](),x!==!0);B--)if(x instanceof Promise)return this._parseStack.handlerPos=B,x}this._parseStack.handlers=[];break;case 6:if(R=b[this._parseStack.chunkPos],x=this._dcsParser.unhook(R!==24&&R!==26,m),x)return x;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(R=b[this._parseStack.chunkPos],x=this._oscParser.end(R!==24&&R!==26,m),x)return x;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 A=D;A<_;++A){switch(R=b[A],k=this._transitions.table[this.currentState<<8|(R<160?R:T)],k>>4){case 2:for(let H=A+1;;++H){if(H>=_||(R=b[H])<32||R>126&&R<T){this._printHandler(b,A,H),A=H-1;break}if(++H>=_||(R=b[H])<32||R>126&&R<T){this._printHandler(b,A,H),A=H-1;break}if(++H>=_||(R=b[H])<32||R>126&&R<T){this._printHandler(b,A,H),A=H-1;break}if(++H>=_||(R=b[H])<32||R>126&&R<T){this._printHandler(b,A,H),A=H-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:A,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&&(x=B[W](this._params),x!==!0);W--)if(x instanceof Promise)return this._preserveStack(3,B,W,k,A),x;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(++A<_&&(R=b[A])>47&&R<60);A--;break;case 9:this._collect<<=8,this._collect|=R;break;case 10:const j=this._escHandlers[this._collect<<8|R];let F=j?j.length-1:-1;for(;F>=0&&(x=j[F](),x!==!0);F--)if(x instanceof Promise)return this._preserveStack(4,j,F,k,A),x;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 H=A+1;;++H)if(H>=_||(R=b[H])===24||R===26||R===27||R>127&&R<T){this._dcsParser.put(b,A,H),A=H-1;break}break;case 14:if(x=this._dcsParser.unhook(R!==24&&R!==26),x)return this._preserveStack(6,[],0,k,A),x;R===27&&(k|=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 H=A+1;;H++)if(H>=_||(R=b[H])<32||R>127&&R<T){this._oscParser.put(b,A,H),A=H-1;break}break;case 6:if(x=this._oscParser.end(R!==24&&R!==26),x)return this._preserveStack(5,[],0,k,A),x;R===27&&(k|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&k}}}c.EscapeSequenceParser=w},6242:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const h=u(5770),g=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,E){this._handlers[C]===void 0&&(this._handlers[C]=[]);const T=this._handlers[C];return T.push(E),{dispose:()=>{const w=T.indexOf(E);w!==-1&&T.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,E,T){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(C,E,T);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(C,E,T))}start(){this.reset(),this._state=1}put(C,E,T){if(this._state!==3){if(this._state===1)for(;E<T;){const w=C[E++];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&&T-E>0&&this._put(C,E,T)}}end(C,E=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let T=!1,w=this._active.length-1,p=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,T=E,p=this._stack.fallThrough,this._stack.paused=!1),!p&&T===!1){for(;w>=0&&(T=this._active[w].end(C),T!==!0);w--)if(T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,T;w--}for(;w>=0;w--)if(T=this._active[w].end(!1),T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,T}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,E,T){this._hitLimit||(this._data+=(0,g.utf32ToString)(C,E,T),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(C){let E=!1;if(this._hitLimit)E=!1;else if(C&&(E=this._handler(this._data),E instanceof Promise))return E.then((T=>(this._data="",this._hitLimit=!1,T)));return this._data="",this._hitLimit=!1,E}}},8742:(S,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 E=Array.isArray(f[0])?1:0;E<f.length;++E){const T=f[E];if(Array.isArray(T))for(let w=0;w<T.length;++w)C.addSubParam(T[w]);else C.addParam(T)}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 E=this._subParamsIdx[C]>>8,T=255&this._subParamsIdx[C];T-E>0&&f.push(Array.prototype.slice.call(this._subParams,E,T))}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,E=255&this._subParamsIdx[f];return E-C>0?this._subParams.subarray(C,E):null}getSubParamsAll(){const f={};for(let C=0;C<this.length;++C){const E=this._subParamsIdx[C]>>8,T=255&this._subParamsIdx[C];T-E>0&&(f[C]=this._subParams.slice(E,T))}return f}addDigit(f){let C;if(this._rejectDigits||!(C=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const E=this._digitIsSub?this._subParams:this.params,T=E[C-1];E[C-1]=~T?Math.min(10*T+f,u):f}}c.Params=h},5741:(S,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 g={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(g),h.dispose=()=>this._wrappedAddonDispose(g),h.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let h=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===u){h=g;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:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferApiView=void 0;const h=u(3785),g=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 g.CellData}}},3785:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLineApiView=void 0;const h=u(511);c.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,f){if(!(g<0||g>=this._line.length))return f?(this._line.loadCell(g,f),f):this._line.loadCell(g,new h.CellData)}translateToString(g,f,C){return this._line.translateToString(g,f,C)}}},8285:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const h=u(8771),g=u(8460),f=u(844);class C extends f.Disposable{constructor(T){super(),this._core=T,this._onBufferChange=this.register(new g.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:(S,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,(g=>h(g.toArray())))}addCsiHandler(u,h){return this.registerCsiHandler(u,h)}registerDcsHandler(u,h){return this._core.registerDcsHandler(u,((g,f)=>h(g,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:(S,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(S,c,u){var h=this&&this.__decorate||function(p,b,_,m){var x,R=arguments.length,k=R<3?b:m===null?m=Object.getOwnPropertyDescriptor(b,_):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(p,b,_,m);else for(var D=p.length-1;D>=0;D--)(x=p[D])&&(k=(R<3?x(k):R>3?x(b,_,k):x(b,_))||k);return R>3&&k&&Object.defineProperty(b,_,k),k},g=this&&this.__param||function(p,b){return function(_,m){b(_,m,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const f=u(8460),C=u(844),E=u(5295),T=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(p){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(p.rawOptions.cols||0,c.MINIMUM_COLS),this.rows=Math.max(p.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new E.BufferSet(p,this))}resize(p,b){this.cols=p,this.rows=b,this.buffers.resize(p,b),this._onResize.fire({cols:p,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(p,b=!1){const _=this.buffer;let m;m=this._cachedBlankLine,m&&m.length===this.cols&&m.getFg(0)===p.fg&&m.getBg(0)===p.bg||(m=_.getBlankLine(p,b),this._cachedBlankLine=m),m.isWrapped=b;const x=_.ybase+_.scrollTop,R=_.ybase+_.scrollBottom;if(_.scrollTop===0){const k=_.lines.isFull;R===_.lines.length-1?k?_.lines.recycle().copyFrom(m):_.lines.push(m.clone()):_.lines.splice(R+1,0,m.clone()),k?this.isUserScrolling&&(_.ydisp=Math.max(_.ydisp-1,0)):(_.ybase++,this.isUserScrolling||_.ydisp++)}else{const k=R-x+1;_.lines.shiftElements(x+1,k-1,-1),_.lines.set(R,m.clone())}this.isUserScrolling||(_.ydisp=_.ybase),this._onScroll.fire(_.ydisp)}scrollLines(p,b,_){const m=this.buffer;if(p<0){if(m.ydisp===0)return;this.isUserScrolling=!0}else p+m.ydisp>=m.ybase&&(this.isUserScrolling=!1);const x=m.ydisp;m.ydisp=Math.max(Math.min(m.ydisp+p,m.ybase),0),x!==m.ydisp&&(b||this._onScroll.fire(m.ydisp))}};c.BufferService=w=h([g(0,T.IOptionsService)],w)},7994:(S,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(S,c,u){var h=this&&this.__decorate||function(m,x,R,k){var D,A=arguments.length,B=A<3?x:k===null?k=Object.getOwnPropertyDescriptor(x,R):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(m,x,R,k);else for(var W=m.length-1;W>=0;W--)(D=m[W])&&(B=(A<3?D(B):A>3?D(x,R,B):D(x,R))||B);return A>3&&B&&Object.defineProperty(x,R,B),B},g=this&&this.__param||function(m,x){return function(R,k){x(R,k,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const f=u(2585),C=u(8460),E=u(844),T={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,x){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||x||(R|=3)),R}const p=String.fromCharCode,b={DEFAULT:m=>{const x=[w(m,!1)+32,m.col+32,m.row+32];return x[0]>255||x[1]>255||x[2]>255?"":`\x1B[M${p(x[0])}${p(x[1])}${p(x[2])}`},SGR:m=>{const x=m.action===0&&m.button!==4?"m":"M";return`\x1B[<${w(m,!0)};${m.col};${m.row}${x}`},SGR_PIXELS:m=>{const x=m.action===0&&m.button!==4?"m":"M";return`\x1B[<${w(m,!0)};${m.x};${m.y}${x}`}};let _=c.CoreMouseService=class extends E.Disposable{constructor(m,x){super(),this._bufferService=m,this._coreService=x,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(T))this.addProtocol(R,T[R]);for(const R of Object.keys(b))this.addEncoding(R,b[R]);this.reset()}addProtocol(m,x){this._protocols[m]=x}addEncoding(m,x){this._encodings[m]=x}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 x=this._encodings[this._activeEncoding](m);return x&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(x):this._coreService.triggerDataEvent(x,!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,x,R){if(R){if(m.x!==x.x||m.y!==x.y)return!1}else if(m.col!==x.col||m.row!==x.row)return!1;return m.button===x.button&&m.action===x.action&&m.ctrl===x.ctrl&&m.alt===x.alt&&m.shift===x.shift}};c.CoreMouseService=_=h([g(0,f.IBufferService),g(1,f.ICoreService)],_)},6975:function(S,c,u){var h=this&&this.__decorate||function(_,m,x,R){var k,D=arguments.length,A=D<3?m:R===null?R=Object.getOwnPropertyDescriptor(m,x):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(_,m,x,R);else for(var B=_.length-1;B>=0;B--)(k=_[B])&&(A=(D<3?k(A):D>3?k(m,x,A):k(m,x))||A);return D>3&&A&&Object.defineProperty(m,x,A),A},g=this&&this.__param||function(_,m){return function(x,R){m(x,R,_)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const f=u(1439),C=u(8460),E=u(844),T=u(2585),w=Object.freeze({insertMode:!1}),p=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let b=c.CoreService=class extends E.Disposable{constructor(_,m,x){super(),this._bufferService=_,this._logService=m,this._optionsService=x,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)(p)}reset(){this.modes=(0,f.clone)(w),this.decPrivateModes=(0,f.clone)(p)}triggerDataEvent(_,m=!1){if(this._optionsService.rawOptions.disableStdin)return;const x=this._bufferService.buffer;m&&this._optionsService.rawOptions.scrollOnUserInput&&x.ybase!==x.ydisp&&this._onRequestScrollToBottom.fire(),m&&this._onUserInput.fire(),this._logService.debug(`sending data "${_}"`,(()=>_.split("").map((R=>R.charCodeAt(0))))),this._onData.fire(_)}triggerBinaryEvent(_){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${_}"`,(()=>_.split("").map((m=>m.charCodeAt(0))))),this._onBinary.fire(_))}};c.CoreService=b=h([g(0,T.IBufferService),g(1,T.ILogService),g(2,T.IOptionsService)],b)},9074:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const h=u(8055),g=u(8460),f=u(844),C=u(6106);let E=0,T=0;class w extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new C.SortedList((_=>_?.marker.line)),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(_){if(_.marker.isDisposed)return;const m=new p(_);if(m){const x=m.marker.onDispose((()=>m.dispose()));m.onDispose((()=>{m&&(this._decorations.delete(m)&&this._onDecorationRemoved.fire(m),x.dispose())})),this._decorations.insert(m),this._onDecorationRegistered.fire(m)}return m}reset(){for(const _ of this._decorations.values())_.dispose();this._decorations.clear()}*getDecorationsAtCell(_,m,x){let R=0,k=0;for(const D of this._decorations.getKeyIterator(m))R=D.options.x??0,k=R+(D.options.width??1),_>=R&&_<k&&(!x||(D.options.layer??"bottom")===x)&&(yield D)}forEachDecorationAtCell(_,m,x,R){this._decorations.forEachByKey(m,(k=>{E=k.options.x??0,T=E+(k.options.width??1),_>=E&&_<T&&(!x||(k.options.layer??"bottom")===x)&&R(k)}))}}c.DecorationService=w;class p 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(_){super(),this.options=_,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=_.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;const h=u(2585),g=u(8343);class f{constructor(...E){this._entries=new Map;for(const[T,w]of E)this.set(T,w)}set(E,T){const w=this._entries.get(E);return this._entries.set(E,T),w}forEach(E){for(const[T,w]of this._entries.entries())E(T,w)}has(E){return this._entries.has(E)}get(E){return this._entries.get(E)}}c.ServiceCollection=f,c.InstantiationService=class{constructor(){this._services=new f,this._services.set(h.IInstantiationService,this)}setService(C,E){this._services.set(C,E)}getService(C){return this._services.get(C)}createInstance(C,...E){const T=(0,g.getServiceDependencies)(C).sort(((b,_)=>b.index-_.index)),w=[];for(const b of T){const _=this._services.get(b.id);if(!_)throw new Error(`[createInstance] ${C.name} depends on UNKNOWN service ${b.id}.`);w.push(_)}const p=T.length>0?T[0].index:E.length;if(E.length!==p)throw new Error(`[createInstance] First service dependency of ${C.name} at position ${p+1} conflicts with ${E.length} static arguments`);return new C(...E,...w)}}},7866:function(S,c,u){var h=this&&this.__decorate||function(p,b,_,m){var x,R=arguments.length,k=R<3?b:m===null?m=Object.getOwnPropertyDescriptor(b,_):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(p,b,_,m);else for(var D=p.length-1;D>=0;D--)(x=p[D])&&(k=(R<3?x(k):R>3?x(b,_,k):x(b,_))||k);return R>3&&k&&Object.defineProperty(b,_,k),k},g=this&&this.__param||function(p,b){return function(_,m){b(_,m,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const f=u(844),C=u(2585),E={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 T,w=c.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(p){super(),this._optionsService=p,this._logLevel=C.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),T=this}_updateLogLevel(){this._logLevel=E[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(p){for(let b=0;b<p.length;b++)typeof p[b]=="function"&&(p[b]=p[b]())}_log(p,b,_){this._evalLazyOptionalParams(_),p.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+b,..._)}trace(p,...b){this._logLevel<=C.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,p,b)}debug(p,...b){this._logLevel<=C.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,p,b)}info(p,...b){this._logLevel<=C.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,p,b)}warn(p,...b){this._logLevel<=C.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,p,b)}error(p,...b){this._logLevel<=C.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,p,b)}};c.LogService=w=h([g(0,C.IOptionsService)],w),c.setTraceLogger=function(p){T=p},c.traceCall=function(p,b,_){if(typeof _.value!="function")throw new Error("not supported");const m=_.value;_.value=function(...x){if(T.logLevel!==C.LogLevelEnum.TRACE)return m.apply(this,x);T.trace(`GlyphRenderer#${m.name}(${x.map((k=>JSON.stringify(k))).join(", ")})`);const R=m.apply(this,x);return T.trace(`GlyphRenderer#${m.name} return`,R),R}}},7302:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=void 0;const h=u(8460),g=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 E extends g.Disposable{constructor(w){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const p={...c.DEFAULT_OPTIONS};for(const b in w)if(b in p)try{const _=w[b];p[b]=this._sanitizeAndValidateOption(b,_)}catch(_){console.error(_)}this.rawOptions=p,this.options={...p},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,p){return this.onOptionChange((b=>{b===w&&p(this.rawOptions[w])}))}onMultipleOptionChange(w,p){return this.onOptionChange((b=>{w.indexOf(b)!==-1&&p()}))}_setupOptions(){const w=b=>{if(!(b in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},p=(b,_)=>{if(!(b in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);_=this._sanitizeAndValidateOption(b,_),this.rawOptions[b]!==_&&(this.rawOptions[b]=_,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const _={get:w.bind(this,b),set:p.bind(this,b)};Object.defineProperty(this.options,b,_)}}_sanitizeAndValidateOption(w,p){switch(w){case"cursorStyle":if(p||(p=c.DEFAULT_OPTIONS[w]),!(function(b){return b==="block"||b==="underline"||b==="bar"})(p))throw new Error(`"${p}" is not a valid value for ${w}`);break;case"wordSeparator":p||(p=c.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof p=="number"&&1<=p&&p<=1e3)break;p=C.includes(p)?p:c.DEFAULT_OPTIONS[w];break;case"cursorWidth":p=Math.floor(p);case"lineHeight":case"tabStopWidth":if(p<1)throw new Error(`${w} cannot be less than 1, value: ${p}`);break;case"minimumContrastRatio":p=Math.max(1,Math.min(21,Math.round(10*p)/10));break;case"scrollback":if((p=Math.min(p,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${p}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(p<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${p}`);break;case"rows":case"cols":if(!p&&p!==0)throw new Error(`${w} must be numeric, value: ${p}`);break;case"windowsPty":p=p??{}}return p}}c.OptionsService=E},2660:function(S,c,u){var h=this&&this.__decorate||function(E,T,w,p){var b,_=arguments.length,m=_<3?T:p===null?p=Object.getOwnPropertyDescriptor(T,w):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(E,T,w,p);else for(var x=E.length-1;x>=0;x--)(b=E[x])&&(m=(_<3?b(m):_>3?b(T,w,m):b(T,w))||m);return _>3&&m&&Object.defineProperty(T,w,m),m},g=this&&this.__param||function(E,T){return function(w,p){T(w,p,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const f=u(2585);let C=c.OscLinkService=class{constructor(E){this._bufferService=E,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(E){const T=this._bufferService.buffer;if(E.id===void 0){const x=T.addMarker(T.ybase+T.y),R={data:E,id:this._nextId++,lines:[x]};return x.onDispose((()=>this._removeMarkerFromLink(R,x))),this._dataByLinkId.set(R.id,R),R.id}const w=E,p=this._getEntryIdKey(w),b=this._entriesWithId.get(p);if(b)return this.addLineToLink(b.id,T.ybase+T.y),b.id;const _=T.addMarker(T.ybase+T.y),m={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(m,_))),this._entriesWithId.set(m.key,m),this._dataByLinkId.set(m.id,m),m.id}addLineToLink(E,T){const w=this._dataByLinkId.get(E);if(w&&w.lines.every((p=>p.line!==T))){const p=this._bufferService.buffer.addMarker(T);w.lines.push(p),p.onDispose((()=>this._removeMarkerFromLink(w,p)))}}getLinkData(E){return this._dataByLinkId.get(E)?.data}_getEntryIdKey(E){return`${E.id};;${E.uri}`}_removeMarkerFromLink(E,T){const w=E.lines.indexOf(T);w!==-1&&(E.lines.splice(w,1),E.lines.length===0&&(E.data.id!==void 0&&this._entriesWithId.delete(E.key),this._dataByLinkId.delete(E.id)))}};c.OscLinkService=C=h([g(0,f.IBufferService)],C)},8343:(S,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(g){return g[h]||[]},c.createDecorator=function(g){if(c.serviceRegistry.has(g))return c.serviceRegistry.get(g);const f=function(C,E,T){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,p,b){p[u]===p?p[h].push({id:w,index:b}):(p[h]=[{id:w,index:b}],p[u]=p)})(f,C,T)};return f.toString=()=>g,c.serviceRegistry.set(g,f),f}},2585:(S,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 g;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"})(g||(c.LogLevelEnum=g={})),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:(S,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const h=u(8460),g=u(225);class f{static extractShouldJoin(E){return(1&E)!=0}static extractWidth(E){return E>>1&3}static extractCharKind(E){return E>>3}static createPropertyValue(E,T,w=!1){return(16777215&E)<<3|(3&T)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const E=new g.UnicodeV6;this.register(E),this._active=E.version,this._activeProvider=E}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(E){if(!this._providers[E])throw new Error(`unknown Unicode version "${E}"`);this._active=E,this._activeProvider=this._providers[E],this._onChange.fire(E)}register(E){this._providers[E.version]=E}wcwidth(E){return this._activeProvider.wcwidth(E)}getStringCellWidth(E){let T=0,w=0;const p=E.length;for(let b=0;b<p;++b){let _=E.charCodeAt(b);if(55296<=_&&_<=56319){if(++b>=p)return T+this.wcwidth(_);const R=E.charCodeAt(b);56320<=R&&R<=57343?_=1024*(_-55296)+R-56320+65536:T+=this.wcwidth(R)}const m=this.charProperties(_,w);let x=f.extractWidth(m);f.extractShouldJoin(m)&&(x-=f.extractWidth(w)),T+=x,w=m}return T}charProperties(E,T){return this._activeProvider.charProperties(E,T)}}c.UnicodeService=f}},o={};function l(S){var c=o[S];if(c!==void 0)return c.exports;var u=o[S]={exports:{}};return s[S].call(u.exports,u,u.exports,l),u.exports}var y={};return(()=>{var S=y;Object.defineProperty(S,"__esModule",{value:!0}),S.Terminal=void 0;const c=l(9042),u=l(3236),h=l(844),g=l(5741),f=l(8285),C=l(7975),E=l(7090),T=["cols","rows"];class w extends h.Disposable{constructor(b){super(),this._core=this.register(new u.Terminal(b)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const _=x=>this._core.options[x],m=(x,R)=>{this._checkReadonlyOptions(x),this._core.options[x]=R};for(const x in this._core.options){const R={get:_.bind(this,x),set:m.bind(this,x)};Object.defineProperty(this._publicOptions,x,R)}}_checkReadonlyOptions(b){if(T.includes(b))throw new Error(`Option "${b}" 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 E.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 b=this._core.coreService.decPrivateModes;let _="none";switch(this._core.coreMouseService.activeProtocol){case"X10":_="x10";break;case"VT200":_="vt200";break;case"DRAG":_="drag";break;case"ANY":_="any"}return{applicationCursorKeysMode:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:_,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const _ in b)this._publicOptions[_]=b[_]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,_=!0){this._core.input(b,_)}resize(b,_){this._verifyIntegers(b,_),this._core.resize(b,_)}open(b){this._core.open(b)}attachCustomKeyEventHandler(b){this._core.attachCustomKeyEventHandler(b)}attachCustomWheelEventHandler(b){this._core.attachCustomWheelEventHandler(b)}registerLinkProvider(b){return this._core.registerLinkProvider(b)}registerCharacterJoiner(b){return this._checkProposedApi(),this._core.registerCharacterJoiner(b)}deregisterCharacterJoiner(b){this._checkProposedApi(),this._core.deregisterCharacterJoiner(b)}registerMarker(b=0){return this._verifyIntegers(b),this._core.registerMarker(b)}registerDecoration(b){return this._checkProposedApi(),this._verifyPositiveIntegers(b.x??0,b.width??0,b.height??0),this._core.registerDecoration(b)}hasSelection(){return this._core.hasSelection()}select(b,_,m){this._verifyIntegers(b,_,m),this._core.select(b,_,m)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,_){this._verifyIntegers(b,_),this._core.selectLines(b,_)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,_){this._core.write(b,_)}writeln(b,_){this._core.write(b),this._core.write(`\r
82
- `,_)}paste(b){this._core.paste(b)}refresh(b,_){this._verifyIntegers(b,_),this._core.refresh(b,_)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return c}_verifyIntegers(...b){for(const _ of b)if(_===1/0||isNaN(_)||_%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const _ of b)if(_&&(_===1/0||isNaN(_)||_%1!=0||_<0))throw new Error("This API only accepts positive integers")}}S.Terminal=w})(),y})()))})(jd)),jd.exports}var E5=w5();function G1(){return te.useSyncExternalStore(r2,av,av)}const Hv=250,x5=5e3,zv=1,T5=4e3,A5=4001;function R5(t){const n=new AbortController,s=new TextEncoder;let o=Hv,l=null,y=null,S=null,c=!1;const u=()=>{y?.dispose(),y=null},h=(C,E)=>{S={cols:C,rows:E},l?.readyState===zv&&l.send(JSON.stringify({type:"resize",cols:C,rows:E}))},g=async()=>{for(;!n.signal.aborted;){t.onStatus?.("connecting");try{const C=t.fetchTicket??Kw,{ticket:E}=await C(t.sessionId,{kind:t.kind,signal:n.signal});if(n.signal.aborted)return;await f(k5(E,t.location),t),o=Hv}catch(C){if(n.signal.aborted)return;t.onStatus?.("connecting",C instanceof Error?C.message:String(C))}await M5(o,n.signal),o=Math.min(o*2,x5)}},f=async(C,E)=>{await new Promise((T,w)=>{const p=(E.webSocketFactory??L5)(C);l=p,p.binaryType="arraybuffer",p.onopen=()=>{E.onStatus?.("live"),u(),y=E.terminal.onData(b=>{p.readyState===zv&&p.send(s.encode(b))}),S&&h(S.cols,S.rows)},p.onmessage=b=>{b.data instanceof ArrayBuffer&&E.terminal.write(new Uint8Array(b.data))},p.onerror=()=>{w(new Error("Terminal WebSocket error"))},p.onclose=b=>{u(),l===p&&(l=null);const _=b?.code;_===T5?n.abort():_===A5&&(n.abort(),E.onExit?.()),T()}})};return{start:()=>{c||(c=!0,g())},resize:h,dispose:()=>{n.abort(),u(),t.onStatus?.("closed"),l?.close(),l=null}}}function k5(t,n=window.location){return`${n.protocol==="https:"?"wss":"ws"}://${n.host}/terminal/ws?ticket=${encodeURIComponent(t)}`}function L5(t){return new WebSocket(t)}async function M5(t,n){await new Promise(s=>{const o=()=>{clearTimeout(l),n.removeEventListener("abort",o),s()},l=setTimeout(o,t);n.addEventListener("abort",o)})}const D5={allowProposedApi:!0,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},O5=80,B5={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)"},N5={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 K1({sessionId:t,kind:n,onExit:s}){const{activeTheme:o,terminalRenderer:l}=G1(),y=te.useRef(null),S=te.useRef(null),c=te.useRef(null),u=te.useRef(null),h=te.useRef(s);h.current=s;const[g,f]=te.useState("connecting");te.useEffect(()=>{const E=y.current;if(!E)return;let T=!1;const w=new E5.Terminal({...D5,theme:$v(o)});S.current=w;const p=new z2.FitAddon;w.loadAddon(p),w.open(E),w.loadAddon(new j2.Unicode11Addon),w.unicode.activeVersion="11",w.attachCustomKeyEventHandler(A=>A.key==="Enter"&&A.shiftKey?(A.type==="keydown"&&w.input(`
83
- `),!1):!0);const b=R5({sessionId:t,kind:n,terminal:w,onExit:()=>h.current?.(),onStatus:(A,B)=>{f(B?`${A}: ${B}`:A)}});c.current=b;let _=null;const m=()=>{p.fit(),b.resize(w.cols,w.rows)},x=()=>{m(),w.refresh(0,w.rows-1)},R=()=>{_&&clearTimeout(_),_=setTimeout(()=>{_=null,T||x()},O5)},k=async()=>{await document.fonts?.ready,!T&&(m(),b.start(),w.focus())},D=new ResizeObserver(R);return D.observe(E),k(),()=>{T=!0,D.disconnect(),_&&clearTimeout(_),b.dispose(),S.current=null,c.current=null;try{w.dispose()}catch{}}},[n,t]),te.useEffect(()=>{const E=S.current;if(!E)return;let T=!1;if(l==="webgl")try{const w=new C5;u.current=w,w.onContextLoss(()=>{if(!T){try{w.dispose()}catch{}u.current===w&&(u.current=null)}}),E.loadAddon(w)}catch{try{u.current?.dispose()}catch{}u.current=null}return()=>{T=!0;const w=u.current;if(w){u.current=null;try{w.dispose()}catch{}}}},[l,n,t]),te.useEffect(()=>{const E=S.current;E&&(E.options.theme=$v(o))},[o]);const C=g.startsWith("live");return N.jsx("section",{className:"terminal-stage","aria-label":n==="shell"?"Shell terminal":"Fleet terminal",children:N.jsxs("div",{className:"terminal-shell",children:[C?null:N.jsxs("div",{className:"terminal-status","aria-live":"polite",children:[N.jsx("span",{className:"terminal-status-dot","aria-hidden":"true"}),g]}),N.jsx("div",{className:"terminal-canvas",ref:y})]})})}function $v(t){return t==="carbon"?N5:B5}function I5({state:t}){const n=te.useRef(null);return t.shellOpen&&n.current===null&&(n.current=document.activeElement),te.useEffect(()=>{if(!t.shellOpen)return;const s=o=>{o.key==="Escape"&&Yo()};return window.addEventListener("keydown",s),()=>{window.removeEventListener("keydown",s);const o=n.current;n.current=null,o?.focus?.()}},[t.shellOpen]),t.shellOpen?N.jsxs("div",{className:"shell-overlay",role:"dialog","aria-modal":"true","aria-label":"Shell",children:[N.jsx("button",{type:"button",className:"shell-overlay-scrim",onClick:Yo,"aria-label":"Close shell"}),N.jsxs("section",{className:"shell-overlay-card",children:[N.jsxs("header",{className:"shell-overlay-header",children:[N.jsx("span",{className:"shell-overlay-kicker",children:"Free Shell"}),N.jsx("h2",{children:"Local Shell"})]}),N.jsx("button",{type:"button",className:"shell-overlay-close",onClick:Yo,"aria-label":"Close shell",children:"×"}),N.jsx("div",{className:"shell-overlay-terminal",children:N.jsx(K1,{sessionId:sv,kind:"shell",onExit:Yo},sv)})]})]}):null}function H5({open:t,title:n,message:s,tone:o="info",onDismiss:l}){return t?N.jsx("div",{className:"app-toast-host",children:N.jsxs("div",{className:`app-toast app-toast--${o}`,role:"status","aria-live":"polite",children:[N.jsx("span",{className:"app-toast-dot","aria-hidden":"true"}),N.jsxs("div",{className:"app-toast-body",children:[N.jsx("p",{className:"app-toast-title",children:n}),s?N.jsx("p",{className:"app-toast-message",children:s}):null]}),l?N.jsx("button",{type:"button",className:"app-toast-close",onClick:l,"aria-label":"Dismiss notification",children:"×"}):null]})}):null}const z5=[{to:"/operations",label:"Operation",end:!1,icon:"operations"},{to:"/codex",label:"Codex",end:!1,icon:"codex"}],Pd=[{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 $5({state:t}){const n=t.connectionError!==null,s=Un().pathname,o=s.startsWith("/codex")?N.jsx(jv,{}):s.startsWith("/operations")?N.jsx(Uv,{}):N.jsx(G5,{});return N.jsxs("header",{className:"topbar",children:[N.jsxs("div",{className:"topbar-lead",children:[N.jsxs(zf,{className:"topbar-brand",to:"/","aria-label":"Welcome으로 이동",children:[N.jsx("span",{className:`topbar-sigil ${n?"is-alert":""}`,"aria-hidden":"true",title:t.connectionError??void 0,children:o}),N.jsxs("h1",{className:"topbar-title",children:["Fleet",N.jsx("span",{className:"topbar-title-thin",children:"Console"})]})]}),N.jsx("span",{className:"topbar-preview-badge",children:"Research Preview"})]}),N.jsx(U5,{state:t}),N.jsxs("div",{className:"topbar-meta",children:[t.updateAvailable?N.jsx("a",{className:"topbar-update-badge",href:"https://www.npmjs.com/package/@dotobokuri/fleet-console",target:"_blank",rel:"noreferrer",title:t.latestVersion?`Latest version: ${t.latestVersion}`:"Update available",children:"Update available"}):null,N.jsx("nav",{className:"topbar-nav","aria-label":"주 내비게이션",children:z5.map(l=>N.jsxs(Y0,{to:l.to,end:l.end,className:({isActive:y})=>`topbar-nav-link ${y?"is-active":""}`,children:[N.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:l.icon==="operations"?N.jsx(Uv,{}):N.jsx(jv,{})}),N.jsx("span",{children:l.label})]},l.to))}),N.jsxs("button",{type:"button",className:"topbar-shell-button",onMouseDown:l=>l.preventDefault(),onClick:l1,"aria-label":"Shell",title:"Shell (⌘`)",children:[N.jsx(V5,{}),N.jsx("span",{children:"Shell"})]}),N.jsx(j5,{activeTheme:t.activeTheme}),N.jsx(P5,{renderer:t.terminalRenderer})]})]})}function U5({state:t}){const[n,s]=te.useState(!1),o=te.useRef(null),l=te.useRef(null),y=te.useRef(null),S=t.theaters.find(f=>f.id===t.activeTheaterId)??null,c=S?.label??(t.theaters.length===0?"No Theaters":"Theater");te.useEffect(()=>{if(!n)return;const f=E=>{o.current?.contains(E.target)||s(!1)},C=E=>{E.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]),te.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=>{d2(f),s(!1),l.current?.focus()},h=async()=>{s(!1),f2();try{const f=await Pw();if("cancelled"in f){_2();return}p2(f)}catch(f){g2(f instanceof Error?f.message:String(f))}},g=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 E=C.indexOf(document.activeElement),T=f.key==="ArrowDown"?1:-1,w=(E+T+C.length)%C.length;C[w]?.focus()};return N.jsxs("div",{className:"theater-control",ref:o,children:[N.jsx("span",{className:"theater-eyebrow","aria-hidden":"true",children:"Theater"}),N.jsxs("button",{type:"button",ref:l,className:`theater-trigger ${n?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":n,"aria-label":"Theater",title:S?.label??t.theaterError??void 0,onClick:()=>s(f=>!f),children:[N.jsx("span",{className:"theater-trigger-sigil","aria-hidden":"true",children:N.jsx(F5,{})}),N.jsx("span",{className:"theater-trigger-label",children:c}),N.jsx("span",{className:"theater-trigger-caret","aria-hidden":"true",children:N.jsx(V1,{})})]}),n?N.jsxs("div",{className:"theater-menu",role:"menu","aria-label":"Theater",ref:y,onKeyDown:g,children:[t.theaters.length>0?N.jsx("ul",{className:"theater-menu-list",children:t.theaters.map(f=>{const C=f.id===t.activeTheaterId;return N.jsx("li",{children:N.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:[N.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:C?N.jsx(Y1,{}):null}),N.jsx("span",{className:"theater-menu-label",children:f.label})]})},f.id)})}):N.jsx("p",{className:"theater-menu-empty",children:"No Theaters yet."}),N.jsx("div",{className:"theater-menu-divider",role:"separator"}),N.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-add",disabled:t.addingTheater,onClick:h,children:[N.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:N.jsx(K5,{})}),N.jsx("span",{className:"theater-menu-label",children:t.addingTheater?"Adding Theater…":"Add Theater…"})]}),t.theaterError?N.jsx("p",{className:"theater-menu-error",children:t.theaterError}):null]}):null]})}function j5({activeTheme:t}){const[n,s]=te.useState(!1),o=te.useRef(null),l=te.useRef(null),y=te.useRef(null),S=Pd.find(h=>h.id===t)??Pd[0];te.useEffect(()=>{if(!n)return;const h=f=>{o.current?.contains(f.target)||s(!1)},g=f=>{f.key==="Escape"&&(s(!1),l.current?.focus())};return document.addEventListener("mousedown",h),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",g)}},[n]),te.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=>{a2(h),s(!1),l.current?.focus()},u=h=>{if(h.key!=="ArrowDown"&&h.key!=="ArrowUp")return;h.preventDefault();const g=Array.from(y.current?.querySelectorAll("[role^='menuitem']")??[]);if(g.length===0)return;const f=g.indexOf(document.activeElement),C=h.key==="ArrowDown"?1:-1,E=(f+C+g.length)%g.length;g[E]?.focus()};return N.jsxs("div",{className:"theme-control",ref:o,children:[N.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:[N.jsx(W5,{}),N.jsx("span",{className:"theme-trigger-label",children:S.label}),N.jsx("span",{className:"theme-trigger-caret","aria-hidden":"true",children:N.jsx(V1,{})})]}),n?N.jsx("div",{className:"theme-menu",role:"menu","aria-label":"Theme",ref:y,onKeyDown:u,children:Pd.map(h=>{const g=h.id===t;return N.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":g,"data-active":g?"true":void 0,className:`theme-menu-item ${g?"is-active":""}`,onClick:()=>c(h.id),children:[N.jsx("span",{className:"theme-swatch","aria-hidden":"true",children:h.swatch.map(f=>N.jsx("i",{style:{background:f}},f))}),N.jsx("span",{className:"theme-menu-label",children:h.label}),N.jsx("span",{className:"theme-menu-check","aria-hidden":"true",children:g?N.jsx(Y1,{}):null})]},h.id)})}):null]})}function P5({renderer:t}){const n=t==="webgl"?"dom":"webgl",s=t==="webgl"?"WebGL":"DOM";return N.jsxs("button",{type:"button",className:"theme-trigger","aria-label":`Terminal renderer: ${s}`,title:`Terminal renderer: ${s}`,onClick:()=>o2(n),children:[N.jsx(q5,{}),N.jsx("span",{className:"theme-trigger-label",children:s})]})}function F5(){return N.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[N.jsx("circle",{cx:"8",cy:"3.2",r:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),N.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 q5(){return N.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[N.jsx("rect",{x:"2.5",y:"3",width:"11",height:"8",rx:"1.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),N.jsx("path",{d:"M5.2 13h5.6M8 11v2",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function V1(){return N.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:N.jsx("path",{d:"M4.5 6.5 8 10l3.5-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function Y1(){return N.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:N.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 W5(){return N.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[N.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"}),N.jsx("circle",{cx:"5.6",cy:"6.4",r:".75",fill:"currentColor"}),N.jsx("circle",{cx:"8",cy:"5.2",r:".75",fill:"currentColor"}),N.jsx("circle",{cx:"10.4",cy:"6.5",r:".75",fill:"currentColor"})]})}function G5(){return N.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16",children:[N.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"}),N.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 Uv(){return N.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[N.jsx("circle",{cx:"8",cy:"8",r:"5.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),N.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"}),N.jsx("circle",{cx:"8",cy:"8",r:"1.1",fill:"currentColor"})]})}function jv(){return N.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[N.jsx("circle",{cx:"12",cy:"12",r:"9"}),N.jsx("circle",{cx:"12",cy:"12",r:"3.2",fill:"currentColor",stroke:"none",opacity:"0.16"}),N.jsx("path",{d:"M12 3v3.6M12 17.4V21M3 12h3.6M17.4 12H21"}),N.jsx("path",{d:"M12 8.6 14.2 12 12 15.4 9.8 12Z",fill:"currentColor",stroke:"none"})]})}function K5(){return N.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:N.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function V5(){return N.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[N.jsx("path",{d:"M2.8 4.2h10.4v7.6H2.8z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),N.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 Y5(){let t="";return n=>{t+=n;const s=[];let o=t.indexOf(`
84
-
85
- `);for(;o>=0;){const l=t.slice(0,o);t=t.slice(o+2);const y=Z5(l);y&&s.push(y),o=t.indexOf(`
86
-
87
- `)}return s}}function X5(t){if(!t.data)return null;let n;try{n=JSON.parse(t.data)}catch{return null}if(t.event==="observer:truncated"){const o=n.tenant?.tenantId;return!o||!n.truncation?null:{kind:"truncation",tenantId:o,tenantLabel:n.tenant?.tenantLabel,truncation:n.truncation}}if(t.event==="session:updated"){const o=Q5(n.session);return o?{kind:"session",tenantId:o.tenantId??o.sessionId,session:o}:null}const s=Pv(n.event)??Pv(n);return s?{kind:"event",tenantId:s.tenantId,tenantLabel:n.tenant?.tenantLabel,event:s}:null}function Z5(t){const n=t.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 Pv(t){if(typeof t!="object"||t===null)return null;const n=t;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}function Q5(t){if(typeof t!="object"||t===null)return null;const n=t;return typeof n.sessionId!="string"||typeof n.cwdLabel!="string"||typeof n.sequence!="number"||typeof n.status!="string"||typeof n.createdAt!="number"||"cwd"in n||"canonicalCwd"in n?null:{sessionId:n.sessionId,terminalSessionId:typeof n.terminalSessionId=="string"?n.terminalSessionId:n.sessionId,cwdLabel:n.cwdLabel,sequence:n.sequence,label:typeof n.label=="string"?n.label:void 0,status:n.status,createdAt:n.createdAt,theaterId:typeof n.theaterId=="string"?n.theaterId:void 0,tenantId:typeof n.tenantId=="string"?n.tenantId:void 0,registrationId:typeof n.registrationId=="string"?n.registrationId:void 0}}const Fv=250,J5=5e3;function ex(){const t=new AbortController;return tx(t.signal),()=>t.abort()}async function tx(t){let n=Fv,s=!1;const o=async()=>{if(!s){s=!0;try{h1(await Z0(t))}catch{}finally{s=!1}}};for(;!t.aborted;){rt({connection:"connecting"});try{await nx(t);const l=await $w(t);rt({connection:"live",connectionError:null}),n=Fv,await ix(l,t,o),t.aborted||rt({connection:"connecting",connectionError:null})}catch(l){if(t.aborted)return;rt({connection:"connecting",connectionError:l instanceof Error?l.message:String(l)})}if(t.aborted)return;await rx(n,t),n=Math.min(n*2,J5)}}async function ix(t,n,s){const o=new TextDecoder,l=Y5();for(;!n.aborted;){const y=await t.read();if(y.done)return;for(const S of l(o.decode(y.value,{stream:!0}))){const c=X5(S);if(c){if(c.kind==="truncation"&&c.truncation){A2(c.tenantId,c.tenantLabel,c.truncation);continue}if(c.kind==="session"&&c.session){o1(c.session);continue}if(c.event){const{unknownTenant:u}=T2(c.event,c.tenantLabel);u&&s()}}}}}async function nx(t){const[n,s]=await Promise.all([Z0(t),zw(t)]);h1(n),x2(s)}async function rx(t,n){await new Promise(s=>{const o=()=>{clearTimeout(l),n.removeEventListener("abort",o),s()},l=setTimeout(o,t);n.addEventListener("abort",o)})}function Te(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Ze(t){return Te(t).replace(/"/g,"&quot;")}const sx="contextual-knowledge-not-instructions";function ax(t,n,s){const o=s?.whyThisMatched??t.frontmatter.whyThisMatched,l=Q1(t,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">${Pc(X1(t))} 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">${Pc(Z1(t))} 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">${Pc(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 X1(t){const n={id:t.frontmatter.id,title:t.frontmatter.title,status:t.frontmatter.status??null,tags:t.frontmatter.tags,updated:t.frontmatter.updated,summary:Wf(t.body)};return JSON.stringify({...n,token_estimate:Pc(JSON.stringify(n))},null,2)}function Z1(t){return[`# ${t.frontmatter.title} (\`${t.frontmatter.id}\`)`,"",`- updated: ${t.frontmatter.updated}`,`- status: ${t.frontmatter.status??"unknown"}`,`- raw_source_ref: ${t.frontmatter.rawSourceRef??"(none)"}`,`- raw_source_refs: ${(t.frontmatter.rawSourceRefs??[]).join(", ")||"(none)"}`,"","## Summary",Wf(t.body)].join(`
111
- `)}function Q1(t,n){const s=new Set([...t.frontmatter.related??[]]),o=n.filter(l=>s.has(l.id)).sort((l,y)=>l.title.localeCompare(y.title));return[`<fleet-wiki-context boundary="${sx}">`,"# Fleet Wiki Context Pack","",`## Entry: ${t.frontmatter.title} (\`${t.frontmatter.id}\`)`,"",`- updated: ${t.frontmatter.updated}`,`- status: ${t.frontmatter.status??"unknown"}`,`- tags: ${t.frontmatter.tags.join(", ")||"(none)"}`,"","### Summary",Wf(t.body),"","### Related Entries",...o.length>0?o.map(l=>`- [[wiki:${l.id}]] — ${l.title}`):["- (none)"],"","</fleet-wiki-context>"].join(`
112
- `)}function Pc(t){return Math.max(1,Math.ceil(t.length/4))}function Wf(t){return t.replace(/\s+/g," ").trim().slice(0,240)||"(empty)"}async function ox(){return Jn(Xi("/health"))}async function lx(){return Jn(Xi("/workspaces"))}async function cx(){return Jn(Xi("/index"))}async function ux(){return eb(Xi("/index-md"))}async function hx(t){return Jn(Xi(`/entry/${encodeURIComponent(t)}`))}async function dx(t,n=[],s=!1){const o=new URLSearchParams;t&&o.set("q",t),n.length>0&&o.set("tags",n.join(",")),s&&o.set("enhanced","true");const l=o.toString();return Jn(Xi(`/search${l?`?${l}`:""}`))}async function fx(t){return eb(Xi(`/raw?ref=${encodeURIComponent(t)}`))}async function hu(t){return Jn(Xi(`/queue?status=${encodeURIComponent(t)}`))}async function px(t){return Jn(Xi(`/queue/${encodeURIComponent(t)}`))}async function _x(t){return tb(Xi(`/queue/${encodeURIComponent(t)}/approve`),{})}async function gx(t,n){return tb(Xi(`/queue/${encodeURIComponent(t)}/reject`),{reason:n})}async function J1(){return Jn(Xi("/conflicts"))}async function mx(t){return Jn(Xi(`/conflicts/${encodeURIComponent(t)}`))}async function vx(t){const n=typeof t=="number"?`?limit=${encodeURIComponent(String(t))}`:"";return Jn(Xi(`/log${n}`))}function Xi(t){const n=window.location.pathname.match(/^\/console\/codex\/w\/([^/]+)(?:\/|$)/),s=t.startsWith("/")?t:`/${t}`;return n?`/console/codex/w/${encodeURIComponent(decodeURIComponent(n[1]??""))}/api${s}`:`/console/codex/api${s}`}async function Jn(t){const n=await fetch(t,{headers:{accept:"application/json"}});if(!n.ok)throw new Error(await Gf(t,n));return n.json()}async function eb(t){const n=await fetch(t,{headers:{accept:"text/markdown,text/plain"}});if(!n.ok)throw new Error(await Gf(t,n));return n.text()}async function tb(t,n){const s=await fetch(t,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(n)});if(!s.ok)throw new Error(await Gf(t,s));return s.json()}async function Gf(t,n){return(await n.json().catch(()=>null))?.error??`${t} request failed: ${n.status}`}const bx=/^[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}$/,In="/console/codex",_f=new Set;function cl(){const t=Ax(Rx(ab(window.location.pathname)).pathname);return t.name==="queue"?{name:"queue",tab:new URLSearchParams(window.location.search).get("tab")==="archived"?"archived":"pending"}:t}function gf(){return sb(ab(window.location.pathname))?.wsId??null}function Is(t){t!==window.location.pathname+window.location.search&&(window.history.pushState({},"",t),Kf(cl()))}function Sx(t){window.history.replaceState({},"",t),Kf(cl())}function yx(t){return _f.add(t),()=>_f.delete(t)}function Cx(){window.addEventListener("popstate",()=>Kf(cl()))}function Lr(t){return Xn(`/entry/${encodeURIComponent(t)}`)}function ib(t){return Xn(`/raw/${encodeURIComponent(t)}`)}function Na(t="pending"){return Xn(t==="archived"?"/queue?tab=archived":"/queue")}function wx(t){return Xn(`/queue/${encodeURIComponent(t)}`)}function Ex(){return Xn("/conflicts")}function xx(t){return Xn(`/conflicts/${encodeURIComponent(t)}`)}function Tx(){return Xn("/index-md")}function nb(t){return Xn(typeof t!="number"?"/log":`/log?limit=${encodeURIComponent(String(t))}`)}function rb(){return Xn("/")}function qv(t){return`${In}/w/${encodeURIComponent(t)}/`}function Ax(t){if(t==="/index"||t==="/index-md")return{name:"index-md"};if(t==="/log"){const y=new URLSearchParams(window.location.search).get("limit"),S=Number(y??20);return{name:"log",limit:Number.isInteger(S)?S:20}}if(t==="/conflicts")return{name:"conflicts"};const n=t.match(/^\/conflicts\/([^/]+)$/);if(n)return{name:"conflict-detail",id:decodeURIComponent(n[1]??"")};const s=t.match(/^\/entry\/([^/]+)$/);if(s)return{name:"entry",id:decodeURIComponent(s[1]??"")};const o=t.match(/^\/raw\/(.+)$/);if(o)return{name:"raw",ref:decodeURIComponent(o[1]??"")};if(t==="/queue")return{name:"queue",tab:"pending"};const l=t.match(/^\/queue\/([^/]+)$/);if(l){const y=decodeURIComponent(l[1]??"");return bx.test(y)?{name:"queue-detail",patchId:y}:{name:"home"}}return{name:"home"}}function Xn(t){const n=gf();return n?`${In}/w/${encodeURIComponent(n)}${t}`:`${In}${t}`}function Rx(t){const n=sb(t);return n?{pathname:n.pathname,wsId:n.wsId}:{pathname:t,wsId:null}}function sb(t){const n=t.match(/^\/w\/([^/]+)(\/.*)?$/);return n?{wsId:decodeURIComponent(n[1]??""),pathname:n[2]??"/"}:null}function ab(t){return t===In||t===`${In}/`?"/":t.startsWith(`${In}/`)?t.slice(In.length)||"/":t}function Kf(t){for(const n of _f)n(t)}const ob="fleet-wiki-web-recent",mf=new Set,Hs={health:null,index:[],currentEntry:null,currentMatchHint:null,conflicts:[],currentConflict:null,indexMarkdown:null,log:null,loading:!1,error:null,recentIds:Hx(),pendingPatchCount:0,currentWorkspaceId:null,workspaces:[]};function Fc(){return Hs}function kx(t){return mf.add(t),()=>mf.delete(t)}async function Lx(){Zt({loading:!0,error:null});try{const[t,n,s,o]=await Promise.all([ox(),cx(),hu("pending").catch(()=>null),lx().catch(()=>null)]);Zt({health:t,index:n,pendingPatchCount:s?.pendingCount??0,currentWorkspaceId:o?.currentWorkspaceId??null,workspaces:o?.workspaces??[],loading:!1})}catch(t){Zt({loading:!1,error:ja(t)})}}async function Mx(t){Zt({loading:!0,error:null,currentEntry:null,currentMatchHint:Hs.currentMatchHint?.id===t?Hs.currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null});try{const n=await hx(t),s=Ix(t);Zt({currentEntry:n,currentConflict:null,indexMarkdown:null,log:null,recentIds:s,loading:!1})}catch(n){Zt({loading:!1,error:ja(n)})}}async function Dx(){Zt({loading:!0,error:null,currentEntry:null,currentConflict:null,log:null});try{Zt({indexMarkdown:await ux(),loading:!1})}catch(t){Zt({loading:!1,error:ja(t)})}}async function Ox(t){Zt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null});try{Zt({log:await vx(t),loading:!1})}catch(n){Zt({loading:!1,error:ja(n)})}}async function Bx(){Zt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null,log:null});try{Zt({conflicts:await J1(),loading:!1})}catch(t){Zt({loading:!1,error:ja(t)})}}async function Nx(t){Zt({loading:!0,error:null,currentEntry:null,indexMarkdown:null,log:null});try{const[n,s]=await Promise.all([mx(t),J1().catch(()=>Hs.conflicts)]);Zt({currentConflict:n,conflicts:s,loading:!1})}catch(n){Zt({loading:!1,error:ja(n)})}}function Fd(){Zt({currentEntry:null,currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null,error:null,loading:!1})}function lb(t){Zt({currentMatchHint:t})}function Vf(t){Zt({pendingPatchCount:t})}function Zt(t){Object.assign(Hs,t);for(const n of mf)n(Hs)}function Ix(t){const n=[t,...Hs.recentIds.filter(s=>s!==t)].slice(0,8);return window.localStorage.setItem(ob,JSON.stringify(n)),n}function Hx(){try{const t=window.localStorage.getItem(ob),n=t?JSON.parse(t):[];return Array.isArray(n)?n.filter(s=>typeof s=="string").slice(0,8):[]}catch{return[]}}function ja(t){return t instanceof Error?t.message:String(t)}const Me={open:!1,query:"",selectedIndex:0,results:[],debounceId:null,searchSeq:0,previousBodyOverflow:null,previousActiveElement:null};let vf=[],Yf=[];function zx(t,n){vf=t,Yf=n,Me.open&&!Me.query&&(Me.results=Xf(),Me.selectedIndex=0,Zc())}function cb(){if(Me.open){Gv();return}Me.open=!0,Me.query="",Me.selectedIndex=0,Me.results=Xf(),Me.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null,Zx(),Gx(),Zc(),Gv()}function el(){Me.open&&(Me.open=!1,Me.searchSeq++,Me.debounceId!==null&&(window.clearTimeout(Me.debounceId),Me.debounceId=null),Kx(),Qx(),Jx())}function $x(){document.addEventListener("keydown",Ux),document.addEventListener("input",jx),document.addEventListener("click",Px),document.addEventListener("mouseover",Fx)}function Ux(t){if((t.metaKey||t.ctrlKey)&&t.key.toLowerCase()==="k"){t.preventDefault(),Me.open?el():cb();return}if(Me.open){if(t.key==="Tab"){eT(t);return}if(t.key==="Escape"){t.preventDefault(),el();return}if(t.key==="ArrowDown"){t.preventDefault(),Me.selectedIndex=Math.min(Me.selectedIndex+1,Math.max(0,Me.results.length-1)),bf({scroll:!0});return}if(t.key==="ArrowUp"){t.preventDefault(),Me.selectedIndex=Math.max(0,Me.selectedIndex-1),bf({scroll:!0});return}if(t.key==="Enter"){t.preventDefault();const s=Me.results[Me.selectedIndex];if(!s)return;lb(s),Is(Lr(s.id)),el()}}}function jx(t){const n=t.target;!(n instanceof HTMLInputElement)||n.id!=="command-input"||(Me.query=n.value.trim(),Me.selectedIndex=0,Me.debounceId!==null&&window.clearTimeout(Me.debounceId),Me.debounceId=window.setTimeout(()=>{qx(Me.query)},150))}function Px(t){const n=t.target;if(!(n instanceof Element))return;if(n.matches("[data-action='open-command']")||n.closest("[data-action='open-command']")){cb();return}if(!Me.open)return;if(n.classList.contains("command-overlay")){el();return}const s=n.closest("[data-command-entry-id]");if(s){const o=Me.results.find(l=>l.id===(s.dataset.commandEntryId??""));lb(o??null),Is(Lr(s.dataset.commandEntryId??"")),el()}}function Fx(t){if(!Me.open)return;const n=t.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>=Me.results.length||(Me.selectedIndex=o,bf({scroll:!1}))}async function qx(t){const n=++Me.searchSeq;if(!t){Me.results=Xf(),Me.selectedIndex=0,Zc();return}let s;try{s=await dx(t)}catch{s=[]}n!==Me.searchSeq||!Me.open||(Me.results=s,Me.selectedIndex=0,Zc())}function Wx(){let t=document.querySelector("#command-palette-root");return t||(t=document.createElement("div"),t.id="command-palette-root",document.body.append(t)),t}function Gx(){const t=Wx();t.querySelector(".command-overlay")||(t.innerHTML=Vx())}function Kx(){const t=document.querySelector("#command-palette-root");t&&(t.innerHTML="")}function Zc(){const t=document.querySelector("#command-results-list");if(t){if(Me.results.length===0){t.innerHTML=`<p class="empty-state">${Te("No results found.")}</p>`;return}t.innerHTML=Me.query?Me.results.map(ub).join(""):Yx()}}function bf(t={scroll:!0}){const n=document.querySelectorAll(".command-result");n.forEach((o,l)=>{o.classList.toggle("active",l===Me.selectedIndex)});const s=n[Me.selectedIndex];t.scroll&&s?.scrollIntoView({block:"nearest"})}function Vx(){const t=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="${t}" 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 ub(t,n){const s=n===Me.selectedIndex?" active":"",o=Ze(t.title),l=t.tags.slice(0,2),y=t.tags.length-l.length,S=rT(t),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(t.id)}" data-command-index="${n}" title="${o}">
128
- <span class="command-result-text">
129
- <strong>${iT(t.title,Me.query)}</strong>
130
- <small>${Te(nT(t))}</small>
131
- ${S?`<small class="command-result-excerpt">${Te(S)}</small>`:""}
132
- </span>
133
- <span class="command-result-aside">${c}${u}</span>
134
- </button>
135
- `}function Yx(){const t=Xx(),n=Me.results.slice(0,t),s=Me.results.slice(t);return[n.length>0?Wv("Recent",n,0):"",s.length>0?Wv("All",s,t):""].join("")}function Wv(t,n,s){return`
136
- <div class="command-section-heading">${Te(t)}</div>
137
- ${n.map((o,l)=>ub(o,s+l)).join("")}
138
- `}function Xf(){const t=new Set(Yf),n=hb().map(o=>vf.find(l=>l.id===o)).filter(o=>!!o),s=vf.filter(o=>!t.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 Xx(){return hb().filter((t,n)=>Me.results[n]?.id===t).length}function hb(){return Array.from(new Set(Yf))}function Zx(){Me.previousBodyOverflow===null&&(Me.previousBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden")}function Qx(){Me.previousBodyOverflow!==null&&(document.body.style.overflow=Me.previousBodyOverflow,Me.previousBodyOverflow=null)}function Jx(){const t=Me.previousActiveElement;Me.previousActiveElement=null,t?.isConnected&&t.focus()}function Gv(){window.setTimeout(()=>{const t=document.querySelector("#command-input");t&&(t.focus(),t.select())},0)}function eT(t){const n=document.querySelector(".command-card");if(!n)return;const s=tT(n);if(s.length===0){t.preventDefault(),n.focus();return}const o=document.activeElement,l=o instanceof HTMLElement?s.indexOf(o):-1,y=t.shiftKey?l<=0?s.length-1:l-1:l===-1||l===s.length-1?0:l+1;(l===-1||t.shiftKey&&l===0||!t.shiftKey&&l===s.length-1)&&(t.preventDefault(),s[y]?.focus())}function tT(t){const n=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");return Array.from(t.querySelectorAll(n)).filter(s=>!s.hasAttribute("hidden")&&s.offsetParent!==null)}function iT(t,n){if(!n)return Te(t);const s=t.toLocaleLowerCase(),o=n.toLocaleLowerCase();if(!o)return Te(t);let l=0,y="";for(;l<t.length;){const S=s.indexOf(o,l);if(S===-1)break;y+=Te(t.slice(l,S)),y+=`<mark class="command-highlight">${Te(t.slice(S,S+n.length))}</mark>`,l=S+n.length}return y+Te(t.slice(l))}function nT(t){switch(t.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 rT(t){const n=t.matchedSnippets?.find(o=>o.field==="body")?.snippet;if(t.reason!=="body")return"";const s=n??t.excerpt;return sT(s??"")}function sT(t){return oT(aT(t)).replace(/\s+/g," ").trim().slice(0,180)}function aT(t){return t.replace(/<<<[^>]*>>>/g," ")}function oT(t){return t.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 Zf(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Us=Zf();function db(t){Us=t}var tl={exec:()=>null};function lt(t,n=""){let s=typeof t=="string"?t:t.source,o={replace:(l,y)=>{let S=typeof y=="string"?y:y.source;return S=S.replace(Bi.caret,"$1"),s=s.replace(l,S),o},getRegex:()=>new RegExp(s,n)};return o}var lT=(()=>{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:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},cT=/^(?:[ \t]*(?:\n|$))+/,uT=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,hT=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ul=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,dT=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Qf=/(?:[*+-]|\d{1,9}[.)])/,fb=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,pb=lt(fb).replace(/bull/g,Qf).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(),fT=lt(fb).replace(/bull/g,Qf).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(),Jf=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,pT=/^[^\n]+/,ep=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,_T=lt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ep).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),gT=lt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Qf).getRegex(),du="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",tp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,mT=lt("^ {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",tp).replace("tag",du).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),_b=lt(Jf).replace("hr",ul).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",du).getRegex(),vT=lt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",_b).getRegex(),ip={blockquote:vT,code:uT,def:_T,fences:hT,heading:dT,hr:ul,html:mT,lheading:pb,list:gT,newline:cT,paragraph:_b,table:tl,text:pT},Kv=lt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ul).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",du).getRegex(),bT={...ip,lheading:fT,table:Kv,paragraph:lt(Jf).replace("hr",ul).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Kv).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",du).getRegex()},ST={...ip,html:lt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",tp).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:tl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:lt(Jf).replace("hr",ul).replace("heading",` *#{1,6} *[^
139
- ]`).replace("lheading",pb).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},yT=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,CT=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,gb=/^( {2,}|\\)\n(?!\s*$)/,wT=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,fu=/[\p{P}\p{S}]/u,np=/[\s\p{P}\p{S}]/u,mb=/[^\s\p{P}\p{S}]/u,ET=lt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,np).getRegex(),vb=/(?!~)[\p{P}\p{S}]/u,xT=/(?!~)[\s\p{P}\p{S}]/u,TT=/(?:[^\s\p{P}\p{S}]|~)/u,AT=lt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",lT?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),bb=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,RT=lt(bb,"u").replace(/punct/g,fu).getRegex(),kT=lt(bb,"u").replace(/punct/g,vb).getRegex(),Sb="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",LT=lt(Sb,"gu").replace(/notPunctSpace/g,mb).replace(/punctSpace/g,np).replace(/punct/g,fu).getRegex(),MT=lt(Sb,"gu").replace(/notPunctSpace/g,TT).replace(/punctSpace/g,xT).replace(/punct/g,vb).getRegex(),DT=lt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,mb).replace(/punctSpace/g,np).replace(/punct/g,fu).getRegex(),OT=lt(/\\(punct)/,"gu").replace(/punct/g,fu).getRegex(),BT=lt(/^<(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(),NT=lt(tp).replace("(?:-->|$)","-->").getRegex(),IT=lt("^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",NT).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Qc=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,HT=lt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Qc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),yb=lt(/^!?\[(label)\]\[(ref)\]/).replace("label",Qc).replace("ref",ep).getRegex(),Cb=lt(/^!?\[(ref)\](?:\[\])?/).replace("ref",ep).getRegex(),zT=lt("reflink|nolink(?!\\()","g").replace("reflink",yb).replace("nolink",Cb).getRegex(),Vv=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,rp={_backpedal:tl,anyPunctuation:OT,autolink:BT,blockSkip:AT,br:gb,code:CT,del:tl,emStrongLDelim:RT,emStrongRDelimAst:LT,emStrongRDelimUnd:DT,escape:yT,link:HT,nolink:Cb,punctuation:ET,reflink:yb,reflinkSearch:zT,tag:IT,text:wT,url:tl},$T={...rp,link:lt(/^!?\[(label)\]\((.*?)\)/).replace("label",Qc).getRegex(),reflink:lt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Qc).getRegex()},Sf={...rp,emStrongRDelimAst:MT,emStrongLDelim:kT,url:lt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Vv).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:lt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Vv).getRegex()},UT={...Sf,br:lt(gb).replace("{2,}","*").getRegex(),text:lt(Sf.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Rc={normal:ip,gfm:bT,pedantic:ST},Po={normal:rp,gfm:Sf,breaks:UT,pedantic:$T},jT={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Yv=t=>jT[t];function Vn(t,n){if(n){if(Bi.escapeTest.test(t))return t.replace(Bi.escapeReplace,Yv)}else if(Bi.escapeTestNoEncode.test(t))return t.replace(Bi.escapeReplaceNoEncode,Yv);return t}function Xv(t){try{t=encodeURI(t).replace(Bi.percentDecode,"%")}catch{return null}return t}function Zv(t,n){let s=t.replace(Bi.findPipe,(y,S,c)=>{let u=!1,h=S;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 Fo(t,n,s){let o=t.length;if(o===0)return"";let l=0;for(;l<o&&t.charAt(o-l-1)===n;)l++;return t.slice(0,o-l)}function PT(t,n){if(t.indexOf(n[1])===-1)return-1;let s=0;for(let o=0;o<t.length;o++)if(t[o]==="\\")o++;else if(t[o]===n[0])s++;else if(t[o]===n[1]&&(s--,s<0))return o;return s>0?-2:-1}function Qv(t,n,s,o,l){let y=n.href,S=n.title||null,c=t[1].replace(l.other.outputLinkReplace,"$1");o.state.inLink=!0;let u={type:t[0].charAt(0)==="!"?"image":"link",raw:s,href:y,title:S,text:c,tokens:o.inlineTokens(c)};return o.state.inLink=!1,u}function FT(t,n,s){let o=t.match(s.other.indentCodeCompensation);if(o===null)return n;let l=o[1];return n.split(`
140
- `).map(y=>{let S=y.match(s.other.beginningSpace);if(S===null)return y;let[c]=S;return c.length>=l.length?y.slice(l.length):y}).join(`
141
- `)}var Jc=class{options;rules;lexer;constructor(t){this.options=t||Us}space(t){let n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){let n=this.rules.block.code.exec(t);if(n){let s=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?s:Fo(s,`
142
- `)}}}fences(t){let n=this.rules.block.fences.exec(t);if(n){let s=n[0],o=FT(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(t){let n=this.rules.block.heading.exec(t);if(n){let s=n[2].trim();if(this.rules.other.endingHash.test(s)){let o=Fo(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(t){let n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:Fo(n[0],`
143
- `)}}blockquote(t){let n=this.rules.block.blockquote.exec(t);if(n){let s=Fo(n[0],`
144
- `).split(`
145
- `),o="",l="",y=[];for(;s.length>0;){let S=!1,c=[],u;for(u=0;u<s.length;u++)if(this.rules.other.blockquoteStart.test(s[u]))c.push(s[u]),S=!0;else if(!S)c.push(s[u]);else break;s=s.slice(u);let h=c.join(`
146
- `),g=h.replace(this.rules.other.blockquoteSetextReplace,`
147
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
148
- ${h}`:h,l=l?`${l}
149
- ${g}`:g;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(g,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 E=C,T=E.raw+`
150
- `+s.join(`
151
- `),w=this.blockquote(T);y[y.length-1]=w,o=o.substring(0,o.length-E.raw.length)+w.raw,l=l.substring(0,l.length-E.text.length)+w.text;break}else if(C?.type==="list"){let E=C,T=E.raw+`
152
- `+s.join(`
153
- `),w=this.list(T);y[y.length-1]=w,o=o.substring(0,o.length-C.raw.length)+w.raw,l=l.substring(0,l.length-E.raw.length)+w.raw,s=T.substring(y.at(-1).raw.length).split(`
154
- `);continue}}return{type:"blockquote",raw:o,tokens:y,text:l}}}list(t){let n=this.rules.block.list.exec(t);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),S=!1;for(;t;){let u=!1,h="",g="";if(!(n=y.exec(t))||this.rules.block.hr.test(t))break;h=n[0],t=t.substring(h.length);let f=n[2].split(`
155
- `,1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),C=t.split(`
156
- `,1)[0],E=!f.trim(),T=0;if(this.options.pedantic?(T=2,g=f.trimStart()):E?T=n[1].length+1:(T=n[2].search(this.rules.other.nonSpaceChar),T=T>4?1:T,g=f.slice(T),T+=n[1].length),E&&this.rules.other.blankLine.test(C)&&(h+=C+`
157
- `,t=t.substring(C.length+1),u=!0),!u){let b=this.rules.other.nextBulletRegex(T),_=this.rules.other.hrRegex(T),m=this.rules.other.fencesBeginRegex(T),x=this.rules.other.headingBeginRegex(T),R=this.rules.other.htmlBeginRegex(T);for(;t;){let k=t.split(`
158
- `,1)[0],D;if(C=k,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),D=C):D=C.replace(this.rules.other.tabCharGlobal," "),m.test(C)||x.test(C)||R.test(C)||b.test(C)||_.test(C))break;if(D.search(this.rules.other.nonSpaceChar)>=T||!C.trim())g+=`
159
- `+D.slice(T);else{if(E||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||m.test(f)||x.test(f)||_.test(f))break;g+=`
160
- `+C}!E&&!C.trim()&&(E=!0),h+=k+`
161
- `,t=t.substring(k.length+1),f=D.slice(T)}}l.loose||(S?l.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(S=!0));let w=null,p;this.options.gfm&&(w=this.rules.other.listIsTask.exec(g),w&&(p=w[0]!=="[ ] ",g=g.replace(this.rules.other.listReplaceTask,""))),l.items.push({type:"list_item",raw:h,task:!!w,checked:p,loose:!1,text:g,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"),g=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));l.loose=g}if(l.loose)for(let u=0;u<l.items.length;u++)l.items[u].loose=!0;return l}}html(t){let n=this.rules.block.html.exec(t);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(t){let n=this.rules.block.def.exec(t);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(t){let n=this.rules.block.table.exec(t);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let s=Zv(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 S of o)this.rules.other.tableAlignRight.test(S)?y.align.push("right"):this.rules.other.tableAlignCenter.test(S)?y.align.push("center"):this.rules.other.tableAlignLeft.test(S)?y.align.push("left"):y.align.push(null);for(let S=0;S<s.length;S++)y.header.push({text:s[S],tokens:this.lexer.inline(s[S]),header:!0,align:y.align[S]});for(let S of l)y.rows.push(Zv(S,y.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:y.align[u]})));return y}}lheading(t){let n=this.rules.block.lheading.exec(t);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(t){let n=this.rules.block.paragraph.exec(t);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(t){let n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){let n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(t){let n=this.rules.inline.tag.exec(t);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(t){let n=this.rules.inline.link.exec(t);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=Fo(s.slice(0,-1),"\\");if((s.length-y.length)%2===0)return}else{let y=PT(n[2],"()");if(y===-2)return;if(y>-1){let S=(n[0].indexOf("!")===0?5:4)+n[1].length+y;n[2]=n[2].substring(0,y),n[0]=n[0].substring(0,S).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)),Qv(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(t,n){let s;if((s=this.rules.inline.reflink.exec(t))||(s=this.rules.inline.nolink.exec(t))){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 Qv(s,l,s[0],this.lexer,this.rules)}}emStrong(t,n,s=""){let o=this.rules.inline.emStrongLDelim.exec(t);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,S,c=l,u=0,h=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,n=n.slice(-1*t.length+l);(o=h.exec(n))!=null;){if(y=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!y)continue;if(S=[...y].length,o[3]||o[4]){c+=S;continue}else if((o[5]||o[6])&&l%3&&!((l+S)%3)){u+=S;continue}if(c-=S,c>0)continue;S=Math.min(S,S+c+u);let g=[...o[0]][0].length,f=t.slice(0,l+o.index+g+S);if(Math.min(l,S)%2){let E=f.slice(1,-1);return{type:"em",raw:f,text:E,tokens:this.lexer.inlineTokens(E)}}let C=f.slice(2,-2);return{type:"strong",raw:f,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(t){let n=this.rules.inline.code.exec(t);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(t){let n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){let n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t){let n=this.rules.inline.autolink.exec(t);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(t){let n;if(n=this.rules.inline.url.exec(t)){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(t){let n=this.rules.inline.text.exec(t);if(n){let s=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:s}}}},Bn=class yf{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 Jc,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:Rc.normal,inline:Po.normal};this.options.pedantic?(s.block=Rc.pedantic,s.inline=Po.pedantic):this.options.gfm&&(s.block=Rc.gfm,this.options.breaks?s.inline=Po.breaks:s.inline=Po.gfm),this.tokenizer.rules=s}static get rules(){return{block:Rc,inline:Po}}static lex(n,s){return new yf(s).lex(n)}static lexInline(n,s){return new yf(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(S=>(l=S.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 S=s.at(-1);l.raw.length===1&&S!==void 0?S.raw+=`
165
- `:s.push(l);continue}if(l=this.tokenizer.code(n)){n=n.substring(l.raw.length);let S=s.at(-1);S?.type==="paragraph"||S?.type==="text"?(S.raw+=(S.raw.endsWith(`
166
- `)?"":`
167
- `)+l.raw,S.text+=`
168
- `+l.text,this.inlineQueue.at(-1).src=S.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 S=s.at(-1);S?.type==="paragraph"||S?.type==="text"?(S.raw+=(S.raw.endsWith(`
169
- `)?"":`
170
- `)+l.raw,S.text+=`
171
- `+l.raw,this.inlineQueue.at(-1).src=S.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 S=1/0,c=n.slice(1),u;this.options.extensions.startBlock.forEach(h=>{u=h.call({lexer:this},c),typeof u=="number"&&u>=0&&(S=Math.min(S,u))}),S<1/0&&S>=0&&(y=n.substring(0,S+1))}if(this.state.top&&(l=this.tokenizer.paragraph(y))){let S=s.at(-1);o&&S?.type==="paragraph"?(S.raw+=(S.raw.endsWith(`
172
- `)?"":`
173
- `)+l.raw,S.text+=`
174
- `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=S.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 S=s.at(-1);S?.type==="text"?(S.raw+=(S.raw.endsWith(`
175
- `)?"":`
176
- `)+l.raw,S.text+=`
177
- `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=S.text):s.push(l);continue}if(n){let S="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(S);break}else throw new Error(S)}}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 S=!1,c="";for(;n;){S||(c=""),S=!1;let u;if(this.options.extensions?.inline?.some(g=>(u=g.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 g=s.at(-1);u.type==="text"&&g?.type==="text"?(g.raw+=u.raw,g.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 g=1/0,f=n.slice(1),C;this.options.extensions.startInline.forEach(E=>{C=E.call({lexer:this},f),typeof C=="number"&&C>=0&&(g=Math.min(g,C))}),g<1/0&&g>=0&&(h=n.substring(0,g+1))}if(u=this.tokenizer.inlineText(h)){n=n.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(c=u.raw.slice(-1)),S=!0;let g=s.at(-1);g?.type==="text"?(g.raw+=u.raw,g.text+=u.text):s.push(u);continue}if(n){let g="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return s}},eu=class{options;parser;constructor(t){this.options=t||Us}space(t){return""}code({text:t,lang:n,escaped:s}){let o=(n||"").match(Bi.notSpaceStart)?.[0],l=t.replace(Bi.endingNewline,"")+`
178
- `;return o?'<pre><code class="language-'+Vn(o)+'">'+(s?l:Vn(l,!0))+`</code></pre>
179
- `:"<pre><code>"+(s?l:Vn(l,!0))+`</code></pre>
180
- `}blockquote({tokens:t}){return`<blockquote>
181
- ${this.parser.parse(t)}</blockquote>
182
- `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
183
- `}hr(t){return`<hr>
184
- `}list(t){let n=t.ordered,s=t.start,o="";for(let S=0;S<t.items.length;S++){let c=t.items[S];o+=this.listitem(c)}let l=n?"ol":"ul",y=n&&s!==1?' start="'+s+'"':"";return"<"+l+y+`>
185
- `+o+"</"+l+`>
186
- `}listitem(t){let n="";if(t.task){let s=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=s+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=s+" "+Vn(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:s+" ",text:s+" ",escaped:!0}):n+=s+" "}return n+=this.parser.parse(t.tokens,!!t.loose),`<li>${n}</li>
187
- `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
188
- `}table(t){let n="",s="";for(let l=0;l<t.header.length;l++)s+=this.tablecell(t.header[l]);n+=this.tablerow({text:s});let o="";for(let l=0;l<t.rows.length;l++){let y=t.rows[l];s="";for(let S=0;S<y.length;S++)s+=this.tablecell(y[S]);o+=this.tablerow({text:s})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
189
- <thead>
190
- `+n+`</thead>
191
- `+o+`</table>
192
- `}tablerow({text:t}){return`<tr>
193
- ${t}</tr>
194
- `}tablecell(t){let n=this.parser.parseInline(t.tokens),s=t.header?"th":"td";return(t.align?`<${s} align="${t.align}">`:`<${s}>`)+n+`</${s}>
195
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Vn(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:s}){let o=this.parser.parseInline(s),l=Xv(t);if(l===null)return o;t=l;let y='<a href="'+t+'"';return n&&(y+=' title="'+Vn(n)+'"'),y+=">"+o+"</a>",y}image({href:t,title:n,text:s,tokens:o}){o&&(s=this.parser.parseInline(o,this.parser.textRenderer));let l=Xv(t);if(l===null)return Vn(s);t=l;let y=`<img src="${t}" alt="${s}"`;return n&&(y+=` title="${Vn(n)}"`),y+=">",y}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Vn(t.text)}},sp=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Nn=class Cf{options;renderer;textRenderer;constructor(n){this.options=n||Us,this.options.renderer=this.options.renderer||new eu,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new sp}static parse(n,s){return new Cf(s).parse(n)}static parseInline(n,s){return new Cf(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 S=y;switch(S.type){case"space":{o+=this.renderer.space(S);continue}case"hr":{o+=this.renderer.hr(S);continue}case"heading":{o+=this.renderer.heading(S);continue}case"code":{o+=this.renderer.code(S);continue}case"table":{o+=this.renderer.table(S);continue}case"blockquote":{o+=this.renderer.blockquote(S);continue}case"list":{o+=this.renderer.list(S);continue}case"html":{o+=this.renderer.html(S);continue}case"def":{o+=this.renderer.def(S);continue}case"paragraph":{o+=this.renderer.paragraph(S);continue}case"text":{let c=S,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 "'+S.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 S=y;switch(S.type){case"escape":{o+=s.text(S);break}case"html":{o+=s.html(S);break}case"link":{o+=s.link(S);break}case"image":{o+=s.image(S);break}case"strong":{o+=s.strong(S);break}case"em":{o+=s.em(S);break}case"codespan":{o+=s.codespan(S);break}case"br":{o+=s.br(S);break}case"del":{o+=s.del(S);break}case"text":{o+=s.text(S);break}default:{let c='Token with "'+S.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return o}},Zo=class{options;block;constructor(t){this.options=t||Us}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?Bn.lex:Bn.lexInline}provideParser(){return this.block?Nn.parse:Nn.parseInline}},wb=class{defaults=Zf();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Nn;Renderer=eu;TextRenderer=sp;Lexer=Bn;Tokenizer=Jc;Hooks=Zo;constructor(...t){this.use(...t)}walkTokens(t,n){let s=[];for(let o of t)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 S of y)s=s.concat(this.walkTokens(S.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 S=l[y].flat(1/0);s=s.concat(this.walkTokens(S,n))}):l.tokens&&(s=s.concat(this.walkTokens(l.tokens,n)))}}return s}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.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(...S){let c=l.renderer.apply(this,S);return c===!1&&(c=y.apply(this,S)),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 eu(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 S=y,c=s.renderer[S],u=l[S];l[S]=(...h)=>{let g=c.apply(l,h);return g===!1&&(g=u.apply(l,h)),g||""}}o.renderer=l}if(s.tokenizer){let l=this.defaults.tokenizer||new Jc(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 S=y,c=s.tokenizer[S],u=l[S];l[S]=(...h)=>{let g=c.apply(l,h);return g===!1&&(g=u.apply(l,h)),g}}o.tokenizer=l}if(s.hooks){let l=this.defaults.hooks||new Zo;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 S=y,c=s.hooks[S],u=l[S];Zo.passThroughHooks.has(y)?l[S]=h=>{if(this.defaults.async&&Zo.passThroughHooksRespectAsync.has(y))return(async()=>{let f=await c.call(l,h);return u.call(l,f)})();let g=c.call(l,h);return u.call(l,g)}:l[S]=(...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 g=c.apply(l,h);return g===!1&&(g=u.apply(l,h)),g}}o.hooks=l}if(s.walkTokens){let l=this.defaults.walkTokens,y=s.walkTokens;o.walkTokens=function(S){let c=[];return c.push(y.call(this,S)),l&&(c=c.concat(l.call(this,S))),c}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return Bn.lex(t,n??this.defaults)}parser(t,n){return Nn.parse(t,n??this.defaults)}parseMarkdown(t){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=t),l.async)return(async()=>{let S=l.hooks?await l.hooks.preprocess(n):n,c=await(l.hooks?await l.hooks.provideLexer():t?Bn.lex:Bn.lexInline)(S,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():t?Nn.parse:Nn.parseInline)(u,l);return l.hooks?await l.hooks.postprocess(h):h})().catch(y);try{l.hooks&&(n=l.hooks.preprocess(n));let S=(l.hooks?l.hooks.provideLexer():t?Bn.lex:Bn.lexInline)(n,l);l.hooks&&(S=l.hooks.processAllTokens(S)),l.walkTokens&&this.walkTokens(S,l.walkTokens);let c=(l.hooks?l.hooks.provideParser():t?Nn.parse:Nn.parseInline)(S,l);return l.hooks&&(c=l.hooks.postprocess(c)),c}catch(S){return y(S)}}}onError(t,n){return s=>{if(s.message+=`
197
- Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+Vn(s.message+"",!0)+"</pre>";return n?Promise.resolve(o):o}if(n)return Promise.reject(s);throw s}}},zs=new wb;function bt(t,n){return zs.parse(t,n)}bt.options=bt.setOptions=function(t){return zs.setOptions(t),bt.defaults=zs.defaults,db(bt.defaults),bt};bt.getDefaults=Zf;bt.defaults=Us;bt.use=function(...t){return zs.use(...t),bt.defaults=zs.defaults,db(bt.defaults),bt};bt.walkTokens=function(t,n){return zs.walkTokens(t,n)};bt.parseInline=zs.parseInline;bt.Parser=Nn;bt.parser=Nn.parse;bt.Renderer=eu;bt.TextRenderer=sp;bt.Lexer=Bn;bt.lexer=Bn.lex;bt.Tokenizer=Jc;bt.Hooks=Zo;bt.parse=bt;bt.options;bt.setOptions;bt.use;bt.walkTokens;bt.parseInline;Nn.parse;Bn.lex;const{entries:Eb,setPrototypeOf:Jv,isFrozen:qT,getPrototypeOf:WT,getOwnPropertyDescriptor:GT}=Object;let{freeze:Ni,seal:xn,create:Ra}=Object,{apply:wf,construct:Ef}=typeof Reflect<"u"&&Reflect;Ni||(Ni=function(n){return n});xn||(xn=function(n){return n});wf||(wf=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)});Ef||(Ef=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 qo=ci(Array.prototype.forEach),KT=ci(Array.prototype.lastIndexOf),e0=ci(Array.prototype.pop),Wo=ci(Array.prototype.push),VT=ci(Array.prototype.splice),Di=Array.isArray,Qo=ci(String.prototype.toLowerCase),qd=ci(String.prototype.toString),t0=ci(String.prototype.match),Ta=ci(String.prototype.replace),i0=ci(String.prototype.indexOf),YT=ci(String.prototype.trim),XT=ci(Number.prototype.toString),ZT=ci(Boolean.prototype.toString),n0=typeof BigInt>"u"?null:ci(BigInt.prototype.toString),r0=typeof Symbol>"u"?null:ci(Symbol.prototype.toString),qt=ci(Object.prototype.hasOwnProperty),Go=ci(Object.prototype.toString),xi=ci(RegExp.prototype.test),kc=QT(TypeError);function ci(t){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 wf(t,n,o)}}function QT(t){return function(){for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return Ef(t,s)}}function Ge(t,n){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Qo;if(Jv&&Jv(t,null),!Di(n))return t;let o=n.length;for(;o--;){let l=n[o];if(typeof l=="string"){const y=s(l);y!==l&&(qT(n)||(n[o]=y),l=y)}t[l]=!0}return t}function JT(t){for(let n=0;n<t.length;n++)qt(t,n)||(t[n]=null);return t}function Ki(t){const n=Ra(null);for(const[s,o]of Eb(t))qt(t,s)&&(Di(o)?n[s]=JT(o):o&&typeof o=="object"&&o.constructor===Object?n[s]=Ki(o):n[s]=o);return n}function eA(t){switch(typeof t){case"string":return t;case"number":return XT(t);case"boolean":return ZT(t);case"bigint":return n0?n0(t):"0";case"symbol":return r0?r0(t):"Symbol()";case"undefined":return Go(t);case"function":case"object":{if(t===null)return Go(t);const n=t,s=ka(n,"toString");if(typeof s=="function"){const o=s(n);return typeof o=="string"?o:Go(o)}return Go(t)}default:return Go(t)}}function ka(t,n){for(;t!==null;){const o=GT(t,n);if(o){if(o.get)return ci(o.get);if(typeof o.value=="function")return ci(o.value)}t=WT(t)}function s(){return null}return s}function tA(t){try{return xi(t,""),!0}catch{return!1}}const s0=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"]),Wd=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"]),Gd=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"]),iA=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"]),Kd=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"]),nA=Ni(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),a0=Ni(["#text"]),o0=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"]),Vd=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"]),l0=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"]),rA=xn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),sA=xn(/<%[\w\W]*|[\w\W]*%>/gm),aA=xn(/\$\{[\w\W]*/gm),oA=xn(/^data-[\-\w.\u00B7-\uFFFF]+$/),lA=xn(/^aria-[\-\w]+$/),xb=xn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),cA=xn(/^(?:\w+script|data):/i),uA=xn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Tb=xn(/^html$/i),hA=xn(/^[a-z][.\w]*(-[.\w]+)+$/i);var c0=Object.freeze({__proto__:null,ARIA_ATTR:lA,ATTR_WHITESPACE:uA,CUSTOM_ELEMENT:hA,DATA_ATTR:oA,DOCTYPE_NAME:Tb,ERB_EXPR:sA,IS_ALLOWED_URI:xb,IS_SCRIPT_OR_DATA:cA,MUSTACHE_EXPR:rA,TMPLIT_EXPR:aA});const Ko={element:1,text:3,progressingInstruction:7,comment:8,document:9},dA=function(){return typeof window>"u"?null:window},fA=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(S){return S},createScriptURL(S){return S}})}catch{return console.warn("TrustedTypes policy "+y+" could not be created."),null}},u0=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ab(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dA();const n=De=>Ab(De);if(n.version="3.4.2",n.removed=[],!t||!t.document||t.document.nodeType!==Ko.document||!t.Element)return n.isSupported=!1,n;let{document:s}=t;const o=s,l=o.currentScript,{DocumentFragment:y,HTMLTemplateElement:S,Node:c,Element:u,NodeFilter:h,NamedNodeMap:g=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:f,DOMParser:C,trustedTypes:E}=t,T=u.prototype,w=ka(T,"cloneNode"),p=ka(T,"remove"),b=ka(T,"nextSibling"),_=ka(T,"childNodes"),m=ka(T,"parentNode");if(typeof S=="function"){const De=s.createElement("template");De.content&&De.content.ownerDocument&&(s=De.content.ownerDocument)}let x,R="";const{implementation:k,createNodeIterator:D,createDocumentFragment:A,getElementsByTagName:B}=s,{importNode:W}=o;let j=u0();n.isSupported=typeof Eb=="function"&&typeof m=="function"&&k&&k.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:F,ERB_EXPR:H,TMPLIT_EXPR:Z,DATA_ATTR:ee,ARIA_ATTR:P,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:K,CUSTOM_ELEMENT:O}=c0;let{IS_ALLOWED_URI:z}=c0,M=null;const U=Ge({},[...s0,...Wd,...Gd,...Kd,...a0]);let Y=null;const ae=Ge({},[...o0,...Vd,...l0,...Lc]);let ce=Object.seal(Ra(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(Ra(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let oe=!0,_e=!0,Se=!1,be=!0,$e=!1,Pe=!0,Ke=!1,Ct=!1,Be=!1,Qt=!1,gi=!1,mi=!1,un=!0,An=!1;const Jt="user-content-";let ct=!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 Rn=null;const Ti=Ge({},["audio","video","img","source","image","track"]);let Zi=null;const ht=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",Vt="http://www.w3.org/1999/xhtml";let zt=Vt,us=!1,er=null;const Ps=Ge({},[Ii,Kt,Vt],qd);let kn=Ge({},["mi","mo","mn","ms","mtext"]),jn=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,Ie=null;const St=s.createElement("form"),dt=function(q){return q instanceof RegExp||q instanceof Function},Ee=function(){let q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ie&&Ie===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"?qd:Qo,M=qt(q,"ALLOWED_TAGS")&&Di(q.ALLOWED_TAGS)?Ge({},q.ALLOWED_TAGS,ve):U,Y=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,qd):Ps,Zi=qt(q,"ADD_URI_SAFE_ATTR")&&Di(q.ADD_URI_SAFE_ATTR)?Ge(Ki(ht),q.ADD_URI_SAFE_ATTR,ve):ht,Rn=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,_e=q.ALLOW_DATA_ATTR!==!1,Se=q.ALLOW_UNKNOWN_PROTOCOLS||!1,be=q.ALLOW_SELF_CLOSE_IN_ATTR!==!1,$e=q.SAFE_FOR_TEMPLATES||!1,Pe=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,Be=q.FORCE_BODY||!1,un=q.SANITIZE_DOM!==!1,An=q.SANITIZE_NAMED_PROPS||!1,ct=q.KEEP_CONTENT!==!1,Gt=q.IN_PLACE||!1,z=tA(q.ALLOWED_URI_REGEXP)?q.ALLOWED_URI_REGEXP:xb,zt=typeof q.NAMESPACE=="string"?q.NAMESPACE:Vt,kn=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"]),jn=qt(q,"HTML_INTEGRATION_POINTS")&&q.HTML_INTEGRATION_POINTS&&typeof q.HTML_INTEGRATION_POINTS=="object"?Ki(q.HTML_INTEGRATION_POINTS):Ge({},["annotation-xml"]);const pe=qt(q,"CUSTOM_ELEMENT_HANDLING")&&q.CUSTOM_ELEMENT_HANDLING&&typeof q.CUSTOM_ELEMENT_HANDLING=="object"?Ki(q.CUSTOM_ELEMENT_HANDLING):Ra(null);if(ce=Ra(null),qt(pe,"tagNameCheck")&&dt(pe.tagNameCheck)&&(ce.tagNameCheck=pe.tagNameCheck),qt(pe,"attributeNameCheck")&&dt(pe.attributeNameCheck)&&(ce.attributeNameCheck=pe.attributeNameCheck),qt(pe,"allowCustomizedBuiltInElements")&&typeof pe.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=pe.allowCustomizedBuiltInElements),$e&&(_e=!1),gi&&(Qt=!0),It&&(M=Ge({},a0),Y=Ra(null),It.html===!0&&(Ge(M,s0),Ge(Y,o0)),It.svg===!0&&(Ge(M,Wd),Ge(Y,Vd),Ge(Y,Lc)),It.svgFilters===!0&&(Ge(M,Gd),Ge(Y,Vd),Ge(Y,Lc)),It.mathMl===!0&&(Ge(M,Kd),Ge(Y,l0),Ge(Y,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)&&(Y===ae&&(Y=Ki(Y)),Ge(Y,q.ADD_ATTR,ve))),qt(q,"ADD_URI_SAFE_ATTR")&&Di(q.ADD_URI_SAFE_ATTR)&&Ge(Zi,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)),ct&&(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 kc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof q.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw kc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=q.TRUSTED_TYPES_POLICY,R=x.createHTML("")}else x===void 0&&(x=fA(E,l)),x!==null&&typeof R=="string"&&(R=x.createHTML(""));Ni&&Ni(q),Ie=q},Ce=Ge({},[...Wd,...Gd,...iA]),He=Ge({},[...Kd,...nA]),Bt=function(q){let pe=m(q);(!pe||!pe.tagName)&&(pe={namespaceURI:zt,tagName:"template"});const we=Qo(q.tagName),it=Qo(pe.tagName);return er[q.namespaceURI]?q.namespaceURI===Kt?pe.namespaceURI===Vt?we==="svg":pe.namespaceURI===Ii?we==="svg"&&(it==="annotation-xml"||kn[it]):!!Ce[we]:q.namespaceURI===Ii?pe.namespaceURI===Vt?we==="math":pe.namespaceURI===Kt?we==="math"&&jn[it]:!!He[we]:q.namespaceURI===Vt?pe.namespaceURI===Kt&&!jn[it]||pe.namespaceURI===Ii&&!kn[it]?!1:!He[we]&&(tr[we]||!Ce[we]):!!(ti==="application/xhtml+xml"&&er[q.namespaceURI]):!1},Qe=function(q){Wo(n.removed,{element:q});try{m(q).removeChild(q)}catch{p(q)}},vi=function(q,pe){try{Wo(n.removed,{attribute:pe.getAttributeNode(q),from:pe})}catch{Wo(n.removed,{attribute:null,from:pe})}if(pe.removeAttribute(q),q==="is")if(Qt||gi)try{Qe(pe)}catch{}else try{pe.setAttribute(q,"")}catch{}},ir=function(q){let pe=null,we=null;if(Be)q="<remove></remove>"+q;else{const Tt=t0(q,/^[\r\n\t ]+/);we=Tt&&Tt[0]}ti==="application/xhtml+xml"&&zt===Vt&&(q='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+q+"</body></html>");const it=x?x.createHTML(q):q;if(zt===Vt)try{pe=new C().parseFromString(it,ti)}catch{}if(!pe||!pe.documentElement){pe=k.createDocument(zt,"template",null);try{pe.documentElement.innerHTML=us?R:it}catch{}}const Ve=pe.body||pe.documentElement;return q&&we&&Ve.insertBefore(s.createTextNode(we),Ve.childNodes[0]||null),zt===Vt?B.call(pe,Ke?"html":"body")[0]:Ke?pe.documentElement:Ve},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 g)||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(De,q,pe){qo(De,we=>{we.call(n,q,pe,Ie)})}const Ln=function(q){let pe=null;if(wt(j.beforeSanitizeElements,q,null),Hi(q))return Qe(q),!0;const we=ve(q.nodeName);if(wt(j.uponSanitizeElement,q,{tagName:we,allowedTags:M}),Pe&&q.hasChildNodes()&&!xt(q.firstElementChild)&&xi(/<[/\w!]/g,q.innerHTML)&&xi(/<[/\w!]/g,q.textContent)||Pe&&q.namespaceURI===Vt&&we==="style"&&xt(q.firstElementChild)||q.nodeType===Ko.progressingInstruction||Pe&&q.nodeType===Ko.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(ct&&!Ht[we]){const it=m(q)||q.parentNode,Ve=_(q)||q.childNodes;if(Ve&&it){const Tt=Ve.length;for(let $t=Tt-1;$t>=0;--$t){const Ut=w(Ve[$t],!0);it.insertBefore(Ut,b(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):($e&&q.nodeType===Ko.text&&(pe=q.textContent,qo([F,H,Z],it=>{pe=Ta(pe,it," ")}),q.textContent!==pe&&(Wo(n.removed,{element:q.cloneNode()}),q.textContent=pe)),wt(j.afterSanitizeElements,q,null),!1)},Mr=function(q,pe,we){if(Q[pe]||un&&(pe==="id"||pe==="name")&&(we in s||we in St))return!1;const it=Y[pe]||$.attributeCheck instanceof Function&&$.attributeCheck(pe,q);if(!(_e&&!Q[pe]&&xi(ee,pe))){if(!(oe&&xi(P,pe))){if(!it||Q[pe]){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,pe)||ce.attributeNameCheck instanceof Function&&ce.attributeNameCheck(pe,q))||pe==="is"&&ce.allowCustomizedBuiltInElements&&(ce.tagNameCheck instanceof RegExp&&xi(ce.tagNameCheck,we)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(we))))return!1}else if(!Zi[pe]){if(!xi(z,Ta(we,K,""))){if(!((pe==="src"||pe==="xlink:href"||pe==="href")&&q!=="script"&&i0(we,"data:")===0&&Rn[q])){if(!(Se&&!xi(V,Ta(we,K,"")))){if(we)return!1}}}}}}return!0},Fs=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!Fs[Qo(q)]&&xi(O,q)},hs=function(q){wt(j.beforeSanitizeAttributes,q,null);const{attributes:pe}=q;if(!pe||Hi(q))return;const we={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y,forceKeepAttr:void 0};let it=pe.length;for(;it--;){const Ve=pe[it],{name:Tt,namespaceURI:$t,value:Ut}=Ve,ge=ve(Tt),Le=Ut;let Oe=Tt==="value"?Le:YT(Le);if(we.attrName=ge,we.attrValue=Oe,we.keepAttr=!0,we.forceKeepAttr=void 0,wt(j.uponSanitizeAttribute,q,we),Oe=we.attrValue,An&&(ge==="id"||ge==="name")&&i0(Oe,Jt)!==0&&(vi(Tt,q),Oe=Jt+Oe),Pe&&xi(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Oe)){vi(Tt,q);continue}if(ge==="attributename"&&t0(Oe,"href")){vi(Tt,q);continue}if(we.forceKeepAttr)continue;if(!we.keepAttr){vi(Tt,q);continue}if(!be&&xi(/\/>/i,Oe)){vi(Tt,q);continue}$e&&qo([F,H,Z],Mt=>{Oe=Ta(Oe,Mt," ")});const st=ve(q.nodeName);if(!Mr(st,ge,Oe)){vi(Tt,q);continue}if(x&&typeof E=="object"&&typeof E.getAttributeType=="function"&&!$t)switch(E.getAttributeType(st,ge)){case"TrustedHTML":{Oe=x.createHTML(Oe);break}case"TrustedScriptURL":{Oe=x.createScriptURL(Oe);break}}if(Oe!==Le)try{$t?q.setAttributeNS($t,Tt,Oe):q.setAttribute(Tt,Oe),Hi(q)?Qe(q):e0(n.removed)}catch{vi(Tt,q)}}wt(j.afterSanitizeAttributes,q,null)},Pn=function(q){let pe=null;const we=nr(q);for(wt(j.beforeSanitizeShadowDOM,q,null);pe=we.nextNode();)wt(j.uponSanitizeShadowNode,pe,null),Ln(pe),hs(pe),pe.content instanceof y&&Pn(pe.content);wt(j.afterSanitizeShadowDOM,q,null)};return n.sanitize=function(De){let q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},pe=null,we=null,it=null,Ve=null;if(us=!De,us&&(De="<!-->"),typeof De!="string"&&!xt(De)&&(De=eA(De),typeof De!="string"))throw kc("dirty is not a string, aborting");if(!n.isSupported)return De;if(Ct||Ee(q),n.removed=[],typeof De=="string"&&(Gt=!1),Gt){const Ut=De.nodeName;if(typeof Ut=="string"){const ge=ve(Ut);if(!M[ge]||me[ge])throw kc("root node is forbidden and cannot be sanitized in-place")}}else if(De instanceof c)pe=ir("<!---->"),we=pe.ownerDocument.importNode(De,!0),we.nodeType===Ko.element&&we.nodeName==="BODY"||we.nodeName==="HTML"?pe=we:pe.appendChild(we);else{if(!Qt&&!$e&&!Ke&&De.indexOf("<")===-1)return x&&mi?x.createHTML(De):De;if(pe=ir(De),!pe)return Qt?null:mi?R:""}pe&&Be&&Qe(pe.firstChild);const Tt=nr(Gt?De:pe);for(;it=Tt.nextNode();)Ln(it),hs(it),it.content instanceof y&&Pn(it.content);if(Gt)return De;if(Qt){if($e){pe.normalize();let Ut=pe.innerHTML;qo([F,H,Z],ge=>{Ut=Ta(Ut,ge," ")}),pe.innerHTML=Ut}if(gi)for(Ve=A.call(pe.ownerDocument);pe.firstChild;)Ve.appendChild(pe.firstChild);else Ve=pe;return(Y.shadowroot||Y.shadowrootmode)&&(Ve=W.call(o,Ve,!0)),Ve}let $t=Ke?pe.outerHTML:pe.innerHTML;return Ke&&M["!doctype"]&&pe.ownerDocument&&pe.ownerDocument.doctype&&pe.ownerDocument.doctype.name&&xi(Tb,pe.ownerDocument.doctype.name)&&($t="<!DOCTYPE "+pe.ownerDocument.doctype.name+`>
198
- `+$t),$e&&qo([F,H,Z],Ut=>{$t=Ta($t,Ut," ")}),x&&mi?x.createHTML($t):$t},n.setConfig=function(){let De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ee(De),Ct=!0},n.clearConfig=function(){Ie=null,Ct=!1},n.isValidAttribute=function(De,q,pe){Ie||Ee({});const we=ve(De),it=ve(q);return Mr(we,it,pe)},n.addHook=function(De,q){typeof q=="function"&&Wo(j[De],q)},n.removeHook=function(De,q){if(q!==void 0){const pe=KT(j[De],q);return pe===-1?void 0:VT(j[De],pe,1)[0]}return e0(j[De])},n.removeHooks=function(De){j[De]=[]},n.removeAllHooks=function(){j=u0()},n}var il=Ab(),Yd,h0;function pA(){if(h0)return Yd;h0=1;function t(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],Ie=typeof ve;(Ie==="object"||Ie==="function")&&!Object.isFrozen(ve)&&t(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 Ie in X)ve[Ie]=X[Ie];return he.forEach(function(Ie){for(const St in Ie)ve[St]=Ie[St]}),ve}const l="</span>",y=X=>!!X.scope,S=(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((Ie,St)=>`${Ie}${"_".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=S(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(Ie=>this._walk(he,Ie)),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 g 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 Ie=he.root;ve&&(Ie.scope=`language:${ve}`),this.add(Ie)}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 E(X){return w("(?:",X,")*")}function T(X){return w("(?:",X,")?")}function w(...X){return X.map(ve=>f(ve)).join("")}function p(X){const he=X[X.length-1];return typeof he=="object"&&he.constructor===Object?(X.splice(X.length-1,1),he):{}}function b(...X){return"("+(p(X).capture?"":"?:")+X.map(Ie=>f(Ie)).join("|")+")"}function _(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 x=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function R(X,{joinWith:he}){let ve=0;return X.map(Ie=>{ve+=1;const St=ve;let dt=f(Ie),Ee="";for(;dt.length>0;){const Ce=x.exec(dt);if(!Ce){Ee+=dt;break}Ee+=dt.substring(0,Ce.index),dt=dt.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(Ie=>`(${Ie})`).join(he)}const k=/\b\B/,D="[a-zA-Z]\\w*",A="[a-zA-Z_]\\w*",B="\\b\\d+(\\.\\d+)?",W="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",j="\\b(0b[01]+)",F="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",H=(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,Ie)=>{ve.index!==0&&Ie.ignoreMatch()}},X)},Z={begin:"\\\\[\\s\\S]",relevance:0},ee={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Z]},P={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Z]},V={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 Ie=o({scope:"comment",begin:X,end:he,contains:[]},ve);Ie.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=b("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 Ie.contains.push({begin:w(/[ ]+/,"(",St,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ie},O=K("//","$"),z=K("/\\*","\\*/"),M=K("#","$"),U={scope:"number",begin:B,relevance:0},Y={scope:"number",begin:W,relevance:0},ae={scope:"number",begin:j,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:A,relevance:0},$={begin:"\\.\\s*"+A,relevance:0};var _e=Object.freeze({__proto__:null,APOS_STRING_MODE:ee,BACKSLASH_ESCAPE:Z,BINARY_NUMBER_MODE:ae,BINARY_NUMBER_RE:j,COMMENT:K,C_BLOCK_COMMENT_MODE:z,C_LINE_COMMENT_MODE:O,C_NUMBER_MODE:Y,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:k,METHOD_GUARD:$,NUMBER_MODE:U,NUMBER_RE:B,PHRASAL_WORDS_MODE:V,QUOTE_STRING_MODE:P,REGEXP_MODE:ce,RE_STARTERS_RE:F,SHEBANG:H,TITLE_MODE:me,UNDERSCORE_IDENT_RE:A,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 $e(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 Pe(X,he){Array.isArray(X.illegal)&&(X.illegal=b(...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 Be=(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(Ie=>{delete X[Ie]}),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 Ie=Object.create(null);return typeof X=="string"?St(ve,X.split(" ")):Array.isArray(X)?St(ve,X):Object.keys(X).forEach(function(dt){Object.assign(Ie,mi(X[dt],he,dt))}),Ie;function St(dt,Ee){he&&(Ee=Ee.map(Ce=>Ce.toLowerCase())),Ee.forEach(function(Ce){const He=Ce.split("|");Ie[He[0]]=[dt,un(He[0],He[1])]})}}function un(X,he){return he?Number(he):An(X)?0:1}function An(X){return Qt.includes(X.toLowerCase())}const Jt={},ct=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 Ie=0;const St=X[ve],dt={},Ee={};for(let Ce=1;Ce<=he.length;Ce++)Ee[Ce+Ie]=St[Ce],dt[Ce+Ie]=!0,Ie+=_(he[Ce-1]);X[ve]=Ee,X[ve]._emit=dt,X[ve]._multi=!0}function Rn(X){if(Array.isArray(X.begin)){if(X.skip||X.excludeBegin||X.returnBegin)throw ct("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ht;if(typeof X.beginScope!="object"||X.beginScope===null)throw ct("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 ct("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ht;if(typeof X.endScope!="object"||X.endScope===null)throw ct("endScope must be object"),Ht;ei(X,X.end,{key:"endScope"}),X.end=R(X.end,{joinWith:""})}}function Zi(X){X.scope&&typeof X.scope=="object"&&X.scope!==null&&(X.beginScope=X.scope,delete X.scope)}function ht(X){Zi(X),typeof X.beginScope=="string"&&(X.beginScope={_wrap:X.beginScope}),typeof X.endScope=="string"&&(X.endScope={_wrap:X.endScope}),Rn(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,He){He.position=this.position++,this.matchIndexes[this.matchAt]=He,this.regexes.push([He,Ce]),this.matchAt+=_(Ce)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ce=this.regexes.map(He=>He[1]);this.matcherRe=he(R(Ce,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ce){this.matcherRe.lastIndex=this.lastIndex;const He=this.matcherRe.exec(Ce);if(!He)return null;const Bt=He.findIndex((vi,ir)=>ir>0&&vi!==void 0),Qe=this.matchIndexes[Bt];return He.splice(0,Bt),Object.assign(He,Qe)}}class Ie{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 He=new ve;return this.rules.slice(Ce).forEach(([Bt,Qe])=>He.addRule(Bt,Qe)),He.compile(),this.multiRegexes[Ce]=He,He}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ce,He){this.rules.push([Ce,He]),He.type==="begin"&&this.count++}exec(Ce){const He=this.getMatcher(this.regexIndex);He.lastIndex=this.lastIndex;let Bt=He.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 Ie;return Ee.contains.forEach(He=>Ce.addRule(He.begin,{rule:He,type:"begin"})),Ee.terminatorEnd&&Ce.addRule(Ee.terminatorEnd,{type:"end"}),Ee.illegal&&Ce.addRule(Ee.illegal,{type:"illegal"}),Ce}function dt(Ee,Ce){const He=Ee;if(Ee.isCompiled)return He;[be,Ke,ht,Be].forEach(Qe=>Qe(Ee,Ce)),X.compilerExtensions.forEach(Qe=>Qe(Ee,Ce)),Ee.__beforeBegin=null,[$e,Pe,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)),He.keywordPatternRe=he(Bt,!0),Ce&&(Ee.begin||(Ee.begin=/\B|\b/),He.beginRe=he(He.begin),!Ee.end&&!Ee.endsWithParent&&(Ee.end=/\B|\b/),Ee.end&&(He.endRe=he(He.end)),He.terminatorEnd=f(He.end)||"",Ee.endsWithParent&&Ce.terminatorEnd&&(He.terminatorEnd+=(Ee.end?"|":"")+Ce.terminatorEnd)),Ee.illegal&&(He.illegalRe=he(Ee.illegal)),Ee.contains||(Ee.contains=[]),Ee.contains=[].concat(...Ee.contains.map(function(Qe){return Vt(Qe==="self"?Ee:Qe)})),Ee.contains.forEach(function(Qe){dt(Qe,He)}),Ee.starts&&dt(Ee.starts,Ce),He.matcher=St(He),He}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||{}),dt(X)}function Kt(X){return X?X.endsWithParent||Kt(X.starts):!1}function Vt(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,kn=Symbol("nomatch"),jn=7,tr=function(X){const he=Object.create(null),ve=Object.create(null),Ie=[];let St=!0;const dt="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:g};function He(ge){return Ce.noHighlightRe.test(ge)}function Bt(ge){let Le=ge.className+" ";Le+=ge.parentNode?ge.parentNode.className:"";const Oe=Ce.languageDetectRe.exec(Le);if(Oe){const st=q(Oe[1]);return st||(Gt(dt.replace("{}",Oe[1])),Gt("Falling back to no-highlight mode for this block.",ge)),st?Oe[1]:"no-highlight"}return Le.split(/\s+/).find(st=>He(st)||q(st))}function Qe(ge,Le,Oe){let st="",Mt="";typeof Le=="object"?(st=ge,Oe=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,st=Le),Oe===void 0&&(Oe=!0);const Ai={code:st,language:Mt};$t("before:highlight",Ai);const Qi=Ai.result?Ai.result:vi(Ai.language,Ai.code,Oe);return Qi.code=Ai.code,$t("after:highlight",Qi),Qi}function vi(ge,Le,Oe,st){const Mt=Object.create(null);function Ai(ye,Ae){return ye.keywords[Ae]}function Qi(){if(!Ue.keywords){ii.addText(ft);return}let ye=0;Ue.keywordPatternRe.lastIndex=0;let Ae=Ue.keywordPatternRe.exec(ft),Fe="";for(;Ae;){Fe+=ft.substring(ye,Ae.index);const Je=bi.case_insensitive?Ae[0].toLowerCase():Ae[0],Nt=Ai(Ue,Je);if(Nt){const[hn,Ga]=Nt;if(ii.addText(Fe),Fe="",Mt[Je]=(Mt[Je]||0)+1,Mt[Je]<=jn&&(Dr+=Ga),hn.startsWith("_"))Fe+=Ae[0];else{const pl=bi.classNameAliases[hn]||hn;Ji(Ae[0],pl)}}else Fe+=Ae[0];ye=Ue.keywordPatternRe.lastIndex,Ae=Ue.keywordPatternRe.exec(ft)}Fe+=ft.substring(ye),ii.addText(Fe)}function zi(){if(ft==="")return;let ye=null;if(typeof Ue.subLanguage=="string"){if(!he[Ue.subLanguage]){ii.addText(ft);return}ye=vi(Ue.subLanguage,ft,!0,fl[Ue.subLanguage]),fl[Ue.subLanguage]=ye._top}else ye=nr(ft,Ue.subLanguage.length?Ue.subLanguage:null);Ue.relevance>0&&(Dr+=ye.relevance),ii.__addSublanguage(ye._emitter,ye.language)}function Et(){Ue.subLanguage!=null?zi():Qi(),ft=""}function Ji(ye,Ae){ye!==""&&(ii.startScope(Ae),ii.addText(ye),ii.endScope())}function hl(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?Ji(hn,Nt):(ft=hn,Qi(),ft=""),Fe++}}function qs(ye,Ae){return ye.scope&&typeof ye.scope=="string"&&ii.openNode(bi.classNameAliases[ye.scope]||ye.scope),ye.beginScope&&(ye.beginScope._wrap?(Ji(ft,bi.classNameAliases[ye.beginScope._wrap]||ye.beginScope._wrap),ft=""):ye.beginScope._multi&&(hl(ye.beginScope,Ae),ft="")),Ue=Object.create(ye,{parent:{value:Ue}}),Ue}function Fa(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 Fa(ye.parent,Ae,Fe)}function Ws(ye){return Ue.matcher.regexIndex===0?(ft+=ye[0],1):(Or=!0,0)}function _u(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 Ws(Ae);return Fe.skip?ft+=Ae:(Fe.excludeBegin&&(ft+=Ae),Et(),!Fe.returnBegin&&!Fe.excludeBegin&&(ft=Ae)),qs(Fe,ye),Fe.returnBegin?0:Ae.length}function $i(ye){const Ae=ye[0],Fe=Le.substring(ye.index),Je=Fa(Ue,ye,Fe);if(!Je)return kn;const Nt=Ue;Ue.endScope&&Ue.endScope._wrap?(Et(),Ji(Ae,Ue.endScope._wrap)):Ue.endScope&&Ue.endScope._multi?(Et(),hl(Ue.endScope,ye)):Nt.skip?ft+=Ae:(Nt.returnEnd||Nt.excludeEnd||(ft+=Ae),Et(),Nt.excludeEnd&&(ft=Ae));do Ue.scope&&ii.closeNode(),!Ue.skip&&!Ue.subLanguage&&(Dr+=Ue.relevance),Ue=Ue.parent;while(Ue!==Je.parent);return Je.starts&&qs(Je.starts,ye),Nt.returnEnd?0:Ae.length}function qa(){const ye=[];for(let Ae=Ue;Ae!==bi;Ae=Ae.parent)Ae.scope&&ye.unshift(Ae.scope);ye.forEach(Ae=>ii.openNode(Ae))}let ds={};function Gs(ye,Ae){const Fe=Ae&&Ae[0];if(ft+=ye,Fe==null)return Et(),0;if(ds.type==="begin"&&Ae.type==="end"&&ds.index===Ae.index&&Fe===""){if(ft+=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 _u(Ae);if(Ae.type==="illegal"&&!Oe){const Je=new Error('Illegal lexeme "'+Fe+'" for mode "'+(Ue.scope||"<unnamed>")+'"');throw Je.mode=Ue,Je}else if(Ae.type==="end"){const Je=$i(Ae);if(Je!==kn)return Je}if(Ae.type==="illegal"&&Fe==="")return ft+=`
200
- `,1;if(Wa>1e5&&Wa>Ae.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ft+=Fe,Fe.length}const bi=q(ge);if(!bi)throw ct(dt.replace("{}",ge)),new Error('Unknown language: "'+ge+'"');const dl=Ii(bi);let Ks="",Ue=st||dl;const fl={},ii=new Ce.__emitter(Ce);qa();let ft="",Dr=0,sr=0,Wa=0,Or=!1;try{if(bi.__emitTokens)bi.__emitTokens(Le,ii);else{for(Ue.matcher.considerAll();;){Wa++,Or?Or=!1:Ue.matcher.considerAll(),Ue.matcher.lastIndex=sr;const ye=Ue.matcher.exec(Le);if(!ye)break;const Ae=Le.substring(sr,ye.index),Fe=Gs(Ae,ye);sr=ye.index+Fe}Gs(Le.substring(sr))}return ii.finalize(),Ks=ii.toHTML(),{language:ge,value:Ks,relevance:Dr,illegal:!1,_emitter:ii,_top:Ue}}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:Ks},_emitter:ii};if(St)return{language:ge,value:er(Le),illegal:!1,relevance:0,errorRaised:ye,_emitter:ii,_top:Ue};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 Oe=ir(ge),st=Le.filter(q).filter(we).map(Et=>vi(Et,ge,!1));st.unshift(Oe);const Mt=st.sort((Et,Ji)=>{if(Et.relevance!==Ji.relevance)return Ji.relevance-Et.relevance;if(Et.language&&Ji.language){if(q(Et.language).supersetOf===Ji.language)return 1;if(q(Ji.language).supersetOf===Et.language)return-1}return 0}),[Ai,Qi]=Mt,zi=Ai;return zi.secondBest=Qi,zi}function Hi(ge,Le,Oe){const st=Le&&ve[Le]||Oe;ge.classList.add("hljs"),ge.classList.add(`language-${st}`)}function xt(ge){let Le=null;const Oe=Bt(ge);if(He(Oe))return;if($t("before:highlightElement",{el:ge,language:Oe}),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 st=Le.textContent,Mt=Oe?Qe(st,{language:Oe,ignoreIllegals:!0}):nr(st);ge.innerHTML=Mt.value,ge.dataset.highlighted="yes",Hi(ge,Oe,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:st})}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 Fs=!1;function rr(){function ge(){rr()}if(document.readyState==="loading"){Fs||window.addEventListener("DOMContentLoaded",ge,!1),Fs=!0;return}document.querySelectorAll(Ce.cssSelector).forEach(xt)}function hs(ge,Le){let Oe=null;try{Oe=Le(X)}catch(st){if(ct("Language definition for '{}' could not be registered.".replace("{}",ge)),St)ct(st);else throw st;Oe=Ee}Oe.name||(Oe.name=ge),he[ge]=Oe,Oe.rawDefinition=Le.bind(null,X),Oe.aliases&&pe(Oe.aliases,{languageName:ge})}function Pn(ge){delete he[ge];for(const Le of Object.keys(ve))ve[Le]===ge&&delete ve[Le]}function De(){return Object.keys(he)}function q(ge){return ge=(ge||"").toLowerCase(),he[ge]||he[ve[ge]]}function pe(ge,{languageName:Le}){typeof ge=="string"&&(ge=[ge]),ge.forEach(Oe=>{ve[Oe.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 Ve(ge){it(ge),Ie.push(ge)}function Tt(ge){const Le=Ie.indexOf(ge);Le!==-1&&Ie.splice(Le,1)}function $t(ge,Le){const Oe=ge;Ie.forEach(function(st){st[Oe]&&st[Oe](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:Pn,listLanguages:De,getLanguage:q,registerAliases:pe,autoDetection:we,inherit:Ps,addPlugin:Ve,removePlugin:Tt}),X.debugMode=function(){St=!1},X.safeMode=function(){St=!0},X.versionString=zt,X.regex={concat:w,lookahead:C,either:b,optional:T,anyNumberOfTimes:E};for(const ge in _e)typeof _e[ge]=="object"&&t(_e[ge]);return Object.assign(X,_e),X},ti=tr({});return ti.newInstance=()=>tr({}),Yd=ti,ti.HighlightJS=ti,ti.default=ti,Yd}var _A=pA();const Sn=Xy(_A);function d0(t){const n=t.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:[t.BACKSLASH_ESCAPE]},y=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),S={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,s,l]};l.contains.push(c);const u={match:/\\"/},h={className:"string",begin:/'/,end:/'/},g={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,s]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],E=t.SHEBANG({binary:`(${C.join("|")})`,relevance:10}),T={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.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"],p=["true","false"],b={match:/(\/[a-z._-]+)+/},_=["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"],x=["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:p,built_in:[..._,...m,"set","shopt",...x,...R]},contains:[E,t.SHEBANG(),T,f,y,S,b,c,u,h,g,s]}}const f0="[A-Za-z$_][0-9A-Za-z$_]*",gA=["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"],mA=["true","false","null","undefined","NaN","Infinity"],Rb=["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"],kb=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Lb=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],vA=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],bA=[].concat(Lb,Rb,kb);function p0(t){const n=t.regex,s=(K,{after:O})=>{const z="</"+K[0].slice(1);return K.input.indexOf(z,O)!==-1},o=f0,l={begin:"<>",end:"</>"},y=/<[A-Za-z0-9\\._:-]+\s*\/>/,S={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(K,O)=>{const z=K[0].length+K.index,M=K.input[z];if(M==="<"||M===","){O.ignoreMatch();return}M===">"&&(s(K,{after:z})||O.ignoreMatch());let U;const Y=K.input.substring(z);if(U=Y.match(/^\s*=/)){O.ignoreMatch();return}if((U=Y.match(/^\s+extends\s+/))&&U.index===0){O.ignoreMatch();return}}},c={$pattern:f0,keyword:gA,literal:mA,built_in:bA,"variable.language":vA},u="[0-9](_?[0-9])*",h=`\\.(${u})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${g})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${g})\\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:[]},E={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},T={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},p={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},_={className:"comment",variants:[t.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}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},m=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,E,T,w,p,{match:/\$\d+/},f];C.contains=m.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(m)});const x=[].concat(_,C.contains),R=x.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(x)}]),k={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"}}]},A={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:{_:[...Rb,...kb]}},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:[k],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(K){return n.concat("(?!",K.join("|"),")")}const H={match:n.concat(/\b/,F([...Lb,"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:/\(\)/},k]},P="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,o,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(P)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[k]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:A},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,E,T,w,p,_,{match:/\$\d+/},f,A,{scope:"attr",match:o+n.lookahead(":"),relevance:0},V,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[_,t.REGEXP_MODE,{className:"function",begin:P,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.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:S.begin,"on:begin":S.isTrulyOpeningTag,end:S.end}],subLanguage:"xml",contains:[{begin:S.begin,end:S.end,skip:!0,contains:["self"]}]}]},W,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[k,t.inherit(t.TITLE_MODE,{begin:o,className:"title.function"})]},{match:/\.\.\./,relevance:0},Z,{match:"\\$"+o,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[k]},H,j,D,ee,{match:/\$[(.]/}]}}function SA(t){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,t.QUOTE_STRING_MODE,l,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function _0(t){const n=t.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},S={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}/}]},g={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=t.inherit(h,{contains:[]}),C=t.inherit(g,{contains:[]});h.contains.push(C),g.contains.push(f);let E=[s,u];return[h,g,f,C].forEach(b=>{b.contains=b.contains.concat(E)}),E=E.concat(h,g),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:E},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:E}]}]},s,y,h,g,{className:"quote",begin:"^>\\s+",contains:E,end:"$"},l,o,u,S,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function g0(t){const n=t.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:/#/},g={begin:/\{\{/,relevance:0},f={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u,g,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u,g,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:[t.BACKSLASH_ESCAPE,g,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,g,h]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",E=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,T=`\\b|${o.join("|")}`,w={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${E}))[eE][+-]?(${C})[jJ]?(?=${T})`},{begin:`(${E})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${T})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${T})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${T})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${T})`},{begin:`\\b(${C})[jJ](?=${T})`}]},p={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},b={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",u,w,f,t.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,p,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,s],scope:{1:"keyword",3:"title.function"},contains:[b]},{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,b,f]}]}}const tu="[A-Za-z$_][0-9A-Za-z$_]*",Mb=["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"],Db=["true","false","null","undefined","NaN","Infinity"],Ob=["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"],Bb=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Nb=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ib=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Hb=[].concat(Nb,Ob,Bb);function yA(t){const n=t.regex,s=(K,{after:O})=>{const z="</"+K[0].slice(1);return K.input.indexOf(z,O)!==-1},o=tu,l={begin:"<>",end:"</>"},y=/<[A-Za-z0-9\\._:-]+\s*\/>/,S={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(K,O)=>{const z=K[0].length+K.index,M=K.input[z];if(M==="<"||M===","){O.ignoreMatch();return}M===">"&&(s(K,{after:z})||O.ignoreMatch());let U;const Y=K.input.substring(z);if(U=Y.match(/^\s*=/)){O.ignoreMatch();return}if((U=Y.match(/^\s+extends\s+/))&&U.index===0){O.ignoreMatch();return}}},c={$pattern:tu,keyword:Mb,literal:Db,built_in:Hb,"variable.language":Ib},u="[0-9](_?[0-9])*",h=`\\.(${u})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${g})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${g})\\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:[]},E={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},T={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},p={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},_={className:"comment",variants:[t.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}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},m=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,E,T,w,p,{match:/\$\d+/},f];C.contains=m.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(m)});const x=[].concat(_,C.contains),R=x.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(x)}]),k={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"}}]},A={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:{_:[...Ob,...Bb]}},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:[k],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(K){return n.concat("(?!",K.join("|"),")")}const H={match:n.concat(/\b/,F([...Nb,"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:/\(\)/},k]},P="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,o,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(P)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[k]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:A},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,E,T,w,p,_,{match:/\$\d+/},f,A,{scope:"attr",match:o+n.lookahead(":"),relevance:0},V,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[_,t.REGEXP_MODE,{className:"function",begin:P,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.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:S.begin,"on:begin":S.isTrulyOpeningTag,end:S.end}],subLanguage:"xml",contains:[{begin:S.begin,end:S.end,skip:!0,contains:["self"]}]}]},W,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[k,t.inherit(t.TITLE_MODE,{begin:o,className:"title.function"})]},{match:/\.\.\./,relevance:0},Z,{match:"\\$"+o,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[k]},H,j,D,ee,{match:/\$[(.]/}]}}function m0(t){const n=t.regex,s=yA(t),o=tu,l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],y={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},S={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:tu,keyword:Mb.concat(u),literal:Db,built_in:Hb.concat(l),"variable.language":Ib},g={className:"meta",begin:"@"+o},f=(w,p,b)=>{const _=w.contains.findIndex(m=>m.label===p);if(_===-1)throw new Error("can not find mode to replace");w.contains.splice(_,1,b)};Object.assign(s.keywords,h),s.exports.PARAMS_CONTAINS.push(g);const C=s.contains.find(w=>w.scope==="attr"),E=Object.assign({},C,{match:n.concat(o,n.lookahead(/\s*\?:/))});s.exports.PARAMS_CONTAINS.push([s.exports.CLASS_REFERENCE,C,E]),s.contains=s.contains.concat([g,y,S,E]),f(s,"shebang",t.SHEBANG()),f(s,"use_strict",c);const T=s.contains.find(w=>w.label==="func.def");return T.relevance=0,Object.assign(s,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),s}const CA=/\[\[wiki:([^\]]+)\]\]/g,wA=new wb({gfm:!0,breaks:!1}),v0={ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto):|[#/]|\.{0,2}\/|[^:]+$)/i,ADD_ATTR:["target","rel","data-entry-id"]},Xd=OA();function Pa(t){const n=TA(t),s=wA.parse(n,{async:!1}),o=il.sanitize(s,v0),l=new DOMParser().parseFromString(o,"text/html");return AA(l),RA(l),LA(l),{html:il.sanitize(l.body.innerHTML,v0),toc:MA(l)}}function EA(t){const n=new TextEncoder().encode(t);let s="";for(const o of n)s+=String.fromCharCode(o);return btoa(s)}function xA(t){const n=atob(t),s=new Uint8Array(n.length);for(let o=0;o<n.length;o++)s[o]=n.charCodeAt(o);return new TextDecoder().decode(s)}function TA(t){return t.replace(CA,(n,s)=>{const o=s.trim();if(!o)return"";const l=Te(o),y=encodeURIComponent(o);return`<a href="${Lr(o)}" data-entry-id="${y}">${l}</a>`})}function AA(t){const n=new Map;for(const s of t.querySelectorAll("h2, h3")){const o=s.textContent?.trim()??"",l=IA(o||"section"),y=n.get(l)??0;n.set(l,y+1),s.id=y===0?l:`${l}-${y+1}`}}function RA(t){for(const n of t.querySelectorAll("pre > code")){const s=BA(n.className),o=n.textContent??"",l=n.parentElement;if(!l)continue;if(s==="mermaid"){const S=t.createElement("div");S.className="diagram-block",S.setAttribute("data-mermaid-source",EA(o)),S.setAttribute("data-diagram-state","pending"),l.replaceWith(S);continue}const y=DA(o,s);n.innerHTML=y,n.classList.add("hljs"),l.classList.add("code-block"),l.dataset.code=o,l.insertBefore(kA(t,s||"text"),l.firstChild)}}function kA(t,n){const s=t.createElement("div");s.className="code-block-toolbar";const o=t.createElement("span");o.className="code-block-dots",o.setAttribute("aria-hidden","true");for(let S=0;S<3;S++)o.append(t.createElement("span"));const l=t.createElement("span");l.className="code-block-language",l.textContent=n;const y=t.createElement("button");return y.className="copy-code",y.type="button",y.dataset.action="copy-code",y.textContent="복사",s.append(o,l,y),s}function LA(t){for(const n of t.querySelectorAll("a")){const s=n.getAttribute("href")??"";NA(s)&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))}}function MA(t){return[...t.querySelectorAll("h2, h3")].map(n=>({id:n.id,text:n.textContent?.trim()??n.id,level:n.tagName.toLowerCase()==="h2"?2:3}))}function DA(t,n){return n&&Xd.getLanguage(n)?Xd.highlight(t,{language:n}).value:Xd.highlightAuto(t).value}function OA(){return Sn.registerLanguage("bash",d0),Sn.registerLanguage("sh",d0),Sn.registerLanguage("javascript",p0),Sn.registerLanguage("js",p0),Sn.registerLanguage("json",SA),Sn.registerLanguage("markdown",_0),Sn.registerLanguage("md",_0),Sn.registerLanguage("python",g0),Sn.registerLanguage("py",g0),Sn.registerLanguage("typescript",m0),Sn.registerLanguage("ts",m0),Sn}function BA(t){return t.match(/language-([a-z0-9_-]+)/i)?.[1]?.toLowerCase()??null}function NA(t){return/^[a-z][a-z0-9+.-]*:/i.test(t)&&!t.startsWith(window.location.origin)}function IA(t){return t.trim().toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"")||"section"}function HA(t){return`
201
- <article class="document">
202
- <header class="document-header">
203
- <p class="eyebrow">MANIFEST · DRYDOCK</p>
204
- <h1>Conflicts</h1>
205
- </header>
206
- ${t.length>0?`
207
- <ul class="conflict-list">
208
- ${t.map(n=>`
209
- <li>
210
- <a class="conflict-list-item" href="${xx(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 zA(t){const n=[Zd("Current",t.current),Zd("Proposed",t.proposed),Zd("Raw Source",t.rawSource)].filter(Boolean).join("");return`
223
- <article class="document">
224
- <header class="document-header">
225
- <p class="eyebrow">MANIFEST · DRYDOCK</p>
226
- <h1>${Te(t.id)}</h1>
227
- <div class="meta-chips">
228
- <span class="chip chip-coral">${Te(String(t.meta.status??"unknown"))}</span>
229
- </div>
230
- </header>
231
- <section class="conflict-meta-card">
232
- <pre>${Te(JSON.stringify(t.meta,null,2))}</pre>
233
- </section>
234
- ${n||'<p class="empty-state">No conflicts to display.</p>'}
235
- </article>
236
- `}function Zd(t,n){if(!n)return"";const s=Pa(n);return`
237
- <section class="conflict-section">
238
- <h2>${Te(t)}</h2>
239
- <div class="markdown-body">${s.html}</div>
240
- </section>
241
- `}function $A(t){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">${Pa(t).html}</div>
248
- </article>
249
- `}function xf(t,n){try{return new Date(t).toLocaleString(n??"en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}catch{return t}}function iu(t){const n=Date.now()-new Date(t).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 UA=`
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 jA(t,n,s){if(!t)return"";const{frontmatter:o}=t,l=xf(o.created),y=iu(o.created),S=xf(o.updated),c=iu(o.updated),u=ax(t,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>',g=o.rawSourceRef?`<a class="manifest-link queue-raw-link" href="${Ze(ib(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">${UA}</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(S)}">
275
- ${Te(S)}
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">${g}</dd>
285
- </dl>
286
- ${u?`<div class="manifest-actions">${u}</div>`:""}
287
- </aside>
288
- `}const PA="modulepreload",FA=function(t){return"/console/"+t},b0={},qA=function(n,s,o){let l=Promise.resolve();if(s&&s.length>0){let u=function(h){return Promise.all(h.map(g=>Promise.resolve(g).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const S=document.querySelector("meta[property=csp-nonce]"),c=S?.nonce||S?.getAttribute("nonce");l=u(s.map(h=>{if(h=FA(h),h in b0)return;b0[h]=!0;const g=h.endsWith(".css"),f=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${f}`))return;const C=document.createElement("link");if(C.rel=g?"stylesheet":PA,g||(C.as="script"),C.crossOrigin="",C.href=h,c&&C.setAttribute("nonce",c),document.head.appendChild(C),g)return new Promise((E,T)=>{C.addEventListener("load",E),C.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${h}`)))})}))}function y(S){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=S,window.dispatchEvent(c),!c.defaultPrevented)throw S}return l.then(S=>{for(const c of S||[])c.status==="rejected"&&y(c.reason);return n().catch(y)})},WA=".diagram-block[data-mermaid-source]:not([data-diagram-state='rendered']):not([data-diagram-state='error'])",GA=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),KA=/^on/i,VA={USE_PROFILES:{svg:!0,svgFilters:!1},FORBID_TAGS:["foreignObject","script"],FORBID_ATTR:["href","xlink:href"]},S0="diagramInteractionBound",YA=/^oklch\s*\(\s*([^)]+)\s*\)$/i,XA=/^(-?\d+(?:\.\d+)?)(deg)?$/i,wn=[25,50,75,100,125,150,200,300,400],ZA=["pie1","pie2","pie3","pie4","pie5","pie6","pie7","pie8","pie9","pie10","pie11","pie12"];let Qd=null,y0=!1,QA=0,JA=0,sl=null;function ls(t){const n=t.trim();if(!n)return n;const s=C3(n);return s?w3(s):n}function e3(t){if(y0)return;y0=!0,C0(t);const n=t instanceof Node?t:document.body;new MutationObserver(o=>{let l=!1;for(const y of o)if(y.type==="childList"){sl&&!sl.trigger.isConnected&&Jo(!1);for(const S of y.addedNodes)if(S instanceof Element&&(S.matches?.(".diagram-block[data-mermaid-source]")||S.querySelector?.(".diagram-block[data-mermaid-source]"))){l=!0;break}if(l)break}l&&C0(t)}).observe(n,{childList:!0,subtree:!0})}function C0(t){const n=t.querySelectorAll(WA);for(const s of n)s.dataset.diagramHydrating!=="true"&&(s.dataset.diagramHydrating="true",s.dataset.diagramState="pending",t3(s))}async function t3(t){const n=t.getAttribute("data-mermaid-source")??"";let s="";try{s=xA(n)}catch{Jd(t,"Invalid diagram source");return}if(!s.trim()){Jd(t,"Empty diagram source");return}try{const o=await n3(),l=`mermaid-diagram-${++QA}`,{svg:y}=await o.render(l,s);t.innerHTML=i3(y),a3(t,y),o3(t),l3(t),t.dataset.diagramState="rendered"}catch(o){const l=o instanceof Error?o.message:String(o);Jd(t,l)}}function Jd(t,n){t.dataset.diagramState="error",t.textContent=`Diagram render failed: ${n}`}function i3(t){const n=(s,o)=>{KA.test(o.attrName)&&(o.keepAttr=!1)};il.addHook("uponSanitizeAttribute",n);try{return il.sanitize(t,VA)}finally{il.removeHook("uponSanitizeAttribute",n)}}async function n3(){return Qd||(Qd=(async()=>{const t=await qA(()=>import("./mermaid.core-BrseLPLb.js").then(s=>s.bC),[]),n=t.default??t;return n.initialize({securityLevel:"strict",htmlLabels:!1,suppressErrorRendering:!0,startOnLoad:!1,theme:"base",look:"handDrawn",themeVariables:r3(),themeCSS:s3(),flowchart:{htmlLabels:!1,useMaxWidth:!1}}),n})()),Qd}function r3(){const t=getComputedStyle(document.documentElement),n=(T,w)=>{const p=t.getPropertyValue(T).trim();return ls(p||w)},s=n("--brass","#c69a4a"),o=n("--brass-bright","#e6b86a"),l=n("--brass-deep","#a0782a"),y=n("--aurora","#8bd7e6"),S=n("--aurora-deep","#1f8aa8"),c=n("--coral","#ef7c63"),u=n("--ink-deep","#1d2734"),h=n("--ink-fog","#a6afbb"),g=n("--ink-pearl","#e6e9ef"),f=n("--ink-spectral","#bcc4d0"),C=[o,s,y,c,ls("oklch(70% 0.11 68)"),S,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)")],E=Object.fromEntries(ZA.map((T,w)=>[T,C[w]??u]));return{background:"transparent",primaryColor:"transparent",primaryTextColor:g,primaryBorderColor:s,secondaryColor:"transparent",secondaryTextColor:g,secondaryBorderColor:o,tertiaryColor:"transparent",tertiaryTextColor:f,tertiaryBorderColor:s,lineColor:S,edgeLabelBackground:"transparent",titleColor:o,fontFamily:"JetBrains Mono Variable, ui-monospace, monospace",mainBkg:"transparent",nodeBorder:s,clusterBkg:"transparent",clusterBorder:s,pieTitleTextColor:o,pieTitleTextSize:"19px",pieSectionTextColor:g,pieSectionTextSize:"13px",pieLegendTextColor:g,pieLegendTextSize:"14px",pieStrokeColor:l,pieStrokeWidth:"1.35px",pieOuterStrokeColor:o,pieOuterStrokeWidth:"2.5px",pieOpacity:"0.96",...E}}function s3(){const t=getComputedStyle(document.documentElement),n=(h,g)=>{const f=t.getPropertyValue(h).trim();return ls(f||g)},s=n("--brass-deep","#a0782a"),o=n("--brass-bright","#e6b86a"),l=n("--aurora-deep","#1f8aa8"),y=n("--ink-abyss","#131920"),S=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 ${S});
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 a3(t,n){const s=new DOMParser().parseFromString(n,"image/svg+xml"),o=Array.from(s.querySelectorAll("a")),l=Array.from(t.querySelectorAll("a")),y=Math.min(o.length,l.length);for(let S=0;S<y;S++){const c=o[S],u=l[S];if(!c||!u)continue;const h=c.getAttribute("href")??c.getAttribute("xlink:href")??"",g=$b(h);g&&u.setAttribute("href",g)}}function o3(t){const n=t.querySelector("svg");if(!n)return;let s;try{s=n.getBBox()}catch{return}const{x:o,y:l,width:y,height:S}=s;!Number.isFinite(o)||!Number.isFinite(l)||!Number.isFinite(y)||!Number.isFinite(S)||o<0||l<0||y<=0||S<=0||n.setAttribute("viewBox",`${Da(o)} ${Da(l)} ${Da(y)} ${Da(S)}`)}function l3(t){t.tabIndex=0,t.setAttribute("aria-label","Open diagram in expanded view"),b3(t),t.dataset[S0]!=="true"&&(t.dataset[S0]="true",t.addEventListener("click",c3),t.addEventListener("keydown",u3))}function c3(t){if(t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.button!==0||nu(t.target))return;const n=t.currentTarget;n instanceof HTMLElement&&(t.preventDefault(),zb(n))}function u3(t){if(t.key!=="Enter"&&t.key!==" "||nu(t.target))return;const n=t.currentTarget;n instanceof HTMLElement&&(t.preventDefault(),zb(n))}function zb(t){const n=t.querySelector("svg");if(!n)return;Jo(!1);const s=typeof HTMLDialogElement<"u"&&typeof HTMLDialogElement.prototype.showModal=="function",o=document.createElement(s?"dialog":"div"),l=++JA,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 S=document.createElement("div");S.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 g=document.createElement("div");g.className="diagram-lightbox__controls",g.setAttribute("aria-label","Diagram zoom controls");const f=Mc("−","Zoom out","out"),C=document.createElement("span");C.className="diagram-lightbox__zoom-readout",C.setAttribute("aria-live","polite");const E=Mc("+","Zoom in","in"),T=Mc("Fit","Fit diagram to viewport","fit"),w=Mc("Reset","Reset diagram zoom","reset");g.append(f,C,E,T,w);const p=document.createElement("div");p.className="diagram-lightbox__viewport";const b=f3(n),_=n.cloneNode(!0);_.removeAttribute("style"),_3(_,`diagram-lightbox-svg-${l}`),p.append(_),c.append(u,g,h),S.append(c,p),o.append(S),document.body.append(o);const m=new h3(p,_,C,b);f.addEventListener("click",()=>m.zoomOut()),E.addEventListener("click",()=>m.zoomIn()),T.addEventListener("click",()=>m.fit()),w.addEventListener("click",()=>m.reset());const x=g3(o),R=A=>{(A.target===o||A.target===h)&&Jo(!0)},k=A=>{if(A.key==="Escape"){A.preventDefault(),Jo(!0);return}m.handleKeyboard(A)||A.key==="Tab"&&v3(A,o)},D={dialog:o,trigger:t,inertStates:x,onClick:R,onKeyDown:k,cleanupPanZoom:()=>m.destroy()};s&&(D.onCancel=A=>{A.preventDefault(),Jo(!0)},o.addEventListener("cancel",D.onCancel),o.showModal()),o.addEventListener("click",R),document.addEventListener("keydown",k,!0),sl=D,m.fit(),h.focus()}function Mc(t,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=t,o}class h3{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),S=y===-1?wn.length-1:Math.max(0,y-1);this.applyZoom(S),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*(Dc(this.zoomIndex)/100)}get svgHeight(){return this.baseSize.height*(Dc(this.zoomIndex)/100)}applyZoom(n){this.zoomIndex=n;const s=Dc(this.zoomIndex),o=s/100;this.svg.setAttribute("width",Da(this.baseSize.width*o)),this.svg.setAttribute("height",Da(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,S=this.viewport.getBoundingClientRect(),c=this.viewport.scrollLeft+s-S.left,u=this.viewport.scrollTop+o-S.top;this.applyZoom(n),this.viewport.scrollLeft=c/l*this.svgWidth-(s-S.left),this.viewport.scrollTop=u/y*this.svgHeight-(o-S.top)}onPointerDown=n=>{if(n.button!==0||nu(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=Dc(this.pinchStart.zoomIndex)*o;this.applyZoom(p3(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=>{nu(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 d3(t){const n=w0(t.getAttribute("width")),s=w0(t.getAttribute("height"));if(n&&s)return{width:n,height:s};const o=t.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number)??[],l=o[2],y=o[3],S=l!==void 0&&Number.isFinite(l)&&l>0?l:null,c=y!==void 0&&Number.isFinite(y)&&y>0?y:null;return{width:n??S??800,height:s??c??600}}function f3(t){const n=t.getBoundingClientRect();return n.width>0&&n.height>0?{width:n.width,height:n.height}:d3(t)}function w0(t){if(!t)return null;const n=/^(\d+(?:\.\d+)?)/.exec(t.trim());if(!n)return null;const s=Number(n[1]);return Number.isFinite(s)&&s>0?s:null}function Da(t){return Number.isInteger(t)?String(t):t.toFixed(2).replace(/\.?0+$/,"")}function p3(t){let n=0,s=Number.POSITIVE_INFINITY;return wn.forEach((o,l)=>{const y=Math.abs(o-t);y<s&&(s=y,n=l)}),n}function Dc(t){return wn[t]??wn[0]}function _3(t,n){const s=t.getAttribute("id")??"";t.setAttribute("id",n);const o=t.querySelector("style");!s||!o?.textContent||(o.textContent=o.textContent.split(`#${s}`).join(`#${n}`))}function Jo(t){const n=sl;n&&(n.dialog.removeEventListener("click",n.onClick),document.removeEventListener("keydown",n.onKeyDown,!0),n.onCancel&&n.dialog.removeEventListener("cancel",n.onCancel),n.cleanupPanZoom(),m3(n.inertStates),n.dialog instanceof HTMLDialogElement&&n.dialog.open&&typeof n.dialog.close=="function"&&n.dialog.close(),n.dialog.remove(),sl=null,t&&n.trigger.isConnected&&n.trigger.focus())}function g3(t){const n=[];for(const s of Array.from(document.body.children))!(s instanceof HTMLElement)||s===t||(n.push({element:s,ariaHidden:s.getAttribute("aria-hidden"),inert:s.inert}),s.inert=!0,s.setAttribute("aria-hidden","true"));return n}function m3(t){for(const n of t)n.element.inert=n.inert,n.ariaHidden===null?n.element.removeAttribute("aria-hidden"):n.element.setAttribute("aria-hidden",n.ariaHidden)}function v3(t,n){const s=Array.from(n.querySelectorAll(GA)).filter(y3);if(s.length===0){t.preventDefault(),n.focus();return}const o=s[0],l=s[s.length-1];!o||!l||(t.shiftKey&&document.activeElement===o?(t.preventDefault(),l.focus()):!t.shiftKey&&document.activeElement===l&&(t.preventDefault(),o.focus()))}function b3(t){t.querySelector("a[href]")?t.removeAttribute("role"):t.setAttribute("role","button")}function nu(t){if(!(t instanceof Element))return!1;const n=t.closest("a[href]");return!n||!(n.getAttribute("href")?.trim()??"")?!1:!S3(n)}function S3(t){return Array.from(t.children).some(n=>n.tagName.toLowerCase()==="svg")}function y3(t){return!(t.inert||t.hidden||t.getAttribute("aria-hidden")==="true"||"disabled"in t&&t.disabled)}function $b(t){const n=t.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:$b(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 C3(t){const n=YA.exec(t);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():"",S=l.trim().split(/[\s,]+/).filter(Boolean);if(S.length!==3)return null;const[c,u,h]=S;if(!c||!u||!h)return null;const g=ef(c,1),f=ef(u,.4),C=E3(h);if(g===null||f===null||C===null)return null;let E=1;if(o>=0){const T=ef(y,1);if(T===null)return null;E=T}return{L:g,C:f,h:C,alpha:E}}function w3(t){const n=t.h*Math.PI/180,s=t.C*Math.cos(n),o=t.C*Math.sin(n),l=t.L,y=l+.3963377774*s+.2158037573*o,S=l-.1055613458*s-.0638541728*o,c=l-.0894841775*s-1.291485548*o,u=y**3,h=S**3,g=c**3,f=4.0767416621*u-3.3077115913*h+.2309699292*g,C=-1.2684380046*u+2.6097574011*h-.3413193965*g,E=-.0041960863*u-.7034186147*h+1.707614701*g,T=Oc(tf(f)),w=Oc(tf(C)),p=Oc(tf(E));if(t.alpha<1){const b=Oc(t.alpha);return`#${Ls(T)}${Ls(w)}${Ls(p)}${Ls(b)}`}return`#${Ls(T)}${Ls(w)}${Ls(p)}`}function ef(t,n){if(!t)return null;if(t.endsWith("%")){const o=Number(t.slice(0,-1));return Number.isFinite(o)?o/100*n:null}const s=Number(t);return Number.isFinite(s)?s:null}function E3(t){const n=XA.exec(t);if(!n)return null;const s=Number(n[1]);return Number.isFinite(s)?s:null}function tf(t){const n=Math.max(0,Math.min(1,t));return n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n}function Oc(t){return Math.round(Math.max(0,Math.min(1,t))*255)}function Ls(t){return t.toString(16).padStart(2,"0")}function x3(t){const n=t.tags.map(o=>`<span class="chip chip-tag">${Te(o)}</span>`).join(""),s=A3(t);return`
342
- <div class="meta-chips">
343
- ${n}
344
- ${s}
345
- <span class="chip">Updated ${Te(T3(t.updated))}</span>
346
- </div>
347
- `}function Ub(t){return t.map(n=>`<span class="chip chip-muted">${Te(n)}</span>`).join("")}function T3(t){const n=new Date(t);return Number.isNaN(n.getTime())?t:n.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function A3(t){const n=R3(t);return n?`<span class="chip ${n.tone==="deprecated"?"chip-coral":n.tone==="stale"?"chip-stale":""}" title="${Ze(n.title)}">${Te(n.label)}</span>`:""}function R3(t,n=new Date){const s=t.status,o=typeof t.revalidateAfter=="string"&&!Number.isNaN(Date.parse(t.revalidateAfter))&&Date.parse(t.revalidateAfter)<n.getTime();return s==="deprecated"||s==="superseded"?{label:s,tone:"deprecated",title:o?`${s} · stale`:s}:o?{label:"stale",tone:"stale",title:t.revalidateAfter??"stale"}:s==="current"||s==="draft"?{label:s,tone:"neutral",title:s}:null}function k3(t,n,s){const o=L3(t,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="${Lr(l.entry.id)}" data-entry-id="${Ze(l.entry.id)}">
353
- <strong>${Te(l.entry.title)}</strong>
354
- <span>${Ub(l.matchingTags)}</span>
355
- </a>
356
- `).join("")}
357
- </div>
358
- </section>
359
- `}function L3(t,n,s){const o=new Set(n),l="en-US";return s.filter(y=>y.id!==t).map(y=>({entry:y,matchingTags:y.tags.filter(S=>o.has(S))})).filter(y=>y.matchingTags.length>0).sort((y,S)=>S.matchingTags.length-y.matchingTags.length||y.entry.title.localeCompare(S.entry.title,l,{sensitivity:"base",numeric:!0})).slice(0,5)}const M3=`
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 D3(t,n,s=!0){const o=t.length,l=t.slice(0,6),y=t[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(Lr(y.id))}" data-entry-id="${Ze(y.id)}">
378
- <span>Open first entry — ${Te(y.title)}</span>
379
- ${M3}
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(S=>`
385
- <a class="welcome-card" href="${Ze(Lr(S.id))}" data-entry-id="${Ze(S.id)}">
386
- <strong>${Te(S.title)}</strong>
387
- <span class="welcome-card-tags">${Ub(S.tags.slice(0,3))}</span>
388
- </a>
389
- `).join("")}
390
- </div>
391
- `:""}
392
- </article>
393
- `}function O3(t,n){const s=Pa(t.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(t.frontmatter.title)}</h1>
398
- ${x3(t.frontmatter)}
399
- </header>
400
- <div class="markdown-body" id="markdown-body">
401
- ${s.html}
402
- </div>
403
- ${k3(t.frontmatter.id,t.frontmatter.tags,n)}
404
- </article>
405
- `}}function B3(){return`
406
- <article class="document">
407
- <p class="loading">Loading entry</p>
408
- </article>
409
- `}function N3(t){return`
410
- <article class="document">
411
- <p class="error-box">${Te(t)}</p>
412
- </article>
413
- `}const qc=new Set;let Tr="entries";const I3=`
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
- `,H3=`
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
- `,z3=`
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
- `,$3=`
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 U3(t,n,s,o=[],l=null,y){const S=t.length,c=F3(t),u=S===0?'<p class="empty-state">No wiki entries yet.</p>':Tr==="tags"?q3(t,n):W3(t,n),h=Tr==="tags"?`Tags · ${c}`:`Entries · ${S}`,g=Tr==="tags"?"tag-tree":"entry-list",f=Tr==="tags"?"Entries by tag":"All entries",C=V3(y??(typeof window<"u"?window.location.pathname:"")),E=C.startsWith("/queue"),T=C==="/index",w=C==="/log",p=C.startsWith("/conflicts"),b=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">${z3}</button>
436
- </div>
437
- </div>
438
- <button class="command-entry" type="button" data-action="open-command">
439
- <span class="command-entry-label">${I3}<span>Search entries</span></span>
440
- <kbd>⌘K</kbd>
441
- </button>
442
- <div class="nav-drydock-section">
443
- <a class="nav-drydock-link${E?" active":""}" href="${Ze(Na())}">
444
- <span class="nav-drydock-icon">${$3}</span>
445
- <span class="nav-drydock-label">Drydock</span>
446
- ${b}
447
- </a>
448
- <a class="nav-drydock-link${T?" active":""}" href="${Ze(Tx())}">
449
- <span class="nav-drydock-label">Index</span>
450
- </a>
451
- <a class="nav-drydock-link${w?" active":""}" href="${Ze(nb())}">
452
- <span class="nav-drydock-label">Log</span>
453
- </a>
454
- <a class="nav-drydock-link${p?" active":""}" href="${Ze(Ex())}">
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="${g}" aria-label="${f}">
468
- ${u}
469
- </nav>
470
- </aside>
471
- `}function j3(t){if(qc.has(t)){qc.delete(t);return}qc.add(t)}function P3(t){Tr=t}function F3(t){const n=new Set;for(const s of t){if(s.tags.length===0){n.add("untagged");continue}for(const o of s.tags)n.add(o)}return n.size}function q3(t,n){return G3(t).map(o=>K3(o,n)).join("")}function W3(t,n){const s="en-US";return[...t].sort((l,y)=>l.title.localeCompare(y.title,s,{sensitivity:"base",numeric:!0})).map(l=>jb(l,n)).join("")}function G3(t){const n="en-US",s=new Map;for(const o of t){const l=o.tags.length>0?o.tags:["untagged"];for(const y of l){const S=s.get(y)??[];S.push(o),s.set(y,S)}}return[...s.entries()].map(([o,l])=>({tag:o,entries:l.sort((y,S)=>y.title.localeCompare(S.title,n,{sensitivity:"base",numeric:!0}))})).sort((o,l)=>o.tag.localeCompare(l.tag,n,{sensitivity:"base",numeric:!0}))}function K3(t,n){const s=qc.has(t.tag),o=s?"":t.entries.map(l=>jb(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(t.tag)}">
474
- ${H3}
475
- <span>${t.tag==="untagged"?"Untagged":Te(t.tag)}</span>
476
- <span class="count">${t.entries.length}</span>
477
- </button>
478
- <div class="tag-group-list">${o}</div>
479
- </section>
480
- `}function jb(t,n){const s=t.id===n?" active":"",o=Ze(t.title);return`
481
- <a class="nav-entry${s}" href="${Lr(t.id)}" data-entry-id="${Ze(t.id)}" title="${o}">
482
- <span class="nav-entry-text">${Te(t.title)}</span>
483
- </a>
484
- `}function V3(t){const n=t===In||t===`${In}/`?"/":t.startsWith(`${In}/`)?t.slice(In.length)||"/":t,s=n.match(/^\/w\/[^/]+(\/.*)?$/);return s?s[1]??"/":n}const Y3=`
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
- `,X3=`
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 Z3(t){const n=t.ref??"";let s;return t.loading?s='<p class="loading">Loading source</p>':t.error?s=`<p class="error-box">Failed to load source — ${Te(t.error)}</p>`:t.content?s=`<div class="markdown-body">${Pa(t.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
- ${Y3}
498
- <span>Codex</span>
499
- </a>
500
- <div class="raw-meta">
501
- <span class="raw-glyph">${X3}</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 ap(t,n){const s=t==="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 Q3(t){const{tab:n,items:s,pendingCount:o,archivedCount:l,loading:y,error:S}=t;if(y&&s.length===0)return'<div class="queue-view"><p class="loading">Loading patch queue</p></div>';if(S)return`<div class="queue-view"><p class="error-box">Failed to load queue — ${Te(S)}</p></div>`;const c=s.length===0?J3(n):s.map(g=>eR(g)).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(Na("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(Na("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 J3(t){return`<p class="queue-empty">${t==="pending"?"No pending patches.":"No archived patches."}</p>`}function eR(t){const{id:n,meta:s,source:o,summary:l,op:y,target:S}=t,c=tR(s.status),u=iu(s.createdAt),h=s.warnings??[],g=h.slice(0,3).map(p=>`<span class="chip chip-muted">${Te(p)}</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>`:"",E=y?ap(y,!0):"",T=l?`<p class="queue-card-summary">${Te(l)}</p>`:"",w=S?`<span class="queue-card-target">${Te(S)}</span>`:"";return`
541
- <a class="queue-card" href="${Ze(wx(n))}">
542
- ${T}
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
- ${E}
549
- ${w}
550
- <span class="queue-card-time">${Te(u)}</span>
551
- ${C}
552
- <div class="queue-card-chips">
553
- ${g}${f}
554
- </div>
555
- </div>
556
- </a>
557
- `}function tR(t){return`<span class="status-dot ${t==="pending"?"status-dot--pending":t==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Ze(t)}"></span>`}const iR=`
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
- `,nR=`
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 rR(t){const{current:n,loading:s,error:o}=t;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?sR(n,t):'<div class="queue-detail-view"><p class="empty-state">Patch not found.</p></div>'}function sR(t,n){const{patch:s,meta:o,wikiEntry:l,targetExists:y}=t,{frontmatter:S}=s,c=Pa(l.body),u=ap(S.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(Na())}" aria-label="Back to Drydock">
570
- ${iR}
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(S.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
- ${aR(t,h)}
585
- ${cR(c.toc)}
586
- ${lR(t)}
587
- ${oR(t,n)}
588
- </aside>
589
- </div>
590
- </div>
591
- `}function aR(t,n){const{patch:s,meta:o,targetExists:l}=t,{frontmatter:y}=s,S=ap(y.op,l),c=xf(o.createdAt),u=iu(o.createdAt),h=uR(o.status),g=o.warnings??[],f=n?`<dd class="queue-dl-value">
592
- <a class="manifest-link queue-raw-link" href="${Ze(ib(n))}" data-raw-ref="${Ze(n)}">
593
- <span class="manifest-ref">${Te(n)}</span>
594
- <span class="manifest-arrow">${nR}</span>
595
- </a>
596
- </dd>`:'<dd class="queue-dl-value queue-dl-muted">None</dd>',C=g.length>0?`<dt class="queue-dl-key">Warnings</dt>
597
- <dd class="queue-dl-value">
598
- <div class="queue-card-chips">
599
- ${g.map(E=>`<span class="chip chip-muted">${Te(E)}</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">${S}</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 oR(t,n){const{meta:s,source:o}=t;if(s.status!=="pending"||o!=="queue")return"";const{actionPending:l,actionError:y}=n,S=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}"${S}
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"${S}
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"${S}>Confirm</button>
653
- <button class="queue-action-btn queue-action-btn--cancel" type="button" data-action="queue-reject-cancel"${S}>Cancel</button>
654
- </div>
655
- </form>
656
- ${u}
657
- </div>
658
- `}function lR(t){const n=t.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 cR(t){return t.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
- ${t.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 uR(t){return`<span class="status-dot ${t==="pending"?"status-dot--pending":t==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Ze(t)}"></span>`}function hR(t){return t.length===0?"":`
687
- <nav class="toc-panel" aria-label="Table of contents">
688
- <h2>Contents</h2>
689
- ${t.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 dR(t){const n=t.entries.join(`
696
-
697
- `),s=Pa(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===t.limit?"chip-tag":""}" href="${nb(l)}">${l}</a>
705
- `).join("")}
706
- </div>
707
- </header>
708
- <p class="empty-state">${`Latest ${t.limit} of ${t.totalEntries} entries`}</p>
709
- <div class="markdown-body">${s.html}</div>
710
- </article>
711
- `}const Tf=new Set,$s={tab:"pending",items:[],pendingCount:0,archivedCount:0,current:null,loading:!1,error:null,actionPending:!1,actionError:null};function ru(){return $s}function fR(t){return Tf.add(t),()=>Tf.delete(t)}async function pR(t){Vi({tab:t,loading:!0,error:null,current:null});try{const n=await hu(t);Vi({items:n.items,pendingCount:n.pendingCount,archivedCount:n.archivedCount,loading:!1}),Vf(n.pendingCount)}catch(n){Vi({loading:!1,error:pu(n)})}}async function _R(t){Vi({loading:!0,error:null,current:null});try{const n=await px(t);Vi({current:n,loading:!1})}catch(n){Vi({loading:!1,error:pu(n)})}}function Ms(){Vi({items:[],current:null,error:null,loading:!1,actionPending:!1,actionError:null})}async function gR(){if($s.actionPending)return;const t=$s.current?.meta.id;if(t){Vi({actionPending:!0,actionError:null});try{await _x(t);const n=await hu("pending");Vi({actionPending:!1,pendingCount:n.pendingCount,archivedCount:n.archivedCount}),Vf(n.pendingCount),Is(Na("archived"))}catch(n){Vi({actionPending:!1,actionError:pu(n)})}}}async function mR(t){if($s.actionPending)return;const n=$s.current?.meta.id;if(!n)return;const s=t.trim();if(!s||s.length>256){Vi({actionError:s?"Rejection reason must be 256 characters or less.":"Please enter a rejection reason."});return}Vi({actionPending:!0,actionError:null});try{await gx(n,s);const o=await hu("pending");Vi({actionPending:!1,pendingCount:o.pendingCount,archivedCount:o.archivedCount}),Vf(o.pendingCount),Is(Na("archived"))}catch(o){Vi({actionPending:!1,actionError:pu(o)})}}function Vi(t){Object.assign($s,t);for(const n of Tf)n($s)}function pu(t){return t instanceof Error?t.message:String(t)}const Af=new Set,cs={ref:null,content:null,loading:!1,error:null};function vR(){return cs}function bR(t){return Af.add(t),()=>Af.delete(t)}async function SR(t){if(!(cs.ref===t&&cs.content!==null&&!cs.error)){Wc({ref:t,content:null,loading:!0,error:null});try{const n=await fx(t);if(cs.ref!==t)return;Wc({content:n,loading:!1})}catch(n){if(cs.ref!==t)return;Wc({loading:!1,error:yR(n)})}}}function rs(){Wc({ref:null,content:null,loading:!1,error:null})}function Wc(t){Object.assign(cs,t);for(const n of Af)n(cs)}function yR(t){return t instanceof Error?t.message:String(t)}let su,Rf=!1;function CR(t,n={}){su=t,Rf=!1,document.documentElement.lang="en",Cx(),$x();const s=kx(()=>Ns()),o=bR(()=>Ns()),l=fR(()=>Ns()),y=yx(S=>{Pb(S)});return document.addEventListener("click",E0),document.addEventListener("submit",x0),e3(t),n.initialWorkspaceId&&gf()!==n.initialWorkspaceId&&Sx(qv(n.initialWorkspaceId)),wR(),{navigateToWorkspace(S){gf()!==S&&Is(qv(S))},destroy(){s(),o(),l(),y(),document.removeEventListener("click",E0),document.removeEventListener("submit",x0),t.innerHTML=""}}}async function wR(){Ns(),await Lx(),await Pb(cl())}async function Pb(t){if(t.name==="entry"){Ms(),rs(),await Mx(t.id);return}if(t.name==="raw"){Ms(),await SR(t.ref);return}if(t.name==="queue"){Fd(),rs(),await pR(t.tab);return}if(t.name==="queue-detail"){Fd(),rs(),await _R(t.patchId);return}if(t.name==="index-md"){Ms(),rs(),await Dx();return}if(t.name==="log"){Ms(),rs(),await Ox(t.limit);return}if(t.name==="conflicts"){Ms(),rs(),await Bx();return}if(t.name==="conflict-detail"){Ms(),rs(),await Nx(t.id);return}Fd(),rs(),Ms(),Ns()}function Ns(){const t=cl();if(t.name==="raw"){ER();return}xR(Fc(),t)}function ER(){su.innerHTML=`
712
- ${Z3(vR())}
713
- <div class="toast" id="toast" aria-live="polite"></div>
714
- `}function xR(t,n){const s=n.name==="entry"?n.id:null,o=n.name==="queue"||n.name==="queue-detail",l=t.currentEntry?O3(t.currentEntry,t.index):null;zx(t.index,t.recentIds),su.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
- ${U3(t.index,s,t.pendingPatchCount,t.workspaces,t.currentWorkspaceId,window.location.pathname)}
722
- <main class="content">
723
- ${TR(t,n,l)}
724
- </main>
725
- <div class="rail">
726
- ${AR(t,n,l)}
727
- </div>
728
- </div>
729
- <div class="toast" id="toast" aria-live="polite"></div>
730
- `,Rf?su.classList.add("is-revealed"):Rf=!0}function TR(t,n,s){return n.name==="queue"?Q3(ru()):n.name==="queue-detail"?rR(ru()):t.error?N3(t.error):t.loading&&!t.currentEntry&&!t.indexMarkdown&&!t.log&&!t.currentConflict?B3():n.name==="index-md"&&t.indexMarkdown?$A(t.indexMarkdown):n.name==="log"&&t.log?dR(t.log):n.name==="conflicts"?HA(t.conflicts):n.name==="conflict-detail"&&t.currentConflict?zA(t.currentConflict):t.currentEntry&&s?s.html:D3(t.index,t.health?.cwd??null,!!t.currentWorkspaceId)}function AR(t,n,s){return n.name==="queue"||n.name==="queue-detail"?"":`
731
- ${jA(t.currentEntry,t.index,t.currentMatchHint)}
732
- ${s?hR(s.toc):""}
733
- `}function E0(t){const n=t.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(A0(t))return;t.preventDefault(),document.body.classList.remove("nav-open"),Is(rb());return}if(s?.dataset.action==="set-nav-mode"){const S=s.dataset.mode;(S==="tags"||S==="entries")&&(P3(S),Ns());return}if(s?.dataset.action==="toggle-tag"){j3(s.dataset.tag??""),Ns();return}if(s?.dataset.action==="copy-code"){RR(s);return}if(s?.dataset.action==="copy-compact-context"){const S=Fc();S.currentEntry&&Gc(X1(S.currentEntry),"Copied compact context.");return}if(s?.dataset.action==="copy-provenance-context"){const S=Fc();S.currentEntry&&Gc(Z1(S.currentEntry),"Copied provenance context.");return}if(s?.dataset.action==="copy-related-context"){const S=Fc();S.currentEntry&&Gc(Q1(S.currentEntry,S.index),"Copied related context pack.");return}if(s?.dataset.action==="toggle-why-matched"){const S=s.closest(".context-actions-grid")?.querySelector(".context-why-matched");S&&(S.hidden=!S.hidden);return}if(s?.dataset.action==="queue-approve"){if(ru().actionPending||!confirm("Approve this patch?"))return;s.setAttribute("disabled",""),gR();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){t.preventDefault(),document.getElementById(o.dataset.tocId??"")?.scrollIntoView({behavior:"smooth",block:"start"});return}const l=n.closest("a");if(!l||A0(t))return;const y=kR(l);y&&(t.preventDefault(),document.body.classList.remove("nav-open"),Is(y))}function x0(t){const n=t.target;if(n instanceof HTMLFormElement&&n.dataset.action==="queue-reject-submit"){if(t.preventDefault(),ru().actionPending)return;const s=n.querySelector("button[type='submit']");s&&(s.disabled=!0);const o=n.querySelector("textarea[name='reason']");mR(o?.value??"")}}async function RR(t){const s=t.closest(".code-block")?.dataset.code??"";s&&await Gc(s,"Code copied.")}async function Gc(t,n){try{await navigator.clipboard.writeText(t),T0(n)}catch{T0("Failed to copy to clipboard.")}}function T0(t){const n=document.querySelector("#toast");n&&(n.textContent=t,n.classList.add("visible"),window.setTimeout(()=>n.classList.remove("visible"),1400))}function A0(t){return t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.button!==0}function kR(t){const n=t.getAttribute("href")??"",s=t.dataset.entryId;if(s)return Lr(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 rb();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?Lr(y):null}function LR({state:t}){const n=te.useRef(null),s=te.useRef(null),o=t.theaters.find(S=>S.id===t.activeTheaterId)??null,l=o?.id??null,y=!!o?.hasWiki;return te.useEffect(()=>{if(!y){s.current?.destroy(),s.current=null;return}const S=n.current;if(!S||!l||s.current)return;const c=CR(S,{initialWorkspaceId:l});return s.current=c,()=>{c.destroy(),s.current===c&&(s.current=null)}},[y]),te.useEffect(()=>{!y||!l||s.current?.navigateToWorkspace(l)},[l,y]),!t.activeTheaterId||t.theaters.length===0?N.jsxs("section",{className:"codex-empty-state",children:[N.jsx("p",{className:"codex-empty-eyebrow",children:"Codex"}),N.jsx("h1",{children:"Add a Theater"}),N.jsx("p",{children:"Use the top bar Theater control to choose a project root before opening Codex."})]}):o?.hasWiki?N.jsx("div",{className:"codex-host",ref:n}):N.jsxs("section",{className:"codex-empty-state",children:[N.jsx("p",{className:"codex-empty-eyebrow",children:"Codex unavailable"}),N.jsx("h1",{children:o?.label??"This Theater"}),N.jsx("p",{children:"This Theater does not have Fleet Wiki data mounted."})]})}function Fb(t){return new Date(t).toLocaleTimeString([],{hour12:!1})}function qb(t){return t.label?.trim()||`#${t.sequence} Operation`}function MR(t,n){const s=Math.max(0,Math.round((n-t)/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 au(t){return t.length<=14?t:`${t.slice(0,6)}…${t.slice(-6)}`}function Wb(t){return t&&t.charAt(0).toUpperCase()+t.slice(1)}function al(t){switch(t){case"active":return"running";case"done":return"done";case"error":return"error";case"aborted":return"aborted";default:return t}}function DR(t){switch(t){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 t}}function js(t){switch(t){case"stream":case"active":case"conn":return"live";case"done":return"ok";case"err":case"error":return"bad";default:return"idle"}}function OR(t){if(t.status!=="active")return null;const n=t.trackOrder.map(l=>t.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],S=y?BR(y):null;if(S)return S}return null}function BR(t){return R0(t.text)??R0(t.thought)??t.tools[t.tools.length-1]?.title??null}function R0(t){if(!t)return null;const n=t.split(`
734
- `);for(let s=n.length-1;s>=0;s--){const o=n[s]?.trim();if(o)return o}return null}const NR=56;function IR(t,n){const s=te.useRef(null),o=te.useRef(!0),[l,y]=te.useState(!0),S=te.useCallback(u=>{o.current!==u&&(o.current=u,y(u))},[]);te.useEffect(()=>{const u=s.current;if(!u)return;const h=()=>{const g=u.scrollHeight-u.scrollTop-u.clientHeight;S(g<=NR)};return u.addEventListener("scroll",h,{passive:!0}),()=>u.removeEventListener("scroll",h)},[S]),te.useLayoutEffect(()=>{S(!0);const u=s.current;u&&(u.scrollTop=u.scrollHeight)},[t,S]),te.useLayoutEffect(()=>{const u=s.current;!u||!o.current||(u.scrollTop=u.scrollHeight)},[n]);const c=te.useCallback(()=>{const u=s.current;u&&(u.scrollTop=u.scrollHeight,u.focus({preventScroll:!0}),S(!0))},[S]);return{containerRef:s,pinned:l,jumpToLatest:c}}const k0=400,HR=["text","fallbackText","fallbackThought"],zR=te.memo(function({events:n}){return N.jsxs("ol",{className:"timeline","aria-label":"Raw event timeline",children:[n.length===0?N.jsx("li",{className:"timeline-empty",children:"No events observed."}):null,n.map((s,o)=>{const l=n[n.length-1-o];return l?N.jsx($R,{event:l},l.id):null})]})}),$R=te.memo(function({event:n}){return N.jsxs("li",{className:"timeline-row",children:[N.jsx("time",{className:"timeline-time",children:Fb(n.at)}),N.jsx("span",{className:"timeline-type",children:n.type}),N.jsx("code",{className:"timeline-payload",children:UR(n.event)})]})});function UR(t){const n={...t};delete n.type;for(const o of HR){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>k0?`${s.slice(0,k0)}…`:s}const jR=te.memo(function({track:n}){const s=js(n.status),o=n.status==="stream",l=n.sentTextLength>n.text.length||n.sentThoughtLength>n.thought.length,y=n.sentTextLength+n.sentThoughtLength;return N.jsxs("article",{className:`track-card track-card--${s}`,children:[N.jsxs("header",{className:"track-head",children:[N.jsx("span",{className:`status-dot status-dot--${s}`,"aria-hidden":"true"}),N.jsx("h3",{className:"track-name",children:n.displayName}),n.displayCli?N.jsx("span",{className:"track-tag",children:n.displayCli}):null,n.model?N.jsx("span",{className:"track-tag track-tag--dim",children:n.model}):null,n.effort?N.jsx("span",{className:"track-tag track-tag--dim",children:n.effort}):null,N.jsx("span",{className:`track-status track-status--${s}`,children:DR(n.status)})]}),n.subtitle?N.jsx("p",{className:"track-subtitle",children:n.subtitle}):null,n.requestPreview?N.jsx(PR,{preview:n.requestPreview}):null,n.thought?N.jsx(FR,{thought:n.thought,streaming:o&&!n.text}):null,N.jsx(qR,{track:n}),n.text?N.jsx("div",{className:"track-output","data-streaming":o||void 0,children:N.jsxs("pre",{className:"track-text",children:[n.text,o?N.jsx("span",{className:"stream-caret","aria-hidden":"true"}):null]})}):o||n.status==="conn"||n.status==="queued"?N.jsxs("p",{className:"track-waiting",children:[N.jsx("span",{className:"stream-caret","aria-hidden":"true"})," awaiting output"]}):null,l?N.jsxs("p",{className:"track-notice",children:["Output partially retained — ",y.toLocaleString()," chars emitted in total."]}):null,n.error?N.jsx("p",{className:"track-error",children:n.error}):null]})});function PR({preview:t}){return N.jsxs("p",{className:"track-request",title:t,children:[N.jsx("span",{className:"track-request-mark","aria-hidden":"true",children:"▸"}),t]})}function FR({thought:t,streaming:n}){const[s,o]=te.useState(!1);return N.jsxs("div",{className:`thought-fold ${s?"is-open":""}`,children:[N.jsxs("button",{type:"button",className:"thought-toggle",onClick:()=>o(l=>!l),"aria-expanded":s,children:[N.jsx("span",{className:"thought-chevron","aria-hidden":"true",children:s?"▾":"▸"}),"reasoning",n?N.jsx("span",{className:"stream-caret stream-caret--dim","aria-hidden":"true"}):null]}),s?N.jsx("pre",{className:"thought-text",children:t}):null]})}function qR({track:t}){return t.tools.length===0?null:N.jsx("ul",{className:"tool-rail","aria-label":"Tool calls",children:t.tools.map(n=>N.jsxs("li",{className:`tool-chip tool-chip--${WR(n.status)}`,children:[N.jsx("span",{className:"tool-chip-glyph","aria-hidden":"true",children:"⚙"}),N.jsx("span",{className:"tool-chip-title",children:n.title}),n.status?N.jsx("span",{className:"tool-chip-status",children:n.status}):null]},n.key))})}function WR(t){const n=t.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 GR({job:t,timelineOpen:n}){const{containerRef:s,pinned:o,jumpToLatest:l}=IR(t?.jobId??"none",t?.lastEventId??0);return t?N.jsxs("main",{className:"stage",children:[N.jsx(KR,{job:t}),N.jsxs("div",{className:"stage-stream",children:[N.jsx("div",{className:"stage-scroll",ref:s,tabIndex:-1,children:N.jsxs("div",{className:"stage-content",children:[t.trackOrder.length===0?N.jsxs("p",{className:"stage-waiting",children:[N.jsx("span",{className:"stream-caret","aria-hidden":"true"})," waiting for track registration"]}):t.trackOrder.map(y=>{const S=t.tracks[y];return S?N.jsx(jR,{track:S},`${t.jobId}:${y}`):null}),t.summary?N.jsx(VR,{summary:t.summary,status:t.status,error:t.error}):null]})}),o?null:N.jsx("button",{type:"button",className:"follow-button",onClick:l,children:"↓ Follow stream"})]}),N.jsxs("section",{className:`timeline-dock ${n?"is-open":""}`,children:[N.jsxs("button",{type:"button",className:"timeline-toggle",onClick:y2,"aria-expanded":n,children:[N.jsx("span",{className:"timeline-chevron","aria-hidden":"true",children:n?"▾":"▴"}),"Event timeline",N.jsx("span",{className:"timeline-count",children:t.recentEvents.length})]}),n?N.jsx(zR,{events:t.recentEvents}):null]})]}):N.jsx("main",{className:"stage",children:N.jsxs("div",{className:"stage-idle",children:[N.jsx("p",{className:"stage-idle-mark","aria-hidden":"true",children:"▵"}),N.jsx("h2",{children:"Standing by"}),N.jsx("p",{children:"Select a job from the left rail, or dispatch carriers from a Fleet session."})]})})}const KR=te.memo(function({job:n}){const s=js(n.status),o=n.startedAt?MR(n.startedAt,n.finishedAt??n.updatedAt):null;return N.jsxs("header",{className:"job-head",children:[N.jsxs("div",{className:"job-head-id",children:[N.jsx("span",{className:`status-dot status-dot--${s} status-dot--lg`,"aria-hidden":"true"}),N.jsxs("div",{children:[N.jsx("h2",{className:"job-title",children:n.label??au(n.jobId)}),N.jsxs("p",{className:"job-meta",children:[N.jsx("span",{className:`job-status job-status--${s}`,children:al(n.status)}),n.ownerCarrierId?N.jsxs("span",{children:["· ",n.ownerCarrierId]}):null,n.kind?N.jsxs("span",{children:["· ",n.kind]}):null,o?N.jsxs("span",{children:["· ",o]}):null,n.startedAt?N.jsxs("span",{children:["· started ",Fb(n.startedAt)]}):null]})]})]}),N.jsx("code",{className:"job-id",title:n.jobId,children:au(n.jobId)})]})});function VR({summary:t,status:n,error:s}){return N.jsxs("aside",{className:`job-summary job-summary--${js(n)}`,children:[N.jsx("p",{className:"job-summary-eyebrow",children:n==="error"?"Finalized with error":"Finalized"}),N.jsx("p",{className:"job-summary-text",children:t}),s?N.jsx("p",{className:"job-summary-error",children:s}):null]})}function YR({state:t}){const n=R2(t);return te.useEffect(()=>{const s=o=>{o.key==="Escape"&&Ad()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[]),n?N.jsxs("div",{className:"job-overlay",role:"dialog","aria-modal":"true","aria-label":"Carrier job stream",children:[N.jsx("button",{type:"button",className:"job-overlay-scrim",onClick:Ad,"aria-label":"Close job stream"}),N.jsxs("div",{className:"job-overlay-card",children:[N.jsx("button",{type:"button",className:"job-overlay-close",onClick:Ad,"aria-label":"Close job stream",children:"×"}),N.jsx(GR,{job:n,timelineOpen:t.timelineOpen})]})]}):null}function XR({creating:t,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 N.jsxs("section",{className:"operations-landing","aria-label":"Operations workspace landing",children:[N.jsx("div",{className:"operations-landing-mark","aria-hidden":"true"}),N.jsxs("div",{children:[N.jsx("p",{className:"operations-landing-eyebrow",children:"Operation"}),N.jsx("h1",{children:l}),N.jsx("p",{children:y})]}),N.jsx("p",{className:`operations-landing-status ${t?"is-live":""}`,children:t?"Launching operation":"No terminal session selected"}),n?N.jsx("p",{className:"operations-landing-error",children:n}):null]})}function ZR({state:t}){const n=Uf(t);return N.jsxs("nav",{className:"operations-sidebar","aria-label":"Operation sessions and carrier jobs",children:[N.jsxs("div",{className:"sidebar-heading",children:[N.jsx("p",{className:"sidebar-eyebrow",children:"Operations"}),N.jsx(QR,{state:t})]}),n.length>0?N.jsx("ol",{className:"session-list",children:n.map(s=>{const o=t.sessions[s];return o?N.jsx(JR,{session:o,active:t.activeTerminalSessionId===s,jobs:d1(t,o),selectedJobId:t.selectedJobId},s):null})}):null,t.terminalSessionError?N.jsx("p",{className:"sidebar-error",children:t.terminalSessionError}):null,n.length===0?N.jsxs("p",{className:"sidebar-empty",children:[t.activeTheaterId?"No operations in this Theater.":"No Theaters registered.",N.jsx("br",{}),t.activeTheaterId?"Use + to launch one here.":"Add a Theater from the top bar."]}):null]})}function QR({state:t}){const[n,s]=te.useState(!1),o=te.useRef(null),l=te.useRef(null),y=te.useRef(null),S=t.creatingTerminalSession||t.addingTheater||!t.activeTheaterId||t.agentClis.length===0;te.useEffect(()=>{if(!n)return;const h=f=>{o.current?.contains(f.target)||s(!1)},g=f=>{f.key==="Escape"&&(s(!1),l.current?.focus())};return document.addEventListener("mousedown",h),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",g)}},[n]),te.useEffect(()=>{if(!n)return;const h=y.current;h&&h.querySelector("[role^='menuitem']")?.focus()},[n]);const c=async h=>{if(!(t.creatingTerminalSession||t.addingTheater||!t.activeTheaterId)){s(!1),l.current?.focus(),v2();try{b2(await Fw(t.activeTheaterId,h.id))}catch(g){S2(g instanceof Error?g.message:String(g))}}},u=h=>{if(h.key!=="ArrowDown"&&h.key!=="ArrowUp")return;h.preventDefault();const g=Array.from(y.current?.querySelectorAll("[role^='menuitem']")??[]);if(g.length===0)return;const f=g.indexOf(document.activeElement),C=h.key==="ArrowDown"?1:-1,E=(f+C+g.length)%g.length;g[E]?.focus()};return N.jsxs("div",{className:"operation-launch-control",ref:o,children:[N.jsx("button",{type:"button",ref:l,className:`workspace-add-button ${n?"is-open":""}`,onClick:()=>s(h=>!h),disabled:S,"aria-haspopup":"menu","aria-expanded":n,"aria-label":"Launch operation",children:N.jsx(ik,{})}),n?N.jsx("div",{className:"operation-launch-menu theater-menu",role:"menu","aria-label":"Launch operation",ref:y,onKeyDown:u,children:N.jsx("ul",{className:"theater-menu-list",children:t.agentClis.map(h=>N.jsx("li",{children:N.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item operation-launch-menu-item",onClick:()=>{c(h)},children:[N.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:nk(h.id)}),N.jsx("span",{className:"theater-menu-label",children:h.label})]})},h.id))})}):null]})}const JR=te.memo(function({session:n,active:s,jobs:o,selectedJobId:l}){const[y,S]=te.useState(!1),[c,u]=te.useState(""),h=te.useRef(null),g=te.useRef(!1),f=te.useRef(!1),E=o.filter(({job:x})=>!Oa(x.status)).length>0||n.status==="registered"||n.status==="live"||n.status==="terminal-only",T=qb(n),w=[...o].sort((x,R)=>Number(Oa(x.job.status))-Number(Oa(R.job.status)));te.useEffect(()=>{y&&(h.current?.focus(),h.current?.select())},[y]);const p=()=>{f.current=!1,u(T),S(!0)},b=()=>{f.current=!0,S(!1),u("")},_=async()=>{if(!g.current){g.current=!0;try{o1(await Ww(n.sessionId,c))}catch(x){E2(x instanceof Error?x.message:String(x))}finally{g.current=!1,f.current=!0,S(!1)}}},m=x=>{if(x.key==="Enter"){x.preventDefault(),_();return}x.key==="Escape"&&(x.preventDefault(),b())};return N.jsxs("li",{className:`session-item ${s?"is-active":""}`,children:[N.jsxs("div",{className:"session-row-shell",children:[y?N.jsxs("div",{className:`session-row session-row-edit ${s?"is-active":""}`,children:[N.jsx("span",{className:`tenant-beacon ${E?"is-live":""}`,"aria-hidden":"true"}),N.jsx("input",{ref:h,className:"session-rename-input",value:c,"aria-label":`${T} 이름 변경`,onChange:x=>u(x.target.value),onKeyDown:m,onBlur:()=>{if(f.current){f.current=!1;return}_()}})]}):N.jsxs("button",{type:"button",className:`session-row ${s?"is-active":""}`,onClick:()=>m2(n.sessionId),onDoubleClick:p,"aria-current":s||void 0,"aria-label":`Operation ${T}`,children:[N.jsx("span",{className:`tenant-beacon ${E?"is-live":""}`,"aria-hidden":"true"}),N.jsx("span",{className:"tenant-row-text",children:N.jsx("span",{className:"tenant-label",children:T})}),!s&&o.length>0?N.jsx("span",{className:"tenant-count",children:o.length}):null]}),N.jsx("button",{type:"button",className:"session-close",onClick:()=>{tk(n.sessionId)},"aria-label":`Terminate operation ${T}`,title:"Terminate operation",children:N.jsx(lk,{})})]}),s?N.jsx("ol",{className:"session-job-list",children:w.length>0?w.map(({job:x})=>N.jsx(ek,{job:x,active:x.jobId===l},x.jobId)):N.jsx("li",{className:"job-list-empty",children:"No carrier jobs in this session."})}):null]})}),ek=te.memo(function({job:n,active:s}){const o=js(n.status);return N.jsx("li",{children:N.jsxs("button",{type:"button",className:`job-row ${s?"is-active":""}`,onClick:()=>u1(n.jobId),"aria-current":s||void 0,children:[N.jsx("span",{className:`status-dot status-dot--${o}`,"aria-hidden":"true"}),N.jsxs("span",{className:"job-row-text",children:[N.jsx("span",{className:"job-row-label",children:n.label??au(n.jobId)}),N.jsx("span",{className:"job-row-meta",children:n.ownerCarrierId?`${Wb(n.ownerCarrierId)} · ${al(n.status)}`:al(n.status)})]})]})})});async function tk(t){try{await qw(t)}catch(n){w2(n instanceof Error?n.message:String(n));return}c1(t)}function ik(){return N.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:N.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function nk(t){return t==="claude"?N.jsx(rk,{}):t==="claude-kimi"?N.jsx(sk,{}):t==="codex"?N.jsx(ak,{}):N.jsx(ok,{})}function rk(){return N.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:N.jsx("path",{d:"M8 2.6 9.15 6.85 13.4 8 9.15 9.15 8 13.4 6.85 9.15 2.6 8 6.85 6.85Z",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinejoin:"round"})})}function sk(){return N.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:N.jsx("path",{d:"M9.7 3.2A5 5 0 1 0 9.7 12.8 4 4 0 1 1 9.7 3.2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinejoin:"round"})})}function ak(){return N.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:N.jsx("path",{d:"M6.2 4.8 3.2 8 6.2 11.2M9.8 4.8 12.8 8 9.8 11.2",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinecap:"round",strokeLinejoin:"round"})})}function ok(){return N.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[N.jsx("rect",{x:"2.8",y:"3.4",width:"10.4",height:"8.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.15"}),N.jsx("path",{d:"M5 6.2 6.7 8 5 9.8M7.8 9.8h3",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinecap:"round",strokeLinejoin:"round"})]})}function lk(){return N.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:N.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 ck({state:t,sessionId:n,expanded:s}){const o=t.sessions[n],l=o?d1(t,o).filter(({job:y})=>!Oa(y.status)):[];return N.jsxs(N.Fragment,{children:[N.jsx("button",{type:"button",className:`terminal-zoom-toggle ${s?"is-expanded":""}`,onClick:()=>C2(n),"aria-label":s?"터미널 축소":"터미널 확대",title:s?"터미널 축소":"터미널 확대",children:s?N.jsx(dk,{}):N.jsx(hk,{})}),l.length>0?N.jsx("div",{className:"terminal-job-dock","aria-label":"Active carrier jobs in terminal",children:N.jsx("ol",{className:"terminal-job-lines",children:l.map(({job:y})=>N.jsx(uk,{job:y,active:t.selectedJobId===y.jobId},y.jobId))})}):null]})}function uk({job:t,active:n}){const s=js(t.status),o=OR(t),l=t.ownerCarrierId?`${Wb(t.ownerCarrierId)} · ${al(t.status)}`:al(t.status);return N.jsx("li",{children:N.jsxs("button",{type:"button",className:`terminal-job-line ${n?"is-active":""}`,onClick:()=>u1(t.jobId),"aria-current":n||void 0,children:[N.jsx("span",{className:`status-dot status-dot--${s}`,"aria-hidden":"true"}),N.jsx("span",{className:"terminal-job-line-label",children:t.label??au(t.jobId)}),N.jsx("span",{className:"terminal-job-line-meta",children:l}),o?N.jsxs(N.Fragment,{children:[N.jsx("span",{className:"terminal-job-line-sep","aria-hidden":"true",children:"-"}),N.jsx("span",{className:"terminal-job-line-stream",children:o})]}):null]})})}function hk(){return N.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:N.jsx("path",{d:"M6.4 3.2H3.2v3.2M3.4 3.4l4.1 4.1M9.6 12.8h3.2V9.6M12.6 12.6 8.5 8.5",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function dk(){return N.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:N.jsx("path",{d:"M7 7H3.8M3.8 7V3.8M3.9 7.1l4-4M9 9h3.2M12.2 9v3.2M12.1 8.9l-4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function fk({state:t}){const n=t.activeTerminalSessionId&&Uf(t).includes(t.activeTerminalSessionId)?t.activeTerminalSessionId:null,s=n?L2(t,n):!1;return N.jsxs("div",{className:`console-body ${s?"is-expanded":""}`,children:[s?null:N.jsx(ZR,{state:t}),N.jsx("main",{className:"operations-terminal-stage",children:n?N.jsxs(N.Fragment,{children:[N.jsx(K1,{sessionId:n,onExit:()=>c1(n)},n),N.jsx(ck,{state:t,sessionId:n,expanded:s}),N.jsx(YR,{state:t})]}):N.jsx(XR,{creating:t.creatingTerminalSession,error:t.terminalSessionError,hasTheaters:t.theaters.length>0,activeTheaterId:t.activeTheaterId})})]})}function pk(t){return{activeTheater:mk(t),readiness:gk(t,t.activeTheaterId),theaters:_k(t),connection:t.connection,connectionError:t.connectionError}}function _k(t){return t.theaters.map(n=>{const s=op(t,n.id),o=lp(t,n.id),l=cp(t,o);return{id:n.id,label:n.label,hasWiki:n.hasWiki,activeAdmiralCount:n.activeAdmiralCount,terminalSessionCount:s.length,liveJobCount:l.filter(y=>js(y.status)==="live").length,lastActivityAt:Gb([Date.parse(n.lastOpenedAt),...s.map(y=>y.createdAt),...o.map(y=>y.createdAt),...l.map(y=>y.updatedAt)]),active:n.id===t.activeTheaterId}})}function gk(t,n){const s=n?op(t,n):[],o=n?lp(t,n):[],l=cp(t,o),y=l.filter(h=>js(h.status)==="live").length,S=l.filter(h=>Oa(h.status)&&h.status==="done").length,c=l.filter(h=>Oa(h.status)&&(h.status==="error"||h.status==="aborted")).length,u=t.activeTerminalSessionId?t.sessions[t.activeTerminalSessionId]:void 0;return{activeSessionLabel:u&&n&&u.theaterId===n?qb(u):"No active session",terminalSessionCount:s.length,liveJobCount:y,completedJobCount:S,failedJobCount:c,emptyState:vk(t,s,l)}}function mk(t){const n=t.theaters.find(y=>y.id===t.activeTheaterId);if(!n)return null;const s=op(t,n.id),o=lp(t,n.id),l=cp(t,o);return{id:n.id,label:n.label,hasWiki:n.hasWiki,activeAdmiralCount:n.activeAdmiralCount,terminalSessionCount:s.length,registeredTenantCount:o.filter(y=>y.status!=="closed").length,lastActivityAt:Gb([Date.parse(n.lastOpenedAt),...s.map(y=>y.createdAt),...o.map(y=>y.createdAt),...l.map(y=>y.updatedAt)])}}function op(t,n){return t.sessionOrder.map(s=>t.sessions[s]).filter(s=>s!==void 0&&s.theaterId===n)}function lp(t,n){return t.tenants.filter(s=>s.theaterId===n)}function cp(t,n){const s=[];for(const o of n){const l=t.tenantJobs[o.tenantId];if(l)for(const y of l.jobOrder){const S=l.jobs[y];S&&s.push(S)}}return s}function vk(t,n,s){return t.theaters.length===0?"no-theaters":n.length===0?"no-sessions":s.length===0?"no-jobs":null}function Gb(t){const n=t.filter(s=>Number.isFinite(s));return n.length===0?null:Math.max(...n)}async function bk(t,n){const[s,o,l,y]=await Promise.all([Bc(t,"/index",n),Bc(t,"/queue?status=all",n),Bc(t,"/conflicts",n),Bc(t,"/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 Bc(t,n,s){const o=n.startsWith("/")?n:`/${n}`,l=await fetch(`/console/codex/w/${encodeURIComponent(t)}/api${o}`,{signal:s});if(!l.ok)throw new Yi(l.status,l.statusText||`HTTP ${l.status}`);return l.json()}const Nc={loading:!1,value:null,error:null},Sk=15e3;function yk({state:t}){const n=pk(t),s=n.activeTheater,[o,l]=te.useState(Nc),[y,S]=te.useState(Nc),[c,u]=te.useState(Nc);return te.useEffect(()=>{if(!s?.hasWiki){l(Nc);return}const h=new AbortController;return l({loading:!0,value:null,error:null}),bk(s.id,h.signal).then(g=>l({loading:!1,value:g,error:null})).catch(g=>{h.signal.aborted||l({loading:!1,value:null,error:g instanceof Error?g.message:String(g)})}),()=>h.abort()},[s?.hasWiki,s?.id]),te.useEffect(()=>{const h=new AbortController;return S(g=>({loading:!0,value:g.value,error:null})),Q0(s?.id??null,h.signal).then(g=>S({loading:!1,value:g,error:null})).catch(g=>{h.signal.aborted||S({loading:!1,value:null,error:g instanceof Error?g.message:String(g)})}),()=>h.abort()},[s?.id]),te.useEffect(()=>{const h=new AbortController,g=()=>{u(C=>({loading:!0,value:C.value,error:null})),jw(h.signal).then(C=>u({loading:!1,value:C,error:null})).catch(C=>{h.signal.aborted||u(E=>({loading:!1,value:E.value,error:C instanceof Error?C.message:String(C)}))})};g();const f=window.setInterval(g,Sk);return()=>{window.clearInterval(f),h.abort()}},[]),N.jsxs("main",{className:"welcome-page",children:[N.jsxs("section",{className:"bridge-matrix","aria-labelledby":"bridge-matrix-title",children:[N.jsxs("div",{className:"bridge-section-heading",children:[N.jsx("p",{className:"bridge-kicker",children:"Theater Capability Matrix"}),N.jsx("h3",{id:"bridge-matrix-title",children:"Registered Theaters"})]}),N.jsxs("div",{className:"bridge-matrix-table",role:"table","aria-label":"Theater capability matrix",children:[N.jsxs("div",{className:"bridge-matrix-row bridge-matrix-head",role:"row",children:[N.jsx("span",{role:"columnheader",children:"Theater"}),N.jsx("span",{role:"columnheader",children:"Codex"}),N.jsx("span",{role:"columnheader",children:"Active"}),N.jsx("span",{role:"columnheader",children:"Terminals"}),N.jsx("span",{role:"columnheader",children:"Updated"})]}),n.theaters.length>0?n.theaters.map(h=>N.jsx(xk,{theater:h},h.id)):N.jsx("p",{className:"bridge-matrix-empty",children:"No Theaters registered."})]})]}),N.jsxs("section",{className:"bridge-carriers","aria-labelledby":"bridge-carriers-title",children:[N.jsxs("div",{className:"bridge-section-heading",children:[N.jsx("p",{className:"bridge-kicker",children:"Carrier Readiness Matrix"}),N.jsx("h3",{id:"bridge-carriers-title",children:"Carrier roster"})]}),N.jsx(Ek,{carriers:c})]}),N.jsxs("section",{className:"bridge-knowledge","aria-labelledby":"bridge-knowledge-title",children:[N.jsxs("div",{className:"bridge-section-heading",children:[N.jsx("p",{className:"bridge-kicker",children:"Knowledge Readiness Panel"}),N.jsx("h3",{id:"bridge-knowledge-title",children:"Codex readiness"})]}),N.jsx(Ck,{activeTheater:s,knowledge:o})]}),N.jsxs("section",{className:"bridge-health","aria-labelledby":"bridge-health-title",children:[N.jsxs("div",{className:"bridge-section-heading",children:[N.jsx("p",{className:"bridge-kicker",children:"System Information"}),N.jsx("h3",{id:"bridge-health-title",children:"Runtime status"})]}),N.jsx(wk,{health:y})]})]})}function Ck({activeTheater:t,knowledge:n}){if(!t)return N.jsx("div",{className:"bridge-empty",children:N.jsx("p",{children:"Add a Theater to inspect Codex readiness."})});if(!t.hasWiki)return N.jsx("div",{className:"bridge-empty",children:N.jsx("p",{children:"Codex unavailable for this Theater."})});if(n.error)return N.jsx("div",{className:"bridge-empty bridge-empty--warn",children:N.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 N.jsx("div",{className:"bridge-knowledge-grid",children:o.map(l=>N.jsx(Kb,{metric:l},l.label))})}function wk({health:t}){const n=t.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}`:t.loading?"loading":"unknown",caption:"Workspaces / jobs"}];return N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"bridge-health-strip",children:s.map(o=>N.jsx(Kb,{metric:o},o.label))}),t.error?N.jsx("p",{className:"bridge-health-error",children:"System health unavailable."}):null]})}function Ek({carriers:t}){if(t.error)return N.jsx("div",{className:"bridge-empty bridge-empty--warn",children:N.jsx("p",{children:"Carrier readiness degraded."})});const n=t.value??[];return n.length===0?N.jsx("div",{className:"bridge-empty",children:N.jsx("p",{children:t.loading?"Loading carrier readiness.":"No carrier readiness entries available."})}):N.jsxs("div",{className:"bridge-carrier-table",role:"table","aria-label":"Carrier readiness matrix",children:[N.jsxs("div",{className:"bridge-carrier-row bridge-carrier-head",role:"row",children:[N.jsx("span",{role:"columnheader",children:"Carrier"}),N.jsx("span",{role:"columnheader",children:"Role"}),N.jsx("span",{role:"columnheader",children:"Model"}),N.jsx("span",{role:"columnheader",children:"Effort"}),N.jsx("span",{role:"columnheader",children:"Task Force"}),N.jsx("span",{role:"columnheader",children:"Mode"})]}),n.map(s=>N.jsxs("div",{className:"bridge-carrier-row",role:"row",children:[N.jsxs("span",{role:"cell",className:"bridge-carrier-name","data-signature":Ak(s),children:[N.jsx("strong",{children:s.displayName}),N.jsx("small",{children:s.category??"unknown"})]}),N.jsx("span",{role:"cell",children:s.role??s.category??"unknown"}),N.jsx("span",{role:"cell",children:s.model||"unknown"}),N.jsx("span",{role:"cell",children:s.effort??"default"}),N.jsx("span",{role:"cell",children:s.taskForceBackendCount}),N.jsx("span",{role:"cell",children:s.subagentMode?"subagent":s.cliType||"cli"})]},s.carrierId))]})}function Kb({metric:t}){return N.jsxs("article",{className:`bridge-card ${t.tone?`bridge-card--${t.tone}`:""}`,children:[N.jsx("p",{className:"bridge-card-label",children:t.label}),N.jsx("strong",{children:t.value}),N.jsx("p",{children:t.caption})]})}function xk({theater:t}){return N.jsxs("div",{className:`bridge-matrix-row ${t.active?"is-active":""}`,role:"row",children:[N.jsxs("span",{role:"cell",children:[N.jsx("span",{className:`bridge-theater-live ${t.liveJobCount>0?"is-live":""}`,"aria-hidden":"true"}),t.label]}),N.jsx("span",{role:"cell",children:t.hasWiki?"available":"unavailable"}),N.jsx("span",{role:"cell",children:t.activeAdmiralCount}),N.jsx("span",{role:"cell",children:t.terminalSessionCount}),N.jsx("span",{role:"cell",children:Tk(t.lastActivityAt)})]})}function Tk(t){return t?new Date(t).toLocaleString([],{month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"none"}function Ak(t){return!t.subagentMode&&t.taskForceBackendCount>=2?"taskforce":t.cliType}const Rk=6e3;function kk(){const t=G1();return te.useEffect(()=>ex(),[]),te.useEffect(()=>{const n=new AbortController;Uw(n.signal).then(h2).catch(l=>{n.signal.aborted||rt({theaterError:l instanceof Error?l.message:String(l)})}),Gw(n.signal).then(u2).catch(l=>{n.signal.aborted||rt({terminalSessionError:l instanceof Error?l.message:String(l)})});const s=()=>{Q0(t.activeTheaterId,n.signal).then(c2).catch(()=>{})};s();const o=window.setTimeout(s,Rk);return()=>{window.clearTimeout(o),n.abort()}},[]),te.useEffect(()=>{const n=s=>{(s.metaKey||s.ctrlKey)&&s.key==="`"&&(s.preventDefault(),l1())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),N.jsxs("div",{className:"console-shell",children:[N.jsx($5,{state:t}),N.jsxs(sw,{children:[N.jsx(Vo,{path:"/",element:N.jsx(yk,{state:t})}),N.jsx(Vo,{path:"/operations",element:N.jsx(fk,{state:t})}),N.jsx(Vo,{path:"/codex/*",element:N.jsx(LR,{state:t})}),N.jsx(Vo,{path:"*",element:N.jsx(nw,{to:"/",replace:!0})})]}),N.jsx(I5,{state:t}),N.jsx(H5,{open:t.connectionError!==null,tone:"error",title:"Console link interrupted",message:t.connectionError??void 0})]})}s2();const L0=document.querySelector("#app");L0&&aC.createRoot(L0).render(N.jsx(te.StrictMode,{children:N.jsx(kw,{basename:"/console",children:N.jsx(kk,{})})}));export{qA as _,Lk as a,Xy as g,bt as k,il as p};