@dotobokuri/fleet-console 1.9.0 → 1.10.1

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 (63) hide show
  1. package/AGENTS.md +4 -4
  2. package/dist/cli-bin.mjs +571 -344
  3. package/dist/cli.mjs +571 -344
  4. package/dist/client/assets/{_baseUniq-_nKBty4x.js → _baseUniq-e_j340KJ.js} +1 -1
  5. package/dist/client/assets/{arc-DEjqUlkY.js → arc-CioNx0k6.js} +1 -1
  6. package/dist/client/assets/{architectureDiagram-Q4EWVU46-CPF3RLab.js → architectureDiagram-Q4EWVU46-B_8HDSCb.js} +1 -1
  7. package/dist/client/assets/{blockDiagram-DXYQGD6D-DguupB0e.js → blockDiagram-DXYQGD6D-CpHdrypQ.js} +1 -1
  8. package/dist/client/assets/{c4Diagram-AHTNJAMY-Dd7AVc09.js → c4Diagram-AHTNJAMY-CkitEGpF.js} +1 -1
  9. package/dist/client/assets/channel-CEwT4AXW.js +1 -0
  10. package/dist/client/assets/{chunk-4BX2VUAB-CSIihHG7.js → chunk-4BX2VUAB-DxyXXSCc.js} +1 -1
  11. package/dist/client/assets/{chunk-4TB4RGXK-DR_cPI3H.js → chunk-4TB4RGXK-C2-nU4zS.js} +1 -1
  12. package/dist/client/assets/{chunk-55IACEB6-97czQ3iV.js → chunk-55IACEB6-Ch5DNHFU.js} +1 -1
  13. package/dist/client/assets/{chunk-EDXVE4YY-piQCPtjQ.js → chunk-EDXVE4YY-CHE6KKZa.js} +1 -1
  14. package/dist/client/assets/{chunk-FMBD7UC4-BIeV9l0L.js → chunk-FMBD7UC4-PFqCeOs6.js} +1 -1
  15. package/dist/client/assets/{chunk-OYMX7WX6-DWUJBKm_.js → chunk-OYMX7WX6-DHE5_rgO.js} +1 -1
  16. package/dist/client/assets/{chunk-QZHKN3VN-DHL5fPU4.js → chunk-QZHKN3VN-BNsfe2Ai.js} +1 -1
  17. package/dist/client/assets/{chunk-YZCP3GAM-Dk19Wldz.js → chunk-YZCP3GAM-Du6aAWOS.js} +1 -1
  18. package/dist/client/assets/classDiagram-6PBFFD2Q-BcAsKAPs.js +1 -0
  19. package/dist/client/assets/classDiagram-v2-HSJHXN6E-BcAsKAPs.js +1 -0
  20. package/dist/client/assets/clone-BbRCSYXZ.js +1 -0
  21. package/dist/client/assets/{cose-bilkent-S5V4N54A-CcROwyfn.js → cose-bilkent-S5V4N54A-BMbRb2Ij.js} +1 -1
  22. package/dist/client/assets/{dagre-KV5264BT-kdHN8OcZ.js → dagre-KV5264BT-BIYIuU4t.js} +1 -1
  23. package/dist/client/assets/{diagram-5BDNPKRD-yqi72mWd.js → diagram-5BDNPKRD-DE58KlL0.js} +1 -1
  24. package/dist/client/assets/{diagram-G4DWMVQ6-CTjHbP--.js → diagram-G4DWMVQ6-BBHYXkDj.js} +1 -1
  25. package/dist/client/assets/{diagram-MMDJMWI5-BCGN9v8i.js → diagram-MMDJMWI5-BGA4ZKw3.js} +1 -1
  26. package/dist/client/assets/{diagram-TYMM5635-p6gtwFXr.js → diagram-TYMM5635-DusN1Hix.js} +1 -1
  27. package/dist/client/assets/{erDiagram-SMLLAGMA-BHNCT04F.js → erDiagram-SMLLAGMA-84E-AJKo.js} +1 -1
  28. package/dist/client/assets/{flowDiagram-DWJPFMVM-DP-E6Gb1.js → flowDiagram-DWJPFMVM-Dpap9NqV.js} +1 -1
  29. package/dist/client/assets/{ganttDiagram-T4ZO3ILL-COKcadl7.js → ganttDiagram-T4ZO3ILL-CukRJAaM.js} +1 -1
  30. package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-CVkte06j.js → gitGraphDiagram-UUTBAWPF-DuAwiTii.js} +1 -1
  31. package/dist/client/assets/{graph-BljmCiGu.js → graph-B7irxl7Q.js} +1 -1
  32. package/dist/client/assets/index-CTyjGQHF.css +1 -0
  33. package/dist/client/assets/index-Uidvbtqb.js +777 -0
  34. package/dist/client/assets/{infoDiagram-42DDH7IO-Dh_U82lE.js → infoDiagram-42DDH7IO-Gdh2w_Ry.js} +1 -1
  35. package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-BtZhb0mv.js → ishikawaDiagram-UXIWVN3A-DvbqJman.js} +1 -1
  36. package/dist/client/assets/{journeyDiagram-VCZTEJTY-_Zd4No67.js → journeyDiagram-VCZTEJTY-DIQYAsjN.js} +1 -1
  37. package/dist/client/assets/{kanban-definition-6JOO6SKY-CpIIMkPJ.js → kanban-definition-6JOO6SKY-8BBtOuAV.js} +1 -1
  38. package/dist/client/assets/{layout-ButG21vs.js → layout-DDUpLunD.js} +1 -1
  39. package/dist/client/assets/{linear-C-frnGuN.js → linear-BzLoJVdP.js} +1 -1
  40. package/dist/client/assets/{mermaid.core-ISlBhdkY.js → mermaid.core-Ddi7z3V3.js} +4 -4
  41. package/dist/client/assets/{min-CalB2Q9y.js → min-CEKwugI-.js} +1 -1
  42. package/dist/client/assets/{mindmap-definition-QFDTVHPH-BfilPIUD.js → mindmap-definition-QFDTVHPH-y-V-6GIi.js} +1 -1
  43. package/dist/client/assets/{pieDiagram-DEJITSTG-Dm_1WIPT.js → pieDiagram-DEJITSTG-DjqTUefi.js} +1 -1
  44. package/dist/client/assets/{quadrantDiagram-34T5L4WZ-DMzRgLeF.js → quadrantDiagram-34T5L4WZ-BZbwyDuC.js} +1 -1
  45. package/dist/client/assets/{requirementDiagram-MS252O5E-Bl1lUR6U.js → requirementDiagram-MS252O5E-M2epVejI.js} +1 -1
  46. package/dist/client/assets/{sankeyDiagram-XADWPNL6-VxDrFumf.js → sankeyDiagram-XADWPNL6-DQHzVL6h.js} +1 -1
  47. package/dist/client/assets/{sequenceDiagram-FGHM5R23-BoB_k7L2.js → sequenceDiagram-FGHM5R23-Dldq08WJ.js} +1 -1
  48. package/dist/client/assets/{stateDiagram-FHFEXIEX-C8DFihD3.js → stateDiagram-FHFEXIEX-B32muPdI.js} +1 -1
  49. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-Ct3tm_Bq.js +1 -0
  50. package/dist/client/assets/{timeline-definition-GMOUNBTQ-G5hn4rEl.js → timeline-definition-GMOUNBTQ-nSYYEX6t.js} +1 -1
  51. package/dist/client/assets/{vennDiagram-DHZGUBPP-D_jMNDmm.js → vennDiagram-DHZGUBPP-DPIMKKCQ.js} +1 -1
  52. package/dist/client/assets/{wardley-RL74JXVD-Clc5Li47.js → wardley-RL74JXVD-DArerB6Y.js} +1 -1
  53. package/dist/client/assets/{wardleyDiagram-NUSXRM2D-Bygn2On7.js → wardleyDiagram-NUSXRM2D-DRvimWEN.js} +1 -1
  54. package/dist/client/assets/{xychartDiagram-5P7HB3ND-arK3uijt.js → xychartDiagram-5P7HB3ND-D0VCX3ps.js} +1 -1
  55. package/dist/client/index.html +2 -2
  56. package/package.json +1 -1
  57. package/dist/client/assets/channel-DA6xE92d.js +0 -1
  58. package/dist/client/assets/classDiagram-6PBFFD2Q-D46R_D_e.js +0 -1
  59. package/dist/client/assets/classDiagram-v2-HSJHXN6E-D46R_D_e.js +0 -1
  60. package/dist/client/assets/clone-DV233GSJ.js +0 -1
  61. package/dist/client/assets/index-B7IECSX7.css +0 -1
  62. package/dist/client/assets/index-CSTdaEyG.js +0 -777
  63. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-DlDadEC7.js +0 -1
@@ -1,777 +0,0 @@
1
- (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const v of o)if(v.type==="childList")for(const m of v.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&a(m)}).observe(document,{childList:!0,subtree:!0});function r(o){const v={};return o.integrity&&(v.integrity=o.integrity),o.referrerPolicy&&(v.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?v.credentials="include":o.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function a(o){if(o.ep)return;o.ep=!0;const v=r(o);fetch(o.href,v)}})();function ME(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function H7(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var n=e.default;if(typeof n=="function"){var r=function a(){var o=!1;try{o=this instanceof a}catch{}return o?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};r.prototype=n.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}),r}var jf={exports:{}},fl={};var hb;function DE(){if(hb)return fl;hb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(a,o,v){var m=null;if(v!==void 0&&(m=""+v),o.key!==void 0&&(m=""+o.key),"key"in o){v={};for(var c in o)c!=="key"&&(v[c]=o[c])}else v=o;return o=v.ref,{$$typeof:e,type:a,key:m,ref:o!==void 0?o:null,props:v}}return fl.Fragment=n,fl.jsx=r,fl.jsxs=r,fl}var db;function OE(){return db||(db=1,jf.exports=DE()),jf.exports}var d=OE(),$f={exports:{}},Ue={};var fb;function NE(){if(fb)return Ue;fb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),m=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),C=Symbol.iterator;function x(N){return N===null||typeof N!="object"?null:(N=C&&N[C]||N["@@iterator"],typeof N=="function"?N:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,g={};function b(N,H,Z){this.props=N,this.context=H,this.refs=g,this.updater=Z||k}b.prototype.isReactComponent={},b.prototype.setState=function(N,H){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,H,"setState")},b.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function p(){}p.prototype=b.prototype;function y(N,H,Z){this.props=N,this.context=H,this.refs=g,this.updater=Z||k}var T=y.prototype=new p;T.constructor=y,E(T,b.prototype),T.isPureReactComponent=!0;var A=Array.isArray;function L(){}var M={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function O(N,H,Z){var ae=Z.ref;return{$$typeof:e,type:N,key:H,ref:ae!==void 0?ae:null,props:Z}}function F(N,H){return O(N.type,H,N.props)}function U(N){return typeof N=="object"&&N!==null&&N.$$typeof===e}function G(N){var H={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(Z){return H[Z]})}var B=/\/+/g;function K(N,H){return typeof N=="object"&&N!==null&&N.key!=null?G(""+N.key):H.toString(36)}function te(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(L,L):(N.status="pending",N.then(function(H){N.status==="pending"&&(N.status="fulfilled",N.value=H)},function(H){N.status==="pending"&&(N.status="rejected",N.reason=H)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function q(N,H,Z,ae,ce){var _e=typeof N;(_e==="undefined"||_e==="boolean")&&(N=null);var Q=!1;if(N===null)Q=!0;else switch(_e){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(N.$$typeof){case e:case n:Q=!0;break;case S:return Q=N._init,q(Q(N._payload),H,Z,ae,ce)}}if(Q)return ce=ce(N),Q=ae===""?"."+K(N,0):ae,A(ce)?(Z="",Q!=null&&(Z=Q.replace(B,"$&/")+"/"),q(ce,H,Z,"",function(ge){return ge})):ce!=null&&(U(ce)&&(ce=F(ce,Z+(ce.key==null||N&&N.key===ce.key?"":(""+ce.key).replace(B,"$&/")+"/")+Q)),H.push(ce)),1;Q=0;var P=ae===""?".":ae+":";if(A(N))for(var oe=0;oe<N.length;oe++)ae=N[oe],_e=P+K(ae,oe),Q+=q(ae,H,Z,_e,ce);else if(oe=x(N),typeof oe=="function")for(N=oe.call(N),oe=0;!(ae=N.next()).done;)ae=ae.value,_e=P+K(ae,oe++),Q+=q(ae,H,Z,_e,ce);else if(_e==="object"){if(typeof N.then=="function")return q(te(N),H,Z,ae,ce);throw H=String(N),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return Q}function W(N,H,Z){if(N==null)return N;var ae=[],ce=0;return q(N,ae,"","",function(_e){return H.call(Z,_e,ce++)}),ae}function Y(N){if(N._status===-1){var H=N._result;H=H(),H.then(function(Z){(N._status===0||N._status===-1)&&(N._status=1,N._result=Z)},function(Z){(N._status===0||N._status===-1)&&(N._status=2,N._result=Z)}),N._status===-1&&(N._status=0,N._result=H)}if(N._status===1)return N._result.default;throw N._result}var I=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},$={map:W,forEach:function(N,H,Z){W(N,function(){H.apply(this,arguments)},Z)},count:function(N){var H=0;return W(N,function(){H++}),H},toArray:function(N){return W(N,function(H){return H})||[]},only:function(N){if(!U(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Ue.Activity=f,Ue.Children=$,Ue.Component=b,Ue.Fragment=r,Ue.Profiler=o,Ue.PureComponent=y,Ue.StrictMode=a,Ue.Suspense=u,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(N){return M.H.useMemoCache(N)}},Ue.cache=function(N){return function(){return N.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(N,H,Z){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var ae=E({},N.props),ce=N.key;if(H!=null)for(_e in H.key!==void 0&&(ce=""+H.key),H)!R.call(H,_e)||_e==="key"||_e==="__self"||_e==="__source"||_e==="ref"&&H.ref===void 0||(ae[_e]=H[_e]);var _e=arguments.length-2;if(_e===1)ae.children=Z;else if(1<_e){for(var Q=Array(_e),P=0;P<_e;P++)Q[P]=arguments[P+2];ae.children=Q}return O(N.type,ce,ae)},Ue.createContext=function(N){return N={$$typeof:m,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:v,_context:N},N},Ue.createElement=function(N,H,Z){var ae,ce={},_e=null;if(H!=null)for(ae in H.key!==void 0&&(_e=""+H.key),H)R.call(H,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ce[ae]=H[ae]);var Q=arguments.length-2;if(Q===1)ce.children=Z;else if(1<Q){for(var P=Array(Q),oe=0;oe<Q;oe++)P[oe]=arguments[oe+2];ce.children=P}if(N&&N.defaultProps)for(ae in Q=N.defaultProps,Q)ce[ae]===void 0&&(ce[ae]=Q[ae]);return O(N,_e,ce)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(N){return{$$typeof:c,render:N}},Ue.isValidElement=U,Ue.lazy=function(N){return{$$typeof:S,_payload:{_status:-1,_result:N},_init:Y}},Ue.memo=function(N,H){return{$$typeof:h,type:N,compare:H===void 0?null:H}},Ue.startTransition=function(N){var H=M.T,Z={};M.T=Z;try{var ae=N(),ce=M.S;ce!==null&&ce(Z,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(L,I)}catch(_e){I(_e)}finally{H!==null&&Z.types!==null&&(H.types=Z.types),M.T=H}},Ue.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Ue.use=function(N){return M.H.use(N)},Ue.useActionState=function(N,H,Z){return M.H.useActionState(N,H,Z)},Ue.useCallback=function(N,H){return M.H.useCallback(N,H)},Ue.useContext=function(N){return M.H.useContext(N)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(N,H){return M.H.useDeferredValue(N,H)},Ue.useEffect=function(N,H){return M.H.useEffect(N,H)},Ue.useEffectEvent=function(N){return M.H.useEffectEvent(N)},Ue.useId=function(){return M.H.useId()},Ue.useImperativeHandle=function(N,H,Z){return M.H.useImperativeHandle(N,H,Z)},Ue.useInsertionEffect=function(N,H){return M.H.useInsertionEffect(N,H)},Ue.useLayoutEffect=function(N,H){return M.H.useLayoutEffect(N,H)},Ue.useMemo=function(N,H){return M.H.useMemo(N,H)},Ue.useOptimistic=function(N,H){return M.H.useOptimistic(N,H)},Ue.useReducer=function(N,H,Z){return M.H.useReducer(N,H,Z)},Ue.useRef=function(N){return M.H.useRef(N)},Ue.useState=function(N){return M.H.useState(N)},Ue.useSyncExternalStore=function(N,H,Z){return M.H.useSyncExternalStore(N,H,Z)},Ue.useTransition=function(){return M.H.useTransition()},Ue.version="19.2.7",Ue}var pb;function jg(){return pb||(pb=1,$f.exports=NE()),$f.exports}var z=jg(),zf={exports:{}},pl={},Pf={exports:{}},Hf={};var gb;function IE(){return gb||(gb=1,(function(e){function n(q,W){var Y=q.length;q.push(W);e:for(;0<Y;){var I=Y-1>>>1,$=q[I];if(0<o($,W))q[I]=W,q[Y]=$,Y=I;else break e}}function r(q){return q.length===0?null:q[0]}function a(q){if(q.length===0)return null;var W=q[0],Y=q.pop();if(Y!==W){q[0]=Y;e:for(var I=0,$=q.length,N=$>>>1;I<N;){var H=2*(I+1)-1,Z=q[H],ae=H+1,ce=q[ae];if(0>o(Z,Y))ae<$&&0>o(ce,Z)?(q[I]=ce,q[ae]=Y,I=ae):(q[I]=Z,q[H]=Y,I=H);else if(ae<$&&0>o(ce,Y))q[I]=ce,q[ae]=Y,I=ae;else break e}}return W}function o(q,W){var Y=q.sortIndex-W.sortIndex;return Y!==0?Y:q.id-W.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var v=performance;e.unstable_now=function(){return v.now()}}else{var m=Date,c=m.now();e.unstable_now=function(){return m.now()-c}}var u=[],h=[],S=1,f=null,C=3,x=!1,k=!1,E=!1,g=!1,b=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function T(q){for(var W=r(h);W!==null;){if(W.callback===null)a(h);else if(W.startTime<=q)a(h),W.sortIndex=W.expirationTime,n(u,W);else break;W=r(h)}}function A(q){if(E=!1,T(q),!k)if(r(u)!==null)k=!0,L||(L=!0,G());else{var W=r(h);W!==null&&te(A,W.startTime-q)}}var L=!1,M=-1,R=5,O=-1;function F(){return g?!0:!(e.unstable_now()-O<R)}function U(){if(g=!1,L){var q=e.unstable_now();O=q;var W=!0;try{e:{k=!1,E&&(E=!1,p(M),M=-1),x=!0;var Y=C;try{t:{for(T(q),f=r(u);f!==null&&!(f.expirationTime>q&&F());){var I=f.callback;if(typeof I=="function"){f.callback=null,C=f.priorityLevel;var $=I(f.expirationTime<=q);if(q=e.unstable_now(),typeof $=="function"){f.callback=$,T(q),W=!0;break t}f===r(u)&&a(u),T(q)}else a(u);f=r(u)}if(f!==null)W=!0;else{var N=r(h);N!==null&&te(A,N.startTime-q),W=!1}}break e}finally{f=null,C=Y,x=!1}W=void 0}}finally{W?G():L=!1}}}var G;if(typeof y=="function")G=function(){y(U)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,K=B.port2;B.port1.onmessage=U,G=function(){K.postMessage(null)}}else G=function(){b(U,0)};function te(q,W){M=b(function(){q(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(q){switch(C){case 1:case 2:case 3:var W=3;break;default:W=C}var Y=C;C=W;try{return q()}finally{C=Y}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(q,W){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var Y=C;C=q;try{return W()}finally{C=Y}},e.unstable_scheduleCallback=function(q,W,Y){var I=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?I+Y:I):Y=I,q){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=Y+$,q={id:S++,callback:W,priorityLevel:q,startTime:Y,expirationTime:$,sortIndex:-1},Y>I?(q.sortIndex=Y,n(h,q),r(u)===null&&q===r(h)&&(E?(p(M),M=-1):E=!0,te(A,Y-I))):(q.sortIndex=$,n(u,q),k||x||(k=!0,L||(L=!0,G()))),q},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(q){var W=C;return function(){var Y=C;C=W;try{return q.apply(this,arguments)}finally{C=Y}}}})(Hf)),Hf}var mb;function BE(){return mb||(mb=1,Pf.exports=IE()),Pf.exports}var Uf={exports:{}},On={};var _b;function jE(){if(_b)return On;_b=1;var e=jg();function n(u){var h="https://react.dev/errors/"+u;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)h+="&args[]="+encodeURIComponent(arguments[S])}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 r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function v(u,h,S){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:f==null?null:""+f,children:u,containerInfo:h,implementation:S}}var m=e.__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 On.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,On.createPortal=function(u,h){var S=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 v(u,h,null,S)},On.flushSync=function(u){var h=m.T,S=a.p;try{if(m.T=null,a.p=2,u)return u()}finally{m.T=h,a.p=S,a.d.f()}},On.preconnect=function(u,h){typeof u=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,a.d.C(u,h))},On.prefetchDNS=function(u){typeof u=="string"&&a.d.D(u)},On.preinit=function(u,h){if(typeof u=="string"&&h&&typeof h.as=="string"){var S=h.as,f=c(S,h.crossOrigin),C=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;S==="style"?a.d.S(u,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:f,integrity:C,fetchPriority:x}):S==="script"&&a.d.X(u,{crossOrigin:f,integrity:C,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},On.preinitModule=function(u,h){if(typeof u=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var S=c(h.as,h.crossOrigin);a.d.M(u,{crossOrigin:S,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&a.d.M(u)},On.preload=function(u,h){if(typeof u=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var S=h.as,f=c(S,h.crossOrigin);a.d.L(u,S,{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})}},On.preloadModule=function(u,h){if(typeof u=="string")if(h){var S=c(h.as,h.crossOrigin);a.d.m(u,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:S,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(u)},On.requestFormReset=function(u){a.d.r(u)},On.unstable_batchedUpdates=function(u,h){return u(h)},On.useFormState=function(u,h,S){return m.H.useFormState(u,h,S)},On.useFormStatus=function(){return m.H.useHostTransitionStatus()},On.version="19.2.7",On}var vb;function nS(){if(vb)return Uf.exports;vb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Uf.exports=jE(),Uf.exports}var bb;function $E(){if(bb)return pl;bb=1;var e=BE(),n=jg(),r=nS();function a(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function v(t){var i=t,s=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(s=i.return),t=i.return;while(t)}return i.tag===3?s:null}function m(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function c(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function u(t){if(v(t)!==t)throw Error(a(188))}function h(t){var i=t.alternate;if(!i){if(i=v(t),i===null)throw Error(a(188));return i!==t?null:t}for(var s=t,l=i;;){var _=s.return;if(_===null)break;var w=_.alternate;if(w===null){if(l=_.return,l!==null){s=l;continue}break}if(_.child===w.child){for(w=_.child;w;){if(w===s)return u(_),t;if(w===l)return u(_),i;w=w.sibling}throw Error(a(188))}if(s.return!==l.return)s=_,l=w;else{for(var D=!1,j=_.child;j;){if(j===s){D=!0,s=_,l=w;break}if(j===l){D=!0,l=_,s=w;break}j=j.sibling}if(!D){for(j=w.child;j;){if(j===s){D=!0,s=w,l=_;break}if(j===l){D=!0,l=w,s=_;break}j=j.sibling}if(!D)throw Error(a(189))}}if(s.alternate!==l)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?t:i}function S(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=S(t),i!==null)return i;t=t.sibling}return null}var f=Object.assign,C=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),y=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function G(t){return t===null||typeof t!="object"?null:(t=U&&t[U]||t["@@iterator"],typeof t=="function"?t:null)}var B=Symbol.for("react.client.reference");function K(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===B?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case E:return"Fragment";case b:return"Profiler";case g:return"StrictMode";case A:return"Suspense";case L:return"SuspenseList";case O:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case k:return"Portal";case y:return t.displayName||"Context";case p:return(t._context.displayName||"Context")+".Consumer";case T:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case M:return i=t.displayName||null,i!==null?i:K(t.type)||"Memo";case R:i=t._payload,t=t._init;try{return K(t(i))}catch{}}return null}var te=Array.isArray,q=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},I=[],$=-1;function N(t){return{current:t}}function H(t){0>$||(t.current=I[$],I[$]=null,$--)}function Z(t,i){$++,I[$]=t.current,t.current=i}var ae=N(null),ce=N(null),_e=N(null),Q=N(null);function P(t,i){switch(Z(_e,i),Z(ce,t),Z(ae,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?N0(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=N0(i),t=I0(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}H(ae),Z(ae,t)}function oe(){H(ae),H(ce),H(_e)}function ge(t){t.memoizedState!==null&&Z(Q,t);var i=ae.current,s=I0(i,t.type);i!==s&&(Z(ce,t),Z(ae,s))}function Se(t){ce.current===t&&(H(ae),H(ce)),Q.current===t&&(H(Q),cl._currentValue=Y)}var ye,Pe;function Fe(t){if(ye===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);ye=i&&i[1]||"",Pe=-1<s.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+ye+t+Pe}var Xe=!1;function xt(t,i){if(!t||Xe)return"";Xe=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={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(t,[],fe)}else{try{fe.call()}catch(le){se=le}t.call(fe.prototype)}}else{try{throw Error()}catch(le){se=le}(fe=t())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(le){if(le&&se&&typeof le.stack=="string")return[le.stack,se.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=l.DetermineComponentFrameRoot(),D=w[0],j=w[1];if(D&&j){var X=D.split(`
4
- `),re=j.split(`
5
- `);for(_=l=0;l<X.length&&!X[l].includes("DetermineComponentFrameRoot");)l++;for(;_<re.length&&!re[_].includes("DetermineComponentFrameRoot");)_++;if(l===X.length||_===re.length)for(l=X.length-1,_=re.length-1;1<=l&&0<=_&&X[l]!==re[_];)_--;for(;1<=l&&0<=_;l--,_--)if(X[l]!==re[_]){if(l!==1||_!==1)do if(l--,_--,0>_||X[l]!==re[_]){var ue=`
6
- `+X[l].replace(" at new "," at ");return t.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",t.displayName)),ue}while(1<=l&&0<=_);break}}}finally{Xe=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Fe(s):""}function Ne(t,i){switch(t.tag){case 26:case 27:case 5:return Fe(t.type);case 16:return Fe("Lazy");case 13:return t.child!==i&&i!==null?Fe("Suspense Fallback"):Fe("Suspense");case 19:return Fe("SuspenseList");case 0:case 15:return xt(t.type,!1);case 11:return xt(t.type.render,!1);case 1:return xt(t.type,!0);case 31:return Fe("Activity");default:return""}}function en(t){try{var i="",s=null;do i+=Ne(t,s),s=t,t=t.return;while(t);return i}catch(l){return`
7
- Error generating stack: `+l.message+`
8
- `+l.stack}}var bn=Object.prototype.hasOwnProperty,yn=e.unstable_scheduleCallback,gi=e.unstable_cancelCallback,Oi=e.unstable_shouldYield,tn=e.unstable_requestPaint,ut=e.unstable_now,Vt=e.unstable_getCurrentPriorityLevel,$t=e.unstable_ImmediatePriority,zt=e.unstable_UserBlockingPriority,nn=e.unstable_NormalPriority,Ni=e.unstable_LowPriority,Mn=e.unstable_IdlePriority,ii=e.log,dt=e.unstable_setDisableYieldValue,Hn=null,Yt=null;function Xt(t){if(typeof ii=="function"&&dt(t),Yt&&typeof Yt.setStrictMode=="function")try{Yt.setStrictMode(Hn,t)}catch{}}var Pt=Math.clz32?Math.clz32:ha,ks=Math.log,lr=Math.LN2;function ha(t){return t>>>=0,t===0?32:31-(ks(t)/lr|0)|0}var Ii=256,Ki=262144,cr=4194304;function rn(t){var i=t&42;if(i!==0)return i;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function J(t,i,s){var l=t.pendingLanes;if(l===0)return 0;var _=0,w=t.suspendedLanes,D=t.pingedLanes;t=t.warmLanes;var j=l&134217727;return j!==0?(l=j&~w,l!==0?_=rn(l):(D&=j,D!==0?_=rn(D):s||(s=j&~t,s!==0&&(_=rn(s))))):(j=l&~w,j!==0?_=rn(j):D!==0?_=rn(D):s||(s=l&~t,s!==0&&(_=rn(s)))),_===0?0:i!==0&&i!==_&&(i&w)===0&&(w=_&-_,s=i&-i,w>=s||w===32&&(s&4194048)!==0)?i:_}function he(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function be(t,i){switch(t){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 Be(){var t=cr;return cr<<=1,(cr&62914560)===0&&(cr=4194304),t}function wt(t){for(var i=[],s=0;31>s;s++)i.push(t);return i}function ft(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Te(t,i,s,l,_,w){var D=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var j=t.entanglements,X=t.expirationTimes,re=t.hiddenUpdates;for(s=D&~s;0<s;){var ue=31-Pt(s),fe=1<<ue;j[ue]=0,X[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)}s&=~fe}l!==0&&Ce(t,l,0),w!==0&&_===0&&t.tag!==0&&(t.suspendedLanes|=w&~(D&~i))}function Ce(t,i,s){t.pendingLanes|=i,t.suspendedLanes&=~i;var l=31-Pt(i);t.entangledLanes|=i,t.entanglements[l]=t.entanglements[l]|1073741824|s&261930}function je(t,i){var s=t.entangledLanes|=i;for(t=t.entanglements;s;){var l=31-Pt(s),_=1<<l;_&i|t[l]&i&&(t[l]|=i),s&=~_}}function Bt(t,i){var s=i&-i;return s=(s&42)!==0?1:et(s),(s&(t.suspendedLanes|i))!==0?0:s}function et(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Sn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function ur(){var t=W.p;return t!==0?t:(t=window.event,t===void 0?32:rb(t.type))}function hr(t,i){var s=W.p;try{return W.p=t,i()}finally{W.p=s}}var Un=Math.random().toString(36).slice(2),kt="__reactFiber$"+Un,Et="__reactProps$"+Un,Bi="__reactContainer$"+Un,Hr="__reactEvents$"+Un,da="__reactListeners$"+Un,dr="__reactHandles$"+Un,As="__reactResources$"+Un,Vi="__reactMarker$"+Un;function De(t){delete t[kt],delete t[Et],delete t[Hr],delete t[da],delete t[dr]}function V(t){var i=t[kt];if(i)return i;for(var s=t.parentNode;s;){if(i=s[Bi]||s[kt]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(t=U0(t);t!==null;){if(s=t[kt])return s;t=U0(t)}return i}t=s,s=t.parentNode}return null}function pe(t){if(t=t[kt]||t[Bi]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function xe(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(a(33))}function rt(t){var i=t[As];return i||(i=t[As]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Ze(t){t[Vi]=!0}var At=new Set,Ht={};function Ut(t,i){me(t,i),me(t+"Capture",i)}function me(t,i){for(Ht[t]=i,t=0;t<i.length;t++)At.add(i[t])}var Me=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={},at={};function Ot(t){return bn.call(at,t)?!0:bn.call(Oe,t)?!1:Me.test(t)?at[t]=!0:(Oe[t]=!0,!1)}function Dn(t,i,s){if(Ot(i))if(s===null)t.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var l=i.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+s)}}function ri(t,i,s){if(s===null)t.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+s)}}function Fn(t,i,s,l){if(l===null)t.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(i,s,""+l)}}function Tt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function si(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function nc(t,i,s){var l=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var _=l.get,w=l.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return _.call(this)},set:function(D){s=""+D,w.call(this,D)}}),Object.defineProperty(t,i,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(D){s=""+D},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function fa(t){if(!t._valueTracker){var i=si(t)?"checked":"value";t._valueTracker=nc(t,i,""+t[i])}}function wo(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var s=i.getValue(),l="";return t&&(l=si(t)?t.checked?"true":"false":t.value),t=l,t!==s?(i.setValue(t),!0):!1}function pa(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Ih=/[\n"\\]/g;function qn(t){return t.replace(Ih,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Co(t,i,s,l,_,w,D,j){t.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?t.type=D:t.removeAttribute("type"),i!=null?D==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+Tt(i)):t.value!==""+Tt(i)&&(t.value=""+Tt(i)):D!=="submit"&&D!=="reset"||t.removeAttribute("value"),i!=null?ga(t,D,Tt(i)):s!=null?ga(t,D,Tt(s)):l!=null&&t.removeAttribute("value"),_==null&&w!=null&&(t.defaultChecked=!!w),_!=null&&(t.checked=_&&typeof _!="function"&&typeof _!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?t.name=""+Tt(j):t.removeAttribute("name")}function Rs(t,i,s,l,_,w,D,j){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(t.type=w),i!=null||s!=null){if(!(w!=="submit"&&w!=="reset"||i!=null)){fa(t);return}s=s!=null?""+Tt(s):"",i=i!=null?""+Tt(i):s,j||i===t.value||(t.value=i),t.defaultValue=i}l=l??_,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=j?t.checked:!!l,t.defaultChecked=!!l,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(t.name=D),fa(t)}function ga(t,i,s){i==="number"&&pa(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function wn(t,i,s,l){if(t=t.options,i){i={};for(var _=0;_<s.length;_++)i["$"+s[_]]=!0;for(s=0;s<t.length;s++)_=i.hasOwnProperty("$"+t[s].value),t[s].selected!==_&&(t[s].selected=_),_&&l&&(t[s].defaultSelected=!0)}else{for(s=""+Tt(s),i=null,_=0;_<t.length;_++){if(t[_].value===s){t[_].selected=!0,l&&(t[_].defaultSelected=!0);return}i!==null||t[_].disabled||(i=t[_])}i!==null&&(i.selected=!0)}}function ic(t,i,s){if(i!=null&&(i=""+Tt(i),i!==t.value&&(t.value=i),s==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=s!=null?""+Tt(s):""}function ma(t,i,s,l){if(i==null){if(l!=null){if(s!=null)throw Error(a(92));if(te(l)){if(1<l.length)throw Error(a(93));l=l[0]}s=l}s==null&&(s=""),i=s}s=Tt(i),t.defaultValue=s,l=t.textContent,l===s&&l!==""&&l!==null&&(t.value=l),fa(t)}function He(t,i){if(i){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=i;return}}t.textContent=i}var rc=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 sn(t,i,s){var l=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":l?t.setProperty(i,s):typeof s!="number"||s===0||rc.has(i)?i==="float"?t.cssFloat=s:t[i]=(""+s).trim():t[i]=s+"px"}function pt(t,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(t=t.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||i!=null&&i.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="");for(var _ in i)l=i[_],i.hasOwnProperty(_)&&s[_]!==l&&sn(t,_,l)}else for(var w in i)i.hasOwnProperty(w)&&sn(t,w,i[w])}function Ur(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var fr=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"]]),xo=/^[\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 Fr(t){return xo.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function we(){}var Re=null;function qe(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var tt=null,jt=null;function mi(t){var i=pe(t);if(i&&(t=i.stateNode)){var s=t[Et]||null;e:switch(t=i.stateNode,i.type){case"input":if(Co(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+qn(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var l=s[i];if(l!==t&&l.form===t.form){var _=l[Et]||null;if(!_)throw Error(a(90));Co(l,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(i=0;i<s.length;i++)l=s[i],l.form===t.form&&wo(l)}break e;case"textarea":ic(t,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&wn(t,!!s.multiple,i,!1)}}}var Eo=!1;function sc(t,i,s){if(Eo)return t(i,s);Eo=!0;try{var l=t(i);return l}finally{if(Eo=!1,(tt!==null||jt!==null)&&(Gc(),tt&&(i=tt,t=jt,jt=tt=null,mi(i),t)))for(i=0;i<t.length;i++)mi(t[i])}}function To(t,i){var s=t.stateNode;if(s===null)return null;var l=s[Et]||null;if(l===null)return null;s=l[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":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var pr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bh=!1;if(pr)try{var ko={};Object.defineProperty(ko,"passive",{get:function(){Bh=!0}}),window.addEventListener("test",ko,ko),window.removeEventListener("test",ko,ko)}catch{Bh=!1}var qr=null,jh=null,ac=null;function Im(){if(ac)return ac;var t,i=jh,s=i.length,l,_="value"in qr?qr.value:qr.textContent,w=_.length;for(t=0;t<s&&i[t]===_[t];t++);var D=s-t;for(l=1;l<=D&&i[s-l]===_[w-l];l++);return ac=_.slice(t,1<l?1-l:void 0)}function oc(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function lc(){return!0}function Bm(){return!1}function Wn(t){function i(s,l,_,w,D){this._reactName=s,this._targetInst=_,this.type=l,this.nativeEvent=w,this.target=D,this.currentTarget=null;for(var j in t)t.hasOwnProperty(j)&&(s=t[j],this[j]=s?s(w):w[j]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?lc:Bm,this.isPropagationStopped=Bm,this}return f(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=lc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=lc)},persist:function(){},isPersistent:lc}),i}var Ls={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cc=Wn(Ls),Ao=f({},Ls,{view:0,detail:0}),Rx=Wn(Ao),$h,zh,Ro,uc=f({},Ao,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hh,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ro&&(Ro&&t.type==="mousemove"?($h=t.screenX-Ro.screenX,zh=t.screenY-Ro.screenY):zh=$h=0,Ro=t),$h)},movementY:function(t){return"movementY"in t?t.movementY:zh}}),jm=Wn(uc),Lx=f({},uc,{dataTransfer:0}),Mx=Wn(Lx),Dx=f({},Ao,{relatedTarget:0}),Ph=Wn(Dx),Ox=f({},Ls,{animationName:0,elapsedTime:0,pseudoElement:0}),Nx=Wn(Ox),Ix=f({},Ls,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Bx=Wn(Ix),jx=f({},Ls,{data:0}),$m=Wn(jx),$x={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zx={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"},Px={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hx(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=Px[t])?!!i[t]:!1}function Hh(){return Hx}var Ux=f({},Ao,{key:function(t){if(t.key){var i=$x[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=oc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?zx[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hh,charCode:function(t){return t.type==="keypress"?oc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?oc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Fx=Wn(Ux),qx=f({},uc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zm=Wn(qx),Wx=f({},Ao,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hh}),Gx=Wn(Wx),Kx=f({},Ls,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vx=Wn(Kx),Yx=f({},uc,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Xx=Wn(Yx),Zx=f({},Ls,{newState:0,oldState:0}),Jx=Wn(Zx),Qx=[9,13,27,32],Uh=pr&&"CompositionEvent"in window,Lo=null;pr&&"documentMode"in document&&(Lo=document.documentMode);var e2=pr&&"TextEvent"in window&&!Lo,Pm=pr&&(!Uh||Lo&&8<Lo&&11>=Lo),Hm=" ",Um=!1;function Fm(t,i){switch(t){case"keyup":return Qx.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var _a=!1;function t2(t,i){switch(t){case"compositionend":return qm(i);case"keypress":return i.which!==32?null:(Um=!0,Hm);case"textInput":return t=i.data,t===Hm&&Um?null:t;default:return null}}function n2(t,i){if(_a)return t==="compositionend"||!Uh&&Fm(t,i)?(t=Im(),ac=jh=qr=null,_a=!1,t):null;switch(t){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 Pm&&i.locale!=="ko"?null:i.data;default:return null}}var i2={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 Wm(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!i2[t.type]:i==="textarea"}function Gm(t,i,s,l){tt?jt?jt.push(l):jt=[l]:tt=l,i=Qc(i,"onChange"),0<i.length&&(s=new cc("onChange","change",null,s,l),t.push({event:s,listeners:i}))}var Mo=null,Do=null;function r2(t){A0(t,0)}function hc(t){var i=xe(t);if(wo(i))return t}function Km(t,i){if(t==="change")return i}var Vm=!1;if(pr){var Fh;if(pr){var qh="oninput"in document;if(!qh){var Ym=document.createElement("div");Ym.setAttribute("oninput","return;"),qh=typeof Ym.oninput=="function"}Fh=qh}else Fh=!1;Vm=Fh&&(!document.documentMode||9<document.documentMode)}function Xm(){Mo&&(Mo.detachEvent("onpropertychange",Zm),Do=Mo=null)}function Zm(t){if(t.propertyName==="value"&&hc(Do)){var i=[];Gm(i,Do,t,qe(t)),sc(r2,i)}}function s2(t,i,s){t==="focusin"?(Xm(),Mo=i,Do=s,Mo.attachEvent("onpropertychange",Zm)):t==="focusout"&&Xm()}function a2(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return hc(Do)}function o2(t,i){if(t==="click")return hc(i)}function l2(t,i){if(t==="input"||t==="change")return hc(i)}function c2(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var ai=typeof Object.is=="function"?Object.is:c2;function Oo(t,i){if(ai(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var s=Object.keys(t),l=Object.keys(i);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var _=s[l];if(!bn.call(i,_)||!ai(t[_],i[_]))return!1}return!0}function Jm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Qm(t,i){var s=Jm(t);t=0;for(var l;s;){if(s.nodeType===3){if(l=t+s.textContent.length,t<=i&&l>=i)return{node:s,offset:i-t};t=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Jm(s)}}function e_(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?e_(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function t_(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=pa(t.document);i instanceof t.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)t=i.contentWindow;else break;i=pa(t.document)}return i}function Wh(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var u2=pr&&"documentMode"in document&&11>=document.documentMode,va=null,Gh=null,No=null,Kh=!1;function n_(t,i,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Kh||va==null||va!==pa(l)||(l=va,"selectionStart"in l&&Wh(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),No&&Oo(No,l)||(No=l,l=Qc(Gh,"onSelect"),0<l.length&&(i=new cc("onSelect","select",null,i,s),t.push({event:i,listeners:l}),i.target=va)))}function Ms(t,i){var s={};return s[t.toLowerCase()]=i.toLowerCase(),s["Webkit"+t]="webkit"+i,s["Moz"+t]="moz"+i,s}var ba={animationend:Ms("Animation","AnimationEnd"),animationiteration:Ms("Animation","AnimationIteration"),animationstart:Ms("Animation","AnimationStart"),transitionrun:Ms("Transition","TransitionRun"),transitionstart:Ms("Transition","TransitionStart"),transitioncancel:Ms("Transition","TransitionCancel"),transitionend:Ms("Transition","TransitionEnd")},Vh={},i_={};pr&&(i_=document.createElement("div").style,"AnimationEvent"in window||(delete ba.animationend.animation,delete ba.animationiteration.animation,delete ba.animationstart.animation),"TransitionEvent"in window||delete ba.transitionend.transition);function Ds(t){if(Vh[t])return Vh[t];if(!ba[t])return t;var i=ba[t],s;for(s in i)if(i.hasOwnProperty(s)&&s in i_)return Vh[t]=i[s];return t}var r_=Ds("animationend"),s_=Ds("animationiteration"),a_=Ds("animationstart"),h2=Ds("transitionrun"),d2=Ds("transitionstart"),f2=Ds("transitioncancel"),o_=Ds("transitionend"),l_=new Map,Yh="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(" ");Yh.push("scrollEnd");function ji(t,i){l_.set(t,i),Ut(i,[t])}var dc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},_i=[],ya=0,Xh=0;function fc(){for(var t=ya,i=Xh=ya=0;i<t;){var s=_i[i];_i[i++]=null;var l=_i[i];_i[i++]=null;var _=_i[i];_i[i++]=null;var w=_i[i];if(_i[i++]=null,l!==null&&_!==null){var D=l.pending;D===null?_.next=_:(_.next=D.next,D.next=_),l.pending=_}w!==0&&c_(s,_,w)}}function pc(t,i,s,l){_i[ya++]=t,_i[ya++]=i,_i[ya++]=s,_i[ya++]=l,Xh|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function Zh(t,i,s,l){return pc(t,i,s,l),gc(t)}function Os(t,i){return pc(t,null,null,i),gc(t)}function c_(t,i,s){t.lanes|=s;var l=t.alternate;l!==null&&(l.lanes|=s);for(var _=!1,w=t.return;w!==null;)w.childLanes|=s,l=w.alternate,l!==null&&(l.childLanes|=s),w.tag===22&&(t=w.stateNode,t===null||t._visibility&1||(_=!0)),t=w,w=w.return;return t.tag===3?(w=t.stateNode,_&&i!==null&&(_=31-Pt(s),t=w.hiddenUpdates,l=t[_],l===null?t[_]=[i]:l.push(i),i.lane=s|536870912),w):null}function gc(t){if(50<nl)throw nl=0,of=null,Error(a(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var Sa={};function p2(t,i,s,l){this.tag=t,this.key=s,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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function oi(t,i,s,l){return new p2(t,i,s,l)}function Jh(t){return t=t.prototype,!(!t||!t.isReactComponent)}function gr(t,i){var s=t.alternate;return s===null?(s=oi(t.tag,i,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=i,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,i=t.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function u_(t,i){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,i=s.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function mc(t,i,s,l,_,w){var D=0;if(l=t,typeof t=="function")Jh(t)&&(D=1);else if(typeof t=="string")D=bE(t,s,ae.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case O:return t=oi(31,s,i,_),t.elementType=O,t.lanes=w,t;case E:return Ns(s.children,_,w,i);case g:D=8,_|=24;break;case b:return t=oi(12,s,i,_|2),t.elementType=b,t.lanes=w,t;case A:return t=oi(13,s,i,_),t.elementType=A,t.lanes=w,t;case L:return t=oi(19,s,i,_),t.elementType=L,t.lanes=w,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case y:D=10;break e;case p:D=9;break e;case T:D=11;break e;case M:D=14;break e;case R:D=16,l=null;break e}D=29,s=Error(a(130,t===null?"null":typeof t,"")),l=null}return i=oi(D,s,i,_),i.elementType=t,i.type=l,i.lanes=w,i}function Ns(t,i,s,l){return t=oi(7,t,l,i),t.lanes=s,t}function Qh(t,i,s){return t=oi(6,t,null,i),t.lanes=s,t}function h_(t){var i=oi(18,null,null,0);return i.stateNode=t,i}function ed(t,i,s){return i=oi(4,t.children!==null?t.children:[],t.key,i),i.lanes=s,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var d_=new WeakMap;function vi(t,i){if(typeof t=="object"&&t!==null){var s=d_.get(t);return s!==void 0?s:(i={value:t,source:i,stack:en(i)},d_.set(t,i),i)}return{value:t,source:i,stack:en(i)}}var wa=[],Ca=0,_c=null,Io=0,bi=[],yi=0,Wr=null,Yi=1,Xi="";function mr(t,i){wa[Ca++]=Io,wa[Ca++]=_c,_c=t,Io=i}function f_(t,i,s){bi[yi++]=Yi,bi[yi++]=Xi,bi[yi++]=Wr,Wr=t;var l=Yi;t=Xi;var _=32-Pt(l)-1;l&=~(1<<_),s+=1;var w=32-Pt(i)+_;if(30<w){var D=_-_%5;w=(l&(1<<D)-1).toString(32),l>>=D,_-=D,Yi=1<<32-Pt(i)+_|s<<_|l,Xi=w+t}else Yi=1<<w|s<<_|l,Xi=t}function td(t){t.return!==null&&(mr(t,1),f_(t,1,0))}function nd(t){for(;t===_c;)_c=wa[--Ca],wa[Ca]=null,Io=wa[--Ca],wa[Ca]=null;for(;t===Wr;)Wr=bi[--yi],bi[yi]=null,Xi=bi[--yi],bi[yi]=null,Yi=bi[--yi],bi[yi]=null}function p_(t,i){bi[yi++]=Yi,bi[yi++]=Xi,bi[yi++]=Wr,Yi=i.id,Xi=i.overflow,Wr=t}var Cn=null,Rt=null,st=!1,Gr=null,Si=!1,id=Error(a(519));function Kr(t){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Bo(vi(i,t)),id}function g_(t){var i=t.stateNode,s=t.type,l=t.memoizedProps;switch(i[kt]=t,i[Et]=l,s){case"dialog":Qe("cancel",i),Qe("close",i);break;case"iframe":case"object":case"embed":Qe("load",i);break;case"video":case"audio":for(s=0;s<rl.length;s++)Qe(rl[s],i);break;case"source":Qe("error",i);break;case"img":case"image":case"link":Qe("error",i),Qe("load",i);break;case"details":Qe("toggle",i);break;case"input":Qe("invalid",i),Rs(i,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Qe("invalid",i);break;case"textarea":Qe("invalid",i),ma(i,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||l.suppressHydrationWarning===!0||D0(i.textContent,s)?(l.popover!=null&&(Qe("beforetoggle",i),Qe("toggle",i)),l.onScroll!=null&&Qe("scroll",i),l.onScrollEnd!=null&&Qe("scrollend",i),l.onClick!=null&&(i.onclick=we),i=!0):i=!1,i||Kr(t,!0)}function m_(t){for(Cn=t.return;Cn;)switch(Cn.tag){case 5:case 31:case 13:Si=!1;return;case 27:case 3:Si=!0;return;default:Cn=Cn.return}}function xa(t){if(t!==Cn)return!1;if(!st)return m_(t),st=!0,!1;var i=t.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||wf(t.type,t.memoizedProps)),s=!s),s&&Rt&&Kr(t),m_(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Rt=H0(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Rt=H0(t)}else i===27?(i=Rt,os(t.type)?(t=kf,kf=null,Rt=t):Rt=i):Rt=Cn?Ci(t.stateNode.nextSibling):null;return!0}function Is(){Rt=Cn=null,st=!1}function rd(){var t=Gr;return t!==null&&(Yn===null?Yn=t:Yn.push.apply(Yn,t),Gr=null),t}function Bo(t){Gr===null?Gr=[t]:Gr.push(t)}var sd=N(null),Bs=null,_r=null;function Vr(t,i,s){Z(sd,i._currentValue),i._currentValue=s}function vr(t){t._currentValue=sd.current,H(sd)}function ad(t,i,s){for(;t!==null;){var l=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,l!==null&&(l.childLanes|=i)):l!==null&&(l.childLanes&i)!==i&&(l.childLanes|=i),t===s)break;t=t.return}}function od(t,i,s,l){var _=t.child;for(_!==null&&(_.return=t);_!==null;){var w=_.dependencies;if(w!==null){var D=_.child;w=w.firstContext;e:for(;w!==null;){var j=w;w=_;for(var X=0;X<i.length;X++)if(j.context===i[X]){w.lanes|=s,j=w.alternate,j!==null&&(j.lanes|=s),ad(w.return,s,t),l||(D=null);break e}w=j.next}}else if(_.tag===18){if(D=_.return,D===null)throw Error(a(341));D.lanes|=s,w=D.alternate,w!==null&&(w.lanes|=s),ad(D,s,t),D=null}else D=_.child;if(D!==null)D.return=_;else for(D=_;D!==null;){if(D===t){D=null;break}if(_=D.sibling,_!==null){_.return=D.return,D=_;break}D=D.return}_=D}}function Ea(t,i,s,l){t=null;for(var _=i,w=!1;_!==null;){if(!w){if((_.flags&524288)!==0)w=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var D=_.alternate;if(D===null)throw Error(a(387));if(D=D.memoizedProps,D!==null){var j=_.type;ai(_.pendingProps.value,D.value)||(t!==null?t.push(j):t=[j])}}else if(_===Q.current){if(D=_.alternate,D===null)throw Error(a(387));D.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(t!==null?t.push(cl):t=[cl])}_=_.return}t!==null&&od(i,t,s,l),i.flags|=262144}function vc(t){for(t=t.firstContext;t!==null;){if(!ai(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function js(t){Bs=t,_r=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function xn(t){return __(Bs,t)}function bc(t,i){return Bs===null&&js(t),__(t,i)}function __(t,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},_r===null){if(t===null)throw Error(a(308));_r=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else _r=_r.next=i;return s}var g2=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(s,l){t.push(l)}};this.abort=function(){i.aborted=!0,t.forEach(function(s){return s()})}},m2=e.unstable_scheduleCallback,_2=e.unstable_NormalPriority,an={$$typeof:y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ld(){return{controller:new g2,data:new Map,refCount:0}}function jo(t){t.refCount--,t.refCount===0&&m2(_2,function(){t.controller.abort()})}var $o=null,cd=0,Ta=0,ka=null;function v2(t,i){if($o===null){var s=$o=[];cd=0,Ta=ff(),ka={status:"pending",value:void 0,then:function(l){s.push(l)}}}return cd++,i.then(v_,v_),i}function v_(){if(--cd===0&&$o!==null){ka!==null&&(ka.status="fulfilled");var t=$o;$o=null,Ta=0,ka=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function b2(t,i){var s=[],l={status:"pending",value:null,reason:null,then:function(_){s.push(_)}};return t.then(function(){l.status="fulfilled",l.value=i;for(var _=0;_<s.length;_++)(0,s[_])(i)},function(_){for(l.status="rejected",l.reason=_,_=0;_<s.length;_++)(0,s[_])(void 0)}),l}var b_=q.S;q.S=function(t,i){n0=ut(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&v2(t,i),b_!==null&&b_(t,i)};var $s=N(null);function ud(){var t=$s.current;return t!==null?t:Ct.pooledCache}function yc(t,i){i===null?Z($s,$s.current):Z($s,i.pool)}function y_(){var t=ud();return t===null?null:{parent:an._currentValue,pool:t}}var Aa=Error(a(460)),hd=Error(a(474)),Sc=Error(a(542)),wc={then:function(){}};function S_(t){return t=t.status,t==="fulfilled"||t==="rejected"}function w_(t,i,s){switch(s=t[s],s===void 0?t.push(i):s!==i&&(i.then(we,we),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,x_(t),t;default:if(typeof i.status=="string")i.then(we,we);else{if(t=Ct,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=i,t.status="pending",t.then(function(l){if(i.status==="pending"){var _=i;_.status="fulfilled",_.value=l}},function(l){if(i.status==="pending"){var _=i;_.status="rejected",_.reason=l}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,x_(t),t}throw Ps=i,Aa}}function zs(t){try{var i=t._init;return i(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Ps=s,Aa):s}}var Ps=null;function C_(){if(Ps===null)throw Error(a(459));var t=Ps;return Ps=null,t}function x_(t){if(t===Aa||t===Sc)throw Error(a(483))}var Ra=null,zo=0;function Cc(t){var i=zo;return zo+=1,Ra===null&&(Ra=[]),w_(Ra,t,i)}function Po(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function xc(t,i){throw i.$$typeof===C?Error(a(525)):(t=Object.prototype.toString.call(i),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function E_(t){function i(ne,ee){if(t){var ie=ne.deletions;ie===null?(ne.deletions=[ee],ne.flags|=16):ie.push(ee)}}function s(ne,ee){if(!t)return null;for(;ee!==null;)i(ne,ee),ee=ee.sibling;return null}function l(ne){for(var ee=new Map;ne!==null;)ne.key!==null?ee.set(ne.key,ne):ee.set(ne.index,ne),ne=ne.sibling;return ee}function _(ne,ee){return ne=gr(ne,ee),ne.index=0,ne.sibling=null,ne}function w(ne,ee,ie){return ne.index=ie,t?(ie=ne.alternate,ie!==null?(ie=ie.index,ie<ee?(ne.flags|=67108866,ee):ie):(ne.flags|=67108866,ee)):(ne.flags|=1048576,ee)}function D(ne){return t&&ne.alternate===null&&(ne.flags|=67108866),ne}function j(ne,ee,ie,de){return ee===null||ee.tag!==6?(ee=Qh(ie,ne.mode,de),ee.return=ne,ee):(ee=_(ee,ie),ee.return=ne,ee)}function X(ne,ee,ie,de){var Ie=ie.type;return Ie===E?ue(ne,ee,ie.props.children,de,ie.key):ee!==null&&(ee.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===R&&zs(Ie)===ee.type)?(ee=_(ee,ie.props),Po(ee,ie),ee.return=ne,ee):(ee=mc(ie.type,ie.key,ie.props,null,ne.mode,de),Po(ee,ie),ee.return=ne,ee)}function re(ne,ee,ie,de){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==ie.containerInfo||ee.stateNode.implementation!==ie.implementation?(ee=ed(ie,ne.mode,de),ee.return=ne,ee):(ee=_(ee,ie.children||[]),ee.return=ne,ee)}function ue(ne,ee,ie,de,Ie){return ee===null||ee.tag!==7?(ee=Ns(ie,ne.mode,de,Ie),ee.return=ne,ee):(ee=_(ee,ie),ee.return=ne,ee)}function fe(ne,ee,ie){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=Qh(""+ee,ne.mode,ie),ee.return=ne,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case x:return ie=mc(ee.type,ee.key,ee.props,null,ne.mode,ie),Po(ie,ee),ie.return=ne,ie;case k:return ee=ed(ee,ne.mode,ie),ee.return=ne,ee;case R:return ee=zs(ee),fe(ne,ee,ie)}if(te(ee)||G(ee))return ee=Ns(ee,ne.mode,ie,null),ee.return=ne,ee;if(typeof ee.then=="function")return fe(ne,Cc(ee),ie);if(ee.$$typeof===y)return fe(ne,bc(ne,ee),ie);xc(ne,ee)}return null}function se(ne,ee,ie,de){var Ie=ee!==null?ee.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Ie!==null?null:j(ne,ee,""+ie,de);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:return ie.key===Ie?X(ne,ee,ie,de):null;case k:return ie.key===Ie?re(ne,ee,ie,de):null;case R:return ie=zs(ie),se(ne,ee,ie,de)}if(te(ie)||G(ie))return Ie!==null?null:ue(ne,ee,ie,de,null);if(typeof ie.then=="function")return se(ne,ee,Cc(ie),de);if(ie.$$typeof===y)return se(ne,ee,bc(ne,ie),de);xc(ne,ie)}return null}function le(ne,ee,ie,de,Ie){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return ne=ne.get(ie)||null,j(ee,ne,""+de,Ie);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case x:return ne=ne.get(de.key===null?ie:de.key)||null,X(ee,ne,de,Ie);case k:return ne=ne.get(de.key===null?ie:de.key)||null,re(ee,ne,de,Ie);case R:return de=zs(de),le(ne,ee,ie,de,Ie)}if(te(de)||G(de))return ne=ne.get(ie)||null,ue(ee,ne,de,Ie,null);if(typeof de.then=="function")return le(ne,ee,ie,Cc(de),Ie);if(de.$$typeof===y)return le(ne,ee,ie,bc(ee,de),Ie);xc(ee,de)}return null}function ke(ne,ee,ie,de){for(var Ie=null,ot=null,Le=ee,Ke=ee=0,it=null;Le!==null&&Ke<ie.length;Ke++){Le.index>Ke?(it=Le,Le=null):it=Le.sibling;var lt=se(ne,Le,ie[Ke],de);if(lt===null){Le===null&&(Le=it);break}t&&Le&&lt.alternate===null&&i(ne,Le),ee=w(lt,ee,Ke),ot===null?Ie=lt:ot.sibling=lt,ot=lt,Le=it}if(Ke===ie.length)return s(ne,Le),st&&mr(ne,Ke),Ie;if(Le===null){for(;Ke<ie.length;Ke++)Le=fe(ne,ie[Ke],de),Le!==null&&(ee=w(Le,ee,Ke),ot===null?Ie=Le:ot.sibling=Le,ot=Le);return st&&mr(ne,Ke),Ie}for(Le=l(Le);Ke<ie.length;Ke++)it=le(Le,ne,Ke,ie[Ke],de),it!==null&&(t&&it.alternate!==null&&Le.delete(it.key===null?Ke:it.key),ee=w(it,ee,Ke),ot===null?Ie=it:ot.sibling=it,ot=it);return t&&Le.forEach(function(ds){return i(ne,ds)}),st&&mr(ne,Ke),Ie}function $e(ne,ee,ie,de){if(ie==null)throw Error(a(151));for(var Ie=null,ot=null,Le=ee,Ke=ee=0,it=null,lt=ie.next();Le!==null&&!lt.done;Ke++,lt=ie.next()){Le.index>Ke?(it=Le,Le=null):it=Le.sibling;var ds=se(ne,Le,lt.value,de);if(ds===null){Le===null&&(Le=it);break}t&&Le&&ds.alternate===null&&i(ne,Le),ee=w(ds,ee,Ke),ot===null?Ie=ds:ot.sibling=ds,ot=ds,Le=it}if(lt.done)return s(ne,Le),st&&mr(ne,Ke),Ie;if(Le===null){for(;!lt.done;Ke++,lt=ie.next())lt=fe(ne,lt.value,de),lt!==null&&(ee=w(lt,ee,Ke),ot===null?Ie=lt:ot.sibling=lt,ot=lt);return st&&mr(ne,Ke),Ie}for(Le=l(Le);!lt.done;Ke++,lt=ie.next())lt=le(Le,ne,Ke,lt.value,de),lt!==null&&(t&&lt.alternate!==null&&Le.delete(lt.key===null?Ke:lt.key),ee=w(lt,ee,Ke),ot===null?Ie=lt:ot.sibling=lt,ot=lt);return t&&Le.forEach(function(LE){return i(ne,LE)}),st&&mr(ne,Ke),Ie}function yt(ne,ee,ie,de){if(typeof ie=="object"&&ie!==null&&ie.type===E&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:e:{for(var Ie=ie.key;ee!==null;){if(ee.key===Ie){if(Ie=ie.type,Ie===E){if(ee.tag===7){s(ne,ee.sibling),de=_(ee,ie.props.children),de.return=ne,ne=de;break e}}else if(ee.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===R&&zs(Ie)===ee.type){s(ne,ee.sibling),de=_(ee,ie.props),Po(de,ie),de.return=ne,ne=de;break e}s(ne,ee);break}else i(ne,ee);ee=ee.sibling}ie.type===E?(de=Ns(ie.props.children,ne.mode,de,ie.key),de.return=ne,ne=de):(de=mc(ie.type,ie.key,ie.props,null,ne.mode,de),Po(de,ie),de.return=ne,ne=de)}return D(ne);case k:e:{for(Ie=ie.key;ee!==null;){if(ee.key===Ie)if(ee.tag===4&&ee.stateNode.containerInfo===ie.containerInfo&&ee.stateNode.implementation===ie.implementation){s(ne,ee.sibling),de=_(ee,ie.children||[]),de.return=ne,ne=de;break e}else{s(ne,ee);break}else i(ne,ee);ee=ee.sibling}de=ed(ie,ne.mode,de),de.return=ne,ne=de}return D(ne);case R:return ie=zs(ie),yt(ne,ee,ie,de)}if(te(ie))return ke(ne,ee,ie,de);if(G(ie)){if(Ie=G(ie),typeof Ie!="function")throw Error(a(150));return ie=Ie.call(ie),$e(ne,ee,ie,de)}if(typeof ie.then=="function")return yt(ne,ee,Cc(ie),de);if(ie.$$typeof===y)return yt(ne,ee,bc(ne,ie),de);xc(ne,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,ee!==null&&ee.tag===6?(s(ne,ee.sibling),de=_(ee,ie),de.return=ne,ne=de):(s(ne,ee),de=Qh(ie,ne.mode,de),de.return=ne,ne=de),D(ne)):s(ne,ee)}return function(ne,ee,ie,de){try{zo=0;var Ie=yt(ne,ee,ie,de);return Ra=null,Ie}catch(Le){if(Le===Aa||Le===Sc)throw Le;var ot=oi(29,Le,null,ne.mode);return ot.lanes=de,ot.return=ne,ot}}}var Hs=E_(!0),T_=E_(!1),Yr=!1;function dd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fd(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Xr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Zr(t,i,s){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(ht&2)!==0){var _=l.pending;return _===null?i.next=i:(i.next=_.next,_.next=i),l.pending=i,i=gc(t),c_(t,null,s),i}return pc(t,l,i,s),gc(t)}function Ho(t,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var l=i.lanes;l&=t.pendingLanes,s|=l,i.lanes=s,je(t,s)}}function pd(t,i){var s=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var _=null,w=null;if(s=s.firstBaseUpdate,s!==null){do{var D={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};w===null?_=w=D:w=w.next=D,s=s.next}while(s!==null);w===null?_=w=i:w=w.next=i}else _=w=i;s={baseState:l.baseState,firstBaseUpdate:_,lastBaseUpdate:w,shared:l.shared,callbacks:l.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=i:t.next=i,s.lastBaseUpdate=i}var gd=!1;function Uo(){if(gd){var t=ka;if(t!==null)throw t}}function Fo(t,i,s,l){gd=!1;var _=t.updateQueue;Yr=!1;var w=_.firstBaseUpdate,D=_.lastBaseUpdate,j=_.shared.pending;if(j!==null){_.shared.pending=null;var X=j,re=X.next;X.next=null,D===null?w=re:D.next=re,D=X;var ue=t.alternate;ue!==null&&(ue=ue.updateQueue,j=ue.lastBaseUpdate,j!==D&&(j===null?ue.firstBaseUpdate=re:j.next=re,ue.lastBaseUpdate=X))}if(w!==null){var fe=_.baseState;D=0,ue=re=X=null,j=w;do{var se=j.lane&-536870913,le=se!==j.lane;if(le?(nt&se)===se:(l&se)===se){se!==0&&se===Ta&&(gd=!0),ue!==null&&(ue=ue.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var ke=t,$e=j;se=i;var yt=s;switch($e.tag){case 1:if(ke=$e.payload,typeof ke=="function"){fe=ke.call(yt,fe,se);break e}fe=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=$e.payload,se=typeof ke=="function"?ke.call(yt,fe,se):ke,se==null)break e;fe=f({},fe,se);break e;case 2:Yr=!0}}se=j.callback,se!==null&&(t.flags|=64,le&&(t.flags|=8192),le=_.callbacks,le===null?_.callbacks=[se]:le.push(se))}else le={lane:se,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ue===null?(re=ue=le,X=fe):ue=ue.next=le,D|=se;if(j=j.next,j===null){if(j=_.shared.pending,j===null)break;le=j,j=le.next,le.next=null,_.lastBaseUpdate=le,_.shared.pending=null}}while(!0);ue===null&&(X=fe),_.baseState=X,_.firstBaseUpdate=re,_.lastBaseUpdate=ue,w===null&&(_.shared.lanes=0),ns|=D,t.lanes=D,t.memoizedState=fe}}function k_(t,i){if(typeof t!="function")throw Error(a(191,t));t.call(i)}function A_(t,i){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)k_(s[t],i)}var La=N(null),Ec=N(0);function R_(t,i){t=kr,Z(Ec,t),Z(La,i),kr=t|i.baseLanes}function md(){Z(Ec,kr),Z(La,La.current)}function _d(){kr=Ec.current,H(La),H(Ec)}var li=N(null),wi=null;function Jr(t){var i=t.alternate;Z(Zt,Zt.current&1),Z(li,t),wi===null&&(i===null||La.current!==null||i.memoizedState!==null)&&(wi=t)}function vd(t){Z(Zt,Zt.current),Z(li,t),wi===null&&(wi=t)}function L_(t){t.tag===22?(Z(Zt,Zt.current),Z(li,t),wi===null&&(wi=t)):Qr()}function Qr(){Z(Zt,Zt.current),Z(li,li.current)}function ci(t){H(li),wi===t&&(wi=null),H(Zt)}var Zt=N(0);function Tc(t){for(var i=t;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Ef(s)||Tf(s)))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===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var br=0,We=null,vt=null,on=null,kc=!1,Ma=!1,Us=!1,Ac=0,qo=0,Da=null,y2=0;function Ft(){throw Error(a(321))}function bd(t,i){if(i===null)return!1;for(var s=0;s<i.length&&s<t.length;s++)if(!ai(t[s],i[s]))return!1;return!0}function yd(t,i,s,l,_,w){return br=w,We=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,q.H=t===null||t.memoizedState===null?fv:Id,Us=!1,w=s(l,_),Us=!1,Ma&&(w=D_(i,s,l,_)),M_(t),w}function M_(t){q.H=Ko;var i=vt!==null&&vt.next!==null;if(br=0,on=vt=We=null,kc=!1,qo=0,Da=null,i)throw Error(a(300));t===null||ln||(t=t.dependencies,t!==null&&vc(t)&&(ln=!0))}function D_(t,i,s,l){We=t;var _=0;do{if(Ma&&(Da=null),qo=0,Ma=!1,25<=_)throw Error(a(301));if(_+=1,on=vt=null,t.updateQueue!=null){var w=t.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}q.H=pv,w=i(s,l)}while(Ma);return w}function S2(){var t=q.H,i=t.useState()[0];return i=typeof i.then=="function"?Wo(i):i,t=t.useState()[0],(vt!==null?vt.memoizedState:null)!==t&&(We.flags|=1024),i}function Sd(){var t=Ac!==0;return Ac=0,t}function wd(t,i,s){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~s}function Cd(t){if(kc){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}kc=!1}br=0,on=vt=We=null,Ma=!1,qo=Ac=0,Da=null}function In(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?We.memoizedState=on=t:on=on.next=t,on}function Jt(){if(vt===null){var t=We.alternate;t=t!==null?t.memoizedState:null}else t=vt.next;var i=on===null?We.memoizedState:on.next;if(i!==null)on=i,vt=t;else{if(t===null)throw We.alternate===null?Error(a(467)):Error(a(310));vt=t,t={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},on===null?We.memoizedState=on=t:on=on.next=t}return on}function Rc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wo(t){var i=qo;return qo+=1,Da===null&&(Da=[]),t=w_(Da,t,i),i=We,(on===null?i.memoizedState:on.next)===null&&(i=i.alternate,q.H=i===null||i.memoizedState===null?fv:Id),t}function Lc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Wo(t);if(t.$$typeof===y)return xn(t)}throw Error(a(438,String(t)))}function xd(t){var i=null,s=We.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var l=We.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(i={data:l.data.map(function(_){return _.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=Rc(),We.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(t),l=0;l<t;l++)s[l]=F;return i.index++,s}function yr(t,i){return typeof i=="function"?i(t):i}function Mc(t){var i=Jt();return Ed(i,vt,t)}function Ed(t,i,s){var l=t.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=s;var _=t.baseQueue,w=l.pending;if(w!==null){if(_!==null){var D=_.next;_.next=w.next,w.next=D}i.baseQueue=_=w,l.pending=null}if(w=t.baseState,_===null)t.memoizedState=w;else{i=_.next;var j=D=null,X=null,re=i,ue=!1;do{var fe=re.lane&-536870913;if(fe!==re.lane?(nt&fe)===fe:(br&fe)===fe){var se=re.revertLane;if(se===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),fe===Ta&&(ue=!0);else if((br&se)===se){re=re.next,se===Ta&&(ue=!0);continue}else fe={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},X===null?(j=X=fe,D=w):X=X.next=fe,We.lanes|=se,ns|=se;fe=re.action,Us&&s(w,fe),w=re.hasEagerState?re.eagerState:s(w,fe)}else se={lane:fe,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},X===null?(j=X=se,D=w):X=X.next=se,We.lanes|=fe,ns|=fe;re=re.next}while(re!==null&&re!==i);if(X===null?D=w:X.next=j,!ai(w,t.memoizedState)&&(ln=!0,ue&&(s=ka,s!==null)))throw s;t.memoizedState=w,t.baseState=D,t.baseQueue=X,l.lastRenderedState=w}return _===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function Td(t){var i=Jt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=t;var l=s.dispatch,_=s.pending,w=i.memoizedState;if(_!==null){s.pending=null;var D=_=_.next;do w=t(w,D.action),D=D.next;while(D!==_);ai(w,i.memoizedState)||(ln=!0),i.memoizedState=w,i.baseQueue===null&&(i.baseState=w),s.lastRenderedState=w}return[w,l]}function O_(t,i,s){var l=We,_=Jt(),w=st;if(w){if(s===void 0)throw Error(a(407));s=s()}else s=i();var D=!ai((vt||_).memoizedState,s);if(D&&(_.memoizedState=s,ln=!0),_=_.queue,Rd(B_.bind(null,l,_,t),[t]),_.getSnapshot!==i||D||on!==null&&on.memoizedState.tag&1){if(l.flags|=2048,Oa(9,{destroy:void 0},I_.bind(null,l,_,s,i),null),Ct===null)throw Error(a(349));w||(br&127)!==0||N_(l,i,s)}return s}function N_(t,i,s){t.flags|=16384,t={getSnapshot:i,value:s},i=We.updateQueue,i===null?(i=Rc(),We.updateQueue=i,i.stores=[t]):(s=i.stores,s===null?i.stores=[t]:s.push(t))}function I_(t,i,s,l){i.value=s,i.getSnapshot=l,j_(i)&&$_(t)}function B_(t,i,s){return s(function(){j_(i)&&$_(t)})}function j_(t){var i=t.getSnapshot;t=t.value;try{var s=i();return!ai(t,s)}catch{return!0}}function $_(t){var i=Os(t,2);i!==null&&Xn(i,t,2)}function kd(t){var i=In();if(typeof t=="function"){var s=t;if(t=s(),Us){Xt(!0);try{s()}finally{Xt(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yr,lastRenderedState:t},i}function z_(t,i,s,l){return t.baseState=s,Ed(t,vt,typeof l=="function"?l:yr)}function w2(t,i,s,l,_){if(Nc(t))throw Error(a(485));if(t=i.action,t!==null){var w={payload:_,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){w.listeners.push(D)}};q.T!==null?s(!0):w.isTransition=!1,l(w),s=i.pending,s===null?(w.next=i.pending=w,P_(i,w)):(w.next=s.next,i.pending=s.next=w)}}function P_(t,i){var s=i.action,l=i.payload,_=t.state;if(i.isTransition){var w=q.T,D={};q.T=D;try{var j=s(_,l),X=q.S;X!==null&&X(D,j),H_(t,i,j)}catch(re){Ad(t,i,re)}finally{w!==null&&D.types!==null&&(w.types=D.types),q.T=w}}else try{w=s(_,l),H_(t,i,w)}catch(re){Ad(t,i,re)}}function H_(t,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){U_(t,i,l)},function(l){return Ad(t,i,l)}):U_(t,i,s)}function U_(t,i,s){i.status="fulfilled",i.value=s,F_(i),t.state=s,i=t.pending,i!==null&&(s=i.next,s===i?t.pending=null:(s=s.next,i.next=s,P_(t,s)))}function Ad(t,i,s){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do i.status="rejected",i.reason=s,F_(i),i=i.next;while(i!==l)}t.action=null}function F_(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function q_(t,i){return i}function W_(t,i){if(st){var s=Ct.formState;if(s!==null){e:{var l=We;if(st){if(Rt){t:{for(var _=Rt,w=Si;_.nodeType!==8;){if(!w){_=null;break t}if(_=Ci(_.nextSibling),_===null){_=null;break t}}w=_.data,_=w==="F!"||w==="F"?_:null}if(_){Rt=Ci(_.nextSibling),l=_.data==="F!";break e}}Kr(l)}l=!1}l&&(i=s[0])}}return s=In(),s.memoizedState=s.baseState=i,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:q_,lastRenderedState:i},s.queue=l,s=uv.bind(null,We,l),l.dispatch=s,l=kd(!1),w=Nd.bind(null,We,!1,l.queue),l=In(),_={state:i,dispatch:null,action:t,pending:null},l.queue=_,s=w2.bind(null,We,_,w,s),_.dispatch=s,l.memoizedState=t,[i,s,!1]}function G_(t){var i=Jt();return K_(i,vt,t)}function K_(t,i,s){if(i=Ed(t,i,q_)[0],t=Mc(yr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var l=Wo(i)}catch(D){throw D===Aa?Sc:D}else l=i;i=Jt();var _=i.queue,w=_.dispatch;return s!==i.memoizedState&&(We.flags|=2048,Oa(9,{destroy:void 0},C2.bind(null,_,s),null)),[l,w,t]}function C2(t,i){t.action=i}function V_(t){var i=Jt(),s=vt;if(s!==null)return K_(i,s,t);Jt(),i=i.memoizedState,s=Jt();var l=s.queue.dispatch;return s.memoizedState=t,[i,l,!1]}function Oa(t,i,s,l){return t={tag:t,create:s,deps:l,inst:i,next:null},i=We.updateQueue,i===null&&(i=Rc(),We.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=t.next=t:(l=s.next,s.next=t,t.next=l,i.lastEffect=t),t}function Y_(){return Jt().memoizedState}function Dc(t,i,s,l){var _=In();We.flags|=t,_.memoizedState=Oa(1|i,{destroy:void 0},s,l===void 0?null:l)}function Oc(t,i,s,l){var _=Jt();l=l===void 0?null:l;var w=_.memoizedState.inst;vt!==null&&l!==null&&bd(l,vt.memoizedState.deps)?_.memoizedState=Oa(i,w,s,l):(We.flags|=t,_.memoizedState=Oa(1|i,w,s,l))}function X_(t,i){Dc(8390656,8,t,i)}function Rd(t,i){Oc(2048,8,t,i)}function x2(t){We.flags|=4;var i=We.updateQueue;if(i===null)i=Rc(),We.updateQueue=i,i.events=[t];else{var s=i.events;s===null?i.events=[t]:s.push(t)}}function Z_(t){var i=Jt().memoizedState;return x2({ref:i,nextImpl:t}),function(){if((ht&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function J_(t,i){return Oc(4,2,t,i)}function Q_(t,i){return Oc(4,4,t,i)}function ev(t,i){if(typeof i=="function"){t=t();var s=i(t);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function tv(t,i,s){s=s!=null?s.concat([t]):null,Oc(4,4,ev.bind(null,i,t),s)}function Ld(){}function nv(t,i){var s=Jt();i=i===void 0?null:i;var l=s.memoizedState;return i!==null&&bd(i,l[1])?l[0]:(s.memoizedState=[t,i],t)}function iv(t,i){var s=Jt();i=i===void 0?null:i;var l=s.memoizedState;if(i!==null&&bd(i,l[1]))return l[0];if(l=t(),Us){Xt(!0);try{t()}finally{Xt(!1)}}return s.memoizedState=[l,i],l}function Md(t,i,s){return s===void 0||(br&1073741824)!==0&&(nt&261930)===0?t.memoizedState=i:(t.memoizedState=s,t=r0(),We.lanes|=t,ns|=t,s)}function rv(t,i,s,l){return ai(s,i)?s:La.current!==null?(t=Md(t,s,l),ai(t,i)||(ln=!0),t):(br&42)===0||(br&1073741824)!==0&&(nt&261930)===0?(ln=!0,t.memoizedState=s):(t=r0(),We.lanes|=t,ns|=t,i)}function sv(t,i,s,l,_){var w=W.p;W.p=w!==0&&8>w?w:8;var D=q.T,j={};q.T=j,Nd(t,!1,i,s);try{var X=_(),re=q.S;if(re!==null&&re(j,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var ue=b2(X,l);Go(t,i,ue,di(t))}else Go(t,i,l,di(t))}catch(fe){Go(t,i,{then:function(){},status:"rejected",reason:fe},di())}finally{W.p=w,D!==null&&j.types!==null&&(D.types=j.types),q.T=D}}function E2(){}function Dd(t,i,s,l){if(t.tag!==5)throw Error(a(476));var _=av(t).queue;sv(t,_,i,Y,s===null?E2:function(){return ov(t),s(l)})}function av(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yr,lastRenderedState:Y},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yr,lastRenderedState:s},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function ov(t){var i=av(t);i.next===null&&(i=t.alternate.memoizedState),Go(t,i.next.queue,{},di())}function Od(){return xn(cl)}function lv(){return Jt().memoizedState}function cv(){return Jt().memoizedState}function T2(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var s=di();t=Xr(s);var l=Zr(i,t,s);l!==null&&(Xn(l,i,s),Ho(l,i,s)),i={cache:ld()},t.payload=i;return}i=i.return}}function k2(t,i,s){var l=di();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Nc(t)?hv(i,s):(s=Zh(t,i,s,l),s!==null&&(Xn(s,t,l),dv(s,i,l)))}function uv(t,i,s){var l=di();Go(t,i,s,l)}function Go(t,i,s,l){var _={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Nc(t))hv(i,_);else{var w=t.alternate;if(t.lanes===0&&(w===null||w.lanes===0)&&(w=i.lastRenderedReducer,w!==null))try{var D=i.lastRenderedState,j=w(D,s);if(_.hasEagerState=!0,_.eagerState=j,ai(j,D))return pc(t,i,_,0),Ct===null&&fc(),!1}catch{}if(s=Zh(t,i,_,l),s!==null)return Xn(s,t,l),dv(s,i,l),!0}return!1}function Nd(t,i,s,l){if(l={lane:2,revertLane:ff(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Nc(t)){if(i)throw Error(a(479))}else i=Zh(t,s,l,2),i!==null&&Xn(i,t,2)}function Nc(t){var i=t.alternate;return t===We||i!==null&&i===We}function hv(t,i){Ma=kc=!0;var s=t.pending;s===null?i.next=i:(i.next=s.next,s.next=i),t.pending=i}function dv(t,i,s){if((s&4194048)!==0){var l=i.lanes;l&=t.pendingLanes,s|=l,i.lanes=s,je(t,s)}}var Ko={readContext:xn,use:Lc,useCallback:Ft,useContext:Ft,useEffect:Ft,useImperativeHandle:Ft,useLayoutEffect:Ft,useInsertionEffect:Ft,useMemo:Ft,useReducer:Ft,useRef:Ft,useState:Ft,useDebugValue:Ft,useDeferredValue:Ft,useTransition:Ft,useSyncExternalStore:Ft,useId:Ft,useHostTransitionStatus:Ft,useFormState:Ft,useActionState:Ft,useOptimistic:Ft,useMemoCache:Ft,useCacheRefresh:Ft};Ko.useEffectEvent=Ft;var fv={readContext:xn,use:Lc,useCallback:function(t,i){return In().memoizedState=[t,i===void 0?null:i],t},useContext:xn,useEffect:X_,useImperativeHandle:function(t,i,s){s=s!=null?s.concat([t]):null,Dc(4194308,4,ev.bind(null,i,t),s)},useLayoutEffect:function(t,i){return Dc(4194308,4,t,i)},useInsertionEffect:function(t,i){Dc(4,2,t,i)},useMemo:function(t,i){var s=In();i=i===void 0?null:i;var l=t();if(Us){Xt(!0);try{t()}finally{Xt(!1)}}return s.memoizedState=[l,i],l},useReducer:function(t,i,s){var l=In();if(s!==void 0){var _=s(i);if(Us){Xt(!0);try{s(i)}finally{Xt(!1)}}}else _=i;return l.memoizedState=l.baseState=_,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:_},l.queue=t,t=t.dispatch=k2.bind(null,We,t),[l.memoizedState,t]},useRef:function(t){var i=In();return t={current:t},i.memoizedState=t},useState:function(t){t=kd(t);var i=t.queue,s=uv.bind(null,We,i);return i.dispatch=s,[t.memoizedState,s]},useDebugValue:Ld,useDeferredValue:function(t,i){var s=In();return Md(s,t,i)},useTransition:function(){var t=kd(!1);return t=sv.bind(null,We,t.queue,!0,!1),In().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,s){var l=We,_=In();if(st){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),Ct===null)throw Error(a(349));(nt&127)!==0||N_(l,i,s)}_.memoizedState=s;var w={value:s,getSnapshot:i};return _.queue=w,X_(B_.bind(null,l,w,t),[t]),l.flags|=2048,Oa(9,{destroy:void 0},I_.bind(null,l,w,s,i),null),s},useId:function(){var t=In(),i=Ct.identifierPrefix;if(st){var s=Xi,l=Yi;s=(l&~(1<<32-Pt(l)-1)).toString(32)+s,i="_"+i+"R_"+s,s=Ac++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=y2++,i="_"+i+"r_"+s.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:Od,useFormState:W_,useActionState:W_,useOptimistic:function(t){var i=In();i.memoizedState=i.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=Nd.bind(null,We,!0,s),s.dispatch=i,[t,i]},useMemoCache:xd,useCacheRefresh:function(){return In().memoizedState=T2.bind(null,We)},useEffectEvent:function(t){var i=In(),s={impl:t};return i.memoizedState=s,function(){if((ht&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Id={readContext:xn,use:Lc,useCallback:nv,useContext:xn,useEffect:Rd,useImperativeHandle:tv,useInsertionEffect:J_,useLayoutEffect:Q_,useMemo:iv,useReducer:Mc,useRef:Y_,useState:function(){return Mc(yr)},useDebugValue:Ld,useDeferredValue:function(t,i){var s=Jt();return rv(s,vt.memoizedState,t,i)},useTransition:function(){var t=Mc(yr)[0],i=Jt().memoizedState;return[typeof t=="boolean"?t:Wo(t),i]},useSyncExternalStore:O_,useId:lv,useHostTransitionStatus:Od,useFormState:G_,useActionState:G_,useOptimistic:function(t,i){var s=Jt();return z_(s,vt,t,i)},useMemoCache:xd,useCacheRefresh:cv};Id.useEffectEvent=Z_;var pv={readContext:xn,use:Lc,useCallback:nv,useContext:xn,useEffect:Rd,useImperativeHandle:tv,useInsertionEffect:J_,useLayoutEffect:Q_,useMemo:iv,useReducer:Td,useRef:Y_,useState:function(){return Td(yr)},useDebugValue:Ld,useDeferredValue:function(t,i){var s=Jt();return vt===null?Md(s,t,i):rv(s,vt.memoizedState,t,i)},useTransition:function(){var t=Td(yr)[0],i=Jt().memoizedState;return[typeof t=="boolean"?t:Wo(t),i]},useSyncExternalStore:O_,useId:lv,useHostTransitionStatus:Od,useFormState:V_,useActionState:V_,useOptimistic:function(t,i){var s=Jt();return vt!==null?z_(s,vt,t,i):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:xd,useCacheRefresh:cv};pv.useEffectEvent=Z_;function Bd(t,i,s,l){i=t.memoizedState,s=s(l,i),s=s==null?i:f({},i,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var jd={enqueueSetState:function(t,i,s){t=t._reactInternals;var l=di(),_=Xr(l);_.payload=i,s!=null&&(_.callback=s),i=Zr(t,_,l),i!==null&&(Xn(i,t,l),Ho(i,t,l))},enqueueReplaceState:function(t,i,s){t=t._reactInternals;var l=di(),_=Xr(l);_.tag=1,_.payload=i,s!=null&&(_.callback=s),i=Zr(t,_,l),i!==null&&(Xn(i,t,l),Ho(i,t,l))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var s=di(),l=Xr(s);l.tag=2,i!=null&&(l.callback=i),i=Zr(t,l,s),i!==null&&(Xn(i,t,s),Ho(i,t,s))}};function gv(t,i,s,l,_,w,D){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,w,D):i.prototype&&i.prototype.isPureReactComponent?!Oo(s,l)||!Oo(_,w):!0}function mv(t,i,s,l){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,l),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,l),i.state!==t&&jd.enqueueReplaceState(i,i.state,null)}function Fs(t,i){var s=i;if("ref"in i){s={};for(var l in i)l!=="ref"&&(s[l]=i[l])}if(t=t.defaultProps){s===i&&(s=f({},s));for(var _ in t)s[_]===void 0&&(s[_]=t[_])}return s}function _v(t){dc(t)}function vv(t){console.error(t)}function bv(t){dc(t)}function Ic(t,i){try{var s=t.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(l){setTimeout(function(){throw l})}}function yv(t,i,s){try{var l=t.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function $d(t,i,s){return s=Xr(s),s.tag=3,s.payload={element:null},s.callback=function(){Ic(t,i)},s}function Sv(t){return t=Xr(t),t.tag=3,t}function wv(t,i,s,l){var _=s.type.getDerivedStateFromError;if(typeof _=="function"){var w=l.value;t.payload=function(){return _(w)},t.callback=function(){yv(i,s,l)}}var D=s.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(t.callback=function(){yv(i,s,l),typeof _!="function"&&(is===null?is=new Set([this]):is.add(this));var j=l.stack;this.componentDidCatch(l.value,{componentStack:j!==null?j:""})})}function A2(t,i,s,l,_){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(i=s.alternate,i!==null&&Ea(i,s,_,!0),s=li.current,s!==null){switch(s.tag){case 31:case 13:return wi===null?Kc():s.alternate===null&&qt===0&&(qt=3),s.flags&=-257,s.flags|=65536,s.lanes=_,l===wc?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([l]):i.add(l),uf(t,l,_)),!1;case 22:return s.flags|=65536,l===wc?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([l]):s.add(l)),uf(t,l,_)),!1}throw Error(a(435,s.tag))}return uf(t,l,_),Kc(),!1}if(st)return i=li.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=_,l!==id&&(t=Error(a(422),{cause:l}),Bo(vi(t,s)))):(l!==id&&(i=Error(a(423),{cause:l}),Bo(vi(i,s))),t=t.current.alternate,t.flags|=65536,_&=-_,t.lanes|=_,l=vi(l,s),_=$d(t.stateNode,l,_),pd(t,_),qt!==4&&(qt=2)),!1;var w=Error(a(520),{cause:l});if(w=vi(w,s),tl===null?tl=[w]:tl.push(w),qt!==4&&(qt=2),i===null)return!0;l=vi(l,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,t=_&-_,s.lanes|=t,t=$d(s.stateNode,l,t),pd(s,t),!1;case 1:if(i=s.type,w=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(is===null||!is.has(w))))return s.flags|=65536,_&=-_,s.lanes|=_,_=Sv(_),wv(_,t,s,l),pd(s,_),!1}s=s.return}while(s!==null);return!1}var zd=Error(a(461)),ln=!1;function En(t,i,s,l){i.child=t===null?T_(i,null,s,l):Hs(i,t.child,s,l)}function Cv(t,i,s,l,_){s=s.render;var w=i.ref;if("ref"in l){var D={};for(var j in l)j!=="ref"&&(D[j]=l[j])}else D=l;return js(i),l=yd(t,i,s,D,w,_),j=Sd(),t!==null&&!ln?(wd(t,i,_),Sr(t,i,_)):(st&&j&&td(i),i.flags|=1,En(t,i,l,_),i.child)}function xv(t,i,s,l,_){if(t===null){var w=s.type;return typeof w=="function"&&!Jh(w)&&w.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=w,Ev(t,i,w,l,_)):(t=mc(s.type,null,l,i,i.mode,_),t.ref=i.ref,t.return=i,i.child=t)}if(w=t.child,!Kd(t,_)){var D=w.memoizedProps;if(s=s.compare,s=s!==null?s:Oo,s(D,l)&&t.ref===i.ref)return Sr(t,i,_)}return i.flags|=1,t=gr(w,l),t.ref=i.ref,t.return=i,i.child=t}function Ev(t,i,s,l,_){if(t!==null){var w=t.memoizedProps;if(Oo(w,l)&&t.ref===i.ref)if(ln=!1,i.pendingProps=l=w,Kd(t,_))(t.flags&131072)!==0&&(ln=!0);else return i.lanes=t.lanes,Sr(t,i,_)}return Pd(t,i,s,l,_)}function Tv(t,i,s,l){var _=l.children,w=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((i.flags&128)!==0){if(w=w!==null?w.baseLanes|s:s,t!==null){for(l=i.child=t.child,_=0;l!==null;)_=_|l.lanes|l.childLanes,l=l.sibling;l=_&~w}else l=0,i.child=null;return kv(t,i,w,s,l)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&yc(i,w!==null?w.cachePool:null),w!==null?R_(i,w):md(),L_(i);else return l=i.lanes=536870912,kv(t,i,w!==null?w.baseLanes|s:s,s,l)}else w!==null?(yc(i,w.cachePool),R_(i,w),Qr(),i.memoizedState=null):(t!==null&&yc(i,null),md(),Qr());return En(t,i,_,s),i.child}function Vo(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function kv(t,i,s,l,_){var w=ud();return w=w===null?null:{parent:an._currentValue,pool:w},i.memoizedState={baseLanes:s,cachePool:w},t!==null&&yc(i,null),md(),L_(i),t!==null&&Ea(t,i,l,!0),i.childLanes=_,null}function Bc(t,i){return i=$c({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function Av(t,i,s){return Hs(i,t.child,null,s),t=Bc(i,i.pendingProps),t.flags|=2,ci(i),i.memoizedState=null,t}function R2(t,i,s){var l=i.pendingProps,_=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(st){if(l.mode==="hidden")return t=Bc(i,l),i.lanes=536870912,Vo(null,t);if(vd(i),(t=Rt)?(t=P0(t,Si),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Wr!==null?{id:Yi,overflow:Xi}:null,retryLane:536870912,hydrationErrors:null},s=h_(t),s.return=i,i.child=s,Cn=i,Rt=null)):t=null,t===null)throw Kr(i);return i.lanes=536870912,null}return Bc(i,l)}var w=t.memoizedState;if(w!==null){var D=w.dehydrated;if(vd(i),_)if(i.flags&256)i.flags&=-257,i=Av(t,i,s);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(a(558));else if(ln||Ea(t,i,s,!1),_=(s&t.childLanes)!==0,ln||_){if(l=Ct,l!==null&&(D=Bt(l,s),D!==0&&D!==w.retryLane))throw w.retryLane=D,Os(t,D),Xn(l,t,D),zd;Kc(),i=Av(t,i,s)}else t=w.treeContext,Rt=Ci(D.nextSibling),Cn=i,st=!0,Gr=null,Si=!1,t!==null&&p_(i,t),i=Bc(i,l),i.flags|=4096;return i}return t=gr(t.child,{mode:l.mode,children:l.children}),t.ref=i.ref,i.child=t,t.return=i,t}function jc(t,i){var s=i.ref;if(s===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(t===null||t.ref!==s)&&(i.flags|=4194816)}}function Pd(t,i,s,l,_){return js(i),s=yd(t,i,s,l,void 0,_),l=Sd(),t!==null&&!ln?(wd(t,i,_),Sr(t,i,_)):(st&&l&&td(i),i.flags|=1,En(t,i,s,_),i.child)}function Rv(t,i,s,l,_,w){return js(i),i.updateQueue=null,s=D_(i,l,s,_),M_(t),l=Sd(),t!==null&&!ln?(wd(t,i,w),Sr(t,i,w)):(st&&l&&td(i),i.flags|=1,En(t,i,s,w),i.child)}function Lv(t,i,s,l,_){if(js(i),i.stateNode===null){var w=Sa,D=s.contextType;typeof D=="object"&&D!==null&&(w=xn(D)),w=new s(l,w),i.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=jd,i.stateNode=w,w._reactInternals=i,w=i.stateNode,w.props=l,w.state=i.memoizedState,w.refs={},dd(i),D=s.contextType,w.context=typeof D=="object"&&D!==null?xn(D):Sa,w.state=i.memoizedState,D=s.getDerivedStateFromProps,typeof D=="function"&&(Bd(i,s,D,l),w.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(D=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),D!==w.state&&jd.enqueueReplaceState(w,w.state,null),Fo(i,l,w,_),Uo(),w.state=i.memoizedState),typeof w.componentDidMount=="function"&&(i.flags|=4194308),l=!0}else if(t===null){w=i.stateNode;var j=i.memoizedProps,X=Fs(s,j);w.props=X;var re=w.context,ue=s.contextType;D=Sa,typeof ue=="object"&&ue!==null&&(D=xn(ue));var fe=s.getDerivedStateFromProps;ue=typeof fe=="function"||typeof w.getSnapshotBeforeUpdate=="function",j=i.pendingProps!==j,ue||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(j||re!==D)&&mv(i,w,l,D),Yr=!1;var se=i.memoizedState;w.state=se,Fo(i,l,w,_),Uo(),re=i.memoizedState,j||se!==re||Yr?(typeof fe=="function"&&(Bd(i,s,fe,l),re=i.memoizedState),(X=Yr||gv(i,s,X,l,se,re,D))?(ue||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(i.flags|=4194308)):(typeof w.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=l,i.memoizedState=re),w.props=l,w.state=re,w.context=D,l=X):(typeof w.componentDidMount=="function"&&(i.flags|=4194308),l=!1)}else{w=i.stateNode,fd(t,i),D=i.memoizedProps,ue=Fs(s,D),w.props=ue,fe=i.pendingProps,se=w.context,re=s.contextType,X=Sa,typeof re=="object"&&re!==null&&(X=xn(re)),j=s.getDerivedStateFromProps,(re=typeof j=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(D!==fe||se!==X)&&mv(i,w,l,X),Yr=!1,se=i.memoizedState,w.state=se,Fo(i,l,w,_),Uo();var le=i.memoizedState;D!==fe||se!==le||Yr||t!==null&&t.dependencies!==null&&vc(t.dependencies)?(typeof j=="function"&&(Bd(i,s,j,l),le=i.memoizedState),(ue=Yr||gv(i,s,ue,l,se,le,X)||t!==null&&t.dependencies!==null&&vc(t.dependencies))?(re||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(l,le,X),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(l,le,X)),typeof w.componentDidUpdate=="function"&&(i.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof w.componentDidUpdate!="function"||D===t.memoizedProps&&se===t.memoizedState||(i.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||D===t.memoizedProps&&se===t.memoizedState||(i.flags|=1024),i.memoizedProps=l,i.memoizedState=le),w.props=l,w.state=le,w.context=X,l=ue):(typeof w.componentDidUpdate!="function"||D===t.memoizedProps&&se===t.memoizedState||(i.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||D===t.memoizedProps&&se===t.memoizedState||(i.flags|=1024),l=!1)}return w=l,jc(t,i),l=(i.flags&128)!==0,w||l?(w=i.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:w.render(),i.flags|=1,t!==null&&l?(i.child=Hs(i,t.child,null,_),i.child=Hs(i,null,s,_)):En(t,i,s,_),i.memoizedState=w.state,t=i.child):t=Sr(t,i,_),t}function Mv(t,i,s,l){return Is(),i.flags|=256,En(t,i,s,l),i.child}var Hd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ud(t){return{baseLanes:t,cachePool:y_()}}function Fd(t,i,s){return t=t!==null?t.childLanes&~s:0,i&&(t|=hi),t}function Dv(t,i,s){var l=i.pendingProps,_=!1,w=(i.flags&128)!==0,D;if((D=w)||(D=t!==null&&t.memoizedState===null?!1:(Zt.current&2)!==0),D&&(_=!0,i.flags&=-129),D=(i.flags&32)!==0,i.flags&=-33,t===null){if(st){if(_?Jr(i):Qr(),(t=Rt)?(t=P0(t,Si),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Wr!==null?{id:Yi,overflow:Xi}:null,retryLane:536870912,hydrationErrors:null},s=h_(t),s.return=i,i.child=s,Cn=i,Rt=null)):t=null,t===null)throw Kr(i);return Tf(t)?i.lanes=32:i.lanes=536870912,null}var j=l.children;return l=l.fallback,_?(Qr(),_=i.mode,j=$c({mode:"hidden",children:j},_),l=Ns(l,_,s,null),j.return=i,l.return=i,j.sibling=l,i.child=j,l=i.child,l.memoizedState=Ud(s),l.childLanes=Fd(t,D,s),i.memoizedState=Hd,Vo(null,l)):(Jr(i),qd(i,j))}var X=t.memoizedState;if(X!==null&&(j=X.dehydrated,j!==null)){if(w)i.flags&256?(Jr(i),i.flags&=-257,i=Wd(t,i,s)):i.memoizedState!==null?(Qr(),i.child=t.child,i.flags|=128,i=null):(Qr(),j=l.fallback,_=i.mode,l=$c({mode:"visible",children:l.children},_),j=Ns(j,_,s,null),j.flags|=2,l.return=i,j.return=i,l.sibling=j,i.child=l,Hs(i,t.child,null,s),l=i.child,l.memoizedState=Ud(s),l.childLanes=Fd(t,D,s),i.memoizedState=Hd,i=Vo(null,l));else if(Jr(i),Tf(j)){if(D=j.nextSibling&&j.nextSibling.dataset,D)var re=D.dgst;D=re,l=Error(a(419)),l.stack="",l.digest=D,Bo({value:l,source:null,stack:null}),i=Wd(t,i,s)}else if(ln||Ea(t,i,s,!1),D=(s&t.childLanes)!==0,ln||D){if(D=Ct,D!==null&&(l=Bt(D,s),l!==0&&l!==X.retryLane))throw X.retryLane=l,Os(t,l),Xn(D,t,l),zd;Ef(j)||Kc(),i=Wd(t,i,s)}else Ef(j)?(i.flags|=192,i.child=t.child,i=null):(t=X.treeContext,Rt=Ci(j.nextSibling),Cn=i,st=!0,Gr=null,Si=!1,t!==null&&p_(i,t),i=qd(i,l.children),i.flags|=4096);return i}return _?(Qr(),j=l.fallback,_=i.mode,X=t.child,re=X.sibling,l=gr(X,{mode:"hidden",children:l.children}),l.subtreeFlags=X.subtreeFlags&65011712,re!==null?j=gr(re,j):(j=Ns(j,_,s,null),j.flags|=2),j.return=i,l.return=i,l.sibling=j,i.child=l,Vo(null,l),l=i.child,j=t.child.memoizedState,j===null?j=Ud(s):(_=j.cachePool,_!==null?(X=an._currentValue,_=_.parent!==X?{parent:X,pool:X}:_):_=y_(),j={baseLanes:j.baseLanes|s,cachePool:_}),l.memoizedState=j,l.childLanes=Fd(t,D,s),i.memoizedState=Hd,Vo(t.child,l)):(Jr(i),s=t.child,t=s.sibling,s=gr(s,{mode:"visible",children:l.children}),s.return=i,s.sibling=null,t!==null&&(D=i.deletions,D===null?(i.deletions=[t],i.flags|=16):D.push(t)),i.child=s,i.memoizedState=null,s)}function qd(t,i){return i=$c({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function $c(t,i){return t=oi(22,t,null,i),t.lanes=0,t}function Wd(t,i,s){return Hs(i,t.child,null,s),t=qd(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function Ov(t,i,s){t.lanes|=i;var l=t.alternate;l!==null&&(l.lanes|=i),ad(t.return,i,s)}function Gd(t,i,s,l,_,w){var D=t.memoizedState;D===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:_,treeForkCount:w}:(D.isBackwards=i,D.rendering=null,D.renderingStartTime=0,D.last=l,D.tail=s,D.tailMode=_,D.treeForkCount=w)}function Nv(t,i,s){var l=i.pendingProps,_=l.revealOrder,w=l.tail;l=l.children;var D=Zt.current,j=(D&2)!==0;if(j?(D=D&1|2,i.flags|=128):D&=1,Z(Zt,D),En(t,i,l,s),l=st?Io:0,!j&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Ov(t,s,i);else if(t.tag===19)Ov(t,s,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(_){case"forwards":for(s=i.child,_=null;s!==null;)t=s.alternate,t!==null&&Tc(t)===null&&(_=s),s=s.sibling;s=_,s===null?(_=i.child,i.child=null):(_=s.sibling,s.sibling=null),Gd(i,!1,_,s,w,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,_=i.child,i.child=null;_!==null;){if(t=_.alternate,t!==null&&Tc(t)===null){i.child=_;break}t=_.sibling,_.sibling=s,s=_,_=t}Gd(i,!0,s,null,w,l);break;case"together":Gd(i,!1,null,null,void 0,l);break;default:i.memoizedState=null}return i.child}function Sr(t,i,s){if(t!==null&&(i.dependencies=t.dependencies),ns|=i.lanes,(s&i.childLanes)===0)if(t!==null){if(Ea(t,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(a(153));if(i.child!==null){for(t=i.child,s=gr(t,t.pendingProps),i.child=s,s.return=i;t.sibling!==null;)t=t.sibling,s=s.sibling=gr(t,t.pendingProps),s.return=i;s.sibling=null}return i.child}function Kd(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&vc(t)))}function L2(t,i,s){switch(i.tag){case 3:P(i,i.stateNode.containerInfo),Vr(i,an,t.memoizedState.cache),Is();break;case 27:case 5:ge(i);break;case 4:P(i,i.stateNode.containerInfo);break;case 10:Vr(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,vd(i),null;break;case 13:var l=i.memoizedState;if(l!==null)return l.dehydrated!==null?(Jr(i),i.flags|=128,null):(s&i.child.childLanes)!==0?Dv(t,i,s):(Jr(i),t=Sr(t,i,s),t!==null?t.sibling:null);Jr(i);break;case 19:var _=(t.flags&128)!==0;if(l=(s&i.childLanes)!==0,l||(Ea(t,i,s,!1),l=(s&i.childLanes)!==0),_){if(l)return Nv(t,i,s);i.flags|=128}if(_=i.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),Z(Zt,Zt.current),l)break;return null;case 22:return i.lanes=0,Tv(t,i,s,i.pendingProps);case 24:Vr(i,an,t.memoizedState.cache)}return Sr(t,i,s)}function Iv(t,i,s){if(t!==null)if(t.memoizedProps!==i.pendingProps)ln=!0;else{if(!Kd(t,s)&&(i.flags&128)===0)return ln=!1,L2(t,i,s);ln=(t.flags&131072)!==0}else ln=!1,st&&(i.flags&1048576)!==0&&f_(i,Io,i.index);switch(i.lanes=0,i.tag){case 16:e:{var l=i.pendingProps;if(t=zs(i.elementType),i.type=t,typeof t=="function")Jh(t)?(l=Fs(t,l),i.tag=1,i=Lv(null,i,t,l,s)):(i.tag=0,i=Pd(null,i,t,l,s));else{if(t!=null){var _=t.$$typeof;if(_===T){i.tag=11,i=Cv(null,i,t,l,s);break e}else if(_===M){i.tag=14,i=xv(null,i,t,l,s);break e}}throw i=K(t)||t,Error(a(306,i,""))}}return i;case 0:return Pd(t,i,i.type,i.pendingProps,s);case 1:return l=i.type,_=Fs(l,i.pendingProps),Lv(t,i,l,_,s);case 3:e:{if(P(i,i.stateNode.containerInfo),t===null)throw Error(a(387));l=i.pendingProps;var w=i.memoizedState;_=w.element,fd(t,i),Fo(i,l,null,s);var D=i.memoizedState;if(l=D.cache,Vr(i,an,l),l!==w.cache&&od(i,[an],s,!0),Uo(),l=D.element,w.isDehydrated)if(w={element:l,isDehydrated:!1,cache:D.cache},i.updateQueue.baseState=w,i.memoizedState=w,i.flags&256){i=Mv(t,i,l,s);break e}else if(l!==_){_=vi(Error(a(424)),i),Bo(_),i=Mv(t,i,l,s);break e}else for(t=i.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Rt=Ci(t.firstChild),Cn=i,st=!0,Gr=null,Si=!0,s=T_(i,null,l,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Is(),l===_){i=Sr(t,i,s);break e}En(t,i,l,s)}i=i.child}return i;case 26:return jc(t,i),t===null?(s=G0(i.type,null,i.pendingProps,null))?i.memoizedState=s:st||(s=i.type,t=i.pendingProps,l=eu(_e.current).createElement(s),l[kt]=i,l[Et]=t,Tn(l,s,t),Ze(l),i.stateNode=l):i.memoizedState=G0(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return ge(i),t===null&&st&&(l=i.stateNode=F0(i.type,i.pendingProps,_e.current),Cn=i,Si=!0,_=Rt,os(i.type)?(kf=_,Rt=Ci(l.firstChild)):Rt=_),En(t,i,i.pendingProps.children,s),jc(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&st&&((_=l=Rt)&&(l=aE(l,i.type,i.pendingProps,Si),l!==null?(i.stateNode=l,Cn=i,Rt=Ci(l.firstChild),Si=!1,_=!0):_=!1),_||Kr(i)),ge(i),_=i.type,w=i.pendingProps,D=t!==null?t.memoizedProps:null,l=w.children,wf(_,w)?l=null:D!==null&&wf(_,D)&&(i.flags|=32),i.memoizedState!==null&&(_=yd(t,i,S2,null,null,s),cl._currentValue=_),jc(t,i),En(t,i,l,s),i.child;case 6:return t===null&&st&&((t=s=Rt)&&(s=oE(s,i.pendingProps,Si),s!==null?(i.stateNode=s,Cn=i,Rt=null,t=!0):t=!1),t||Kr(i)),null;case 13:return Dv(t,i,s);case 4:return P(i,i.stateNode.containerInfo),l=i.pendingProps,t===null?i.child=Hs(i,null,l,s):En(t,i,l,s),i.child;case 11:return Cv(t,i,i.type,i.pendingProps,s);case 7:return En(t,i,i.pendingProps,s),i.child;case 8:return En(t,i,i.pendingProps.children,s),i.child;case 12:return En(t,i,i.pendingProps.children,s),i.child;case 10:return l=i.pendingProps,Vr(i,i.type,l.value),En(t,i,l.children,s),i.child;case 9:return _=i.type._context,l=i.pendingProps.children,js(i),_=xn(_),l=l(_),i.flags|=1,En(t,i,l,s),i.child;case 14:return xv(t,i,i.type,i.pendingProps,s);case 15:return Ev(t,i,i.type,i.pendingProps,s);case 19:return Nv(t,i,s);case 31:return R2(t,i,s);case 22:return Tv(t,i,s,i.pendingProps);case 24:return js(i),l=xn(an),t===null?(_=ud(),_===null&&(_=Ct,w=ld(),_.pooledCache=w,w.refCount++,w!==null&&(_.pooledCacheLanes|=s),_=w),i.memoizedState={parent:l,cache:_},dd(i),Vr(i,an,_)):((t.lanes&s)!==0&&(fd(t,i),Fo(i,null,null,s),Uo()),_=t.memoizedState,w=i.memoizedState,_.parent!==l?(_={parent:l,cache:l},i.memoizedState=_,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=_),Vr(i,an,l)):(l=w.cache,Vr(i,an,l),l!==_.cache&&od(i,[an],s,!0))),En(t,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function wr(t){t.flags|=4}function Vd(t,i,s,l,_){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(_&335544128)===_)if(t.stateNode.complete)t.flags|=8192;else if(l0())t.flags|=8192;else throw Ps=wc,hd}else t.flags&=-16777217}function Bv(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Z0(i))if(l0())t.flags|=8192;else throw Ps=wc,hd}function zc(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?Be():536870912,t.lanes|=i,ja|=i)}function Yo(t,i){if(!st)switch(t.tailMode){case"hidden":i=t.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function Lt(t){var i=t.alternate!==null&&t.alternate.child===t.child,s=0,l=0;if(i)for(var _=t.child;_!==null;)s|=_.lanes|_.childLanes,l|=_.subtreeFlags&65011712,l|=_.flags&65011712,_.return=t,_=_.sibling;else for(_=t.child;_!==null;)s|=_.lanes|_.childLanes,l|=_.subtreeFlags,l|=_.flags,_.return=t,_=_.sibling;return t.subtreeFlags|=l,t.childLanes=s,i}function M2(t,i,s){var l=i.pendingProps;switch(nd(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lt(i),null;case 1:return Lt(i),null;case 3:return s=i.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),vr(an),oe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(xa(i)?wr(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,rd())),Lt(i),null;case 26:var _=i.type,w=i.memoizedState;return t===null?(wr(i),w!==null?(Lt(i),Bv(i,w)):(Lt(i),Vd(i,_,null,l,s))):w?w!==t.memoizedState?(wr(i),Lt(i),Bv(i,w)):(Lt(i),i.flags&=-16777217):(t=t.memoizedProps,t!==l&&wr(i),Lt(i),Vd(i,_,t,l,s)),null;case 27:if(Se(i),s=_e.current,_=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==l&&wr(i);else{if(!l){if(i.stateNode===null)throw Error(a(166));return Lt(i),null}t=ae.current,xa(i)?g_(i):(t=F0(_,l,s),i.stateNode=t,wr(i))}return Lt(i),null;case 5:if(Se(i),_=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==l&&wr(i);else{if(!l){if(i.stateNode===null)throw Error(a(166));return Lt(i),null}if(w=ae.current,xa(i))g_(i);else{var D=eu(_e.current);switch(w){case 1:w=D.createElementNS("http://www.w3.org/2000/svg",_);break;case 2:w=D.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;default:switch(_){case"svg":w=D.createElementNS("http://www.w3.org/2000/svg",_);break;case"math":w=D.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;case"script":w=D.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof l.is=="string"?D.createElement("select",{is:l.is}):D.createElement("select"),l.multiple?w.multiple=!0:l.size&&(w.size=l.size);break;default:w=typeof l.is=="string"?D.createElement(_,{is:l.is}):D.createElement(_)}}w[kt]=i,w[Et]=l;e:for(D=i.child;D!==null;){if(D.tag===5||D.tag===6)w.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===i)break e;for(;D.sibling===null;){if(D.return===null||D.return===i)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}i.stateNode=w;e:switch(Tn(w,_,l),_){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&wr(i)}}return Lt(i),Vd(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,s),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==l&&wr(i);else{if(typeof l!="string"&&i.stateNode===null)throw Error(a(166));if(t=_e.current,xa(i)){if(t=i.stateNode,s=i.memoizedProps,l=null,_=Cn,_!==null)switch(_.tag){case 27:case 5:l=_.memoizedProps}t[kt]=i,t=!!(t.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||D0(t.nodeValue,s)),t||Kr(i,!0)}else t=eu(t).createTextNode(l),t[kt]=i,i.stateNode=t}return Lt(i),null;case 31:if(s=i.memoizedState,t===null||t.memoizedState!==null){if(l=xa(i),s!==null){if(t===null){if(!l)throw Error(a(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[kt]=i}else Is(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Lt(i),t=!1}else s=rd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return i.flags&256?(ci(i),i):(ci(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Lt(i),null;case 13:if(l=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(_=xa(i),l!==null&&l.dehydrated!==null){if(t===null){if(!_)throw Error(a(318));if(_=i.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(a(317));_[kt]=i}else Is(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Lt(i),_=!1}else _=rd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=_),_=!0;if(!_)return i.flags&256?(ci(i),i):(ci(i),null)}return ci(i),(i.flags&128)!==0?(i.lanes=s,i):(s=l!==null,t=t!==null&&t.memoizedState!==null,s&&(l=i.child,_=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(_=l.alternate.memoizedState.cachePool.pool),w=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(w=l.memoizedState.cachePool.pool),w!==_&&(l.flags|=2048)),s!==t&&s&&(i.child.flags|=8192),zc(i,i.updateQueue),Lt(i),null);case 4:return oe(),t===null&&_f(i.stateNode.containerInfo),Lt(i),null;case 10:return vr(i.type),Lt(i),null;case 19:if(H(Zt),l=i.memoizedState,l===null)return Lt(i),null;if(_=(i.flags&128)!==0,w=l.rendering,w===null)if(_)Yo(l,!1);else{if(qt!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(w=Tc(t),w!==null){for(i.flags|=128,Yo(l,!1),t=w.updateQueue,i.updateQueue=t,zc(i,t),i.subtreeFlags=0,t=s,s=i.child;s!==null;)u_(s,t),s=s.sibling;return Z(Zt,Zt.current&1|2),st&&mr(i,l.treeForkCount),i.child}t=t.sibling}l.tail!==null&&ut()>qc&&(i.flags|=128,_=!0,Yo(l,!1),i.lanes=4194304)}else{if(!_)if(t=Tc(w),t!==null){if(i.flags|=128,_=!0,t=t.updateQueue,i.updateQueue=t,zc(i,t),Yo(l,!0),l.tail===null&&l.tailMode==="hidden"&&!w.alternate&&!st)return Lt(i),null}else 2*ut()-l.renderingStartTime>qc&&s!==536870912&&(i.flags|=128,_=!0,Yo(l,!1),i.lanes=4194304);l.isBackwards?(w.sibling=i.child,i.child=w):(t=l.last,t!==null?t.sibling=w:i.child=w,l.last=w)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=ut(),t.sibling=null,s=Zt.current,Z(Zt,_?s&1|2:s&1),st&&mr(i,l.treeForkCount),t):(Lt(i),null);case 22:case 23:return ci(i),_d(),l=i.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(i.flags|=8192):l&&(i.flags|=8192),l?(s&536870912)!==0&&(i.flags&128)===0&&(Lt(i),i.subtreeFlags&6&&(i.flags|=8192)):Lt(i),s=i.updateQueue,s!==null&&zc(i,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),l=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),l!==s&&(i.flags|=2048),t!==null&&H($s),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),vr(an),Lt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function D2(t,i){switch(nd(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return vr(an),oe(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return Se(i),null;case 31:if(i.memoizedState!==null){if(ci(i),i.alternate===null)throw Error(a(340));Is()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(ci(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Is()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return H(Zt),null;case 4:return oe(),null;case 10:return vr(i.type),null;case 22:case 23:return ci(i),_d(),t!==null&&H($s),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return vr(an),null;case 25:return null;default:return null}}function jv(t,i){switch(nd(i),i.tag){case 3:vr(an),oe();break;case 26:case 27:case 5:Se(i);break;case 4:oe();break;case 31:i.memoizedState!==null&&ci(i);break;case 13:ci(i);break;case 19:H(Zt);break;case 10:vr(i.type);break;case 22:case 23:ci(i),_d(),t!==null&&H($s);break;case 24:vr(an)}}function Xo(t,i){try{var s=i.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var _=l.next;s=_;do{if((s.tag&t)===t){l=void 0;var w=s.create,D=s.inst;l=w(),D.destroy=l}s=s.next}while(s!==_)}}catch(j){mt(i,i.return,j)}}function es(t,i,s){try{var l=i.updateQueue,_=l!==null?l.lastEffect:null;if(_!==null){var w=_.next;l=w;do{if((l.tag&t)===t){var D=l.inst,j=D.destroy;if(j!==void 0){D.destroy=void 0,_=i;var X=s,re=j;try{re()}catch(ue){mt(_,X,ue)}}}l=l.next}while(l!==w)}}catch(ue){mt(i,i.return,ue)}}function $v(t){var i=t.updateQueue;if(i!==null){var s=t.stateNode;try{A_(i,s)}catch(l){mt(t,t.return,l)}}}function zv(t,i,s){s.props=Fs(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(l){mt(t,i,l)}}function Zo(t,i){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof s=="function"?t.refCleanup=s(l):s.current=l}}catch(_){mt(t,i,_)}}function Zi(t,i){var s=t.ref,l=t.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(_){mt(t,i,_)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(_){mt(t,i,_)}else s.current=null}function Pv(t){var i=t.type,s=t.memoizedProps,l=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(_){mt(t,t.return,_)}}function Yd(t,i,s){try{var l=t.stateNode;eE(l,t.type,s,i),l[Et]=i}catch(_){mt(t,t.return,_)}}function Hv(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&os(t.type)||t.tag===4}function Xd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Hv(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&os(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Zd(t,i,s){var l=t.tag;if(l===5||l===6)t=t.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(t),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=we));else if(l!==4&&(l===27&&os(t.type)&&(s=t.stateNode,i=null),t=t.child,t!==null))for(Zd(t,i,s),t=t.sibling;t!==null;)Zd(t,i,s),t=t.sibling}function Pc(t,i,s){var l=t.tag;if(l===5||l===6)t=t.stateNode,i?s.insertBefore(t,i):s.appendChild(t);else if(l!==4&&(l===27&&os(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(Pc(t,i,s),t=t.sibling;t!==null;)Pc(t,i,s),t=t.sibling}function Uv(t){var i=t.stateNode,s=t.memoizedProps;try{for(var l=t.type,_=i.attributes;_.length;)i.removeAttributeNode(_[0]);Tn(i,l,s),i[kt]=t,i[Et]=s}catch(w){mt(t,t.return,w)}}var Cr=!1,cn=!1,Jd=!1,Fv=typeof WeakSet=="function"?WeakSet:Set,pn=null;function O2(t,i){if(t=t.containerInfo,yf=ou,t=t_(t),Wh(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var _=l.anchorOffset,w=l.focusNode;l=l.focusOffset;try{s.nodeType,w.nodeType}catch{s=null;break e}var D=0,j=-1,X=-1,re=0,ue=0,fe=t,se=null;t:for(;;){for(var le;fe!==s||_!==0&&fe.nodeType!==3||(j=D+_),fe!==w||l!==0&&fe.nodeType!==3||(X=D+l),fe.nodeType===3&&(D+=fe.nodeValue.length),(le=fe.firstChild)!==null;)se=fe,fe=le;for(;;){if(fe===t)break t;if(se===s&&++re===_&&(j=D),se===w&&++ue===l&&(X=D),(le=fe.nextSibling)!==null)break;fe=se,se=fe.parentNode}fe=le}s=j===-1||X===-1?null:{start:j,end:X}}else s=null}s=s||{start:0,end:0}}else s=null;for(Sf={focusedElem:t,selectionRange:s},ou=!1,pn=i;pn!==null;)if(i=pn,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,pn=t;else for(;pn!==null;){switch(i=pn,w=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)_=t[s],_.ref.impl=_.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&w!==null){t=void 0,s=i,_=w.memoizedProps,w=w.memoizedState,l=s.stateNode;try{var ke=Fs(s.type,_);t=l.getSnapshotBeforeUpdate(ke,w),l.__reactInternalSnapshotBeforeUpdate=t}catch($e){mt(s,s.return,$e)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,s=t.nodeType,s===9)xf(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":xf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(a(163))}if(t=i.sibling,t!==null){t.return=i.return,pn=t;break}pn=i.return}}function qv(t,i,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:Er(t,s),l&4&&Xo(5,s);break;case 1:if(Er(t,s),l&4)if(t=s.stateNode,i===null)try{t.componentDidMount()}catch(D){mt(s,s.return,D)}else{var _=Fs(s.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(_,i,t.__reactInternalSnapshotBeforeUpdate)}catch(D){mt(s,s.return,D)}}l&64&&$v(s),l&512&&Zo(s,s.return);break;case 3:if(Er(t,s),l&64&&(t=s.updateQueue,t!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{A_(t,i)}catch(D){mt(s,s.return,D)}}break;case 27:i===null&&l&4&&Uv(s);case 26:case 5:Er(t,s),i===null&&l&4&&Pv(s),l&512&&Zo(s,s.return);break;case 12:Er(t,s);break;case 31:Er(t,s),l&4&&Kv(t,s);break;case 13:Er(t,s),l&4&&Vv(t,s),l&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=U2.bind(null,s),lE(t,s))));break;case 22:if(l=s.memoizedState!==null||Cr,!l){i=i!==null&&i.memoizedState!==null||cn,_=Cr;var w=cn;Cr=l,(cn=i)&&!w?Tr(t,s,(s.subtreeFlags&8772)!==0):Er(t,s),Cr=_,cn=w}break;case 30:break;default:Er(t,s)}}function Wv(t){var i=t.alternate;i!==null&&(t.alternate=null,Wv(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&De(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Nt=null,Gn=!1;function xr(t,i,s){for(s=s.child;s!==null;)Gv(t,i,s),s=s.sibling}function Gv(t,i,s){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(Hn,s)}catch{}switch(s.tag){case 26:cn||Zi(s,i),xr(t,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:cn||Zi(s,i);var l=Nt,_=Gn;os(s.type)&&(Nt=s.stateNode,Gn=!1),xr(t,i,s),al(s.stateNode),Nt=l,Gn=_;break;case 5:cn||Zi(s,i);case 6:if(l=Nt,_=Gn,Nt=null,xr(t,i,s),Nt=l,Gn=_,Nt!==null)if(Gn)try{(Nt.nodeType===9?Nt.body:Nt.nodeName==="HTML"?Nt.ownerDocument.body:Nt).removeChild(s.stateNode)}catch(w){mt(s,i,w)}else try{Nt.removeChild(s.stateNode)}catch(w){mt(s,i,w)}break;case 18:Nt!==null&&(Gn?(t=Nt,$0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Wa(t)):$0(Nt,s.stateNode));break;case 4:l=Nt,_=Gn,Nt=s.stateNode.containerInfo,Gn=!0,xr(t,i,s),Nt=l,Gn=_;break;case 0:case 11:case 14:case 15:es(2,s,i),cn||es(4,s,i),xr(t,i,s);break;case 1:cn||(Zi(s,i),l=s.stateNode,typeof l.componentWillUnmount=="function"&&zv(s,i,l)),xr(t,i,s);break;case 21:xr(t,i,s);break;case 22:cn=(l=cn)||s.memoizedState!==null,xr(t,i,s),cn=l;break;default:xr(t,i,s)}}function Kv(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Wa(t)}catch(s){mt(i,i.return,s)}}}function Vv(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Wa(t)}catch(s){mt(i,i.return,s)}}function N2(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new Fv),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new Fv),i;default:throw Error(a(435,t.tag))}}function Hc(t,i){var s=N2(t);i.forEach(function(l){if(!s.has(l)){s.add(l);var _=F2.bind(null,t,l);l.then(_,_)}})}function Kn(t,i){var s=i.deletions;if(s!==null)for(var l=0;l<s.length;l++){var _=s[l],w=t,D=i,j=D;e:for(;j!==null;){switch(j.tag){case 27:if(os(j.type)){Nt=j.stateNode,Gn=!1;break e}break;case 5:Nt=j.stateNode,Gn=!1;break e;case 3:case 4:Nt=j.stateNode.containerInfo,Gn=!0;break e}j=j.return}if(Nt===null)throw Error(a(160));Gv(w,D,_),Nt=null,Gn=!1,w=_.alternate,w!==null&&(w.return=null),_.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Yv(i,t),i=i.sibling}var $i=null;function Yv(t,i){var s=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Kn(i,t),Vn(t),l&4&&(es(3,t,t.return),Xo(3,t),es(5,t,t.return));break;case 1:Kn(i,t),Vn(t),l&512&&(cn||s===null||Zi(s,s.return)),l&64&&Cr&&(t=t.updateQueue,t!==null&&(l=t.callbacks,l!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?l:s.concat(l))));break;case 26:var _=$i;if(Kn(i,t),Vn(t),l&512&&(cn||s===null||Zi(s,s.return)),l&4){var w=s!==null?s.memoizedState:null;if(l=t.memoizedState,s===null)if(l===null)if(t.stateNode===null){e:{l=t.type,s=t.memoizedProps,_=_.ownerDocument||_;t:switch(l){case"title":w=_.getElementsByTagName("title")[0],(!w||w[Vi]||w[kt]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=_.createElement(l),_.head.insertBefore(w,_.querySelector("head > title"))),Tn(w,l,s),w[kt]=t,Ze(w),l=w;break e;case"link":var D=Y0("link","href",_).get(l+(s.href||""));if(D){for(var j=0;j<D.length;j++)if(w=D[j],w.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&w.getAttribute("rel")===(s.rel==null?null:s.rel)&&w.getAttribute("title")===(s.title==null?null:s.title)&&w.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){D.splice(j,1);break t}}w=_.createElement(l),Tn(w,l,s),_.head.appendChild(w);break;case"meta":if(D=Y0("meta","content",_).get(l+(s.content||""))){for(j=0;j<D.length;j++)if(w=D[j],w.getAttribute("content")===(s.content==null?null:""+s.content)&&w.getAttribute("name")===(s.name==null?null:s.name)&&w.getAttribute("property")===(s.property==null?null:s.property)&&w.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&w.getAttribute("charset")===(s.charSet==null?null:s.charSet)){D.splice(j,1);break t}}w=_.createElement(l),Tn(w,l,s),_.head.appendChild(w);break;default:throw Error(a(468,l))}w[kt]=t,Ze(w),l=w}t.stateNode=l}else X0(_,t.type,t.stateNode);else t.stateNode=V0(_,l,t.memoizedProps);else w!==l?(w===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):w.count--,l===null?X0(_,t.type,t.stateNode):V0(_,l,t.memoizedProps)):l===null&&t.stateNode!==null&&Yd(t,t.memoizedProps,s.memoizedProps)}break;case 27:Kn(i,t),Vn(t),l&512&&(cn||s===null||Zi(s,s.return)),s!==null&&l&4&&Yd(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Kn(i,t),Vn(t),l&512&&(cn||s===null||Zi(s,s.return)),t.flags&32){_=t.stateNode;try{He(_,"")}catch(ke){mt(t,t.return,ke)}}l&4&&t.stateNode!=null&&(_=t.memoizedProps,Yd(t,_,s!==null?s.memoizedProps:_)),l&1024&&(Jd=!0);break;case 6:if(Kn(i,t),Vn(t),l&4){if(t.stateNode===null)throw Error(a(162));l=t.memoizedProps,s=t.stateNode;try{s.nodeValue=l}catch(ke){mt(t,t.return,ke)}}break;case 3:if(iu=null,_=$i,$i=tu(i.containerInfo),Kn(i,t),$i=_,Vn(t),l&4&&s!==null&&s.memoizedState.isDehydrated)try{Wa(i.containerInfo)}catch(ke){mt(t,t.return,ke)}Jd&&(Jd=!1,Xv(t));break;case 4:l=$i,$i=tu(t.stateNode.containerInfo),Kn(i,t),Vn(t),$i=l;break;case 12:Kn(i,t),Vn(t);break;case 31:Kn(i,t),Vn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Hc(t,l)));break;case 13:Kn(i,t),Vn(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Fc=ut()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Hc(t,l)));break;case 22:_=t.memoizedState!==null;var X=s!==null&&s.memoizedState!==null,re=Cr,ue=cn;if(Cr=re||_,cn=ue||X,Kn(i,t),cn=ue,Cr=re,Vn(t),l&8192)e:for(i=t.stateNode,i._visibility=_?i._visibility&-2:i._visibility|1,_&&(s===null||X||Cr||cn||qs(t)),s=null,i=t;;){if(i.tag===5||i.tag===26){if(s===null){X=s=i;try{if(w=X.stateNode,_)D=w.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{j=X.stateNode;var fe=X.memoizedProps.style,se=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;j.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(ke){mt(X,X.return,ke)}}}else if(i.tag===6){if(s===null){X=i;try{X.stateNode.nodeValue=_?"":X.memoizedProps}catch(ke){mt(X,X.return,ke)}}}else if(i.tag===18){if(s===null){X=i;try{var le=X.stateNode;_?z0(le,!0):z0(X.stateNode,!1)}catch(ke){mt(X,X.return,ke)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}l&4&&(l=t.updateQueue,l!==null&&(s=l.retryQueue,s!==null&&(l.retryQueue=null,Hc(t,s))));break;case 19:Kn(i,t),Vn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Hc(t,l)));break;case 30:break;case 21:break;default:Kn(i,t),Vn(t)}}function Vn(t){var i=t.flags;if(i&2){try{for(var s,l=t.return;l!==null;){if(Hv(l)){s=l;break}l=l.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var _=s.stateNode,w=Xd(t);Pc(t,w,_);break;case 5:var D=s.stateNode;s.flags&32&&(He(D,""),s.flags&=-33);var j=Xd(t);Pc(t,j,D);break;case 3:case 4:var X=s.stateNode.containerInfo,re=Xd(t);Zd(t,re,X);break;default:throw Error(a(161))}}catch(ue){mt(t,t.return,ue)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function Xv(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;Xv(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function Er(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)qv(t,i.alternate,i),i=i.sibling}function qs(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:es(4,i,i.return),qs(i);break;case 1:Zi(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&zv(i,i.return,s),qs(i);break;case 27:al(i.stateNode);case 26:case 5:Zi(i,i.return),qs(i);break;case 22:i.memoizedState===null&&qs(i);break;case 30:qs(i);break;default:qs(i)}t=t.sibling}}function Tr(t,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var l=i.alternate,_=t,w=i,D=w.flags;switch(w.tag){case 0:case 11:case 15:Tr(_,w,s),Xo(4,w);break;case 1:if(Tr(_,w,s),l=w,_=l.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(re){mt(l,l.return,re)}if(l=w,_=l.updateQueue,_!==null){var j=l.stateNode;try{var X=_.shared.hiddenCallbacks;if(X!==null)for(_.shared.hiddenCallbacks=null,_=0;_<X.length;_++)k_(X[_],j)}catch(re){mt(l,l.return,re)}}s&&D&64&&$v(w),Zo(w,w.return);break;case 27:Uv(w);case 26:case 5:Tr(_,w,s),s&&l===null&&D&4&&Pv(w),Zo(w,w.return);break;case 12:Tr(_,w,s);break;case 31:Tr(_,w,s),s&&D&4&&Kv(_,w);break;case 13:Tr(_,w,s),s&&D&4&&Vv(_,w);break;case 22:w.memoizedState===null&&Tr(_,w,s),Zo(w,w.return);break;case 30:break;default:Tr(_,w,s)}i=i.sibling}}function Qd(t,i){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&jo(s))}function ef(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&jo(t))}function zi(t,i,s,l){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Zv(t,i,s,l),i=i.sibling}function Zv(t,i,s,l){var _=i.flags;switch(i.tag){case 0:case 11:case 15:zi(t,i,s,l),_&2048&&Xo(9,i);break;case 1:zi(t,i,s,l);break;case 3:zi(t,i,s,l),_&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&jo(t)));break;case 12:if(_&2048){zi(t,i,s,l),t=i.stateNode;try{var w=i.memoizedProps,D=w.id,j=w.onPostCommit;typeof j=="function"&&j(D,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(X){mt(i,i.return,X)}}else zi(t,i,s,l);break;case 31:zi(t,i,s,l);break;case 13:zi(t,i,s,l);break;case 23:break;case 22:w=i.stateNode,D=i.alternate,i.memoizedState!==null?w._visibility&2?zi(t,i,s,l):Jo(t,i):w._visibility&2?zi(t,i,s,l):(w._visibility|=2,Na(t,i,s,l,(i.subtreeFlags&10256)!==0||!1)),_&2048&&Qd(D,i);break;case 24:zi(t,i,s,l),_&2048&&ef(i.alternate,i);break;default:zi(t,i,s,l)}}function Na(t,i,s,l,_){for(_=_&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var w=t,D=i,j=s,X=l,re=D.flags;switch(D.tag){case 0:case 11:case 15:Na(w,D,j,X,_),Xo(8,D);break;case 23:break;case 22:var ue=D.stateNode;D.memoizedState!==null?ue._visibility&2?Na(w,D,j,X,_):Jo(w,D):(ue._visibility|=2,Na(w,D,j,X,_)),_&&re&2048&&Qd(D.alternate,D);break;case 24:Na(w,D,j,X,_),_&&re&2048&&ef(D.alternate,D);break;default:Na(w,D,j,X,_)}i=i.sibling}}function Jo(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=t,l=i,_=l.flags;switch(l.tag){case 22:Jo(s,l),_&2048&&Qd(l.alternate,l);break;case 24:Jo(s,l),_&2048&&ef(l.alternate,l);break;default:Jo(s,l)}i=i.sibling}}var Qo=8192;function Ia(t,i,s){if(t.subtreeFlags&Qo)for(t=t.child;t!==null;)Jv(t,i,s),t=t.sibling}function Jv(t,i,s){switch(t.tag){case 26:Ia(t,i,s),t.flags&Qo&&t.memoizedState!==null&&yE(s,$i,t.memoizedState,t.memoizedProps);break;case 5:Ia(t,i,s);break;case 3:case 4:var l=$i;$i=tu(t.stateNode.containerInfo),Ia(t,i,s),$i=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=Qo,Qo=16777216,Ia(t,i,s),Qo=l):Ia(t,i,s));break;default:Ia(t,i,s)}}function Qv(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function el(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var l=i[s];pn=l,t0(l,t)}Qv(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)e0(t),t=t.sibling}function e0(t){switch(t.tag){case 0:case 11:case 15:el(t),t.flags&2048&&es(9,t,t.return);break;case 3:el(t);break;case 12:el(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,Uc(t)):el(t);break;default:el(t)}}function Uc(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var l=i[s];pn=l,t0(l,t)}Qv(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:es(8,i,i.return),Uc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Uc(i));break;default:Uc(i)}t=t.sibling}}function t0(t,i){for(;pn!==null;){var s=pn;switch(s.tag){case 0:case 11:case 15:es(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:jo(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,pn=l;else e:for(s=t;pn!==null;){l=pn;var _=l.sibling,w=l.return;if(Wv(l),l===s){pn=null;break e}if(_!==null){_.return=w,pn=_;break e}pn=w}}}var I2={getCacheForType:function(t){var i=xn(an),s=i.data.get(t);return s===void 0&&(s=t(),i.data.set(t,s)),s},cacheSignal:function(){return xn(an).controller.signal}},B2=typeof WeakMap=="function"?WeakMap:Map,ht=0,Ct=null,Je=null,nt=0,gt=0,ui=null,ts=!1,Ba=!1,tf=!1,kr=0,qt=0,ns=0,Ws=0,nf=0,hi=0,ja=0,tl=null,Yn=null,rf=!1,Fc=0,n0=0,qc=1/0,Wc=null,is=null,fn=0,rs=null,$a=null,Ar=0,sf=0,af=null,i0=null,nl=0,of=null;function di(){return(ht&2)!==0&&nt!==0?nt&-nt:q.T!==null?ff():ur()}function r0(){if(hi===0)if((nt&536870912)===0||st){var t=Ki;Ki<<=1,(Ki&3932160)===0&&(Ki=262144),hi=t}else hi=536870912;return t=li.current,t!==null&&(t.flags|=32),hi}function Xn(t,i,s){(t===Ct&&(gt===2||gt===9)||t.cancelPendingCommit!==null)&&(za(t,0),ss(t,nt,hi,!1)),ft(t,s),((ht&2)===0||t!==Ct)&&(t===Ct&&((ht&2)===0&&(Ws|=s),qt===4&&ss(t,nt,hi,!1)),Ji(t))}function s0(t,i,s){if((ht&6)!==0)throw Error(a(327));var l=!s&&(i&127)===0&&(i&t.expiredLanes)===0||he(t,i),_=l?z2(t,i):cf(t,i,!0),w=l;do{if(_===0){Ba&&!l&&ss(t,i,0,!1);break}else{if(s=t.current.alternate,w&&!j2(s)){_=cf(t,i,!1),w=!1;continue}if(_===2){if(w=i,t.errorRecoveryDisabledLanes&w)var D=0;else D=t.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){i=D;e:{var j=t;_=tl;var X=j.current.memoizedState.isDehydrated;if(X&&(za(j,D).flags|=256),D=cf(j,D,!1),D!==2){if(tf&&!X){j.errorRecoveryDisabledLanes|=w,Ws|=w,_=4;break e}w=Yn,Yn=_,w!==null&&(Yn===null?Yn=w:Yn.push.apply(Yn,w))}_=D}if(w=!1,_!==2)continue}}if(_===1){za(t,0),ss(t,i,0,!0);break}e:{switch(l=t,w=_,w){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:ss(l,i,hi,!ts);break e;case 2:Yn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(_=Fc+300-ut(),10<_)){if(ss(l,i,hi,!ts),J(l,0,!0)!==0)break e;Ar=i,l.timeoutHandle=B0(a0.bind(null,l,s,Yn,Wc,rf,i,hi,Ws,ja,ts,w,"Throttled",-0,0),_);break e}a0(l,s,Yn,Wc,rf,i,hi,Ws,ja,ts,w,null,-0,0)}}break}while(!0);Ji(t)}function a0(t,i,s,l,_,w,D,j,X,re,ue,fe,se,le){if(t.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:we},Jv(i,w,fe);var ke=(w&62914560)===w?Fc-ut():(w&4194048)===w?n0-ut():0;if(ke=SE(fe,ke),ke!==null){Ar=w,t.cancelPendingCommit=ke(p0.bind(null,t,i,w,s,l,_,D,j,X,ue,fe,null,se,le)),ss(t,w,D,!re);return}}p0(t,i,w,s,l,_,D,j,X)}function j2(t){for(var i=t;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var _=s[l],w=_.getSnapshot;_=_.value;try{if(!ai(w(),_))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ss(t,i,s,l){i&=~nf,i&=~Ws,t.suspendedLanes|=i,t.pingedLanes&=~i,l&&(t.warmLanes|=i),l=t.expirationTimes;for(var _=i;0<_;){var w=31-Pt(_),D=1<<w;l[w]=-1,_&=~D}s!==0&&Ce(t,s,i)}function Gc(){return(ht&6)===0?(il(0),!1):!0}function lf(){if(Je!==null){if(gt===0)var t=Je.return;else t=Je,_r=Bs=null,Cd(t),Ra=null,zo=0,t=Je;for(;t!==null;)jv(t.alternate,t),t=t.return;Je=null}}function za(t,i){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,iE(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Ar=0,lf(),Ct=t,Je=s=gr(t.current,null),nt=i,gt=0,ui=null,ts=!1,Ba=he(t,i),tf=!1,ja=hi=nf=Ws=ns=qt=0,Yn=tl=null,rf=!1,(i&8)!==0&&(i|=i&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=i;0<l;){var _=31-Pt(l),w=1<<_;i|=t[_],l&=~w}return kr=i,fc(),s}function o0(t,i){We=null,q.H=Ko,i===Aa||i===Sc?(i=C_(),gt=3):i===hd?(i=C_(),gt=4):gt=i===zd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,ui=i,Je===null&&(qt=1,Ic(t,vi(i,t.current)))}function l0(){var t=li.current;return t===null?!0:(nt&4194048)===nt?wi===null:(nt&62914560)===nt||(nt&536870912)!==0?t===wi:!1}function c0(){var t=q.H;return q.H=Ko,t===null?Ko:t}function u0(){var t=q.A;return q.A=I2,t}function Kc(){qt=4,ts||(nt&4194048)!==nt&&li.current!==null||(Ba=!0),(ns&134217727)===0&&(Ws&134217727)===0||Ct===null||ss(Ct,nt,hi,!1)}function cf(t,i,s){var l=ht;ht|=2;var _=c0(),w=u0();(Ct!==t||nt!==i)&&(Wc=null,za(t,i)),i=!1;var D=qt;e:do try{if(gt!==0&&Je!==null){var j=Je,X=ui;switch(gt){case 8:lf(),D=6;break e;case 3:case 2:case 9:case 6:li.current===null&&(i=!0);var re=gt;if(gt=0,ui=null,Pa(t,j,X,re),s&&Ba){D=0;break e}break;default:re=gt,gt=0,ui=null,Pa(t,j,X,re)}}$2(),D=qt;break}catch(ue){o0(t,ue)}while(!0);return i&&t.shellSuspendCounter++,_r=Bs=null,ht=l,q.H=_,q.A=w,Je===null&&(Ct=null,nt=0,fc()),D}function $2(){for(;Je!==null;)h0(Je)}function z2(t,i){var s=ht;ht|=2;var l=c0(),_=u0();Ct!==t||nt!==i?(Wc=null,qc=ut()+500,za(t,i)):Ba=he(t,i);e:do try{if(gt!==0&&Je!==null){i=Je;var w=ui;t:switch(gt){case 1:gt=0,ui=null,Pa(t,i,w,1);break;case 2:case 9:if(S_(w)){gt=0,ui=null,d0(i);break}i=function(){gt!==2&&gt!==9||Ct!==t||(gt=7),Ji(t)},w.then(i,i);break e;case 3:gt=7;break e;case 4:gt=5;break e;case 7:S_(w)?(gt=0,ui=null,d0(i)):(gt=0,ui=null,Pa(t,i,w,7));break;case 5:var D=null;switch(Je.tag){case 26:D=Je.memoizedState;case 5:case 27:var j=Je;if(D?Z0(D):j.stateNode.complete){gt=0,ui=null;var X=j.sibling;if(X!==null)Je=X;else{var re=j.return;re!==null?(Je=re,Vc(re)):Je=null}break t}}gt=0,ui=null,Pa(t,i,w,5);break;case 6:gt=0,ui=null,Pa(t,i,w,6);break;case 8:lf(),qt=6;break e;default:throw Error(a(462))}}P2();break}catch(ue){o0(t,ue)}while(!0);return _r=Bs=null,q.H=l,q.A=_,ht=s,Je!==null?0:(Ct=null,nt=0,fc(),qt)}function P2(){for(;Je!==null&&!Oi();)h0(Je)}function h0(t){var i=Iv(t.alternate,t,kr);t.memoizedProps=t.pendingProps,i===null?Vc(t):Je=i}function d0(t){var i=t,s=i.alternate;switch(i.tag){case 15:case 0:i=Rv(s,i,i.pendingProps,i.type,void 0,nt);break;case 11:i=Rv(s,i,i.pendingProps,i.type.render,i.ref,nt);break;case 5:Cd(i);default:jv(s,i),i=Je=u_(i,kr),i=Iv(s,i,kr)}t.memoizedProps=t.pendingProps,i===null?Vc(t):Je=i}function Pa(t,i,s,l){_r=Bs=null,Cd(i),Ra=null,zo=0;var _=i.return;try{if(A2(t,_,i,s,nt)){qt=1,Ic(t,vi(s,t.current)),Je=null;return}}catch(w){if(_!==null)throw Je=_,w;qt=1,Ic(t,vi(s,t.current)),Je=null;return}i.flags&32768?(st||l===1?t=!0:Ba||(nt&536870912)!==0?t=!1:(ts=t=!0,(l===2||l===9||l===3||l===6)&&(l=li.current,l!==null&&l.tag===13&&(l.flags|=16384))),f0(i,t)):Vc(i)}function Vc(t){var i=t;do{if((i.flags&32768)!==0){f0(i,ts);return}t=i.return;var s=M2(i.alternate,i,kr);if(s!==null){Je=s;return}if(i=i.sibling,i!==null){Je=i;return}Je=i=t}while(i!==null);qt===0&&(qt=5)}function f0(t,i){do{var s=D2(t.alternate,t);if(s!==null){s.flags&=32767,Je=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(t=t.sibling,t!==null)){Je=t;return}Je=t=s}while(t!==null);qt=6,Je=null}function p0(t,i,s,l,_,w,D,j,X){t.cancelPendingCommit=null;do Yc();while(fn!==0);if((ht&6)!==0)throw Error(a(327));if(i!==null){if(i===t.current)throw Error(a(177));if(w=i.lanes|i.childLanes,w|=Xh,Te(t,s,w,D,j,X),t===Ct&&(Je=Ct=null,nt=0),$a=i,rs=t,Ar=s,sf=w,af=_,i0=l,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,q2(nn,function(){return b0(),null})):(t.callbackNode=null,t.callbackPriority=0),l=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||l){l=q.T,q.T=null,_=W.p,W.p=2,D=ht,ht|=4;try{O2(t,i,s)}finally{ht=D,W.p=_,q.T=l}}fn=1,g0(),m0(),_0()}}function g0(){if(fn===1){fn=0;var t=rs,i=$a,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=q.T,q.T=null;var l=W.p;W.p=2;var _=ht;ht|=4;try{Yv(i,t);var w=Sf,D=t_(t.containerInfo),j=w.focusedElem,X=w.selectionRange;if(D!==j&&j&&j.ownerDocument&&e_(j.ownerDocument.documentElement,j)){if(X!==null&&Wh(j)){var re=X.start,ue=X.end;if(ue===void 0&&(ue=re),"selectionStart"in j)j.selectionStart=re,j.selectionEnd=Math.min(ue,j.value.length);else{var fe=j.ownerDocument||document,se=fe&&fe.defaultView||window;if(se.getSelection){var le=se.getSelection(),ke=j.textContent.length,$e=Math.min(X.start,ke),yt=X.end===void 0?$e:Math.min(X.end,ke);!le.extend&&$e>yt&&(D=yt,yt=$e,$e=D);var ne=Qm(j,$e),ee=Qm(j,yt);if(ne&&ee&&(le.rangeCount!==1||le.anchorNode!==ne.node||le.anchorOffset!==ne.offset||le.focusNode!==ee.node||le.focusOffset!==ee.offset)){var ie=fe.createRange();ie.setStart(ne.node,ne.offset),le.removeAllRanges(),$e>yt?(le.addRange(ie),le.extend(ee.node,ee.offset)):(ie.setEnd(ee.node,ee.offset),le.addRange(ie))}}}}for(fe=[],le=j;le=le.parentNode;)le.nodeType===1&&fe.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<fe.length;j++){var de=fe[j];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}ou=!!yf,Sf=yf=null}finally{ht=_,W.p=l,q.T=s}}t.current=i,fn=2}}function m0(){if(fn===2){fn=0;var t=rs,i=$a,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=q.T,q.T=null;var l=W.p;W.p=2;var _=ht;ht|=4;try{qv(t,i.alternate,i)}finally{ht=_,W.p=l,q.T=s}}fn=3}}function _0(){if(fn===4||fn===3){fn=0,tn();var t=rs,i=$a,s=Ar,l=i0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?fn=5:(fn=0,$a=rs=null,v0(t,t.pendingLanes));var _=t.pendingLanes;if(_===0&&(is=null),Sn(s),i=i.stateNode,Yt&&typeof Yt.onCommitFiberRoot=="function")try{Yt.onCommitFiberRoot(Hn,i,void 0,(i.current.flags&128)===128)}catch{}if(l!==null){i=q.T,_=W.p,W.p=2,q.T=null;try{for(var w=t.onRecoverableError,D=0;D<l.length;D++){var j=l[D];w(j.value,{componentStack:j.stack})}}finally{q.T=i,W.p=_}}(Ar&3)!==0&&Yc(),Ji(t),_=t.pendingLanes,(s&261930)!==0&&(_&42)!==0?t===of?nl++:(nl=0,of=t):nl=0,il(0)}}function v0(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,jo(i)))}function Yc(){return g0(),m0(),_0(),b0()}function b0(){if(fn!==5)return!1;var t=rs,i=sf;sf=0;var s=Sn(Ar),l=q.T,_=W.p;try{W.p=32>s?32:s,q.T=null,s=af,af=null;var w=rs,D=Ar;if(fn=0,$a=rs=null,Ar=0,(ht&6)!==0)throw Error(a(331));var j=ht;if(ht|=4,e0(w.current),Zv(w,w.current,D,s),ht=j,il(0,!1),Yt&&typeof Yt.onPostCommitFiberRoot=="function")try{Yt.onPostCommitFiberRoot(Hn,w)}catch{}return!0}finally{W.p=_,q.T=l,v0(t,i)}}function y0(t,i,s){i=vi(s,i),i=$d(t.stateNode,i,2),t=Zr(t,i,2),t!==null&&(ft(t,2),Ji(t))}function mt(t,i,s){if(t.tag===3)y0(t,t,s);else for(;i!==null;){if(i.tag===3){y0(i,t,s);break}else if(i.tag===1){var l=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(is===null||!is.has(l))){t=vi(s,t),s=Sv(2),l=Zr(i,s,2),l!==null&&(wv(s,l,i,t),ft(l,2),Ji(l));break}}i=i.return}}function uf(t,i,s){var l=t.pingCache;if(l===null){l=t.pingCache=new B2;var _=new Set;l.set(i,_)}else _=l.get(i),_===void 0&&(_=new Set,l.set(i,_));_.has(s)||(tf=!0,_.add(s),t=H2.bind(null,t,i,s),i.then(t,t))}function H2(t,i,s){var l=t.pingCache;l!==null&&l.delete(i),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,Ct===t&&(nt&s)===s&&(qt===4||qt===3&&(nt&62914560)===nt&&300>ut()-Fc?(ht&2)===0&&za(t,0):nf|=s,ja===nt&&(ja=0)),Ji(t)}function S0(t,i){i===0&&(i=Be()),t=Os(t,i),t!==null&&(ft(t,i),Ji(t))}function U2(t){var i=t.memoizedState,s=0;i!==null&&(s=i.retryLane),S0(t,s)}function F2(t,i){var s=0;switch(t.tag){case 31:case 13:var l=t.stateNode,_=t.memoizedState;_!==null&&(s=_.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(a(314))}l!==null&&l.delete(i),S0(t,s)}function q2(t,i){return yn(t,i)}var Xc=null,Ha=null,hf=!1,Zc=!1,df=!1,as=0;function Ji(t){t!==Ha&&t.next===null&&(Ha===null?Xc=Ha=t:Ha=Ha.next=t),Zc=!0,hf||(hf=!0,G2())}function il(t,i){if(!df&&Zc){df=!0;do for(var s=!1,l=Xc;l!==null;){if(t!==0){var _=l.pendingLanes;if(_===0)var w=0;else{var D=l.suspendedLanes,j=l.pingedLanes;w=(1<<31-Pt(42|t)+1)-1,w&=_&~(D&~j),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(s=!0,E0(l,w))}else w=nt,w=J(l,l===Ct?w:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(w&3)===0||he(l,w)||(s=!0,E0(l,w));l=l.next}while(s);df=!1}}function W2(){w0()}function w0(){Zc=hf=!1;var t=0;as!==0&&nE()&&(t=as);for(var i=ut(),s=null,l=Xc;l!==null;){var _=l.next,w=C0(l,i);w===0?(l.next=null,s===null?Xc=_:s.next=_,_===null&&(Ha=s)):(s=l,(t!==0||(w&3)!==0)&&(Zc=!0)),l=_}fn!==0&&fn!==5||il(t),as!==0&&(as=0)}function C0(t,i){for(var s=t.suspendedLanes,l=t.pingedLanes,_=t.expirationTimes,w=t.pendingLanes&-62914561;0<w;){var D=31-Pt(w),j=1<<D,X=_[D];X===-1?((j&s)===0||(j&l)!==0)&&(_[D]=be(j,i)):X<=i&&(t.expiredLanes|=j),w&=~j}if(i=Ct,s=nt,s=J(t,t===i?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,s===0||t===i&&(gt===2||gt===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&gi(l),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||he(t,s)){if(i=s&-s,i===t.callbackPriority)return i;switch(l!==null&&gi(l),Sn(s)){case 2:case 8:s=zt;break;case 32:s=nn;break;case 268435456:s=Mn;break;default:s=nn}return l=x0.bind(null,t),s=yn(s,l),t.callbackPriority=i,t.callbackNode=s,i}return l!==null&&l!==null&&gi(l),t.callbackPriority=2,t.callbackNode=null,2}function x0(t,i){if(fn!==0&&fn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(Yc()&&t.callbackNode!==s)return null;var l=nt;return l=J(t,t===Ct?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(s0(t,l,i),C0(t,ut()),t.callbackNode!=null&&t.callbackNode===s?x0.bind(null,t):null)}function E0(t,i){if(Yc())return null;s0(t,i,!0)}function G2(){rE(function(){(ht&6)!==0?yn($t,W2):w0()})}function ff(){if(as===0){var t=Ta;t===0&&(t=Ii,Ii<<=1,(Ii&261888)===0&&(Ii=256)),as=t}return as}function T0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Fr(""+t)}function k0(t,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,t.id&&s.setAttribute("form",t.id),i.parentNode.insertBefore(s,i),t=new FormData(t),s.parentNode.removeChild(s),t}function K2(t,i,s,l,_){if(i==="submit"&&s&&s.stateNode===_){var w=T0((_[Et]||null).action),D=l.submitter;D&&(i=(i=D[Et]||null)?T0(i.formAction):D.getAttribute("formAction"),i!==null&&(w=i,D=null));var j=new cc("action","action",null,l,_);t.push({event:j,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(as!==0){var X=D?k0(_,D):new FormData(_);Dd(s,{pending:!0,data:X,method:_.method,action:w},null,X)}}else typeof w=="function"&&(j.preventDefault(),X=D?k0(_,D):new FormData(_),Dd(s,{pending:!0,data:X,method:_.method,action:w},w,X))},currentTarget:_}]})}}for(var pf=0;pf<Yh.length;pf++){var gf=Yh[pf],V2=gf.toLowerCase(),Y2=gf[0].toUpperCase()+gf.slice(1);ji(V2,"on"+Y2)}ji(r_,"onAnimationEnd"),ji(s_,"onAnimationIteration"),ji(a_,"onAnimationStart"),ji("dblclick","onDoubleClick"),ji("focusin","onFocus"),ji("focusout","onBlur"),ji(h2,"onTransitionRun"),ji(d2,"onTransitionStart"),ji(f2,"onTransitionCancel"),ji(o_,"onTransitionEnd"),me("onMouseEnter",["mouseout","mouseover"]),me("onMouseLeave",["mouseout","mouseover"]),me("onPointerEnter",["pointerout","pointerover"]),me("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 rl="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(" "),X2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(rl));function A0(t,i){i=(i&4)!==0;for(var s=0;s<t.length;s++){var l=t[s],_=l.event;l=l.listeners;e:{var w=void 0;if(i)for(var D=l.length-1;0<=D;D--){var j=l[D],X=j.instance,re=j.currentTarget;if(j=j.listener,X!==w&&_.isPropagationStopped())break e;w=j,_.currentTarget=re;try{w(_)}catch(ue){dc(ue)}_.currentTarget=null,w=X}else for(D=0;D<l.length;D++){if(j=l[D],X=j.instance,re=j.currentTarget,j=j.listener,X!==w&&_.isPropagationStopped())break e;w=j,_.currentTarget=re;try{w(_)}catch(ue){dc(ue)}_.currentTarget=null,w=X}}}}function Qe(t,i){var s=i[Hr];s===void 0&&(s=i[Hr]=new Set);var l=t+"__bubble";s.has(l)||(R0(i,t,2,!1),s.add(l))}function mf(t,i,s){var l=0;i&&(l|=4),R0(s,t,l,i)}var Jc="_reactListening"+Math.random().toString(36).slice(2);function _f(t){if(!t[Jc]){t[Jc]=!0,At.forEach(function(s){s!=="selectionchange"&&(X2.has(s)||mf(s,!1,t),mf(s,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[Jc]||(i[Jc]=!0,mf("selectionchange",!1,i))}}function R0(t,i,s,l){switch(rb(i)){case 2:var _=xE;break;case 8:_=EE;break;default:_=Df}s=_.bind(null,i,s,t),_=void 0,!Bh||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(_=!0),l?_!==void 0?t.addEventListener(i,s,{capture:!0,passive:_}):t.addEventListener(i,s,!0):_!==void 0?t.addEventListener(i,s,{passive:_}):t.addEventListener(i,s,!1)}function vf(t,i,s,l,_){var w=l;if((i&1)===0&&(i&2)===0&&l!==null)e:for(;;){if(l===null)return;var D=l.tag;if(D===3||D===4){var j=l.stateNode.containerInfo;if(j===_)break;if(D===4)for(D=l.return;D!==null;){var X=D.tag;if((X===3||X===4)&&D.stateNode.containerInfo===_)return;D=D.return}for(;j!==null;){if(D=V(j),D===null)return;if(X=D.tag,X===5||X===6||X===26||X===27){l=w=D;continue e}j=j.parentNode}}l=l.return}sc(function(){var re=w,ue=qe(s),fe=[];e:{var se=l_.get(t);if(se!==void 0){var le=cc,ke=t;switch(t){case"keypress":if(oc(s)===0)break e;case"keydown":case"keyup":le=Fx;break;case"focusin":ke="focus",le=Ph;break;case"focusout":ke="blur",le=Ph;break;case"beforeblur":case"afterblur":le=Ph;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":le=jm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=Mx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=Gx;break;case r_:case s_:case a_:le=Nx;break;case o_:le=Vx;break;case"scroll":case"scrollend":le=Rx;break;case"wheel":le=Xx;break;case"copy":case"cut":case"paste":le=Bx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=zm;break;case"toggle":case"beforetoggle":le=Jx}var $e=(i&4)!==0,yt=!$e&&(t==="scroll"||t==="scrollend"),ne=$e?se!==null?se+"Capture":null:se;$e=[];for(var ee=re,ie;ee!==null;){var de=ee;if(ie=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||ie===null||ne===null||(de=To(ee,ne),de!=null&&$e.push(sl(ee,de,ie))),yt)break;ee=ee.return}0<$e.length&&(se=new le(se,ke,null,s,ue),fe.push({event:se,listeners:$e}))}}if((i&7)===0){e:{if(se=t==="mouseover"||t==="pointerover",le=t==="mouseout"||t==="pointerout",se&&s!==Re&&(ke=s.relatedTarget||s.fromElement)&&(V(ke)||ke[Bi]))break e;if((le||se)&&(se=ue.window===ue?ue:(se=ue.ownerDocument)?se.defaultView||se.parentWindow:window,le?(ke=s.relatedTarget||s.toElement,le=re,ke=ke?V(ke):null,ke!==null&&(yt=v(ke),$e=ke.tag,ke!==yt||$e!==5&&$e!==27&&$e!==6)&&(ke=null)):(le=null,ke=re),le!==ke)){if($e=jm,de="onMouseLeave",ne="onMouseEnter",ee="mouse",(t==="pointerout"||t==="pointerover")&&($e=zm,de="onPointerLeave",ne="onPointerEnter",ee="pointer"),yt=le==null?se:xe(le),ie=ke==null?se:xe(ke),se=new $e(de,ee+"leave",le,s,ue),se.target=yt,se.relatedTarget=ie,de=null,V(ue)===re&&($e=new $e(ne,ee+"enter",ke,s,ue),$e.target=ie,$e.relatedTarget=yt,de=$e),yt=de,le&&ke)t:{for($e=Z2,ne=le,ee=ke,ie=0,de=ne;de;de=$e(de))ie++;de=0;for(var Ie=ee;Ie;Ie=$e(Ie))de++;for(;0<ie-de;)ne=$e(ne),ie--;for(;0<de-ie;)ee=$e(ee),de--;for(;ie--;){if(ne===ee||ee!==null&&ne===ee.alternate){$e=ne;break t}ne=$e(ne),ee=$e(ee)}$e=null}else $e=null;le!==null&&L0(fe,se,le,$e,!1),ke!==null&&yt!==null&&L0(fe,yt,ke,$e,!0)}}e:{if(se=re?xe(re):window,le=se.nodeName&&se.nodeName.toLowerCase(),le==="select"||le==="input"&&se.type==="file")var ot=Km;else if(Wm(se))if(Vm)ot=l2;else{ot=a2;var Le=s2}else le=se.nodeName,!le||le.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?re&&Ur(re.elementType)&&(ot=Km):ot=o2;if(ot&&(ot=ot(t,re))){Gm(fe,ot,s,ue);break e}Le&&Le(t,se,re),t==="focusout"&&re&&se.type==="number"&&re.memoizedProps.value!=null&&ga(se,"number",se.value)}switch(Le=re?xe(re):window,t){case"focusin":(Wm(Le)||Le.contentEditable==="true")&&(va=Le,Gh=re,No=null);break;case"focusout":No=Gh=va=null;break;case"mousedown":Kh=!0;break;case"contextmenu":case"mouseup":case"dragend":Kh=!1,n_(fe,s,ue);break;case"selectionchange":if(u2)break;case"keydown":case"keyup":n_(fe,s,ue)}var Ke;if(Uh)e:{switch(t){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else _a?Fm(t,s)&&(it="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(it="onCompositionStart");it&&(Pm&&s.locale!=="ko"&&(_a||it!=="onCompositionStart"?it==="onCompositionEnd"&&_a&&(Ke=Im()):(qr=ue,jh="value"in qr?qr.value:qr.textContent,_a=!0)),Le=Qc(re,it),0<Le.length&&(it=new $m(it,t,null,s,ue),fe.push({event:it,listeners:Le}),Ke?it.data=Ke:(Ke=qm(s),Ke!==null&&(it.data=Ke)))),(Ke=e2?t2(t,s):n2(t,s))&&(it=Qc(re,"onBeforeInput"),0<it.length&&(Le=new $m("onBeforeInput","beforeinput",null,s,ue),fe.push({event:Le,listeners:it}),Le.data=Ke)),K2(fe,t,re,s,ue)}A0(fe,i)})}function sl(t,i,s){return{instance:t,listener:i,currentTarget:s}}function Qc(t,i){for(var s=i+"Capture",l=[];t!==null;){var _=t,w=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||w===null||(_=To(t,s),_!=null&&l.unshift(sl(t,_,w)),_=To(t,i),_!=null&&l.push(sl(t,_,w))),t.tag===3)return l;t=t.return}return[]}function Z2(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function L0(t,i,s,l,_){for(var w=i._reactName,D=[];s!==null&&s!==l;){var j=s,X=j.alternate,re=j.stateNode;if(j=j.tag,X!==null&&X===l)break;j!==5&&j!==26&&j!==27||re===null||(X=re,_?(re=To(s,w),re!=null&&D.unshift(sl(s,re,X))):_||(re=To(s,w),re!=null&&D.push(sl(s,re,X)))),s=s.return}D.length!==0&&t.push({event:i,listeners:D})}var J2=/\r\n?/g,Q2=/\u0000|\uFFFD/g;function M0(t){return(typeof t=="string"?t:""+t).replace(J2,`
9
- `).replace(Q2,"")}function D0(t,i){return i=M0(i),M0(t)===i}function bt(t,i,s,l,_,w){switch(s){case"children":typeof l=="string"?i==="body"||i==="textarea"&&l===""||He(t,l):(typeof l=="number"||typeof l=="bigint")&&i!=="body"&&He(t,""+l);break;case"className":ri(t,"class",l);break;case"tabIndex":ri(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ri(t,s,l);break;case"style":pt(t,l,w);break;case"data":if(i!=="object"){ri(t,"data",l);break}case"src":case"href":if(l===""&&(i!=="a"||s!=="href")){t.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(s);break}l=Fr(""+l),t.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="function"){t.setAttribute(s,"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 w=="function"&&(s==="formAction"?(i!=="input"&&bt(t,i,"name",_.name,_,null),bt(t,i,"formEncType",_.formEncType,_,null),bt(t,i,"formMethod",_.formMethod,_,null),bt(t,i,"formTarget",_.formTarget,_,null)):(bt(t,i,"encType",_.encType,_,null),bt(t,i,"method",_.method,_,null),bt(t,i,"target",_.target,_,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(s);break}l=Fr(""+l),t.setAttribute(s,l);break;case"onClick":l!=null&&(t.onclick=we);break;case"onScroll":l!=null&&Qe("scroll",t);break;case"onScrollEnd":l!=null&&Qe("scrollend",t);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(s=l.__html,s!=null){if(_.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"multiple":t.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":t.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){t.removeAttribute("xlink:href");break}s=Fr(""+l),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(s,""+l):t.removeAttribute(s);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":l&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":l===!0?t.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(s,l):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(s,l):t.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(s):t.setAttribute(s,l);break;case"popover":Qe("beforetoggle",t),Qe("toggle",t),Dn(t,"popover",l);break;case"xlinkActuate":Fn(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Fn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Fn(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Fn(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Fn(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Fn(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Fn(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Fn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Fn(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Dn(t,"is",l);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=fr.get(s)||s,Dn(t,s,l))}}function bf(t,i,s,l,_,w){switch(s){case"style":pt(t,l,w);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(s=l.__html,s!=null){if(_.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"children":typeof l=="string"?He(t,l):(typeof l=="number"||typeof l=="bigint")&&He(t,""+l);break;case"onScroll":l!=null&&Qe("scroll",t);break;case"onScrollEnd":l!=null&&Qe("scrollend",t);break;case"onClick":l!=null&&(t.onclick=we);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ht.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(_=s.endsWith("Capture"),i=s.slice(2,_?s.length-7:void 0),w=t[Et]||null,w=w!=null?w[s]:null,typeof w=="function"&&t.removeEventListener(i,w,_),typeof l=="function")){typeof w!="function"&&w!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(i,l,_);break e}s in t?t[s]=l:l===!0?t.setAttribute(s,""):Dn(t,s,l)}}}function Tn(t,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",t),Qe("load",t);var l=!1,_=!1,w;for(w in s)if(s.hasOwnProperty(w)){var D=s[w];if(D!=null)switch(w){case"src":l=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:bt(t,i,w,D,s,null)}}_&&bt(t,i,"srcSet",s.srcSet,s,null),l&&bt(t,i,"src",s.src,s,null);return;case"input":Qe("invalid",t);var j=w=D=_=null,X=null,re=null;for(l in s)if(s.hasOwnProperty(l)){var ue=s[l];if(ue!=null)switch(l){case"name":_=ue;break;case"type":D=ue;break;case"checked":X=ue;break;case"defaultChecked":re=ue;break;case"value":w=ue;break;case"defaultValue":j=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(a(137,i));break;default:bt(t,i,l,ue,s,null)}}Rs(t,w,j,X,re,D,_,!1);return;case"select":Qe("invalid",t),l=D=w=null;for(_ in s)if(s.hasOwnProperty(_)&&(j=s[_],j!=null))switch(_){case"value":w=j;break;case"defaultValue":D=j;break;case"multiple":l=j;default:bt(t,i,_,j,s,null)}i=w,s=D,t.multiple=!!l,i!=null?wn(t,!!l,i,!1):s!=null&&wn(t,!!l,s,!0);return;case"textarea":Qe("invalid",t),w=_=l=null;for(D in s)if(s.hasOwnProperty(D)&&(j=s[D],j!=null))switch(D){case"value":l=j;break;case"defaultValue":_=j;break;case"children":w=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(a(91));break;default:bt(t,i,D,j,s,null)}ma(t,l,_,w);return;case"option":for(X in s)s.hasOwnProperty(X)&&(l=s[X],l!=null)&&(X==="selected"?t.selected=l&&typeof l!="function"&&typeof l!="symbol":bt(t,i,X,l,s,null));return;case"dialog":Qe("beforetoggle",t),Qe("toggle",t),Qe("cancel",t),Qe("close",t);break;case"iframe":case"object":Qe("load",t);break;case"video":case"audio":for(l=0;l<rl.length;l++)Qe(rl[l],t);break;case"image":Qe("error",t),Qe("load",t);break;case"details":Qe("toggle",t);break;case"embed":case"source":case"link":Qe("error",t),Qe("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(re in s)if(s.hasOwnProperty(re)&&(l=s[re],l!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:bt(t,i,re,l,s,null)}return;default:if(Ur(i)){for(ue in s)s.hasOwnProperty(ue)&&(l=s[ue],l!==void 0&&bf(t,i,ue,l,s,void 0));return}}for(j in s)s.hasOwnProperty(j)&&(l=s[j],l!=null&&bt(t,i,j,l,s,null))}function eE(t,i,s,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,w=null,D=null,j=null,X=null,re=null,ue=null;for(le in s){var fe=s[le];if(s.hasOwnProperty(le)&&fe!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":X=fe;default:l.hasOwnProperty(le)||bt(t,i,le,null,l,fe)}}for(var se in l){var le=l[se];if(fe=s[se],l.hasOwnProperty(se)&&(le!=null||fe!=null))switch(se){case"type":w=le;break;case"name":_=le;break;case"checked":re=le;break;case"defaultChecked":ue=le;break;case"value":D=le;break;case"defaultValue":j=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(a(137,i));break;default:le!==fe&&bt(t,i,se,le,l,fe)}}Co(t,D,j,X,re,ue,w,_);return;case"select":le=D=j=se=null;for(w in s)if(X=s[w],s.hasOwnProperty(w)&&X!=null)switch(w){case"value":break;case"multiple":le=X;default:l.hasOwnProperty(w)||bt(t,i,w,null,l,X)}for(_ in l)if(w=l[_],X=s[_],l.hasOwnProperty(_)&&(w!=null||X!=null))switch(_){case"value":se=w;break;case"defaultValue":j=w;break;case"multiple":D=w;default:w!==X&&bt(t,i,_,w,l,X)}i=j,s=D,l=le,se!=null?wn(t,!!s,se,!1):!!l!=!!s&&(i!=null?wn(t,!!s,i,!0):wn(t,!!s,s?[]:"",!1));return;case"textarea":le=se=null;for(j in s)if(_=s[j],s.hasOwnProperty(j)&&_!=null&&!l.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:bt(t,i,j,null,l,_)}for(D in l)if(_=l[D],w=s[D],l.hasOwnProperty(D)&&(_!=null||w!=null))switch(D){case"value":se=_;break;case"defaultValue":le=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:_!==w&&bt(t,i,D,_,l,w)}ic(t,se,le);return;case"option":for(var ke in s)se=s[ke],s.hasOwnProperty(ke)&&se!=null&&!l.hasOwnProperty(ke)&&(ke==="selected"?t.selected=!1:bt(t,i,ke,null,l,se));for(X in l)se=l[X],le=s[X],l.hasOwnProperty(X)&&se!==le&&(se!=null||le!=null)&&(X==="selected"?t.selected=se&&typeof se!="function"&&typeof se!="symbol":bt(t,i,X,se,l,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 $e in s)se=s[$e],s.hasOwnProperty($e)&&se!=null&&!l.hasOwnProperty($e)&&bt(t,i,$e,null,l,se);for(re in l)if(se=l[re],le=s[re],l.hasOwnProperty(re)&&se!==le&&(se!=null||le!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(a(137,i));break;default:bt(t,i,re,se,l,le)}return;default:if(Ur(i)){for(var yt in s)se=s[yt],s.hasOwnProperty(yt)&&se!==void 0&&!l.hasOwnProperty(yt)&&bf(t,i,yt,void 0,l,se);for(ue in l)se=l[ue],le=s[ue],!l.hasOwnProperty(ue)||se===le||se===void 0&&le===void 0||bf(t,i,ue,se,l,le);return}}for(var ne in s)se=s[ne],s.hasOwnProperty(ne)&&se!=null&&!l.hasOwnProperty(ne)&&bt(t,i,ne,null,l,se);for(fe in l)se=l[fe],le=s[fe],!l.hasOwnProperty(fe)||se===le||se==null&&le==null||bt(t,i,fe,se,l,le)}function O0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function tE(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var _=s[l],w=_.transferSize,D=_.initiatorType,j=_.duration;if(w&&j&&O0(D)){for(D=0,j=_.responseEnd,l+=1;l<s.length;l++){var X=s[l],re=X.startTime;if(re>j)break;var ue=X.transferSize,fe=X.initiatorType;ue&&O0(fe)&&(X=X.responseEnd,D+=ue*(X<j?1:(j-re)/(X-re)))}if(--l,i+=8*(w+D)/(_.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var yf=null,Sf=null;function eu(t){return t.nodeType===9?t:t.ownerDocument}function N0(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function I0(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function wf(t,i){return t==="textarea"||t==="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 Cf=null;function nE(){var t=window.event;return t&&t.type==="popstate"?t===Cf?!1:(Cf=t,!0):(Cf=null,!1)}var B0=typeof setTimeout=="function"?setTimeout:void 0,iE=typeof clearTimeout=="function"?clearTimeout:void 0,j0=typeof Promise=="function"?Promise:void 0,rE=typeof queueMicrotask=="function"?queueMicrotask:typeof j0<"u"?function(t){return j0.resolve(null).then(t).catch(sE)}:B0;function sE(t){setTimeout(function(){throw t})}function os(t){return t==="head"}function $0(t,i){var s=i,l=0;do{var _=s.nextSibling;if(t.removeChild(s),_&&_.nodeType===8)if(s=_.data,s==="/$"||s==="/&"){if(l===0){t.removeChild(_),Wa(i);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")al(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,al(s);for(var w=s.firstChild;w;){var D=w.nextSibling,j=w.nodeName;w[Vi]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&w.rel.toLowerCase()==="stylesheet"||s.removeChild(w),w=D}}else s==="body"&&al(t.ownerDocument.body);s=_}while(s);Wa(i)}function z0(t,i){var s=t;t=0;do{var l=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=l}while(s)}function xf(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":xf(s),De(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function aE(t,i,s,l){for(;t.nodeType===1;){var _=s;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[Vi])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(w=t.getAttribute("rel"),w==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(w!==_.rel||t.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||t.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||t.getAttribute("title")!==(_.title==null?null:_.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(w=t.getAttribute("src"),(w!==(_.src==null?null:_.src)||t.getAttribute("type")!==(_.type==null?null:_.type)||t.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&w&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var w=_.name==null?null:""+_.name;if(_.type==="hidden"&&t.getAttribute("name")===w)return t}else return t;if(t=Ci(t.nextSibling),t===null)break}return null}function oE(t,i,s){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=Ci(t.nextSibling),t===null))return null;return t}function P0(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=Ci(t.nextSibling),t===null))return null;return t}function Ef(t){return t.data==="$?"||t.data==="$~"}function Tf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function lE(t,i){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||s.readyState!=="loading")i();else{var l=function(){i(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function Ci(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var kf=null;function H0(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(i===0)return Ci(t.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}t=t.nextSibling}return null}function U0(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return t;i--}else s!=="/$"&&s!=="/&"||i++}t=t.previousSibling}return null}function F0(t,i,s){switch(i=eu(s),t){case"html":if(t=i.documentElement,!t)throw Error(a(452));return t;case"head":if(t=i.head,!t)throw Error(a(453));return t;case"body":if(t=i.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function al(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);De(t)}var xi=new Map,q0=new Set;function tu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Rr=W.d;W.d={f:cE,r:uE,D:hE,C:dE,L:fE,m:pE,X:mE,S:gE,M:_E};function cE(){var t=Rr.f(),i=Gc();return t||i}function uE(t){var i=pe(t);i!==null&&i.tag===5&&i.type==="form"?ov(i):Rr.r(t)}var Ua=typeof document>"u"?null:document;function W0(t,i,s){var l=Ua;if(l&&typeof i=="string"&&i){var _=qn(i);_='link[rel="'+t+'"][href="'+_+'"]',typeof s=="string"&&(_+='[crossorigin="'+s+'"]'),q0.has(_)||(q0.add(_),t={rel:t,crossOrigin:s,href:i},l.querySelector(_)===null&&(i=l.createElement("link"),Tn(i,"link",t),Ze(i),l.head.appendChild(i)))}}function hE(t){Rr.D(t),W0("dns-prefetch",t,null)}function dE(t,i){Rr.C(t,i),W0("preconnect",t,i)}function fE(t,i,s){Rr.L(t,i,s);var l=Ua;if(l&&t&&i){var _='link[rel="preload"][as="'+qn(i)+'"]';i==="image"&&s&&s.imageSrcSet?(_+='[imagesrcset="'+qn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(_+='[imagesizes="'+qn(s.imageSizes)+'"]')):_+='[href="'+qn(t)+'"]';var w=_;switch(i){case"style":w=Fa(t);break;case"script":w=qa(t)}xi.has(w)||(t=f({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:t,as:i},s),xi.set(w,t),l.querySelector(_)!==null||i==="style"&&l.querySelector(ol(w))||i==="script"&&l.querySelector(ll(w))||(i=l.createElement("link"),Tn(i,"link",t),Ze(i),l.head.appendChild(i)))}}function pE(t,i){Rr.m(t,i);var s=Ua;if(s&&t){var l=i&&typeof i.as=="string"?i.as:"script",_='link[rel="modulepreload"][as="'+qn(l)+'"][href="'+qn(t)+'"]',w=_;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=qa(t)}if(!xi.has(w)&&(t=f({rel:"modulepreload",href:t},i),xi.set(w,t),s.querySelector(_)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(ll(w)))return}l=s.createElement("link"),Tn(l,"link",t),Ze(l),s.head.appendChild(l)}}}function gE(t,i,s){Rr.S(t,i,s);var l=Ua;if(l&&t){var _=rt(l).hoistableStyles,w=Fa(t);i=i||"default";var D=_.get(w);if(!D){var j={loading:0,preload:null};if(D=l.querySelector(ol(w)))j.loading=5;else{t=f({rel:"stylesheet",href:t,"data-precedence":i},s),(s=xi.get(w))&&Af(t,s);var X=D=l.createElement("link");Ze(X),Tn(X,"link",t),X._p=new Promise(function(re,ue){X.onload=re,X.onerror=ue}),X.addEventListener("load",function(){j.loading|=1}),X.addEventListener("error",function(){j.loading|=2}),j.loading|=4,nu(D,i,l)}D={type:"stylesheet",instance:D,count:1,state:j},_.set(w,D)}}}function mE(t,i){Rr.X(t,i);var s=Ua;if(s&&t){var l=rt(s).hoistableScripts,_=qa(t),w=l.get(_);w||(w=s.querySelector(ll(_)),w||(t=f({src:t,async:!0},i),(i=xi.get(_))&&Rf(t,i),w=s.createElement("script"),Ze(w),Tn(w,"link",t),s.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},l.set(_,w))}}function _E(t,i){Rr.M(t,i);var s=Ua;if(s&&t){var l=rt(s).hoistableScripts,_=qa(t),w=l.get(_);w||(w=s.querySelector(ll(_)),w||(t=f({src:t,async:!0,type:"module"},i),(i=xi.get(_))&&Rf(t,i),w=s.createElement("script"),Ze(w),Tn(w,"link",t),s.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},l.set(_,w))}}function G0(t,i,s,l){var _=(_=_e.current)?tu(_):null;if(!_)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=Fa(s.href),s=rt(_).hoistableStyles,l=s.get(i),l||(l={type:"style",instance:null,count:0,state:null},s.set(i,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Fa(s.href);var w=rt(_).hoistableStyles,D=w.get(t);if(D||(_=_.ownerDocument||_,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(t,D),(w=_.querySelector(ol(t)))&&!w._p&&(D.instance=w,D.state.loading=5),xi.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},xi.set(t,s),w||vE(_,t,s,D.state))),i&&l===null)throw Error(a(528,""));return D}if(i&&l!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=qa(s),s=rt(_).hoistableScripts,l=s.get(i),l||(l={type:"script",instance:null,count:0,state:null},s.set(i,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function Fa(t){return'href="'+qn(t)+'"'}function ol(t){return'link[rel="stylesheet"]['+t+"]"}function K0(t){return f({},t,{"data-precedence":t.precedence,precedence:null})}function vE(t,i,s,l){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?l.loading=1:(i=t.createElement("link"),l.preload=i,i.addEventListener("load",function(){return l.loading|=1}),i.addEventListener("error",function(){return l.loading|=2}),Tn(i,"link",s),Ze(i),t.head.appendChild(i))}function qa(t){return'[src="'+qn(t)+'"]'}function ll(t){return"script[async]"+t}function V0(t,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var l=t.querySelector('style[data-href~="'+qn(s.href)+'"]');if(l)return i.instance=l,Ze(l),l;var _=f({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Ze(l),Tn(l,"style",_),nu(l,s.precedence,t),i.instance=l;case"stylesheet":_=Fa(s.href);var w=t.querySelector(ol(_));if(w)return i.state.loading|=4,i.instance=w,Ze(w),w;l=K0(s),(_=xi.get(_))&&Af(l,_),w=(t.ownerDocument||t).createElement("link"),Ze(w);var D=w;return D._p=new Promise(function(j,X){D.onload=j,D.onerror=X}),Tn(w,"link",l),i.state.loading|=4,nu(w,s.precedence,t),i.instance=w;case"script":return w=qa(s.src),(_=t.querySelector(ll(w)))?(i.instance=_,Ze(_),_):(l=s,(_=xi.get(w))&&(l=f({},s),Rf(l,_)),t=t.ownerDocument||t,_=t.createElement("script"),Ze(_),Tn(_,"link",l),t.head.appendChild(_),i.instance=_);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(l=i.instance,i.state.loading|=4,nu(l,s.precedence,t));return i.instance}function nu(t,i,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=l.length?l[l.length-1]:null,w=_,D=0;D<l.length;D++){var j=l[D];if(j.dataset.precedence===i)w=j;else if(w!==_)break}w?w.parentNode.insertBefore(t,w.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(t,i.firstChild))}function Af(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function Rf(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var iu=null;function Y0(t,i,s){if(iu===null){var l=new Map,_=iu=new Map;_.set(s,l)}else _=iu,l=_.get(s),l||(l=new Map,_.set(s,l));if(l.has(t))return l;for(l.set(t,null),s=s.getElementsByTagName(t),_=0;_<s.length;_++){var w=s[_];if(!(w[Vi]||w[kt]||t==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var D=w.getAttribute(i)||"";D=t+D;var j=l.get(D);j?j.push(w):l.set(D,[w])}}return l}function X0(t,i,s){t=t.ownerDocument||t,t.head.insertBefore(s,i==="title"?t.querySelector("head > title"):null)}function bE(t,i,s){if(s===1||i.itemProp!=null)return!1;switch(t){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"?(t=i.disabled,typeof i.precedence=="string"&&t==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 Z0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function yE(t,i,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var _=Fa(l.href),w=i.querySelector(ol(_));if(w){i=w._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=ru.bind(t),i.then(t,t)),s.state.loading|=4,s.instance=w,Ze(w);return}w=i.ownerDocument||i,l=K0(l),(_=xi.get(_))&&Af(l,_),w=w.createElement("link"),Ze(w);var D=w;D._p=new Promise(function(j,X){D.onload=j,D.onerror=X}),Tn(w,"link",l),s.instance=w}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=ru.bind(t),i.addEventListener("load",s),i.addEventListener("error",s))}}var Lf=0;function SE(t,i){return t.stylesheets&&t.count===0&&au(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var l=setTimeout(function(){if(t.stylesheets&&au(t,t.stylesheets),t.unsuspend){var w=t.unsuspend;t.unsuspend=null,w()}},6e4+i);0<t.imgBytes&&Lf===0&&(Lf=62500*tE());var _=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&au(t,t.stylesheets),t.unsuspend)){var w=t.unsuspend;t.unsuspend=null,w()}},(t.imgBytes>Lf?50:800)+i);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(_)}}:null}function ru(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)au(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var su=null;function au(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,su=new Map,i.forEach(wE,t),su=null,ru.call(t))}function wE(t,i){if(!(i.state.loading&4)){var s=su.get(t);if(s)var l=s.get(null);else{s=new Map,su.set(t,s);for(var _=t.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<_.length;w++){var D=_[w];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(s.set(D.dataset.precedence,D),l=D)}l&&s.set(null,l)}_=i.instance,D=_.getAttribute("data-precedence"),w=s.get(D)||l,w===l&&s.set(null,_),s.set(D,_),this.count++,l=ru.bind(this),_.addEventListener("load",l),_.addEventListener("error",l),w?w.parentNode.insertBefore(_,w.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(_,t.firstChild)),i.state.loading|=4}}var cl={$$typeof:y,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function CE(t,i,s,l,_,w,D,j,X){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=wt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wt(0),this.hiddenUpdates=wt(null),this.identifierPrefix=l,this.onUncaughtError=_,this.onCaughtError=w,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function J0(t,i,s,l,_,w,D,j,X,re,ue,fe){return t=new CE(t,i,s,D,X,re,ue,fe,j),i=1,w===!0&&(i|=24),w=oi(3,null,null,i),t.current=w,w.stateNode=t,i=ld(),i.refCount++,t.pooledCache=i,i.refCount++,w.memoizedState={element:l,isDehydrated:s,cache:i},dd(w),t}function Q0(t){return t?(t=Sa,t):Sa}function eb(t,i,s,l,_,w){_=Q0(_),l.context===null?l.context=_:l.pendingContext=_,l=Xr(i),l.payload={element:s},w=w===void 0?null:w,w!==null&&(l.callback=w),s=Zr(t,l,i),s!==null&&(Xn(s,t,i),Ho(s,t,i))}function tb(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<i?s:i}}function Mf(t,i){tb(t,i),(t=t.alternate)&&tb(t,i)}function nb(t){if(t.tag===13||t.tag===31){var i=Os(t,67108864);i!==null&&Xn(i,t,67108864),Mf(t,67108864)}}function ib(t){if(t.tag===13||t.tag===31){var i=di();i=et(i);var s=Os(t,i);s!==null&&Xn(s,t,i),Mf(t,i)}}var ou=!0;function xE(t,i,s,l){var _=q.T;q.T=null;var w=W.p;try{W.p=2,Df(t,i,s,l)}finally{W.p=w,q.T=_}}function EE(t,i,s,l){var _=q.T;q.T=null;var w=W.p;try{W.p=8,Df(t,i,s,l)}finally{W.p=w,q.T=_}}function Df(t,i,s,l){if(ou){var _=Of(l);if(_===null)vf(t,i,l,lu,s),sb(t,l);else if(kE(_,t,i,s,l))l.stopPropagation();else if(sb(t,l),i&4&&-1<TE.indexOf(t)){for(;_!==null;){var w=pe(_);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var D=rn(w.pendingLanes);if(D!==0){var j=w;for(j.pendingLanes|=2,j.entangledLanes|=2;D;){var X=1<<31-Pt(D);j.entanglements[1]|=X,D&=~X}Ji(w),(ht&6)===0&&(qc=ut()+500,il(0))}}break;case 31:case 13:j=Os(w,2),j!==null&&Xn(j,w,2),Gc(),Mf(w,2)}if(w=Of(l),w===null&&vf(t,i,l,lu,s),w===_)break;_=w}_!==null&&l.stopPropagation()}else vf(t,i,l,null,s)}}function Of(t){return t=qe(t),Nf(t)}var lu=null;function Nf(t){if(lu=null,t=V(t),t!==null){var i=v(t);if(i===null)t=null;else{var s=i.tag;if(s===13){if(t=m(i),t!==null)return t;t=null}else if(s===31){if(t=c(i),t!==null)return t;t=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return lu=t,null}function rb(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Vt()){case $t:return 2;case zt:return 8;case nn:case Ni:return 32;case Mn:return 268435456;default:return 32}default:return 32}}var If=!1,ls=null,cs=null,us=null,ul=new Map,hl=new Map,hs=[],TE="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 sb(t,i){switch(t){case"focusin":case"focusout":ls=null;break;case"dragenter":case"dragleave":cs=null;break;case"mouseover":case"mouseout":us=null;break;case"pointerover":case"pointerout":ul.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":hl.delete(i.pointerId)}}function dl(t,i,s,l,_,w){return t===null||t.nativeEvent!==w?(t={blockedOn:i,domEventName:s,eventSystemFlags:l,nativeEvent:w,targetContainers:[_]},i!==null&&(i=pe(i),i!==null&&nb(i)),t):(t.eventSystemFlags|=l,i=t.targetContainers,_!==null&&i.indexOf(_)===-1&&i.push(_),t)}function kE(t,i,s,l,_){switch(i){case"focusin":return ls=dl(ls,t,i,s,l,_),!0;case"dragenter":return cs=dl(cs,t,i,s,l,_),!0;case"mouseover":return us=dl(us,t,i,s,l,_),!0;case"pointerover":var w=_.pointerId;return ul.set(w,dl(ul.get(w)||null,t,i,s,l,_)),!0;case"gotpointercapture":return w=_.pointerId,hl.set(w,dl(hl.get(w)||null,t,i,s,l,_)),!0}return!1}function ab(t){var i=V(t.target);if(i!==null){var s=v(i);if(s!==null){if(i=s.tag,i===13){if(i=m(s),i!==null){t.blockedOn=i,hr(t.priority,function(){ib(s)});return}}else if(i===31){if(i=c(s),i!==null){t.blockedOn=i,hr(t.priority,function(){ib(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function cu(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var s=Of(t.nativeEvent);if(s===null){s=t.nativeEvent;var l=new s.constructor(s.type,s);Re=l,s.target.dispatchEvent(l),Re=null}else return i=pe(s),i!==null&&nb(i),t.blockedOn=s,!1;i.shift()}return!0}function ob(t,i,s){cu(t)&&s.delete(i)}function AE(){If=!1,ls!==null&&cu(ls)&&(ls=null),cs!==null&&cu(cs)&&(cs=null),us!==null&&cu(us)&&(us=null),ul.forEach(ob),hl.forEach(ob)}function uu(t,i){t.blockedOn===i&&(t.blockedOn=null,If||(If=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,AE)))}var hu=null;function lb(t){hu!==t&&(hu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){hu===t&&(hu=null);for(var i=0;i<t.length;i+=3){var s=t[i],l=t[i+1],_=t[i+2];if(typeof l!="function"){if(Nf(l||s)===null)continue;break}var w=pe(s);w!==null&&(t.splice(i,3),i-=3,Dd(w,{pending:!0,data:_,method:s.method,action:l},l,_))}}))}function Wa(t){function i(X){return uu(X,t)}ls!==null&&uu(ls,t),cs!==null&&uu(cs,t),us!==null&&uu(us,t),ul.forEach(i),hl.forEach(i);for(var s=0;s<hs.length;s++){var l=hs[s];l.blockedOn===t&&(l.blockedOn=null)}for(;0<hs.length&&(s=hs[0],s.blockedOn===null);)ab(s),s.blockedOn===null&&hs.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var _=s[l],w=s[l+1],D=_[Et]||null;if(typeof w=="function")D||lb(s);else if(D){var j=null;if(w&&w.hasAttribute("formAction")){if(_=w,D=w[Et]||null)j=D.formAction;else if(Nf(_)!==null)continue}else j=D.action;typeof j=="function"?s[l+1]=j:(s.splice(l,3),l-=3),lb(s)}}}function cb(){function t(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(D){return _=D})},focusReset:"manual",scroll:"manual"})}function i(){_!==null&&(_(),_=null),l||setTimeout(s,20)}function s(){if(!l&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,_=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),_!==null&&(_(),_=null)}}}function Bf(t){this._internalRoot=t}du.prototype.render=Bf.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,l=di();eb(s,l,t,i,null,null)},du.prototype.unmount=Bf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;eb(t.current,2,null,t,null,null),Gc(),i[Bi]=null}};function du(t){this._internalRoot=t}du.prototype.unstable_scheduleHydration=function(t){if(t){var i=ur();t={blockedOn:null,target:t,priority:i};for(var s=0;s<hs.length&&i!==0&&i<hs[s].priority;s++);hs.splice(s,0,t),s===0&&ab(t)}};var ub=n.version;if(ub!=="19.2.7")throw Error(a(527,ub,"19.2.7"));W.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=h(i),t=t!==null?S(t):null,t=t===null?null:t.stateNode,t};var RE={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fu.isDisabled&&fu.supportsFiber)try{Hn=fu.inject(RE),Yt=fu}catch{}}return pl.createRoot=function(t,i){if(!o(t))throw Error(a(299));var s=!1,l="",_=_v,w=vv,D=bv;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(l=i.identifierPrefix),i.onUncaughtError!==void 0&&(_=i.onUncaughtError),i.onCaughtError!==void 0&&(w=i.onCaughtError),i.onRecoverableError!==void 0&&(D=i.onRecoverableError)),i=J0(t,1,!1,null,null,s,l,null,_,w,D,cb),t[Bi]=i.current,_f(t),new Bf(i)},pl.hydrateRoot=function(t,i,s){if(!o(t))throw Error(a(299));var l=!1,_="",w=_v,D=vv,j=bv,X=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(_=s.identifierPrefix),s.onUncaughtError!==void 0&&(w=s.onUncaughtError),s.onCaughtError!==void 0&&(D=s.onCaughtError),s.onRecoverableError!==void 0&&(j=s.onRecoverableError),s.formState!==void 0&&(X=s.formState)),i=J0(t,1,!0,i,s??null,l,_,X,w,D,j,cb),i.context=Q0(null),s=i.current,l=di(),l=et(l),_=Xr(l),_.callback=null,Zr(s,_,l),s=l,i.current.lanes=s,ft(i,s),Ji(i),t[Bi]=i.current,_f(t),new du(i)},pl.version="19.2.7",pl}var yb;function zE(){if(yb)return zf.exports;yb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),zf.exports=$E(),zf.exports}var PE=zE();var Sb="popstate";function wb(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function HE(e={}){function n(a,o){let v=o.state?.masked,{pathname:m,search:c,hash:u}=v||a.location;return $p("",{pathname:m,search:c,hash:u},o.state&&o.state.usr||null,o.state&&o.state.key||"default",v?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,o){return typeof o=="string"?o:zl(o)}return FE(n,r,null,e)}function It(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Wi(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function UE(){return Math.random().toString(36).substring(2,10)}function Cb(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function $p(e,n,r=null,a,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?fo(n):n,state:r,key:n&&n.key||a||UE(),mask:o}}function zl({pathname:e="/",search:n="",hash:r=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function fo(e){let n={};if(e){let r=e.indexOf("#");r>=0&&(n.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(n.search=e.substring(a),e=e.substring(0,a)),e&&(n.pathname=e)}return n}function FE(e,n,r,a={}){let{window:o=document.defaultView,v5Compat:v=!1}=a,m=o.history,c="POP",u=null,h=S();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function S(){return(m.state||{idx:null}).idx}function f(){c="POP";let g=S(),b=g==null?null:g-h;h=g,u&&u({action:c,location:E.location,delta:b})}function C(g,b){c="PUSH";let p=wb(g)?g:$p(E.location,g,b);h=S()+1;let y=Cb(p,h),T=E.createHref(p.mask||p);try{m.pushState(y,"",T)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;o.location.assign(T)}v&&u&&u({action:c,location:E.location,delta:1})}function x(g,b){c="REPLACE";let p=wb(g)?g:$p(E.location,g,b);h=S();let y=Cb(p,h),T=E.createHref(p.mask||p);m.replaceState(y,"",T),v&&u&&u({action:c,location:E.location,delta:0})}function k(g){return qE(o,g)}let E={get action(){return c},get location(){return e(o,m)},listen(g){if(u)throw new Error("A history only accepts one active listener");return o.addEventListener(Sb,f),u=g,()=>{o.removeEventListener(Sb,f),u=null}},createHref(g){return n(o,g)},createURL:k,encodeLocation(g){let b=k(g);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:C,replace:x,go(g){return m.go(g)}};return E}function qE(e,n,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),It(a,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:zl(n);return o=o.replace(/ $/,"%20"),!r&&o.startsWith("//")&&(o=a+o),new URL(o,a)}function iS(e,n,r="/"){return WE(e,n,r,!1)}function WE(e,n,r,a,o){let v=typeof n=="string"?fo(n):n,m=zr(v.pathname||"/",r);if(m==null)return null;let c=GE(e),u=null,h=r5(m);for(let S=0;u==null&&S<c.length;++S)u=n5(c[S],h,a);return u}function GE(e){let n=rS(e);return KE(n),n}function rS(e,n=[],r=[],a="",o=!1){let v=(m,c,u=o,h)=>{let S={relativePath:h===void 0?m.path||"":h,caseSensitive:m.caseSensitive===!0,childrenIndex:c,route:m};if(S.relativePath.startsWith("/")){if(!S.relativePath.startsWith(a)&&u)return;It(S.relativePath.startsWith(a),`Absolute route path "${S.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),S.relativePath=S.relativePath.slice(a.length)}let f=qi([a,S.relativePath]),C=r.concat(S);m.children&&m.children.length>0&&(It(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),rS(m.children,n,C,f,u)),!(m.path==null&&!m.index)&&n.push({path:f,score:e5(f,m.index),routesMeta:C})};return e.forEach((m,c)=>{if(m.path===""||!m.path?.includes("?"))v(m,c);else for(let u of sS(m.path))v(m,c,!0,u)}),n}function sS(e){let n=e.split("/");if(n.length===0)return[];let[r,...a]=n,o=r.endsWith("?"),v=r.replace(/\?$/,"");if(a.length===0)return o?[v,""]:[v];let m=sS(a.join("/")),c=[];return c.push(...m.map(u=>u===""?v:[v,u].join("/"))),o&&c.push(...m),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function KE(e){e.sort((n,r)=>n.score!==r.score?r.score-n.score:t5(n.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var VE=/^:[\w-]+$/,YE=3,XE=2,ZE=1,JE=10,QE=-2,xb=e=>e==="*";function e5(e,n){let r=e.split("/"),a=r.length;return r.some(xb)&&(a+=QE),n&&(a+=XE),r.filter(o=>!xb(o)).reduce((o,v)=>o+(VE.test(v)?YE:v===""?ZE:JE),a)}function t5(e,n){return e.length===n.length&&e.slice(0,-1).every((a,o)=>a===n[o])?e[e.length-1]-n[n.length-1]:0}function n5(e,n,r=!1){let{routesMeta:a}=e,o={},v="/",m=[];for(let c=0;c<a.length;++c){let u=a[c],h=c===a.length-1,S=v==="/"?n:n.slice(v.length)||"/",f=Xu({path:u.relativePath,caseSensitive:u.caseSensitive,end:h},S),C=u.route;if(!f&&h&&r&&!a[a.length-1].route.index&&(f=Xu({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},S)),!f)return null;Object.assign(o,f.params),m.push({params:o,pathname:qi([v,f.pathname]),pathnameBase:l5(qi([v,f.pathnameBase])),route:C}),f.pathnameBase!=="/"&&(v=qi([v,f.pathnameBase]))}return m}function Xu(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=i5(e.path,e.caseSensitive,e.end),o=n.match(r);if(!o)return null;let v=o[0],m=v.replace(/(.)\/+$/,"$1"),c=o.slice(1);return{params:a.reduce((h,{paramName:S,isOptional:f},C)=>{if(S==="*"){let k=c[C]||"";m=v.slice(0,v.length-k.length).replace(/(.)\/+$/,"$1")}const x=c[C];return f&&!x?h[S]=void 0:h[S]=(x||"").replace(/%2F/g,"/"),h},{}),pathname:v,pathnameBase:m,pattern:e}}function i5(e,n=!1,r=!0){Wi(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,c,u,h,S)=>{if(a.push({paramName:c,isOptional:u!=null}),u){let f=S.charAt(h+m.length);return f&&f!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,n?void 0:"i"),a]}function r5(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Wi(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function zr(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let r=n.endsWith("/")?n.length-1:n.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}var s5=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function a5(e,n="/"){let{pathname:r,search:a="",hash:o=""}=typeof e=="string"?fo(e):e,v;return r?(r=aS(r),r.startsWith("/")?v=Eb(r.substring(1),"/"):v=Eb(r,n)):v=n,{pathname:v,search:c5(a),hash:u5(o)}}function Eb(e,n){let r=Zu(n).split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Ff(e,n,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function o5(e){return e.filter((n,r)=>r===0||n.route.path&&n.route.path.length>0)}function $g(e){let n=o5(e);return n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase)}function mh(e,n,r,a=!1){let o;typeof e=="string"?o=fo(e):(o={...e},It(!o.pathname||!o.pathname.includes("?"),Ff("?","pathname","search",o)),It(!o.pathname||!o.pathname.includes("#"),Ff("#","pathname","hash",o)),It(!o.search||!o.search.includes("#"),Ff("#","search","hash",o)));let v=e===""||o.pathname==="",m=v?"/":o.pathname,c;if(m==null)c=r;else{let f=n.length-1;if(!a&&m.startsWith("..")){let C=m.split("/");for(;C[0]==="..";)C.shift(),f-=1;o.pathname=C.join("/")}c=f>=0?n[f]:"/"}let u=a5(o,c),h=m&&m!=="/"&&m.endsWith("/"),S=(v||m===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(h||S)&&(u.pathname+="/"),u}var aS=e=>e.replace(/\/\/+/g,"/"),qi=e=>aS(e.join("/")),Zu=e=>e.replace(/\/+$/,""),l5=e=>Zu(e).replace(/^\/*/,"/"),c5=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,u5=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,h5=class{constructor(e,n,r,a=!1){this.status=e,this.statusText=n||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function d5(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function f5(e){let n=e.map(r=>r.route.path).filter(Boolean);return qi(n)||"/"}var oS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function lS(e,n){let r=e;if(typeof r!="string"||!s5.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,o=!1;if(oS)try{let v=new URL(window.location.href),m=r.startsWith("//")?new URL(v.protocol+r):new URL(r),c=zr(m.pathname,n);m.origin===v.origin&&c!=null?r=c+m.search+m.hash:o=!0}catch{Wi(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:o,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var cS=["POST","PUT","PATCH","DELETE"];new Set(cS);var p5=["GET",...cS];new Set(p5);var po=z.createContext(null);po.displayName="DataRouter";var _h=z.createContext(null);_h.displayName="DataRouterState";var uS=z.createContext(!1);function g5(){return z.useContext(uS)}var hS=z.createContext({isTransitioning:!1});hS.displayName="ViewTransition";var m5=z.createContext(new Map);m5.displayName="Fetchers";var _5=z.createContext(null);_5.displayName="Await";var pi=z.createContext(null);pi.displayName="Navigation";var Vl=z.createContext(null);Vl.displayName="Location";var sr=z.createContext({outlet:null,matches:[],isDataRoute:!1});sr.displayName="Route";var zg=z.createContext(null);zg.displayName="RouteError";var dS="REACT_ROUTER_ERROR",v5="REDIRECT",b5="ROUTE_ERROR_RESPONSE";function y5(e){if(e.startsWith(`${dS}:${v5}:{`))try{let n=JSON.parse(e.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 S5(e){if(e.startsWith(`${dS}:${b5}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new h5(n.status,n.statusText,n.data)}catch{}}function w5(e,{relative:n}={}){It(go(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=z.useContext(pi),{hash:o,pathname:v,search:m}=Xl(e,{relative:n}),c=v;return r!=="/"&&(c=v==="/"?r:qi([r,v])),a.createHref({pathname:c,search:m,hash:o})}function go(){return z.useContext(Vl)!=null}function Di(){return It(go(),"useLocation() may be used only in the context of a <Router> component."),z.useContext(Vl).location}var fS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function pS(e){z.useContext(pi).static||z.useLayoutEffect(e)}function Yl(){let{isDataRoute:e}=z.useContext(sr);return e?I5():C5()}function C5(){It(go(),"useNavigate() may be used only in the context of a <Router> component.");let e=z.useContext(po),{basename:n,navigator:r}=z.useContext(pi),{matches:a}=z.useContext(sr),{pathname:o}=Di(),v=JSON.stringify($g(a)),m=z.useRef(!1);return pS(()=>{m.current=!0}),z.useCallback((u,h={})=>{if(Wi(m.current,fS),!m.current)return;if(typeof u=="number"){r.go(u);return}let S=mh(u,JSON.parse(v),o,h.relative==="path");e==null&&n!=="/"&&(S.pathname=S.pathname==="/"?n:qi([n,S.pathname])),(h.replace?r.replace:r.push)(S,h.state,h)},[n,r,v,o,e])}z.createContext(null);function Xl(e,{relative:n}={}){let{matches:r}=z.useContext(sr),{pathname:a}=Di(),o=JSON.stringify($g(r));return z.useMemo(()=>mh(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function x5(e,n){return gS(e,n)}function gS(e,n,r){It(go(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=z.useContext(pi),{matches:o}=z.useContext(sr),v=o[o.length-1],m=v?v.params:{},c=v?v.pathname:"/",u=v?v.pathnameBase:"/",h=v&&v.route;{let g=h&&h.path||"";_S(c,!h||g.endsWith("*")||g.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${g}">) 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="${g}"> to <Route path="${g==="/"?"*":`${g}/*`}">.`)}let S=Di(),f;if(n){let g=typeof n=="string"?fo(n):n;It(u==="/"||g.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 "${g.pathname}" was given in the \`location\` prop.`),f=g}else f=S;let C=f.pathname||"/",x=C;if(u!=="/"){let g=u.replace(/^\//,"").split("/");x="/"+C.replace(/^\//,"").split("/").slice(g.length).join("/")}let k=r&&r.state.matches.length?r.state.matches.map(g=>Object.assign(g,{route:r.manifest[g.route.id]||g.route})):iS(e,{pathname:x});Wi(h||k!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),Wi(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.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 E=R5(k&&k.map(g=>Object.assign({},g,{params:Object.assign({},m,g.params),pathname:qi([u,a.encodeLocation?a.encodeLocation(g.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?u:qi([u,a.encodeLocation?a.encodeLocation(g.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathnameBase])})),o,r);return n&&E?z.createElement(Vl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...f},navigationType:"POP"}},E):E}function E5(){let e=N5(),n=d5(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:a},v={padding:"2px 4px",backgroundColor:a},m=null;return console.error("Error handled by React Router default ErrorBoundary:",e),m=z.createElement(z.Fragment,null,z.createElement("p",null,"💿 Hey developer 👋"),z.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",z.createElement("code",{style:v},"ErrorBoundary")," or"," ",z.createElement("code",{style:v},"errorElement")," prop on your route.")),z.createElement(z.Fragment,null,z.createElement("h2",null,"Unexpected Application Error!"),z.createElement("h3",{style:{fontStyle:"italic"}},n),r?z.createElement("pre",{style:o},r):null,m)}var T5=z.createElement(E5,null),mS=class extends z.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=S5(e.digest);r&&(e=r)}let n=e!==void 0?z.createElement(sr.Provider,{value:this.props.routeContext},z.createElement(zg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?z.createElement(k5,{error:e},n):n}};mS.contextType=uS;var qf=new WeakMap;function k5({children:e,error:n}){let{basename:r}=z.useContext(pi);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let a=y5(n.digest);if(a){let o=qf.get(n);if(o)throw o;let v=lS(a.location,r);if(oS&&!qf.get(n))if(v.isExternal||a.reloadDocument)window.location.href=v.absoluteURL||v.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(v.to,{replace:a.replace}));throw qf.set(n,m),m}return z.createElement("meta",{httpEquiv:"refresh",content:`0;url=${v.absoluteURL||v.to}`})}}return e}function A5({routeContext:e,match:n,children:r}){let a=z.useContext(po);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),z.createElement(sr.Provider,{value:e},r)}function R5(e,n=[],r){let a=r?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(n.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let o=e,v=a?.errors;if(v!=null){let S=o.findIndex(f=>f.route.id&&v?.[f.route.id]!==void 0);It(S>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(v).join(",")}`),o=o.slice(0,Math.min(o.length,S+1))}let m=!1,c=-1;if(r&&a){m=a.renderFallback;for(let S=0;S<o.length;S++){let f=o[S];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=S),f.route.id){let{loaderData:C,errors:x}=a,k=f.route.loader&&!C.hasOwnProperty(f.route.id)&&(!x||x[f.route.id]===void 0);if(f.route.lazy||k){r.isStatic&&(m=!0),c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}}let u=r?.onError,h=a&&u?(S,f)=>{u(S,{location:a.location,params:a.matches?.[0]?.params??{},pattern:f5(a.matches),errorInfo:f})}:void 0;return o.reduceRight((S,f,C)=>{let x,k=!1,E=null,g=null;a&&(x=v&&f.route.id?v[f.route.id]:void 0,E=f.route.errorElement||T5,m&&(c<0&&C===0?(_S("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,g=null):c===C&&(k=!0,g=f.route.hydrateFallbackElement||null)));let b=n.concat(o.slice(0,C+1)),p=()=>{let y;return x?y=E:k?y=g:f.route.Component?y=z.createElement(f.route.Component,null):f.route.element?y=f.route.element:y=S,z.createElement(A5,{match:f,routeContext:{outlet:S,matches:b,isDataRoute:a!=null},children:y})};return a&&(f.route.ErrorBoundary||f.route.errorElement||C===0)?z.createElement(mS,{location:a.location,revalidation:a.revalidation,component:E,error:x,children:p(),routeContext:{outlet:null,matches:b,isDataRoute:!0},onError:h}):p()},null)}function Pg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function L5(e){let n=z.useContext(po);return It(n,Pg(e)),n}function M5(e){let n=z.useContext(_h);return It(n,Pg(e)),n}function D5(e){let n=z.useContext(sr);return It(n,Pg(e)),n}function Hg(e){let n=D5(e),r=n.matches[n.matches.length-1];return It(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function O5(){return Hg("useRouteId")}function N5(){let e=z.useContext(zg),n=M5("useRouteError"),r=Hg("useRouteError");return e!==void 0?e:n.errors?.[r]}function I5(){let{router:e}=L5("useNavigate"),n=Hg("useNavigate"),r=z.useRef(!1);return pS(()=>{r.current=!0}),z.useCallback(async(o,v={})=>{Wi(r.current,fS),r.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:n,...v}))},[e,n])}var Tb={};function _S(e,n,r){!n&&!Tb[e]&&(Tb[e]=!0,Wi(!1,r))}z.memo(B5);function B5({routes:e,manifest:n,future:r,state:a,isStatic:o,onError:v}){return gS(e,void 0,{manifest:n,state:a,isStatic:o,onError:v})}function j5({to:e,replace:n,state:r,relative:a}){It(go(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=z.useContext(pi);Wi(!o,"<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:v}=z.useContext(sr),{pathname:m}=Di(),c=Yl(),u=mh(e,$g(v),m,a==="path"),h=JSON.stringify(u);return z.useEffect(()=>{c(JSON.parse(h),{replace:n,state:r,relative:a})},[c,h,a,n,r]),null}function Ys(e){It(!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 $5({basename:e="/",children:n=null,location:r,navigationType:a="POP",navigator:o,static:v=!1,useTransitions:m}){It(!go(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=z.useMemo(()=>({basename:c,navigator:o,static:v,useTransitions:m,future:{}}),[c,o,v,m]);typeof r=="string"&&(r=fo(r));let{pathname:h="/",search:S="",hash:f="",state:C=null,key:x="default",mask:k}=r,E=z.useMemo(()=>{let g=zr(h,c);return g==null?null:{location:{pathname:g,search:S,hash:f,state:C,key:x,mask:k},navigationType:a}},[c,h,S,f,C,x,a,k]);return Wi(E!=null,`<Router basename="${c}"> is not able to match the URL "${h}${S}${f}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:z.createElement(pi.Provider,{value:u},z.createElement(Vl.Provider,{children:n,value:E}))}function z5({children:e,location:n}){return x5(zp(e),n)}function zp(e,n=[]){let r=[];return z.Children.forEach(e,(a,o)=>{if(!z.isValidElement(a))return;let v=[...n,o];if(a.type===z.Fragment){r.push.apply(r,zp(a.props.children,v));return}It(a.type===Ys,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),It(!a.props.index||!a.props.children,"An index route cannot have child routes.");let m={id:a.props.id||v.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(m.children=zp(a.props.children,v)),r.push(m)}),r}var Nu="get",Iu="application/x-www-form-urlencoded";function vh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function P5(e){return vh(e)&&e.tagName.toLowerCase()==="button"}function H5(e){return vh(e)&&e.tagName.toLowerCase()==="form"}function U5(e){return vh(e)&&e.tagName.toLowerCase()==="input"}function F5(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function q5(e,n){return e.button===0&&(!n||n==="_self")&&!F5(e)}var pu=null;function W5(){if(pu===null)try{new FormData(document.createElement("form"),0),pu=!1}catch{pu=!0}return pu}var G5=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Wf(e){return e!=null&&!G5.has(e)?(Wi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Iu}"`),null):e}function K5(e,n){let r,a,o,v,m;if(H5(e)){let c=e.getAttribute("action");a=c?zr(c,n):null,r=e.getAttribute("method")||Nu,o=Wf(e.getAttribute("enctype"))||Iu,v=new FormData(e)}else if(P5(e)||U5(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||c.getAttribute("action");if(a=u?zr(u,n):null,r=e.getAttribute("formmethod")||c.getAttribute("method")||Nu,o=Wf(e.getAttribute("formenctype"))||Wf(c.getAttribute("enctype"))||Iu,v=new FormData(c,e),!W5()){let{name:h,type:S,value:f}=e;if(S==="image"){let C=h?`${h}.`:"";v.append(`${C}x`,"0"),v.append(`${C}y`,"0")}else h&&v.append(h,f)}}else{if(vh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Nu,a=null,o=Iu,m=e}return v&&o==="text/plain"&&(m=v,v=void 0),{action:a,method:r.toLowerCase(),encType:o,formData:v,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ug(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function vS(e,n,r,a){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${a}`:o.pathname=`${o.pathname}.${a}`:o.pathname==="/"?o.pathname=`_root.${a}`:n&&zr(o.pathname,n)==="/"?o.pathname=`${Zu(n)}/_root.${a}`:o.pathname=`${Zu(o.pathname)}.${a}`,o}async function V5(e,n){if(e.id in n)return n[e.id];try{let r=await import(e.module);return n[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Y5(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function X5(e,n,r){let a=await Promise.all(e.map(async o=>{let v=n.routes[o.route.id];if(v){let m=await V5(v,r);return m.links?m.links():[]}return[]}));return eT(a.flat(1).filter(Y5).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function kb(e,n,r,a,o,v){let m=(u,h)=>r[h]?u.route.id!==r[h].route.id:!0,c=(u,h)=>r[h].pathname!==u.pathname||r[h].route.path?.endsWith("*")&&r[h].params["*"]!==u.params["*"];return v==="assets"?n.filter((u,h)=>m(u,h)||c(u,h)):v==="data"?n.filter((u,h)=>{let S=a.routes[u.route.id];if(!S||!S.hasLoader)return!1;if(m(u,h)||c(u,h))return!0;if(u.route.shouldRevalidate){let f=u.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function Z5(e,n,{includeHydrateFallback:r}={}){return J5(e.map(a=>{let o=n.routes[a.route.id];if(!o)return[];let v=[o.module];return o.clientActionModule&&(v=v.concat(o.clientActionModule)),o.clientLoaderModule&&(v=v.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(v=v.concat(o.hydrateFallbackModule)),o.imports&&(v=v.concat(o.imports)),v}).flat(1))}function J5(e){return[...new Set(e)]}function Q5(e){let n={},r=Object.keys(e).sort();for(let a of r)n[a]=e[a];return n}function eT(e,n){let r=new Set;return new Set(n),e.reduce((a,o)=>{let v=JSON.stringify(Q5(o));return r.has(v)||(r.add(v),a.push({key:v,link:o})),a},[])}function Fg(){let e=z.useContext(po);return Ug(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function tT(){let e=z.useContext(_h);return Ug(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var qg=z.createContext(void 0);qg.displayName="FrameworkContext";function Wg(){let e=z.useContext(qg);return Ug(e,"You must render this element inside a <HydratedRouter> element"),e}function nT(e,n){let r=z.useContext(qg),[a,o]=z.useState(!1),[v,m]=z.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:h,onMouseLeave:S,onTouchStart:f}=n,C=z.useRef(null);z.useEffect(()=>{if(e==="render"&&m(!0),e==="viewport"){let E=b=>{b.forEach(p=>{m(p.isIntersecting)})},g=new IntersectionObserver(E,{threshold:.5});return C.current&&g.observe(C.current),()=>{g.disconnect()}}},[e]),z.useEffect(()=>{if(a){let E=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(E)}}},[a]);let x=()=>{o(!0)},k=()=>{o(!1),m(!1)};return r?e!=="intent"?[v,C,{}]:[v,C,{onFocus:gl(c,x),onBlur:gl(u,k),onMouseEnter:gl(h,x),onMouseLeave:gl(S,k),onTouchStart:gl(f,x)}]:[!1,C,{}]}function gl(e,n){return r=>{e&&e(r),r.defaultPrevented||n(r)}}function iT({page:e,...n}){let r=g5(),{router:a}=Fg(),o=z.useMemo(()=>iS(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?r?z.createElement(sT,{page:e,matches:o,...n}):z.createElement(aT,{page:e,matches:o,...n}):null}function rT(e){let{manifest:n,routeModules:r}=Wg(),[a,o]=z.useState([]);return z.useEffect(()=>{let v=!1;return X5(e,n,r).then(m=>{v||o(m)}),()=>{v=!0}},[e,n,r]),a}function sT({page:e,matches:n,...r}){let a=Di(),{future:o}=Wg(),{basename:v}=Fg(),m=z.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let c=vS(e,v,o.v8_trailingSlashAwareDataRequests,"rsc"),u=!1,h=[];for(let S of n)typeof S.route.shouldRevalidate=="function"?u=!0:h.push(S.route.id);return u&&h.length>0&&c.searchParams.set("_routes",h.join(",")),[c.pathname+c.search]},[v,o.v8_trailingSlashAwareDataRequests,e,a,n]);return z.createElement(z.Fragment,null,m.map(c=>z.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...r})))}function aT({page:e,matches:n,...r}){let a=Di(),{future:o,manifest:v,routeModules:m}=Wg(),{basename:c}=Fg(),{loaderData:u,matches:h}=tT(),S=z.useMemo(()=>kb(e,n,h,v,a,"data"),[e,n,h,v,a]),f=z.useMemo(()=>kb(e,n,h,v,a,"assets"),[e,n,h,v,a]),C=z.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let E=new Set,g=!1;if(n.forEach(p=>{let y=v.routes[p.route.id];!y||!y.hasLoader||(!S.some(T=>T.route.id===p.route.id)&&p.route.id in u&&m[p.route.id]?.shouldRevalidate||y.hasClientLoader?g=!0:E.add(p.route.id))}),E.size===0)return[];let b=vS(e,c,o.v8_trailingSlashAwareDataRequests,"data");return g&&E.size>0&&b.searchParams.set("_routes",n.filter(p=>E.has(p.route.id)).map(p=>p.route.id).join(",")),[b.pathname+b.search]},[c,o.v8_trailingSlashAwareDataRequests,u,a,v,S,n,e,m]),x=z.useMemo(()=>Z5(f,v),[f,v]),k=rT(f);return z.createElement(z.Fragment,null,C.map(E=>z.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...r})),x.map(E=>z.createElement("link",{key:E,rel:"modulepreload",href:E,...r})),k.map(({key:E,link:g})=>z.createElement("link",{key:E,nonce:r.nonce,...g,crossOrigin:g.crossOrigin??r.crossOrigin})))}function oT(...e){return n=>{e.forEach(r=>{typeof r=="function"?r(n):r!=null&&(r.current=n)})}}var lT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{lT&&(window.__reactRouterVersion="7.17.0")}catch{}function cT({basename:e,children:n,useTransitions:r,window:a}){let o=z.useRef();o.current==null&&(o.current=HE({window:a,v5Compat:!0}));let v=o.current,[m,c]=z.useState({action:v.action,location:v.location}),u=z.useCallback(h=>{r===!1?c(h):z.startTransition(()=>c(h))},[r]);return z.useLayoutEffect(()=>v.listen(u),[v,u]),z.createElement($5,{basename:e,children:n,location:m.location,navigationType:m.action,navigator:v,useTransitions:r})}var bS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pl=z.forwardRef(function({onClick:n,discover:r="render",prefetch:a="none",relative:o,reloadDocument:v,replace:m,mask:c,state:u,target:h,to:S,preventScrollReset:f,viewTransition:C,defaultShouldRevalidate:x,...k},E){let{basename:g,navigator:b,useTransitions:p}=z.useContext(pi),y=typeof S=="string"&&bS.test(S),T=lS(S,g);S=T.to;let A=w5(S,{relative:o}),L=Di(),M=null;if(c){let te=mh(c,[],L.mask?L.mask.pathname:"/",!0);g!=="/"&&(te.pathname=te.pathname==="/"?g:qi([g,te.pathname])),M=b.createHref(te)}let[R,O,F]=nT(a,k),U=dT(S,{replace:m,mask:c,state:u,target:h,preventScrollReset:f,relative:o,viewTransition:C,defaultShouldRevalidate:x,useTransitions:p});function G(te){n&&n(te),te.defaultPrevented||U(te)}let B=!(T.isExternal||v),K=z.createElement("a",{...k,...F,href:(B?M:void 0)||T.absoluteURL||A,onClick:B?G:n,ref:oT(E,O),target:h,"data-discover":!y&&r==="render"?"true":void 0});return R&&!y?z.createElement(z.Fragment,null,K,z.createElement(iT,{page:A})):K});Pl.displayName="Link";var Bu=z.forwardRef(function({"aria-current":n="page",caseSensitive:r=!1,className:a="",end:o=!1,style:v,to:m,viewTransition:c,children:u,...h},S){let f=Xl(m,{relative:h.relative}),C=Di(),x=z.useContext(_h),{navigator:k,basename:E}=z.useContext(pi),g=x!=null&&_T(f)&&c===!0,b=k.encodeLocation?k.encodeLocation(f).pathname:f.pathname,p=C.pathname,y=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;r||(p=p.toLowerCase(),y=y?y.toLowerCase():null,b=b.toLowerCase()),y&&E&&(y=zr(y,E)||y);const T=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let A=p===b||!o&&p.startsWith(b)&&p.charAt(T)==="/",L=y!=null&&(y===b||!o&&y.startsWith(b)&&y.charAt(b.length)==="/"),M={isActive:A,isPending:L,isTransitioning:g},R=A?n:void 0,O;typeof a=="function"?O=a(M):O=[a,A?"active":null,L?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let F=typeof v=="function"?v(M):v;return z.createElement(Pl,{...h,"aria-current":R,className:O,ref:S,style:F,to:m,viewTransition:c},typeof u=="function"?u(M):u)});Bu.displayName="NavLink";var uT=z.forwardRef(({discover:e="render",fetcherKey:n,navigate:r,reloadDocument:a,replace:o,state:v,method:m=Nu,action:c,onSubmit:u,relative:h,preventScrollReset:S,viewTransition:f,defaultShouldRevalidate:C,...x},k)=>{let{useTransitions:E}=z.useContext(pi),g=gT(),b=mT(c,{relative:h}),p=m.toLowerCase()==="get"?"get":"post",y=typeof c=="string"&&bS.test(c),T=A=>{if(u&&u(A),A.defaultPrevented)return;A.preventDefault();let L=A.nativeEvent.submitter,M=L?.getAttribute("formmethod")||m,R=()=>g(L||A.currentTarget,{fetcherKey:n,method:M,navigate:r,replace:o,state:v,relative:h,preventScrollReset:S,viewTransition:f,defaultShouldRevalidate:C});E&&r!==!1?z.startTransition(()=>R()):R()};return z.createElement("form",{ref:k,method:p,action:b,onSubmit:a?u:T,...x,"data-discover":!y&&e==="render"?"true":void 0})});uT.displayName="Form";function hT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function yS(e){let n=z.useContext(po);return It(n,hT(e)),n}function dT(e,{target:n,replace:r,mask:a,state:o,preventScrollReset:v,relative:m,viewTransition:c,defaultShouldRevalidate:u,useTransitions:h}={}){let S=Yl(),f=Di(),C=Xl(e,{relative:m});return z.useCallback(x=>{if(q5(x,n)){x.preventDefault();let k=r!==void 0?r:zl(f)===zl(C),E=()=>S(e,{replace:k,mask:a,state:o,preventScrollReset:v,relative:m,viewTransition:c,defaultShouldRevalidate:u});h?z.startTransition(()=>E()):E()}},[f,S,C,r,a,o,n,e,v,m,c,u,h])}var fT=0,pT=()=>`__${String(++fT)}__`;function gT(){let{router:e}=yS("useSubmit"),{basename:n}=z.useContext(pi),r=O5(),a=e.fetch,o=e.navigate;return z.useCallback(async(v,m={})=>{let{action:c,method:u,encType:h,formData:S,body:f}=K5(v,n);if(m.navigate===!1){let C=m.fetcherKey||pT();await a(C,r,m.action||c,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:S,body:f,formMethod:m.method||u,formEncType:m.encType||h,flushSync:m.flushSync})}else await o(m.action||c,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:S,body:f,formMethod:m.method||u,formEncType:m.encType||h,replace:m.replace,state:m.state,fromRouteId:r,flushSync:m.flushSync,viewTransition:m.viewTransition})},[a,o,n,r])}function mT(e,{relative:n}={}){let{basename:r}=z.useContext(pi),a=z.useContext(sr);It(a,"useFormAction must be used inside a RouteContext");let[o]=a.matches.slice(-1),v={...Xl(e||".",{relative:n})},m=Di();if(e==null){v.search=m.search;let c=new URLSearchParams(v.search),u=c.getAll("index");if(u.some(S=>S==="")){c.delete("index"),u.filter(f=>f).forEach(f=>c.append("index",f));let S=c.toString();v.search=S?`?${S}`:""}}return(!e||e===".")&&o.route.index&&(v.search=v.search?v.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(v.pathname=v.pathname==="/"?r:qi([r,v.pathname])),zl(v)}function _T(e,{relative:n}={}){let r=z.useContext(hS);It(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=yS("useViewTransitionState"),o=Xl(e,{relative:n});if(!r.isTransitioning)return!1;let v=zr(r.currentLocation.pathname,a)||r.currentLocation.pathname,m=zr(r.nextLocation.pathname,a)||r.nextLocation.pathname;return Xu(o.pathname,m)!=null||Xu(o.pathname,v)!=null}var vT=nS();const bT="fleet-console.canvas.",SS="fleet-console.canvas.backgroundAnimation",wS="fleet-console.canvas.maximized",CS="fleet-console.canvas.dockExpanded",yT=400,Pp=640,Hp=400,Ab=40,Rb=96,ST=.25,wT=1,Gf=.2,Lb=.5,CT=.001,Qa={x:0,y:0,zoom:1},io={viewport:Qa,panels:{},minimized:[]},Up=new Set,Fp=new Set,qp=new Set,Wp=new Set;let Hl=null,Ss=null,_t=io,ju=VT(),Ol=XT(),$u=JT(),ys=Qa,Qs=null,co=0;function xS(e){return Up.add(e),()=>{Up.delete(e)}}function Mb(){return _t}function ES(){return z.useSyncExternalStore(xS,Mb,Mb)}function xT(){return z.useSyncExternalStore(jT,Db,Db)}function Gg(){return z.useSyncExternalStore(zT,Ob,Ob)}function ET(){return z.useSyncExternalStore(xS,Nb,Nb)}function TT(){return z.useSyncExternalStore(HT,Ib,Ib)}function nr(e){_t={viewport:e.viewport??_t.viewport,panels:e.panels??_t.panels,minimized:e.minimized??_t.minimized},qT(),AS()}function zu(e){Kg();const n=Vg(e);ys=n,nr({viewport:n})}function kT(e){const n=Vg(e);if(typeof window>"u"||typeof window.requestAnimationFrame!="function"||FT()){zu(n);return}ys=n,Qs===null&&(Qs=window.requestAnimationFrame(RS))}function Nl(e,n){const r=mo();nr({panels:{..._t.panels,[e]:{...Yg(n,r),zIndex:r}}})}function AT(e){_t.minimized.includes(e)||nr({minimized:[..._t.minimized,e]})}function RT(e){if(!_t.minimized.includes(e))return;const n=_t.minimized.filter(o=>o!==e),r=_t.panels[e];if(!r){nr({minimized:n});return}const a=mo();nr({minimized:n,panels:{..._t.panels,[e]:{...r,zIndex:a}}})}function mo(){return co+=1,co}function LT(e){co=Math.max(co,e)}function TS(e){const n=_t.panels[e];if(n)return n;const r=Object.keys(_t.panels).length,a={x:r*Ab,y:r*Ab,width:Pp,height:Hp,zIndex:mo()};return nr({panels:{..._t.panels,[e]:a}}),a}function MT(e){const n=new Set(e),r={};let a=!1;for(const[m,c]of Object.entries(_t.panels))n.has(m)?r[m]=c:a=!0;const o=_t.minimized.filter(m=>n.has(m)),v=o.length!==_t.minimized.length;(a||v)&&nr({panels:r,minimized:o})}function DT(e){WT(),Kg(),Hl=e,_t=e?KT(e):io,ys=_t.viewport,co=Math.max(co,DS(_t.panels)),AS()}function kS(e,n){const r=_t.panels[e];if(!r)return;const a=Math.max(ST,Math.min(wT,Math.min((n.width-Rb)/r.width,(n.height-Rb)/r.height))),o={x:n.width/2-(r.x+r.width/2)*a,y:n.height/2-(r.y+r.height/2)*a,zoom:a};Kg(),ys=o;const v=mo(),m=_t.minimized.includes(e);nr({viewport:o,panels:{..._t.panels,[e]:{...Yg(r,v),zIndex:v}},...m?{minimized:_t.minimized.filter(c=>c!==e)}:{}})}function OT(){ju=!ju,YT(ju),$T()}function NT(){IT(!Ol)}function IT(e){Ol!==e&&(Ol=e,ZT(Ol),PT())}function BT(){$u=!$u,QT($u),UT()}function jT(e){return Fp.add(e),()=>{Fp.delete(e)}}function Db(){return ju}function AS(){for(const e of Up)e()}function $T(){for(const e of Fp)e()}function zT(e){return qp.add(e),()=>{qp.delete(e)}}function Ob(){return Ol}function Nb(){return _t.minimized}function PT(){for(const e of qp)e()}function HT(e){return Wp.add(e),()=>{Wp.delete(e)}}function Ib(){return $u}function UT(){for(const e of Wp)e()}function RS(){const e=_t.viewport,n=ys.x-e.x,r=ys.y-e.y,a=ys.zoom-e.zoom;if(Math.abs(n)<Lb&&Math.abs(r)<Lb&&Math.abs(a)<CT){Qs=null,nr({viewport:ys});return}nr({viewport:{x:e.x+n*Gf,y:e.y+r*Gf,zoom:e.zoom+a*Gf}}),Qs=typeof window<"u"?window.requestAnimationFrame(RS):null}function Kg(){Qs===null||typeof window>"u"||(window.cancelAnimationFrame(Qs),Qs=null)}function FT(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function qT(){!Hl||typeof window>"u"||(GT(),Ss=window.setTimeout(()=>{Ss=null,LS(Hl,_t)},yT))}function WT(){!Ss||!Hl||typeof window>"u"||(window.clearTimeout(Ss),Ss=null,LS(Hl,_t))}function GT(){!Ss||typeof window>"u"||(window.clearTimeout(Ss),Ss=null)}function KT(e){if(typeof window>"u")return io;try{const n=window.localStorage.getItem(MS(e));if(!n)return io;const r=JSON.parse(n);return ek(r)}catch{return io}}function LS(e,n){if(!(!e||typeof window>"u"))try{window.localStorage.setItem(MS(e),JSON.stringify(n))}catch{}}function VT(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(SS);return e===null?!0:e==="true"}catch{return!0}}function YT(e){if(!(typeof window>"u"))try{window.localStorage.setItem(SS,String(e))}catch{}}function XT(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(wS)==="true"}catch{return!1}}function ZT(e){if(!(typeof window>"u"))try{window.localStorage.setItem(wS,String(e))}catch{}}function JT(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(CS);return e===null?!0:e==="true"}catch{return!0}}function QT(e){if(!(typeof window>"u"))try{window.localStorage.setItem(CS,String(e))}catch{}}function MS(e){return`${bT}${e}`}function ek(e){if(!Ul(e))return io;const n=nk(e.panels);return{viewport:Vg(e.viewport),panels:n,minimized:tk(e.minimized,n)}}function tk(e,n){if(!Array.isArray(e))return[];const r=new Set,a=[];for(const o of e)typeof o!="string"||r.has(o)||!(o in n)||(r.add(o),a.push(o));return a}function Vg(e){if(!Ul(e))return Qa;const n=Il(e.x,Qa.x),r=Il(e.y,Qa.y),a=Gp(e.zoom,Qa.zoom);return{x:n,y:r,zoom:a}}function nk(e){if(!Ul(e))return{};const n={};for(const[r,a]of Object.entries(e))Ul(a)&&(n[r]=Yg(a,ik(n)));return n}function Yg(e,n){return Ul(e)?{x:Il(e.x,0),y:Il(e.y,0),width:Gp(e.width,Pp),height:Gp(e.height,Hp),zIndex:Il(e.zIndex,n)}:{x:0,y:0,width:Pp,height:Hp,zIndex:n}}function ik(e){return DS(e)+1}function DS(e){return Math.max(0,...Object.values(e).map(n=>n.zIndex))}function Il(e,n){return typeof e=="number"&&Number.isFinite(e)?e:n}function Gp(e,n){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:n}function Ul(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const OS="fleet-console.operations.mode",Kf="canvas",Kp=new Set;let Vp=ak();function bh(){return z.useSyncExternalStore(rk,jb,jb)}function Bb(e){Vp!==e&&(Vp=e,ok(e),sk())}function rk(e){return Kp.add(e),()=>{Kp.delete(e)}}function jb(){return Vp}function sk(){for(const e of Kp)e()}function ak(){if(typeof window>"u")return Kf;try{const e=window.localStorage.getItem(OS);return e==="classic"||e==="canvas"?e:Kf}catch{return Kf}}function ok(e){if(!(typeof window>"u"))try{window.localStorage.setItem(OS,e)}catch{}}const NS="fleet-console.codex.view-mode",IS="fleet-console.codex.side-width",Vf="route",kl=460,lk=120,Yp=new Set;let Xp=dk(),Zp=fk(),BS=!1;function ck(){return z.useSyncExternalStore(Xg,$b,$b)}function jS(e){if(BS=!0,Xp===e){Jp();return}Xp=e,PS(NS,e),Jp()}function uk(){return z.useSyncExternalStore(Xg,Pb,Pb)}function $S(){return z.useSyncExternalStore(Xg,zb,zb)}function hk(e){const n=zS(e);Zp!==n&&(Zp=n,PS(IS,String(n)),Jp())}function Xg(e){return Yp.add(e),()=>{Yp.delete(e)}}function $b(){return Xp}function zb(){return Zp}function Pb(){return BS}function Jp(){for(const e of Yp)e()}function zS(e){return Number.isFinite(e)?Math.max(lk,Math.round(e)):kl}function dk(){if(typeof window>"u")return Vf;try{const e=window.localStorage.getItem(NS);return e==="route"||e==="side"?e:Vf}catch{return Vf}}function fk(){if(typeof window>"u")return kl;try{const e=window.localStorage.getItem(IS);if(e===null)return kl;const n=Number.parseInt(e,10);return Number.isNaN(n)?kl:zS(n)}catch{return kl}}function PS(e,n){if(!(typeof window>"u"))try{window.localStorage.setItem(e,n)}catch{}}const pk=["canonicalCwd","cwd","providerSession","ticket","token","transcriptPath"];class Ge extends Error{status;constructor(n,r){super(r),this.name="ApiError",this.status=n}}async function HS(e){const n=await fetch("/observer/tenants",{signal:e});await Ln(n);const r=await n.json();if(!Array.isArray(r.tenants))throw new Ge(n.status,"Invalid tenants response");return r.tenants.map(a=>kk(a,n.status))}async function gk(e){const n=await fetch("/observer/jobs",{signal:e});return await Ln(n),(await n.json()).tenants}async function mk(e){const n=await fetch("/observer/events",{signal:e});if(await Ln(n),!n.body)throw new Ge(n.status,"Observer stream unavailable");return n.body.getReader()}async function US(e){const n=await fetch("/observer/theaters",{signal:e});await Ln(n);const r=await n.json();if(!Array.isArray(r.theaters))throw new Ge(n.status,"Invalid Theater response");const a=Array.isArray(r.agentClis)?r.agentClis.map(o=>Tk(o,n.status)):[];return{theaters:r.theaters.map(o=>KS(o,n.status)),agentClis:a}}async function FS(e,n){const r=e?`?theaterId=${encodeURIComponent(e)}`:"",a=await fetch(`/observer/status${r}`,{signal:n});return await Ln(a),Ak(await a.json(),a.status)}async function _k(e){const n=await fetch("/update/apply",{method:"POST",signal:e});return await Ln(n),Rk(await n.json(),n.status)}async function vk(e){const n=await fetch("/observer/carriers",{signal:e});await Ln(n);const r=await n.json();if(!Array.isArray(r.carriers))throw new Ge(n.status,"Invalid carrier readiness response");return r.carriers.map(a=>Lk(a,n.status))}async function qS(e,n){const r=await fetch("/observer/theaters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folderGrantId:e}),signal:n});await Ln(r);const a=await r.json();return KS(a,r.status)}async function Ju(e,n,r){const a=await fetch(`/observer/theaters/${encodeURIComponent(e)}/sessions`,{method:"POST",...n?{headers:{"Content-Type":"application/json"},body:JSON.stringify({cliId:n})}:{},signal:r});return await Ln(a),wh(await a.json(),a.status)}async function bk(e,n){const r=await fetch("/terminal/folders/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:n});return await Ln(r),xk(await r.json(),r.status)}async function WS(e,n){const r=await fetch("/terminal/folders/grants",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:n});await Ln(r);const a=await r.json();if(typeof a.folderGrantId!="string")throw new Ge(r.status,"Invalid folder grant response");return a.folderGrantId}async function yh(e,n){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await Ln(r)}async function Sh(e,n){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}/resume`,{method:"POST",signal:n});return await Ln(r),wh(await r.json(),r.status)}async function yk(e,n){const r=await fetch(`/observer/theaters/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await Ln(r)}async function Zg(e,n){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({label:n})});return await Ln(r),wh(await r.json(),r.status)}async function Sk(e){const n=await fetch("/terminal/sessions",{signal:e});await Ln(n);const r=await n.json();if(!Array.isArray(r.sessions))throw new Ge(n.status,"Invalid terminal sessions response");return r.sessions.map(a=>wh(a,n.status))}async function wk(e,n){const r=Ck(n),a=await fetch("/terminal/ticket",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e,...r.kind?{kind:r.kind}:{},...r.theaterId?{theaterId:r.theaterId}:{}}),signal:r.signal});await Ln(a);const o=await a.json();if(typeof o.ticket!="string"||typeof o.ttlMs!="number")throw new Ge(a.status,"Invalid terminal ticket response");return{ticket:o.ticket,ttlMs:o.ttlMs}}function Ck(e){return e?e instanceof AbortSignal?{signal:e}:e:{}}function wh(e,n){const r=e;if(!r||typeof r.sessionId!="string"||typeof r.cwdLabel!="string"||typeof r.sequence!="number"||typeof r.status!="string"||typeof r.createdAt!="number"||GS(r))throw new Ge(n,"Invalid terminal session response");return{sessionId:r.sessionId,terminalSessionId:typeof r.terminalSessionId=="string"?r.terminalSessionId:r.sessionId,cwdLabel:r.cwdLabel,sequence:r.sequence,label:typeof r.label=="string"?r.label:void 0,cliId:typeof r.cliId=="string"?r.cliId:void 0,cliLabel:typeof r.cliLabel=="string"?r.cliLabel:void 0,status:r.status,turnState:r.turnState==="running"||r.turnState==="ended"?r.turnState:"none",createdAt:r.createdAt,theaterId:typeof r.theaterId=="string"?r.theaterId:void 0,tenantId:typeof r.tenantId=="string"?r.tenantId:void 0,registrationId:typeof r.registrationId=="string"?r.registrationId:void 0,resumeAvailable:r.resumeAvailable===!0}}function xk(e,n){const r=e;if(!r||typeof r.path!="string"||r.parentPath!==null&&typeof r.parentPath!="string"||!Array.isArray(r.roots)||!r.roots.every(a=>typeof a=="string")||!Array.isArray(r.entries))throw new Ge(n,"Invalid folder list response");return{path:r.path,parentPath:r.parentPath,roots:r.roots,entries:r.entries.map(a=>Ek(a,n)),...r.truncated===!0?{truncated:!0}:{}}}function Ek(e,n){const r=e;if(!r||typeof r.name!="string"||typeof r.path!="string"||r.kind!=="dir"||typeof r.accessible!="boolean")throw new Ge(n,"Invalid folder list response");return{name:r.name,path:r.path,kind:"dir",accessible:r.accessible}}function Tk(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.label!="string"||typeof r.available!="boolean"||typeof r.signedIn!="boolean")throw new Ge(n,"Invalid Agent CLI metadata response");return{id:r.id,label:r.label,available:r.available,signedIn:r.signedIn}}function kk(e,n){const r=e;if(!r||typeof r.tenantId!="string"||typeof r.tenantLabel!="string"||typeof r.createdAt!="number"||typeof r.sessions!="number"||GS(r))throw new Ge(n,"Invalid tenants response");return{tenantId:r.tenantId,tenantLabel:r.tenantLabel,createdAt:r.createdAt,sessions:r.sessions,status:r.status,cliRunId:typeof r.cliRunId=="string"?r.cliRunId:void 0,registrationId:typeof r.registrationId=="string"?r.registrationId:void 0,theaterId:typeof r.theaterId=="string"?r.theaterId:void 0,terminalSessionId:typeof r.terminalSessionId=="string"?r.terminalSessionId:void 0}}function GS(e){return pk.some(n=>n in e)}function Ak(e,n){const r=e;if(!r||typeof r.workspaces!="number"||typeof r.jobs!="number"||typeof r.version!="string"||r.channel!=="stable"&&r.channel!=="local"&&r.channel!=="unknown"||typeof r.updateAvailable!="boolean"||r.latestVersion!==void 0&&typeof r.latestVersion!="string"||typeof r.port!="number"||r.wikiServerStatus!=="available"&&r.wikiServerStatus!=="unavailable"&&r.wikiServerStatus!=="unknown"||"token"in r||"path"in r||"cwd"in r||"knowledgeRoot"in r)throw new Ge(n,"Invalid observer status response");return{workspaces:r.workspaces,jobs:r.jobs,version:r.version,channel:r.channel,updateAvailable:r.updateAvailable,...r.latestVersion!==void 0?{latestVersion:r.latestVersion}:{},port:r.port,wikiServerStatus:r.wikiServerStatus}}function Rk(e,n){const r=e;if(!r||r.status!=="accepted"||"packageName"in r||"packageVersion"in r||"path"in r||"token"in r)throw new Ge(n,"Invalid update apply response");return{status:"accepted"}}function Lk(e,n){const r=e;if(!r||typeof r.carrierId!="string"||typeof r.displayName!="string"||r.role!==null&&typeof r.role!="string"||typeof r.model!="string"||r.effort!==null&&typeof r.effort!="string"||typeof r.taskForceBackendCount!="number"||typeof r.subagentMode!="boolean"||r.category!==void 0&&r.category!=="strategy"&&r.category!=="planning"&&r.category!=="operations"||typeof r.slot!="number"||typeof r.cliType!="string"||"token"in r||"key"in r||"credential"in r||"cwd"in r||"path"in r||"persona"in r||"prompt"in r||"toolAllowlist"in r||"allowedExecutorTools"in r)throw new Ge(n,"Invalid carrier readiness response");return{carrierId:r.carrierId,displayName:r.displayName,role:r.role,model:r.model,effort:r.effort,taskForceBackendCount:r.taskForceBackendCount,subagentMode:r.subagentMode,...r.category?{category:r.category}:{},slot:r.slot,cliType:r.cliType}}function KS(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.label!="string"||"path"in r||typeof r.createdAt!="string"||typeof r.lastOpenedAt!="string"||typeof r.hasWiki!="boolean"||typeof r.activeAdmiralCount!="number")throw new Ge(n,"Invalid Theater response");return{id:r.id,label:r.label,createdAt:r.createdAt,lastOpenedAt:r.lastOpenedAt,hasWiki:r.hasWiki,activeAdmiralCount:r.activeAdmiralCount}}async function Ln(e){if(e.ok)return;let n=e.statusText;try{n=(await e.json()).error??n}catch{}throw new Ge(e.status,n||`HTTP ${e.status}`)}const Hb=120,Mk="active",Qp=new Set(["done","error","aborted"]);function Dk(e,n){let r=YS(e,n.jobId,n.updatedAt);for(const a of n.events)r=VS(r,a);return Qp.has(n.status)&&!Qp.has(r.status)&&(r={...r,status:n.status}),r}function VS(e,n){if(n.id<=e.lastEventId)return e;const r=n.event,a={...e,updatedAt:n.at,lastEventId:n.id,recentEvents:$k(e.recentEvents,n)};switch(n.type){case"job:registered":return Bk(a,r);case"job:finalized":return{...a,status:un(r.status)??"done",finishedAt:gs(r.finishedAt)??n.at,summary:un(r.summary),error:un(r.error)};case"track:begin":return Ga(a,r,o=>({...o,startedAt:gs(r.startedAt)??n.at,requestPreview:un(r.requestPreview)}));case"track:status":return Ga(a,r,o=>({...o,status:un(r.status)??o.status}));case"track:text":return Ga(a,r,o=>({...o,status:"stream",text:o.text+(un(r.text)??""),sentTextLength:o.sentTextLength+(gs(r.textLength)??un(r.text)?.length??0)}));case"track:thought":return Ga(a,r,o=>({...o,thought:o.thought+(un(r.text)??""),sentThoughtLength:o.sentThoughtLength+(gs(r.textLength)??un(r.text)?.length??0)}));case"track:tool":return Ga(a,r,o=>({...o,status:"stream",tools:jk(o.tools,r)}));case"track:finalized":return Ga(a,r,o=>{const v=Fb(o.text,o.sentTextLength,un(r.fallbackText),gs(r.fallbackTextLength)),m=Fb(o.thought,o.sentThoughtLength,un(r.fallbackThought),gs(r.fallbackThoughtLength));return{...o,status:un(r.status)??"done",finishedAt:gs(r.finishedAt)??n.at,error:un(r.error),text:v.text,sentTextLength:v.sentLength,thought:m.text,sentThoughtLength:m.sentLength}});default:return a}}function YS(e,n,r){return{jobId:n,tenantId:e,status:Mk,updatedAt:r,trackOrder:[],tracks:{},lastEventId:0,recentEvents:[]}}function Li(e){return Qp.has(e)}function Ok(e,n,r){if(!n.operationsViewActive)return new Set;if(e==="classic")return n.activeTerminalSessionId?new Set([n.activeTerminalSessionId]):new Set;const a=new Set(r.minimized),o=new Set;for(const v of Object.keys(r.panels))a.has(v)||o.add(v);return o}function Nk(e,n){const r=[],a=[];for(const o of e)n.has(o.sessionId)?a.push(o):r.push(o);return{hidden:r,visible:a}}function Ub(e){const n=new Map;for(const r of[...e].sort((a,o)=>o.lastRaisedSeq-a.lastRaisedSeq)){const a=r.theaterId??"__unknown__",o=n.get(a)??{theaterId:r.theaterId,theaterLabel:r.theaterLabel,notifications:[],totalCount:0};o.notifications.push(r),o.totalCount+=r.count,n.set(a,o)}return[...n.values()].sort((r,a)=>{const o=r.notifications[0]?.lastRaisedSeq??0;return(a.notifications[0]?.lastRaisedSeq??0)-o})}function Ik(e,n){return n.globalMute||n.dnd?[]:e.filter(r=>!r.theaterId||n.mutedTheaterIds[r.theaterId]!==!0)}function Bk(e,n){const r=Array.isArray(n.tracks)?n.tracks:[];let a=e.trackOrder,o=e.tracks;for(const v of r){if(!v.trackId)continue;const m=o[v.trackId],c={...m??XS(v.trackId),displayName:v.displayName??m?.displayName??v.trackId,displayCli:v.displayCli??m?.displayCli,model:v.model??m?.model,effort:v.effort??m?.effort,subtitle:v.subtitle??m?.subtitle,kind:v.kind??m?.kind,startedAt:v.startedAt??m?.startedAt};m||(a=[...a,v.trackId]),o={...o,[v.trackId]:c}}return{...e,label:un(n.label)??e.label,ownerCarrierId:un(n.ownerCarrierId)??e.ownerCarrierId,kind:un(n.kind)??e.kind,startedAt:gs(n.startedAt)??e.startedAt,trackOrder:a,tracks:o}}function Ga(e,n,r){const a=un(n.trackId);if(!a)return e;const o=e.tracks[a],v=r(o??XS(a));return{...e,trackOrder:o?e.trackOrder:[...e.trackOrder,a],tracks:{...e.tracks,[a]:v}}}function XS(e){return{trackId:e,displayName:e,status:"queued",text:"",thought:"",sentTextLength:0,sentThoughtLength:0,tools:[]}}function Fb(e,n,r,a){const o=a??r?.length??0;return r!==void 0&&o>e.length?{text:r,sentLength:Math.max(o,n)}:{text:e,sentLength:Math.max(n,o)}}function jk(e,n){const r=un(n.title)??"tool",a=un(n.status)??"",o=un(n.toolCallId),v=o??`${r}#${e.length}`;if(o){const m=e.findIndex(c=>c.key===o);if(m>=0){const c=[...e];return c[m]={key:o,title:r,status:a},c}}return[...e,{key:v,title:r,status:a}]}function $k(e,n){const r=[...e,n];return r.length>Hb?r.slice(-Hb):r}function un(e){return typeof e=="string"?e:void 0}function gs(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function ZS(e){return new Date(e).toLocaleTimeString([],{hour12:!1})}function xs(e){return e.label?.trim()||`#${e.sequence} Operation`}function zk(e,n){const r=Math.max(0,Math.round((n-e)/1e3)),a=Math.floor(r/60),o=r%60;return a===0?`${o}s`:a<60?`${a}m ${String(o).padStart(2,"0")}s`:`${Math.floor(a/60)}h ${String(a%60).padStart(2,"0")}m`}function Fl(e){return e.length<=14?e:`${e.slice(0,6)}…${e.slice(-6)}`}function Jg(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function na(e){switch(e){case"active":return"running";case"done":return"done";case"error":return"error";case"aborted":return"aborted";default:return e}}function Pk(e){switch(e){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 e}}function uo(e,n){return e.status==="dormant"?"tenant-beacon is-dormant":n>0?"tenant-beacon is-live":e.turnState==="running"?"tenant-beacon is-turn-running":e.turnState==="ended"?"tenant-beacon is-turn-ended":"tenant-beacon"}function Es(e){switch(e){case"stream":case"active":case"conn":return"live";case"done":return"ok";case"err":case"error":return"bad";default:return"idle"}}function Hk(e){if(e.status!=="active")return null;const n=e.trackOrder.map(o=>e.tracks[o]).filter(o=>!!o),r=n.filter(o=>o.status==="stream"||o.status==="conn"),a=r.length>0?r:n;for(let o=a.length-1;o>=0;o--){const v=a[o],m=v?Uk(v):null;if(m)return m}return null}function Uk(e){return qb(e.text)??qb(e.thought)??e.tools[e.tools.length-1]?.title??null}function qb(e){if(!e)return null;const n=e.split(`
12
- `);for(let r=n.length-1;r>=0;r--){const a=n[r]?.trim();if(a)return a}return null}const Fk="__unassigned__";function qk(e){const n=new Map(e.theaters.map(a=>[a.id,a])),r=[];for(const a of e.sessionOrder){const o=e.sessions[a];o&&o.theaterId&&r.push(Kk(o,n.get(o.theaterId)))}return r}function Wk(e,n){const r=JS(n);return r.length===0?e:e.filter(a=>{const o=Vk(a);return r.every(v=>o.includes(v))})}function Gk(e){const n=[],r=new Map;for(const a of e){const o=a.theaterId??Fk,v=r.get(o);if(v!==void 0){const m=n[v];m&&(n[v]={...m,entries:[...m.entries,a]});continue}r.set(o,n.length),n.push({theaterId:a.theaterId,theaterLabel:a.theaterLabel,entries:[a]})}return n}function JS(e){return e.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean)}function Kk(e,n){return{sessionId:e.sessionId,theaterId:e.theaterId??null,theaterLabel:n?.label??e.theaterId??"",operationName:xs(e),cliLabel:e.cliLabel,status:e.status}}function Vk(e){return[e.operationName,e.theaterLabel,e.cliLabel??""].join(" ").toLocaleLowerCase()}const Yk="fleet-console.canvas.shell.",Xk=400,Wb=560,Gb=360,eg=new Set;let ti={},ia=null,ra=null,ws=null;function Zk(){return z.useSyncExternalStore(QS,Yb,Yb)}function Jk(){return z.useSyncExternalStore(QS,Kb,Kb)}function Kb(){return ia}function Qu(e){ia!==e&&(ia=e,_o())}function Qk(e,n){const r=oA();return ti={...ti,[r]:{theaterId:e,geometry:n}},Qg(),_o(),r}function Yf(e,n){const r=ti[e];r&&(ti={...ti,[e]:{...r,geometry:n}},Qg(),_o())}function Vb(e){if(!(e in ti))return;const n={...ti};delete n[e],ti=n,ia===e&&(ia=null),Qg(),_o()}function eA(e){nA(),ra=e,ti=e?iA(e):{},ia=null,LT(aA(ti)),_o()}function tA(e){if(typeof window<"u")try{window.sessionStorage.removeItem(em(e))}catch{}ra===e&&(ew(),ra=null,ti={},ia=null,_o())}function QS(e){return eg.add(e),()=>{eg.delete(e)}}function Yb(){return ti}function _o(){for(const e of eg)e()}function Qg(){!ra||typeof window>"u"||(ew(),ws=window.setTimeout(()=>{ws=null,tw(ra,ti)},Xk))}function nA(){!ws||!ra||typeof window>"u"||(window.clearTimeout(ws),ws=null,tw(ra,ti))}function ew(){!ws||typeof window>"u"||(window.clearTimeout(ws),ws=null)}function iA(e){if(typeof window>"u")return{};try{const n=window.sessionStorage.getItem(em(e));return n?rA(JSON.parse(n),e):{}}catch{return{}}}function tw(e,n){if(!(!e||typeof window>"u"))try{window.sessionStorage.setItem(em(e),JSON.stringify({panels:n}))}catch{}}function em(e){return`${Yk}${e}`}function rA(e,n){if(!Pu(e)||!Pu(e.panels))return{};const r={};for(const[a,o]of Object.entries(e.panels))!a.startsWith("shell:")||!Pu(o)||o.theaterId===n&&(r[a]={theaterId:n,geometry:sA(o.geometry)});return r}function sA(e){return Pu(e)?{x:Xf(e.x,0),y:Xf(e.y,0),width:Xb(e.width,Wb),height:Xb(e.height,Gb),zIndex:Xf(e.zIndex,0)}:{x:0,y:0,width:Wb,height:Gb,zIndex:0}}function aA(e){return Math.max(0,...Object.values(e).map(n=>n.geometry.zIndex))}function Xf(e,n){return typeof e=="number"&&Number.isFinite(e)?e:n}function Xb(e,n){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:n}function Pu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function oA(){return`shell:${typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}`}const Ui={version:"1.9.0",date:"2026-06-20",sections:[{heading:"Added",items:["Fleet Console adds a Model Sign-in section to the global Settings screen to register, verify, and remove a provider API key so carriers can run on that model, starting with Moonshot Kimi; keys are validated against the provider, stored locally, and never shown back in the browser.","Installing Fleet Console globally via npm now automatically opens the console in the browser when the install finishes, limited to interactive desktop installs and skipped in CI, headless, or non-global installs; set `FLEET_CONSOLE_NO_AUTO_OPEN` to opt out.","Add Claude GLM (ZhipuAI GLM) as a selectable Claude-family provider across the CLI and Console, including `fleet auth` login/logout support.","The Settings Model Sign-in section now lists ZhipuAI GLM alongside Moonshot Kimi, so its API key can be registered, validated, and signed out directly from the Console.","Settings now shows whether each Agent CLI (Claude Code, Codex CLI, OpenCode, Cursor Agent) is installed and its detected version.","The Codex Side panel can be opened from a right-edge handle on any non-Codex view","The Codex Side panel header offers manual collapse toggles for its left (Nav) and right (ToC/Manifest) panes","The Codex Cmd+K search palette is scoped to the Side panel region in Side view instead of covering the full screen","The Codex Wiki reading view caps the body to a single reading measure and reclaims wasted whitespace on wide screens, drops the empty rail on browse and index views, and folds the raw source view into the same shell","The Codex Wiki reading rail lists the table of contents first with active-section highlighting above a collapsible manifest, adds a contents drawer on narrow viewports, and shows breadcrumbs on entries","Console self-update flow applies a global `fleet-cli` + `fleet-console` update directly from the topbar button instead of opening an npm registry link.","Self-update blocks while a terminal Operation has a live PTY and rejects local/unpublished builds, then restarts the console on a fresh random loopback port and opens it in a new browser window.","CLI update subsystem now shares the generic core-agent package-updater substrate while preserving CLI-specific shutdown and messaging lifecycle.","Generic global package updater factory for package-manager detection, global-root checks, version resolution, install spawning, and manual fallback messages.","Fleet Console now shows a What's new popup that lists the installed version's changelog entries grouped by Added/Changed/Fixed/Removed; it opens automatically once after a version update and can be reopened anytime from a What's new control in the global navigation bar.","Add a GitHub repository link and live star count beside the GNB Research Preview badge","Fleet Console Operations Map panels can now be minimized to a collapsible bottom dock and restored to their original position and size by double-clicking the dock entry or its restore button; the dock collapses to a single expand/collapse handle, each entry shows the panel's status light, name, Agent CLI, and active job count, and both the collapsed handle and the entries pulse while a minimized panel is busy.",'Operations are now automatically named from the first meaningful line of each submitted prompt (for both Claude and Codex sessions), so a new Operation no longer stays as the generic "#N Operation" once work starts. A manual rename always takes over and is never overwritten by auto-naming, and clearing the name re-enables it.']},{heading:"Changed",items:["Fleet Console no longer raises an Operation's completion toast while that Operation still has a carrier job running, since the work is still in progress and the live Operation panel already reflects it.","Replaced running Operation attention motion with a consistent perimeter signal across open panels and minimized Dock controls.","Aligned minimized Operation labels with open panel title typography.","The Operations Map minimized-panel dock now expands upward from a centered bottom handle (an up/down chevron), laying its entries out centered and growing them to fit the available screen width (kept clear of the left shortcuts and right radar instruments) before paging overflow behind previous/next controls with a page indicator, so existing entries no longer shift when the count changes.","A busy minimized-panel entry now signals progress with a running light that travels around its full outline instead of an outward breathing pulse, and the dock handle's attention animation only plays while the dock is collapsed.","A minimized operation now restores with a single click anywhere on its dock chip (previously a double-click), and the redundant per-chip restore button has been removed.","Operation completion and input-waiting alerts now group by Theater in a left-docked notification panel that stays available and opens or closes from an edge handle instead of a flat stack of separate toasts, showing only Operations that are not currently visible.","The notification cluster distinguishes completion and input-waiting per Operation, counts repeated input-waiting attention, and adds global mute, do-not-disturb, and per-Theater mute controls.","Cluster alerts clear automatically when an Operation resumes work, and are removed when its session or Theater is deleted, so stale rows no longer linger.","The Operation launch menus now disable an Agent CLI choice when its CLI is not installed, or when a sign-in-gated model is not signed in, labeling each disabled choice with the reason, and the server rejects session-creation requests for those CLIs.","Theme selection and terminal renderer controls move out of the global navigation bar into a new Appearance section at the top of the Settings screen, decluttering the navigation bar; both still apply immediately and are remembered per browser."]},{heading:"Fixed",items:["A Fleet Console run from source (`pnpm fleet-console`) now stores its persisted Theaters, Operations, and session captures under the project workspace instead of the shared home directory, so a development console no longer mixes its state with a globally installed Fleet Console.","Operation auto-naming now updates only from the first submitted prompt unless the operator clears the name to re-enable automatic naming.",'Stopped a carrier-dispatch idle pause from raising a false "Awaiting orders" notification while the dispatched carrier job is still running; genuine input-waiting prompts (permission requests, questions, elicitation dialogs) still notify as before.',"The Operations sidebar collapse state in the Map view now persists when navigating to Codex full mode and back, instead of resetting to expanded.","Operations Map panel positions and sizes now persist across a browser refresh instead of resetting to defaults.","Map shell panels now survive a browser refresh instead of disappearing.","Fixed other open Operations terminals showing a corrupted display when an additional terminal was opened or a minimized terminal was restored from the dock.","Mouse clicks and drag selections inside an Operations Map terminal now land on the correct cell after zooming the map in or out, instead of being offset until the view was reset."]},{heading:"Removed",items:["Fleet Console no longer raises a toast when a carrier sorties; the live Operation panel already reflects the active job.","Fleet no longer renders user-global (`~/.fleet`) or project-local (`.fleet`) skills, agents, and hooks into Agent CLI sessions; only the built-in Fleet plugin is activated.","Deprecated user-global and project plugin registrations and their leftover marketplace directories are pruned from Codex and the Fleet marketplace on launch.","[fleet-cli] [fleet-console] Removed the automatic migration of legacy auth credentials from the old `~/.fleet/agent/auth.json` location; Fleet now reads and writes only `~/.fleet/auth.json`, so credentials left in the old location are no longer picked up and must be re-added with `fleet auth login`."]}]},tg=200,ng="fleet-console.activeTheaterId",nw="fleet-console.activeTheme",iw="fleet-console.terminalRenderer",rw="fleet-console.expandedSessions",sw="fleet-console.commissioningSeen",aw="fleet-console.whatsNewSeenVersion",ow="fleet-console.notificationPreferences",lw=1,Zf="maritime",Jf="webgl",gu={globalMute:!1,dnd:!1,mutedTheaterIds:{}},Zb="shell",ig=new Set;let rg=null,ve={connection:"connecting",connectionError:null,activeTheme:yw(),terminalRenderer:fA(),version:"",updateAvailable:!1,latestVersion:null,tenants:[],theaters:[],agentClis:[],activeTheaterId:null,addingTheater:!1,theaterError:null,sessions:{},sessionOrder:[],activeTerminalSessionId:null,operationsViewActive:!1,creatingTerminalSession:!1,terminalSessionError:null,tenantJobs:{},tenantOrder:[],timelineOpen:!1,shellOpen:!1,operationSearchOpen:!1,shortcutsOpen:!1,whatsNewOpen:!1,onboardingOpen:!1,bootstrapped:!1,terminalSessionsHydrated:!1,pendingOperationFocus:null,selectedJobId:null,expandedSessionIds:HA(),operationNotifications:{},notificationPreferences:UA()},Jb=0;function Qb(){return ve}function lA(e){return ig.add(e),()=>{ig.delete(e)}}function ze(e){ve={...ve,...e},Sw()}function cA(e){ve.operationsViewActive!==e&&ze({operationsViewActive:e})}function uA(){cw(yw())}function hA(e){WA(e),cw(e),ze({activeTheme:e})}function dA(e){GA(e),ze({terminalRenderer:e})}function fA(){if(typeof window>"u")return Jf;try{const e=window.localStorage.getItem(iw);return e==="webgl"||e==="dom"?e:Jf}catch{return Jf}}function pA(e){const n=Ui!==null&&Ui.version===e.version&&qA()!==e.version;ze({version:e.version,updateAvailable:e.updateAvailable,latestVersion:e.latestVersion??null,whatsNewOpen:n?!0:ve.whatsNewOpen})}function cw(e){if(!(typeof document>"u")){if(e==="maritime"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",e)}}function gA(e){const n={};for(const o of e)n[o.sessionId]=Th(o);const r=[...e].sort((o,v)=>v.createdAt-o.createdAt).map(o=>o.sessionId),a=vw(n,ve.tenants);ze({sessions:a,sessionOrder:r,activeTerminalSessionId:Ts(ve.activeTheaterId,a,r,ve.activeTerminalSessionId),terminalSessionsHydrated:!0})}function uw(e){const n=bw(e.theaters,ve.activeTheaterId);ze({theaters:e.theaters,agentClis:e.agentClis,activeTheaterId:n,activeTerminalSessionId:Ts(n,ve.sessions,ve.sessionOrder,ve.activeTerminalSessionId),selectedJobId:null})}function mA(e){Ah(e),ze({activeTheaterId:e,activeTerminalSessionId:Ts(e,ve.sessions,ve.sessionOrder,null),selectedJobId:null})}function hw(){ze({addingTheater:!0,theaterError:null})}function dw(e){const n=[e,...ve.theaters.filter(r=>r.id!==e.id)];Ah(e.id),ze({theaters:n,activeTheaterId:e.id,addingTheater:!1,theaterError:null,activeTerminalSessionId:Ts(e.id,ve.sessions,ve.sessionOrder,null),selectedJobId:null})}function _A(){ze({addingTheater:!1,theaterError:null})}function sg(e){ze({addingTheater:!1,theaterError:e})}function Qn(e){ze({activeTerminalSessionId:e,selectedJobId:null,operationNotifications:e?kh(ve.operationNotifications,e):ve.operationNotifications})}function tm(e){const n=ve.sessions[e];n&&(Ah(n.theaterId??null),ze({activeTheaterId:n.theaterId??null,activeTerminalSessionId:e,selectedJobId:null,pendingOperationFocus:e,operationNotifications:kh(ve.operationNotifications,e)}))}function Qf(){ve.pendingOperationFocus!==null&&ze({pendingOperationFocus:null})}function vA(e,n,r){if(e.length===0)return null;const a=n?e.indexOf(n):-1,o=a===-1?r>0?0:e.length-1:(a+r+e.length)%e.length;return e[o]??null}function ep(){ze({operationSearchOpen:!1})}function bA(){ze({operationSearchOpen:!ve.operationSearchOpen})}function eh(){ze({creatingTerminalSession:!0,terminalSessionError:null})}function th(e){const n=Th(e);ze({sessions:{...ve.sessions,[n.sessionId]:n},sessionOrder:[n.sessionId,...ve.sessionOrder.filter(r=>r!==n.sessionId)],activeTerminalSessionId:!ve.activeTheaterId||ih(n,ve.activeTheaterId)?n.sessionId:ve.activeTerminalSessionId,creatingTerminalSession:!1,terminalSessionError:null,selectedJobId:null})}function Cs(e){const n=ve.sessions[e.sessionId],r=Th({...n??{},...e}),a=!!n,o={...ve.sessions,[r.sessionId]:r},v=a?ve.sessionOrder:[r.sessionId,...ve.sessionOrder.filter(c=>c!==r.sessionId)],m=n?jA(ve.operationNotifications,n,r):ve.operationNotifications;ze({sessions:o,sessionOrder:v,activeTerminalSessionId:Ts(ve.activeTheaterId,o,v,ve.activeTerminalSessionId),operationNotifications:m})}function yA(e,n){const r=ve.sessions[e.sessionId]??Th(e);n==="idle_prompt"&&_w(r)||ze({operationNotifications:mw(ve.operationNotifications,gw("input-waiting",r))})}function SA(e){const n={...ve.notificationPreferences,globalMute:e};sm(n),ze({notificationPreferences:n})}function wA(e){const n={...ve.notificationPreferences,dnd:e};sm(n),ze({notificationPreferences:n})}function CA(e){const n={...ve.notificationPreferences.mutedTheaterIds};n[e]?delete n[e]:n[e]=!0;const r={...ve.notificationPreferences,mutedTheaterIds:n};sm(r),ze({notificationPreferences:r})}function nh(e){ze({creatingTerminalSession:!1,terminalSessionError:e})}function xA(){ze({timelineOpen:!ve.timelineOpen})}function fw(){if(ve.shellOpen){Al();return}ze({shellOpen:!0})}function Al(){ve.shellOpen&&ze({shellOpen:!1})}function EA(){ve.shortcutsOpen||ze({shortcutsOpen:!0})}function tp(){ve.shortcutsOpen&&ze({shortcutsOpen:!1})}function TA(){Ui===null||ve.whatsNewOpen||ze({whatsNewOpen:!0})}function mu(){ve.whatsNewOpen&&(ve.version&&VA(ve.version),ze({whatsNewOpen:!1}))}function e1(){ve.onboardingOpen||ze({onboardingOpen:!0})}function ml(){KA(!0),ve.onboardingOpen&&ze({onboardingOpen:!1})}function t1(){if(ve.bootstrapped)return;const e=ve.theaters.length===0&&!FA();ze({bootstrapped:!0,onboardingOpen:e?!0:ve.onboardingOpen})}function kA(e){const n=ve.expandedSessionIds.includes(e)?ve.expandedSessionIds.filter(r=>r!==e):[...ve.expandedSessionIds,e];rm(n),ze({expandedSessionIds:n})}function Ch(e){ze({terminalSessionError:e})}function xh(e){ze({terminalSessionError:e})}function nm(e){ze({terminalSessionError:e})}function n1(e){tA(e);const n=ve.theaters.filter(c=>c.id!==e),r={},a=[];for(const c of ve.sessionOrder){const u=ve.sessions[c];!u||u.theaterId===e||(r[c]=u,a.push(c))}const o=bw(n,ve.activeTheaterId===e?null:ve.activeTheaterId),v=ve.expandedSessionIds.filter(c=>r[c]),m=$A(ve.operationNotifications,e);Ah(o),rm(v),ze({theaters:n,sessions:r,sessionOrder:a,activeTheaterId:o,activeTerminalSessionId:Ts(o,r,a,ve.activeTerminalSessionId),selectedJobId:null,expandedSessionIds:v,operationNotifications:m})}function Zl(e){if(!ve.sessions[e])return;const n={...ve.sessions};delete n[e];const r=ve.sessionOrder.filter(v=>v!==e),a=ve.expandedSessionIds.filter(v=>v!==e),o=ve.activeTerminalSessionId===e;rm(a),ze({sessions:n,sessionOrder:r,activeTerminalSessionId:o?Ts(ve.activeTheaterId,n,r,null):ve.activeTerminalSessionId,selectedJobId:o?null:ve.selectedJobId,expandedSessionIds:a,operationNotifications:kh(ve.operationNotifications,e)})}function Eh(e){ze({selectedJobId:ve.selectedJobId===e?null:e})}function np(){ze({selectedJobId:null})}function pw(e){const n=new Set(e.map(o=>o.tenantId)),r=vw(ve.sessions,e),a=[...e.map(o=>o.tenantId),...ve.tenantOrder.filter(o=>!n.has(o)&&ve.tenantJobs[o])];ze({tenants:e,sessions:r,tenantOrder:a,activeTerminalSessionId:Ts(ve.activeTheaterId,r,ve.sessionOrder,ve.activeTerminalSessionId)})}function AA(e){const n={},r=[];for(const o of e){const v={};for(const c of o.jobs)v[c.jobId]=Dk(o.tenantId,c);const m=Object.values(v).sort((c,u)=>(c.startedAt??c.updatedAt)-(u.startedAt??u.updatedAt)).map(c=>c.jobId);n[o.tenantId]={tenantId:o.tenantId,tenantLabel:o.tenantLabel,jobOrder:m,jobs:v,truncation:o.truncation},r.push(o.tenantId)}const a=[...ve.tenantOrder.filter(o=>n[o]),...r.filter(o=>!ve.tenantOrder.includes(o))];ze({tenantJobs:n,tenantOrder:a.length>0?a:r})}function RA(e,n){const r=ve.tenantJobs[e.tenantId],a=!r&&!ve.tenants.some(c=>c.tenantId===e.tenantId),o=r??{tenantId:e.tenantId,tenantLabel:n,jobOrder:[],jobs:{},truncation:{droppedCount:0}};let v=n&&o.tenantLabel!==n?{...o,tenantLabel:n}:o;if(e.jobId){const c=v.jobs[e.jobId],u=VS(c??YS(e.tenantId,e.jobId,e.at),e),h=c?v.jobOrder:[...v.jobOrder,e.jobId];v={...v,jobs:YA({...v.jobs,[e.jobId]:u},h),jobOrder:h.slice(-tg)}}const m={...ve.tenantJobs,[e.tenantId]:v};return ve={...ve,connection:"live",connectionError:null,tenantJobs:m,tenantOrder:ve.tenantOrder.includes(e.tenantId)?ve.tenantOrder:[...ve.tenantOrder,e.tenantId]},Sw(),{unknownTenant:a}}function LA(e,n,r){const a=ve.tenantJobs[e]??{tenantId:e,tenantLabel:n,jobOrder:[],jobs:{},truncation:{droppedCount:0}};ze({tenantJobs:{...ve.tenantJobs,[e]:{...a,truncation:r}},tenantOrder:ve.tenantOrder.includes(e)?ve.tenantOrder:[...ve.tenantOrder,e]})}function MA(e){if(!e.selectedJobId||e.activeTheaterId&&e.activeTerminalSessionId&&!sa(e).includes(e.activeTerminalSessionId))return null;const n=DA(e);return n?e.tenantJobs[n]?.jobs[e.selectedJobId]??null:null}function DA(e){return e.activeTerminalSessionId?im(e.sessions[e.activeTerminalSessionId]):null}function OA(e){return sa(e).map(n=>e.sessions[n]).filter(n=>!!n)}function sa(e){return e.activeTheaterId?e.sessionOrder.filter(n=>ih(e.sessions[n],e.activeTheaterId)):[]}function NA(e){return qk(e)}function Jl(e,n){const r=im(n);if(!r)return[];const a=e.tenantJobs[r];if(!a)return[];const o=[];for(const v of a.jobOrder){const m=a.jobs[v];m&&o.push({job:m,tenant:a})}return o}function IA(e,n){return n?e.expandedSessionIds.includes(n):!1}function im(e){return e?.tenantId??e?.sessionId??null}function Th(e){return{...e,terminalSessionId:e.terminalSessionId??e.sessionId,status:e.status==="starting"&&e.tenantId?"registered":e.status,turnState:e.turnState??"none",resumeAvailable:e.resumeAvailable===!0}}function BA(e){return e?ve.theaters.find(n=>n.id===e)?.label??e:"—"}function gw(e,n){return Jb+=1,{kind:e,sessionId:n.sessionId,theaterId:n.theaterId??null,theaterLabel:BA(n.theaterId),operationLabel:xs(n),count:1,lastRaisedSeq:Jb}}function jA(e,n,r){return n.turnState!=="running"&&r.turnState==="running"?kh(e,r.sessionId):n.turnState!=="ended"&&r.turnState==="ended"&&!_w(r)?mw(e,gw("ended",r)):e}function mw(e,n){const r=e[n.sessionId];return{...e,[n.sessionId]:{...n,count:r?.kind==="input-waiting"&&n.kind==="input-waiting"?r.count+1:1}}}function kh(e,n){if(!e[n])return e;const r={...e};return delete r[n],r}function $A(e,n){let r=!1;const a={};for(const[o,v]of Object.entries(e)){if(v.theaterId===n){r=!0;continue}a[o]=v}return r?a:e}function _w(e){const n=im(e);return n?zA(ve.tenantJobs[n]):!1}function zA(e){return e?e.jobOrder.some(n=>{const r=e.jobs[n];return r?!r.finishedAt&&!Li(r.status):!1}):!1}function vw(e,n){const r={...e};for(const a of n){if(!a.terminalSessionId)continue;const o=r[a.terminalSessionId];o&&(r[a.terminalSessionId]={...o,status:a.status==="closed"?"closed":a.status==="dormant"?"dormant":"registered",tenantId:a.tenantId,registrationId:a.registrationId,theaterId:a.theaterId??o.theaterId})}return r}function bw(e,n){const r=new Set(e.map(o=>o.id)),a=PA();return a&&r.has(a)?a:n&&r.has(n)?n:e[0]?.id??null}function Ts(e,n,r,a){return e?a&&ih(n[a],e)&&_u(n[a])?a:r.find(o=>ih(n[o],e)&&_u(n[o]))??null:a&&n[a]&&_u(n[a])?a:r.find(o=>_u(n[o]))??null}function ih(e,n){return!e||!n?!1:e.theaterId===n}function _u(e){return!!(e&&e.status!=="dormant")}function PA(){if(typeof window>"u")return null;try{return window.localStorage.getItem(ng)}catch{return null}}function Ah(e){if(!(typeof window>"u"))try{e?window.localStorage.setItem(ng,e):window.localStorage.removeItem(ng)}catch{}}function yw(){if(typeof window>"u")return Zf;try{const e=window.localStorage.getItem(nw);return e==="maritime"||e==="carbon"?e:Zf}catch{return Zf}}function HA(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(rw);if(!e)return[];const n=JSON.parse(e);return Array.isArray(n)?n.filter(r=>typeof r=="string"):[]}catch{return[]}}function UA(){if(typeof window>"u")return gu;try{const e=window.localStorage.getItem(ow);if(!e)return gu;const n=JSON.parse(e);return XA(n)?{globalMute:n.preferences.globalMute,dnd:n.preferences.dnd,mutedTheaterIds:n.preferences.mutedTheaterIds}:gu}catch{return gu}}function FA(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(sw)==="1"}catch{return!1}}function qA(){if(rg!==null)return rg;if(typeof window>"u")return null;try{return window.localStorage.getItem(aw)}catch{return null}}function WA(e){if(!(typeof window>"u"))try{window.localStorage.setItem(nw,e)}catch{}}function GA(e){if(!(typeof window>"u"))try{window.localStorage.setItem(iw,e)}catch{}}function rm(e){if(!(typeof window>"u"))try{window.localStorage.setItem(rw,JSON.stringify(e))}catch{}}function sm(e){if(!(typeof window>"u"))try{window.localStorage.setItem(ow,JSON.stringify({version:lw,preferences:e}))}catch{}}function KA(e){if(!(typeof window>"u"))try{window.localStorage.setItem(sw,e?"1":"0")}catch{}}function VA(e){if(rg=e,!(typeof window>"u"))try{window.localStorage.setItem(aw,e)}catch{}}function YA(e,n){if(n.length<=tg)return e;const r=new Set(n.slice(-tg)),a={};for(const o of Object.keys(e))r.has(o)&&(a[o]=e[o]);return a}function XA(e){if(!e||typeof e!="object")return!1;const n=e;if(n.version!==lw||!n.preferences||typeof n.preferences.globalMute!="boolean"||typeof n.preferences.dnd!="boolean")return!1;const r=n.preferences.mutedTheaterIds;return!!r&&typeof r=="object"&&!Array.isArray(r)}function Sw(){for(const e of ig)e()}const vu="directory-browser-sectors";function ww({open:e,onCancel:n,onConfirm:r}){const[a,o]=z.useState(null),[v,m]=z.useState(null),[c,u]=z.useState(null),[h,S]=z.useState(""),[f,C]=z.useState(0),x=z.useRef(null),k=z.useRef(null),E=async(O,F)=>{m(O),u(null),S(""),C(0);try{const U=await bk(O,F);o(U)}catch(U){if(U instanceof DOMException&&U.name==="AbortError")return;u(U instanceof Ge?U.message:String(U))}finally{m(null)}};z.useEffect(()=>{if(!e)return;const O=new AbortController;return E(null,O.signal),()=>O.abort()},[e]),z.useEffect(()=>{e&&x.current?.focus()},[e,a?.path]);const g=a?.entries??[],b=z.useMemo(()=>{const O=h.trim().toLowerCase();return O===""?g:g.filter(F=>F.name.toLowerCase().includes(O))},[g,h]),p=z.useMemo(()=>a?ZA(a):[],[a]),y=b.length===0?-1:Math.min(f,b.length-1);if(z.useEffect(()=>{if(y<0)return;k.current?.querySelector(`[data-index="${y}"]`)?.scrollIntoView({block:"nearest"})},[y,a?.path]),!e)return null;const T=O=>{O.accessible&&v===null&&E(O.path)},A=()=>{a?.parentPath!=null&&v===null&&E(a.parentPath)},L=a?.path??null,M=y>=0?`${vu}-${y}`:void 0,R=O=>{switch(O.key){case"Escape":h!==""?S(""):n();return;case"ArrowDown":O.preventDefault(),C(F=>Math.min(F+1,Math.max(b.length-1,0)));return;case"ArrowUp":O.preventDefault(),C(F=>Math.max(F-1,0));return;case"Enter":{O.preventDefault();const F=b[y];F&&T(F);return}case"Backspace":h===""&&(O.preventDefault(),A());return;default:return}};return vT.createPortal(d.jsxs("div",{className:"directory-browser-overlay",role:"presentation",children:[d.jsx("button",{type:"button",className:"directory-browser-scrim","aria-label":"Close",onClick:n}),d.jsxs("section",{className:"directory-browser-card",role:"dialog","aria-modal":"true","aria-label":"Establish Theater of Operations",onKeyDown:R,children:[d.jsxs("header",{className:"directory-browser-header",children:[d.jsx("span",{className:"directory-browser-sigil","aria-hidden":"true",children:d.jsx(QA,{})}),d.jsxs("div",{className:"directory-browser-heading",children:[d.jsx("span",{className:"directory-browser-kicker",children:"Theater of Operations"}),d.jsx("h2",{children:"Establish Theater"})]}),d.jsx("button",{type:"button",className:"directory-browser-close",onClick:n,"aria-label":"Close",children:"×"})]}),d.jsx("nav",{className:"directory-browser-course","aria-label":"Path",children:p.map((O,F)=>{const U=F===p.length-1;return d.jsxs("span",{className:"directory-browser-course-seg",children:[F>0?d.jsx("span",{className:"directory-browser-course-sep","aria-hidden":"true",children:"›"}):null,d.jsx("button",{type:"button",className:`directory-browser-crumb ${U?"is-current":""}`,"aria-current":U?"location":void 0,disabled:U||v!==null,title:O.path,onClick:()=>{E(O.path)},children:O.label})]},O.path)})}),d.jsxs("div",{className:"directory-browser-toolbar",children:[d.jsxs("div",{className:"directory-browser-filter",children:[d.jsx("span",{className:"directory-browser-filter-glyph","aria-hidden":"true",children:d.jsx(t3,{})}),d.jsx("input",{ref:x,type:"text",className:"directory-browser-filter-input",placeholder:"Filter sectors…","aria-label":"Filter folders","aria-controls":vu,value:h,spellCheck:!1,autoComplete:"off",onChange:O=>{S(O.target.value),C(0)}})]}),d.jsxs("button",{type:"button",className:"directory-browser-up",disabled:a?.parentPath==null||v!==null,title:"Up one sector (Backspace)",onClick:A,children:[d.jsx(n3,{}),d.jsx("span",{children:"Up"})]})]}),c?d.jsx("p",{className:"directory-browser-error",role:"alert",children:c}):null,d.jsx("div",{className:"directory-browser-list",id:vu,role:"listbox","aria-label":"Folders","aria-busy":v!==null,"aria-activedescendant":M,ref:k,children:v!==null?d.jsxs("p",{className:"directory-browser-state is-live",children:[d.jsx("span",{className:"directory-browser-scan-dot","aria-hidden":"true"}),"Scouting…"]}):b.length===0?d.jsx("p",{className:"directory-browser-state",children:h!==""?"No sectors match the filter.":"No sectors to advance into."}):b.map((O,F)=>d.jsxs("div",{id:`${vu}-${F}`,"data-index":F,role:"option","aria-selected":F===y,"aria-disabled":!O.accessible,className:`directory-browser-sector ${F===y?"is-active":""} ${O.accessible?"":"is-locked"}`,title:O.path,onClick:()=>{C(F),T(O)},children:[d.jsx("span",{className:"directory-browser-sector-glyph","aria-hidden":"true",children:d.jsx(e3,{})}),d.jsx("span",{className:"directory-browser-sector-name",children:O.name}),O.accessible?d.jsx("span",{className:"directory-browser-sector-advance","aria-hidden":"true",children:"›"}):d.jsxs("span",{className:"directory-browser-sector-lock",children:[d.jsx(i3,{})," Locked"]})]},O.path))}),a?.truncated?d.jsx("p",{className:"directory-browser-note",children:"Charting first 500 sectors only."}):null,d.jsxs("footer",{className:"directory-browser-actions",children:[d.jsxs("div",{className:"directory-browser-target",children:[d.jsx("span",{className:"directory-browser-target-label",children:"Theater Root"}),d.jsx("span",{className:"directory-browser-target-path",title:L??"",children:L??"Scouting…"})]}),d.jsxs("div",{className:"directory-browser-buttons",children:[d.jsx("button",{type:"button",className:"directory-browser-button",onClick:n,children:"Cancel"}),d.jsx("button",{type:"button",className:"directory-browser-button is-primary",disabled:L===null||v!==null,onClick:()=>L&&r(L),children:"Establish Theater"})]})]})]})]}),document.body)}function ZA(e){if(JA(e)==="/"){const m=[{label:"/",path:"/"}];let c="";for(const u of e.path.split("/").filter(Boolean))c+=`/${u}`,m.push({label:u,path:c});return m}const r=/^([A-Za-z]:)\\?/.exec(e.path),a=r?`${r[1]}\\`:e.roots[0]??"C:\\",o=[{label:a,path:a}];let v=a.replace(/\\$/,"");for(const m of e.path.slice(a.length).split("\\").filter(Boolean))v+=`\\${m}`,o.push({label:m,path:v});return o}function JA(e){return e.roots.some(n=>/^[A-Za-z]:\\$/.test(n))||/^[A-Za-z]:\\/.test(e.path)?"\\":"/"}function QA(){return d.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[d.jsx("circle",{cx:"10",cy:"10",r:"6.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),d.jsx("circle",{cx:"10",cy:"10",r:"2.1",fill:"currentColor"}),d.jsx("path",{d:"M10 1.6v3.2M10 15.2v3.2M1.6 10h3.2M15.2 10h3.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function e3(){return d.jsx("svg",{viewBox:"0 0 18 18","aria-hidden":"true",children:d.jsx("path",{d:"M2.4 5.2c0-.7.6-1.3 1.3-1.3h2.7l1.4 1.5h6.5c.7 0 1.3.6 1.3 1.3v6.4c0 .7-.6 1.3-1.3 1.3H3.7c-.7 0-1.3-.6-1.3-1.3z",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinejoin:"round"})})}function t3(){return d.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[d.jsx("circle",{cx:"7",cy:"7",r:"4.2",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),d.jsx("path",{d:"M10.2 10.2 13.5 13.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}function n3(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M8 12.5V4M4.5 7.5 8 4l3.5 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"})})}function i3(){return d.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[d.jsx("rect",{x:"3.6",y:"7",width:"8.8",height:"6.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),d.jsx("path",{d:"M5.6 7V5.4a2.4 2.4 0 0 1 4.8 0V7",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}const r3=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function s3({state:e}){const[n,r]=z.useState(!1),a=z.useRef(null),o=z.useRef(null),v=z.useRef(null),m=e.theaters.length>0;if(z.useEffect(()=>{if(e.onboardingOpen)return a.current=document.activeElement,o.current?.focus(),()=>{const S=a.current;a.current=null,S?.focus?.()}},[e.onboardingOpen]),z.useEffect(()=>{if(!e.onboardingOpen)return;const S=f=>{n||(f.key==="Escape"?(f.preventDefault(),ml()):f.key==="Tab"&&a3(f,v.current),f.stopImmediatePropagation())};return window.addEventListener("keydown",S,!0),()=>window.removeEventListener("keydown",S,!0)},[n,e.onboardingOpen]),!e.onboardingOpen)return null;const c=()=>{r(!0)},u=()=>{r(!1)},h=async S=>{r(!1),hw();try{const f=await WS(S),C=await qS(f);dw(C)}catch(f){sg(f instanceof Error?f.message:String(f))}};return d.jsxs("div",{className:"commissioning-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"commissioning-title",children:[d.jsx("button",{type:"button",className:"commissioning-scrim",onClick:ml,"aria-label":"Close Commissioning guide"}),d.jsxs("section",{className:"commissioning-card",ref:v,children:[d.jsxs("header",{className:"commissioning-header",children:[d.jsx("span",{className:"commissioning-eyebrow",children:"COMMISSIONING · FLEET CONSOLE"}),d.jsx("h2",{id:"commissioning-title",children:"Bring your fleet online"}),d.jsx("p",{children:"Three steps to go from an empty bridge to live carrier operations."})]}),d.jsxs("ol",{className:"commissioning-steps",children:[d.jsxs("li",{className:`commissioning-step commissioning-step--primary ${m?"is-complete":"is-current"}`,children:[d.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:m?"✓":"01"}),d.jsxs("div",{className:"commissioning-step-body",children:[d.jsx("h3",{children:"Register a Theater"}),d.jsx("p",{children:"A Theater is a project directory the fleet operates in. Choose the folder you want to work from."}),m?d.jsx(Pl,{ref:S=>{o.current=S},className:"commissioning-primary-action",to:"/operations",onClick:ml,children:"Go to Operations →"}):d.jsx("button",{ref:S=>{o.current=S},type:"button",className:"commissioning-primary-action is-live",disabled:e.addingTheater,onClick:c,children:e.addingTheater?"Adding Theater…":"Choose a folder…"}),e.theaterError?d.jsx("p",{className:"commissioning-error",role:"alert",children:e.theaterError}):null]})]}),d.jsxs("li",{className:"commissioning-step",children:[d.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:"02"}),d.jsxs("div",{className:"commissioning-step-body",children:[d.jsx("h3",{children:"Open an Operation"}),d.jsx("p",{children:"An Operation is a live terminal session running an Agent CLI. Start one from the Operations tab to begin a working session."}),d.jsx(Pl,{className:"commissioning-secondary-link",to:"/operations",onClick:ml,children:"Go to Operations"})]})]}),d.jsxs("li",{className:"commissioning-step",children:[d.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:"03"}),d.jsxs("div",{className:"commissioning-step-body",children:[d.jsx("h3",{children:"Observe carriers"}),d.jsx("p",{children:"Carriers are specialist agents your Admiral dispatches. Their sorties stream here in real time as they run."})]})]})]}),d.jsxs("footer",{className:"commissioning-footer",children:[d.jsx("p",{children:"Theaters with a Fleet Wiki knowledge root also unlock Codex — your decision log and reference library."}),d.jsx("button",{type:"button",className:"commissioning-skip",onClick:ml,children:"Skip for now"})]})]}),d.jsx(ww,{open:n,onCancel:u,onConfirm:h})]})}function a3(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(r3)),a=r[0],o=r[r.length-1];!a||!o||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a.focus()))}function Ql(){return z.useSyncExternalStore(lA,Qb,Qb)}const o3={ended:"Stood down","input-waiting":"Awaiting orders"},Cw="fleet-console.notificationsDockOpen",ip=!1;function l3(){const e=Ql(),n=ES(),r=bh(),a=Yl(),[o,v]=z.useState(c3),[m,c]=z.useState(!1),u=z.useMemo(()=>Object.values(e.operationNotifications),[e.operationNotifications]),h=Ok(r,e,n),S=Nk(u,h).hidden,f=Ik(S,e.notificationPreferences),C=Ub(f),x=Ub(S),k=C.reduce((A,L)=>A+L.totalCount,0),E=i1(C,"input-waiting"),g=i1(C,"ended");h3(e.notificationPreferences);const b=C.length===0,p=b?"muted":E>0?"awaiting":"ended",y=A=>{tm(A.sessionId),a("/operations")},T=A=>{v(A),u3(A)};return o?d.jsx("div",{className:"notification-dock-layer",children:d.jsxs("aside",{className:`notification-dock ${p==="awaiting"?"has-awaiting":""}`,"aria-live":"polite","aria-label":"Operation notifications",children:[d.jsxs("header",{className:"notification-dock-head",children:[d.jsx("span",{className:"notification-dock-eyebrow",children:"Notifications"}),b?null:d.jsxs("span",{className:"notification-dock-tallies","aria-hidden":"true",children:[E>0?d.jsx("span",{className:"notification-tally is-input-waiting",children:E}):null,g>0?d.jsx("span",{className:"notification-tally is-ended",children:g}):null]}),d.jsx("button",{type:"button",className:"notification-dock-icon",onClick:()=>c(!m),"aria-expanded":m,"aria-label":"Notification settings",title:"Notification settings",children:d.jsx(p3,{})}),d.jsx("button",{type:"button",className:"notification-dock-icon",onClick:()=>T(!1),"aria-label":"Close notifications",title:"Close",children:d.jsx(g3,{})})]}),m?d.jsx(d3,{groups:x}):null,b?d.jsx("p",{className:"notification-dock-empty",children:"No active alerts"}):d.jsx("div",{className:"notification-dock-deck",children:C.map(A=>d.jsxs("section",{className:"notification-cluster-group",children:[d.jsxs("header",{className:"notification-cluster-group-head",children:[d.jsx("span",{className:"notification-cluster-theater",children:A.theaterLabel}),d.jsx("span",{className:"notification-cluster-group-count",children:A.totalCount})]}),d.jsx("ul",{className:"notification-cluster-roster",children:A.notifications.map(L=>d.jsxs("li",{className:`notification-row is-${L.kind}`,children:[d.jsx("span",{className:"notification-row-beacon","aria-hidden":"true"}),d.jsxs("span",{className:"notification-row-body",children:[d.jsx("span",{className:"notification-row-op",children:L.operationLabel}),d.jsx("span",{className:"notification-row-state",children:o3[L.kind]})]}),L.count>1?d.jsx("span",{className:"notification-row-count",children:L.count}):null,d.jsx("button",{type:"button",className:"notification-row-move",onClick:()=>y(L),"aria-label":`Open ${A.theaterLabel} ${L.operationLabel}`,children:"Open"})]},L.sessionId))})]},A.theaterId??"__unknown__"))})]})}):d.jsxs("button",{type:"button",className:`notification-handle is-${p} ${p==="awaiting"?"has-awaiting":""}`,onClick:()=>T(!0),"aria-label":`Open notifications (${k})`,children:[d.jsx("span",{className:"notification-handle-count",children:b?0:k}),d.jsx("span",{className:"notification-handle-label",children:"Alerts"}),d.jsx(m3,{className:"notification-handle-chevron"})]})}function c3(){if(typeof window>"u")return ip;try{const e=window.localStorage.getItem(Cw);return e===null?ip:e==="true"}catch{return ip}}function u3(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Cw,String(e))}catch{}}function h3(e){return e.globalMute||e.dnd||Object.keys(e.mutedTheaterIds).length>0}function i1(e,n){let r=0;for(const a of e)for(const o of a.notifications)o.kind===n&&(r+=o.count);return r}function d3({groups:e}){const n=Ql(),r=f3(e,n.notificationPreferences.mutedTheaterIds,n.theaters);return d.jsxs("div",{className:"notification-cluster-settings",role:"dialog","aria-label":"Notification settings",children:[d.jsx("p",{className:"notification-cluster-settings-eyebrow",children:"Display"}),d.jsxs("label",{className:"notification-cluster-setting",children:[d.jsx("input",{type:"checkbox",checked:n.notificationPreferences.globalMute,onChange:a=>SA(a.currentTarget.checked)}),d.jsx("span",{children:"Mute all"})]}),d.jsxs("label",{className:"notification-cluster-setting",children:[d.jsx("input",{type:"checkbox",checked:n.notificationPreferences.dnd,onChange:a=>wA(a.currentTarget.checked)}),d.jsx("span",{children:"Do not disturb"})]}),r.length>0?d.jsx("p",{className:"notification-cluster-settings-eyebrow",children:"By Theater"}):null,r.map(a=>d.jsxs("label",{className:"notification-cluster-setting",children:[d.jsx("input",{type:"checkbox",checked:a.theaterId?n.notificationPreferences.mutedTheaterIds[a.theaterId]===!0:!1,onChange:()=>{a.theaterId&&CA(a.theaterId)}}),d.jsx("span",{children:a.theaterLabel})]},a.theaterId))]})}function f3(e,n,r){const a=new Map;for(const o of e)o.theaterId&&a.set(o.theaterId,o);for(const o of Object.keys(n))a.has(o)||a.set(o,{theaterId:o,theaterLabel:r.find(v=>v.id===o)?.label??o,notifications:[],totalCount:0});return[...a.values()]}function p3(){return d.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[d.jsx("path",{d:"M8 5.4a2.6 2.6 0 1 1 0 5.2 2.6 2.6 0 0 1 0-5.2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.25"}),d.jsx("path",{d:"M8 2.2v1.6M8 12.2v1.6M3.9 3.9 5 5M11 11l1.1 1.1M2.2 8h1.6M12.2 8h1.6M3.9 12.1 5 11M11 5l1.1-1.1",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]})}function g3(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M4 4l8 8M12 4l-8 8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function m3({className:e}){return d.jsx("svg",{className:e,viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M6 4l4 4-4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const xw=[{title:"Console",entries:[{combos:[["Mod","K"]],description:"Search Operations across Theaters"},{combos:[["Mod","`"]],description:"Toggle the local shell"},{combos:[["Esc"]],description:"Close the open overlay or menu"}]},{title:"Operations",entries:[{combos:[["Esc"]],description:"Close the carrier job stream"},{combos:[["Shift","Enter"]],description:"Insert a newline in the terminal instead of submitting"},{combos:[["Enter"],["Esc"]],description:"Confirm or cancel a session rename"},{combos:[["↑"],["↓"]],description:"Move between Theater, Theme, and launch menu items"}]},{title:"Map",entries:[{combos:[["Alt","←"],["Alt","→"]],description:"Focus the previous / next Operation (also in Helm)"},{combos:[["Drag"]],description:"Pan the operations map"},{combos:[["Shift","Drag"]],description:"Draw a new Operation terminal"},{combos:[["Space","Drag"]],description:"Pan even while a terminal has focus"},{combos:[["Scroll"]],description:"Zoom the map in or out"},{combos:[["Right-click"]],description:"Open the canvas actions menu"},{combos:[["Double-click"]],description:"Focus a panel from its title bar; rename from its name"},{combos:[["Click"]],description:"Clear terminal focus on the empty canvas"}]},{title:"Codex",entries:[{combos:[["Mod","K"]],description:"Toggle the command palette"},{combos:[["↑"],["↓"]],description:"Move through command palette results"},{combos:[["Enter"]],description:"Open the selected result"},{combos:[["Tab"]],description:"Move focus within the command palette"},{combos:[["Esc"]],description:"Close the command palette or diagram lightbox"},{combos:[["+"],["−"],["0"]],description:"Zoom the diagram lightbox in / out / reset"},{combos:[["F"]],description:"Fit the diagram lightbox to the viewport"}]}],_3=/mac|iphone|ipad|ipod/i,v3=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function b3({state:e}){const n=z.useRef(null),r=z.useRef(null),a=z.useRef(null);if(e.shortcutsOpen&&n.current===null&&(n.current=document.activeElement),z.useEffect(()=>{if(!e.shortcutsOpen)return;const v=m=>{m.key==="Escape"?(tp(),m.preventDefault()):m.key==="Tab"&&S3(m,a.current),m.stopImmediatePropagation()};return r.current?.focus(),window.addEventListener("keydown",v,!0),()=>{window.removeEventListener("keydown",v,!0);const m=n.current;n.current=null,m?.focus?.()}},[e.shortcutsOpen]),!e.shortcutsOpen)return null;const o=y3();return d.jsxs("div",{className:"shortcuts-overlay",role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",children:[d.jsx("button",{type:"button",className:"shortcuts-overlay-scrim",onClick:tp,"aria-label":"Close keyboard shortcuts"}),d.jsxs("section",{className:"shortcuts-overlay-card",ref:a,children:[d.jsxs("header",{className:"shortcuts-overlay-header",children:[d.jsx("span",{className:"shortcuts-overlay-kicker",children:"Reference Map"}),d.jsx("h2",{children:"Keyboard Shortcuts"})]}),d.jsx("button",{ref:r,type:"button",className:"shortcuts-overlay-close",onClick:tp,"aria-label":"Close keyboard shortcuts",children:"×"}),d.jsx("div",{className:"shortcuts-overlay-groups",children:xw.map(v=>d.jsxs("section",{className:"shortcuts-group","aria-labelledby":`shortcuts-${v.title.toLowerCase()}`,children:[d.jsx("h3",{id:`shortcuts-${v.title.toLowerCase()}`,children:v.title}),d.jsx("dl",{className:"shortcuts-list",children:v.entries.map(m=>d.jsxs("div",{className:"shortcuts-entry",children:[d.jsx("dt",{className:"shortcuts-combos",children:m.combos.map((c,u)=>d.jsxs("span",{className:"shortcuts-combo",children:[u>0?d.jsx("span",{className:"shortcuts-combo-separator",children:"or"}):null,d.jsx("span",{className:"shortcuts-keyset",children:c.map(h=>d.jsx("kbd",{children:h==="Mod"?o:h},h))})]},`${m.description}:${c.join("+")}`))}),d.jsx("dd",{children:m.description})]},`${v.title}:${m.description}`))})]},v.title))})]})]})}function y3(){const n=navigator.userAgentData?.platform??navigator.platform;return _3.test(n)?"⌘":"Ctrl"}function S3(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(v3)),a=r[0],o=r[r.length-1];!a||!o||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a.focus()))}var rp={exports:{}},r1;function w3(){return r1||(r1=1,(function(e,n){(function(r,a){e.exports=a()})(self,(()=>(()=>{var r={};return(()=>{var a=r;Object.defineProperty(a,"__esModule",{value:!0}),a.FitAddon=void 0,a.FitAddon=class{activate(o){this._terminal=o}dispose(){}fit(){const o=this.proposeDimensions();if(!o||!this._terminal||isNaN(o.cols)||isNaN(o.rows))return;const v=this._terminal._core;this._terminal.rows===o.rows&&this._terminal.cols===o.cols||(v._renderService.clear(),this._terminal.resize(o.cols,o.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const o=this._terminal._core,v=o._renderService.dimensions;if(v.css.cell.width===0||v.css.cell.height===0)return;const m=this._terminal.options.scrollback===0?0:o.viewport.scrollBarWidth,c=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(c.getPropertyValue("height")),h=Math.max(0,parseInt(c.getPropertyValue("width"))),S=window.getComputedStyle(this._terminal.element),f=u-(parseInt(S.getPropertyValue("padding-top"))+parseInt(S.getPropertyValue("padding-bottom"))),C=h-(parseInt(S.getPropertyValue("padding-right"))+parseInt(S.getPropertyValue("padding-left")))-m;return{cols:Math.max(2,Math.floor(C/v.css.cell.width)),rows:Math.max(1,Math.floor(f/v.css.cell.height))}}}})(),r})()))})(rp)),rp.exports}var C3=w3(),Hu={exports:{}},x3=Hu.exports,s1;function E3(){return s1||(s1=1,(function(e,n){(function(r,a){e.exports=a()})(x3,(()=>(()=>{var r={433:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV11=void 0;const h=u(938),S=[[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]],x=[[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 k;function E(g,b){let p,y=0,T=b.length-1;if(g<b[0][0]||g>b[T][1])return!1;for(;T>=y;)if(p=y+T>>1,g>b[p][1])y=p+1;else{if(!(g<b[p][0]))return!0;T=p-1}return!1}c.UnicodeV11=class{constructor(){if(this.version="11",!k){k=new Uint8Array(65536),k.fill(1),k[0]=0,k.fill(0,1,32),k.fill(0,127,160);for(let g=0;g<S.length;++g)k.fill(0,S[g][0],S[g][1]+1);for(let g=0;g<C.length;++g)k.fill(2,C[g][0],C[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?k[g]:E(g,f)?0:E(g,x)?2:1}charProperties(g,b){let p=this.wcwidth(g),y=p===0&&b!==0;if(y){const T=h.UnicodeService.extractWidth(b);T===0?y=!1:T>p&&(p=T)}return h.UnicodeService.createPropertyValue(0,p,y)}}},345:(m,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 S=[];for(let f=0;f<this._listeners.length;f++)S.push(this._listeners[f]);for(let f=0;f<S.length;f++)S[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((S=>h.fire(S)))},c.runAndSubscribe=function(u,h){return h(void 0),u((S=>h(S)))}},490:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const h=u(938),S=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],f=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let C;c.UnicodeV6=class{constructor(){if(this.version="6",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160),C.fill(2,4352,4448),C[9001]=2,C[9002]=2,C.fill(2,11904,42192),C[12351]=1,C.fill(2,44032,55204),C.fill(2,63744,64256),C.fill(2,65040,65050),C.fill(2,65072,65136),C.fill(2,65280,65377),C.fill(2,65504,65511);for(let x=0;x<S.length;++x)C.fill(0,S[x][0],S[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?C[x]:(function(k,E){let g,b=0,p=E.length-1;if(k<E[0][0]||k>E[p][1])return!1;for(;p>=b;)if(g=b+p>>1,k>E[g][1])b=g+1;else{if(!(k<E[g][0]))return!0;p=g-1}return!1})(x,f)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,k){let E=this.wcwidth(x),g=E===0&&k!==0;if(g){const b=h.UnicodeService.extractWidth(k);b===0?g=!1:b>E&&(E=b)}return h.UnicodeService.createPropertyValue(0,E,g)}}},938:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const h=u(345),S=u(490);class f{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,k,E=!1){return(16777215&x)<<3|(3&k)<<1|(E?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const x=new S.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let k=0,E=0;const g=x.length;for(let b=0;b<g;++b){let p=x.charCodeAt(b);if(55296<=p&&p<=56319){if(++b>=g)return k+this.wcwidth(p);const A=x.charCodeAt(b);56320<=A&&A<=57343?p=1024*(p-55296)+A-56320+65536:k+=this.wcwidth(A)}const y=this.charProperties(p,E);let T=f.extractWidth(y);f.extractShouldJoin(y)&&(T-=f.extractWidth(E)),k+=T,E=y}return k}charProperties(x,k){return this._activeProvider.charProperties(x,k)}}c.UnicodeService=f}},a={};function o(m){var c=a[m];if(c!==void 0)return c.exports;var u=a[m]={exports:{}};return r[m](u,u.exports,o),u.exports}var v={};return(()=>{var m=v;Object.defineProperty(m,"__esModule",{value:!0}),m.Unicode11Addon=void 0;const c=o(433);m.Unicode11Addon=class{activate(u){u.unicode.register(new c.UnicodeV11)}dispose(){}}})(),v})()))})(Hu)),Hu.exports}var T3=E3();var k3=(e,n,r,a)=>{for(var o=n,v=e.length-1,m;v>=0;v--)(m=e[v])&&(o=m(o)||o);return o},A3=(e,n)=>(r,a)=>n(r,a,e),R3=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?a1.isErrorNoTelemetry(e)?new a1(e.message+`
13
-
14
- `+e.stack):new Error(e.message+`
15
-
16
- `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(n=>{n(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},L3=new R3;function sp(e){M3(e)||L3.onUnexpectedError(e)}var ag="Canceled";function M3(e){return e instanceof D3?!0:e instanceof Error&&e.name===ag&&e.message===ag}var D3=class extends Error{constructor(){super(ag),this.name=this.message}},a1=class og extends Error{constructor(n){super(n),this.name="CodeExpectedError"}static fromError(n){if(n instanceof og)return n;let r=new og;return r.message=n.message,r.stack=n.stack,r}static isErrorNoTelemetry(n){return n.name==="CodeExpectedError"}},O3;(e=>{function n(v){return v<0}e.isLessThan=n;function r(v){return v<=0}e.isLessThanOrEqual=r;function a(v){return v>0}e.isGreaterThan=a;function o(v){return v===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(O3||={});function N3(e,n){let r=this,a=!1,o;return function(){return a||(a=!0,n||(o=e.apply(r,arguments))),o}}var Ew;(e=>{function n(T){return T&&typeof T=="object"&&typeof T[Symbol.iterator]=="function"}e.is=n;let r=Object.freeze([]);function a(){return r}e.empty=a;function*o(T){yield T}e.single=o;function v(T){return n(T)?T:o(T)}e.wrap=v;function m(T){return T||r}e.from=m;function*c(T){for(let A=T.length-1;A>=0;A--)yield T[A]}e.reverse=c;function u(T){return!T||T[Symbol.iterator]().next().done===!0}e.isEmpty=u;function h(T){return T[Symbol.iterator]().next().value}e.first=h;function S(T,A){let L=0;for(let M of T)if(A(M,L++))return!0;return!1}e.some=S;function f(T,A){for(let L of T)if(A(L))return L}e.find=f;function*C(T,A){for(let L of T)A(L)&&(yield L)}e.filter=C;function*x(T,A){let L=0;for(let M of T)yield A(M,L++)}e.map=x;function*k(T,A){let L=0;for(let M of T)yield*A(M,L++)}e.flatMap=k;function*E(...T){for(let A of T)yield*A}e.concat=E;function g(T,A,L){let M=L;for(let R of T)M=A(M,R);return M}e.reduce=g;function*b(T,A,L=T.length){for(A<0&&(A+=T.length),L<0?L+=T.length:L>T.length&&(L=T.length);A<L;A++)yield T[A]}e.slice=b;function p(T,A=Number.POSITIVE_INFINITY){let L=[];if(A===0)return[L,T];let M=T[Symbol.iterator]();for(let R=0;R<A;R++){let O=M.next();if(O.done)return[L,e.empty()];L.push(O.value)}return[L,{[Symbol.iterator](){return M}}]}e.consume=p;async function y(T){let A=[];for await(let L of T)A.push(L);return Promise.resolve(A)}e.asyncToArray=y})(Ew||={});function Tw(e){if(Ew.is(e)){let n=[];for(let r of e)if(r)try{r.dispose()}catch(a){n.push(a)}if(n.length===1)throw n[0];if(n.length>1)throw new AggregateError(n,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function kw(...e){return Nn(()=>Tw(e))}function Nn(e){return{dispose:N3(()=>{e()})}}var Aw=class Rw{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{Tw(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?Rw.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)}};Aw.DISABLE_DISPOSED_WARNING=!1;var ro=Aw,Gi=class{constructor(){this._store=new ro,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)}};Gi.None=Object.freeze({dispose(){}});var _l=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}},am=typeof process<"u"&&"title"in process,Rh=am?"node":navigator.userAgent,I3=am?"node":navigator.platform,B3=Rh.includes("Firefox"),j3=Rh.includes("Edge"),Lw=/^((?!chrome|android).)*safari/i.test(Rh);function $3(){if(!Lw)return 0;let e=Rh.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}I3.indexOf("Linux")>=0;var z3="",mn=0,_n=0,vn=0,Kt=0,Ti={css:"#00000000",rgba:0},$n;(e=>{function n(o,v,m,c){return c!==void 0?`#${Gs(o)}${Gs(v)}${Gs(m)}${Gs(c)}`:`#${Gs(o)}${Gs(v)}${Gs(m)}`}e.toCss=n;function r(o,v,m,c=255){return(o<<24|v<<16|m<<8|c)>>>0}e.toRgba=r;function a(o,v,m,c){return{css:e.toCss(o,v,m,c),rgba:e.toRgba(o,v,m,c)}}e.toColor=a})($n||={});var Rl;(e=>{function n(u,h){if(Kt=(h.rgba&255)/255,Kt===1)return{css:h.css,rgba:h.rgba};let S=h.rgba>>24&255,f=h.rgba>>16&255,C=h.rgba>>8&255,x=u.rgba>>24&255,k=u.rgba>>16&255,E=u.rgba>>8&255;mn=x+Math.round((S-x)*Kt),_n=k+Math.round((f-k)*Kt),vn=E+Math.round((C-E)*Kt);let g=$n.toCss(mn,_n,vn),b=$n.toRgba(mn,_n,vn);return{css:g,rgba:b}}e.blend=n;function r(u){return(u.rgba&255)===255}e.isOpaque=r;function a(u,h,S){let f=ea.ensureContrastRatio(u.rgba,h.rgba,S);if(f)return $n.toColor(f>>24&255,f>>16&255,f>>8&255)}e.ensureContrastRatio=a;function o(u){let h=(u.rgba|255)>>>0;return[mn,_n,vn]=ea.toChannels(h),{css:$n.toCss(mn,_n,vn),rgba:h}}e.opaque=o;function v(u,h){return Kt=Math.round(h*255),[mn,_n,vn]=ea.toChannels(u.rgba),{css:$n.toCss(mn,_n,vn,Kt),rgba:$n.toRgba(mn,_n,vn,Kt)}}e.opacity=v;function m(u,h){return Kt=u.rgba&255,v(u,Kt*h/255)}e.multiplyOpacity=m;function c(u){return[u.rgba>>24&255,u.rgba>>16&255,u.rgba>>8&255]}e.toColorRGB=c})(Rl||={});var P3;(e=>{let n,r;try{let o=document.createElement("canvas");o.width=1,o.height=1;let v=o.getContext("2d",{willReadFrequently:!0});v&&(n=v,n.globalCompositeOperation="copy",r=n.createLinearGradient(0,0,1,1))}catch{}function a(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return mn=parseInt(o.slice(1,2).repeat(2),16),_n=parseInt(o.slice(2,3).repeat(2),16),vn=parseInt(o.slice(3,4).repeat(2),16),$n.toColor(mn,_n,vn);case 5:return mn=parseInt(o.slice(1,2).repeat(2),16),_n=parseInt(o.slice(2,3).repeat(2),16),vn=parseInt(o.slice(3,4).repeat(2),16),Kt=parseInt(o.slice(4,5).repeat(2),16),$n.toColor(mn,_n,vn,Kt);case 7:return{css:o,rgba:(parseInt(o.slice(1),16)<<8|255)>>>0};case 9:return{css:o,rgba:parseInt(o.slice(1),16)>>>0}}let v=o.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(v)return mn=parseInt(v[1]),_n=parseInt(v[2]),vn=parseInt(v[3]),Kt=Math.round((v[5]===void 0?1:parseFloat(v[5]))*255),$n.toColor(mn,_n,vn,Kt);if(!n||!r)throw new Error("css.toColor: Unsupported css format");if(n.fillStyle=r,n.fillStyle=o,typeof n.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(n.fillRect(0,0,1,1),[mn,_n,vn,Kt]=n.getImageData(0,0,1,1).data,Kt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:$n.toRgba(mn,_n,vn,Kt),css:o}}e.toColor=a})(P3||={});var Bn;(e=>{function n(a){return r(a>>16&255,a>>8&255,a&255)}e.relativeLuminance=n;function r(a,o,v){let m=a/255,c=o/255,u=v/255,h=m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4),S=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+S*.7152+f*.0722}e.relativeLuminance2=r})(Bn||={});var ea;(e=>{function n(m,c){if(Kt=(c&255)/255,Kt===1)return c;let u=c>>24&255,h=c>>16&255,S=c>>8&255,f=m>>24&255,C=m>>16&255,x=m>>8&255;return mn=f+Math.round((u-f)*Kt),_n=C+Math.round((h-C)*Kt),vn=x+Math.round((S-x)*Kt),$n.toRgba(mn,_n,vn)}e.blend=n;function r(m,c,u){let h=Bn.relativeLuminance(m>>8),S=Bn.relativeLuminance(c>>8);if(Lr(h,S)<u){if(S<h){let x=a(m,c,u),k=Lr(h,Bn.relativeLuminance(x>>8));if(k<u){let E=o(m,c,u),g=Lr(h,Bn.relativeLuminance(E>>8));return k>g?x:E}return x}let f=o(m,c,u),C=Lr(h,Bn.relativeLuminance(f>>8));if(C<u){let x=a(m,c,u),k=Lr(h,Bn.relativeLuminance(x>>8));return C>k?f:x}return f}}e.ensureContrastRatio=r;function a(m,c,u){let h=m>>24&255,S=m>>16&255,f=m>>8&255,C=c>>24&255,x=c>>16&255,k=c>>8&255,E=Lr(Bn.relativeLuminance2(C,x,k),Bn.relativeLuminance2(h,S,f));for(;E<u&&(C>0||x>0||k>0);)C-=Math.max(0,Math.ceil(C*.1)),x-=Math.max(0,Math.ceil(x*.1)),k-=Math.max(0,Math.ceil(k*.1)),E=Lr(Bn.relativeLuminance2(C,x,k),Bn.relativeLuminance2(h,S,f));return(C<<24|x<<16|k<<8|255)>>>0}e.reduceLuminance=a;function o(m,c,u){let h=m>>24&255,S=m>>16&255,f=m>>8&255,C=c>>24&255,x=c>>16&255,k=c>>8&255,E=Lr(Bn.relativeLuminance2(C,x,k),Bn.relativeLuminance2(h,S,f));for(;E<u&&(C<255||x<255||k<255);)C=Math.min(255,C+Math.ceil((255-C)*.1)),x=Math.min(255,x+Math.ceil((255-x)*.1)),k=Math.min(255,k+Math.ceil((255-k)*.1)),E=Lr(Bn.relativeLuminance2(C,x,k),Bn.relativeLuminance2(h,S,f));return(C<<24|x<<16|k<<8|255)>>>0}e.increaseLuminance=o;function v(m){return[m>>24&255,m>>16&255,m>>8&255,m&255]}e.toChannels=v})(ea||={});function Gs(e){let n=e.toString(16);return n.length<2?"0"+n:n}function Lr(e,n){return e<n?(n+.05)/(e+.05):(e+.05)/(n+.05)}function hn(e){if(!e)throw new Error("value must not be falsy");return e}function om(e){return 57508<=e&&e<=57558}function H3(e){return 57520<=e&&e<=57527}function U3(e){return 57344<=e&&e<=63743}function F3(e){return 9472<=e&&e<=9631}function q3(e){return e>=128512&&e<=128591||e>=127744&&e<=128511||e>=128640&&e<=128767||e>=9728&&e<=9983||e>=9984&&e<=10175||e>=65024&&e<=65039||e>=129280&&e<=129535||e>=127462&&e<=127487}function W3(e,n,r,a){return n===1&&r>Math.ceil(a*1.5)&&e!==void 0&&e>255&&!q3(e)&&!om(e)&&!U3(e)}function Mw(e){return om(e)||F3(e)}function G3(){return{css:{canvas:bu(),cell:bu()},device:{canvas:bu(),cell:bu(),char:{width:0,height:0,left:0,top:0}}}}function bu(){return{width:0,height:0}}function K3(e,n,r=0){return(e-(Math.round(n)*2-r))%(Math.round(n)*2)}var kn=0,gn=0,Qi=!1,Mr=!1,yu=!1,Zn,ap=0,V3=class{constructor(e,n,r,a,o,v){this._terminal=e,this._optionService=n,this._selectionRenderModel=r,this._decorationService=a,this._coreBrowserService=o,this._themeService=v,this.result={fg:0,bg:0,ext:0}}resolve(e,n,r,a){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=e.bg&268435456?e.extended.ext:0,gn=0,kn=0,Mr=!1,Qi=!1,yu=!1,Zn=this._themeService.colors,ap=0,e.getCode()!==0&&e.extended.underlineStyle===4){let o=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));ap=n*a%(Math.round(o)*2)}if(this._decorationService.forEachDecorationAtCell(n,r,"bottom",o=>{o.backgroundColorRGB&&(gn=o.backgroundColorRGB.rgba>>8&16777215,Mr=!0),o.foregroundColorRGB&&(kn=o.foregroundColorRGB.rgba>>8&16777215,Qi=!0)}),yu=this._selectionRenderModel.isCellSelected(this._terminal,n,r),yu){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:gn=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:gn=(this.result.fg&16777215)<<8|255;break;default:gn=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:gn=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:gn=(this.result.bg&16777215)<<8|255;break}gn=ea.blend(gn,(this._coreBrowserService.isFocused?Zn.selectionBackgroundOpaque:Zn.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else gn=(this._coreBrowserService.isFocused?Zn.selectionBackgroundOpaque:Zn.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Mr=!0,Zn.selectionForeground&&(kn=Zn.selectionForeground.rgba>>8&16777215,Qi=!0),Mw(e.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)kn=(this._coreBrowserService.isFocused?Zn.selectionBackgroundOpaque:Zn.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:kn=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:kn=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:kn=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:kn=(this.result.fg&16777215)<<8|255;break;default:kn=this._themeService.colors.foreground.rgba}kn=ea.blend(kn,(this._coreBrowserService.isFocused?Zn.selectionBackgroundOpaque:Zn.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}Qi=!0}}this._decorationService.forEachDecorationAtCell(n,r,"top",o=>{o.backgroundColorRGB&&(gn=o.backgroundColorRGB.rgba>>8&16777215,Mr=!0),o.foregroundColorRGB&&(kn=o.foregroundColorRGB.rgba>>8&16777215,Qi=!0)}),Mr&&(yu?gn=e.bg&-16777216&-134217729|gn|50331648:gn=e.bg&-16777216|gn|50331648),Qi&&(kn=e.fg&-16777216&-67108865|kn|50331648),this.result.fg&67108864&&(Mr&&!Qi&&((this.result.bg&50331648)===0?kn=this.result.fg&-134217728|Zn.background.rgba>>8&16777215&16777215|50331648:kn=this.result.fg&-134217728|this.result.bg&67108863,Qi=!0),!Mr&&Qi&&((this.result.fg&50331648)===0?gn=this.result.bg&-67108864|Zn.foreground.rgba>>8&16777215&16777215|50331648:gn=this.result.bg&-67108864|this.result.fg&67108863,Mr=!0)),Zn=void 0,this.result.bg=Mr?gn:this.result.bg,this.result.fg=Qi?kn:this.result.fg,this.result.ext&=536870911,this.result.ext|=ap<<29&3758096384}},Y3=.5,Dw=B3||j3?"bottom":"ideographic",X3={"▀":[{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}]},Z3={"░":[[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]]},J3={"─":{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:(e,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"║":{1:(e,n)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╒":{1:(e,n)=>`M.5,1 L.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╓":{1:(e,n)=>`M${.5-e},1 L${.5-e},.5 L1,.5 M${.5+e},.5 L${.5+e},1`},"╔":{1:(e,n)=>`M1,${.5-n} L${.5-e},${.5-n} L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1`},"╕":{1:(e,n)=>`M0,${.5-n} L.5,${.5-n} L.5,1 M0,${.5+n} L.5,${.5+n}`},"╖":{1:(e,n)=>`M${.5+e},1 L${.5+e},.5 L0,.5 M${.5-e},.5 L${.5-e},1`},"╗":{1:(e,n)=>`M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M0,${.5-n} L${.5+e},${.5-n} L${.5+e},1`},"╘":{1:(e,n)=>`M.5,0 L.5,${.5+n} L1,${.5+n} M.5,${.5-n} L1,${.5-n}`},"╙":{1:(e,n)=>`M1,.5 L${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╚":{1:(e,n)=>`M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0 M1,${.5+n} L${.5-e},${.5+n} L${.5-e},0`},"╛":{1:(e,n)=>`M0,${.5+n} L.5,${.5+n} L.5,0 M0,${.5-n} L.5,${.5-n}`},"╜":{1:(e,n)=>`M0,.5 L${.5+e},.5 L${.5+e},0 M${.5-e},.5 L${.5-e},0`},"╝":{1:(e,n)=>`M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0 M0,${.5+n} L${.5+e},${.5+n} L${.5+e},0`},"╞":{1:(e,n)=>`M.5,0 L.5,1 M.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╟":{1:(e,n)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1 M${.5+e},.5 L1,.5`},"╠":{1:(e,n)=>`M${.5-e},0 L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1 M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0`},"╡":{1:(e,n)=>`M.5,0 L.5,1 M0,${.5-n} L.5,${.5-n} M0,${.5+n} L.5,${.5+n}`},"╢":{1:(e,n)=>`M0,.5 L${.5-e},.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╣":{1:(e,n)=>`M${.5+e},0 L${.5+e},1 M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0`},"╤":{1:(e,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n} M.5,${.5+n} L.5,1`},"╥":{1:(e,n)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},1 M${.5+e},.5 L${.5+e},1`},"╦":{1:(e,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1`},"╧":{1:(e,n)=>`M.5,0 L.5,${.5-n} M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╨":{1:(e,n)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╩":{1:(e,n)=>`M0,${.5+n} L1,${.5+n} M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0 M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0`},"╪":{1:(e,n)=>`M.5,0 L.5,1 M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╫":{1:(e,n)=>`M0,.5 L1,.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╬":{1:(e,n)=>`M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1 M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0 M1,${.5-n} L${.5+e},${.5-n} L${.5+e},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:(e,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,1,.5`},"╮":{1:(e,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,0,.5`},"╯":{1:(e,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,0,.5`},"╰":{1:(e,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,1,.5`}},ql={"":{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}};ql[""]=ql[""];ql[""]=ql[""];function Q3(e,n,r,a,o,v,m,c){let u=X3[n];if(u)return eR(e,u,r,a,o,v),!0;let h=Z3[n];if(h)return tR(e,h,r,a,o,v),!0;let S=J3[n];if(S)return nR(e,S,r,a,o,v,c),!0;let f=ql[n];return f?(iR(e,f,r,a,o,v,m,c),!0):!1}function eR(e,n,r,a,o,v){for(let m=0;m<n.length;m++){let c=n[m],u=o/8,h=v/8;e.fillRect(r+c.x*u,a+c.y*h,c.w*u,c.h*h)}}var o1=new Map;function tR(e,n,r,a,o,v){let m=o1.get(n);m||(m=new Map,o1.set(n,m));let c=e.fillStyle;if(typeof c!="string")throw new Error(`Unexpected fillStyle type "${c}"`);let u=m.get(c);if(!u){let h=n[0].length,S=n.length,f=e.canvas.ownerDocument.createElement("canvas");f.width=h,f.height=S;let C=hn(f.getContext("2d")),x=new ImageData(h,S),k,E,g,b;if(c.startsWith("#"))k=parseInt(c.slice(1,3),16),E=parseInt(c.slice(3,5),16),g=parseInt(c.slice(5,7),16),b=c.length>7&&parseInt(c.slice(7,9),16)||1;else if(c.startsWith("rgba"))[k,E,g,b]=c.substring(5,c.length-1).split(",").map(p=>parseFloat(p));else throw new Error(`Unexpected fillStyle color format "${c}" when drawing pattern glyph`);for(let p=0;p<S;p++)for(let y=0;y<h;y++)x.data[(p*h+y)*4]=k,x.data[(p*h+y)*4+1]=E,x.data[(p*h+y)*4+2]=g,x.data[(p*h+y)*4+3]=n[p][y]*(b*255);C.putImageData(x,0,0),u=hn(e.createPattern(f,null)),m.set(c,u)}e.fillStyle=u,e.fillRect(r,a,o,v)}function nR(e,n,r,a,o,v,m){e.strokeStyle=e.fillStyle;for(let[c,u]of Object.entries(n)){e.beginPath(),e.lineWidth=m*Number.parseInt(c);let h;if(typeof u=="function"){let S=.15/v*o;h=u(.15,S)}else h=u;for(let S of h.split(" ")){let f=S[0],C=Ow[f];if(!C){console.error(`Could not find drawing instructions for "${f}"`);continue}let x=S.substring(1).split(",");!x[0]||!x[1]||C(e,Nw(x,o,v,r,a,!0,m))}e.stroke(),e.closePath()}}function iR(e,n,r,a,o,v,m,c){let u=new Path2D;u.rect(r,a,o,v),e.clip(u),e.beginPath();let h=m/12;e.lineWidth=c*h;for(let S of n.d.split(" ")){let f=S[0],C=Ow[f];if(!C){console.error(`Could not find drawing instructions for "${f}"`);continue}let x=S.substring(1).split(",");!x[0]||!x[1]||C(e,Nw(x,o,v,r,a,!1,c,(n.leftPadding??0)*(h/2),(n.rightPadding??0)*(h/2)))}n.type===1?(e.strokeStyle=e.fillStyle,e.stroke()):e.fill(),e.closePath()}function l1(e,n,r=0){return Math.max(Math.min(e,n),r)}var Ow={C:(e,n)=>e.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]),L:(e,n)=>e.lineTo(n[0],n[1]),M:(e,n)=>e.moveTo(n[0],n[1])};function Nw(e,n,r,a,o,v,m,c=0,u=0){let h=e.map(S=>parseFloat(S)||parseInt(S));if(h.length<2)throw new Error("Too few arguments for instruction");for(let S=0;S<h.length;S+=2)h[S]*=n-c*m-u*m,v&&h[S]!==0&&(h[S]=l1(Math.round(h[S]+.5)-.5,n,0)),h[S]+=a+c*m;for(let S=1;S<h.length;S+=2)h[S]*=r,v&&h[S]!==0&&(h[S]=l1(Math.round(h[S]+.5)-.5,r,0)),h[S]+=o;return h}var c1=class{constructor(){this._data={}}set(e,n,r){this._data[e]||(this._data[e]={}),this._data[e][n]=r}get(e,n){return this._data[e]?this._data[e][n]:void 0}clear(){this._data={}}},u1=class{constructor(){this._data=new c1}set(e,n,r,a,o){this._data.get(e,n)||this._data.set(e,n,new c1),this._data.get(e,n).set(r,a,o)}get(e,n,r,a){return this._data.get(e,n)?.get(r,a)}clear(){this._data.clear()}},Iw=class{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 n=0,r=0,a=e.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(n=performance.now(),this._tasks[this._i]()||this._i++,n=Math.max(1,performance.now()-n),r=Math.max(n,r),o=e.timeRemaining(),r*1.5>o){a-n<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-n))}ms`),this._start();return}a=o}this.clear()}},rR=class extends Iw{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let n=performance.now()+e;return{timeRemaining:()=>Math.max(0,n-performance.now())}}},sR=class extends Iw{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},aR=!am&&"requestIdleCallback"in window?sR:rR,eo=class Bw{constructor(){this.fg=0,this.bg=0,this.extended=new jw}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 Bw;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}},jw=class $w{constructor(n=0,r=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=r}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 $w(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},oR=globalThis.performance&&typeof globalThis.performance.now=="function",lR=class zw{static create(n){return new zw(n)}constructor(n){this._now=oR&&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}},Br;(e=>{e.None=()=>Gi.None;function n(G,B){return f(G,()=>{},0,void 0,!0,void 0,B)}e.defer=n;function r(G){return(B,K=null,te)=>{let q=!1,W;return W=G(Y=>{if(!q)return W?W.dispose():q=!0,B.call(K,Y)},null,te),q&&W.dispose(),W}}e.once=r;function a(G,B,K){return h((te,q=null,W)=>G(Y=>te.call(q,B(Y)),null,W),K)}e.map=a;function o(G,B,K){return h((te,q=null,W)=>G(Y=>{B(Y),te.call(q,Y)},null,W),K)}e.forEach=o;function v(G,B,K){return h((te,q=null,W)=>G(Y=>B(Y)&&te.call(q,Y),null,W),K)}e.filter=v;function m(G){return G}e.signal=m;function c(...G){return(B,K=null,te)=>{let q=kw(...G.map(W=>W(Y=>B.call(K,Y))));return S(q,te)}}e.any=c;function u(G,B,K,te){let q=K;return a(G,W=>(q=B(q,W),q),te)}e.reduce=u;function h(G,B){let K,te={onWillAddFirstListener(){K=G(q.fire,q)},onDidRemoveLastListener(){K?.dispose()}},q=new Dt(te);return B?.add(q),q.event}function S(G,B){return B instanceof Array?B.push(G):B&&B.add(G),G}function f(G,B,K=100,te=!1,q=!1,W,Y){let I,$,N,H=0,Z,ae={leakWarningThreshold:W,onWillAddFirstListener(){I=G(_e=>{H++,$=B($,_e),te&&!N&&(ce.fire($),$=void 0),Z=()=>{let Q=$;$=void 0,N=void 0,(!te||H>1)&&ce.fire(Q),H=0},typeof K=="number"?(clearTimeout(N),N=setTimeout(Z,K)):N===void 0&&(N=0,queueMicrotask(Z))})},onWillRemoveListener(){q&&H>0&&Z?.()},onDidRemoveLastListener(){Z=void 0,I.dispose()}},ce=new Dt(ae);return Y?.add(ce),ce.event}e.debounce=f;function C(G,B=0,K){return e.debounce(G,(te,q)=>te?(te.push(q),te):[q],B,void 0,!0,void 0,K)}e.accumulate=C;function x(G,B=(te,q)=>te===q,K){let te=!0,q;return v(G,W=>{let Y=te||!B(W,q);return te=!1,q=W,Y},K)}e.latch=x;function k(G,B,K){return[e.filter(G,B,K),e.filter(G,te=>!B(te),K)]}e.split=k;function E(G,B=!1,K=[],te){let q=K.slice(),W=G($=>{q?q.push($):I.fire($)});te&&te.add(W);let Y=()=>{q?.forEach($=>I.fire($)),q=null},I=new Dt({onWillAddFirstListener(){W||(W=G($=>I.fire($)),te&&te.add(W))},onDidAddFirstListener(){q&&(B?setTimeout(Y):Y())},onDidRemoveLastListener(){W&&W.dispose(),W=null}});return te&&te.add(I),I.event}e.buffer=E;function g(G,B){return(K,te,q)=>{let W=B(new p);return G(function(Y){let I=W.evaluate(Y);I!==b&&K.call(te,I)},void 0,q)}}e.chain=g;let b=Symbol("HaltChainable");class p{constructor(){this.steps=[]}map(B){return this.steps.push(B),this}forEach(B){return this.steps.push(K=>(B(K),K)),this}filter(B){return this.steps.push(K=>B(K)?K:b),this}reduce(B,K){let te=K;return this.steps.push(q=>(te=B(te,q),te)),this}latch(B=(K,te)=>K===te){let K=!0,te;return this.steps.push(q=>{let W=K||!B(q,te);return K=!1,te=q,W?q:b}),this}evaluate(B){for(let K of this.steps)if(B=K(B),B===b)break;return B}}function y(G,B,K=te=>te){let te=(...I)=>Y.fire(K(...I)),q=()=>G.on(B,te),W=()=>G.removeListener(B,te),Y=new Dt({onWillAddFirstListener:q,onDidRemoveLastListener:W});return Y.event}e.fromNodeEventEmitter=y;function T(G,B,K=te=>te){let te=(...I)=>Y.fire(K(...I)),q=()=>G.addEventListener(B,te),W=()=>G.removeEventListener(B,te),Y=new Dt({onWillAddFirstListener:q,onDidRemoveLastListener:W});return Y.event}e.fromDOMEventEmitter=T;function A(G){return new Promise(B=>r(G)(B))}e.toPromise=A;function L(G){let B=new Dt;return G.then(K=>{B.fire(K)},()=>{B.fire(void 0)}).finally(()=>{B.dispose()}),B.event}e.fromPromise=L;function M(G,B){return G(K=>B.fire(K))}e.forward=M;function R(G,B,K){return B(K),G(te=>B(te))}e.runAndSubscribe=R;class O{constructor(B,K){this._observable=B,this._counter=0,this._hasChanged=!1;let te={onWillAddFirstListener:()=>{B.addObserver(this)},onDidRemoveLastListener:()=>{B.removeObserver(this)}};this.emitter=new Dt(te),K&&K.add(this.emitter)}beginUpdate(B){this._counter++}handlePossibleChange(B){}handleChange(B,K){this._hasChanged=!0}endUpdate(B){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function F(G,B){return new O(G,B).emitter.event}e.fromObservable=F;function U(G){return(B,K,te)=>{let q=0,W=!1,Y={beginUpdate(){q++},endUpdate(){q--,q===0&&(G.reportChanges(),W&&(W=!1,B.call(K)))},handlePossibleChange(){},handleChange(){W=!0}};G.addObserver(Y),G.reportChanges();let I={dispose(){G.removeObserver(Y)}};return te instanceof ro?te.add(I):Array.isArray(te)&&te.push(I),I}}e.fromObservableLight=U})(Br||={});var lg=class cg{constructor(n){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${n}_${cg._idPool++}`,cg.all.add(this)}start(n){this._stopWatch=new lR,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}}};lg.all=new Set,lg._idPool=0;var cR=lg,uR=-1,Pw=class Hw{constructor(n,r,a=(Hw._idPool++).toString(16).padStart(3,"0")){this._errorHandler=n,this.threshold=r,this.name=a,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(n,r){let a=this.threshold;if(a<=0||r<a)return;this._stacks||(this._stacks=new Map);let o=this._stacks.get(n.value)||0;if(this._stacks.set(n.value,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let[v,m]=this.getMostFrequentStack(),c=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${m}):`;console.warn(c),console.warn(v);let u=new fR(c,v);this._errorHandler(u)}return()=>{let v=this._stacks.get(n.value)||0;this._stacks.set(n.value,v-1)}}getMostFrequentStack(){if(!this._stacks)return;let n,r=0;for(let[a,o]of this._stacks)(!n||r<o)&&(n=[a,o],r=o);return n}};Pw._idPool=1;var hR=Pw,dR=class Uw{constructor(n){this.value=n}static create(){let n=new Error;return new Uw(n.stack??"")}print(){console.warn(this.value.split(`
17
- `).slice(2).join(`
18
- `))}},fR=class extends Error{constructor(e,n){super(e),this.name="ListenerLeakError",this.stack=n}},pR=class extends Error{constructor(e,n){super(e),this.name="ListenerRefusalError",this.stack=n}},gR=0,op=class{constructor(n){this.value=n,this.id=gR++}},mR=2,_R,Dt=class{constructor(n){this._size=0,this._options=n,this._leakageMon=this._options?.leakWarningThreshold?new hR(n?.onListenerError??sp,this._options?.leakWarningThreshold??uR):void 0,this._perfMon=this._options?._profName?new cR(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,r,a)=>{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 pR(`${c}. HINT: Stack shows most frequent listener (${u[1]}-times)`,u[0]);return(this._options?.onListenerError||sp)(h),Gi.None}if(this._disposed)return Gi.None;r&&(n=n.bind(r));let o=new op(n),v;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=dR.create(),v=this._leakageMon.check(o.stack,this._size+1)),this._listeners?this._listeners instanceof op?(this._deliveryQueue??=new vR,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._size++;let m=Nn(()=>{v?.(),this._removeListener(o)});return a instanceof ro?a.add(m):Array.isArray(a)&&a.push(m),m},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 r=this._listeners,a=r.indexOf(n);if(a===-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--,r[a]=void 0;let o=this._deliveryQueue.current===this;if(this._size*mR<=r.length){let v=0;for(let m=0;m<r.length;m++)r[m]?r[v++]=r[m]:o&&(this._deliveryQueue.end--,v<this._deliveryQueue.i&&this._deliveryQueue.i--);r.length=v}}_deliver(n,r){if(!n)return;let a=this._options?.onListenerError||sp;if(!a){n.value(r);return}try{n.value(r)}catch(o){a(o)}}_deliverQueue(n){let r=n.current._listeners;for(;n.i<n.end;)this._deliver(r[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 op)this._deliver(this._listeners,n);else{let r=this._deliveryQueue;r.enqueue(this,n,this._listeners.length),this._deliverQueue(r)}this._perfMon?.stop()}hasListeners(){return this._size>0}},vR=class{constructor(){this.i=-1,this.end=0}enqueue(e,n,r){this.i=0,this.end=r,this.current=e,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},h1={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}},vl=2,bl,ms=class Xa{constructor(n,r,a){this._document=n,this._config=r,this._unicodeService=a,this._didWarmUp=!1,this._cacheMap=new u1,this._cacheMapCombined=new u1,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new eo,this._textureSize=512,this._onAddTextureAtlasCanvas=new Dt,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Dt,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=Fw(n,this._config.deviceCellWidth*4+vl*2,this._config.deviceCellHeight+vl*2),this._tmpCtx=hn(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 aR;for(let r=33;r<126;r++)n.enqueue(()=>{if(!this._cacheMap.get(r,0,0,0)){let a=this._drawToCache(r,0,0,0,!1,void 0);this._cacheMap.set(r,0,0,0,a)}})}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(Xa.maxAtlasPages&&this._pages.length>=Math.max(4,Xa.maxAtlasPages)){let r=this._pages.filter(h=>h.canvas.width*2<=(Xa.maxTextureSize||4096)).sort((h,S)=>S.canvas.width!==h.canvas.width?S.canvas.width-h.canvas.width:S.percentageUsed-h.percentageUsed),a=-1,o=0;for(let h=0;h<r.length;h++)if(r[h].canvas.width!==o)a=h,o=r[h].canvas.width;else if(h-a===3)break;let v=r.slice(a,a+4),m=v.map(h=>h.glyphs[0].texturePage).sort((h,S)=>h>S?1:-1),c=this.pages.length-v.length,u=this._mergePages(v,c);u.version++;for(let h=m.length-1;h>=0;h--)this._deletePage(m[h]);this.pages.push(u),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(u.canvas)}let n=new lp(this._document,this._textureSize);return this._pages.push(n),this._activePages.push(n),this._onAddTextureAtlasCanvas.fire(n.canvas),n}_mergePages(n,r){let a=n[0].canvas.width*2,o=new lp(this._document,a,n);for(let[v,m]of n.entries()){let c=v*m.canvas.width%a,u=Math.floor(v/2)*m.canvas.height;o.ctx.drawImage(m.canvas,c,u);for(let S of m.glyphs)S.texturePage=r,S.sizeClipSpace.x=S.size.x/a,S.sizeClipSpace.y=S.size.y/a,S.texturePosition.x+=c,S.texturePosition.y+=u,S.texturePositionClipSpace.x=S.texturePosition.x/a,S.texturePositionClipSpace.y=S.texturePosition.y/a;this._onRemoveTextureAtlasCanvas.fire(m.canvas);let h=this._activePages.indexOf(m);h!==-1&&this._activePages.splice(h,1)}return o}_deletePage(n){this._pages.splice(n,1);for(let r=n;r<this._pages.length;r++){let a=this._pages[r];for(let o of a.glyphs)o.texturePage--;a.version++}}getRasterizedGlyphCombinedChar(n,r,a,o,v,m){return this._getFromCacheMap(this._cacheMapCombined,n,r,a,o,v,m)}getRasterizedGlyph(n,r,a,o,v,m){return this._getFromCacheMap(this._cacheMap,n,r,a,o,v,m)}_getFromCacheMap(n,r,a,o,v,m,c){return bl=n.get(r,a,o,v),bl||(bl=this._drawToCache(r,a,o,v,m,c),n.set(r,a,o,v,bl)),bl}_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,r,a,o){if(this._config.allowTransparency)return Ti;let v;switch(n){case 16777216:case 33554432:v=this._getColorFromAnsiIndex(r);break;case 50331648:let m=eo.toColorRGB(r);v=$n.toColor(m[0],m[1],m[2]);break;default:a?v=Rl.opaque(this._config.colors.foreground):v=this._config.colors.background;break}return this._config.allowTransparency||(v=Rl.opaque(v)),v}_getForegroundColor(n,r,a,o,v,m,c,u,h,S){let f=this._getMinimumContrastColor(n,r,a,o,v,m,c,h,u,S);if(f)return f;let C;switch(v){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&h&&m<8&&(m+=8),C=this._getColorFromAnsiIndex(m);break;case 50331648:let x=eo.toColorRGB(m);C=$n.toColor(x[0],x[1],x[2]);break;default:c?C=this._config.colors.background:C=this._config.colors.foreground}return this._config.allowTransparency&&(C=Rl.opaque(C)),u&&(C=Rl.multiplyOpacity(C,Y3)),C}_resolveBackgroundRgba(n,r,a){switch(n){case 16777216:case 33554432:return this._getColorFromAnsiIndex(r).rgba;case 50331648:return r<<8;default:return a?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(n,r,a,o){switch(n){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&o&&r<8&&(r+=8),this._getColorFromAnsiIndex(r).rgba;case 50331648:return r<<8;default:return a?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(n,r,a,o,v,m,c,u,h,S){if(this._config.minimumContrastRatio===1||S)return;let f=this._getContrastCache(h),C=f.getColor(n,o);if(C!==void 0)return C||void 0;let x=this._resolveBackgroundRgba(r,a,c),k=this._resolveForegroundRgba(v,m,c,u),E=ea.ensureContrastRatio(x,k,this._config.minimumContrastRatio/(h?2:1));if(!E){f.setColor(n,o,null);return}let g=$n.toColor(E>>24&255,E>>16&255,E>>8&255);return f.setColor(n,o,g),g}_getContrastCache(n){return n?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(n,r,a,o,v,m){let c=typeof n=="number"?String.fromCharCode(n):n;m&&this._tmpCanvas.parentElement!==m&&(this._tmpCanvas.style.display="none",m.append(this._tmpCanvas));let u=Math.min(this._config.deviceCellWidth*Math.max(c.length,2)+vl*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<u&&(this._tmpCanvas.width=u);let h=Math.min(this._config.deviceCellHeight+vl*4,this._textureSize);if(this._tmpCanvas.height<h&&(this._tmpCanvas.height=h),this._tmpCtx.save(),this._workAttributeData.fg=a,this._workAttributeData.bg=r,this._workAttributeData.extended.ext=o,!!this._workAttributeData.isInvisible())return h1;let S=!!this._workAttributeData.isBold(),f=!!this._workAttributeData.isInverse(),C=!!this._workAttributeData.isDim(),x=!!this._workAttributeData.isItalic(),k=!!this._workAttributeData.isUnderline(),E=!!this._workAttributeData.isStrikethrough(),g=!!this._workAttributeData.isOverline(),b=this._workAttributeData.getFgColor(),p=this._workAttributeData.getFgColorMode(),y=this._workAttributeData.getBgColor(),T=this._workAttributeData.getBgColorMode();if(f){let $=b;b=y,y=$;let N=p;p=T,T=N}let A=this._getBackgroundColor(T,y,f,C);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=A.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let L=S?this._config.fontWeightBold:this._config.fontWeight,M=x?"italic":"";this._tmpCtx.font=`${M} ${L} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=Dw;let R=c.length===1&&om(c.charCodeAt(0)),O=c.length===1&&H3(c.charCodeAt(0)),F=this._getForegroundColor(r,T,y,a,p,b,f,C,S,Mw(c.charCodeAt(0)));this._tmpCtx.fillStyle=F.css;let U=O?0:vl*2,G=!1;this._config.customGlyphs!==!1&&(G=Q3(this._tmpCtx,c,U,U,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let B=!R,K;if(typeof n=="number"?K=this._unicodeService.wcwidth(n):K=this._unicodeService.getStringCellWidth(n),k){this._tmpCtx.save();let $=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),N=$%2===1?.5:0;if(this._tmpCtx.lineWidth=$,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())B=!1,this._tmpCtx.strokeStyle=`rgb(${eo.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{B=!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 H=U,Z=Math.ceil(U+this._config.deviceCharHeight)-N-(v?$*2:0),ae=Z+$,ce=Z+$*2,_e=this._workAttributeData.getUnderlineVariantOffset();for(let Q=0;Q<K;Q++){this._tmpCtx.save();let P=H+Q*this._config.deviceCellWidth,oe=H+(Q+1)*this._config.deviceCellWidth,ge=P+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(P,Z),this._tmpCtx.lineTo(oe,Z),this._tmpCtx.moveTo(P,ce),this._tmpCtx.lineTo(oe,ce);break;case 3:let Se=$<=1?ce:Math.ceil(U+this._config.deviceCharHeight-$/2)-N,ye=$<=1?Z:Math.ceil(U+this._config.deviceCharHeight+$/2)-N,Pe=new Path2D;Pe.rect(P,Z,this._config.deviceCellWidth,ce-Z),this._tmpCtx.clip(Pe),this._tmpCtx.moveTo(P-this._config.deviceCellWidth/2,ae),this._tmpCtx.bezierCurveTo(P-this._config.deviceCellWidth/2,ye,P,ye,P,ae),this._tmpCtx.bezierCurveTo(P,Se,ge,Se,ge,ae),this._tmpCtx.bezierCurveTo(ge,ye,oe,ye,oe,ae),this._tmpCtx.bezierCurveTo(oe,Se,oe+this._config.deviceCellWidth/2,Se,oe+this._config.deviceCellWidth/2,ae);break;case 4:let Fe=_e===0?0:_e>=$?$*2-_e:$-_e;_e>=$||Fe===0?(this._tmpCtx.setLineDash([Math.round($),Math.round($)]),this._tmpCtx.moveTo(P+Fe,Z),this._tmpCtx.lineTo(oe,Z)):(this._tmpCtx.setLineDash([Math.round($),Math.round($)]),this._tmpCtx.moveTo(P,Z),this._tmpCtx.lineTo(P+Fe,Z),this._tmpCtx.moveTo(P+Fe+$,Z),this._tmpCtx.lineTo(oe,Z)),_e=K3(oe-P,$,_e);break;case 5:let Xe=.6,xt=.3,Ne=oe-P,en=Math.floor(Xe*Ne),bn=Math.floor(xt*Ne),yn=Ne-en-bn;this._tmpCtx.setLineDash([en,bn,yn]),this._tmpCtx.moveTo(P,Z),this._tmpCtx.lineTo(oe,Z);break;default:this._tmpCtx.moveTo(P,Z),this._tmpCtx.lineTo(oe,Z);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!G&&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 P=new Path2D;P.rect(H,Z-Math.ceil($/2),this._config.deviceCellWidth*K,ce-Z+Math.ceil($/2)),this._tmpCtx.clip(P),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=A.css,this._tmpCtx.strokeText(c,U,U+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(g){let $=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),N=$%2===1?.5:0;this._tmpCtx.lineWidth=$,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(U,U+N),this._tmpCtx.lineTo(U+this._config.deviceCharWidth*K,U+N),this._tmpCtx.stroke()}if(G||this._tmpCtx.fillText(c,U,U+this._config.deviceCharHeight),c==="_"&&!this._config.allowTransparency){let $=cp(this._tmpCtx.getImageData(U,U,this._config.deviceCellWidth,this._config.deviceCellHeight),A,F,B);if($)for(let N=1;N<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=A.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(c,U,U+this._config.deviceCharHeight-N),$=cp(this._tmpCtx.getImageData(U,U,this._config.deviceCellWidth,this._config.deviceCellHeight),A,F,B),!!$);N++);}if(E){let $=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),N=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=$,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(U,U+Math.floor(this._config.deviceCharHeight/2)-N),this._tmpCtx.lineTo(U+this._config.deviceCharWidth*K,U+Math.floor(this._config.deviceCharHeight/2)-N),this._tmpCtx.stroke()}this._tmpCtx.restore();let te=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),q;if(this._config.allowTransparency?q=bR(te):q=cp(te,A,F,B),q)return h1;let W=this._findGlyphBoundingBox(te,this._workBoundingBox,u,O,G,U),Y,I;for(;;){if(this._activePages.length===0){let $=this._createNewPage();Y=$,I=$.currentRow,I.height=W.size.y;break}Y=this._activePages[this._activePages.length-1],I=Y.currentRow;for(let $ of this._activePages)W.size.y<=$.currentRow.height&&(Y=$,I=$.currentRow);for(let $=this._activePages.length-1;$>=0;$--)for(let N of this._activePages[$].fixedRows)N.height<=I.height&&W.size.y<=N.height&&(Y=this._activePages[$],I=N);if(W.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new lp(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),Y=this._overflowSizePage,I=this._overflowSizePage.currentRow,I.x+W.size.x>=Y.canvas.width&&(I.x=0,I.y+=I.height,I.height=0);break}if(I.y+W.size.y>=Y.canvas.height||I.height>W.size.y+2){let $=!1;if(Y.currentRow.y+Y.currentRow.height+W.size.y>=Y.canvas.height){let N;for(let H of this._activePages)if(H.currentRow.y+H.currentRow.height+W.size.y<H.canvas.height){N=H;break}if(N)Y=N;else if(Xa.maxAtlasPages&&this._pages.length>=Xa.maxAtlasPages&&I.y+W.size.y<=Y.canvas.height&&I.height>=W.size.y&&I.x+W.size.x<=Y.canvas.width)$=!0;else{let H=this._createNewPage();Y=H,I=H.currentRow,I.height=W.size.y,$=!0}}$||(Y.currentRow.height>0&&Y.fixedRows.push(Y.currentRow),I={x:0,y:Y.currentRow.y+Y.currentRow.height,height:W.size.y},Y.fixedRows.push(I),Y.currentRow={x:0,y:I.y+I.height,height:0})}if(I.x+W.size.x<=Y.canvas.width)break;I===Y.currentRow?(I.x=0,I.y+=I.height,I.height=0):Y.fixedRows.splice(Y.fixedRows.indexOf(I),1)}return W.texturePage=this._pages.indexOf(Y),W.texturePosition.x=I.x,W.texturePosition.y=I.y,W.texturePositionClipSpace.x=I.x/Y.canvas.width,W.texturePositionClipSpace.y=I.y/Y.canvas.height,W.sizeClipSpace.x/=Y.canvas.width,W.sizeClipSpace.y/=Y.canvas.height,I.height=Math.max(I.height,W.size.y),I.x+=W.size.x,Y.ctx.putImageData(te,W.texturePosition.x-this._workBoundingBox.left,W.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,W.size.x,W.size.y),Y.addGlyph(W),Y.version++,W}_findGlyphBoundingBox(n,r,a,o,v,m){r.top=0;let c=o?this._config.deviceCellHeight:this._tmpCanvas.height,u=o?this._config.deviceCellWidth:a,h=!1;for(let S=0;S<c;S++){for(let f=0;f<u;f++){let C=S*this._tmpCanvas.width*4+f*4+3;if(n.data[C]!==0){r.top=S,h=!0;break}}if(h)break}r.left=0,h=!1;for(let S=0;S<m+u;S++){for(let f=0;f<c;f++){let C=f*this._tmpCanvas.width*4+S*4+3;if(n.data[C]!==0){r.left=S,h=!0;break}}if(h)break}r.right=u,h=!1;for(let S=m+u-1;S>=m;S--){for(let f=0;f<c;f++){let C=f*this._tmpCanvas.width*4+S*4+3;if(n.data[C]!==0){r.right=S,h=!0;break}}if(h)break}r.bottom=c,h=!1;for(let S=c-1;S>=0;S--){for(let f=0;f<u;f++){let C=S*this._tmpCanvas.width*4+f*4+3;if(n.data[C]!==0){r.bottom=S,h=!0;break}}if(h)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:r.right-r.left+1,y:r.bottom-r.top+1},sizeClipSpace:{x:r.right-r.left+1,y:r.bottom-r.top+1},offset:{x:-r.left+m+(o||v?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-r.top+m+(o||v?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},lp=class{constructor(e,n,r){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],r)for(let a of r)this._glyphs.push(...a.glyphs),this._usedPixels+=a._usedPixels;this.canvas=Fw(e,n,n),this.ctx=hn(this.canvas.getContext("2d",{alpha:!0}))}get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(e){this._glyphs.push(e),this._usedPixels+=e.size.x*e.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 cp(e,n,r,a){let o=n.rgba>>>24,v=n.rgba>>>16&255,m=n.rgba>>>8&255,c=r.rgba>>>24,u=r.rgba>>>16&255,h=r.rgba>>>8&255,S=Math.floor((Math.abs(o-c)+Math.abs(v-u)+Math.abs(m-h))/12),f=!0;for(let C=0;C<e.data.length;C+=4)e.data[C]===o&&e.data[C+1]===v&&e.data[C+2]===m||a&&Math.abs(e.data[C]-o)+Math.abs(e.data[C+1]-v)+Math.abs(e.data[C+2]-m)<S?e.data[C+3]=0:f=!1;return f}function bR(e){for(let n=0;n<e.data.length;n+=4)if(e.data[n+3]>0)return!1;return!0}function Fw(e,n,r){let a=e.createElement("canvas");return a.width=n,a.height=r,a}function yR(e,n,r,a,o,v,m,c){let u={foreground:v.foreground,background:v.background,cursor:Ti,cursorAccent:Ti,selectionForeground:Ti,selectionBackgroundTransparent:Ti,selectionBackgroundOpaque:Ti,selectionInactiveBackgroundTransparent:Ti,selectionInactiveBackgroundOpaque:Ti,overviewRulerBorder:Ti,scrollbarSliderBackground:Ti,scrollbarSliderHoverBackground:Ti,scrollbarSliderActiveBackground:Ti,ansi:v.ansi.slice(),contrastCache:v.contrastCache,halfContrastCache:v.halfContrastCache};return{customGlyphs:o.customGlyphs,devicePixelRatio:m,deviceMaxTextureSize:c,letterSpacing:o.letterSpacing,lineHeight:o.lineHeight,deviceCellWidth:e,deviceCellHeight:n,deviceCharWidth:r,deviceCharHeight:a,fontFamily:o.fontFamily,fontSize:o.fontSize,fontWeight:o.fontWeight,fontWeightBold:o.fontWeightBold,allowTransparency:o.allowTransparency,drawBoldTextInBrightColors:o.drawBoldTextInBrightColors,minimumContrastRatio:o.minimumContrastRatio,colors:u}}function d1(e,n){for(let r=0;r<e.colors.ansi.length;r++)if(e.colors.ansi[r].rgba!==n.colors.ansi[r].rgba)return!1;return e.devicePixelRatio===n.devicePixelRatio&&e.customGlyphs===n.customGlyphs&&e.lineHeight===n.lineHeight&&e.letterSpacing===n.letterSpacing&&e.fontFamily===n.fontFamily&&e.fontSize===n.fontSize&&e.fontWeight===n.fontWeight&&e.fontWeightBold===n.fontWeightBold&&e.allowTransparency===n.allowTransparency&&e.deviceCharWidth===n.deviceCharWidth&&e.deviceCharHeight===n.deviceCharHeight&&e.drawBoldTextInBrightColors===n.drawBoldTextInBrightColors&&e.minimumContrastRatio===n.minimumContrastRatio&&e.colors.foreground.rgba===n.colors.foreground.rgba&&e.colors.background.rgba===n.colors.background.rgba}function SR(e){return(e&50331648)===16777216||(e&50331648)===33554432}var Ri=[];function qw(e,n,r,a,o,v,m,c,u){let h=yR(a,o,v,m,n,r,c,u);for(let C=0;C<Ri.length;C++){let x=Ri[C],k=x.ownedBy.indexOf(e);if(k>=0){if(d1(x.config,h))return x.atlas;x.ownedBy.length===1?(x.atlas.dispose(),Ri.splice(C,1)):x.ownedBy.splice(k,1);break}}for(let C=0;C<Ri.length;C++){let x=Ri[C];if(d1(x.config,h))return x.ownedBy.push(e),x.atlas}let S=e._core,f={atlas:new ms(document,h,S.unicodeService),config:h,ownedBy:[e]};return Ri.push(f),f.atlas}function f1(e){for(let n=0;n<Ri.length;n++){let r=Ri[n].ownedBy.indexOf(e);if(r!==-1){Ri[n].ownedBy.length===1?(Ri[n].atlas.dispose(),Ri.splice(n,1)):Ri[n].ownedBy.splice(r,1);break}}}var Su=600,wR=class{constructor(e,n){this._renderCallback=e,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(e=Su){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let n=Su-(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=Su-(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})},Su)},e)}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 p1(e,n,r){let a=new n.ResizeObserver(o=>{let v=o.find(u=>u.target===e);if(!v)return;if(!("devicePixelContentBoxSize"in v)){a?.disconnect(),a=void 0;return}let m=v.devicePixelContentBoxSize[0].inlineSize,c=v.devicePixelContentBoxSize[0].blockSize;m>0&&c>0&&r(m,c)});try{a.observe(e,{box:["device-pixel-content-box"]})}catch{a.disconnect(),a=void 0}return Nn(()=>a?.disconnect())}function CR(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}var g1=class Ww extends eo{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new jw,this.combinedData=""}static fromCharData(n){let r=new Ww;return r.setFromCharData(n),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?CR(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 r=!1;if(n[1].length>2)r=!0;else if(n[1].length===2){let a=n[1].charCodeAt(0);if(55296<=a&&a<=56319){let o=n[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(a-55296)*1024+o-56320+65536|n[2]<<22:r=!0}else r=!0}else this.content=n[1].charCodeAt(0)|n[2]<<22;r&&(this.combinedData=n[1],this.content=2097152|n[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Gw=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function Kw(e,n,r){let a=hn(e.createProgram());if(e.attachShader(a,hn(m1(e,e.VERTEX_SHADER,n))),e.attachShader(a,hn(m1(e,e.FRAGMENT_SHADER,r))),e.linkProgram(a),e.getProgramParameter(a,e.LINK_STATUS))return a;console.error(e.getProgramInfoLog(a)),e.deleteProgram(a)}function m1(e,n,r){let a=hn(e.createShader(n));if(e.shaderSource(a,r),e.compileShader(a),e.getShaderParameter(a,e.COMPILE_STATUS))return a;console.error(e.getShaderInfoLog(a)),e.deleteShader(a)}function xR(e,n){let r=Math.min(e.length*2,n),a=new Float32Array(r);for(let o=0;o<e.length;o++)a[o]=e[o];return a}var ER=class{constructor(e){this.texture=e,this.version=-1}},TR=`#version 300 es
19
- layout (location = 0) in vec2 a_unitquad;
20
- layout (location = 1) in vec2 a_cellpos;
21
- layout (location = 2) in vec2 a_offset;
22
- layout (location = 3) in vec2 a_size;
23
- layout (location = 4) in float a_texpage;
24
- layout (location = 5) in vec2 a_texcoord;
25
- layout (location = 6) in vec2 a_texsize;
26
-
27
- uniform mat4 u_projection;
28
- uniform vec2 u_resolution;
29
-
30
- out vec2 v_texcoord;
31
- flat out int v_texpage;
32
-
33
- void main() {
34
- vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
35
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
36
- v_texpage = int(a_texpage);
37
- v_texcoord = a_texcoord + a_unitquad * a_texsize;
38
- }`;function kR(e){let n="";for(let r=1;r<e;r++)n+=` else if (v_texpage == ${r}) { outColor = texture(u_texture[${r}], v_texcoord); }`;return`#version 300 es
39
- precision lowp float;
40
-
41
- in vec2 v_texcoord;
42
- flat in int v_texpage;
43
-
44
- uniform sampler2D u_texture[${e}];
45
-
46
- out vec4 outColor;
47
-
48
- void main() {
49
- if (v_texpage == 0) {
50
- outColor = texture(u_texture[0], v_texcoord);
51
- } ${n}
52
- }`}var _s=11,Ka=_s*Float32Array.BYTES_PER_ELEMENT,AR=2,Wt=0,Mt,up=0,yl=0,RR=class extends Gi{constructor(e,n,r,a){super(),this._terminal=e,this._gl=n,this._dimensions=r,this._optionsService=a,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let o=this._gl;ms.maxAtlasPages===void 0&&(ms.maxAtlasPages=Math.min(32,hn(o.getParameter(o.MAX_TEXTURE_IMAGE_UNITS))),ms.maxTextureSize=hn(o.getParameter(o.MAX_TEXTURE_SIZE))),this._program=hn(Kw(o,TR,kR(ms.maxAtlasPages))),this._register(Nn(()=>o.deleteProgram(this._program))),this._projectionLocation=hn(o.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=hn(o.getUniformLocation(this._program,"u_resolution")),this._textureLocation=hn(o.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=o.createVertexArray(),o.bindVertexArray(this._vertexArrayObject);let v=new Float32Array([0,0,1,0,0,1,1,1]),m=o.createBuffer();this._register(Nn(()=>o.deleteBuffer(m))),o.bindBuffer(o.ARRAY_BUFFER,m),o.bufferData(o.ARRAY_BUFFER,v,o.STATIC_DRAW),o.enableVertexAttribArray(0),o.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),u=o.createBuffer();this._register(Nn(()=>o.deleteBuffer(u))),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,u),o.bufferData(o.ELEMENT_ARRAY_BUFFER,c,o.STATIC_DRAW),this._attributesBuffer=hn(o.createBuffer()),this._register(Nn(()=>o.deleteBuffer(this._attributesBuffer))),o.bindBuffer(o.ARRAY_BUFFER,this._attributesBuffer),o.enableVertexAttribArray(2),o.vertexAttribPointer(2,2,o.FLOAT,!1,Ka,0),o.vertexAttribDivisor(2,1),o.enableVertexAttribArray(3),o.vertexAttribPointer(3,2,o.FLOAT,!1,Ka,2*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(3,1),o.enableVertexAttribArray(4),o.vertexAttribPointer(4,1,o.FLOAT,!1,Ka,4*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(4,1),o.enableVertexAttribArray(5),o.vertexAttribPointer(5,2,o.FLOAT,!1,Ka,5*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(5,1),o.enableVertexAttribArray(6),o.vertexAttribPointer(6,2,o.FLOAT,!1,Ka,7*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(6,1),o.enableVertexAttribArray(1),o.vertexAttribPointer(1,2,o.FLOAT,!1,Ka,9*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(1,1),o.useProgram(this._program);let h=new Int32Array(ms.maxAtlasPages);for(let S=0;S<ms.maxAtlasPages;S++)h[S]=S;o.uniform1iv(this._textureLocation,h),o.uniformMatrix4fv(this._projectionLocation,!1,Gw),this._atlasTextures=[];for(let S=0;S<ms.maxAtlasPages;S++){let f=new ER(hn(o.createTexture()));this._register(Nn(()=>o.deleteTexture(f.texture))),o.activeTexture(o.TEXTURE0+S),o.bindTexture(o.TEXTURE_2D,f.texture),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,1,1,0,o.RGBA,o.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[S]=f}o.enable(o.BLEND),o.blendFunc(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(e,n,r,a,o,v,m,c,u){this._updateCell(this._vertices.attributes,e,n,r,a,o,v,m,c,u)}_updateCell(e,n,r,a,o,v,m,c,u,h){if(Wt=(r*this._terminal.cols+n)*_s,a===0||a===void 0){e.fill(0,Wt,Wt+_s-1-AR);return}this._atlas&&(c&&c.length>1?Mt=this._atlas.getRasterizedGlyphCombinedChar(c,o,v,m,!1,this._terminal.element):Mt=this._atlas.getRasterizedGlyph(a,o,v,m,!1,this._terminal.element),up=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),o!==h&&Mt.offset.x>up?(yl=Mt.offset.x-up,e[Wt]=-(Mt.offset.x-yl)+this._dimensions.device.char.left,e[Wt+1]=-Mt.offset.y+this._dimensions.device.char.top,e[Wt+2]=(Mt.size.x-yl)/this._dimensions.device.canvas.width,e[Wt+3]=Mt.size.y/this._dimensions.device.canvas.height,e[Wt+4]=Mt.texturePage,e[Wt+5]=Mt.texturePositionClipSpace.x+yl/this._atlas.pages[Mt.texturePage].canvas.width,e[Wt+6]=Mt.texturePositionClipSpace.y,e[Wt+7]=Mt.sizeClipSpace.x-yl/this._atlas.pages[Mt.texturePage].canvas.width,e[Wt+8]=Mt.sizeClipSpace.y):(e[Wt]=-Mt.offset.x+this._dimensions.device.char.left,e[Wt+1]=-Mt.offset.y+this._dimensions.device.char.top,e[Wt+2]=Mt.size.x/this._dimensions.device.canvas.width,e[Wt+3]=Mt.size.y/this._dimensions.device.canvas.height,e[Wt+4]=Mt.texturePage,e[Wt+5]=Mt.texturePositionClipSpace.x,e[Wt+6]=Mt.texturePositionClipSpace.y,e[Wt+7]=Mt.sizeClipSpace.x,e[Wt+8]=Mt.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&W3(a,u,Mt.size.x,this._dimensions.device.cell.width)&&(e[Wt+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let e=this._terminal,n=e.cols*e.rows*_s;this._vertices.count!==n?this._vertices.attributes=new Float32Array(n):this._vertices.attributes.fill(0);let r=0;for(;r<this._vertices.attributesBuffers.length;r++)this._vertices.count!==n?this._vertices.attributesBuffers[r]=new Float32Array(n):this._vertices.attributesBuffers[r].fill(0);this._vertices.count=n,r=0;for(let a=0;a<e.rows;a++)for(let o=0;o<e.cols;o++)this._vertices.attributes[r+9]=o/e.cols,this._vertices.attributes[r+10]=a/e.rows,r+=_s}handleResize(){let e=this._gl;e.useProgram(this._program),e.viewport(0,0,e.canvas.width,e.canvas.height),e.uniform2f(this._resolutionLocation,e.canvas.width,e.canvas.height),this.clear()}render(e){if(!this._atlas)return;let n=this._gl;n.useProgram(this._program),n.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let r=this._vertices.attributesBuffers[this._activeBuffer],a=0;for(let o=0;o<e.lineLengths.length;o++){let v=o*this._terminal.cols*_s,m=this._vertices.attributes.subarray(v,v+e.lineLengths[o]*_s);r.set(m,a),a+=m.length}n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,r.subarray(0,a),n.STREAM_DRAW);for(let o=0;o<this._atlas.pages.length;o++)this._atlas.pages[o].version!==this._atlasTextures[o].version&&this._bindAtlasPageTexture(n,this._atlas,o);n.drawElementsInstanced(n.TRIANGLE_STRIP,4,n.UNSIGNED_BYTE,0,a/_s)}setAtlas(e){this._atlas=e;for(let n of this._atlasTextures)n.version=-1}_bindAtlasPageTexture(e,n,r){e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_2D,this._atlasTextures[r].texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n.pages[r].canvas),e.generateMipmap(e.TEXTURE_2D),this._atlasTextures[r].version=n.pages[r].version}setDimensions(e){this._dimensions=e}},LR=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(e,n,r,a=!1){if(this.selectionStart=n,this.selectionEnd=r,!n||!r||n[0]===r[0]&&n[1]===r[1]){this.clear();return}let o=e.buffers.active.ydisp,v=n[1]-o,m=r[1]-o,c=Math.max(v,0),u=Math.min(m,e.rows-1);if(c>=e.rows||u<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=a,this.viewportStartRow=v,this.viewportEndRow=m,this.viewportCappedStartRow=c,this.viewportCappedEndRow=u,this.startCol=n[0],this.endCol=r[0]}isCellSelected(e,n,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&r>=this.viewportCappedStartRow&&n<this.endCol&&r<=this.viewportCappedEndRow:n<this.startCol&&r>=this.viewportCappedStartRow&&n>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&r===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportStartRow&&n>=this.startCol):!1}};function MR(){return new LR}var rh=4,Uu=1,Fu=2,hp=3,DR=2147483648,OR=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=MR()}resize(e,n){let r=e*n*rh;r!==this.cells.length&&(this.cells=new Uint32Array(r),this.lineLengths=new Uint32Array(n))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},NR=`#version 300 es
53
- layout (location = 0) in vec2 a_position;
54
- layout (location = 1) in vec2 a_size;
55
- layout (location = 2) in vec4 a_color;
56
- layout (location = 3) in vec2 a_unitquad;
57
-
58
- uniform mat4 u_projection;
59
-
60
- out vec4 v_color;
61
-
62
- void main() {
63
- vec2 zeroToOne = a_position + (a_unitquad * a_size);
64
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
65
- v_color = a_color;
66
- }`,IR=`#version 300 es
67
- precision lowp float;
68
-
69
- in vec4 v_color;
70
-
71
- out vec4 outColor;
72
-
73
- void main() {
74
- outColor = v_color;
75
- }`,Ir=8,dp=Ir*Float32Array.BYTES_PER_ELEMENT,BR=20*Ir,_1=class{constructor(){this.attributes=new Float32Array(BR),this.count=0}},Dr=0,v1=0,b1=0,y1=0,S1=0,w1=0,C1=0,jR=class extends Gi{constructor(e,n,r,a){super(),this._terminal=e,this._gl=n,this._dimensions=r,this._themeService=a,this._vertices=new _1,this._verticesCursor=new _1;let o=this._gl;this._program=hn(Kw(o,NR,IR)),this._register(Nn(()=>o.deleteProgram(this._program))),this._projectionLocation=hn(o.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=o.createVertexArray(),o.bindVertexArray(this._vertexArrayObject);let v=new Float32Array([0,0,1,0,0,1,1,1]),m=o.createBuffer();this._register(Nn(()=>o.deleteBuffer(m))),o.bindBuffer(o.ARRAY_BUFFER,m),o.bufferData(o.ARRAY_BUFFER,v,o.STATIC_DRAW),o.enableVertexAttribArray(3),o.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),u=o.createBuffer();this._register(Nn(()=>o.deleteBuffer(u))),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,u),o.bufferData(o.ELEMENT_ARRAY_BUFFER,c,o.STATIC_DRAW),this._attributesBuffer=hn(o.createBuffer()),this._register(Nn(()=>o.deleteBuffer(this._attributesBuffer))),o.bindBuffer(o.ARRAY_BUFFER,this._attributesBuffer),o.enableVertexAttribArray(0),o.vertexAttribPointer(0,2,o.FLOAT,!1,dp,0),o.vertexAttribDivisor(0,1),o.enableVertexAttribArray(1),o.vertexAttribPointer(1,2,o.FLOAT,!1,dp,2*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(1,1),o.enableVertexAttribArray(2),o.vertexAttribPointer(2,4,o.FLOAT,!1,dp,4*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(2,1),this._updateCachedColors(a.colors),this._register(this._themeService.onChangeColors(h=>{this._updateCachedColors(h),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let n=this._gl;n.useProgram(this._program),n.bindVertexArray(this._vertexArrayObject),n.uniformMatrix4fv(this._projectionLocation,!1,Gw),n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,e.attributes,n.DYNAMIC_DRAW),n.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,n.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.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(e){let n=this._terminal,r=this._vertices,a=1,o,v,m,c,u,h,S,f,C,x,k;for(o=0;o<n.rows;o++){for(m=-1,c=0,u=0,h=!1,v=0;v<n.cols;v++)S=(o*n.cols+v)*rh,f=e.cells[S+Uu],C=e.cells[S+Fu],x=!!(C&67108864),(f!==c||C!==u&&(h||x))&&((c!==0||h&&u!==0)&&(k=a++*Ir,this._updateRectangle(r,k,u,c,m,v,o)),m=v,c=f,u=C,h=x);(c!==0||h&&u!==0)&&(k=a++*Ir,this._updateRectangle(r,k,u,c,m,n.cols,o))}r.count=a}updateCursor(e){let n=this._verticesCursor,r=e.cursor;if(!r||r.style==="block"){n.count=0;return}let a,o=0;(r.style==="bar"||r.style==="outline")&&(a=o++*Ir,this._addRectangleFloat(n.attributes,a,r.x*this._dimensions.device.cell.width,r.y*this._dimensions.device.cell.height,r.style==="bar"?r.dpr*r.cursorWidth:r.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(r.style==="underline"||r.style==="outline")&&(a=o++*Ir,this._addRectangleFloat(n.attributes,a,r.x*this._dimensions.device.cell.width,(r.y+1)*this._dimensions.device.cell.height-r.dpr,r.width*this._dimensions.device.cell.width,r.dpr,this._cursorFloat)),r.style==="outline"&&(a=o++*Ir,this._addRectangleFloat(n.attributes,a,r.x*this._dimensions.device.cell.width,r.y*this._dimensions.device.cell.height,r.width*this._dimensions.device.cell.width,r.dpr,this._cursorFloat),a=o++*Ir,this._addRectangleFloat(n.attributes,a,(r.x+r.width)*this._dimensions.device.cell.width-r.dpr,r.y*this._dimensions.device.cell.height,r.dpr,this._dimensions.device.cell.height,this._cursorFloat)),n.count=o}_updateRectangle(e,n,r,a,o,v,m){if(r&67108864)switch(r&50331648){case 16777216:case 33554432:Dr=this._themeService.colors.ansi[r&255].rgba;break;case 50331648:Dr=(r&16777215)<<8;break;default:Dr=this._themeService.colors.foreground.rgba}else switch(a&50331648){case 16777216:case 33554432:Dr=this._themeService.colors.ansi[a&255].rgba;break;case 50331648:Dr=(a&16777215)<<8;break;default:Dr=this._themeService.colors.background.rgba}e.attributes.length<n+4&&(e.attributes=xR(e.attributes,this._terminal.rows*this._terminal.cols*Ir)),v1=o*this._dimensions.device.cell.width,b1=m*this._dimensions.device.cell.height,y1=(Dr>>24&255)/255,S1=(Dr>>16&255)/255,w1=(Dr>>8&255)/255,C1=1,this._addRectangle(e.attributes,n,v1,b1,(v-o)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,y1,S1,w1,C1)}_addRectangle(e,n,r,a,o,v,m,c,u,h){e[n]=r/this._dimensions.device.canvas.width,e[n+1]=a/this._dimensions.device.canvas.height,e[n+2]=o/this._dimensions.device.canvas.width,e[n+3]=v/this._dimensions.device.canvas.height,e[n+4]=m,e[n+5]=c,e[n+6]=u,e[n+7]=h}_addRectangleFloat(e,n,r,a,o,v,m){e[n]=r/this._dimensions.device.canvas.width,e[n+1]=a/this._dimensions.device.canvas.height,e[n+2]=o/this._dimensions.device.canvas.width,e[n+3]=v/this._dimensions.device.canvas.height,e[n+4]=m[0],e[n+5]=m[1],e[n+6]=m[2],e[n+7]=m[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},$R=class extends Gi{constructor(e,n,r,a,o,v,m,c){super(),this._container=n,this._alpha=o,this._coreBrowserService=v,this._optionsService=m,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-${r}-layer`),this._canvas.style.zIndex=a.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(u=>{this._refreshCharAtlas(e,u),this.reset(e)})),this._register(Nn(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=hn(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,n,r){}handleSelectionChanged(e,n,r,a=!1){}_setTransparency(e,n){if(n===this._alpha)return;let r=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,r),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=qw(e,this._optionsService.rawOptions,n,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,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(e,this._themeService.colors)}_fillBottomLineAtCells(e,n,r=1){this._ctx.fillRect(e*this._deviceCellWidth,(n+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,r*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(e,n,r,a){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,n*this._deviceCellHeight,r*this._deviceCellWidth,a*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,n*this._deviceCellHeight,r*this._deviceCellWidth,a*this._deviceCellHeight))}_fillCharTrueColor(e,n,r,a){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=Dw,this._clipCell(r,a,n.getWidth()),this._ctx.fillText(n.getChars(),r*this._deviceCellWidth+this._deviceCharLeft,a*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,n,r){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,n*this._deviceCellHeight,r*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,n,r){let a=n?e.options.fontWeightBold:e.options.fontWeight;return`${r?"italic":""} ${a} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},zR=class extends $R{constructor(e,n,r,a,o,v,m){super(r,e,"link",n,!0,o,v,m),this._register(a.onShowLinkUnderline(c=>this._handleShowLinkUnderline(c))),this._register(a.onHideLinkUnderline(c=>this._handleHideLinkUnderline(c)))}resize(e,n){super.resize(e,n),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&SR(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let n=e.y1+1;n<e.y2;n++)this._fillBottomLineAtCells(0,n,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},Zs=typeof window=="object"?window:globalThis,ug=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Dt,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Dt,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(n){return this.mapWindowIdToZoomLevel.get(this.getWindowId(n))??0}setZoomLevel(n,r){if(this.getZoomLevel(r)===n)return;let a=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(a,n),this._onDidChangeZoomLevel.fire(a)}getZoomFactor(n){return this.mapWindowIdToZoomFactor.get(this.getWindowId(n))??1}setZoomFactor(n,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),n)}setFullscreen(n,r){if(this.isFullscreen(r)===n)return;let a=this.getWindowId(r);this.mapWindowIdToFullScreen.set(a,n),this._onDidChangeFullscreen.fire(a)}isFullscreen(n){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(n))}getWindowId(n){return n.vscodeWindowId}};ug.INSTANCE=new ug;var Vw=ug;function PR(e,n,r){typeof n=="string"&&(n=e.matchMedia(n)),n.addEventListener("change",r)}Vw.INSTANCE.onDidChangeZoomLevel;Vw.INSTANCE.onDidChangeFullscreen;var vo=typeof navigator=="object"?navigator.userAgent:"";vo.indexOf("Firefox")>=0;vo.indexOf("AppleWebKit")>=0;var HR=vo.indexOf("Chrome")>=0;!HR&&vo.indexOf("Safari")>=0;vo.indexOf("Electron/")>=0;vo.indexOf("Android")>=0;var fp=!1;if(typeof Zs.matchMedia=="function"){let e=Zs.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),n=Zs.matchMedia("(display-mode: fullscreen)");fp=e.matches,PR(Zs,e,({matches:r})=>{fp&&n.matches||(fp=r)})}var to="en",pp=!1,Yw=!1,wu,qu=to,x1=to,UR,Or,ta=globalThis,fi;typeof ta.vscode<"u"&&typeof ta.vscode.process<"u"?fi=ta.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(fi=process);var FR=typeof fi?.versions?.electron=="string",qR=FR&&fi?.type==="renderer";if(typeof fi=="object"){fi.platform,fi.platform,pp=fi.platform==="linux",pp&&fi.env.SNAP&&fi.env.SNAP_REVISION,fi.env.CI||fi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,wu=to,qu=to;let e=fi.env.VSCODE_NLS_CONFIG;if(e)try{let n=JSON.parse(e);wu=n.userLocale,x1=n.osLocale,qu=n.resolvedLanguage||to,UR=n.languagePack?.translationsConfigFile}catch{}Yw=!0}else typeof navigator=="object"&&!qR?(Or=navigator.userAgent,Or.indexOf("Windows")>=0,Or.indexOf("Macintosh")>=0,(Or.indexOf("Macintosh")>=0||Or.indexOf("iPad")>=0||Or.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,pp=Or.indexOf("Linux")>=0,Or?.indexOf("Mobi")>=0,qu=globalThis._VSCODE_NLS_LANGUAGE||to,wu=navigator.language.toLowerCase(),x1=wu):console.error("Unable to resolve platform.");var E1=Yw,ir=Or,fs=qu,WR;(e=>{function n(){return fs}e.value=n;function r(){return fs.length===2?fs==="en":fs.length>=3?fs[0]==="e"&&fs[1]==="n"&&fs[2]==="-":!1}e.isDefaultVariant=r;function a(){return fs==="en"}e.isDefault=a})(WR||={});var GR=typeof ta.postMessage=="function"&&!ta.importScripts;(()=>{if(GR){let e=[];ta.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let a=0,o=e.length;a<o;a++){let v=e[a];if(v.id===r.data.vscodeScheduleAsyncWork){e.splice(a,1),v.callback();return}}});let n=0;return r=>{let a=++n;e.push({id:a,callback:r}),ta.postMessage({vscodeScheduleAsyncWork:a},"*")}}return e=>setTimeout(e)})();var KR=!!(ir&&ir.indexOf("Chrome")>=0);ir&&ir.indexOf("Firefox")>=0;!KR&&ir&&ir.indexOf("Safari")>=0;ir&&ir.indexOf("Edg/")>=0;ir&&ir.indexOf("Android")>=0;var Va=typeof navigator=="object"?navigator:{};E1||document.queryCommandSupported&&document.queryCommandSupported("copy")||Va&&Va.clipboard&&Va.clipboard.writeText,E1||Va&&Va.clipboard&&Va.clipboard.readText;var lm=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,n){this._keyCodeToStr[e]=n,this._strToKeyCode[n.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},gp=new lm,T1=new lm,k1=new lm;new Array(230);var VR;(e=>{function n(c){return gp.keyCodeToStr(c)}e.toString=n;function r(c){return gp.strToKeyCode(c)}e.fromString=r;function a(c){return T1.keyCodeToStr(c)}e.toUserSettingsUS=a;function o(c){return k1.keyCodeToStr(c)}e.toUserSettingsGeneral=o;function v(c){return T1.strToKeyCode(c)||k1.strToKeyCode(c)}e.fromUserSettings=v;function m(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 gp.keyCodeToStr(c)}e.toElectronAccelerator=m})(VR||={});var Xw=Object.freeze(function(e,n){let r=setTimeout(e.bind(n),0);return{dispose(){clearTimeout(r)}}}),YR;(e=>{function n(r){return r===e.None||r===e.Cancelled||r instanceof XR?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=n,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Br.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Xw})})(YR||={});var XR=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?Xw:(this._emitter||(this._emitter=new Dt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},ZR;(e=>{async function n(a){let o,v=await Promise.all(a.map(m=>m.then(c=>c,c=>{o||(o=c)})));if(typeof o<"u")throw o;return v}e.settled=n;function r(a){return new Promise(async(o,v)=>{try{await a(o,v)}catch(m){v(m)}})}e.withAsyncBody=r})(ZR||={});var A1=class ki{static fromArray(n){return new ki(r=>{r.emitMany(n)})}static fromPromise(n){return new ki(async r=>{r.emitMany(await n)})}static fromPromises(n){return new ki(async r=>{await Promise.all(n.map(async a=>r.emitOne(await a)))})}static merge(n){return new ki(async r=>{await Promise.all(n.map(async a=>{for await(let o of a)r.emitOne(o)}))})}constructor(n,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new Dt,queueMicrotask(async()=>{let a={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(n(a)),this.resolve()}catch(o){this.reject(o)}finally{a.emitOne=void 0,a.emitMany=void 0,a.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 Br.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(n,r){return new ki(async a=>{for await(let o of n)a.emitOne(r(o))})}map(n){return ki.map(this,n)}static filter(n,r){return new ki(async a=>{for await(let o of n)r(o)&&a.emitOne(o)})}filter(n){return ki.filter(this,n)}static coalesce(n){return ki.filter(n,r=>!!r)}coalesce(){return ki.coalesce(this)}static async toPromise(n){let r=[];for await(let a of n)r.push(a);return r}toPromise(){return ki.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())}};A1.EMPTY=A1.fromArray([]);var{getWindow:JR}=(function(){let e=new Map,n={window:Zs,disposables:new ro};e.set(Zs.vscodeWindowId,n);let r=new Dt,a=new Dt,o=new Dt;function v(m,c){return(typeof m=="number"?e.get(m):void 0)??(c?n:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:a.event,registerWindow(m){if(e.has(m.vscodeWindowId))return Gi.None;let c=new ro,u={window:m,disposables:c.add(new ro)};return e.set(m.vscodeWindowId,u),c.add(Nn(()=>{e.delete(m.vscodeWindowId),a.fire(m)})),c.add(hg(m,eL.BEFORE_UNLOAD,()=>{o.fire(m)})),r.fire(u),c},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(m){return m.vscodeWindowId},hasWindow(m){return e.has(m)},getWindowById:v,getWindow(m){let c=m;if(c?.ownerDocument?.defaultView)return c.ownerDocument.defaultView.window;let u=m;return u?.view?u.view.window:Zs},getDocument(m){return JR(m).document}}})(),QR=class{constructor(e,n,r,a){this._node=e,this._type=n,this._handler=r,this._options=a||!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 hg(e,n,r,a){return new QR(e,n,r,a)}var eL={BEFORE_UNLOAD:"beforeunload"},tL=class extends Gi{constructor(e,n,r,a,o,v,m,c,u){super(),this._terminal=e,this._characterJoinerService=n,this._charSizeService=r,this._coreBrowserService=a,this._coreService=o,this._decorationService=v,this._optionsService=m,this._themeService=c,this._cursorBlinkStateManager=new _l,this._charAtlasDisposable=this._register(new _l),this._observerDisposable=this._register(new _l),this._model=new OR,this._workCell=new g1,this._workCell2=new g1,this._rectangleRenderer=this._register(new _l),this._glyphRenderer=this._register(new _l),this._onChangeTextureAtlas=this._register(new Dt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Dt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Dt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Dt),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Dt),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 V3(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new zR(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,m,this._themeService)],this.dimensions=G3(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(m.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(hg(this._canvas,"webglcontextlost",S=>{console.log("webglcontextlost event received"),S.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(S)},3e3)})),this._register(hg(this._canvas,"webglcontextrestored",S=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,f1(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=p1(this._canvas,this._coreBrowserService.window,(S,f)=>this._setCanvasDevicePixelDimensions(S,f)),this._register(this._coreBrowserService.onWindowChange(S=>{this._observerDisposable.value=p1(this._canvas,S,(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(Nn(()=>{for(let S of this._renderLayers)S.dispose();this._canvas.parentElement?.removeChild(this._canvas),f1(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(e,n){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let r of this._renderLayers)r.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 e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,n,r){for(let a of this._renderLayers)a.handleSelectionChanged(this._terminal,e,n,r);this._model.selection.update(this._core,e,n,r),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new jR(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new RR(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 e=qw(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!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=kw(Br.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Br.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,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 r of this._renderLayers)r.handleGridChanged(this._terminal,e,n);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,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 wR(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,n){let r=this._core,a=this._workCell,o,v,m,c,u,h,S=0,f=!0,C,x,k,E,g,b,p,y,T;e=R1(e,r.rows-1,0),n=R1(n,r.rows-1,0);let A=this._coreService.decPrivateModes.cursorStyle??r.options.cursorStyle??"block",L=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,M=L-r.buffer.ydisp,R=Math.min(this._terminal.buffer.active.cursorX,r.cols-1),O=-1,F=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let U=!1;for(v=e;v<=n;v++)for(m=v+r.buffer.ydisp,c=r.buffer.lines.get(m),this._model.lineLengths[v]=0,k=L===m,S=0,u=this._characterJoinerService.getJoinedCharacters(m),y=0;y<r.cols;y++){if(o=this._cellColorResolver.result.bg,c.loadCell(y,a),y===0&&(o=this._cellColorResolver.result.bg),h=!1,f=y>=S,C=y,u.length>0&&y===u[0][0]&&f){x=u.shift();let G=this._model.selection.isCellSelected(this._terminal,x[0],m);for(p=x[0]+1;p<x[1];p++)f&&=G===this._model.selection.isCellSelected(this._terminal,p,m);f&&=!k||R<x[0]||R>=x[1],f?(h=!0,a=new nL(a,c.translateToString(!0,x[0],x[1]),x[1]-x[0]),C=x[1]-1):S=x[1]}if(E=a.getChars(),g=a.getCode(),p=(v*r.cols+y)*rh,this._cellColorResolver.resolve(a,y,m,this.dimensions.device.cell.width),F&&m===L&&(y===R&&(this._model.cursor={x:R,y:M,width:a.getWidth(),style:this._coreBrowserService.isFocused?A:r.options.cursorInactiveStyle,cursorWidth:r.options.cursorWidth,dpr:this._devicePixelRatio},O=R+a.getWidth()-1),y>=R&&y<=O&&(this._coreBrowserService.isFocused&&A==="block"||this._coreBrowserService.isFocused===!1&&r.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)),g!==0&&(this._model.lineLengths[v]=y+1),!(this._model.cells[p]===g&&this._model.cells[p+Uu]===this._cellColorResolver.result.bg&&this._model.cells[p+Fu]===this._cellColorResolver.result.fg&&this._model.cells[p+hp]===this._cellColorResolver.result.ext)&&(U=!0,E.length>1&&(g|=DR),this._model.cells[p]=g,this._model.cells[p+Uu]=this._cellColorResolver.result.bg,this._model.cells[p+Fu]=this._cellColorResolver.result.fg,this._model.cells[p+hp]=this._cellColorResolver.result.ext,b=a.getWidth(),this._glyphRenderer.value.updateCell(y,v,g,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,E,b,o),h)){for(a=this._workCell,y++;y<=C;y++)T=(v*r.cols+y)*rh,this._glyphRenderer.value.updateCell(y,v,0,0,0,0,z3,0,0),this._model.cells[T]=0,this._model.cells[T+Uu]=this._cellColorResolver.result.bg,this._model.cells[T+Fu]=this._cellColorResolver.result.fg,this._model.cells[T+hp]=this._cellColorResolver.result.ext;y--}}U&&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(e,n){this._canvas.width===e&&this._canvas.height===n||(this._canvas.width=e,this._canvas.height=n,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},nL=class extends eo{constructor(e,n,r){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=n,this._width=r}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function R1(e,n,r=0){return Math.max(Math.min(e,n),r)}var L1="di$target",M1="di$dependencies",mp=new Map;function ar(e){if(mp.has(e))return mp.get(e);let n=function(r,a,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");iL(n,r,o)};return n._id=e,mp.set(e,n),n}function iL(e,n,r){n[L1]===n?n[M1].push({id:e,index:r}):(n[M1]=[{id:e,index:r}],n[L1]=n)}ar("BufferService");ar("CoreMouseService");ar("CoreService");ar("CharsetService");ar("InstantiationService");ar("LogService");var rL=ar("OptionsService");ar("OscLinkService");ar("UnicodeService");ar("DecorationService");var sL={trace:0,debug:1,info:2,warn:3,error:4,off:5},aL="xterm.js: ",D1=class extends Gi{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=sL[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let n=0;n<e.length;n++)typeof e[n]=="function"&&(e[n]=e[n]())}_log(e,n,r){this._evalLazyOptionalParams(r),e.call(console,(this._optionsService.options.logger?"":aL)+n,...r)}trace(e,...n){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,n)}debug(e,...n){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,n)}info(e,...n){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,n)}warn(e,...n){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,n)}error(e,...n){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,n)}};D1=k3([A3(0,rL)],D1);var oL=class extends Gi{constructor(e){if(Lw&&$3()<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=e,this._onChangeTextureAtlas=this._register(new Dt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Dt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Dt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Dt),this.onContextLoss=this._onContextLoss.event}activate(e){let n=e._core;if(!e.element){this._register(n.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let r=n.coreService,a=n.optionsService,o=n,v=o._renderService,m=o._characterJoinerService,c=o._charSizeService,u=o._coreBrowserService,h=o._decorationService;o._logService;let S=o._themeService;this._renderer=this._register(new tL(e,m,c,u,r,h,a,S,this._preserveDrawingBuffer)),this._register(Br.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(Br.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(Br.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(Br.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),v.setRenderer(this._renderer),this._register(Nn(()=>{if(this._terminal._core._store._isDisposed)return;let f=this._terminal._core._renderService;f.setRenderer(this._terminal._core._createRenderer()),f.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},_p={exports:{}},O1;function lL(){return O1||(O1=1,(function(e,n){(function(r,a){e.exports=a()})(globalThis,(()=>(()=>{var r={4567:function(m,c,u){var h=this&&this.__decorate||function(p,y,T,A){var L,M=arguments.length,R=M<3?y:A===null?A=Object.getOwnPropertyDescriptor(y,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,y,T,A);else for(var O=p.length-1;O>=0;O--)(L=p[O])&&(R=(M<3?L(R):M>3?L(y,T,R):L(y,T))||R);return M>3&&R&&Object.defineProperty(y,T,R),R},S=this&&this.__param||function(p,y){return function(T,A){y(T,A,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const f=u(9042),C=u(9924),x=u(844),k=u(4725),E=u(2585),g=u(3656);let b=c.AccessibilityManager=class extends x.Disposable{constructor(p,y,T,A){super(),this._terminal=p,this._coreBrowserService=T,this._renderService=A,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let L=0;L<this._terminal.rows;L++)this._rowElements[L]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[L]);if(this._topBoundaryFocusListener=L=>this._handleBoundaryFocus(L,0),this._bottomBoundaryFocusListener=L=>this._handleBoundaryFocus(L,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new C.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((L=>this._handleResize(L.rows)))),this.register(this._terminal.onRender((L=>this._refreshRows(L.start,L.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((L=>this._handleChar(L)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
76
- `)))),this.register(this._terminal.onA11yTab((L=>this._handleTab(L)))),this.register(this._terminal.onKey((L=>this._handleKey(L.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,g.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,x.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(p){for(let y=0;y<p;y++)this._handleChar(" ")}_handleChar(p){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==p&&(this._charsToAnnounce+=p):this._charsToAnnounce+=p,p===`
77
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(p){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(p)||this._charsToConsume.push(p)}_refreshRows(p,y){this._liveRegionDebouncer.refresh(p,y,this._terminal.rows)}_renderRows(p,y){const T=this._terminal.buffer,A=T.lines.length.toString();for(let L=p;L<=y;L++){const M=T.lines.get(T.ydisp+L),R=[],O=M?.translateToString(!0,void 0,void 0,R)||"",F=(T.ydisp+L+1).toString(),U=this._rowElements[L];U&&(O.length===0?(U.innerText=" ",this._rowColumns.set(U,[0,1])):(U.textContent=O,this._rowColumns.set(U,R)),U.setAttribute("aria-posinset",F),U.setAttribute("aria-setsize",A))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(p,y){const T=p.target,A=this._rowElements[y===0?1:this._rowElements.length-2];if(T.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||p.relatedTarget!==A)return;let L,M;if(y===0?(L=T,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(L=this._rowElements.shift(),M=T,this._rowContainer.removeChild(L)),L.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const R=this._createAccessibilityTreeNode();this._rowElements.unshift(R),this._rowContainer.insertAdjacentElement("afterbegin",R)}else{const R=this._createAccessibilityTreeNode();this._rowElements.push(R),this._rowContainer.appendChild(R)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),p.preventDefault(),p.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const p=document.getSelection();if(!p)return;if(p.isCollapsed)return void(this._rowContainer.contains(p.anchorNode)&&this._terminal.clearSelection());if(!p.anchorNode||!p.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:p.anchorNode,offset:p.anchorOffset},T={node:p.focusNode,offset:p.focusOffset};if((y.node.compareDocumentPosition(T.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===T.node&&y.offset>T.offset)&&([y,T]=[T,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const A=this._rowElements.slice(-1)[0];if(T.node.compareDocumentPosition(A)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(T={node:A,offset:A.textContent?.length??0}),!this._rowContainer.contains(T.node))return;const L=({node:O,offset:F})=>{const U=O instanceof Text?O.parentNode:O;let G=parseInt(U?.getAttribute("aria-posinset"),10)-1;if(isNaN(G))return console.warn("row is invalid. Race condition?"),null;const B=this._rowColumns.get(U);if(!B)return console.warn("columns is null. Race condition?"),null;let K=F<B.length?B[F]:B.slice(-1)[0]+1;return K>=this._terminal.cols&&(++G,K=0),{row:G,column:K}},M=L(y),R=L(T);if(M&&R){if(M.row>R.row||M.row===R.row&&M.column>=R.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(R.row-M.row)*this._terminal.cols-M.column+R.column)}}_handleResize(p){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);for(;this._rowElements.length>p;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const p=this._coreBrowserService.mainDocument.createElement("div");return p.setAttribute("role","listitem"),p.tabIndex=-1,this._refreshRowDimensions(p),p}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let p=0;p<this._terminal.rows;p++)this._refreshRowDimensions(this._rowElements[p])}}_refreshRowDimensions(p){p.style.height=`${this._renderService.dimensions.css.cell.height}px`}};c.AccessibilityManager=b=h([S(1,E.IInstantiationService),S(2,k.ICoreBrowserService),S(3,k.IRenderService)],b)},3614:(m,c)=>{function u(C){return C.replace(/\r?\n/g,"\r")}function h(C,x){return x?"\x1B[200~"+C+"\x1B[201~":C}function S(C,x,k,E){C=h(C=u(C),k.decPrivateModes.bracketedPasteMode&&E.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(C,!0),x.value=""}function f(C,x,k){const E=k.getBoundingClientRect(),g=C.clientX-E.left-10,b=C.clientY-E.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${g}px`,x.style.top=`${b}px`,x.style.zIndex="1000",x.focus()}Object.defineProperty(c,"__esModule",{value:!0}),c.rightClickHandler=c.moveTextAreaUnderMouseCursor=c.paste=c.handlePasteEvent=c.copyHandler=c.bracketTextForPaste=c.prepareTextForTerminal=void 0,c.prepareTextForTerminal=u,c.bracketTextForPaste=h,c.copyHandler=function(C,x){C.clipboardData&&C.clipboardData.setData("text/plain",x.selectionText),C.preventDefault()},c.handlePasteEvent=function(C,x,k,E){C.stopPropagation(),C.clipboardData&&S(C.clipboardData.getData("text/plain"),x,k,E)},c.paste=S,c.moveTextAreaUnderMouseCursor=f,c.rightClickHandler=function(C,x,k,E,g){f(C,x,k),g&&E.rightClickSelect(C),x.value=E.selectionText,x.select()}},7239:(m,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(S,f,C){this._css.set(S,f,C)}getCss(S,f){return this._css.get(S,f)}setColor(S,f,C){this._color.set(S,f,C)}getColor(S,f){return this._color.get(S,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(u,h,S,f){u.addEventListener(h,S,f);let C=!1;return{dispose:()=>{C||(C=!0,u.removeEventListener(h,S,f))}}}},3551:function(m,c,u){var h=this&&this.__decorate||function(b,p,y,T){var A,L=arguments.length,M=L<3?p:T===null?T=Object.getOwnPropertyDescriptor(p,y):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(b,p,y,T);else for(var R=b.length-1;R>=0;R--)(A=b[R])&&(M=(L<3?A(M):L>3?A(p,y,M):A(p,y))||M);return L>3&&M&&Object.defineProperty(p,y,M),M},S=this&&this.__param||function(b,p){return function(y,T){p(y,T,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const f=u(3656),C=u(8460),x=u(844),k=u(2585),E=u(4725);let g=c.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(b,p,y,T,A){super(),this._element=b,this._mouseService=p,this._renderService=y,this._bufferService=T,this._linkProviderService=A,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new C.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new C.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(b){this._lastMouseEvent=b;const p=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!p)return;this._isMouseOut=!1;const y=b.composedPath();for(let T=0;T<y.length;T++){const A=y[T];if(A.classList.contains("xterm"))break;if(A.classList.contains("xterm-hover"))return}this._lastBufferCell&&p.x===this._lastBufferCell.x&&p.y===this._lastBufferCell.y||(this._handleHover(p),this._lastBufferCell=p)}_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,p){this._activeProviderReplies&&p||(this._activeProviderReplies?.forEach((T=>{T?.forEach((A=>{A.link.dispose&&A.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let y=!1;for(const[T,A]of this._linkProviderService.linkProviders.entries())p?this._activeProviderReplies?.get(T)&&(y=this._checkLinkProviderResult(T,b,y)):A.provideLinks(b.y,(L=>{if(this._isMouseOut)return;const M=L?.map((R=>({link:R})));this._activeProviderReplies?.set(T,M),y=this._checkLinkProviderResult(T,b,y),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,p){const y=new Set;for(let T=0;T<p.size;T++){const A=p.get(T);if(A)for(let L=0;L<A.length;L++){const M=A[L],R=M.link.range.start.y<b?0:M.link.range.start.x,O=M.link.range.end.y>b?this._bufferService.cols:M.link.range.end.x;for(let F=R;F<=O;F++){if(y.has(F)){A.splice(L--,1);break}y.add(F)}}}}_checkLinkProviderResult(b,p,y){if(!this._activeProviderReplies)return y;const T=this._activeProviderReplies.get(b);let A=!1;for(let L=0;L<b;L++)this._activeProviderReplies.has(L)&&!this._activeProviderReplies.get(L)||(A=!0);if(!A&&T){const L=T.find((M=>this._linkAtPosition(M.link,p)));L&&(y=!0,this._handleNewLink(L))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let L=0;L<this._activeProviderReplies.size;L++){const M=this._activeProviderReplies.get(L)?.find((R=>this._linkAtPosition(R.link,p)));if(M){y=!0,this._handleNewLink(M);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const p=this._positionFromMouseEvent(b,this._element,this._mouseService);p&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,p)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,p){this._currentLink&&this._lastMouseEvent&&(!b||!p||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=p)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._linkAtPosition(b.link,p)&&(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:y=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:y=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const T=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,A=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=T&&this._currentLink.link.range.end.y<=A&&(this._clearCurrentLink(T,A),this._lastMouseEvent)){const L=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);L&&this._askForLink(L,!1)}}))))}_linkHover(b,p,y){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),p.hover&&p.hover(y,p.text)}_fireUnderlineEvent(b,p){const y=b.range,T=this._bufferService.buffer.ydisp,A=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-T-1,y.end.x,y.end.y-T-1,void 0);(p?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(A)}_linkLeave(b,p,y){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),p.leave&&p.leave(y,p.text)}_linkAtPosition(b,p){const y=b.range.start.y*this._bufferService.cols+b.range.start.x,T=b.range.end.y*this._bufferService.cols+b.range.end.x,A=p.y*this._bufferService.cols+p.x;return y<=A&&A<=T}_positionFromMouseEvent(b,p,y){const T=y.getCoords(b,p,this._bufferService.cols,this._bufferService.rows);if(T)return{x:T[0],y:T[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,p,y,T,A){return{x1:b,y1:p,x2:y,y2:T,cols:this._bufferService.cols,fg:A}}};c.Linkifier=g=h([S(1,E.IMouseService),S(2,E.IRenderService),S(3,k.IBufferService),S(4,E.ILinkProviderService)],g)},9042:(m,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(m,c,u){var h=this&&this.__decorate||function(E,g,b,p){var y,T=arguments.length,A=T<3?g:p===null?p=Object.getOwnPropertyDescriptor(g,b):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(E,g,b,p);else for(var L=E.length-1;L>=0;L--)(y=E[L])&&(A=(T<3?y(A):T>3?y(g,b,A):y(g,b))||A);return T>3&&A&&Object.defineProperty(g,b,A),A},S=this&&this.__param||function(E,g){return function(b,p){g(b,p,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const f=u(511),C=u(2585);let x=c.OscLinkProvider=class{constructor(E,g,b){this._bufferService=E,this._optionsService=g,this._oscLinkService=b}provideLinks(E,g){const b=this._bufferService.buffer.lines.get(E-1);if(!b)return void g(void 0);const p=[],y=this._optionsService.rawOptions.linkHandler,T=new f.CellData,A=b.getTrimmedLength();let L=-1,M=-1,R=!1;for(let O=0;O<A;O++)if(M!==-1||b.hasContent(O)){if(b.loadCell(O,T),T.hasExtendedAttrs()&&T.extended.urlId){if(M===-1){M=O,L=T.extended.urlId;continue}R=T.extended.urlId!==L}else M!==-1&&(R=!0);if(R||M!==-1&&O===A-1){const F=this._oscLinkService.getLinkData(L)?.uri;if(F){const U={start:{x:M+1,y:E},end:{x:O+(R||O!==A-1?0:1),y:E}};let G=!1;if(!y?.allowNonHttpProtocols)try{const B=new URL(F);["http:","https:"].includes(B.protocol)||(G=!0)}catch{G=!0}G||p.push({text:F,range:U,activate:(B,K)=>y?y.activate(B,K,U):k(0,K),hover:(B,K)=>y?.hover?.(B,K,U),leave:(B,K)=>y?.leave?.(B,K,U)})}R=!1,T.hasExtendedAttrs()&&T.extended.urlId?(M=O,L=T.extended.urlId):(M=-1,L=-1)}}g(p)}};function k(E,g){if(confirm(`Do you want to navigate to ${g}?
78
-
79
- WARNING: This link could potentially be dangerous`)){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=g}else console.warn("Opening link blocked as opener could not be cleared")}}c.OscLinkProvider=x=h([S(0,C.IBufferService),S(1,C.IOptionsService),S(2,C.IOscLinkService)],x)},6193:(m,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,S){this._rowCount=S,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:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const h=u(3614),S=u(3656),f=u(3551),C=u(9042),x=u(3730),k=u(1680),E=u(3107),g=u(5744),b=u(2950),p=u(1296),y=u(428),T=u(4269),A=u(5114),L=u(8934),M=u(3230),R=u(9312),O=u(4725),F=u(6731),U=u(8055),G=u(8969),B=u(8460),K=u(844),te=u(6114),q=u(8437),W=u(2584),Y=u(7399),I=u(5941),$=u(9074),N=u(2585),H=u(5435),Z=u(4567),ae=u(779);class ce extends G.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=te,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new K.MutableDisposable),this._onCursorMove=this.register(new B.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new B.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new B.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new B.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new B.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new B.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new B.EventEmitter),this._onBlur=this.register(new B.EventEmitter),this._onA11yCharEmitter=this.register(new B.EventEmitter),this._onA11yTabEmitter=this.register(new B.EventEmitter),this._onWillOpen=this.register(new B.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance($.DecorationService),this._instantiationService.setService(N.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ae.LinkProviderService),this._instantiationService.setService(O.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((P,oe)=>this.refresh(P,oe)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((P=>this._reportWindowsOptions(P)))),this.register(this._inputHandler.onColor((P=>this._handleColorEvent(P)))),this.register((0,B.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,B.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((P=>this._afterResize(P.cols,P.rows)))),this.register((0,K.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(Q){if(this._themeService)for(const P of Q){let oe,ge="";switch(P.index){case 256:oe="foreground",ge="10";break;case 257:oe="background",ge="11";break;case 258:oe="cursor",ge="12";break;default:oe="ansi",ge="4;"+P.index}switch(P.type){case 0:const Se=U.color.toColorRGB(oe==="ansi"?this._themeService.colors.ansi[P.index]:this._themeService.colors[oe]);this.coreService.triggerDataEvent(`${W.C0.ESC}]${ge};${(0,I.toRgbString)(Se)}${W.C1_ESCAPED.ST}`);break;case 1:if(oe==="ansi")this._themeService.modifyColors((ye=>ye.ansi[P.index]=U.channels.toColor(...P.color)));else{const ye=oe;this._themeService.modifyColors((Pe=>Pe[ye]=U.channels.toColor(...P.color)))}break;case 2:this._themeService.restoreColor(P.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(Z.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Q){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.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(W.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,P=this.buffer.lines.get(Q);if(!P)return;const oe=Math.min(this.buffer.x,this.cols-1),ge=this._renderService.dimensions.css.cell.height,Se=P.getWidth(oe),ye=this._renderService.dimensions.css.cell.width*Se,Pe=this.buffer.y*this._renderService.dimensions.css.cell.height,Fe=oe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Fe+"px",this.textarea.style.top=Pe+"px",this.textarea.style.width=ye+"px",this.textarea.style.height=ge+"px",this.textarea.style.lineHeight=ge+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,S.addDisposableDomListener)(this.element,"copy",(P=>{this.hasSelection()&&(0,h.copyHandler)(P,this._selectionService)})));const Q=P=>(0,h.handlePasteEvent)(P,this.textarea,this.coreService,this.optionsService);this.register((0,S.addDisposableDomListener)(this.textarea,"paste",Q)),this.register((0,S.addDisposableDomListener)(this.element,"paste",Q)),te.isFirefox?this.register((0,S.addDisposableDomListener)(this.element,"mousedown",(P=>{P.button===2&&(0,h.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,S.addDisposableDomListener)(this.element,"contextmenu",(P=>{(0,h.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),te.isLinux&&this.register((0,S.addDisposableDomListener)(this.element,"auxclick",(P=>{P.button===1&&(0,h.moveTextAreaUnderMouseCursor)(P,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,S.addDisposableDomListener)(this.textarea,"keyup",(Q=>this._keyUp(Q)),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"keydown",(Q=>this._keyDown(Q)),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"keypress",(Q=>this._keyPress(Q)),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionupdate",(Q=>this._compositionHelper.compositionupdate(Q)))),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,S.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 P=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),P.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,S.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),P.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",C.promptLabel),te.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(A.CoreBrowserService,this.textarea,Q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(O.ICoreBrowserService,this._coreBrowserService),this.register((0,S.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,S.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(O.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(F.ThemeService),this._instantiationService.setService(O.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(T.CharacterJoinerService),this._instantiationService.setService(O.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(O.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(L.MouseService),this._instantiationService.setService(O.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(P);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(k.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(R.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(O.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,S.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(E.BufferDecorationRenderer,this.screenElement)),this.register((0,S.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(Z.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(g.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(g.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(p.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Q=this,P=this.element;function oe(ye){const Pe=Q._mouseService.getMouseReportCoords(ye,Q.screenElement);if(!Pe)return!1;let Fe,Xe;switch(ye.overrideType||ye.type){case"mousemove":Xe=32,ye.buttons===void 0?(Fe=3,ye.button!==void 0&&(Fe=ye.button<3?ye.button:3)):Fe=1&ye.buttons?0:4&ye.buttons?1:2&ye.buttons?2:3;break;case"mouseup":Xe=0,Fe=ye.button<3?ye.button:3;break;case"mousedown":Xe=1,Fe=ye.button<3?ye.button:3;break;case"wheel":if(Q._customWheelEventHandler&&Q._customWheelEventHandler(ye)===!1||Q.viewport.getLinesScrolled(ye)===0)return!1;Xe=ye.deltaY<0?0:1,Fe=4;break;default:return!1}return!(Xe===void 0||Fe===void 0||Fe>4)&&Q.coreMouseService.triggerMouseEvent({col:Pe.col,row:Pe.row,x:Pe.x,y:Pe.y,button:Fe,action:Xe,ctrl:ye.ctrlKey,alt:ye.altKey,shift:ye.shiftKey})}const ge={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Se={mouseup:ye=>(oe(ye),ye.buttons||(this._document.removeEventListener("mouseup",ge.mouseup),ge.mousedrag&&this._document.removeEventListener("mousemove",ge.mousedrag)),this.cancel(ye)),wheel:ye=>(oe(ye),this.cancel(ye,!0)),mousedrag:ye=>{ye.buttons&&oe(ye)},mousemove:ye=>{ye.buttons||oe(ye)}};this.register(this.coreMouseService.onProtocolChange((ye=>{ye?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ye)),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&ye?ge.mousemove||(P.addEventListener("mousemove",Se.mousemove),ge.mousemove=Se.mousemove):(P.removeEventListener("mousemove",ge.mousemove),ge.mousemove=null),16&ye?ge.wheel||(P.addEventListener("wheel",Se.wheel,{passive:!1}),ge.wheel=Se.wheel):(P.removeEventListener("wheel",ge.wheel),ge.wheel=null),2&ye?ge.mouseup||(ge.mouseup=Se.mouseup):(this._document.removeEventListener("mouseup",ge.mouseup),ge.mouseup=null),4&ye?ge.mousedrag||(ge.mousedrag=Se.mousedrag):(this._document.removeEventListener("mousemove",ge.mousedrag),ge.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,S.addDisposableDomListener)(P,"mousedown",(ye=>{if(ye.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ye))return oe(ye),ge.mouseup&&this._document.addEventListener("mouseup",ge.mouseup),ge.mousedrag&&this._document.addEventListener("mousemove",ge.mousedrag),this.cancel(ye)}))),this.register((0,S.addDisposableDomListener)(P,"wheel",(ye=>{if(!ge.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ye)===!1)return!1;if(!this.buffer.hasScrollback){const Pe=this.viewport.getLinesScrolled(ye);if(Pe===0)return;const Fe=W.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ye.deltaY<0?"A":"B");let Xe="";for(let xt=0;xt<Math.abs(Pe);xt++)Xe+=Fe;return this.coreService.triggerDataEvent(Xe,!0),this.cancel(ye,!0)}return this.viewport.handleWheel(ye)?this.cancel(ye):void 0}}),{passive:!1})),this.register((0,S.addDisposableDomListener)(P,"touchstart",(ye=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ye),this.cancel(ye)}),{passive:!0})),this.register((0,S.addDisposableDomListener)(P,"touchmove",(ye=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ye)?void 0:this.cancel(ye)}),{passive:!1}))}refresh(Q,P){this._renderService?.refreshRows(Q,P)}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,P,oe=0){oe===1?(super.scrollLines(Q,P,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 P=this._characterJoinerService.register(Q);return this.refresh(0,this.rows-1),P}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,P,oe){this._selectionService.setSelection(Q,P,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,P){this._selectionService?.selectLines(Q,P)}_keyDown(Q){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;const P=this.browser.isMac&&this.options.macOptionIsMeta&&Q.altKey;if(!P&&!this._compositionHelper.keydown(Q))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;P||Q.key!=="Dead"&&Q.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const oe=(0,Y.evaluateKeyboardEvent)(Q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Q),oe.type===3||oe.type===2){const ge=this.rows-1;return this.scrollLines(oe.type===2?-ge:ge),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!==W.C0.ETX&&oe.key!==W.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,P){const oe=Q.isMac&&!this.options.macOptionIsMeta&&P.altKey&&!P.ctrlKey&&!P.metaKey||Q.isWindows&&P.altKey&&P.ctrlKey&&!P.metaKey||Q.isWindows&&P.getModifierState("AltGraph");return P.type==="keypress"?oe:oe&&(!P.keyCode||P.keyCode>47)}_keyUp(Q){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1||((function(P){return P.keyCode===16||P.keyCode===17||P.keyCode===18})(Q)||this.focus(),this.updateCursorStyle(Q),this._keyPressHandled=!1)}_keyPress(Q){let P;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;if(this.cancel(Q),Q.charCode)P=Q.charCode;else if(Q.which===null||Q.which===void 0)P=Q.keyCode;else{if(Q.which===0||Q.charCode===0)return!1;P=Q.which}return!(!P||(Q.altKey||Q.ctrlKey||Q.metaKey)&&!this._isThirdLevelShift(this.browser,Q)||(P=String.fromCharCode(P),this._onKey.fire({key:P,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(P,!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 P=Q.data;return this.coreService.triggerDataEvent(P,!0),this.cancel(Q),!0}return!1}resize(Q,P){Q!==this.cols||P!==this.rows?super.resize(Q,P):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Q,P){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(q.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(W.C0.ESC+"[I"):this.coreService.triggerDataEvent(W.C0.ESC+"[O")}_reportWindowsOptions(Q){if(this._renderService)switch(Q){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const P=this._renderService.dimensions.css.canvas.width.toFixed(0),oe=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[4;${oe};${P}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ge=this._renderService.dimensions.css.cell.width.toFixed(0),Se=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[6;${Se};${ge}t`)}}cancel(Q,P){if(this.options.cancelEvents||P)return Q.preventDefault(),Q.stopPropagation(),!1}}c.Terminal=ce},9924:(m,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,S){this._rowCount=S,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const C=f-this._lastRefreshMs,x=this._debounceThresholdMS-C;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h)}}},1680:function(m,c,u){var h=this&&this.__decorate||function(b,p,y,T){var A,L=arguments.length,M=L<3?p:T===null?T=Object.getOwnPropertyDescriptor(p,y):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(b,p,y,T);else for(var R=b.length-1;R>=0;R--)(A=b[R])&&(M=(L<3?A(M):L>3?A(p,y,M):A(p,y))||M);return L>3&&M&&Object.defineProperty(p,y,M),M},S=this&&this.__param||function(b,p){return function(y,T){p(y,T,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const f=u(3656),C=u(4725),x=u(8460),k=u(844),E=u(2585);let g=c.Viewport=class extends k.Disposable{constructor(b,p,y,T,A,L,M,R){super(),this._viewportElement=b,this._scrollArea=p,this._bufferService=y,this._optionsService=T,this._charSizeService=A,this._renderService=L,this._coreBrowserService=M,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((O=>this._activeBuffer=O.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((O=>this._renderDimensions=O))),this._handleThemeChange(R.colors),this.register(R.onChangeColors((O=>this._handleThemeChange(O)))),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 p=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==p&&(this._lastRecordedBufferHeight=p,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const 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 p=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const 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,p){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(p<0&&this._viewportElement.scrollTop!==0||p>0&&y<this._lastRecordedBufferHeight)||(b.cancelable&&b.preventDefault(),!1)}handleWheel(b){const p=this._getPixelsScrolled(b);return p!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+p:this._smoothScrollState.target+=p,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=p,this._bubbleScroll(b,p))}scrollLines(b){if(b!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const p=b*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+p,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:b,suppressScrollEvent:!1})}_getPixelsScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let p=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_LINE?p*=this._currentRowHeight:b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(p*=this._currentRowHeight*this._bufferService.rows),p}getBufferElements(b,p){let y,T="";const A=[],L=p??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let R=b;R<L;R++){const O=M.get(R);if(!O)continue;const F=M.get(R+1)?.isWrapped;if(T+=O.translateToString(!F),!F||R===M.length-1){const U=document.createElement("div");U.textContent=T,A.push(U),T.length>0&&(y=U),T=""}}return{bufferElements:A,cursorElement:y}}getLinesScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let p=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(p/=this._currentRowHeight+0,this._wheelPartialScroll+=p,p=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(p*=this._bufferService.rows),p}_applyScrollModifier(b,p){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&p.altKey||y==="ctrl"&&p.ctrlKey||y==="shift"&&p.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 p=this._lastTouchY-b.touches[0].pageY;return this._lastTouchY=b.touches[0].pageY,p!==0&&(this._viewportElement.scrollTop+=p,this._bubbleScroll(b,p))}};c.Viewport=g=h([S(2,E.IBufferService),S(3,E.IOptionsService),S(4,C.ICharSizeService),S(5,C.IRenderService),S(6,C.ICoreBrowserService),S(7,C.IThemeService)],g)},3107:function(m,c,u){var h=this&&this.__decorate||function(E,g,b,p){var y,T=arguments.length,A=T<3?g:p===null?p=Object.getOwnPropertyDescriptor(g,b):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(E,g,b,p);else for(var L=E.length-1;L>=0;L--)(y=E[L])&&(A=(T<3?y(A):T>3?y(g,b,A):y(g,b))||A);return T>3&&A&&Object.defineProperty(g,b,A),A},S=this&&this.__param||function(E,g){return function(b,p){g(b,p,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const f=u(4725),C=u(844),x=u(2585);let k=c.BufferDecorationRenderer=class extends C.Disposable{constructor(E,g,b,p,y){super(),this._screenElement=E,this._bufferService=g,this._coreBrowserService=b,this._decorationService=p,this._renderService=y,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((T=>this._removeDecoration(T)))),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 E of this._decorationService.decorations)this._renderDecoration(E);this._dimensionsChanged=!1}_renderDecoration(E){this._refreshStyle(E),this._dimensionsChanged&&this._refreshXPosition(E)}_createElement(E){const g=this._coreBrowserService.mainDocument.createElement("div");g.classList.add("xterm-decoration"),g.classList.toggle("xterm-decoration-top-layer",E?.options?.layer==="top"),g.style.width=`${Math.round((E.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,g.style.height=(E.options.height||1)*this._renderService.dimensions.css.cell.height+"px",g.style.top=(E.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",g.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const b=E.options.x??0;return b&&b>this._bufferService.cols&&(g.style.display="none"),this._refreshXPosition(E,g),g}_refreshStyle(E){const g=E.marker.line-this._bufferService.buffers.active.ydisp;if(g<0||g>=this._bufferService.rows)E.element&&(E.element.style.display="none",E.onRenderEmitter.fire(E.element));else{let b=this._decorationElements.get(E);b||(b=this._createElement(E),E.element=b,this._decorationElements.set(E,b),this._container.appendChild(b),E.onDispose((()=>{this._decorationElements.delete(E),b.remove()}))),b.style.top=g*this._renderService.dimensions.css.cell.height+"px",b.style.display=this._altBufferIsActive?"none":"block",E.onRenderEmitter.fire(b)}}_refreshXPosition(E,g=E.element){if(!g)return;const b=E.options.x??0;(E.options.anchor||"left")==="right"?g.style.right=b?b*this._renderService.dimensions.css.cell.width+"px":"":g.style.left=b?b*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(E){this._decorationElements.get(E)?.remove(),this._decorationElements.delete(E),E.dispose()}};c.BufferDecorationRenderer=k=h([S(1,x.IBufferService),S(2,f.ICoreBrowserService),S(3,x.IDecorationService),S(4,f.IRenderService)],k)},5871:(m,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,S){return h>=u.startBufferLine-this._linePadding[S||"full"]&&h<=u.endBufferLine+this._linePadding[S||"full"]}_addLineToZone(u,h){u.startBufferLine=Math.min(u.startBufferLine,h),u.endBufferLine=Math.max(u.endBufferLine,h)}}},5744:function(m,c,u){var h=this&&this.__decorate||function(y,T,A,L){var M,R=arguments.length,O=R<3?T:L===null?L=Object.getOwnPropertyDescriptor(T,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(y,T,A,L);else for(var F=y.length-1;F>=0;F--)(M=y[F])&&(O=(R<3?M(O):R>3?M(T,A,O):M(T,A))||O);return R>3&&O&&Object.defineProperty(T,A,O),O},S=this&&this.__param||function(y,T){return function(A,L){T(A,L,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const f=u(5871),C=u(4725),x=u(844),k=u(2585),E={full:0,left:0,center:0,right:0},g={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0};let p=c.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,T,A,L,M,R,O){super(),this._viewportElement=y,this._screenElement=T,this._bufferService=A,this._decorationService=L,this._renderService=M,this._optionsService=R,this._coreBrowserService=O,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 F=this._canvas.getContext("2d");if(!F)throw new Error("Ctx cannot be null");this._ctx=F,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.toDisposable)((()=>{this._canvas?.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),T=Math.ceil(this._canvas.width/3);g.full=this._canvas.width,g.left=y,g.center=T,g.right=y,this._refreshDrawHeightConstants(),b.full=0,b.left=0,b.center=g.left,b.right=g.left+g.center}_refreshDrawHeightConstants(){E.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,T=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);E.left=T,E.center=T,E.right=T}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.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 T of this._decorationService.decorations)this._colorZoneStore.addDecoration(T);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const T of y)T.position!=="full"&&this._renderColorZone(T);for(const T of y)T.position==="full"&&this._renderColorZone(T);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(b[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-E[y.position||"full"]/2),g[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+E[y.position||"full"]))}_queueRefresh(y,T){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=T||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};c.OverviewRulerRenderer=p=h([S(2,k.IBufferService),S(3,k.IDecorationService),S(4,C.IRenderService),S(5,k.IOptionsService),S(6,C.ICoreBrowserService)],p)},2950:function(m,c,u){var h=this&&this.__decorate||function(E,g,b,p){var y,T=arguments.length,A=T<3?g:p===null?p=Object.getOwnPropertyDescriptor(g,b):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(E,g,b,p);else for(var L=E.length-1;L>=0;L--)(y=E[L])&&(A=(T<3?y(A):T>3?y(g,b,A):y(g,b))||A);return T>3&&A&&Object.defineProperty(g,b,A),A},S=this&&this.__param||function(E,g){return function(b,p){g(b,p,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const f=u(4725),C=u(2585),x=u(2584);let k=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(E,g,b,p,y,T){this._textarea=E,this._compositionView=g,this._bufferService=b,this._optionsService=p,this._coreService=y,this._renderService=T,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(E){this._compositionView.textContent=E.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(E){if(this._isComposing||this._isSendingComposition){if(E.keyCode===229||E.keyCode===16||E.keyCode===17||E.keyCode===18)return!1;this._finalizeComposition(!1)}return E.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(E){if(this._compositionView.classList.remove("active"),this._isComposing=!1,E){const g={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let b;this._isSendingComposition=!1,g.start+=this._dataAlreadySent.length,b=this._isComposing?this._textarea.value.substring(g.start,g.end):this._textarea.value.substring(g.start),b.length>0&&this._coreService.triggerDataEvent(b,!0)}}),0)}else{this._isSendingComposition=!1;const g=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(g,!0)}}_handleAnyTextareaChanges(){const E=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const g=this._textarea.value,b=g.replace(E,"");this._dataAlreadySent=b,g.length>E.length?this._coreService.triggerDataEvent(b,!0):g.length<E.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):g.length===E.length&&g!==E&&this._coreService.triggerDataEvent(g,!0)}}),0)}updateCompositionElements(E){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const g=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),b=this._renderService.dimensions.css.cell.height,p=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,y=g*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=y+"px",this._compositionView.style.top=p+"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 T=this._compositionView.getBoundingClientRect();this._textarea.style.left=y+"px",this._textarea.style.top=p+"px",this._textarea.style.width=Math.max(T.width,1)+"px",this._textarea.style.height=Math.max(T.height,1)+"px",this._textarea.style.lineHeight=T.height+"px"}E||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};c.CompositionHelper=k=h([S(2,C.IBufferService),S(3,C.IOptionsService),S(4,C.ICoreService),S(5,f.IRenderService)],k)},9806:(m,c)=>{function u(h,S,f){const C=f.getBoundingClientRect(),x=h.getComputedStyle(f),k=parseInt(x.getPropertyValue("padding-left")),E=parseInt(x.getPropertyValue("padding-top"));return[S.clientX-C.left-k,S.clientY-C.top-E]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=u,c.getCoords=function(h,S,f,C,x,k,E,g,b){if(!k)return;const p=u(h,S,f);return p?(p[0]=Math.ceil((p[0]+(b?E/2:0))/E),p[1]=Math.ceil(p[1]/g),p[0]=Math.min(Math.max(p[0],1),C+(b?1:0)),p[1]=Math.min(Math.max(p[1],1),x),p):void 0}},9504:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const h=u(2584);function S(g,b,p,y){const T=g-f(g,p),A=b-f(b,p),L=Math.abs(T-A)-(function(M,R,O){let F=0;const U=M-f(M,O),G=R-f(R,O);for(let B=0;B<Math.abs(U-G);B++){const K=C(M,R)==="A"?-1:1;O.buffer.lines.get(U+K*B)?.isWrapped&&F++}return F})(g,b,p);return E(L,k(C(g,b),y))}function f(g,b){let p=0,y=b.buffer.lines.get(g),T=y?.isWrapped;for(;T&&g>=0&&g<b.rows;)p++,y=b.buffer.lines.get(--g),T=y?.isWrapped;return p}function C(g,b){return g>b?"A":"B"}function x(g,b,p,y,T,A){let L=g,M=b,R="";for(;L!==p||M!==y;)L+=T?1:-1,T&&L>A.cols-1?(R+=A.buffer.translateBufferLineToString(M,!1,g,L),L=0,g=0,M++):!T&&L<0&&(R+=A.buffer.translateBufferLineToString(M,!1,0,g+1),L=A.cols-1,g=L,M--);return R+A.buffer.translateBufferLineToString(M,!1,g,L)}function k(g,b){const p=b?"O":"[";return h.C0.ESC+p+g}function E(g,b){g=Math.floor(g);let p="";for(let y=0;y<g;y++)p+=b;return p}c.moveToCellSequence=function(g,b,p,y){const T=p.buffer.x,A=p.buffer.y;if(!p.buffer.hasScrollback)return(function(R,O,F,U,G,B){return S(O,U,G,B).length===0?"":E(x(R,O,R,O-f(O,G),!1,G).length,k("D",B))})(T,A,0,b,p,y)+S(A,b,p,y)+(function(R,O,F,U,G,B){let K;K=S(O,U,G,B).length>0?U-f(U,G):O;const te=U,q=(function(W,Y,I,$,N,H){let Z;return Z=S(I,$,N,H).length>0?$-f($,N):Y,W<I&&Z<=$||W>=I&&Z<$?"C":"D"})(R,O,F,U,G,B);return E(x(R,K,F,te,q==="C",G).length,k(q,B))})(T,A,g,b,p,y);let L;if(A===b)return L=T>g?"D":"C",E(Math.abs(T-g),k(L,y));L=A>b?"D":"C";const M=Math.abs(A-b);return E((function(R,O){return O.cols-R})(A>b?g:T,p)+(M-1)*p.cols+1+((A>b?T:g)-1),k(L,y))}},1296:function(m,c,u){var h=this&&this.__decorate||function(B,K,te,q){var W,Y=arguments.length,I=Y<3?K:q===null?q=Object.getOwnPropertyDescriptor(K,te):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(B,K,te,q);else for(var $=B.length-1;$>=0;$--)(W=B[$])&&(I=(Y<3?W(I):Y>3?W(K,te,I):W(K,te))||I);return Y>3&&I&&Object.defineProperty(K,te,I),I},S=this&&this.__param||function(B,K){return function(te,q){K(te,q,B)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const f=u(3787),C=u(2550),x=u(2223),k=u(6171),E=u(6052),g=u(4725),b=u(8055),p=u(8460),y=u(844),T=u(2585),A="xterm-dom-renderer-owner-",L="xterm-rows",M="xterm-fg-",R="xterm-bg-",O="xterm-focus",F="xterm-selection";let U=1,G=c.DomRenderer=class extends y.Disposable{constructor(B,K,te,q,W,Y,I,$,N,H,Z,ae,ce){super(),this._terminal=B,this._document=K,this._element=te,this._screenElement=q,this._viewportElement=W,this._helperContainer=Y,this._linkifier2=I,this._charSizeService=N,this._optionsService=H,this._bufferService=Z,this._coreBrowserService=ae,this._themeService=ce,this._terminalClass=U++,this._rowElements=[],this._selectionRenderModel=(0,E.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new p.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(L),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(F),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,k.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((_e=>this._injectCss(_e)))),this._injectCss(this._themeService.colors),this._rowFactory=$.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(A+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((_e=>this._handleLinkHover(_e)))),this.register(this._linkifier2.onHideLinkUnderline((_e=>this._handleLinkLeave(_e)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(A+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 B=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*B,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*B),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/B),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/B),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 te of this._rowElements)te.style.width=`${this.dimensions.css.canvas.width}px`,te.style.height=`${this.dimensions.css.cell.height}px`,te.style.lineHeight=`${this.dimensions.css.cell.height}px`,te.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const K=`${this._terminalSelector} .${L} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=K,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(B){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let K=`${this._terminalSelector} .${L} { color: ${B.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;K+=`${this._terminalSelector} .${L} .xterm-dim { color: ${b.color.multiplyOpacity(B.foreground,.5).css};}`,K+=`${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 te=`blink_underline_${this._terminalClass}`,q=`blink_bar_${this._terminalClass}`,W=`blink_block_${this._terminalClass}`;K+=`@keyframes ${te} { 50% { border-bottom-style: hidden; }}`,K+=`@keyframes ${q} { 50% { box-shadow: none; }}`,K+=`@keyframes ${W} { 0% { background-color: ${B.cursor.css}; color: ${B.cursorAccent.css}; } 50% { background-color: inherit; color: ${B.cursor.css}; }}`,K+=`${this._terminalSelector} .${L}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${te} 1s step-end infinite;}${this._terminalSelector} .${L}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${L}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-block { background-color: ${B.cursor.css}; color: ${B.cursorAccent.css};}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${B.cursor.css} !important; color: ${B.cursorAccent.css} !important;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${B.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${B.cursor.css} inset;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${B.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,K+=`${this._terminalSelector} .${F} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${F} div { position: absolute; background-color: ${B.selectionBackgroundOpaque.css};}${this._terminalSelector} .${F} div { position: absolute; background-color: ${B.selectionInactiveBackgroundOpaque.css};}`;for(const[Y,I]of B.ansi.entries())K+=`${this._terminalSelector} .${M}${Y} { color: ${I.css}; }${this._terminalSelector} .${M}${Y}.xterm-dim { color: ${b.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${R}${Y} { background-color: ${I.css}; }`;K+=`${this._terminalSelector} .${M}${x.INVERTED_DEFAULT_COLOR} { color: ${b.color.opaque(B.background).css}; }${this._terminalSelector} .${M}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${b.color.multiplyOpacity(b.color.opaque(B.background),.5).css}; }${this._terminalSelector} .${R}${x.INVERTED_DEFAULT_COLOR} { background-color: ${B.foreground.css}; }`,this._themeStyleElement.textContent=K}_setDefaultSpacing(){const B=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${B}px`,this._rowFactory.defaultSpacing=B}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(B,K){for(let te=this._rowElements.length;te<=K;te++){const q=this._document.createElement("div");this._rowContainer.appendChild(q),this._rowElements.push(q)}for(;this._rowElements.length>K;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(B,K){this._refreshRowElements(B,K),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(O),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(O),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(B,K,te){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(B,K,te),this.renderRows(0,this._bufferService.rows-1),!B||!K)return;this._selectionRenderModel.update(this._terminal,B,K,te);const q=this._selectionRenderModel.viewportStartRow,W=this._selectionRenderModel.viewportEndRow,Y=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(Y>=this._bufferService.rows||I<0)return;const $=this._document.createDocumentFragment();if(te){const N=B[0]>K[0];$.appendChild(this._createSelectionElement(Y,N?K[0]:B[0],N?B[0]:K[0],I-Y+1))}else{const N=q===Y?B[0]:0,H=Y===W?K[0]:this._bufferService.cols;$.appendChild(this._createSelectionElement(Y,N,H));const Z=I-Y-1;if($.appendChild(this._createSelectionElement(Y+1,0,this._bufferService.cols,Z)),Y!==I){const ae=W===I?K[0]:this._bufferService.cols;$.appendChild(this._createSelectionElement(I,0,ae))}}this._selectionContainer.appendChild($)}_createSelectionElement(B,K,te,q=1){const W=this._document.createElement("div"),Y=K*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(te-K);return Y+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-Y),W.style.height=q*this.dimensions.css.cell.height+"px",W.style.top=B*this.dimensions.css.cell.height+"px",W.style.left=`${Y}px`,W.style.width=`${I}px`,W}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 B of this._rowElements)B.replaceChildren()}renderRows(B,K){const te=this._bufferService.buffer,q=te.ybase+te.y,W=Math.min(te.x,this._bufferService.cols-1),Y=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,$=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=B;N<=K;N++){const H=N+te.ydisp,Z=this._rowElements[N],ae=te.lines.get(H);if(!Z||!ae)break;Z.replaceChildren(...this._rowFactory.createRow(ae,H,H===q,I,$,W,Y,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${A}${this._terminalClass}`}_handleLinkHover(B){this._setCellUnderline(B.x1,B.x2,B.y1,B.y2,B.cols,!0)}_handleLinkLeave(B){this._setCellUnderline(B.x1,B.x2,B.y1,B.y2,B.cols,!1)}_setCellUnderline(B,K,te,q,W,Y){te<0&&(B=0),q<0&&(K=0);const I=this._bufferService.rows-1;te=Math.max(Math.min(te,I),0),q=Math.max(Math.min(q,I),0),W=Math.min(W,this._bufferService.cols);const $=this._bufferService.buffer,N=$.ybase+$.y,H=Math.min($.x,W-1),Z=this._optionsService.rawOptions.cursorBlink,ae=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let _e=te;_e<=q;++_e){const Q=_e+$.ydisp,P=this._rowElements[_e],oe=$.lines.get(Q);if(!P||!oe)break;P.replaceChildren(...this._rowFactory.createRow(oe,Q,Q===N,ae,ce,H,Z,this.dimensions.css.cell.width,this._widthCache,Y?_e===te?B:0:-1,Y?(_e===q?K:W)-1:-1))}}};c.DomRenderer=G=h([S(7,T.IInstantiationService),S(8,g.ICharSizeService),S(9,T.IOptionsService),S(10,T.IBufferService),S(11,g.ICoreBrowserService),S(12,g.IThemeService)],G)},3787:function(m,c,u){var h=this&&this.__decorate||function(L,M,R,O){var F,U=arguments.length,G=U<3?M:O===null?O=Object.getOwnPropertyDescriptor(M,R):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(L,M,R,O);else for(var B=L.length-1;B>=0;B--)(F=L[B])&&(G=(U<3?F(G):U>3?F(M,R,G):F(M,R))||G);return U>3&&G&&Object.defineProperty(M,R,G),G},S=this&&this.__param||function(L,M){return function(R,O){M(R,O,L)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const f=u(2223),C=u(643),x=u(511),k=u(2585),E=u(8055),g=u(4725),b=u(4269),p=u(6171),y=u(3734);let T=c.DomRendererRowFactory=class{constructor(L,M,R,O,F,U,G){this._document=L,this._characterJoinerService=M,this._optionsService=R,this._coreBrowserService=O,this._coreService=F,this._decorationService=U,this._themeService=G,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(L,M,R){this._selectionStart=L,this._selectionEnd=M,this._columnSelectMode=R}createRow(L,M,R,O,F,U,G,B,K,te,q){const W=[],Y=this._characterJoinerService.getJoinedCharacters(M),I=this._themeService.colors;let $,N=L.getNoBgTrimmedLength();R&&N<U+1&&(N=U+1);let H=0,Z="",ae=0,ce=0,_e=0,Q=!1,P=0,oe=!1,ge=0;const Se=[],ye=te!==-1&&q!==-1;for(let Pe=0;Pe<N;Pe++){L.loadCell(Pe,this._workCell);let Fe=this._workCell.getWidth();if(Fe===0)continue;let Xe=!1,xt=Pe,Ne=this._workCell;if(Y.length>0&&Pe===Y[0][0]){Xe=!0;const dt=Y.shift();Ne=new b.JoinedCellData(this._workCell,L.translateToString(!0,dt[0],dt[1]),dt[1]-dt[0]),xt=dt[1]-1,Fe=Ne.getWidth()}const en=this._isCellInSelection(Pe,M),bn=R&&Pe===U,yn=ye&&Pe>=te&&Pe<=q;let gi=!1;this._decorationService.forEachDecorationAtCell(Pe,M,void 0,(dt=>{gi=!0}));let Oi=Ne.getChars()||C.WHITESPACE_CELL_CHAR;if(Oi===" "&&(Ne.isUnderline()||Ne.isOverline())&&(Oi=" "),ge=Fe*B-K.get(Oi,Ne.isBold(),Ne.isItalic()),$){if(H&&(en&&oe||!en&&!oe&&Ne.bg===ae)&&(en&&oe&&I.selectionForeground||Ne.fg===ce)&&Ne.extended.ext===_e&&yn===Q&&ge===P&&!bn&&!Xe&&!gi){Ne.isInvisible()?Z+=C.WHITESPACE_CELL_CHAR:Z+=Oi,H++;continue}H&&($.textContent=Z),$=this._document.createElement("span"),H=0,Z=""}else $=this._document.createElement("span");if(ae=Ne.bg,ce=Ne.fg,_e=Ne.extended.ext,Q=yn,P=ge,oe=en,Xe&&U>=Pe&&U<=xt&&(U=Pe),!this._coreService.isCursorHidden&&bn&&this._coreService.isCursorInitialized){if(Se.push("xterm-cursor"),this._coreBrowserService.isFocused)G&&Se.push("xterm-cursor-blink"),Se.push(O==="bar"?"xterm-cursor-bar":O==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(F)switch(F){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(Ne.isBold()&&Se.push("xterm-bold"),Ne.isItalic()&&Se.push("xterm-italic"),Ne.isDim()&&Se.push("xterm-dim"),Z=Ne.isInvisible()?C.WHITESPACE_CELL_CHAR:Ne.getChars()||C.WHITESPACE_CELL_CHAR,Ne.isUnderline()&&(Se.push(`xterm-underline-${Ne.extended.underlineStyle}`),Z===" "&&(Z=" "),!Ne.isUnderlineColorDefault()))if(Ne.isUnderlineColorRGB())$.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Ne.getUnderlineColor()).join(",")})`;else{let dt=Ne.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ne.isBold()&&dt<8&&(dt+=8),$.style.textDecorationColor=I.ansi[dt].css}Ne.isOverline()&&(Se.push("xterm-overline"),Z===" "&&(Z=" ")),Ne.isStrikethrough()&&Se.push("xterm-strikethrough"),yn&&($.style.textDecoration="underline");let tn=Ne.getFgColor(),ut=Ne.getFgColorMode(),Vt=Ne.getBgColor(),$t=Ne.getBgColorMode();const zt=!!Ne.isInverse();if(zt){const dt=tn;tn=Vt,Vt=dt;const Hn=ut;ut=$t,$t=Hn}let nn,Ni,Mn,ii=!1;switch(this._decorationService.forEachDecorationAtCell(Pe,M,void 0,(dt=>{dt.options.layer!=="top"&&ii||(dt.backgroundColorRGB&&($t=50331648,Vt=dt.backgroundColorRGB.rgba>>8&16777215,nn=dt.backgroundColorRGB),dt.foregroundColorRGB&&(ut=50331648,tn=dt.foregroundColorRGB.rgba>>8&16777215,Ni=dt.foregroundColorRGB),ii=dt.options.layer==="top")})),!ii&&en&&(nn=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,Vt=nn.rgba>>8&16777215,$t=50331648,ii=!0,I.selectionForeground&&(ut=50331648,tn=I.selectionForeground.rgba>>8&16777215,Ni=I.selectionForeground)),ii&&Se.push("xterm-decoration-top"),$t){case 16777216:case 33554432:Mn=I.ansi[Vt],Se.push(`xterm-bg-${Vt}`);break;case 50331648:Mn=E.channels.toColor(Vt>>16,Vt>>8&255,255&Vt),this._addStyle($,`background-color:#${A((Vt>>>0).toString(16),"0",6)}`);break;default:zt?(Mn=I.foreground,Se.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):Mn=I.background}switch(nn||Ne.isDim()&&(nn=E.color.multiplyOpacity(Mn,.5)),ut){case 16777216:case 33554432:Ne.isBold()&&tn<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(tn+=8),this._applyMinimumContrast($,Mn,I.ansi[tn],Ne,nn,void 0)||Se.push(`xterm-fg-${tn}`);break;case 50331648:const dt=E.channels.toColor(tn>>16&255,tn>>8&255,255&tn);this._applyMinimumContrast($,Mn,dt,Ne,nn,Ni)||this._addStyle($,`color:#${A(tn.toString(16),"0",6)}`);break;default:this._applyMinimumContrast($,Mn,I.foreground,Ne,nn,Ni)||zt&&Se.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}Se.length&&($.className=Se.join(" "),Se.length=0),bn||Xe||gi?$.textContent=Z:H++,ge!==this.defaultSpacing&&($.style.letterSpacing=`${ge}px`),W.push($),Pe=xt}return $&&H&&($.textContent=Z),W}_applyMinimumContrast(L,M,R,O,F,U){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,p.treatGlyphAsBackgroundColor)(O.getCode()))return!1;const G=this._getContrastCache(O);let B;if(F||U||(B=G.getColor(M.rgba,R.rgba)),B===void 0){const K=this._optionsService.rawOptions.minimumContrastRatio/(O.isDim()?2:1);B=E.color.ensureContrastRatio(F||M,U||R,K),G.setColor((F||M).rgba,(U||R).rgba,B??null)}return!!B&&(this._addStyle(L,`color:${B.css}`),!0)}_getContrastCache(L){return L.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(L,M){L.setAttribute("style",`${L.getAttribute("style")||""}${M};`)}_isCellInSelection(L,M){const R=this._selectionStart,O=this._selectionEnd;return!(!R||!O)&&(this._columnSelectMode?R[0]<=O[0]?L>=R[0]&&M>=R[1]&&L<O[0]&&M<=O[1]:L<R[0]&&M>=R[1]&&L>=O[0]&&M<=O[1]:M>R[1]&&M<O[1]||R[1]===O[1]&&M===R[1]&&L>=R[0]&&L<O[0]||R[1]<O[1]&&M===O[1]&&L<O[0]||R[1]<O[1]&&M===R[1]&&L>=R[0])}};function A(L,M,R){for(;L.length<R;)L=M+L;return L}c.DomRendererRowFactory=T=h([S(1,g.ICharacterJoinerService),S(2,k.IOptionsService),S(3,g.ICoreBrowserService),S(4,k.ICoreService),S(5,k.IDecorationService),S(6,g.IThemeService)],T)},2550:(m,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 S=u.createElement("span");S.classList.add("xterm-char-measure-element");const f=u.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const C=u.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontStyle="italic";const x=u.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[S,f,C,x],this._container.appendChild(S),this._container.appendChild(f),this._container.appendChild(C),this._container.appendChild(x),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(u,h,S,f){u===this._font&&h===this._fontSize&&S===this._weight&&f===this._weightBold||(this._font=u,this._fontSize=h,this._weight=S,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${S}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${S}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(u,h,S){let f=0;if(!h&&!S&&u.length===1&&(f=u.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const k=this._measure(u,0);return k>0&&(this._flat[f]=k),k}let C=u;h&&(C+="B"),S&&(C+="I");let x=this._holey.get(C);if(x===void 0){let k=0;h&&(k|=1),S&&(k|=2),x=this._measure(u,k),x>0&&this._holey.set(C,x)}return x}_measure(u,h){const S=this._measureElements[h];return S.textContent=u.repeat(32),S.offsetWidth/32}}},2223:(m,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:(m,c)=>{function u(S){return 57508<=S&&S<=57558}function h(S){return S>=128512&&S<=128591||S>=127744&&S<=128511||S>=128640&&S<=128767||S>=9728&&S<=9983||S>=9984&&S<=10175||S>=65024&&S<=65039||S>=129280&&S<=129535||S>=127462&&S<=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(S){if(!S)throw new Error("value must not be falsy");return S},c.isPowerlineGlyph=u,c.isRestrictedPowerlineGlyph=function(S){return 57520<=S&&S<=57527},c.isEmoji=h,c.allowRescaling=function(S,f,C,x){return f===1&&C>Math.ceil(1.5*x)&&S!==void 0&&S>255&&!h(S)&&!u(S)&&!(function(k){return 57344<=k&&k<=63743})(S)},c.treatGlyphAsBackgroundColor=function(S){return u(S)||(function(f){return 9472<=f&&f<=9631})(S)},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(S,f,C=0){return(S-(2*Math.round(f)-C))%(2*Math.round(f))}},6052:(m,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(S,f,C,x=!1){if(this.selectionStart=f,this.selectionEnd=C,!f||!C||f[0]===C[0]&&f[1]===C[1])return void this.clear();const k=S.buffers.active.ydisp,E=f[1]-k,g=C[1]-k,b=Math.max(E,0),p=Math.min(g,S.rows-1);b>=S.rows||p<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=E,this.viewportEndRow=g,this.viewportCappedStartRow=b,this.viewportCappedEndRow=p,this.startCol=f[0],this.endCol=C[0])}isCellSelected(S,f,C){return!!this.hasSelection&&(C-=S.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:(m,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(m,c,u){var h=this&&this.__decorate||function(p,y,T,A){var L,M=arguments.length,R=M<3?y:A===null?A=Object.getOwnPropertyDescriptor(y,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,y,T,A);else for(var O=p.length-1;O>=0;O--)(L=p[O])&&(R=(M<3?L(R):M>3?L(y,T,R):L(y,T))||R);return M>3&&R&&Object.defineProperty(y,T,R),R},S=this&&this.__param||function(p,y){return function(T,A){y(T,A,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const f=u(2585),C=u(8460),x=u(844);let k=c.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(p,y,T){super(),this._optionsService=T,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 g(p,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const p=this._measureStrategy.measure();p.width===this.width&&p.height===this.height||(this.width=p.width,this.height=p.height,this._onCharSizeChange.fire())}};c.CharSizeService=k=h([S(2,f.IOptionsService)],k);class E extends x.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,T){y!==void 0&&y>0&&T!==void 0&&T>0&&(this._result.width=y,this._result.height=T)}}class g extends E{constructor(y,T,A){super(),this._document=y,this._parentElement=T,this._optionsService=A,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 E{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const T=this._ctx.measureText("W");if(!("width"in T&&"fontBoundingBoxAscent"in T&&"fontBoundingBoxDescent"in T))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(m,c,u){var h=this&&this.__decorate||function(b,p,y,T){var A,L=arguments.length,M=L<3?p:T===null?T=Object.getOwnPropertyDescriptor(p,y):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(b,p,y,T);else for(var R=b.length-1;R>=0;R--)(A=b[R])&&(M=(L<3?A(M):L>3?A(p,y,M):A(p,y))||M);return L>3&&M&&Object.defineProperty(p,y,M),M},S=this&&this.__param||function(b,p){return function(y,T){p(y,T,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const f=u(3734),C=u(643),x=u(511),k=u(2585);class E extends f.AttributeData{constructor(p,y,T){super(),this.content=0,this.combinedData="",this.fg=p.fg,this.bg=p.bg,this.combinedData=y,this._width=T}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(p){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.JoinedCellData=E;let g=c.CharacterJoinerService=class Zw{constructor(p){this._bufferService=p,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(p){const y={id:this._nextCharacterJoinerId++,handler:p};return this._characterJoiners.push(y),y.id}deregister(p){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===p)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(p){if(this._characterJoiners.length===0)return[];const y=this._bufferService.buffer.lines.get(p);if(!y||y.length===0)return[];const T=[],A=y.translateToString(!0);let L=0,M=0,R=0,O=y.getFg(0),F=y.getBg(0);for(let U=0;U<y.getTrimmedLength();U++)if(y.loadCell(U,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==O||this._workCell.bg!==F){if(U-L>1){const G=this._getJoinedRanges(A,R,M,y,L);for(let B=0;B<G.length;B++)T.push(G[B])}L=U,R=M,O=this._workCell.fg,F=this._workCell.bg}M+=this._workCell.getChars().length||C.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-L>1){const U=this._getJoinedRanges(A,R,M,y,L);for(let G=0;G<U.length;G++)T.push(U[G])}return T}_getJoinedRanges(p,y,T,A,L){const M=p.substring(y,T);let R=[];try{R=this._characterJoiners[0].handler(M)}catch(O){console.error(O)}for(let O=1;O<this._characterJoiners.length;O++)try{const F=this._characterJoiners[O].handler(M);for(let U=0;U<F.length;U++)Zw._mergeRanges(R,F[U])}catch(F){console.error(F)}return this._stringRangesToCellRanges(R,A,L),R}_stringRangesToCellRanges(p,y,T){let A=0,L=!1,M=0,R=p[A];if(R){for(let O=T;O<this._bufferService.cols;O++){const F=y.getWidth(O),U=y.getString(O).length||C.WHITESPACE_CELL_CHAR.length;if(F!==0){if(!L&&R[0]<=M&&(R[0]=O,L=!0),R[1]<=M){if(R[1]=O,R=p[++A],!R)break;R[0]<=M?(R[0]=O,L=!0):L=!1}M+=U}}R&&(R[1]=this._bufferService.cols)}}static _mergeRanges(p,y){let T=!1;for(let A=0;A<p.length;A++){const L=p[A];if(T){if(y[1]<=L[0])return p[A-1][1]=y[1],p;if(y[1]<=L[1])return p[A-1][1]=Math.max(y[1],L[1]),p.splice(A,1),p;p.splice(A,1),A--}else{if(y[1]<=L[0])return p.splice(A,0,y),p;if(y[1]<=L[1])return L[0]=Math.min(y[0],L[0]),p;y[0]<L[1]&&(L[0]=Math.min(y[0],L[0]),T=!0)}}return T?p[p.length-1][1]=y[1]:p.push(y),p}};c.CharacterJoinerService=g=h([S(0,k.IBufferService)],g)},5114:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const h=u(844),S=u(8460),f=u(3656);class C extends h.Disposable{constructor(E,g,b){super(),this._textarea=E,this._window=g,this.mainDocument=b,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(this._window),this._onDprChange=this.register(new S.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new S.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((p=>this._screenDprMonitor.setWindow(p)))),this.register((0,S.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(E){this._window!==E&&(this._window=E,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}c.CoreBrowserService=C;class x extends h.Disposable{constructor(E){super(),this._parentWindow=E,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new S.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(E){this._parentWindow=E,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:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.LinkProviderService=void 0;const h=u(844);class S extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(C){return this.linkProviders.push(C),{dispose:()=>{const x=this.linkProviders.indexOf(C);x!==-1&&this.linkProviders.splice(x,1)}}}}c.LinkProviderService=S},8934:function(m,c,u){var h=this&&this.__decorate||function(k,E,g,b){var p,y=arguments.length,T=y<3?E:b===null?b=Object.getOwnPropertyDescriptor(E,g):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(k,E,g,b);else for(var A=k.length-1;A>=0;A--)(p=k[A])&&(T=(y<3?p(T):y>3?p(E,g,T):p(E,g))||T);return y>3&&T&&Object.defineProperty(E,g,T),T},S=this&&this.__param||function(k,E){return function(g,b){E(g,b,k)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const f=u(4725),C=u(9806);let x=c.MouseService=class{constructor(k,E){this._renderService=k,this._charSizeService=E}getCoords(k,E,g,b,p){return(0,C.getCoords)(window,k,E,g,b,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,p)}getMouseReportCoords(k,E){const g=(0,C.getCoordsRelativeToElement)(window,k,E);if(this._charSizeService.hasValidSize)return g[0]=Math.min(Math.max(g[0],0),this._renderService.dimensions.css.canvas.width-1),g[1]=Math.min(Math.max(g[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(g[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(g[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(g[0]),y:Math.floor(g[1])}}};c.MouseService=x=h([S(0,f.IRenderService),S(1,f.ICharSizeService)],x)},3230:function(m,c,u){var h=this&&this.__decorate||function(p,y,T,A){var L,M=arguments.length,R=M<3?y:A===null?A=Object.getOwnPropertyDescriptor(y,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,y,T,A);else for(var O=p.length-1;O>=0;O--)(L=p[O])&&(R=(M<3?L(R):M>3?L(y,T,R):L(y,T))||R);return M>3&&R&&Object.defineProperty(y,T,R),R},S=this&&this.__param||function(p,y){return function(T,A){y(T,A,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const f=u(6193),C=u(4725),x=u(8460),k=u(844),E=u(7226),g=u(2585);let b=c.RenderService=class extends k.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(p,y,T,A,L,M,R,O){super(),this._rowCount=p,this._charSizeService=A,this._renderer=this.register(new k.MutableDisposable),this._pausedResizeTask=new E.DebouncedIdleTask,this._observerDisposable=this.register(new k.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((F,U)=>this._renderRows(F,U)),R),this.register(this._renderDebouncer),this.register(R.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(T.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(L.onDecorationRegistered((()=>this._fullRefresh()))),this.register(L.onDecorationRemoved((()=>this._fullRefresh()))),this.register(T.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(T.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(O.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(R.window,y),this.register(R.onWindowChange((F=>this._registerIntersectionObserver(F,y))))}_registerIntersectionObserver(p,y){if("IntersectionObserver"in p){const T=new p.IntersectionObserver((A=>this._handleIntersectionChange(A[A.length-1])),{threshold:0});T.observe(y),this._observerDisposable.value=(0,k.toDisposable)((()=>T.disconnect()))}}_handleIntersectionChange(p){this._isPaused=p.isIntersecting===void 0?p.intersectionRatio===0:!p.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(p,y,T=!1){this._isPaused?this._needsFullRefresh=!0:(T||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(p,y,this._rowCount))}_renderRows(p,y){this._renderer.value&&(p=Math.min(p,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(p,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:p,end:y}),this._onRender.fire({start:p,end:y}),this._isNextRenderRedrawOnly=!0)}resize(p,y){this._rowCount=y,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(p){this._renderer.value=p,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(p){return this._renderDebouncer.addRefreshCallback(p)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(p,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(p,y))):this._renderer.value.handleResize(p,y),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(p,y,T){this._selectionState.start=p,this._selectionState.end=y,this._selectionState.columnSelectMode=T,this._renderer.value?.handleSelectionChanged(p,y,T)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};c.RenderService=b=h([S(2,g.IOptionsService),S(3,C.ICharSizeService),S(4,g.IDecorationService),S(5,g.IBufferService),S(6,C.ICoreBrowserService),S(7,C.IThemeService)],b)},9312:function(m,c,u){var h=this&&this.__decorate||function(R,O,F,U){var G,B=arguments.length,K=B<3?O:U===null?U=Object.getOwnPropertyDescriptor(O,F):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(R,O,F,U);else for(var te=R.length-1;te>=0;te--)(G=R[te])&&(K=(B<3?G(K):B>3?G(O,F,K):G(O,F))||K);return B>3&&K&&Object.defineProperty(O,F,K),K},S=this&&this.__param||function(R,O){return function(F,U){O(F,U,R)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const f=u(9806),C=u(9504),x=u(456),k=u(4725),E=u(8460),g=u(844),b=u(6114),p=u(4841),y=u(511),T=u(2585),A=" ",L=new RegExp(A,"g");let M=c.SelectionService=class extends g.Disposable{constructor(R,O,F,U,G,B,K,te,q){super(),this._element=R,this._screenElement=O,this._linkifier=F,this._bufferService=U,this._coreService=G,this._mouseService=B,this._optionsService=K,this._renderService=te,this._coreBrowserService=q,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new E.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new E.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new E.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new E.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=W=>this._handleMouseMove(W),this._mouseUpListener=W=>this._handleMouseUp(W),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((W=>this._handleTrim(W))),this.register(this._bufferService.buffers.onBufferActivate((W=>this._handleBufferActivate(W)))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,g.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 R=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!(!R||!O||R[0]===O[0]&&R[1]===O[1])}get selectionText(){const R=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;if(!R||!O)return"";const F=this._bufferService.buffer,U=[];if(this._activeSelectionMode===3){if(R[0]===O[0])return"";const G=R[0]<O[0]?R[0]:O[0],B=R[0]<O[0]?O[0]:R[0];for(let K=R[1];K<=O[1];K++){const te=F.translateBufferLineToString(K,!0,G,B);U.push(te)}}else{const G=R[1]===O[1]?O[0]:void 0;U.push(F.translateBufferLineToString(R[1],!0,R[0],G));for(let B=R[1]+1;B<=O[1]-1;B++){const K=F.lines.get(B),te=F.translateBufferLineToString(B,!0);K?.isWrapped?U[U.length-1]+=te:U.push(te)}if(R[1]!==O[1]){const B=F.lines.get(O[1]),K=F.translateBufferLineToString(O[1],!0,0,O[0]);B&&B.isWrapped?U[U.length-1]+=K:U.push(K)}}return U.map((G=>G.replace(L," "))).join(b.isWindows?`\r
80
- `:`
81
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(R){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.isLinux&&R&&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(R){const O=this._getMouseBufferCoords(R),F=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!!(F&&U&&O)&&this._areCoordsInSelection(O,F,U)}isCellInSelection(R,O){const F=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!(!F||!U)&&this._areCoordsInSelection([R,O],F,U)}_areCoordsInSelection(R,O,F){return R[1]>O[1]&&R[1]<F[1]||O[1]===F[1]&&R[1]===O[1]&&R[0]>=O[0]&&R[0]<F[0]||O[1]<F[1]&&R[1]===F[1]&&R[0]<F[0]||O[1]<F[1]&&R[1]===O[1]&&R[0]>=O[0]}_selectWordAtCursor(R,O){const F=this._linkifier.currentLink?.link?.range;if(F)return this._model.selectionStart=[F.start.x-1,F.start.y-1],this._model.selectionStartLength=(0,p.getRangeLength)(F,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const U=this._getMouseBufferCoords(R);return!!U&&(this._selectWordAt(U,O),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(R,O){this._model.clearSelection(),R=Math.max(R,0),O=Math.min(O,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,R],this._model.selectionEnd=[this._bufferService.cols,O],this.refresh(),this._onSelectionChange.fire()}_handleTrim(R){this._model.handleTrim(R)&&this.refresh()}_getMouseBufferCoords(R){const O=this._mouseService.getCoords(R,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(O)return O[0]--,O[1]--,O[1]+=this._bufferService.buffer.ydisp,O}_getMouseEventScrollAmount(R){let O=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,R,this._screenElement)[1];const F=this._renderService.dimensions.css.canvas.height;return O>=0&&O<=F?0:(O>F&&(O-=F),O=Math.min(Math.max(O,-50),50),O/=50,O/Math.abs(O)+Math.round(14*O))}shouldForceSelection(R){return b.isMac?R.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:R.shiftKey}handleMouseDown(R){if(this._mouseDownTimeStamp=R.timeStamp,(R.button!==2||!this.hasSelection)&&R.button===0){if(!this._enabled){if(!this.shouldForceSelection(R))return;R.stopPropagation()}R.preventDefault(),this._dragScrollAmount=0,this._enabled&&R.shiftKey?this._handleIncrementalClick(R):R.detail===1?this._handleSingleClick(R):R.detail===2?this._handleDoubleClick(R):R.detail===3&&this._handleTripleClick(R),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(R){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(R))}_handleSingleClick(R){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(R)?3:0,this._model.selectionStart=this._getMouseBufferCoords(R),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const O=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);O&&O.length!==this._model.selectionStart[0]&&O.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(R){this._selectWordAtCursor(R,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(R){const O=this._getMouseBufferCoords(R);O&&(this._activeSelectionMode=2,this._selectLineAt(O[1]))}shouldColumnSelect(R){return R.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(R){if(R.stopImmediatePropagation(),!this._model.selectionStart)return;const O=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(R),!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(R),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const F=this._bufferService.buffer;if(this._model.selectionEnd[1]<F.lines.length){const U=F.lines.get(this._model.selectionEnd[1]);U&&U.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}O&&O[0]===this._model.selectionEnd[0]&&O[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 R=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(R.ydisp+this._bufferService.rows,R.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=R.ydisp),this.refresh()}}_handleMouseUp(R){const O=R.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&O<500&&R.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const F=this._mouseService.getCoords(R,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(F&&F[0]!==void 0&&F[1]!==void 0){const U=(0,C.moveToCellSequence)(F[0]-1,F[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(U,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const R=this._model.finalSelectionStart,O=this._model.finalSelectionEnd,F=!(!R||!O||R[0]===O[0]&&R[1]===O[1]);F?R&&O&&(this._oldSelectionStart&&this._oldSelectionEnd&&R[0]===this._oldSelectionStart[0]&&R[1]===this._oldSelectionStart[1]&&O[0]===this._oldSelectionEnd[0]&&O[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(R,O,F)):this._oldHasSelection&&this._fireOnSelectionChange(R,O,F)}_fireOnSelectionChange(R,O,F){this._oldSelectionStart=R,this._oldSelectionEnd=O,this._oldHasSelection=F,this._onSelectionChange.fire()}_handleBufferActivate(R){this.clearSelection(),this._trimListener.dispose(),this._trimListener=R.activeBuffer.lines.onTrim((O=>this._handleTrim(O)))}_convertViewportColToCharacterIndex(R,O){let F=O;for(let U=0;O>=U;U++){const G=R.loadCell(U,this._workCell).getChars().length;this._workCell.getWidth()===0?F--:G>1&&O!==U&&(F+=G-1)}return F}setSelection(R,O,F){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[R,O],this._model.selectionStartLength=F,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(R){this._isClickInSelection(R)||(this._selectWordAtCursor(R,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(R,O,F=!0,U=!0){if(R[0]>=this._bufferService.cols)return;const G=this._bufferService.buffer,B=G.lines.get(R[1]);if(!B)return;const K=G.translateBufferLineToString(R[1],!1);let te=this._convertViewportColToCharacterIndex(B,R[0]),q=te;const W=R[0]-te;let Y=0,I=0,$=0,N=0;if(K.charAt(te)===" "){for(;te>0&&K.charAt(te-1)===" ";)te--;for(;q<K.length&&K.charAt(q+1)===" ";)q++}else{let ae=R[0],ce=R[0];B.getWidth(ae)===0&&(Y++,ae--),B.getWidth(ce)===2&&(I++,ce++);const _e=B.getString(ce).length;for(_e>1&&(N+=_e-1,q+=_e-1);ae>0&&te>0&&!this._isCharWordSeparator(B.loadCell(ae-1,this._workCell));){B.loadCell(ae-1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===0?(Y++,ae--):Q>1&&($+=Q-1,te-=Q-1),te--,ae--}for(;ce<B.length&&q+1<K.length&&!this._isCharWordSeparator(B.loadCell(ce+1,this._workCell));){B.loadCell(ce+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(I++,ce++):Q>1&&(N+=Q-1,q+=Q-1),q++,ce++}}q++;let H=te+W-Y+$,Z=Math.min(this._bufferService.cols,q-te+Y+I-$-N);if(O||K.slice(te,q).trim()!==""){if(F&&H===0&&B.getCodePoint(0)!==32){const ae=G.lines.get(R[1]-1);if(ae&&B.isWrapped&&ae.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,R[1]-1],!1,!0,!1);if(ce){const _e=this._bufferService.cols-ce.start;H-=_e,Z+=_e}}}if(U&&H+Z===this._bufferService.cols&&B.getCodePoint(this._bufferService.cols-1)!==32){const ae=G.lines.get(R[1]+1);if(ae?.isWrapped&&ae.getCodePoint(0)!==32){const ce=this._getWordAt([0,R[1]+1],!1,!1,!0);ce&&(Z+=ce.length)}}return{start:H,length:Z}}}_selectWordAt(R,O){const F=this._getWordAt(R,O);if(F){for(;F.start<0;)F.start+=this._bufferService.cols,R[1]--;this._model.selectionStart=[F.start,R[1]],this._model.selectionStartLength=F.length}}_selectToWordAt(R){const O=this._getWordAt(R,!0);if(O){let F=R[1];for(;O.start<0;)O.start+=this._bufferService.cols,F--;if(!this._model.areSelectionValuesReversed())for(;O.start+O.length>this._bufferService.cols;)O.length-=this._bufferService.cols,F++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?O.start:O.start+O.length,F]}}_isCharWordSeparator(R){return R.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(R.getChars())>=0}_selectLineAt(R){const O=this._bufferService.buffer.getWrappedRangeForLine(R),F={start:{x:0,y:O.first},end:{x:this._bufferService.cols-1,y:O.last}};this._model.selectionStart=[0,O.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,p.getRangeLength)(F,this._bufferService.cols)}};c.SelectionService=M=h([S(3,T.IBufferService),S(4,T.ICoreService),S(5,k.IMouseService),S(6,T.IOptionsService),S(7,k.IRenderService),S(8,k.ICoreBrowserService)],M)},4725:(m,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(m,c,u){var h=this&&this.__decorate||function(M,R,O,F){var U,G=arguments.length,B=G<3?R:F===null?F=Object.getOwnPropertyDescriptor(R,O):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(M,R,O,F);else for(var K=M.length-1;K>=0;K--)(U=M[K])&&(B=(G<3?U(B):G>3?U(R,O,B):U(R,O))||B);return G>3&&B&&Object.defineProperty(R,O,B),B},S=this&&this.__param||function(M,R){return function(O,F){R(O,F,M)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const f=u(7239),C=u(8055),x=u(8460),k=u(844),E=u(2585),g=C.css.toColor("#ffffff"),b=C.css.toColor("#000000"),p=C.css.toColor("#ffffff"),y=C.css.toColor("#000000"),T={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};c.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[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")],R=[0,95,135,175,215,255];for(let O=0;O<216;O++){const F=R[O/36%6|0],U=R[O/6%6|0],G=R[O%6];M.push({css:C.channels.toCss(F,U,G),rgba:C.channels.toRgba(F,U,G)})}for(let O=0;O<24;O++){const F=8+10*O;M.push({css:C.channels.toCss(F,F,F),rgba:C.channels.toRgba(F,F,F)})}return M})());let A=c.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:g,background:b,cursor:p,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:T,selectionBackgroundOpaque:C.color.blend(b,T),selectionInactiveBackgroundTransparent:T,selectionInactiveBackgroundOpaque:C.color.blend(b,T),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(M={}){const R=this._colors;if(R.foreground=L(M.foreground,g),R.background=L(M.background,b),R.cursor=L(M.cursor,p),R.cursorAccent=L(M.cursorAccent,y),R.selectionBackgroundTransparent=L(M.selectionBackground,T),R.selectionBackgroundOpaque=C.color.blend(R.background,R.selectionBackgroundTransparent),R.selectionInactiveBackgroundTransparent=L(M.selectionInactiveBackground,R.selectionBackgroundTransparent),R.selectionInactiveBackgroundOpaque=C.color.blend(R.background,R.selectionInactiveBackgroundTransparent),R.selectionForeground=M.selectionForeground?L(M.selectionForeground,C.NULL_COLOR):void 0,R.selectionForeground===C.NULL_COLOR&&(R.selectionForeground=void 0),C.color.isOpaque(R.selectionBackgroundTransparent)&&(R.selectionBackgroundTransparent=C.color.opacity(R.selectionBackgroundTransparent,.3)),C.color.isOpaque(R.selectionInactiveBackgroundTransparent)&&(R.selectionInactiveBackgroundTransparent=C.color.opacity(R.selectionInactiveBackgroundTransparent,.3)),R.ansi=c.DEFAULT_ANSI_COLORS.slice(),R.ansi[0]=L(M.black,c.DEFAULT_ANSI_COLORS[0]),R.ansi[1]=L(M.red,c.DEFAULT_ANSI_COLORS[1]),R.ansi[2]=L(M.green,c.DEFAULT_ANSI_COLORS[2]),R.ansi[3]=L(M.yellow,c.DEFAULT_ANSI_COLORS[3]),R.ansi[4]=L(M.blue,c.DEFAULT_ANSI_COLORS[4]),R.ansi[5]=L(M.magenta,c.DEFAULT_ANSI_COLORS[5]),R.ansi[6]=L(M.cyan,c.DEFAULT_ANSI_COLORS[6]),R.ansi[7]=L(M.white,c.DEFAULT_ANSI_COLORS[7]),R.ansi[8]=L(M.brightBlack,c.DEFAULT_ANSI_COLORS[8]),R.ansi[9]=L(M.brightRed,c.DEFAULT_ANSI_COLORS[9]),R.ansi[10]=L(M.brightGreen,c.DEFAULT_ANSI_COLORS[10]),R.ansi[11]=L(M.brightYellow,c.DEFAULT_ANSI_COLORS[11]),R.ansi[12]=L(M.brightBlue,c.DEFAULT_ANSI_COLORS[12]),R.ansi[13]=L(M.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),R.ansi[14]=L(M.brightCyan,c.DEFAULT_ANSI_COLORS[14]),R.ansi[15]=L(M.brightWhite,c.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const O=Math.min(R.ansi.length-16,M.extendedAnsi.length);for(let F=0;F<O;F++)R.ansi[F+16]=L(M.extendedAnsi[F],c.DEFAULT_ANSI_COLORS[F+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(M){this._restoreColor(M),this._onChangeColors.fire(this.colors)}_restoreColor(M){if(M!==void 0)switch(M){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[M]=this._restoreColors.ansi[M]}else for(let R=0;R<this._restoreColors.ansi.length;++R)this._colors.ansi[R]=this._restoreColors.ansi[R]}modifyColors(M){M(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function L(M,R){if(M!==void 0)try{return C.css.toColor(M)}catch{}return R}c.ThemeService=A=h([S(0,E.IOptionsService)],A)},6349:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const h=u(8460),S=u(844);class f extends S.Disposable{constructor(x){super(),this._maxLength=x,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(x){if(this._maxLength===x)return;const k=new Array(x);for(let E=0;E<Math.min(x,this.length);E++)k[E]=this._array[this._getCyclicIndex(E)];this._array=k,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let k=this._length;k<x;k++)this._array[k]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,k){this._array[this._getCyclicIndex(x)]=k}push(x){this._array[this._getCyclicIndex(this._length)]=x,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(x,k,...E){if(k){for(let g=x;g<this._length-k;g++)this._array[this._getCyclicIndex(g)]=this._array[this._getCyclicIndex(g+k)];this._length-=k,this.onDeleteEmitter.fire({index:x,amount:k})}for(let g=this._length-1;g>=x;g--)this._array[this._getCyclicIndex(g+E.length)]=this._array[this._getCyclicIndex(g)];for(let g=0;g<E.length;g++)this._array[this._getCyclicIndex(x+g)]=E[g];if(E.length&&this.onInsertEmitter.fire({index:x,amount:E.length}),this._length+E.length>this._maxLength){const g=this._length+E.length-this._maxLength;this._startIndex+=g,this._length=this._maxLength,this.onTrimEmitter.fire(g)}else this._length+=E.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,k,E){if(!(k<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+E<0)throw new Error("Cannot shift elements in list beyond index 0");if(E>0){for(let b=k-1;b>=0;b--)this.set(x+b+E,this.get(x+b));const g=x+k+E-this._length;if(g>0)for(this._length+=g;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let g=0;g<k;g++)this.set(x+g+E,this.get(x+g))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}c.CircularList=f},1439:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.clone=void 0,c.clone=function u(h,S=5){if(typeof h!="object")return h;const f=Array.isArray(h)?[]:{};for(const C in h)f[C]=S<=1?h[C]:h[C]&&u(h[C],S-1);return f}},8055:(m,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,S=0,f=0;var C,x,k,E,g;function b(y){const T=y.toString(16);return T.length<2?"0"+T:T}function p(y,T){return y<T?(T+.05)/(y+.05):(y+.05)/(T+.05)}c.NULL_COLOR={css:"#00000000",rgba:0},(function(y){y.toCss=function(T,A,L,M){return M!==void 0?`#${b(T)}${b(A)}${b(L)}${b(M)}`:`#${b(T)}${b(A)}${b(L)}`},y.toRgba=function(T,A,L,M=255){return(T<<24|A<<16|L<<8|M)>>>0},y.toColor=function(T,A,L,M){return{css:y.toCss(T,A,L,M),rgba:y.toRgba(T,A,L,M)}}})(C||(c.channels=C={})),(function(y){function T(A,L){return f=Math.round(255*L),[u,h,S]=g.toChannels(A.rgba),{css:C.toCss(u,h,S,f),rgba:C.toRgba(u,h,S,f)}}y.blend=function(A,L){if(f=(255&L.rgba)/255,f===1)return{css:L.css,rgba:L.rgba};const M=L.rgba>>24&255,R=L.rgba>>16&255,O=L.rgba>>8&255,F=A.rgba>>24&255,U=A.rgba>>16&255,G=A.rgba>>8&255;return u=F+Math.round((M-F)*f),h=U+Math.round((R-U)*f),S=G+Math.round((O-G)*f),{css:C.toCss(u,h,S),rgba:C.toRgba(u,h,S)}},y.isOpaque=function(A){return(255&A.rgba)==255},y.ensureContrastRatio=function(A,L,M){const R=g.ensureContrastRatio(A.rgba,L.rgba,M);if(R)return C.toColor(R>>24&255,R>>16&255,R>>8&255)},y.opaque=function(A){const L=(255|A.rgba)>>>0;return[u,h,S]=g.toChannels(L),{css:C.toCss(u,h,S),rgba:L}},y.opacity=T,y.multiplyOpacity=function(A,L){return f=255&A.rgba,T(A,f*L/255)},y.toColorRGB=function(A){return[A.rgba>>24&255,A.rgba>>16&255,A.rgba>>8&255]}})(x||(c.color=x={})),(function(y){let T,A;try{const L=document.createElement("canvas");L.width=1,L.height=1;const M=L.getContext("2d",{willReadFrequently:!0});M&&(T=M,T.globalCompositeOperation="copy",A=T.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(L){if(L.match(/#[\da-f]{3,8}/i))switch(L.length){case 4:return u=parseInt(L.slice(1,2).repeat(2),16),h=parseInt(L.slice(2,3).repeat(2),16),S=parseInt(L.slice(3,4).repeat(2),16),C.toColor(u,h,S);case 5:return u=parseInt(L.slice(1,2).repeat(2),16),h=parseInt(L.slice(2,3).repeat(2),16),S=parseInt(L.slice(3,4).repeat(2),16),f=parseInt(L.slice(4,5).repeat(2),16),C.toColor(u,h,S,f);case 7:return{css:L,rgba:(parseInt(L.slice(1),16)<<8|255)>>>0};case 9:return{css:L,rgba:parseInt(L.slice(1),16)>>>0}}const M=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(M)return u=parseInt(M[1]),h=parseInt(M[2]),S=parseInt(M[3]),f=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),C.toColor(u,h,S,f);if(!T||!A)throw new Error("css.toColor: Unsupported css format");if(T.fillStyle=A,T.fillStyle=L,typeof T.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(T.fillRect(0,0,1,1),[u,h,S,f]=T.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:C.toRgba(u,h,S,f),css:L}}})(k||(c.css=k={})),(function(y){function T(A,L,M){const R=A/255,O=L/255,F=M/255;return .2126*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.7152*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))+.0722*(F<=.03928?F/12.92:Math.pow((F+.055)/1.055,2.4))}y.relativeLuminance=function(A){return T(A>>16&255,A>>8&255,255&A)},y.relativeLuminance2=T})(E||(c.rgb=E={})),(function(y){function T(L,M,R){const O=L>>24&255,F=L>>16&255,U=L>>8&255;let G=M>>24&255,B=M>>16&255,K=M>>8&255,te=p(E.relativeLuminance2(G,B,K),E.relativeLuminance2(O,F,U));for(;te<R&&(G>0||B>0||K>0);)G-=Math.max(0,Math.ceil(.1*G)),B-=Math.max(0,Math.ceil(.1*B)),K-=Math.max(0,Math.ceil(.1*K)),te=p(E.relativeLuminance2(G,B,K),E.relativeLuminance2(O,F,U));return(G<<24|B<<16|K<<8|255)>>>0}function A(L,M,R){const O=L>>24&255,F=L>>16&255,U=L>>8&255;let G=M>>24&255,B=M>>16&255,K=M>>8&255,te=p(E.relativeLuminance2(G,B,K),E.relativeLuminance2(O,F,U));for(;te<R&&(G<255||B<255||K<255);)G=Math.min(255,G+Math.ceil(.1*(255-G))),B=Math.min(255,B+Math.ceil(.1*(255-B))),K=Math.min(255,K+Math.ceil(.1*(255-K))),te=p(E.relativeLuminance2(G,B,K),E.relativeLuminance2(O,F,U));return(G<<24|B<<16|K<<8|255)>>>0}y.blend=function(L,M){if(f=(255&M)/255,f===1)return M;const R=M>>24&255,O=M>>16&255,F=M>>8&255,U=L>>24&255,G=L>>16&255,B=L>>8&255;return u=U+Math.round((R-U)*f),h=G+Math.round((O-G)*f),S=B+Math.round((F-B)*f),C.toRgba(u,h,S)},y.ensureContrastRatio=function(L,M,R){const O=E.relativeLuminance(L>>8),F=E.relativeLuminance(M>>8);if(p(O,F)<R){if(F<O){const B=T(L,M,R),K=p(O,E.relativeLuminance(B>>8));if(K<R){const te=A(L,M,R);return K>p(O,E.relativeLuminance(te>>8))?B:te}return B}const U=A(L,M,R),G=p(O,E.relativeLuminance(U>>8));if(G<R){const B=T(L,M,R);return G>p(O,E.relativeLuminance(B>>8))?U:B}return U}},y.reduceLuminance=T,y.increaseLuminance=A,y.toChannels=function(L){return[L>>24&255,L>>16&255,L>>8&255,255&L]}})(g||(c.rgba=g={})),c.toPaddedHex=b,c.contrastRatio=p},8969:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const h=u(844),S=u(2585),f=u(4348),C=u(7866),x=u(744),k=u(7302),E=u(6975),g=u(8460),b=u(1753),p=u(1480),y=u(7994),T=u(9282),A=u(5435),L=u(5981),M=u(2660);let R=!1;class O extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new g.EventEmitter),this._onScroll.event((U=>{this._onScrollApi?.fire(U.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(U){for(const G in U)this.optionsService.options[G]=U[G]}constructor(U){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new g.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new g.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new g.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new g.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new k.OptionsService(U)),this._instantiationService.setService(S.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(S.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(C.LogService)),this._instantiationService.setService(S.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(E.CoreService)),this._instantiationService.setService(S.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(S.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(p.UnicodeService)),this._instantiationService.setService(S.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(S.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(S.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new A.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,g.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,g.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,g.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,g.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((G=>{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((G=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new L.WriteBuffer(((G,B)=>this._inputHandler.parse(G,B)))),this.register((0,g.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(U,G){this._writeBuffer.write(U,G)}writeSync(U,G){this._logService.logLevel<=S.LogLevelEnum.WARN&&!R&&(this._logService.warn("writeSync is unreliable and will be removed soon."),R=!0),this._writeBuffer.writeSync(U,G)}input(U,G=!0){this.coreService.triggerDataEvent(U,G)}resize(U,G){isNaN(U)||isNaN(G)||(U=Math.max(U,x.MINIMUM_COLS),G=Math.max(G,x.MINIMUM_ROWS),this._bufferService.resize(U,G))}scroll(U,G=!1){this._bufferService.scroll(U,G)}scrollLines(U,G,B){this._bufferService.scrollLines(U,G,B)}scrollPages(U){this.scrollLines(U*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(U){const G=U-this._bufferService.buffer.ydisp;G!==0&&this.scrollLines(G)}registerEscHandler(U,G){return this._inputHandler.registerEscHandler(U,G)}registerDcsHandler(U,G){return this._inputHandler.registerDcsHandler(U,G)}registerCsiHandler(U,G){return this._inputHandler.registerCsiHandler(U,G)}registerOscHandler(U,G){return this._inputHandler.registerOscHandler(U,G)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let U=!1;const G=this.optionsService.rawOptions.windowsPty;G&&G.buildNumber!==void 0&&G.buildNumber!==void 0?U=G.backend==="conpty"&&G.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(U=!0),U?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const U=[];U.push(this.onLineFeed(T.updateWindowsModeWrappedState.bind(null,this._bufferService))),U.push(this.registerCsiHandler({final:"H"},(()=>((0,T.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const G of U)G.dispose()}))}}}c.CoreTerminal=O},8460:(m,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 S=[];for(let f=0;f<this._listeners.length;f++)S.push(this._listeners[f]);for(let f=0;f<S.length;f++)S[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((S=>h.fire(S)))},c.runAndSubscribe=function(u,h){return h(void 0),u((S=>h(S)))}},5435:function(m,c,u){var h=this&&this.__decorate||function(Y,I,$,N){var H,Z=arguments.length,ae=Z<3?I:N===null?N=Object.getOwnPropertyDescriptor(I,$):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ae=Reflect.decorate(Y,I,$,N);else for(var ce=Y.length-1;ce>=0;ce--)(H=Y[ce])&&(ae=(Z<3?H(ae):Z>3?H(I,$,ae):H(I,$))||ae);return Z>3&&ae&&Object.defineProperty(I,$,ae),ae},S=this&&this.__param||function(Y,I){return function($,N){I($,N,Y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const f=u(2584),C=u(7116),x=u(2015),k=u(844),E=u(482),g=u(8437),b=u(8460),p=u(643),y=u(511),T=u(3734),A=u(2585),L=u(1480),M=u(6242),R=u(6351),O=u(5941),F={"(":0,")":1,"*":2,"+":3,"-":1,".":2},U=131072;function G(Y,I){if(Y>24)return I.setWinLines||!1;switch(Y){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var B;(function(Y){Y[Y.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Y[Y.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(B||(c.WindowsOptionsReportType=B={}));let K=0;class te extends k.Disposable{getAttrData(){return this._curAttrData}constructor(I,$,N,H,Z,ae,ce,_e,Q=new x.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=$,this._coreService=N,this._logService=H,this._optionsService=Z,this._oscLinkService=ae,this._coreMouseService=ce,this._unicodeService=_e,this._parser=Q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new E.StringToUtf32,this._utf8Decoder=new E.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=g.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=g.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 q(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((P=>this._activeBuffer=P.activeBuffer))),this._parser.setCsiHandlerFallback(((P,oe)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(P),params:oe.toArray()})})),this._parser.setEscHandlerFallback((P=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(P)})})),this._parser.setExecuteHandlerFallback((P=>{this._logService.debug("Unknown EXECUTE code: ",{code:P})})),this._parser.setOscHandlerFallback(((P,oe,ge)=>{this._logService.debug("Unknown OSC code: ",{identifier:P,action:oe,data:ge})})),this._parser.setDcsHandlerFallback(((P,oe,ge)=>{oe==="HOOK"&&(ge=ge.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(P),action:oe,payload:ge})})),this._parser.setPrintHandler(((P,oe,ge)=>this.print(P,oe,ge))),this._parser.registerCsiHandler({final:"@"},(P=>this.insertChars(P))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(P=>this.scrollLeft(P))),this._parser.registerCsiHandler({final:"A"},(P=>this.cursorUp(P))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(P=>this.scrollRight(P))),this._parser.registerCsiHandler({final:"B"},(P=>this.cursorDown(P))),this._parser.registerCsiHandler({final:"C"},(P=>this.cursorForward(P))),this._parser.registerCsiHandler({final:"D"},(P=>this.cursorBackward(P))),this._parser.registerCsiHandler({final:"E"},(P=>this.cursorNextLine(P))),this._parser.registerCsiHandler({final:"F"},(P=>this.cursorPrecedingLine(P))),this._parser.registerCsiHandler({final:"G"},(P=>this.cursorCharAbsolute(P))),this._parser.registerCsiHandler({final:"H"},(P=>this.cursorPosition(P))),this._parser.registerCsiHandler({final:"I"},(P=>this.cursorForwardTab(P))),this._parser.registerCsiHandler({final:"J"},(P=>this.eraseInDisplay(P,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(P=>this.eraseInDisplay(P,!0))),this._parser.registerCsiHandler({final:"K"},(P=>this.eraseInLine(P,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(P=>this.eraseInLine(P,!0))),this._parser.registerCsiHandler({final:"L"},(P=>this.insertLines(P))),this._parser.registerCsiHandler({final:"M"},(P=>this.deleteLines(P))),this._parser.registerCsiHandler({final:"P"},(P=>this.deleteChars(P))),this._parser.registerCsiHandler({final:"S"},(P=>this.scrollUp(P))),this._parser.registerCsiHandler({final:"T"},(P=>this.scrollDown(P))),this._parser.registerCsiHandler({final:"X"},(P=>this.eraseChars(P))),this._parser.registerCsiHandler({final:"Z"},(P=>this.cursorBackwardTab(P))),this._parser.registerCsiHandler({final:"`"},(P=>this.charPosAbsolute(P))),this._parser.registerCsiHandler({final:"a"},(P=>this.hPositionRelative(P))),this._parser.registerCsiHandler({final:"b"},(P=>this.repeatPrecedingCharacter(P))),this._parser.registerCsiHandler({final:"c"},(P=>this.sendDeviceAttributesPrimary(P))),this._parser.registerCsiHandler({prefix:">",final:"c"},(P=>this.sendDeviceAttributesSecondary(P))),this._parser.registerCsiHandler({final:"d"},(P=>this.linePosAbsolute(P))),this._parser.registerCsiHandler({final:"e"},(P=>this.vPositionRelative(P))),this._parser.registerCsiHandler({final:"f"},(P=>this.hVPosition(P))),this._parser.registerCsiHandler({final:"g"},(P=>this.tabClear(P))),this._parser.registerCsiHandler({final:"h"},(P=>this.setMode(P))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(P=>this.setModePrivate(P))),this._parser.registerCsiHandler({final:"l"},(P=>this.resetMode(P))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(P=>this.resetModePrivate(P))),this._parser.registerCsiHandler({final:"m"},(P=>this.charAttributes(P))),this._parser.registerCsiHandler({final:"n"},(P=>this.deviceStatus(P))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(P=>this.deviceStatusPrivate(P))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(P=>this.softReset(P))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(P=>this.setCursorStyle(P))),this._parser.registerCsiHandler({final:"r"},(P=>this.setScrollRegion(P))),this._parser.registerCsiHandler({final:"s"},(P=>this.saveCursor(P))),this._parser.registerCsiHandler({final:"t"},(P=>this.windowOptions(P))),this._parser.registerCsiHandler({final:"u"},(P=>this.restoreCursor(P))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(P=>this.insertColumns(P))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(P=>this.deleteColumns(P))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(P=>this.selectProtected(P))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(P=>this.requestMode(P,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(P=>this.requestMode(P,!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 M.OscHandler((P=>(this.setTitle(P),this.setIconName(P),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((P=>this.setIconName(P)))),this._parser.registerOscHandler(2,new M.OscHandler((P=>this.setTitle(P)))),this._parser.registerOscHandler(4,new M.OscHandler((P=>this.setOrReportIndexedColor(P)))),this._parser.registerOscHandler(8,new M.OscHandler((P=>this.setHyperlink(P)))),this._parser.registerOscHandler(10,new M.OscHandler((P=>this.setOrReportFgColor(P)))),this._parser.registerOscHandler(11,new M.OscHandler((P=>this.setOrReportBgColor(P)))),this._parser.registerOscHandler(12,new M.OscHandler((P=>this.setOrReportCursorColor(P)))),this._parser.registerOscHandler(104,new M.OscHandler((P=>this.restoreIndexedColor(P)))),this._parser.registerOscHandler(110,new M.OscHandler((P=>this.restoreFgColor(P)))),this._parser.registerOscHandler(111,new M.OscHandler((P=>this.restoreBgColor(P)))),this._parser.registerOscHandler(112,new M.OscHandler((P=>this.restoreCursorColor(P)))),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 P in C.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:P},(()=>this.selectCharset("("+P))),this._parser.registerEscHandler({intermediates:")",final:P},(()=>this.selectCharset(")"+P))),this._parser.registerEscHandler({intermediates:"*",final:P},(()=>this.selectCharset("*"+P))),this._parser.registerEscHandler({intermediates:"+",final:P},(()=>this.selectCharset("+"+P))),this._parser.registerEscHandler({intermediates:"-",final:P},(()=>this.selectCharset("-"+P))),this._parser.registerEscHandler({intermediates:".",final:P},(()=>this.selectCharset("."+P))),this._parser.registerEscHandler({intermediates:"/",final:P},(()=>this.selectCharset("/"+P)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((P=>(this._logService.error("Parsing error: ",P),P))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new R.DcsHandler(((P,oe)=>this.requestStatusString(P,oe))))}_preserveStack(I,$,N,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=$,this._parseStack.decodedLength=N,this._parseStack.position=H}_logSlowResolvingAsync(I){this._logService.logLevel<=A.LogLevelEnum.WARN&&Promise.race([I,new Promise((($,N)=>setTimeout((()=>N("#SLOW_TIMEOUT")),5e3)))]).catch(($=>{if($!=="#SLOW_TIMEOUT")throw $;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,$){let N,H=this._activeBuffer.x,Z=this._activeBuffer.y,ae=0;const ce=this._parseStack.paused;if(ce){if(N=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,$))return this._logSlowResolvingAsync(N),N;H=this._parseStack.cursorStartX,Z=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>U&&(ae=this._parseStack.position+U)}if(this._logService.logLevel<=A.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(P=>String.fromCharCode(P))).join("")}"`),typeof I=="string"?I.split("").map((P=>P.charCodeAt(0))):I),this._parseBuffer.length<I.length&&this._parseBuffer.length<U&&(this._parseBuffer=new Uint32Array(Math.min(I.length,U))),ce||this._dirtyRowTracker.clearRange(),I.length>U)for(let P=ae;P<I.length;P+=U){const oe=P+U<I.length?P+U:I.length,ge=typeof I=="string"?this._stringDecoder.decode(I.substring(P,oe),this._parseBuffer):this._utf8Decoder.decode(I.subarray(P,oe),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,ge))return this._preserveStack(H,Z,ge,P),this._logSlowResolvingAsync(N),N}else if(!ce){const P=typeof I=="string"?this._stringDecoder.decode(I,this._parseBuffer):this._utf8Decoder.decode(I,this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,P))return this._preserveStack(H,Z,P,0),this._logSlowResolvingAsync(N),N}this._activeBuffer.x===H&&this._activeBuffer.y===Z||this._onCursorMove.fire();const _e=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(_e,this._bufferService.rows-1))}print(I,$,N){let H,Z;const ae=this._charsetService.charset,ce=this._optionsService.rawOptions.screenReaderMode,_e=this._bufferService.cols,Q=this._coreService.decPrivateModes.wraparound,P=this._coreService.modes.insertMode,oe=this._curAttrData;let ge=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&N-$>0&&ge.getWidth(this._activeBuffer.x-1)===2&&ge.setCellFromCodepoint(this._activeBuffer.x-1,0,1,oe);let Se=this._parser.precedingJoinState;for(let ye=$;ye<N;++ye){if(H=I[ye],H<127&&ae){const xt=ae[String.fromCharCode(H)];xt&&(H=xt.charCodeAt(0))}const Pe=this._unicodeService.charProperties(H,Se);Z=L.UnicodeService.extractWidth(Pe);const Fe=L.UnicodeService.extractShouldJoin(Pe),Xe=Fe?L.UnicodeService.extractWidth(Se):0;if(Se=Pe,ce&&this._onA11yChar.fire((0,E.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Z-Xe>_e){if(Q){const xt=ge;let Ne=this._activeBuffer.x-Xe;for(this._activeBuffer.x=Xe,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),ge=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Xe>0&&ge instanceof g.BufferLine&&ge.copyCellsFrom(xt,Ne,0,Xe,!1);Ne<_e;)xt.setCellFromCodepoint(Ne++,0,1,oe)}else if(this._activeBuffer.x=_e-1,Z===2)continue}if(Fe&&this._activeBuffer.x){const xt=ge.getWidth(this._activeBuffer.x-1)?1:2;ge.addCodepointToCell(this._activeBuffer.x-xt,H,Z);for(let Ne=Z-Xe;--Ne>=0;)ge.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}else if(P&&(ge.insertCells(this._activeBuffer.x,Z-Xe,this._activeBuffer.getNullCell(oe)),ge.getWidth(_e-1)===2&&ge.setCellFromCodepoint(_e-1,p.NULL_CELL_CODE,p.NULL_CELL_WIDTH,oe)),ge.setCellFromCodepoint(this._activeBuffer.x++,H,Z,oe),Z>0)for(;--Z;)ge.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}this._parser.precedingJoinState=Se,this._activeBuffer.x<_e&&N-$>0&&ge.getWidth(this._activeBuffer.x)===0&&!ge.hasContent(this._activeBuffer.x)&&ge.setCellFromCodepoint(this._activeBuffer.x,0,1,oe),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,$){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,$):this._parser.registerCsiHandler(I,(N=>!G(N.params[0],this._optionsService.rawOptions.windowOptions)||$(N)))}registerDcsHandler(I,$){return this._parser.registerDcsHandler(I,new R.DcsHandler($))}registerEscHandler(I,$){return this._parser.registerEscHandler(I,$)}registerOscHandler(I,$){return this._parser.registerOscHandler(I,new M.OscHandler($))}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 I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);I.hasWidth(this._activeBuffer.x)&&!I.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,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(I,$){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+$):(this._activeBuffer.x=I,this._activeBuffer.y=$),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,$){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+$)}cursorUp(I){const $=this._activeBuffer.y-this._activeBuffer.scrollTop;return $>=0?this._moveCursor(0,-Math.min($,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const $=this._activeBuffer.scrollBottom-this._activeBuffer.y;return $>=0?this._moveCursor(0,Math.min($,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const $=I.params[0];return $===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:$===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let $=I.params[0]||1;for(;$--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let $=I.params[0]||1;for(;$--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const $=I.params[0];return $===1&&(this._curAttrData.bg|=536870912),$!==2&&$!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,$,N,H=!1,Z=!1){const ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);ae.replaceCells($,N,this._activeBuffer.getNullCell(this._eraseAttrData()),Z),H&&(ae.isWrapped=!1)}_resetBufferLine(I,$=!1){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);N&&(N.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),$),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),N.isWrapped=!1)}eraseInDisplay(I,$=!1){let N;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,$);N<this._bufferService.rows;N++)this._resetBufferLine(N,$);this._dirtyRowTracker.markDirty(N);break;case 1:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N,0,this._activeBuffer.x+1,!0,$),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(N+1).isWrapped=!1);N--;)this._resetBufferLine(N,$);this._dirtyRowTracker.markDirty(0);break;case 2:for(N=this._bufferService.rows,this._dirtyRowTracker.markDirty(N-1);N--;)this._resetBufferLine(N,$);this._dirtyRowTracker.markDirty(0);break;case 3:const H=this._activeBuffer.lines.length-this._bufferService.rows;H>0&&(this._activeBuffer.lines.trimStart(H),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-H,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-H,0),this._onScroll.fire(0))}return!0}eraseInLine(I,$=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,$);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,$);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,$)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let $=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y,H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Z=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;$--;)this._activeBuffer.lines.splice(Z-1,1),this._activeBuffer.lines.splice(N,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(I){this._restrictCursor();let $=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y;let H;for(H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-H;$--;)this._activeBuffer.lines.splice(N,1),this._activeBuffer.lines.splice(H,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(I){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.insertCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(I){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.deleteCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(I){let $=I.params[0]||1;for(;$--;)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(I){let $=I.params[0]||1;for(;$--;)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(g.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=I.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);H.deleteCells(0,$,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=I.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);H.insertCells(0,$,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=I.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);H.insertCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=I.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);H.deleteCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(I){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(I.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(I){const $=this._parser.precedingJoinState;if(!$)return!0;const N=I.params[0]||1,H=L.UnicodeService.extractWidth($),Z=this._activeBuffer.x-H,ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Z),ce=new Uint32Array(ae.length*N);let _e=0;for(let P=0;P<ae.length;){const oe=ae.codePointAt(P)||0;ce[_e++]=oe,P+=oe>65535?2:1}let Q=_e;for(let P=1;P<N;++P)ce.copyWithin(Q,0,_e),Q+=_e;return this.print(ce,0,Q),!0}sendDeviceAttributesPrimary(I){return I.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(I){return I.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(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let $=0;$<I.length;$++)switch(I.params[$]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(I){for(let $=0;$<I.length;$++)switch(I.params[$]){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(I){for(let $=0;$<I.length;$++)switch(I.params[$]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(I){for(let $=0;$<I.length;$++)switch(I.params[$]){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(),I.params[$]===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(I,$){const N=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:Z}=this._coreMouseService,ae=this._coreService,{buffers:ce,cols:_e}=this._bufferService,{active:Q,alt:P}=ce,oe=this._optionsService.rawOptions,ge=Fe=>Fe?1:2,Se=I.params[0];return ye=Se,Pe=$?Se===2?4:Se===4?ge(ae.modes.insertMode):Se===12?3:Se===20?ge(oe.convertEol):0:Se===1?ge(N.applicationCursorKeys):Se===3?oe.windowOptions.setWinLines?_e===80?2:_e===132?1:0:0:Se===6?ge(N.origin):Se===7?ge(N.wraparound):Se===8?3:Se===9?ge(H==="X10"):Se===12?ge(oe.cursorBlink):Se===25?ge(!ae.isCursorHidden):Se===45?ge(N.reverseWraparound):Se===66?ge(N.applicationKeypad):Se===67?4:Se===1e3?ge(H==="VT200"):Se===1002?ge(H==="DRAG"):Se===1003?ge(H==="ANY"):Se===1004?ge(N.sendFocus):Se===1005?4:Se===1006?ge(Z==="SGR"):Se===1015?4:Se===1016?ge(Z==="SGR_PIXELS"):Se===1048?1:Se===47||Se===1047||Se===1049?ge(Q===P):Se===2004?ge(N.bracketedPasteMode):0,ae.triggerDataEvent(`${f.C0.ESC}[${$?"":"?"}${ye};${Pe}$y`),!0;var ye,Pe}_updateAttrColor(I,$,N,H,Z){return $===2?(I|=50331648,I&=-16777216,I|=T.AttributeData.fromColorRGB([N,H,Z])):$===5&&(I&=-50331904,I|=33554432|255&N),I}_extractColor(I,$,N){const H=[0,0,-1,0,0,0];let Z=0,ae=0;do{if(H[ae+Z]=I.params[$+ae],I.hasSubParams($+ae)){const ce=I.getSubParams($+ae);let _e=0;do H[1]===5&&(Z=1),H[ae+_e+1+Z]=ce[_e];while(++_e<ce.length&&_e+ae+1+Z<H.length);break}if(H[1]===5&&ae+Z>=2||H[1]===2&&ae+Z>=5)break;H[1]&&(Z=1)}while(++ae+$<I.length&&ae+Z<H.length);for(let ce=2;ce<H.length;++ce)H[ce]===-1&&(H[ce]=0);switch(H[0]){case 38:N.fg=this._updateAttrColor(N.fg,H[1],H[3],H[4],H[5]);break;case 48:N.bg=this._updateAttrColor(N.bg,H[1],H[3],H[4],H[5]);break;case 58:N.extended=N.extended.clone(),N.extended.underlineColor=this._updateAttrColor(N.extended.underlineColor,H[1],H[3],H[4],H[5])}return ae}_processUnderline(I,$){$.extended=$.extended.clone(),(!~I||I>5)&&(I=1),$.extended.underlineStyle=I,$.fg|=268435456,I===0&&($.fg&=-268435457),$.updateExtended()}_processSGR0(I){I.fg=g.DEFAULT_ATTR_DATA.fg,I.bg=g.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const $=I.length;let N;const H=this._curAttrData;for(let Z=0;Z<$;Z++)N=I.params[Z],N>=30&&N<=37?(H.fg&=-50331904,H.fg|=16777216|N-30):N>=40&&N<=47?(H.bg&=-50331904,H.bg|=16777216|N-40):N>=90&&N<=97?(H.fg&=-50331904,H.fg|=16777224|N-90):N>=100&&N<=107?(H.bg&=-50331904,H.bg|=16777224|N-100):N===0?this._processSGR0(H):N===1?H.fg|=134217728:N===3?H.bg|=67108864:N===4?(H.fg|=268435456,this._processUnderline(I.hasSubParams(Z)?I.getSubParams(Z)[0]:1,H)):N===5?H.fg|=536870912:N===7?H.fg|=67108864:N===8?H.fg|=1073741824:N===9?H.fg|=2147483648:N===2?H.bg|=134217728:N===21?this._processUnderline(2,H):N===22?(H.fg&=-134217729,H.bg&=-134217729):N===23?H.bg&=-67108865:N===24?(H.fg&=-268435457,this._processUnderline(0,H)):N===25?H.fg&=-536870913:N===27?H.fg&=-67108865:N===28?H.fg&=-1073741825:N===29?H.fg&=2147483647:N===39?(H.fg&=-67108864,H.fg|=16777215&g.DEFAULT_ATTR_DATA.fg):N===49?(H.bg&=-67108864,H.bg|=16777215&g.DEFAULT_ATTR_DATA.bg):N===38||N===48||N===58?Z+=this._extractColor(I,Z,H):N===53?H.bg|=1073741824:N===55?H.bg&=-1073741825:N===59?(H.extended=H.extended.clone(),H.extended.underlineColor=-1,H.updateExtended()):N===100?(H.fg&=-67108864,H.fg|=16777215&g.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&g.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",N);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const $=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${$};${N}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const $=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${$};${N}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=g.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(I){const $=I.params[0]||1;switch($){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 N=$%2==1;return this._optionsService.options.cursorBlink=N,!0}setScrollRegion(I){const $=I.params[0]||1;let N;return(I.length<2||(N=I.params[1])>this._bufferService.rows||N===0)&&(N=this._bufferService.rows),N>$&&(this._activeBuffer.scrollTop=$-1,this._activeBuffer.scrollBottom=N-1,this._setCursor(0,0)),!0}windowOptions(I){if(!G(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const $=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:$!==2&&this._onRequestWindowsOptionsReport.fire(B.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(B.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:$!==0&&$!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),$!==0&&$!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:$!==0&&$!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),$!==0&&$!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){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(I){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(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const $=[],N=I.split(";");for(;N.length>1;){const H=N.shift(),Z=N.shift();if(/^\d+$/.exec(H)){const ae=parseInt(H);if(W(ae))if(Z==="?")$.push({type:0,index:ae});else{const ce=(0,O.parseColor)(Z);ce&&$.push({type:1,index:ae,color:ce})}}}return $.length&&this._onColor.fire($),!0}setHyperlink(I){const $=I.split(";");return!($.length<2)&&($[1]?this._createHyperlink($[0],$[1]):!$[0]&&this._finishHyperlink())}_createHyperlink(I,$){this._getCurrentLinkId()&&this._finishHyperlink();const N=I.split(":");let H;const Z=N.findIndex((ae=>ae.startsWith("id=")));return Z!==-1&&(H=N[Z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,uri:$}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,$){const N=I.split(";");for(let H=0;H<N.length&&!($>=this._specialColors.length);++H,++$)if(N[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[$]}]);else{const Z=(0,O.parseColor)(N[H]);Z&&this._onColor.fire([{type:1,index:this._specialColors[$],color:Z}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const $=[],N=I.split(";");for(let H=0;H<N.length;++H)if(/^\d+$/.exec(N[H])){const Z=parseInt(N[H]);W(Z)&&$.push({type:2,index:Z})}return $.length&&this._onColor.fire($),!0}restoreFgColor(I){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(I){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(I){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(I){return I.length!==2?(this.selectDefaultCharset(),!0):(I[0]==="/"||this._charsetService.setgCharset(F[I[0]],C.CHARSETS[I[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 I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,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=g.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=g.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new y.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let $=0;$<this._bufferService.rows;++$){const N=this._activeBuffer.ybase+this._activeBuffer.y+$,H=this._activeBuffer.lines.get(N);H&&(H.fill(I),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(I,$){const N=this._bufferService.buffer,H=this._optionsService.rawOptions;return(Z=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${Z}${f.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${N.scrollTop+1};${N.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,$){this._dirtyRowTracker.markRangeDirty(I,$)}}c.InputHandler=te;let q=class{constructor(Y){this._bufferService=Y,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Y){Y<this.start?this.start=Y:Y>this.end&&(this.end=Y)}markRangeDirty(Y,I){Y>I&&(K=Y,Y=I,I=K),Y<this.start&&(this.start=Y),I>this.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function W(Y){return 0<=Y&&Y<256}q=h([S(0,A.IBufferService)],q)},844:(m,c)=>{function u(h){for(const S of h)S.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 S=this._disposables.indexOf(h);S!==-1&&this._disposables.splice(S,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:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FourKeyMap=c.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(S,f,C){this._data[S]||(this._data[S]={}),this._data[S][f]=C}get(S,f){return this._data[S]?this._data[S][f]:void 0}clear(){this._data={}}}c.TwoKeyMap=u,c.FourKeyMap=class{constructor(){this._data=new u}set(h,S,f,C,x){this._data.get(h,S)||this._data.set(h,S,new u),this._data.get(h,S).set(f,C,x)}get(h,S,f,C){return this._data.get(h,S)?.get(f,C)}clear(){this._data.clear()}}},6114:(m,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 S=u.match(/Version\/(\d+)/);return S===null||S.length<2?0:parseInt(S[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:(m,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 S=this._getKey(h);if(S===void 0||(u=this._search(S),u===-1)||this._getKey(this._array[u])!==S)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])===S);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,S){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do S(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===h)}values(){return[...this._array].values()}_search(h){let S=0,f=this._array.length-1;for(;f>=S;){let C=S+f>>1;const x=this._getKey(this._array[C]);if(x>h)f=C-1;else{if(!(x<h)){for(;C>0&&this._getKey(this._array[C-1])===h;)C--;return C}S=C+1}}return S}}},7226:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DebouncedIdleTask=c.IdleTaskQueue=c.PriorityTaskQueue=void 0;const h=u(6114);class S{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(x){this._idleCallback=void 0;let k=0,E=0,g=x.timeRemaining(),b=0;for(;this._i<this._tasks.length;){if(k=Date.now(),this._tasks[this._i]()||this._i++,k=Math.max(1,Date.now()-k),E=Math.max(k,E),b=x.timeRemaining(),1.5*E>b)return g-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(g-k))}ms`),void this._start();g=b}this.clear()}}class f extends S{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const k=Date.now()+x;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}c.PriorityTaskQueue=f,c.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends S{_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:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;const h=u(643);c.updateWindowsModeWrappedState=function(S){const f=S.buffer.lines.get(S.buffer.ybase+S.buffer.y-1),C=f?.get(S.cols-1),x=S.buffer.lines.get(S.buffer.ybase+S.buffer.y);x&&C&&(x.isWrapped=C[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&C[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(m,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:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Buffer=c.MAX_BUFFER_SIZE=void 0;const h=u(6349),S=u(7226),f=u(3734),C=u(8437),x=u(4634),k=u(511),E=u(643),g=u(4863),b=u(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(p,y,T){this._hasScrollback=p,this._optionsService=y,this._bufferService=T,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=k.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,E.WHITESPACE_CELL_CHAR,E.WHITESPACE_CELL_WIDTH,E.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new S.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(p){return p?(this._nullCell.fg=p.fg,this._nullCell.bg=p.bg,this._nullCell.extended=p.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(p){return p?(this._whitespaceCell.fg=p.fg,this._whitespaceCell.bg=p.bg,this._whitespaceCell.extended=p.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(p,y){return new C.BufferLine(this._bufferService.cols,this.getNullCell(p),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const p=this.ybase+this.y-this.ydisp;return p>=0&&p<this._rows}_getCorrectBufferLength(p){if(!this._hasScrollback)return p;const y=p+this._optionsService.rawOptions.scrollback;return y>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:y}fillViewportRows(p){if(this.lines.length===0){p===void 0&&(p=C.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(p))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(p,y){const T=this.getNullCell(C.DEFAULT_ATTR_DATA);let A=0;const L=this._getCorrectBufferLength(y);if(L>this.lines.maxLength&&(this.lines.maxLength=L),this.lines.length>0){if(this._cols<p)for(let R=0;R<this.lines.length;R++)A+=+this.lines.get(R).resize(p,T);let M=0;if(this._rows<y)for(let R=this._rows;R<y;R++)this.lines.length<y+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new C.BufferLine(p,T)):this.ybase>0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new C.BufferLine(p,T)));else for(let R=this._rows;R>y;R--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(L<this.lines.maxLength){const R=this.lines.length-L;R>0&&(this.lines.trimStart(R),this.ybase=Math.max(this.ybase-R,0),this.ydisp=Math.max(this.ydisp-R,0),this.savedY=Math.max(this.savedY-R,0)),this.lines.maxLength=L}this.x=Math.min(this.x,p-1),this.y=Math.min(this.y,y-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,p-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(p,y),this._cols>p))for(let M=0;M<this.lines.length;M++)A+=+this.lines.get(M).resize(p,T);this._cols=p,this._rows=y,this._memoryCleanupQueue.clear(),A>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let p=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,p=!1);let y=0;for(;this._memoryCleanupPosition<this.lines.length;)if(y+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),y>100)return!0;return p}get _isReflowEnabled(){const p=this._optionsService.rawOptions.windowsPty;return p&&p.buildNumber?this._hasScrollback&&p.backend==="conpty"&&p.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(p,y){this._cols!==p&&(p>this._cols?this._reflowLarger(p,y):this._reflowSmaller(p,y))}_reflowLarger(p,y){const T=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,p,this.ybase+this.y,this.getNullCell(C.DEFAULT_ATTR_DATA));if(T.length>0){const A=(0,x.reflowLargerCreateNewLayout)(this.lines,T);(0,x.reflowLargerApplyNewLayout)(this.lines,A.layout),this._reflowLargerAdjustViewport(p,y,A.countRemoved)}}_reflowLargerAdjustViewport(p,y,T){const A=this.getNullCell(C.DEFAULT_ATTR_DATA);let L=T;for(;L-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<y&&this.lines.push(new C.BufferLine(p,A))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-T,0)}_reflowSmaller(p,y){const T=this.getNullCell(C.DEFAULT_ATTR_DATA),A=[];let L=0;for(let M=this.lines.length-1;M>=0;M--){let R=this.lines.get(M);if(!R||!R.isWrapped&&R.getTrimmedLength()<=p)continue;const O=[R];for(;R.isWrapped&&M>0;)R=this.lines.get(--M),O.unshift(R);const F=this.ybase+this.y;if(F>=M&&F<M+O.length)continue;const U=O[O.length-1].getTrimmedLength(),G=(0,x.reflowSmallerGetNewLineLengths)(O,this._cols,p),B=G.length-O.length;let K;K=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+B):Math.max(0,this.lines.length-this.lines.maxLength+B);const te=[];for(let N=0;N<B;N++){const H=this.getBlankLine(C.DEFAULT_ATTR_DATA,!0);te.push(H)}te.length>0&&(A.push({start:M+O.length+L,newLines:te}),L+=te.length),O.push(...te);let q=G.length-1,W=G[q];W===0&&(q--,W=G[q]);let Y=O.length-B-1,I=U;for(;Y>=0;){const N=Math.min(I,W);if(O[q]===void 0)break;if(O[q].copyCellsFrom(O[Y],I-N,W-N,N,!0),W-=N,W===0&&(q--,W=G[q]),I-=N,I===0){Y--;const H=Math.max(Y,0);I=(0,x.getWrappedLineTrimmedLength)(O,H,this._cols)}}for(let N=0;N<O.length;N++)G[N]<p&&O[N].setCell(G[N],T);let $=B-K;for(;$-- >0;)this.ybase===0?this.y<y-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+L)-y&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+B,this.ybase+y-1)}if(A.length>0){const M=[],R=[];for(let q=0;q<this.lines.length;q++)R.push(this.lines.get(q));const O=this.lines.length;let F=O-1,U=0,G=A[U];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+L);let B=0;for(let q=Math.min(this.lines.maxLength-1,O+L-1);q>=0;q--)if(G&&G.start>F+B){for(let W=G.newLines.length-1;W>=0;W--)this.lines.set(q--,G.newLines[W]);q++,M.push({index:F+1,amount:G.newLines.length}),B+=G.newLines.length,G=A[++U]}else this.lines.set(q,R[F--]);let K=0;for(let q=M.length-1;q>=0;q--)M[q].index+=K,this.lines.onInsertEmitter.fire(M[q]),K+=M[q].amount;const te=Math.max(0,O+L-this.lines.maxLength);te>0&&this.lines.onTrimEmitter.fire(te)}}translateBufferLineToString(p,y,T=0,A){const L=this.lines.get(p);return L?L.translateToString(y,T,A):""}getWrappedRangeForLine(p){let y=p,T=p;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;T+1<this.lines.length&&this.lines.get(T+1).isWrapped;)T++;return{first:y,last:T}}setupTabStops(p){for(p!=null?this.tabs[p]||(p=this.prevStop(p)):(this.tabs={},p=0);p<this._cols;p+=this._optionsService.rawOptions.tabStopWidth)this.tabs[p]=!0}prevStop(p){for(p==null&&(p=this.x);!this.tabs[--p]&&p>0;);return p>=this._cols?this._cols-1:p<0?0:p}nextStop(p){for(p==null&&(p=this.x);!this.tabs[++p]&&p<this._cols;);return p>=this._cols?this._cols-1:p<0?0:p}clearMarkers(p){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].line===p&&(this.markers[y].dispose(),this.markers.splice(y--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let p=0;p<this.markers.length;p++)this.markers[p].dispose(),this.markers.splice(p--,1);this._isClearing=!1}addMarker(p){const y=new g.Marker(p);return this.markers.push(y),y.register(this.lines.onTrim((T=>{y.line-=T,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((T=>{y.line>=T.index&&(y.line+=T.amount)}))),y.register(this.lines.onDelete((T=>{y.line>=T.index&&y.line<T.index+T.amount&&y.dispose(),y.line>T.index&&(y.line-=T.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(p){this._isClearing||this.markers.splice(this.markers.indexOf(p),1)}}},8437:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const h=u(3734),S=u(511),f=u(643),C=u(482);c.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let x=0;class k{constructor(g,b,p=!1){this.isWrapped=p,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*g);const y=b||S.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let T=0;T<g;++T)this.setCell(T,y);this.length=g}get(g){const b=this._data[3*g+0],p=2097151&b;return[this._data[3*g+1],2097152&b?this._combined[g]:p?(0,C.stringFromCodePoint)(p):"",b>>22,2097152&b?this._combined[g].charCodeAt(this._combined[g].length-1):p]}set(g,b){this._data[3*g+1]=b[f.CHAR_DATA_ATTR_INDEX],b[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[g]=b[1],this._data[3*g+0]=2097152|g|b[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*g+0]=b[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(g){return this._data[3*g+0]>>22}hasWidth(g){return 12582912&this._data[3*g+0]}getFg(g){return this._data[3*g+1]}getBg(g){return this._data[3*g+2]}hasContent(g){return 4194303&this._data[3*g+0]}getCodePoint(g){const b=this._data[3*g+0];return 2097152&b?this._combined[g].charCodeAt(this._combined[g].length-1):2097151&b}isCombined(g){return 2097152&this._data[3*g+0]}getString(g){const b=this._data[3*g+0];return 2097152&b?this._combined[g]:2097151&b?(0,C.stringFromCodePoint)(2097151&b):""}isProtected(g){return 536870912&this._data[3*g+2]}loadCell(g,b){return x=3*g,b.content=this._data[x+0],b.fg=this._data[x+1],b.bg=this._data[x+2],2097152&b.content&&(b.combinedData=this._combined[g]),268435456&b.bg&&(b.extended=this._extendedAttrs[g]),b}setCell(g,b){2097152&b.content&&(this._combined[g]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[g]=b.extended),this._data[3*g+0]=b.content,this._data[3*g+1]=b.fg,this._data[3*g+2]=b.bg}setCellFromCodepoint(g,b,p,y){268435456&y.bg&&(this._extendedAttrs[g]=y.extended),this._data[3*g+0]=b|p<<22,this._data[3*g+1]=y.fg,this._data[3*g+2]=y.bg}addCodepointToCell(g,b,p){let y=this._data[3*g+0];2097152&y?this._combined[g]+=(0,C.stringFromCodePoint)(b):2097151&y?(this._combined[g]=(0,C.stringFromCodePoint)(2097151&y)+(0,C.stringFromCodePoint)(b),y&=-2097152,y|=2097152):y=b|4194304,p&&(y&=-12582913,y|=p<<22),this._data[3*g+0]=y}insertCells(g,b,p){if((g%=this.length)&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g-1,0,1,p),b<this.length-g){const y=new S.CellData;for(let T=this.length-g-b-1;T>=0;--T)this.setCell(g+b+T,this.loadCell(g+T,y));for(let T=0;T<b;++T)this.setCell(g+T,p)}else for(let y=g;y<this.length;++y)this.setCell(y,p);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,p)}deleteCells(g,b,p){if(g%=this.length,b<this.length-g){const y=new S.CellData;for(let T=0;T<this.length-g-b;++T)this.setCell(g+T,this.loadCell(g+b+T,y));for(let T=this.length-b;T<this.length;++T)this.setCell(T,p)}else for(let y=g;y<this.length;++y)this.setCell(y,p);g&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g-1,0,1,p),this.getWidth(g)!==0||this.hasContent(g)||this.setCellFromCodepoint(g,0,1,p)}replaceCells(g,b,p,y=!1){if(y)for(g&&this.getWidth(g-1)===2&&!this.isProtected(g-1)&&this.setCellFromCodepoint(g-1,0,1,p),b<this.length&&this.getWidth(b-1)===2&&!this.isProtected(b)&&this.setCellFromCodepoint(b,0,1,p);g<b&&g<this.length;)this.isProtected(g)||this.setCell(g,p),g++;else for(g&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g-1,0,1,p),b<this.length&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b,0,1,p);g<b&&g<this.length;)this.setCell(g++,p)}resize(g,b){if(g===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const p=3*g;if(g>this.length){if(this._data.buffer.byteLength>=4*p)this._data=new Uint32Array(this._data.buffer,0,p);else{const y=new Uint32Array(p);y.set(this._data),this._data=y}for(let y=this.length;y<g;++y)this.setCell(y,b)}else{this._data=this._data.subarray(0,p);const y=Object.keys(this._combined);for(let A=0;A<y.length;A++){const L=parseInt(y[A],10);L>=g&&delete this._combined[L]}const T=Object.keys(this._extendedAttrs);for(let A=0;A<T.length;A++){const L=parseInt(T[A],10);L>=g&&delete this._extendedAttrs[L]}}return this.length=g,4*p*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const g=new Uint32Array(this._data.length);return g.set(this._data),this._data=g,1}return 0}fill(g,b=!1){if(b)for(let p=0;p<this.length;++p)this.isProtected(p)||this.setCell(p,g);else{this._combined={},this._extendedAttrs={};for(let p=0;p<this.length;++p)this.setCell(p,g)}}copyFrom(g){this.length!==g.length?this._data=new Uint32Array(g._data):this._data.set(g._data),this.length=g.length,this._combined={};for(const b in g._combined)this._combined[b]=g._combined[b];this._extendedAttrs={};for(const b in g._extendedAttrs)this._extendedAttrs[b]=g._extendedAttrs[b];this.isWrapped=g.isWrapped}clone(){const g=new k(0);g._data=new Uint32Array(this._data),g.length=this.length;for(const b in this._combined)g._combined[b]=this._combined[b];for(const b in this._extendedAttrs)g._extendedAttrs[b]=this._extendedAttrs[b];return g.isWrapped=this.isWrapped,g}getTrimmedLength(){for(let g=this.length-1;g>=0;--g)if(4194303&this._data[3*g+0])return g+(this._data[3*g+0]>>22);return 0}getNoBgTrimmedLength(){for(let g=this.length-1;g>=0;--g)if(4194303&this._data[3*g+0]||50331648&this._data[3*g+2])return g+(this._data[3*g+0]>>22);return 0}copyCellsFrom(g,b,p,y,T){const A=g._data;if(T)for(let M=y-1;M>=0;M--){for(let R=0;R<3;R++)this._data[3*(p+M)+R]=A[3*(b+M)+R];268435456&A[3*(b+M)+2]&&(this._extendedAttrs[p+M]=g._extendedAttrs[b+M])}else for(let M=0;M<y;M++){for(let R=0;R<3;R++)this._data[3*(p+M)+R]=A[3*(b+M)+R];268435456&A[3*(b+M)+2]&&(this._extendedAttrs[p+M]=g._extendedAttrs[b+M])}const L=Object.keys(g._combined);for(let M=0;M<L.length;M++){const R=parseInt(L[M],10);R>=b&&(this._combined[R-b+p]=g._combined[R])}}translateToString(g,b,p,y){b=b??0,p=p??this.length,g&&(p=Math.min(p,this.getTrimmedLength())),y&&(y.length=0);let T="";for(;b<p;){const A=this._data[3*b+0],L=2097151&A,M=2097152&A?this._combined[b]:L?(0,C.stringFromCodePoint)(L):f.WHITESPACE_CELL_CHAR;if(T+=M,y)for(let R=0;R<M.length;++R)y.push(b);b+=A>>22||1}return y&&y.push(b),T}}c.BufferLine=k},4841:(m,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:(m,c)=>{function u(h,S,f){if(S===h.length-1)return h[S].getTrimmedLength();const C=!h[S].hasContent(f-1)&&h[S].getWidth(f-1)===1,x=h[S+1].getWidth(0)===2;return C&&x?f-1:f}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(h,S,f,C,x){const k=[];for(let E=0;E<h.length-1;E++){let g=E,b=h.get(++g);if(!b.isWrapped)continue;const p=[h.get(E)];for(;g<h.length&&b.isWrapped;)p.push(b),b=h.get(++g);if(C>=E&&C<g){E+=p.length-1;continue}let y=0,T=u(p,y,S),A=1,L=0;for(;A<p.length;){const R=u(p,A,S),O=R-L,F=f-T,U=Math.min(O,F);p[y].copyCellsFrom(p[A],L,T,U,!1),T+=U,T===f&&(y++,T=0),L+=U,L===R&&(A++,L=0),T===0&&y!==0&&p[y-1].getWidth(f-1)===2&&(p[y].copyCellsFrom(p[y-1],f-1,T++,1,!1),p[y-1].setCell(f-1,x))}p[y].replaceCells(T,f,x);let M=0;for(let R=p.length-1;R>0&&(R>y||p[R].getTrimmedLength()===0);R--)M++;M>0&&(k.push(E+p.length-M),k.push(M)),E+=p.length-1}return k},c.reflowLargerCreateNewLayout=function(h,S){const f=[];let C=0,x=S[C],k=0;for(let E=0;E<h.length;E++)if(x===E){const g=S[++C];h.onDeleteEmitter.fire({index:E-k,amount:g}),E+=g-1,k+=g,x=S[++C]}else f.push(E);return{layout:f,countRemoved:k}},c.reflowLargerApplyNewLayout=function(h,S){const f=[];for(let C=0;C<S.length;C++)f.push(h.get(S[C]));for(let C=0;C<f.length;C++)h.set(C,f[C]);h.length=S.length},c.reflowSmallerGetNewLineLengths=function(h,S,f){const C=[],x=h.map(((b,p)=>u(h,p,S))).reduce(((b,p)=>b+p));let k=0,E=0,g=0;for(;g<x;){if(x-g<f){C.push(x-g);break}k+=f;const b=u(h,E,S);k>b&&(k-=b,E++);const p=h[E].getWidth(k-1)===2;p&&k--;const y=p?f-1:f;C.push(y),g+=y}return C},c.getWrappedLineTrimmedLength=u},5295:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const h=u(8460),S=u(844),f=u(9092);class C extends S.Disposable{constructor(k,E){super(),this._optionsService=k,this._bufferService=E,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(k){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(k),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(k,E){this._normal.resize(k,E),this._alt.resize(k,E),this.setupTabStops(k)}setupTabStops(k){this._normal.setupTabStops(k),this._alt.setupTabStops(k)}}c.BufferSet=C},511:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CellData=void 0;const h=u(482),S=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(k){const E=new C;return E.setFromCharData(k),E}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(k){this.fg=k[S.CHAR_DATA_ATTR_INDEX],this.bg=0;let E=!1;if(k[S.CHAR_DATA_CHAR_INDEX].length>2)E=!0;else if(k[S.CHAR_DATA_CHAR_INDEX].length===2){const g=k[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=g&&g<=56319){const b=k[S.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(g-55296)+b-56320+65536|k[S.CHAR_DATA_WIDTH_INDEX]<<22:E=!0}else E=!0}else this.content=k[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[S.CHAR_DATA_WIDTH_INDEX]<<22;E&&(this.combinedData=k[S.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[S.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.CellData=C},643:(m,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:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;const h=u(8460),S=u(844);class f{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,S.disposeArray)(this._disposables),this._disposables.length=0)}register(x){return this._disposables.push(x),x}}c.Marker=f,f._nextId=1},7116:(m,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:(m,c)=>{var u,h,S;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=`
82
- `,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}\\`})(S||(c.C1_ESCAPED=S={}))},7399:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.evaluateKeyboardEvent=void 0;const h=u(2584),S={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};c.evaluateKeyboardEvent=function(f,C,x,k){const E={type:0,cancel:!1,key:void 0},g=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?E.key=C?h.C0.ESC+"OA":h.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?E.key=C?h.C0.ESC+"OD":h.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?E.key=C?h.C0.ESC+"OC":h.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(E.key=C?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:E.key=f.ctrlKey?"\b":h.C0.DEL,f.altKey&&(E.key=h.C0.ESC+E.key);break;case 9:if(f.shiftKey){E.key=h.C0.ESC+"[Z";break}E.key=h.C0.HT,E.cancel=!0;break;case 13:E.key=f.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,E.cancel=!0;break;case 27:E.key=h.C0.ESC,f.altKey&&(E.key=h.C0.ESC+h.C0.ESC),E.cancel=!0;break;case 37:if(f.metaKey)break;g?(E.key=h.C0.ESC+"[1;"+(g+1)+"D",E.key===h.C0.ESC+"[1;3D"&&(E.key=h.C0.ESC+(x?"b":"[1;5D"))):E.key=C?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(f.metaKey)break;g?(E.key=h.C0.ESC+"[1;"+(g+1)+"C",E.key===h.C0.ESC+"[1;3C"&&(E.key=h.C0.ESC+(x?"f":"[1;5C"))):E.key=C?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(f.metaKey)break;g?(E.key=h.C0.ESC+"[1;"+(g+1)+"A",x||E.key!==h.C0.ESC+"[1;3A"||(E.key=h.C0.ESC+"[1;5A")):E.key=C?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(f.metaKey)break;g?(E.key=h.C0.ESC+"[1;"+(g+1)+"B",x||E.key!==h.C0.ESC+"[1;3B"||(E.key=h.C0.ESC+"[1;5B")):E.key=C?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(E.key=h.C0.ESC+"[2~");break;case 46:E.key=g?h.C0.ESC+"[3;"+(g+1)+"~":h.C0.ESC+"[3~";break;case 36:E.key=g?h.C0.ESC+"[1;"+(g+1)+"H":C?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:E.key=g?h.C0.ESC+"[1;"+(g+1)+"F":C?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:f.shiftKey?E.type=2:f.ctrlKey?E.key=h.C0.ESC+"[5;"+(g+1)+"~":E.key=h.C0.ESC+"[5~";break;case 34:f.shiftKey?E.type=3:f.ctrlKey?E.key=h.C0.ESC+"[6;"+(g+1)+"~":E.key=h.C0.ESC+"[6~";break;case 112:E.key=g?h.C0.ESC+"[1;"+(g+1)+"P":h.C0.ESC+"OP";break;case 113:E.key=g?h.C0.ESC+"[1;"+(g+1)+"Q":h.C0.ESC+"OQ";break;case 114:E.key=g?h.C0.ESC+"[1;"+(g+1)+"R":h.C0.ESC+"OR";break;case 115:E.key=g?h.C0.ESC+"[1;"+(g+1)+"S":h.C0.ESC+"OS";break;case 116:E.key=g?h.C0.ESC+"[15;"+(g+1)+"~":h.C0.ESC+"[15~";break;case 117:E.key=g?h.C0.ESC+"[17;"+(g+1)+"~":h.C0.ESC+"[17~";break;case 118:E.key=g?h.C0.ESC+"[18;"+(g+1)+"~":h.C0.ESC+"[18~";break;case 119:E.key=g?h.C0.ESC+"[19;"+(g+1)+"~":h.C0.ESC+"[19~";break;case 120:E.key=g?h.C0.ESC+"[20;"+(g+1)+"~":h.C0.ESC+"[20~";break;case 121:E.key=g?h.C0.ESC+"[21;"+(g+1)+"~":h.C0.ESC+"[21~";break;case 122:E.key=g?h.C0.ESC+"[23;"+(g+1)+"~":h.C0.ESC+"[23~";break;case 123:E.key=g?h.C0.ESC+"[24;"+(g+1)+"~":h.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(x&&!k||!f.altKey||f.metaKey)!x||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?E.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(E.key=h.C0.US),f.key==="@"&&(E.key=h.C0.NUL)):f.keyCode===65&&(E.type=1);else{const b=S[f.keyCode],p=b?.[f.shiftKey?1:0];if(p)E.key=h.C0.ESC+p;else if(f.keyCode>=65&&f.keyCode<=90){const y=f.ctrlKey?f.keyCode-64:f.keyCode+32;let T=String.fromCharCode(y);f.shiftKey&&(T=T.toUpperCase()),E.key=h.C0.ESC+T}else if(f.keyCode===32)E.key=h.C0.ESC+(f.ctrlKey?h.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let y=f.code.slice(3,4);f.shiftKey||(y=y.toLowerCase()),E.key=h.C0.ESC+y,E.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?E.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?E.key=h.C0.NUL:f.keyCode>=51&&f.keyCode<=55?E.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?E.key=h.C0.DEL:f.keyCode===219?E.key=h.C0.ESC:f.keyCode===220?E.key=h.C0.FS:f.keyCode===221&&(E.key=h.C0.GS)}return E}},482:(m,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,S=u.length){let f="";for(let C=h;C<S;++C){let x=u[C];x>65535?(x-=65536,f+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):f+=String.fromCharCode(x)}return f},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,h){const S=u.length;if(!S)return 0;let f=0,C=0;if(this._interim){const x=u.charCodeAt(C++);56320<=x&&x<=57343?h[f++]=1024*(this._interim-55296)+x-56320+65536:(h[f++]=this._interim,h[f++]=x),this._interim=0}for(let x=C;x<S;++x){const k=u.charCodeAt(x);if(55296<=k&&k<=56319){if(++x>=S)return this._interim=k,f;const E=u.charCodeAt(x);56320<=E&&E<=57343?h[f++]=1024*(k-55296)+E-56320+65536:(h[f++]=k,h[f++]=E)}else k!==65279&&(h[f++]=k)}return f}},c.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,h){const S=u.length;if(!S)return 0;let f,C,x,k,E=0,g=0,b=0;if(this.interim[0]){let T=!1,A=this.interim[0];A&=(224&A)==192?31:(240&A)==224?15:7;let L,M=0;for(;(L=63&this.interim[++M])&&M<4;)A<<=6,A|=L;const R=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,O=R-M;for(;b<O;){if(b>=S)return 0;if(L=u[b++],(192&L)!=128){b--,T=!0;break}this.interim[M++]=L,A<<=6,A|=63&L}T||(R===2?A<128?b--:h[E++]=A:R===3?A<2048||A>=55296&&A<=57343||A===65279||(h[E++]=A):A<65536||A>1114111||(h[E++]=A)),this.interim.fill(0)}const p=S-4;let y=b;for(;y<S;){for(;!(!(y<p)||128&(f=u[y])||128&(C=u[y+1])||128&(x=u[y+2])||128&(k=u[y+3]));)h[E++]=f,h[E++]=C,h[E++]=x,h[E++]=k,y+=4;if(f=u[y++],f<128)h[E++]=f;else if((224&f)==192){if(y>=S)return this.interim[0]=f,E;if(C=u[y++],(192&C)!=128){y--;continue}if(g=(31&f)<<6|63&C,g<128){y--;continue}h[E++]=g}else if((240&f)==224){if(y>=S)return this.interim[0]=f,E;if(C=u[y++],(192&C)!=128){y--;continue}if(y>=S)return this.interim[0]=f,this.interim[1]=C,E;if(x=u[y++],(192&x)!=128){y--;continue}if(g=(15&f)<<12|(63&C)<<6|63&x,g<2048||g>=55296&&g<=57343||g===65279)continue;h[E++]=g}else if((248&f)==240){if(y>=S)return this.interim[0]=f,E;if(C=u[y++],(192&C)!=128){y--;continue}if(y>=S)return this.interim[0]=f,this.interim[1]=C,E;if(x=u[y++],(192&x)!=128){y--;continue}if(y>=S)return this.interim[0]=f,this.interim[1]=C,this.interim[2]=x,E;if(k=u[y++],(192&k)!=128){y--;continue}if(g=(7&f)<<18|(63&C)<<12|(63&x)<<6|63&k,g<65536||g>1114111)continue;h[E++]=g}}return E}}},225:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const h=u(1480),S=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],f=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let C;c.UnicodeV6=class{constructor(){if(this.version="6",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160),C.fill(2,4352,4448),C[9001]=2,C[9002]=2,C.fill(2,11904,42192),C[12351]=1,C.fill(2,44032,55204),C.fill(2,63744,64256),C.fill(2,65040,65050),C.fill(2,65072,65136),C.fill(2,65280,65377),C.fill(2,65504,65511);for(let x=0;x<S.length;++x)C.fill(0,S[x][0],S[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?C[x]:(function(k,E){let g,b=0,p=E.length-1;if(k<E[0][0]||k>E[p][1])return!1;for(;p>=b;)if(g=b+p>>1,k>E[g][1])b=g+1;else{if(!(k<E[g][0]))return!0;p=g-1}return!1})(x,f)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,k){let E=this.wcwidth(x),g=E===0&&k!==0;if(g){const b=h.UnicodeService.extractWidth(k);b===0?g=!1:b>E&&(E=b)}return h.UnicodeService.createPropertyValue(0,E,g)}}},5981:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const h=u(8460),S=u(844);class f extends S.Disposable{constructor(x){super(),this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(x,k){if(k!==void 0&&this._syncCalls>k)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let E;for(this._isSyncWriting=!0;E=this._writeBuffer.shift();){this._action(E);const g=this._callbacks.shift();g&&g()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,k){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(k),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(k)}_innerWrite(x=0,k=!0){const E=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const g=this._writeBuffer[this._bufferOffset],b=this._action(g,k);if(b){const y=T=>Date.now()-E>=12?setTimeout((()=>this._innerWrite(0,T))):this._innerWrite(E,T);return void b.catch((T=>(queueMicrotask((()=>{throw T})),Promise.resolve(!1)))).then(y)}const p=this._callbacks[this._bufferOffset];if(p&&p(),this._bufferOffset++,this._pendingData-=g.length,Date.now()-E>=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:(m,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 S(f,C){const x=f.toString(16),k=x.length<2?"0"+x:x;switch(C){case 4:return x[0];case 8:return k;case 12:return(k+k).slice(0,3);default:return k+k}}c.parseColor=function(f){if(!f)return;let C=f.toLowerCase();if(C.indexOf("rgb:")===0){C=C.slice(4);const x=u.exec(C);if(x){const k=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/k*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/k*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/k*255)]}}else if(C.indexOf("#")===0&&(C=C.slice(1),h.exec(C)&&[3,6,9,12].includes(C.length))){const x=C.length/3,k=[0,0,0];for(let E=0;E<3;++E){const g=parseInt(C.slice(x*E,x*E+x),16);k[E]=x===1?g<<4:x===2?g:x===3?g>>4:g>>8}return k}},c.toRgbString=function(f,C=16){const[x,k,E]=f;return`rgb:${S(x,C)}/${S(k,C)}/${S(E,C)}`}},5770:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},6351:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;const h=u(482),S=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(k,E){this._handlers[k]===void 0&&(this._handlers[k]=[]);const g=this._handlers[k];return g.push(E),{dispose:()=>{const b=g.indexOf(E);b!==-1&&g.splice(b,1)}}}clearHandler(k){this._handlers[k]&&delete this._handlers[k]}setHandlerFallback(k){this._handlerFb=k}reset(){if(this._active.length)for(let k=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;k>=0;--k)this._active[k].unhook(!1);this._stack.paused=!1,this._active=C,this._ident=0}hook(k,E){if(this.reset(),this._ident=k,this._active=this._handlers[k]||C,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].hook(E);else this._handlerFb(this._ident,"HOOK",E)}put(k,E,g){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(k,E,g);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(k,E,g))}unhook(k,E=!0){if(this._active.length){let g=!1,b=this._active.length-1,p=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,g=E,p=this._stack.fallThrough,this._stack.paused=!1),!p&&g===!1){for(;b>=0&&(g=this._active[b].unhook(k),g!==!0);b--)if(g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,g;b--}for(;b>=0;b--)if(g=this._active[b].unhook(!1),g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,g}else this._handlerFb(this._ident,"UNHOOK",k);this._active=C,this._ident=0}};const x=new S.Params;x.addParam(0),c.DcsHandler=class{constructor(k){this._handler=k,this._data="",this._params=x,this._hitLimit=!1}hook(k){this._params=k.length>1||k.params[0]?k.clone():x,this._data="",this._hitLimit=!1}put(k,E,g){this._hitLimit||(this._data+=(0,h.utf32ToString)(k,E,g),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(k){let E=!1;if(this._hitLimit)E=!1;else if(k&&(E=this._handler(this._data,this._params),E instanceof Promise))return E.then((g=>(this._params=x,this._data="",this._hitLimit=!1,g)));return this._params=x,this._data="",this._hitLimit=!1,E}}},2015:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.EscapeSequenceParser=c.VT500_TRANSITION_TABLE=c.TransitionTable=void 0;const h=u(844),S=u(8742),f=u(6242),C=u(6351);class x{constructor(b){this.table=new Uint8Array(b)}setDefault(b,p){this.table.fill(b<<4|p)}add(b,p,y,T){this.table[p<<8|b]=y<<4|T}addMany(b,p,y,T){for(let A=0;A<b.length;A++)this.table[p<<8|b[A]]=y<<4|T}}c.TransitionTable=x;const k=160;c.VT500_TRANSITION_TABLE=(function(){const g=new x(4095),b=Array.apply(null,Array(256)).map(((M,R)=>R)),p=(M,R)=>b.slice(M,R),y=p(32,127),T=p(0,24);T.push(25),T.push.apply(T,p(28,32));const A=p(0,14);let L;for(L in g.setDefault(1,0),g.addMany(y,0,2,0),A)g.addMany([24,26,153,154],L,3,0),g.addMany(p(128,144),L,3,0),g.addMany(p(144,152),L,3,0),g.add(156,L,0,0),g.add(27,L,11,1),g.add(157,L,4,8),g.addMany([152,158,159],L,0,7),g.add(155,L,11,3),g.add(144,L,11,9);return g.addMany(T,0,3,0),g.addMany(T,1,3,1),g.add(127,1,0,1),g.addMany(T,8,0,8),g.addMany(T,3,3,3),g.add(127,3,0,3),g.addMany(T,4,3,4),g.add(127,4,0,4),g.addMany(T,6,3,6),g.addMany(T,5,3,5),g.add(127,5,0,5),g.addMany(T,2,3,2),g.add(127,2,0,2),g.add(93,1,4,8),g.addMany(y,8,5,8),g.add(127,8,5,8),g.addMany([156,27,24,26,7],8,6,0),g.addMany(p(28,32),8,0,8),g.addMany([88,94,95],1,0,7),g.addMany(y,7,0,7),g.addMany(T,7,0,7),g.add(156,7,0,0),g.add(127,7,0,7),g.add(91,1,11,3),g.addMany(p(64,127),3,7,0),g.addMany(p(48,60),3,8,4),g.addMany([60,61,62,63],3,9,4),g.addMany(p(48,60),4,8,4),g.addMany(p(64,127),4,7,0),g.addMany([60,61,62,63],4,0,6),g.addMany(p(32,64),6,0,6),g.add(127,6,0,6),g.addMany(p(64,127),6,0,0),g.addMany(p(32,48),3,9,5),g.addMany(p(32,48),5,9,5),g.addMany(p(48,64),5,0,6),g.addMany(p(64,127),5,7,0),g.addMany(p(32,48),4,9,5),g.addMany(p(32,48),1,9,2),g.addMany(p(32,48),2,9,2),g.addMany(p(48,127),2,10,0),g.addMany(p(48,80),1,10,0),g.addMany(p(81,88),1,10,0),g.addMany([89,90,92],1,10,0),g.addMany(p(96,127),1,10,0),g.add(80,1,11,9),g.addMany(T,9,0,9),g.add(127,9,0,9),g.addMany(p(28,32),9,0,9),g.addMany(p(32,48),9,9,12),g.addMany(p(48,60),9,8,10),g.addMany([60,61,62,63],9,9,10),g.addMany(T,11,0,11),g.addMany(p(32,128),11,0,11),g.addMany(p(28,32),11,0,11),g.addMany(T,10,0,10),g.add(127,10,0,10),g.addMany(p(28,32),10,0,10),g.addMany(p(48,60),10,8,10),g.addMany([60,61,62,63],10,0,11),g.addMany(p(32,48),10,9,12),g.addMany(T,12,0,12),g.add(127,12,0,12),g.addMany(p(28,32),12,0,12),g.addMany(p(32,48),12,9,12),g.addMany(p(48,64),12,0,11),g.addMany(p(64,127),12,12,13),g.addMany(p(64,127),10,12,13),g.addMany(p(64,127),9,12,13),g.addMany(T,13,13,13),g.addMany(y,13,13,13),g.add(127,13,0,13),g.addMany([27,156,24,26],13,14,0),g.add(k,0,2,0),g.add(k,8,5,8),g.add(k,6,0,6),g.add(k,11,0,11),g.add(k,13,13,13),g})();class E 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 S.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(p,y,T)=>{},this._executeHandlerFb=p=>{},this._csiHandlerFb=(p,y)=>{},this._escHandlerFb=p=>{},this._errorHandlerFb=p=>p,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new C.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(b,p=[64,126]){let y=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=b.prefix.charCodeAt(0),y&&60>y||y>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 A=0;A<b.intermediates.length;++A){const L=b.intermediates.charCodeAt(A);if(32>L||L>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=L}}if(b.final.length!==1)throw new Error("final must be a single byte");const T=b.final.charCodeAt(0);if(p[0]>T||T>p[1])throw new Error(`final must be in range ${p[0]} .. ${p[1]}`);return y<<=8,y|=T,y}identToString(b){const p=[];for(;b;)p.push(String.fromCharCode(255&b)),b>>=8;return p.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,p){const y=this._identifier(b,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const T=this._escHandlers[y];return T.push(p),{dispose:()=>{const A=T.indexOf(p);A!==-1&&T.splice(A,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,p){this._executeHandlers[b.charCodeAt(0)]=p}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,p){const y=this._identifier(b);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const T=this._csiHandlers[y];return T.push(p),{dispose:()=>{const A=T.indexOf(p);A!==-1&&T.splice(A,1)}}}clearCsiHandler(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,p){return this._dcsParser.registerHandler(this._identifier(b),p)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,p){return this._oscParser.registerHandler(b,p)}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,p,y,T,A){this._parseStack.state=b,this._parseStack.handlers=p,this._parseStack.handlerPos=y,this._parseStack.transition=T,this._parseStack.chunkPos=A}parse(b,p,y){let T,A=0,L=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const R=this._parseStack.handlers;let O=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&O>-1){for(;O>=0&&(T=R[O](this._params),T!==!0);O--)if(T instanceof Promise)return this._parseStack.handlerPos=O,T}this._parseStack.handlers=[];break;case 4:if(y===!1&&O>-1){for(;O>=0&&(T=R[O](),T!==!0);O--)if(T instanceof Promise)return this._parseStack.handlerPos=O,T}this._parseStack.handlers=[];break;case 6:if(A=b[this._parseStack.chunkPos],T=this._dcsParser.unhook(A!==24&&A!==26,y),T)return T;A===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(A=b[this._parseStack.chunkPos],T=this._oscParser.end(A!==24&&A!==26,y),T)return T;A===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let R=M;R<p;++R){switch(A=b[R],L=this._transitions.table[this.currentState<<8|(A<160?A:k)],L>>4){case 2:for(let B=R+1;;++B){if(B>=p||(A=b[B])<32||A>126&&A<k){this._printHandler(b,R,B),R=B-1;break}if(++B>=p||(A=b[B])<32||A>126&&A<k){this._printHandler(b,R,B),R=B-1;break}if(++B>=p||(A=b[B])<32||A>126&&A<k){this._printHandler(b,R,B),R=B-1;break}if(++B>=p||(A=b[B])<32||A>126&&A<k){this._printHandler(b,R,B),R=B-1;break}}break;case 3:this._executeHandlers[A]?this._executeHandlers[A]():this._executeHandlerFb(A),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:R,code:A,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const O=this._csiHandlers[this._collect<<8|A];let F=O?O.length-1:-1;for(;F>=0&&(T=O[F](this._params),T!==!0);F--)if(T instanceof Promise)return this._preserveStack(3,O,F,L,R),T;F<0&&this._csiHandlerFb(this._collect<<8|A,this._params),this.precedingJoinState=0;break;case 8:do switch(A){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(A-48)}while(++R<p&&(A=b[R])>47&&A<60);R--;break;case 9:this._collect<<=8,this._collect|=A;break;case 10:const U=this._escHandlers[this._collect<<8|A];let G=U?U.length-1:-1;for(;G>=0&&(T=U[G](),T!==!0);G--)if(T instanceof Promise)return this._preserveStack(4,U,G,L,R),T;G<0&&this._escHandlerFb(this._collect<<8|A),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|A,this._params);break;case 13:for(let B=R+1;;++B)if(B>=p||(A=b[B])===24||A===26||A===27||A>127&&A<k){this._dcsParser.put(b,R,B),R=B-1;break}break;case 14:if(T=this._dcsParser.unhook(A!==24&&A!==26),T)return this._preserveStack(6,[],0,L,R),T;A===27&&(L|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let B=R+1;;B++)if(B>=p||(A=b[B])<32||A>127&&A<k){this._oscParser.put(b,R,B),R=B-1;break}break;case 6:if(T=this._oscParser.end(A!==24&&A!==26),T)return this._preserveStack(5,[],0,L,R),T;A===27&&(L|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&L}}}c.EscapeSequenceParser=E},6242:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const h=u(5770),S=u(482),f=[];c.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(C,x){this._handlers[C]===void 0&&(this._handlers[C]=[]);const k=this._handlers[C];return k.push(x),{dispose:()=>{const E=k.indexOf(x);E!==-1&&k.splice(E,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].start();else this._handlerFb(this._id,"START")}_put(C,x,k){if(this._active.length)for(let E=this._active.length-1;E>=0;E--)this._active[E].put(C,x,k);else this._handlerFb(this._id,"PUT",(0,S.utf32ToString)(C,x,k))}start(){this.reset(),this._state=1}put(C,x,k){if(this._state!==3){if(this._state===1)for(;x<k;){const E=C[x++];if(E===59){this._state=2,this._start();break}if(E<48||57<E)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+E-48}this._state===2&&k-x>0&&this._put(C,x,k)}}end(C,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let k=!1,E=this._active.length-1,g=!1;if(this._stack.paused&&(E=this._stack.loopPosition-1,k=x,g=this._stack.fallThrough,this._stack.paused=!1),!g&&k===!1){for(;E>=0&&(k=this._active[E].end(C),k!==!0);E--)if(k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!1,k;E--}for(;E>=0;E--)if(k=this._active[E].end(!1),k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!0,k}else this._handlerFb(this._id,"END",C);this._active=f,this._id=-1,this._state=0}}},c.OscHandler=class{constructor(C){this._handler=C,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(C,x,k){this._hitLimit||(this._data+=(0,S.utf32ToString)(C,x,k),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(C){let x=!1;if(this._hitLimit)x=!1;else if(C&&(x=this._handler(this._data),x instanceof Promise))return x.then((k=>(this._data="",this._hitLimit=!1,k)));return this._data="",this._hitLimit=!1,x}}},8742:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;const u=2147483647;class h{static fromArray(f){const C=new h;if(!f.length)return C;for(let x=Array.isArray(f[0])?1:0;x<f.length;++x){const k=f[x];if(Array.isArray(k))for(let E=0;E<k.length;++E)C.addSubParam(k[E]);else C.addParam(k)}return C}constructor(f=32,C=32){if(this.maxLength=f,this.maxSubParamsLength=C,C>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(C),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new h(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let C=0;C<this.length;++C){f.push(this.params[C]);const x=this._subParamsIdx[C]>>8,k=255&this._subParamsIdx[C];k-x>0&&f.push(Array.prototype.slice.call(this._subParams,x,k))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>u?u:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>u?u:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const C=this._subParamsIdx[f]>>8,x=255&this._subParamsIdx[f];return x-C>0?this._subParams.subarray(C,x):null}getSubParamsAll(){const f={};for(let C=0;C<this.length;++C){const x=this._subParamsIdx[C]>>8,k=255&this._subParamsIdx[C];k-x>0&&(f[C]=this._subParams.slice(x,k))}return f}addDigit(f){let C;if(this._rejectDigits||!(C=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,k=x[C-1];x[C-1]=~k?Math.min(10*k+f,u):f}}c.Params=h},5741:(m,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 S={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(S),h.dispose=()=>this._wrappedAddonDispose(S),h.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let h=-1;for(let S=0;S<this._addons.length;S++)if(this._addons[S]===u){h=S;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:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferApiView=void 0;const h=u(3785),S=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 S.CellData}}},3785:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLineApiView=void 0;const h=u(511);c.BufferLineApiView=class{constructor(S){this._line=S}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(S,f){if(!(S<0||S>=this._line.length))return f?(this._line.loadCell(S,f),f):this._line.loadCell(S,new h.CellData)}translateToString(S,f,C){return this._line.translateToString(S,f,C)}}},8285:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const h=u(8771),S=u(8460),f=u(844);class C extends f.Disposable{constructor(k){super(),this._core=k,this._onBufferChange=this.register(new S.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:(m,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,(S=>h(S.toArray())))}addCsiHandler(u,h){return this.registerCsiHandler(u,h)}registerDcsHandler(u,h){return this._core.registerDcsHandler(u,((S,f)=>h(S,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:(m,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(m,c,u){var h=this&&this.__decorate||function(g,b,p,y){var T,A=arguments.length,L=A<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,p):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(g,b,p,y);else for(var M=g.length-1;M>=0;M--)(T=g[M])&&(L=(A<3?T(L):A>3?T(b,p,L):T(b,p))||L);return A>3&&L&&Object.defineProperty(b,p,L),L},S=this&&this.__param||function(g,b){return function(p,y){b(p,y,g)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const f=u(8460),C=u(844),x=u(5295),k=u(2585);c.MINIMUM_COLS=2,c.MINIMUM_ROWS=1;let E=c.BufferService=class extends C.Disposable{get buffer(){return this.buffers.active}constructor(g){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(g.rawOptions.cols||0,c.MINIMUM_COLS),this.rows=Math.max(g.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(g,this))}resize(g,b){this.cols=g,this.rows=b,this.buffers.resize(g,b),this._onResize.fire({cols:g,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(g,b=!1){const p=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===g.fg&&y.getBg(0)===g.bg||(y=p.getBlankLine(g,b),this._cachedBlankLine=y),y.isWrapped=b;const T=p.ybase+p.scrollTop,A=p.ybase+p.scrollBottom;if(p.scrollTop===0){const L=p.lines.isFull;A===p.lines.length-1?L?p.lines.recycle().copyFrom(y):p.lines.push(y.clone()):p.lines.splice(A+1,0,y.clone()),L?this.isUserScrolling&&(p.ydisp=Math.max(p.ydisp-1,0)):(p.ybase++,this.isUserScrolling||p.ydisp++)}else{const L=A-T+1;p.lines.shiftElements(T+1,L-1,-1),p.lines.set(A,y.clone())}this.isUserScrolling||(p.ydisp=p.ybase),this._onScroll.fire(p.ydisp)}scrollLines(g,b,p){const y=this.buffer;if(g<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else g+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const T=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+g,y.ybase),0),T!==y.ydisp&&(b||this._onScroll.fire(y.ydisp))}};c.BufferService=E=h([S(0,k.IOptionsService)],E)},7994:(m,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(m,c,u){var h=this&&this.__decorate||function(y,T,A,L){var M,R=arguments.length,O=R<3?T:L===null?L=Object.getOwnPropertyDescriptor(T,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(y,T,A,L);else for(var F=y.length-1;F>=0;F--)(M=y[F])&&(O=(R<3?M(O):R>3?M(T,A,O):M(T,A))||O);return R>3&&O&&Object.defineProperty(T,A,O),O},S=this&&this.__param||function(y,T){return function(A,L){T(A,L,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const f=u(2585),C=u(8460),x=u(844),k={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function E(y,T){let A=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(A|=64,A|=y.action):(A|=3&y.button,4&y.button&&(A|=64),8&y.button&&(A|=128),y.action===32?A|=32:y.action!==0||T||(A|=3)),A}const g=String.fromCharCode,b={DEFAULT:y=>{const T=[E(y,!1)+32,y.col+32,y.row+32];return T[0]>255||T[1]>255||T[2]>255?"":`\x1B[M${g(T[0])}${g(T[1])}${g(T[2])}`},SGR:y=>{const T=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${E(y,!0)};${y.col};${y.row}${T}`},SGR_PIXELS:y=>{const T=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${E(y,!0)};${y.x};${y.y}${T}`}};let p=c.CoreMouseService=class extends x.Disposable{constructor(y,T){super(),this._bufferService=y,this._coreService=T,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 A of Object.keys(k))this.addProtocol(A,k[A]);for(const A of Object.keys(b))this.addEncoding(A,b[A]);this.reset()}addProtocol(y,T){this._protocols[y]=T}addEncoding(y,T){this._encodings[y]=T}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const T=this._encodings[this._activeEncoding](y);return T&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(T):this._coreService.triggerDataEvent(T,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,T,A){if(A){if(y.x!==T.x||y.y!==T.y)return!1}else if(y.col!==T.col||y.row!==T.row)return!1;return y.button===T.button&&y.action===T.action&&y.ctrl===T.ctrl&&y.alt===T.alt&&y.shift===T.shift}};c.CoreMouseService=p=h([S(0,f.IBufferService),S(1,f.ICoreService)],p)},6975:function(m,c,u){var h=this&&this.__decorate||function(p,y,T,A){var L,M=arguments.length,R=M<3?y:A===null?A=Object.getOwnPropertyDescriptor(y,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,y,T,A);else for(var O=p.length-1;O>=0;O--)(L=p[O])&&(R=(M<3?L(R):M>3?L(y,T,R):L(y,T))||R);return M>3&&R&&Object.defineProperty(y,T,R),R},S=this&&this.__param||function(p,y){return function(T,A){y(T,A,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const f=u(1439),C=u(8460),x=u(844),k=u(2585),E=Object.freeze({insertMode:!1}),g=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let b=c.CoreService=class extends x.Disposable{constructor(p,y,T){super(),this._bufferService=p,this._logService=y,this._optionsService=T,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)(E),this.decPrivateModes=(0,f.clone)(g)}reset(){this.modes=(0,f.clone)(E),this.decPrivateModes=(0,f.clone)(g)}triggerDataEvent(p,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const T=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&T.ybase!==T.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${p}"`,(()=>p.split("").map((A=>A.charCodeAt(0))))),this._onData.fire(p)}triggerBinaryEvent(p){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${p}"`,(()=>p.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(p))}};c.CoreService=b=h([S(0,k.IBufferService),S(1,k.ILogService),S(2,k.IOptionsService)],b)},9074:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const h=u(8055),S=u(8460),f=u(844),C=u(6106);let x=0,k=0;class E extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new C.SortedList((p=>p?.marker.line)),this._onDecorationRegistered=this.register(new S.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new S.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(p){if(p.marker.isDisposed)return;const y=new g(p);if(y){const T=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),T.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const p of this._decorations.values())p.dispose();this._decorations.clear()}*getDecorationsAtCell(p,y,T){let A=0,L=0;for(const M of this._decorations.getKeyIterator(y))A=M.options.x??0,L=A+(M.options.width??1),p>=A&&p<L&&(!T||(M.options.layer??"bottom")===T)&&(yield M)}forEachDecorationAtCell(p,y,T,A){this._decorations.forEachByKey(y,(L=>{x=L.options.x??0,k=x+(L.options.width??1),p>=x&&p<k&&(!T||(L.options.layer??"bottom")===T)&&A(L)}))}}c.DecorationService=E;class g extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(p){super(),this.options=p,this.onRenderEmitter=this.register(new S.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new S.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=p.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;const h=u(2585),S=u(8343);class f{constructor(...x){this._entries=new Map;for(const[k,E]of x)this.set(k,E)}set(x,k){const E=this._entries.get(x);return this._entries.set(x,k),E}forEach(x){for(const[k,E]of this._entries.entries())x(k,E)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}c.ServiceCollection=f,c.InstantiationService=class{constructor(){this._services=new f,this._services.set(h.IInstantiationService,this)}setService(C,x){this._services.set(C,x)}getService(C){return this._services.get(C)}createInstance(C,...x){const k=(0,S.getServiceDependencies)(C).sort(((b,p)=>b.index-p.index)),E=[];for(const b of k){const p=this._services.get(b.id);if(!p)throw new Error(`[createInstance] ${C.name} depends on UNKNOWN service ${b.id}.`);E.push(p)}const g=k.length>0?k[0].index:x.length;if(x.length!==g)throw new Error(`[createInstance] First service dependency of ${C.name} at position ${g+1} conflicts with ${x.length} static arguments`);return new C(...x,...E)}}},7866:function(m,c,u){var h=this&&this.__decorate||function(g,b,p,y){var T,A=arguments.length,L=A<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,p):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(g,b,p,y);else for(var M=g.length-1;M>=0;M--)(T=g[M])&&(L=(A<3?T(L):A>3?T(b,p,L):T(b,p))||L);return A>3&&L&&Object.defineProperty(b,p,L),L},S=this&&this.__param||function(g,b){return function(p,y){b(p,y,g)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const f=u(844),C=u(2585),x={trace:C.LogLevelEnum.TRACE,debug:C.LogLevelEnum.DEBUG,info:C.LogLevelEnum.INFO,warn:C.LogLevelEnum.WARN,error:C.LogLevelEnum.ERROR,off:C.LogLevelEnum.OFF};let k,E=c.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(g){super(),this._optionsService=g,this._logLevel=C.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),k=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(g){for(let b=0;b<g.length;b++)typeof g[b]=="function"&&(g[b]=g[b]())}_log(g,b,p){this._evalLazyOptionalParams(p),g.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+b,...p)}trace(g,...b){this._logLevel<=C.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,g,b)}debug(g,...b){this._logLevel<=C.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,g,b)}info(g,...b){this._logLevel<=C.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,g,b)}warn(g,...b){this._logLevel<=C.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,g,b)}error(g,...b){this._logLevel<=C.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,g,b)}};c.LogService=E=h([S(0,C.IOptionsService)],E),c.setTraceLogger=function(g){k=g},c.traceCall=function(g,b,p){if(typeof p.value!="function")throw new Error("not supported");const y=p.value;p.value=function(...T){if(k.logLevel!==C.LogLevelEnum.TRACE)return y.apply(this,T);k.trace(`GlyphRenderer#${y.name}(${T.map((L=>JSON.stringify(L))).join(", ")})`);const A=y.apply(this,T);return k.trace(`GlyphRenderer#${y.name} return`,A),A}}},7302:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=void 0;const h=u(8460),S=u(844),f=u(6114);c.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const C=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends S.Disposable{constructor(E){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const g={...c.DEFAULT_OPTIONS};for(const b in E)if(b in g)try{const p=E[b];g[b]=this._sanitizeAndValidateOption(b,p)}catch(p){console.error(p)}this.rawOptions=g,this.options={...g},this._setupOptions(),this.register((0,S.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(E,g){return this.onOptionChange((b=>{b===E&&g(this.rawOptions[E])}))}onMultipleOptionChange(E,g){return this.onOptionChange((b=>{E.indexOf(b)!==-1&&g()}))}_setupOptions(){const E=b=>{if(!(b in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},g=(b,p)=>{if(!(b in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);p=this._sanitizeAndValidateOption(b,p),this.rawOptions[b]!==p&&(this.rawOptions[b]=p,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const p={get:E.bind(this,b),set:g.bind(this,b)};Object.defineProperty(this.options,b,p)}}_sanitizeAndValidateOption(E,g){switch(E){case"cursorStyle":if(g||(g=c.DEFAULT_OPTIONS[E]),!(function(b){return b==="block"||b==="underline"||b==="bar"})(g))throw new Error(`"${g}" is not a valid value for ${E}`);break;case"wordSeparator":g||(g=c.DEFAULT_OPTIONS[E]);break;case"fontWeight":case"fontWeightBold":if(typeof g=="number"&&1<=g&&g<=1e3)break;g=C.includes(g)?g:c.DEFAULT_OPTIONS[E];break;case"cursorWidth":g=Math.floor(g);case"lineHeight":case"tabStopWidth":if(g<1)throw new Error(`${E} cannot be less than 1, value: ${g}`);break;case"minimumContrastRatio":g=Math.max(1,Math.min(21,Math.round(10*g)/10));break;case"scrollback":if((g=Math.min(g,4294967295))<0)throw new Error(`${E} cannot be less than 0, value: ${g}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(g<=0)throw new Error(`${E} cannot be less than or equal to 0, value: ${g}`);break;case"rows":case"cols":if(!g&&g!==0)throw new Error(`${E} must be numeric, value: ${g}`);break;case"windowsPty":g=g??{}}return g}}c.OptionsService=x},2660:function(m,c,u){var h=this&&this.__decorate||function(x,k,E,g){var b,p=arguments.length,y=p<3?k:g===null?g=Object.getOwnPropertyDescriptor(k,E):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(x,k,E,g);else for(var T=x.length-1;T>=0;T--)(b=x[T])&&(y=(p<3?b(y):p>3?b(k,E,y):b(k,E))||y);return p>3&&y&&Object.defineProperty(k,E,y),y},S=this&&this.__param||function(x,k){return function(E,g){k(E,g,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const f=u(2585);let C=c.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const k=this._bufferService.buffer;if(x.id===void 0){const T=k.addMarker(k.ybase+k.y),A={data:x,id:this._nextId++,lines:[T]};return T.onDispose((()=>this._removeMarkerFromLink(A,T))),this._dataByLinkId.set(A.id,A),A.id}const E=x,g=this._getEntryIdKey(E),b=this._entriesWithId.get(g);if(b)return this.addLineToLink(b.id,k.ybase+k.y),b.id;const p=k.addMarker(k.ybase+k.y),y={id:this._nextId++,key:this._getEntryIdKey(E),data:E,lines:[p]};return p.onDispose((()=>this._removeMarkerFromLink(y,p))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(x,k){const E=this._dataByLinkId.get(x);if(E&&E.lines.every((g=>g.line!==k))){const g=this._bufferService.buffer.addMarker(k);E.lines.push(g),g.onDispose((()=>this._removeMarkerFromLink(E,g)))}}getLinkData(x){return this._dataByLinkId.get(x)?.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,k){const E=x.lines.indexOf(k);E!==-1&&(x.lines.splice(E,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};c.OscLinkService=C=h([S(0,f.IBufferService)],C)},8343:(m,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(S){return S[h]||[]},c.createDecorator=function(S){if(c.serviceRegistry.has(S))return c.serviceRegistry.get(S);const f=function(C,x,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(E,g,b){g[u]===g?g[h].push({id:E,index:b}):(g[h]=[{id:E,index:b}],g[u]=g)})(f,C,k)};return f.toString=()=>S,c.serviceRegistry.set(S,f),f}},2585:(m,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 S;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"})(S||(c.LogLevelEnum=S={})),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:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const h=u(8460),S=u(225);class f{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,k,E=!1){return(16777215&x)<<3|(3&k)<<1|(E?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const x=new S.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let k=0,E=0;const g=x.length;for(let b=0;b<g;++b){let p=x.charCodeAt(b);if(55296<=p&&p<=56319){if(++b>=g)return k+this.wcwidth(p);const A=x.charCodeAt(b);56320<=A&&A<=57343?p=1024*(p-55296)+A-56320+65536:k+=this.wcwidth(A)}const y=this.charProperties(p,E);let T=f.extractWidth(y);f.extractShouldJoin(y)&&(T-=f.extractWidth(E)),k+=T,E=y}return k}charProperties(x,k){return this._activeProvider.charProperties(x,k)}}c.UnicodeService=f}},a={};function o(m){var c=a[m];if(c!==void 0)return c.exports;var u=a[m]={exports:{}};return r[m].call(u.exports,u,u.exports,o),u.exports}var v={};return(()=>{var m=v;Object.defineProperty(m,"__esModule",{value:!0}),m.Terminal=void 0;const c=o(9042),u=o(3236),h=o(844),S=o(5741),f=o(8285),C=o(7975),x=o(7090),k=["cols","rows"];class E extends h.Disposable{constructor(b){super(),this._core=this.register(new u.Terminal(b)),this._addonManager=this.register(new S.AddonManager),this._publicOptions={...this._core.options};const p=T=>this._core.options[T],y=(T,A)=>{this._checkReadonlyOptions(T),this._core.options[T]=A};for(const T in this._core.options){const A={get:p.bind(this,T),set:y.bind(this,T)};Object.defineProperty(this._publicOptions,T,A)}}_checkReadonlyOptions(b){if(k.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 x.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const b=this._core.coreService.decPrivateModes;let p="none";switch(this._core.coreMouseService.activeProtocol){case"X10":p="x10";break;case"VT200":p="vt200";break;case"DRAG":p="drag";break;case"ANY":p="any"}return{applicationCursorKeysMode:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:p,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const p in b)this._publicOptions[p]=b[p]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,p=!0){this._core.input(b,p)}resize(b,p){this._verifyIntegers(b,p),this._core.resize(b,p)}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,p,y){this._verifyIntegers(b,p,y),this._core.select(b,p,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,p){this._verifyIntegers(b,p),this._core.selectLines(b,p)}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,p){this._core.write(b,p)}writeln(b,p){this._core.write(b),this._core.write(`\r
83
- `,p)}paste(b){this._core.paste(b)}refresh(b,p){this._verifyIntegers(b,p),this._core.refresh(b,p)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return c}_verifyIntegers(...b){for(const p of b)if(p===1/0||isNaN(p)||p%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const p of b)if(p&&(p===1/0||isNaN(p)||p%1!=0||p<0))throw new Error("This API only accepts positive integers")}}m.Terminal=E})(),v})()))})(_p)),_p.exports}var cL=lL();const N1=250,uL=5e3,I1=1,hL=4e3,dL=4001;function fL(e){const n=new AbortController,r=new TextEncoder;let a=N1,o=null,v=null,m=null,c=!1;const u=()=>{v?.dispose(),v=null},h=(C,x)=>{m={cols:C,rows:x},o?.readyState===I1&&o.send(JSON.stringify({type:"resize",cols:C,rows:x}))},S=async()=>{for(;!n.signal.aborted;){e.onStatus?.("connecting");try{const C=e.fetchTicket??wk,{ticket:x}=await C(e.sessionId,{kind:e.kind,theaterId:e.theaterId,signal:n.signal});if(n.signal.aborted)return;await f(pL(x,e.location),e),a=N1}catch(C){if(n.signal.aborted)return;e.onStatus?.("connecting",C instanceof Error?C.message:String(C))}await mL(a,n.signal),a=Math.min(a*2,uL)}},f=async(C,x)=>{await new Promise((k,E)=>{const g=(x.webSocketFactory??gL)(C);o=g,g.binaryType="arraybuffer",g.onopen=()=>{x.onStatus?.("live"),u(),v=x.terminal.onData(b=>{g.readyState===I1&&g.send(r.encode(b))}),m&&h(m.cols,m.rows)},g.onmessage=b=>{b.data instanceof ArrayBuffer&&x.terminal.write(new Uint8Array(b.data))},g.onerror=()=>{E(new Error("Terminal WebSocket error"))},g.onclose=b=>{u(),o===g&&(o=null);const p=b?.code;p===hL?n.abort():p===dL&&(n.abort(),x.onExit?.()),k()}})};return{start:()=>{c||(c=!0,S())},resize:h,dispose:()=>{n.abort(),u(),e.onStatus?.("closed"),o?.close(),o=null}}}function pL(e,n=window.location){return`${n.protocol==="https:"?"wss":"ws"}://${n.host}/terminal/ws?ticket=${encodeURIComponent(e)}`}function gL(e){return new WebSocket(e)}async function mL(e,n){await new Promise(r=>{const a=()=>{clearTimeout(o),n.removeEventListener("abort",a),r()},o=setTimeout(a,e);n.addEventListener("abort",a)})}const Jw=14,_L={allowProposedApi:!0,convertEol:!0,cursorBlink:!0,cursorStyle:"block",fontFamily:'"Cascadia Code", "Cascadia Mono", "JetBrains Mono Variable", ui-monospace, "SF Mono", Menlo, monospace',fontSize:Jw,lineHeight:1.2},vL=80,bL=120,yL={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)"},SL={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 Lh({sessionId:e,kind:n,theaterId:r,onExit:a,active:o,zoom:v=1}){const{activeTheme:m,terminalRenderer:c}=Ql(),u=z.useRef(null),h=z.useRef(null),S=z.useRef(null),f=z.useRef(null),C=z.useRef(null),[x,k]=z.useState(v),E=z.useRef(a);E.current=a;const g=z.useRef(o);g.current=o;const[b,p]=z.useState("connecting");z.useEffect(()=>{const A=u.current;if(!A)return;let L=!1;const M=new cL.Terminal({..._L,theme:B1(m)});h.current=M;const R=new C3.FitAddon;C.current=R,M.loadAddon(R),M.open(A),M.loadAddon(new T3.Unicode11Addon),M.unicode.activeVersion="11",M.attachCustomKeyEventHandler(q=>q.key==="Enter"&&q.shiftKey?(q.type==="keydown"&&M.input(`
84
- `),!1):!0);const O=fL({sessionId:e,kind:n,theaterId:r,terminal:M,onExit:()=>E.current?.(),onStatus:(q,W)=>{p(W?`${q}: ${W}`:q)}});S.current=O;let F=null;const U=()=>{R.fit(),O.resize(M.cols,M.rows)},G=()=>{U(),M.refresh(0,M.rows-1)},B=()=>{F&&clearTimeout(F),F=setTimeout(()=>{F=null,L||G()},vL)},K=async()=>{await document.fonts?.ready,!L&&(U(),O.start(),g.current!==!1&&M.focus())},te=new ResizeObserver(B);return te.observe(A),K(),()=>{L=!0,te.disconnect(),F&&clearTimeout(F),O.dispose(),h.current=null,S.current=null,C.current=null;try{M.dispose()}catch{}}},[n,e,r]),z.useEffect(()=>{o&&h.current?.focus()},[o]),z.useEffect(()=>{const A=h.current;if(!A)return;let L=!1;if(c==="webgl")try{const M=new oL;f.current=M,M.onContextLoss(()=>{if(!L){try{M.dispose()}catch{}f.current===M&&(f.current=null)}}),A.loadAddon(M)}catch{try{f.current?.dispose()}catch{}f.current=null}return()=>{L=!0;const M=f.current;if(M){f.current=null;try{M.dispose()}catch{}}}},[c,n,e]),z.useEffect(()=>{const A=h.current;A&&(A.options.theme=B1(m))},[m]),z.useEffect(()=>{if(v===x)return;const A=setTimeout(()=>k(v),bL);return()=>clearTimeout(A)},[v,x]),z.useEffect(()=>{const A=h.current,L=C.current;!A||!L||(A.options.fontSize=Jw*x,L.fit(),A.refresh(0,A.rows-1))},[x]);const y=b.startsWith("live"),T=x===1?void 0:{width:`${x*100}%`,height:`${x*100}%`,transform:`scale(${1/x})`,transformOrigin:"0 0"};return d.jsx("section",{className:"terminal-stage","aria-label":n==="shell"?"Shell terminal":"Fleet terminal",children:d.jsxs("div",{className:"terminal-shell",children:[y?null:d.jsxs("div",{className:"terminal-status","aria-live":"polite",children:[d.jsx("span",{className:"terminal-status-dot","aria-hidden":"true"}),b]}),d.jsx("div",{className:"terminal-viewport",children:d.jsx("div",{className:"terminal-canvas",ref:u,style:T})})]})})}function B1(e){return e==="carbon"?SL:yL}function wL({state:e}){const n=z.useRef(null);return e.shellOpen&&n.current===null&&(n.current=document.activeElement),z.useEffect(()=>{if(!e.shellOpen)return;const r=a=>{a.key==="Escape"&&Al()};return window.addEventListener("keydown",r),()=>{window.removeEventListener("keydown",r);const a=n.current;n.current=null,a?.focus?.()}},[e.shellOpen]),e.shellOpen?d.jsxs("div",{className:"shell-overlay",role:"dialog","aria-modal":"true","aria-label":"Shell",children:[d.jsx("button",{type:"button",className:"shell-overlay-scrim",onClick:Al,"aria-label":"Close shell"}),d.jsxs("section",{className:"shell-overlay-card",children:[d.jsxs("header",{className:"shell-overlay-header",children:[d.jsx("span",{className:"shell-overlay-kicker",children:"Free Shell"}),d.jsx("h2",{children:"Local Shell"})]}),d.jsx("button",{type:"button",className:"shell-overlay-close",onClick:Al,"aria-label":"Close shell",children:"×"}),d.jsx("div",{className:"shell-overlay-terminal",children:d.jsx(Lh,{sessionId:Zb,kind:"shell",onExit:Al},Zb)})]})]}):null}const CL="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])",j1="operation-search-listbox",Qw="__unassigned__";function xL({state:e}){const n=Yl(),[r,a]=z.useState(""),[o,v]=z.useState(0),m=z.useRef(null),c=z.useRef(null),u=z.useRef(null),h=z.useRef(new Map),S=z.useMemo(()=>NA(e),[e]),f=z.useMemo(()=>Wk(S,r),[S,r]),C=z.useMemo(()=>Gk(f),[f]),x=z.useMemo(()=>JS(r),[r]),k=$1(o,f.length),E=f[k]?z1(f[k].sessionId):void 0;if(z.useEffect(()=>{if(!e.operationSearchOpen)return;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const p=document.body.style.overflow;return document.body.style.overflow="hidden",window.setTimeout(()=>m.current?.focus(),0),()=>{document.body.style.overflow=p,u.current?.focus()}},[e.operationSearchOpen]),z.useEffect(()=>{if(!e.operationSearchOpen){a(""),v(0);return}v(0)},[e.operationSearchOpen,r]),z.useEffect(()=>{if(!e.operationSearchOpen)return;const p=f[k];p&&h.current.get(p.sessionId)?.scrollIntoView({block:"nearest"})},[k,f,e.operationSearchOpen]),!e.operationSearchOpen)return null;const g=p=>{tm(p),n("/operations"),ep()},b=p=>{if(p.key==="Escape"){p.preventDefault(),ep();return}if(p.key==="ArrowDown"||p.key==="ArrowUp"){p.preventDefault(),v(y=>$1(y+(p.key==="ArrowDown"?1:-1),f.length));return}if(p.key==="Enter"){const y=f[k];if(!y)return;p.preventDefault(),g(y.sessionId);return}p.key==="Tab"&&AL(p,c.current)};return d.jsx("div",{className:"operation-search-overlay",onMouseDown:p=>{p.target===p.currentTarget&&ep()},children:d.jsxs("section",{ref:c,className:"operation-search-card",role:"dialog","aria-modal":"true","aria-label":"Operation quick search",tabIndex:-1,onKeyDown:b,children:[d.jsxs("div",{className:"operation-search-field",children:[d.jsx(RL,{}),d.jsx("input",{ref:m,id:"operation-search-input",type:"search",value:r,onChange:p=>a(p.target.value),placeholder:"Search Operations across Theaters",autoComplete:"off",role:"combobox","aria-expanded":!0,"aria-controls":j1,"aria-activedescendant":E,"aria-autocomplete":"list",spellCheck:!1}),d.jsx("kbd",{children:"esc"})]}),d.jsx("div",{id:j1,className:"operation-search-results",role:"listbox","aria-label":"Operation results",children:C.length>0?C.map(p=>{const y=TL(p.theaterId);return d.jsxs("section",{className:"operation-search-section",role:"group","aria-labelledby":y,children:[d.jsx("h2",{id:y,className:"operation-search-section-heading",children:vp(p.theaterLabel,x)}),p.entries.map(T=>{const A=f.indexOf(T),L=A===k;return d.jsxs("button",{id:z1(T.sessionId),ref:M=>{M?h.current.set(T.sessionId,M):h.current.delete(T.sessionId)},type:"button",className:`operation-search-result ${L?"is-active":""}`,role:"option","aria-selected":L,onMouseEnter:()=>v(A),onClick:()=>g(T.sessionId),children:[d.jsxs("span",{className:"operation-search-result-text",children:[d.jsx("strong",{children:vp(T.operationName,x)}),d.jsx("small",{children:EL(T)})]}),d.jsx("span",{className:"operation-search-theater",children:vp(T.theaterLabel,x)})]},T.sessionId)})]},p.theaterId??Qw)}):d.jsx("p",{className:"operation-search-empty",children:"No matching Operations."})})]})})}function $1(e,n){return n<=0?0:Math.max(0,Math.min(e,n-1))}function EL(e){return[e.cliLabel,e.status].filter(Boolean).join(" · ")}function TL(e){return`operation-search-heading-${eC(e??Qw)}`}function z1(e){return`operation-search-option-${eC(e)}`}function eC(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function vp(e,n){if(n.length===0)return e;const r=[];let a=0;for(;a<e.length;){const o=kL(e,n,a);if(!o){r.push(e.slice(a));break}o.start>a&&r.push(e.slice(a,o.start)),r.push(d.jsx("mark",{children:e.slice(o.start,o.end)},`${o.start}-${o.end}`)),a=o.end}return r}function kL(e,n,r){const a=e.toLocaleLowerCase();let o=null;for(const v of n){const m=a.indexOf(v,r);m!==-1&&(!o||m<o.start)&&(o={start:m,end:m+v.length})}return o}function AL(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(CL)).filter(v=>v.offsetParent!==null);if(r.length===0)return;const a=r[0],o=r[r.length-1];if(e.shiftKey&&document.activeElement===a){e.preventDefault(),o?.focus();return}!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a?.focus())}function RL(){return d.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:d.jsx("path",{d:"m14.2 14.2 3 3M8.9 15.2a6.3 6.3 0 1 1 0-12.6 6.3 6.3 0 0 1 0 12.6Z",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function LL({open:e,title:n,message:r,tone:a="info",onDismiss:o}){return e?d.jsx("div",{className:"app-toast-host",children:d.jsxs("div",{className:`app-toast app-toast--${a}`,role:"status","aria-live":"polite",children:[d.jsx("span",{className:"app-toast-dot","aria-hidden":"true"}),d.jsxs("div",{className:"app-toast-body",children:[d.jsx("p",{className:"app-toast-title",children:n}),r?d.jsx("p",{className:"app-toast-message",children:r}):null]}),o?d.jsx("button",{type:"button",className:"app-toast-close",onClick:o,"aria-label":"Dismiss notification",children:"×"}):null]})}):null}const ML=[{id:"route",label:"Full",title:"Codex view: Full page"},{id:"side",label:"Side",title:"Codex view: Side panel"}];function DL({mode:e,onSelect:n}){return d.jsx("div",{className:"codex-mode-toggle",role:"group","aria-label":"Codex view mode",children:ML.map(r=>d.jsx("button",{type:"button",className:`codex-mode-option ${e===r.id?"is-active":""}`,onClick:()=>n(r.id),"aria-pressed":e===r.id,title:r.title,children:r.label},r.id))})}function OL({state:e}){if(Ui===null)return null;const n=Ui.version===e.version&&e.version?` v${Ui.version}`:"";return d.jsx("button",{type:"button",className:"topbar-whatsnew-button",onMouseDown:r=>r.preventDefault(),onClick:TA,"aria-label":`What's new${n}`,title:`What's new${n}`,children:d.jsx("span",{children:"What's new"})})}const NL=[{to:"/operations",label:"Operation",end:!1,icon:"operations"},{to:"/codex",label:"Codex",end:!1,icon:"codex"}],IL=1400,BL="https://github.com/sbluemin/fleet-harness",jL="https://github.com/sbluemin/fleet-harness/stargazers",$L="https://api.github.com/repos/sbluemin/fleet-harness",cm="fleet-console.github-stars",zL=360*60*1e3;function PL({state:e,codexMode:n}){const r=e.connectionError!==null,a=Di().pathname,o=bh(),v=a.startsWith("/operations"),m=a.startsWith("/codex"),c=a.startsWith("/codex")?d.jsx(H1,{}):a.startsWith("/carrier-settings")?d.jsx(F1,{}):a.startsWith("/settings")?d.jsx(U1,{}):a.startsWith("/operations")?d.jsx(P1,{}):d.jsx(iM,{});return d.jsxs("header",{className:"topbar",children:[d.jsxs("div",{className:"topbar-lead",children:[d.jsxs(Pl,{className:"topbar-brand",to:"/","aria-label":"Welcome으로 이동",children:[d.jsx("span",{className:`topbar-sigil ${r?"is-alert":""}`,"aria-hidden":"true",title:e.connectionError??void 0,children:c}),d.jsxs("h1",{className:"topbar-title",children:["Fleet",d.jsx("span",{className:"topbar-title-thin",children:"Console"})]})]}),d.jsx("span",{className:"topbar-preview-badge",children:"Research Preview"}),d.jsx(KL,{}),d.jsx(OL,{state:e})]}),d.jsx(GL,{state:e}),d.jsxs("div",{className:"topbar-meta",children:[e.updateAvailable?d.jsx(HL,{latestVersion:e.latestVersion}):null,d.jsx("nav",{className:"topbar-nav","aria-label":"주 내비게이션",children:NL.map(u=>d.jsxs(z.Fragment,{children:[d.jsxs(Bu,{to:u.to,end:u.end,className:({isActive:h})=>`topbar-nav-link ${h?"is-active":""}`,children:[d.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:u.icon==="operations"?d.jsx(P1,{}):d.jsx(H1,{})}),d.jsx("span",{children:u.label})]}),u.icon==="operations"&&v?d.jsx(WL,{mode:o}):null,u.icon==="codex"&&m?d.jsx(DL,{mode:n,onSelect:jS}):null]},u.to))}),d.jsxs("button",{type:"button",className:"topbar-shell-button",onMouseDown:u=>u.preventDefault(),onClick:fw,"aria-label":"Shell",title:"Shell (⌘`)",children:[d.jsx(oM,{}),d.jsx("span",{children:"Shell"})]}),d.jsx("button",{type:"button",className:"topbar-shell-button topbar-shortcuts-button",onMouseDown:u=>u.preventDefault(),onClick:EA,"aria-label":"Keyboard shortcuts",title:"Keyboard shortcuts",children:d.jsx(lM,{})}),d.jsxs(Bu,{to:"/carrier-settings",className:({isActive:u})=>`topbar-nav-link ${u?"is-active":""}`,title:"Carrier settings",children:[d.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:d.jsx(F1,{})}),d.jsx("span",{children:"Carriers"})]}),d.jsxs(Bu,{to:"/settings",className:({isActive:u})=>`topbar-nav-link ${u?"is-active":""}`,title:"Settings",children:[d.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:d.jsx(U1,{})}),d.jsx("span",{children:"Settings"})]})]})]})}function HL({latestVersion:e}){const[n,r]=z.useState("idle"),[a,o]=z.useState(null),v=z.useRef(null),m=UL(n,a,e);z.useEffect(()=>()=>{v.current!==null&&window.clearTimeout(v.current)},[]);const c=async()=>{if(!m.disabled){v.current!==null&&(window.clearTimeout(v.current),v.current=null),r("applying"),o(null);try{if((await _k()).status!=="accepted"){r("error"),o("invalid_response");return}r("accepted"),v.current=window.setTimeout(()=>{v.current=null,r("completed")},IL)}catch(u){const h=u instanceof Ge?u.message:"network_error";o(h),r(qL(h)?"blocked":"error")}}};return d.jsx("button",{type:"button",className:`topbar-update-badge topbar-update-badge--${m.tone}`,onClick:c,disabled:m.disabled,title:m.title,"aria-live":"polite",children:m.label})}function UL(e,n,r){const a=r?`최신 버전 ${r}`:"업데이트 가능";return e==="applying"?{label:"요청 중",title:"업데이트 적용 요청을 보내는 중입니다.",tone:"live",disabled:!0}:e==="accepted"?{label:"업데이트 중",title:"서버가 곧 재시작되고 새 창에서 콘솔을 엽니다.",tone:"live",disabled:!0}:e==="completed"?{label:"완료: 새 창에서 계속",title:"새 창에서 재시작된 콘솔을 계속 사용하세요.",tone:"live",disabled:!0}:e==="blocked"?FL(n):e==="error"?{label:"재시도",title:"업데이트 요청에 실패했습니다. 다시 시도할 수 있습니다.",tone:"error",disabled:!1}:{label:"Update available",title:a,tone:"warn",disabled:!1}}function FL(e){return e==="local_channel"?{label:"로컬 빌드",title:"로컬 개발 빌드는 콘솔에서 업데이트하지 않습니다.",tone:"blocked",disabled:!0}:e==="active_terminal_sessions"?{label:"세션 종료 필요",title:"실행 중인 Operation을 종료한 뒤 업데이트하세요.",tone:"blocked",disabled:!1}:e==="update_already_in_progress"?{label:"이미 진행 중",title:"다른 업데이트 적용이 이미 진행 중입니다.",tone:"blocked",disabled:!0}:e==="update_not_available"?{label:"업데이트 없음",title:"서버 재확인 결과 적용할 업데이트가 없습니다.",tone:"blocked",disabled:!0}:{label:"콘솔 준비 안 됨",title:"콘솔이 업데이트를 시작할 준비가 되지 않았습니다. 잠시 뒤 다시 시도하세요.",tone:"error",disabled:!1}}function qL(e){return e==="active_terminal_sessions"||e==="local_channel"||e==="update_already_in_progress"||e==="update_not_available"}function WL({mode:e}){return d.jsxs("div",{className:"operations-mode-toggle",role:"group","aria-label":"Operation view mode",children:[d.jsx("button",{type:"button",className:`operations-mode-option ${e==="canvas"?"is-active":""}`,onClick:()=>Bb("canvas"),"aria-pressed":e==="canvas",title:"Operation mode: Map",children:"Map"}),d.jsx("button",{type:"button",className:`operations-mode-option ${e==="classic"?"is-active":""}`,onClick:()=>Bb("classic"),"aria-pressed":e==="classic",title:"Operation mode: Helm",children:"Helm"})]})}function GL({state:e}){const[n,r]=z.useState(!1),[a,o]=z.useState(!1),v=z.useRef(null),m=z.useRef(null),c=z.useRef(null),u=e.theaters.find(g=>g.id===e.activeTheaterId)??null,h=u?.label??(e.theaters.length===0?"No Theaters":"Theater");z.useEffect(()=>{if(!n)return;const g=p=>{v.current?.contains(p.target)||r(!1)},b=p=>{p.key==="Escape"&&(r(!1),m.current?.focus())};return document.addEventListener("mousedown",g),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",b)}},[n]),z.useEffect(()=>{if(!n)return;const g=c.current;if(!g)return;(g.querySelector('[data-active="true"]')??g.querySelector("[role^='menuitem']"))?.focus()},[n]);const S=g=>{mA(g),r(!1),m.current?.focus()},f=async()=>{r(!1),o(!0)},C=()=>{o(!1),_A()},x=async g=>{o(!1),hw();try{const b=await WS(g),p=await qS(b);dw(p)}catch(b){sg(b instanceof Error?b.message:String(b))}},k=async()=>{if(u){r(!1);try{await yk(u.id),n1(u.id)}catch(g){if(g instanceof Ge&&g.status===404){n1(u.id);return}sg(g instanceof Error?g.message:String(g))}}},E=g=>{if(g.key!=="ArrowDown"&&g.key!=="ArrowUp")return;g.preventDefault();const b=Array.from(c.current?.querySelectorAll("[role^='menuitem']")??[]);if(b.length===0)return;const p=b.indexOf(document.activeElement),y=g.key==="ArrowDown"?1:-1,T=(p+y+b.length)%b.length;b[T]?.focus()};return d.jsxs("div",{className:"theater-control",ref:v,children:[d.jsx("span",{className:"theater-eyebrow","aria-hidden":"true",children:"Theater"}),d.jsxs("button",{type:"button",ref:m,className:`theater-trigger ${n?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":n,"aria-label":"Theater",title:u?.label??e.theaterError??void 0,onClick:()=>r(g=>!g),children:[d.jsx("span",{className:"theater-trigger-sigil","aria-hidden":"true",children:d.jsx(QL,{})}),d.jsx("span",{className:"theater-trigger-label",children:h}),d.jsx("span",{className:"theater-trigger-caret","aria-hidden":"true",children:d.jsx(eM,{})})]}),n?d.jsxs("div",{className:"theater-menu",role:"menu","aria-label":"Theater",ref:c,onKeyDown:E,children:[e.theaters.length>0?d.jsx("ul",{className:"theater-menu-list",children:e.theaters.map(g=>{const b=g.id===e.activeTheaterId;return d.jsx("li",{children:d.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":b,"data-active":b?"true":void 0,className:`theater-menu-item ${b?"is-active":""}`,title:g.label,onClick:()=>S(g.id),children:[d.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:b?d.jsx(tM,{}):null}),d.jsx("span",{className:"theater-menu-label",children:g.label})]})},g.id)})}):d.jsx("p",{className:"theater-menu-empty",children:"No Theaters yet."}),d.jsx("div",{className:"theater-menu-divider",role:"separator"}),u?d.jsxs(d.Fragment,{children:[d.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-forget",onClick:k,children:[d.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:d.jsx(nM,{})}),d.jsx("span",{className:"theater-menu-label",children:"Forget Theater"})]}),d.jsx("div",{className:"theater-menu-divider",role:"separator"})]}):null,d.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-add",disabled:e.addingTheater,onClick:f,children:[d.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:d.jsx(rM,{})}),d.jsx("span",{className:"theater-menu-label",children:e.addingTheater?"Adding Theater…":"Add Theater…"})]}),e.theaterError?d.jsx("p",{className:"theater-menu-error",children:e.theaterError}):null]}):null,d.jsx(ww,{open:a,onCancel:C,onConfirm:x})]})}function KL(){const e=VL(),n=e.count!==null;return d.jsxs("div",{className:"topbar-github",role:"group","aria-label":"GitHub",children:[d.jsx("a",{className:"topbar-github-link",href:BL,target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub 저장소 열기",title:"GitHub 저장소",children:d.jsx(sM,{})}),d.jsxs("a",{className:"topbar-github-stars",href:jL,target:"_blank",rel:"noopener noreferrer","aria-label":n?`GitHub 스타 ${e.count.toLocaleString()}개 — 스타 누르기`:"GitHub에서 스타 누르기",title:"GitHub에서 스타 누르기",children:[d.jsx(aM,{}),n?d.jsx("span",{className:"topbar-github-stars-count",children:JL(e.count)}):null]})]})}function VL(){const[e,n]=z.useState(()=>{const r=YL();return r===null?{count:null,status:"idle"}:{count:r,status:"ready"}});return z.useEffect(()=>{if(XL())return;let r=!1;return n(a=>a.status==="ready"?a:{...a,status:"loading"}),fetch($L,{headers:{Accept:"application/vnd.github+json"}}).then(a=>a.ok?a.json():Promise.reject(new Error(`status ${a.status}`))).then(a=>{if(r)return;const o=typeof a.stargazers_count=="number"?a.stargazers_count:null;if(o===null){n(v=>({count:v.count,status:v.count===null?"error":"ready"}));return}ZL(o),n({count:o,status:"ready"})}).catch(()=>{r||n(a=>({count:a.count,status:a.count===null?"error":"ready"}))}),()=>{r=!0}},[]),e}function YL(){try{const e=window.localStorage.getItem(cm);if(!e)return null;const n=JSON.parse(e);return typeof n.count=="number"?n.count:null}catch{return null}}function XL(){try{const e=window.localStorage.getItem(cm);if(!e)return!1;const n=JSON.parse(e);return typeof n.at=="number"&&Date.now()-n.at<zL}catch{return!1}}function ZL(e){try{window.localStorage.setItem(cm,JSON.stringify({count:e,at:Date.now()}))}catch{}}function JL(e){if(e<1e3)return String(e);const n=e/1e3;return n<10?`${n.toFixed(1)}k`:`${Math.round(n)}k`}function QL(){return d.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[d.jsx("circle",{cx:"8",cy:"3.2",r:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),d.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 eM(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M4.5 6.5 8 10l3.5-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function tM(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.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 nM(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M4.7 4.7 11.3 11.3M11.3 4.7 4.7 11.3",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})})}function iM(){return d.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16",children:[d.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"}),d.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 P1(){return d.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[d.jsx("circle",{cx:"8",cy:"8",r:"5.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),d.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"}),d.jsx("circle",{cx:"8",cy:"8",r:"1.1",fill:"currentColor"})]})}function H1(){return d.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("circle",{cx:"12",cy:"12",r:"9"}),d.jsx("circle",{cx:"12",cy:"12",r:"3.2",fill:"currentColor",stroke:"none",opacity:"0.16"}),d.jsx("path",{d:"M12 3v3.6M12 17.4V21M3 12h3.6M17.4 12H21"}),d.jsx("path",{d:"M12 8.6 14.2 12 12 15.4 9.8 12Z",fill:"currentColor",stroke:"none"})]})}function U1(){return d.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[d.jsx("path",{d:"M3 4.4h10M3 8h10M3 11.6h10",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),d.jsx("circle",{cx:"6.2",cy:"4.4",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),d.jsx("circle",{cx:"10",cy:"8",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),d.jsx("circle",{cx:"7.4",cy:"11.6",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"})]})}function F1(){return d.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[d.jsx("circle",{cx:"4",cy:"4.2",r:"1.15",fill:"currentColor"}),d.jsx("circle",{cx:"4",cy:"8",r:"1.15",fill:"currentColor"}),d.jsx("circle",{cx:"4",cy:"11.8",r:"1.15",fill:"currentColor"}),d.jsx("path",{d:"M7.2 4.2h6M7.2 8h6M7.2 11.8h6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function rM(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function sM(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{fill:"currentColor",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.65 7.65 0 0 1 2-.27c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}function aM(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M8 2.2 9.41 6.26 13.71 6.35 10.28 8.94 11.53 13.05 8 10.6 4.47 13.05 5.72 8.94 2.29 6.35 6.59 6.26Z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function oM(){return d.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[d.jsx("path",{d:"M2.8 4.2h10.4v7.6H2.8z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),d.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 lM(){return d.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[d.jsx("rect",{x:"2.4",y:"4.1",width:"11.2",height:"7.8",rx:"1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),d.jsx("path",{d:"M4.5 6.3h.1M6.8 6.3h.1M9.1 6.3h.1M11.4 6.3h.1M4.5 8.2h.1M6.8 8.2h.1M9.1 8.2h.1M11.4 8.2h.1M5.8 10.1h4.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}const cM=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function uM({state:e}){const n=z.useRef(null),r=z.useRef(null),a=z.useRef(null),o=!e.bootstrapped||e.onboardingOpen||e.shellOpen||e.operationSearchOpen||e.shortcutsOpen||e.timelineOpen;return e.whatsNewOpen&&!o&&n.current===null&&(n.current=document.activeElement),z.useEffect(()=>{if(!e.whatsNewOpen||o)return;const v=m=>{m.key==="Escape"?(m.preventDefault(),mu()):m.key==="Tab"&&dM(m,a.current),m.stopImmediatePropagation()};return r.current?.focus(),window.addEventListener("keydown",v,!0),()=>{window.removeEventListener("keydown",v,!0);const m=n.current;n.current=null,m?.focus?.()}},[e.whatsNewOpen,o]),!e.whatsNewOpen||o||Ui===null?null:d.jsxs("div",{className:"whatsnew-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"whatsnew-title",children:[d.jsx("button",{type:"button",className:"whatsnew-scrim",onClick:mu,"aria-label":"Close What's new"}),d.jsxs("section",{className:"whatsnew-card",ref:a,children:[d.jsxs("header",{className:"whatsnew-header",children:[d.jsxs("div",{className:"whatsnew-heading-row",children:[d.jsx("h2",{id:"whatsnew-title",children:"What's new"}),d.jsxs("span",{className:"whatsnew-version-badge",children:["v",Ui.version]})]}),d.jsxs("time",{className:"whatsnew-date",dateTime:Ui.date,children:["Released ",Ui.date]})]}),d.jsx("button",{ref:r,type:"button",className:"whatsnew-close",onClick:mu,"aria-label":"Close What's new",children:"x"}),d.jsx("div",{className:"whatsnew-body",children:Ui.sections.map((v,m)=>d.jsx(hM,{section:v,index:m},v.heading))}),d.jsx("footer",{className:"whatsnew-footer",children:d.jsx("button",{type:"button",className:"whatsnew-done",onClick:mu,children:"Close"})})]})]})}function hM({section:e,index:n}){const r=e.heading.toLowerCase().replaceAll(" ","-"),a={"--whatsnew-delay":`${n*55}ms`};return d.jsxs("section",{className:`whatsnew-section whatsnew-section--${r}`,style:a,children:[d.jsx("h3",{children:d.jsx("span",{className:"whatsnew-section-chip",children:e.heading})}),d.jsx("ul",{children:e.items.map(o=>d.jsx("li",{children:o},o))})]})}function dM(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(cM)),a=r[0],o=r[r.length-1];!a||!o||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a.focus()))}const fM=new Set(["idle_prompt","permission_prompt","auth_success","elicitation_dialog","elicitation_complete","elicitation_response"]);function pM(){let e="";return n=>{e+=n;const r=[];let a=e.indexOf(`
85
-
86
- `);for(;a>=0;){const o=e.slice(0,a);e=e.slice(a+2);const v=mM(o);v&&r.push(v),a=e.indexOf(`
87
-
88
- `)}return r}}function gM(e){if(!e.data)return null;let n;try{n=JSON.parse(e.data)}catch{return null}if(e.event==="observer:truncated"){const a=n.tenant?.tenantId;return!a||!n.truncation?null:{kind:"truncation",tenantId:a,tenantLabel:n.tenant?.tenantLabel,truncation:n.truncation}}if(e.event==="session:updated"){const a=W1(n.session);return a?{kind:"session",tenantId:a.tenantId??a.sessionId,session:a}:null}if(e.event==="session:attention"){const a=W1(n.session);return a?{kind:"attention",tenantId:a.tenantId??a.sessionId,session:a,reason:_M(n.reason)}:null}const r=q1(n.event)??q1(n);return r?{kind:"event",tenantId:r.tenantId,tenantLabel:n.tenant?.tenantLabel,event:r}:null}function mM(e){const n=e.split(`
89
- `),r=n.find(o=>o.startsWith("event:"))?.slice(6).trim()??"message",a=n.filter(o=>o.startsWith("data:")).map(o=>o.slice(5).trim()).join(`
90
- `);return!a&&r==="message"?null:{event:r,data:a}}function q1(e){if(typeof e!="object"||e===null)return null;const n=e;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 W1(e){if(typeof e!="object"||e===null)return null;const n=e;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||"providerSession"in n||"ticket"in n||"token"in n||"transcriptPath"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,cliId:typeof n.cliId=="string"?n.cliId:void 0,cliLabel:typeof n.cliLabel=="string"?n.cliLabel:void 0,status:n.status,turnState:n.turnState==="running"||n.turnState==="ended"?n.turnState:"none",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,resumeAvailable:n.resumeAvailable===!0}}function _M(e){return typeof e=="string"&&fM.has(e)?e:void 0}const G1=250,vM=5e3;function bM(){const e=new AbortController;return yM(e.signal),()=>e.abort()}async function yM(e){let n=G1,r=!1;const a=async()=>{if(!r){r=!0;try{pw(await HS(e))}catch{}finally{r=!1}}};for(;!e.aborted;){ze({connection:"connecting"});try{await wM(e);const o=await mk(e);ze({connection:"live",connectionError:null}),n=G1,await SM(o,e,a),e.aborted||ze({connection:"connecting",connectionError:null})}catch(o){if(e.aborted)return;ze({connection:"connecting",connectionError:o instanceof Error?o.message:String(o)})}if(e.aborted)return;await CM(n,e),n=Math.min(n*2,vM)}}async function SM(e,n,r){const a=new TextDecoder,o=pM();for(;!n.aborted;){const v=await e.read();if(v.done)return;for(const m of o(a.decode(v.value,{stream:!0}))){const c=gM(m);if(c){if(c.kind==="truncation"&&c.truncation){LA(c.tenantId,c.tenantLabel,c.truncation);continue}if(c.kind==="session"&&c.session){Cs(c.session);continue}if(c.kind==="attention"&&c.session){yA(c.session,c.reason);continue}if(c.event){const{unknownTenant:u}=RA(c.event,c.tenantLabel);u&&r()}}}}}async function wM(e){const[n,r]=await Promise.all([HS(e),gk(e)]);pw(n),AA(r)}async function CM(e,n){await new Promise(r=>{const a=()=>{clearTimeout(o),n.removeEventListener("abort",a),r()},o=setTimeout(a,e);n.addEventListener("abort",a)})}const xM=new Set(["token","credential","cwd","path","persona","prompt","toolAllowlist","allowedExecutorTools"]);async function tC(e){const n=await fetch("/carrier-settings/state",{signal:e});return await um(n),nC(await n.json(),n.status)}async function EM(e){const n=await fetch("/carrier-settings/options",{signal:e});return await um(n),MM(await n.json(),n.status)}async function TM(e,n,r){return bo(`/carrier-settings/carriers/${encodeURIComponent(e)}/cli`,"PUT",{cliType:n},r)}async function kM(e,n,r){return bo(`/carrier-settings/carriers/${encodeURIComponent(e)}/model`,"PUT",n,r)}async function AM(e,n,r){return bo(`/carrier-settings/carriers/${encodeURIComponent(e)}/display-name`,"PATCH",{displayName:n},r)}async function K1(e,n,r){return bo(`/carrier-settings/carriers/${encodeURIComponent(e)}/agent-mode`,"PUT",{agentMode:n},r)}async function RM(e,n,r,a){return bo(`/carrier-settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(n)}`,"PUT",r,a)}async function LM(e,n,r){return bo(`/carrier-settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(n)}`,"DELETE",{},r)}async function bo(e,n,r,a){const o=await fetch(e,{method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(r),signal:a});await um(o);const v=await o.json();if(!v||typeof v!="object"||!("state"in v))throw new Ge(o.status,"Invalid carrier settings mutation response");return{state:nC(v.state,o.status)}}async function um(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Ge(e.status,n)}function nC(e,n){iC(e,n);const r=e;if(!r||typeof r.generation!="number"||!Array.isArray(r.carriers))throw new Ge(n,"Invalid carrier settings state response");return{generation:r.generation,carriers:r.carriers.map(a=>DM(a,n))}}function MM(e,n){iC(e,n);const r=e;if(!r||!Array.isArray(r.cliTypes)||!r.taskForceConstraints||typeof r.taskForceConstraints.minBackends!="number")throw new Ge(n,"Invalid carrier settings options response");return{cliTypes:r.cliTypes.map(a=>OM(a,n)),taskForceConstraints:{minBackends:r.taskForceConstraints.minBackends}}}function DM(e,n){const r=e;if(!r||typeof r.carrierId!="string"||typeof r.displayName!="string"||typeof r.sourceDisplayName!="string"||typeof r.role!="string"||typeof r.roleDescription!="string"||typeof r.slot!="number"||typeof r.cliType!="string"||typeof r.defaultCliType!="string"||typeof r.model!="string"||r.effort!==void 0&&typeof r.effort!="string"||r.agentMode!=="cli"&&r.agentMode!=="subagent"||typeof r.subagentMode!="boolean"||typeof r.taskForceBackendCount!="number"||!r.taskforce||!Array.isArray(r.taskforce.backends))throw new Ge(n,"Invalid carrier settings carrier response");return{carrierId:r.carrierId,displayName:r.displayName,sourceDisplayName:r.sourceDisplayName,role:r.role,roleDescription:r.roleDescription,...r.category?{category:r.category}:{},slot:r.slot,cliType:r.cliType,defaultCliType:r.defaultCliType,model:r.model,...r.effort?{effort:r.effort}:{},agentMode:r.agentMode,subagentMode:r.subagentMode,taskForceBackendCount:r.taskForceBackendCount,taskforce:{backends:r.taskforce.backends.map(a=>IM(a,n))}}}function OM(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.displayName!="string"||typeof r.supportsSubagent!="boolean"||!Array.isArray(r.models)||typeof r.defaultModel!="string")throw new Ge(n,"Invalid carrier settings CLI option");return{id:r.id,displayName:r.displayName,supportsSubagent:r.supportsSubagent,models:r.models.map(a=>NM(a,n)),defaultModel:r.defaultModel}}function NM(e,n){const r=e;if(!r||typeof r.modelId!="string"||typeof r.name!="string")throw new Ge(n,"Invalid carrier settings model option");if(r.effort!==void 0&&(!Array.isArray(r.effort.levels)||typeof r.effort.default!="string"))throw new Ge(n,"Invalid carrier settings effort option");return{modelId:r.modelId,name:r.name,...r.effort?{effort:{levels:r.effort.levels.filter(a=>typeof a=="string"),default:r.effort.default}}:{}}}function IM(e,n){const r=e;if(!r||typeof r.cliType!="string"||typeof r.model!="string"||r.effort!==void 0&&typeof r.effort!="string")throw new Ge(n,"Invalid carrier settings Task Force backend");return{cliType:r.cliType,model:r.model,...r.effort?{effort:r.effort}:{}}}function iC(e,n){const r=[e];for(;r.length>0;){const a=r.pop();if(!(!a||typeof a!="object"))for(const[o,v]of Object.entries(a)){if(xM.has(o))throw new Ge(n,"Carrier settings response leaked a restricted field");v&&typeof v=="object"&&r.push(v)}}}const BM={cliType:"",model:"",effort:"",displayName:"",agentMode:"cli",taskforce:{}},dg=new Set;let Rn={loading:!1,state:null,options:null,activeCarrierId:null,draft:BM,savingActionId:null,error:null};function rC(){return z.useSyncExternalStore(jM,V1,V1)}function V1(){return Rn}function jM(e){return dg.add(e),()=>{dg.delete(e)}}async function Y1(e){tr({loading:!0,error:null});try{const[n,r]=await Promise.all([tC(e),EM(e)]);sC(n,r)}catch(n){if(e?.aborted)return;tr({loading:!1,error:oC(n)})}}function $M(e){const n=Rn.state?.carriers.find(r=>r.carrierId===e);tr({activeCarrierId:e,draft:n?hm(n,Rn.options):Rn.draft,error:null})}function Xs(e){tr({draft:{...Rn.draft,...e},error:null})}function fg(e,n){const r=Rn.draft.taskforce[e]??{model:"",effort:""};tr({draft:{...Rn.draft,taskforce:{...Rn.draft.taskforce,[e]:{...r,...n}}},error:null})}function zM(){const e=aC();e&&tr({draft:hm(e,Rn.options),error:null})}async function PM(e){const n=aC();return n?HM("save-all",async()=>{const r=Rn.draft;let a=null;r.displayName!==n.displayName&&(a=(await AM(n.carrierId,r.displayName)).state);const o=r.cliType!==n.cliType;return o&&(a=(await TM(n.carrierId,r.cliType)).state),(o||r.model!==n.model||(r.effort||"")!==(n.effort||""))&&(a=(await kM(n.carrierId,FM(r))).state),r.agentMode==="subagent"?(n.agentMode!=="subagent"||n.taskForceBackendCount>0)&&(a=(await K1(n.carrierId,"subagent")).state):(n.agentMode!=="cli"&&(a=(await K1(n.carrierId,"cli")).state),a=await qM(n,e,a)),{state:a??await tC()}}):!1}function sC(e,n){const r=WM(e,Rn.activeCarrierId),a=e.carriers.find(o=>o.carrierId===r)??null;tr({loading:!1,state:e,options:n,activeCarrierId:r,draft:a?hm(a,n):Rn.draft,error:null})}async function HM(e,n){tr({savingActionId:e,error:null});try{const r=await n();return sC(r.state,Rn.options??{cliTypes:[],taskForceConstraints:{minBackends:2}}),tr({savingActionId:null}),!0}catch(r){return tr({savingActionId:null,error:oC(r)}),!1}}function hm(e,n){const r=Object.fromEntries((n?.cliTypes??[]).map(a=>{const o=e.taskforce.backends.find(v=>v.cliType===a.id);return[a.id,{model:o?.model??a.defaultModel,effort:o?.effort??UM(a.id,o?.model??a.defaultModel,n)??""}]}));return{cliType:e.cliType,model:e.model,effort:e.effort??"",displayName:e.displayName,agentMode:e.agentMode,taskforce:r}}function UM(e,n,r){return r?.cliTypes.find(v=>v.id===e)?.models.find(v=>v.modelId===n)?.effort?.default??null}function FM(e){return{model:e.model,...e.effort?{effort:e.effort}:{}}}function aC(){return Rn.state?.carriers.find(e=>e.carrierId===Rn.activeCarrierId)??null}async function qM(e,n,r){const a=new Set(n.map(o=>o.cliType));for(const o of e.taskforce.backends)a.has(o.cliType)||(r=(await LM(e.carrierId,o.cliType)).state);for(const o of n){const v=e.taskforce.backends.find(m=>m.cliType===o.cliType);v&&v.model===o.model&&(v.effort||"")===(o.effort||"")||(r=(await RM(e.carrierId,o.cliType,{model:o.model,...o.effort?{effort:o.effort}:{}})).state)}return r}function WM(e,n){return n&&e.carriers.some(r=>r.carrierId===n)?n:e.carriers[0]?.carrierId??null}function tr(e){Rn={...Rn,...e};for(const n of dg)n()}function oC(e){return e instanceof Error?e.message:String(e)}const GM=50,KM=2400,VM={nimitz:"var(--captain-nimitz)",kirov:"var(--captain-kirov)",genesis:"var(--captain-genesis)",ohio:"var(--captain-ohio)",sentinel:"var(--captain-sentinel)",vanguard:"var(--captain-vanguard)",tempest:"var(--captain-tempest)",chronicle:"var(--captain-chronicle)"};function YM(){const e=rC(),n=e.state?.carriers.find(p=>p.carrierId===e.activeCarrierId)??null,r=e.options?.cliTypes.find(p=>p.id===e.draft.cliType)??null,a=r?.models.find(p=>p.modelId===e.draft.model)??null,[o,v]=z.useState(!1),[m,c]=z.useState([]),[u,h]=z.useState("idle"),S=m.length>0,f=e.draft.agentMode==="subagent",C=e.draft.agentMode==="subagent",x=e.savingActionId==="save-all",k=n?t6(n,e.draft,m):!1,E=n?.taskforce.backends.map(p=>`${p.cliType}:${p.model}:${p.effort??""}`).join("|")??"";z.useEffect(()=>{const p=new AbortController;return Y1(p.signal),()=>p.abort()},[]),z.useEffect(()=>{v(!1),c(n?.taskforce.backends.map(p=>p.cliType)??[]),h("idle")},[n?.carrierId,E]),z.useEffect(()=>{if(u!=="saved")return;const p=window.setTimeout(()=>h("idle"),KM);return()=>window.clearTimeout(p)},[u]);function g(){n&&(zM(),c(n.taskforce.backends.map(p=>p.cliType)),v(!1),h("idle"))}async function b(){if(!n)return;if(h("saving"),!await PM(i6(m,e.draft.taskforce))){h("idle");return}v(!1),h("saved")}return d.jsxs("main",{className:"carrier-settings-page",children:[d.jsxs("section",{className:"carrier-settings-hero","aria-labelledby":"carrier-settings-title",children:[d.jsxs("div",{children:[d.jsx("p",{className:"bridge-kicker",children:"Carrier Control Surface"}),d.jsx("h2",{id:"carrier-settings-title",children:"Carrier Settings"})]}),d.jsxs("div",{className:"carrier-settings-hero-actions",children:[d.jsx("div",{className:`carrier-settings-save-status ${u==="saved"?"is-positive":""}`,role:"status","aria-live":"polite",children:u==="saving"||x?"Saving…":u==="saved"?"Saved ✓":""}),n?d.jsxs("div",{className:"carrier-settings-save-actions",children:[d.jsx("button",{type:"button",className:`carrier-settings-action-button ${k?"is-dirty":""}`,disabled:!k||x,onClick:()=>{b()},children:"Save"}),d.jsx("button",{type:"button",className:`carrier-settings-action-button ${k?"is-dirty":""}`,disabled:!k||x,onClick:g,children:"Discard"})]}):null,d.jsx("button",{type:"button",className:"carrier-settings-action-button carrier-settings-hero-refresh",disabled:e.loading,onClick:()=>{Y1()},children:"Refresh"})]})]}),e.error?d.jsx("p",{className:"carrier-settings-error",role:"alert",children:e.error}):null,d.jsxs("section",{className:"carrier-settings-grid",children:[d.jsxs("div",{className:"carrier-settings-list","aria-label":"Carrier list",children:[e.loading&&!e.state?d.jsx("p",{className:"carrier-settings-empty",children:"Loading carrier settings."}):null,e.state&&e.state.carriers.length===0?d.jsx("p",{className:"carrier-settings-empty",children:"No carriers registered."}):null,e.state?.carriers.map(p=>d.jsx(XM,{carrier:p,active:p.carrierId===e.activeCarrierId,minBackends:e.options?.taskForceConstraints.minBackends??2,onSelect:()=>$M(p.carrierId)},p.carrierId))]}),n&&e.options&&r?d.jsxs("div",{className:"carrier-settings-detail",style:uC(n.carrierId),children:[d.jsxs("div",{className:"carrier-settings-detail-head",children:[d.jsxs("div",{className:"carrier-settings-detail-title-block",children:[d.jsxs("div",{className:"carrier-settings-captain-id",children:[d.jsx("span",{children:"Captain"})," · ",n.carrierId.toUpperCase()]}),d.jsx("div",{className:`carrier-settings-name-line ${o?"is-editing":""}`,children:o?d.jsxs(d.Fragment,{children:[d.jsx("input",{id:"carrier-display-name",className:"carrier-settings-input carrier-settings-name-input",value:e.draft.displayName,maxLength:GM,onChange:p=>Xs({displayName:p.target.value})}),d.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Save display name",disabled:x,onClick:()=>{v(!1)},children:d.jsx(s6,{})}),d.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Cancel display name edit",onClick:()=>{Xs({displayName:n.displayName}),v(!1)},children:d.jsx(a6,{})})]}):d.jsxs(d.Fragment,{children:[d.jsx("h3",{className:"carrier-settings-captain-name",children:n.displayName}),d.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Edit display name",onClick:()=>{Xs({displayName:n.displayName}),v(!0)},children:d.jsx(r6,{})})]})}),d.jsx("div",{className:"carrier-settings-captain-role",children:n.role})]}),d.jsxs("div",{className:"carrier-settings-cli-badge",children:[d.jsx("span",{className:"ind","aria-hidden":"true"}),n.cliType]})]}),d.jsxs("div",{className:"carrier-settings-body",children:[d.jsxs("div",{className:"carrier-settings-control-group",children:[d.jsx("div",{className:"carrier-settings-resp-title",children:"Identity"}),d.jsxs("div",{className:"carrier-settings-mission",children:['"',n.roleDescription,'"']})]}),d.jsxs("div",{className:"carrier-settings-control-group",children:[d.jsx("div",{className:"carrier-settings-resp-title",children:"Runtime"}),d.jsxs("div",{className:"carrier-settings-runtime",children:[d.jsx("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--cli",children:d.jsxs("div",{className:"carrier-settings-field carrier-settings-field--wide",children:[d.jsx("label",{className:"carrier-settings-label",htmlFor:"carrier-cli",children:"CLI"}),d.jsx("select",{id:"carrier-cli",className:"carrier-settings-select",value:e.draft.cliType,onChange:p=>JM(p.target.value,e.options?.cliTypes??[]),children:e.options.cliTypes.map(p=>d.jsx("option",{value:p.id,children:p.displayName},p.id))})]})}),d.jsxs("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--model",children:[d.jsx(lC,{id:"carrier-model",label:"Model",models:r.models,value:e.draft.model,onChange:p=>QM(r,p)}),d.jsx(cC,{id:"carrier-effort",model:a,value:e.draft.effort,onChange:p=>Xs({effort:p})})]})]})]}),d.jsx("div",{className:"carrier-settings-control-group",children:d.jsxs("div",{className:"carrier-settings-toggle-row",children:[d.jsxs("div",{children:[d.jsx("p",{className:"carrier-settings-resp-title",children:"SubAgent"}),d.jsx("p",{className:"carrier-settings-help",children:S?"Task Force draft is present. Remove every backend to enable SubAgent.":r.supportsSubagent?"Enabling SubAgent clears Task Force backends when saved.":"This CLI does not support SubAgent mode."})]}),d.jsx("button",{type:"button",className:`carrier-settings-toggle ${f?"is-on":""}`,disabled:x||!f&&(!r.supportsSubagent||S),"aria-pressed":f,onClick:()=>Xs({agentMode:f?"cli":"subagent"}),children:d.jsx("span",{children:f?"On":"Off"})})]})}),d.jsx(ZM,{carrier:n,cliOptions:e.options.cliTypes,minBackends:e.options.taskForceConstraints.minBackends,savingActionId:e.savingActionId,rows:m,disabled:C,onRowsChange:c})]})]},n.carrierId):d.jsx("div",{className:"carrier-settings-detail",children:d.jsx("p",{className:"carrier-settings-empty",children:"Select a carrier."})})]})]})}function XM({carrier:e,active:n,minBackends:r,onSelect:a}){const o=e.taskForceBackendCount>=r;return d.jsxs("button",{type:"button",className:`carrier-settings-row ${n?"is-active":""}`,style:uC(e.carrierId),onClick:a,children:[d.jsx("span",{className:"carrier-settings-captain-dot","aria-hidden":"true"}),d.jsxs("span",{className:"carrier-settings-row-text",children:[d.jsx("span",{className:"carrier-settings-row-name",children:e.displayName}),d.jsx("span",{className:"carrier-settings-row-role",children:e.role})]}),d.jsxs("span",{className:"carrier-settings-row-live","aria-hidden":"true",children:[d.jsx("span",{className:`carrier-settings-live-dot ${e.subagentMode?"is-live":""}`}),d.jsx("span",{className:`carrier-settings-live-dot ${o?"is-live":""}`})]})]})}function lC({id:e,label:n,models:r,value:a,disabled:o=!1,onChange:v}){return d.jsxs("div",{className:"carrier-settings-field",children:[d.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:n}),d.jsx("select",{id:e,className:"carrier-settings-select",value:a,disabled:o,onChange:m=>v(m.target.value),children:r.map(m=>d.jsx("option",{value:m.modelId,children:m.name},m.modelId))})]})}function cC({id:e,model:n,value:r,disabled:a=!1,onChange:o}){return n?.effort?d.jsxs("div",{className:"carrier-settings-field",children:[d.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:"Effort"}),d.jsx("select",{id:e,className:"carrier-settings-select",value:r||n.effort.default,disabled:a,onChange:v=>o(v.target.value),children:n.effort.levels.map(v=>d.jsx("option",{value:v,children:v},v))})]}):d.jsxs("div",{className:"carrier-settings-field",children:[d.jsx("span",{className:"carrier-settings-label",children:"Effort"}),d.jsx("p",{className:"carrier-settings-help",children:"Not supported for this model."})]})}function ZM({carrier:e,cliOptions:n,minBackends:r,savingActionId:a,rows:o,disabled:v,onRowsChange:m}){const c=rC(),u=e.taskforce.backends.length,[h,S]=z.useState(u>0),[f,C]=z.useState(!1),[x,k]=z.useState(""),E=e.taskForceBackendCount>=r,g=n.filter(p=>!o.includes(p.id)),b=x||g[0]?.id||"";return d.jsxs("div",{className:`carrier-settings-control-group carrier-settings-control-group--taskforce ${h?"is-expanded":""} ${v?"is-disabled":""}`,children:[d.jsxs("div",{className:"carrier-settings-section-head",children:[d.jsxs("div",{children:[d.jsx("p",{className:"carrier-settings-resp-title",children:"Task Force"}),d.jsx("p",{className:"carrier-settings-help",children:v?"Disabled while SubAgent is on. Turn SubAgent off before composing Task Force backends.":u>0?`${u} backend${u===1?"":"s"} configured${E?" · active":` · needs ${r}+ to activate`}.`:`Run this carrier across multiple CLI backends. Needs at least ${r} to activate.`})]}),d.jsx("div",{className:"carrier-settings-tf-head-actions",children:d.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":h,onClick:()=>S(p=>!p),children:h?"Hide":"Configure"})})]}),h?d.jsxs("div",{className:"carrier-settings-tf-list",children:[o.length===0?d.jsx("p",{className:"carrier-settings-tf-empty",children:"No Task Force backend drafted."}):null,o.map(p=>{const y=n.find(M=>M.id===p);if(!y)return null;const T=c.draft.taskforce[y.id]??{model:y.defaultModel,effort:""},A=y.models.find(M=>M.modelId===T.model)??y.models[0]??null,L=e.taskforce.backends.some(M=>M.cliType===y.id);return d.jsxs("div",{className:`carrier-settings-tf-item ${L?"is-active":""}`,children:[d.jsxs("div",{className:"carrier-settings-tf-title",children:[d.jsx("span",{className:`carrier-settings-live-dot ${L?"is-live":""}`,"aria-hidden":"true"}),d.jsx("strong",{children:y.displayName})]}),d.jsx(lC,{id:`tf-${y.id}-model`,label:"Model",models:y.models,value:T.model,disabled:v,onChange:M=>e6(y,M)}),d.jsx(cC,{id:`tf-${y.id}-effort`,model:A,value:T.effort,disabled:v,onChange:M=>fg(y.id,{effort:M})}),d.jsx("div",{className:"carrier-settings-tf-actions",children:d.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:v||a==="save-all",onClick:()=>m(o.filter(M=>M!==y.id)),children:"Remove"})})]},y.id)}),d.jsxs("div",{className:"carrier-settings-tf-add-row",children:[f&&g.length>0?d.jsx("select",{className:"carrier-settings-select carrier-settings-tf-add-select",value:b,onChange:p=>k(p.target.value),"aria-label":"Task Force CLI to add",children:g.map(p=>d.jsx("option",{value:p.id,children:p.displayName},p.id))}):null,d.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:v||g.length===0||a==="save-all",onClick:()=>{if(!f){C(!0);return}const p=b,y=n.find(A=>A.id===p),T=y?.models.find(A=>A.modelId===y.defaultModel)??y?.models[0]??null;!y||!T||(fg(y.id,{model:T.modelId,effort:T.effort?.default??""}),m(o.includes(y.id)?o:[...o,y.id]),k(""),C(!1))},children:"Add"})]})]}):null]})}function JM(e,n){const r=n.find(v=>v.id===e),a=r?.models.find(v=>v.modelId===r.defaultModel)??r?.models[0]??null,o={cliType:e,model:a?.modelId??"",effort:a?.effort?.default??""};r?.supportsSubagent||(o.agentMode="cli"),Xs(o)}function QM(e,n){const r=e.models.find(a=>a.modelId===n);Xs({model:n,effort:r?.effort?.default??""})}function e6(e,n){const r=e.models.find(a=>a.modelId===n);fg(e.id,{model:n,effort:r?.effort?.default??""})}function t6(e,n,r){return n.displayName!==e.displayName||n.cliType!==e.cliType||n.model!==e.model||(n.effort||"")!==(e.effort||"")||n.agentMode!==e.agentMode?!0:n.agentMode==="subagent"?e.taskForceBackendCount>0:n6(e,r,n.taskforce)}function n6(e,n,r){if(n.length!==e.taskforce.backends.length)return!0;const a=new Set(n);for(const o of e.taskforce.backends){if(!a.has(o.cliType))return!0;const v=r[o.cliType];if(!v||v.model!==o.model||(v.effort||"")!==(o.effort||""))return!0}return!1}function i6(e,n){return e.map(r=>{const a=n[r];return a?{cliType:r,model:a.model,...a.effort?{effort:a.effort}:{}}:null}).filter(r=>r!==null)}function uC(e){return{"--cap-color":VM[e]??"var(--brass)"}}function r6(){return d.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[d.jsx("path",{d:"M10.8 2.2 13.8 5.2 5.2 13.8 2 14.5 2.7 11.3 10.8 2.2Z"}),d.jsx("path",{d:"M9.7 3.4 12.6 6.3"})]})}function s6(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:d.jsx("path",{d:"M3 8.3 6.4 11.7 13.2 4.5"})})}function a6(){return d.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[d.jsx("path",{d:"M4.2 4.2 11.8 11.8"}),d.jsx("path",{d:"M11.8 4.2 4.2 11.8"})]})}function Ee(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Ye(e){return Ee(e).replace(/"/g,"&quot;")}const o6="contextual-knowledge-not-instructions";function l6(e,n,r){const a=r?.whyThisMatched??e.frontmatter.whyThisMatched,o=fC(e,n);return`
91
- <div class="context-actions-grid">
92
- <button class="context-action-btn" type="button" data-action="copy-compact-context">
93
- <span class="context-action-label">Compact context</span>
94
- <span class="context-action-meta">${Wu(hC(e))} tok</span>
95
- </button>
96
- <button class="context-action-btn" type="button" data-action="copy-provenance-context">
97
- <span class="context-action-label">Provenance</span>
98
- <span class="context-action-meta">${Wu(dC(e))} tok</span>
99
- </button>
100
- <button class="context-action-btn" type="button" data-action="copy-related-context">
101
- <span class="context-action-label">Context pack</span>
102
- <span class="context-action-meta">${Wu(o)} tok</span>
103
- </button>
104
- ${a?`
105
- <button class="context-action-btn context-action-btn--secondary" type="button" data-action="toggle-why-matched">
106
- <span class="context-action-label">Why this matched</span>
107
- </button>
108
- <div class="context-why-matched" hidden>${Ee(a)}</div>
109
- `:""}
110
- </div>
111
- `}function hC(e){const n={id:e.frontmatter.id,title:e.frontmatter.title,status:e.frontmatter.status??null,tags:e.frontmatter.tags,updated:e.frontmatter.updated,summary:dm(e.body)};return JSON.stringify({...n,token_estimate:Wu(JSON.stringify(n))},null,2)}function dC(e){return[`# ${e.frontmatter.title} (\`${e.frontmatter.id}\`)`,"",`- updated: ${e.frontmatter.updated}`,`- status: ${e.frontmatter.status??"unknown"}`,`- raw_source_ref: ${e.frontmatter.rawSourceRef??"(none)"}`,`- raw_source_refs: ${(e.frontmatter.rawSourceRefs??[]).join(", ")||"(none)"}`,"","## Summary",dm(e.body)].join(`
112
- `)}function fC(e,n){const r=new Set([...e.frontmatter.related??[]]),a=n.filter(o=>r.has(o.id)).sort((o,v)=>o.title.localeCompare(v.title));return[`<fleet-wiki-context boundary="${o6}">`,"# Fleet Wiki Context Pack","",`## Entry: ${e.frontmatter.title} (\`${e.frontmatter.id}\`)`,"",`- updated: ${e.frontmatter.updated}`,`- status: ${e.frontmatter.status??"unknown"}`,`- tags: ${e.frontmatter.tags.join(", ")||"(none)"}`,"","### Summary",dm(e.body),"","### Related Entries",...a.length>0?a.map(o=>`- [[wiki:${o.id}]] — ${o.title}`):["- (none)"],"","</fleet-wiki-context>"].join(`
113
- `)}function Wu(e){return Math.max(1,Math.ceil(e.length/4))}function dm(e){return e.replace(/\s+/g," ").trim().slice(0,240)||"(empty)"}async function c6(){return or(ni("/health"))}async function u6(){return or(ni("/workspaces"))}async function h6(){return or(ni("/index"))}async function d6(){return gC(ni("/index-md"))}async function f6(e){return or(ni(`/entry/${encodeURIComponent(e)}`))}async function p6(e,n=[],r=!1){const a=new URLSearchParams;e&&a.set("q",e),n.length>0&&a.set("tags",n.join(",")),r&&a.set("enhanced","true");const o=a.toString();return or(ni(`/search${o?`?${o}`:""}`))}async function g6(e){return gC(ni(`/raw?ref=${encodeURIComponent(e)}`))}async function Mh(e){return or(ni(`/queue?status=${encodeURIComponent(e)}`))}async function m6(e){return or(ni(`/queue/${encodeURIComponent(e)}`))}async function _6(e){return mC(ni(`/queue/${encodeURIComponent(e)}/approve`),{})}async function v6(e,n){return mC(ni(`/queue/${encodeURIComponent(e)}/reject`),{reason:n})}async function pC(){return or(ni("/conflicts"))}async function b6(e){return or(ni(`/conflicts/${encodeURIComponent(e)}`))}async function y6(e){const n=typeof e=="number"?`?limit=${encodeURIComponent(String(e))}`:"";return or(ni(`/log${n}`))}function ni(e){const n=window.location.pathname.match(/^\/console\/codex\/w\/([^/]+)(?:\/|$)/),r=e.startsWith("/")?e:`/${e}`;return n?`/console/codex/w/${encodeURIComponent(decodeURIComponent(n[1]??""))}/api${r}`:`/console/codex/api${r}`}async function or(e){const n=await fetch(e,{headers:{accept:"application/json"}});if(!n.ok)throw new Error(await fm(e,n));return n.json()}async function gC(e){const n=await fetch(e,{headers:{accept:"text/markdown,text/plain"}});if(!n.ok)throw new Error(await fm(e,n));return n.text()}async function mC(e,n){const r=await fetch(e,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error(await fm(e,r));return r.json()}async function fm(e,n){return(await n.json().catch(()=>null))?.error??`${e} request failed: ${n.status}`}const S6=/^[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}$/,Fi="/console/codex",pg=new Set;let so=null;function ec(){const e=R6(L6(SC(window.location.pathname)).pathname);return e.name==="queue"?{name:"queue",tab:new URLSearchParams(window.location.search).get("tab")==="archived"?"archived":"pending"}:e}function gg(){return yC(SC(window.location.pathname))?.wsId??null}function aa(e){e!==window.location.pathname+window.location.search&&(window.history.pushState({},"",e),gm(ec()))}function w6(e){window.history.replaceState({},"",e),gm(ec())}function C6(e){return pg.add(e),()=>pg.delete(e)}function x6(){so||(so=()=>gm(ec()),window.addEventListener("popstate",so))}function E6(){so&&(window.removeEventListener("popstate",so),so=null)}function Pr(e){return rr(`/entry/${encodeURIComponent(e)}`)}function _C(e){return rr(`/raw/${encodeURIComponent(e)}`)}function ho(e="pending"){return rr(e==="archived"?"/queue?tab=archived":"/queue")}function T6(e){return rr(`/queue/${encodeURIComponent(e)}`)}function k6(){return rr("/conflicts")}function A6(e){return rr(`/conflicts/${encodeURIComponent(e)}`)}function vC(){return rr("/index-md")}function bC(e){return rr(typeof e!="number"?"/log":`/log?limit=${encodeURIComponent(String(e))}`)}function pm(){return rr("/")}function X1(e){return`${Fi}/w/${encodeURIComponent(e)}/`}function R6(e){if(e==="/index"||e==="/index-md")return{name:"index-md"};if(e==="/log"){const v=new URLSearchParams(window.location.search).get("limit"),m=Number(v??20);return{name:"log",limit:Number.isInteger(m)?m:20}}if(e==="/conflicts")return{name:"conflicts"};const n=e.match(/^\/conflicts\/([^/]+)$/);if(n)return{name:"conflict-detail",id:decodeURIComponent(n[1]??"")};const r=e.match(/^\/entry\/([^/]+)$/);if(r)return{name:"entry",id:decodeURIComponent(r[1]??"")};const a=e.match(/^\/raw\/(.+)$/);if(a)return{name:"raw",ref:decodeURIComponent(a[1]??"")};if(e==="/queue")return{name:"queue",tab:"pending"};const o=e.match(/^\/queue\/([^/]+)$/);if(o){const v=decodeURIComponent(o[1]??"");return S6.test(v)?{name:"queue-detail",patchId:v}:{name:"home"}}return{name:"home"}}function rr(e){const n=gg();return n?`${Fi}/w/${encodeURIComponent(n)}${e}`:`${Fi}${e}`}function L6(e){const n=yC(e);return n?{pathname:n.pathname,wsId:n.wsId}:{pathname:e,wsId:null}}function yC(e){const n=e.match(/^\/w\/([^/]+)(\/.*)?$/);return n?{wsId:decodeURIComponent(n[1]??""),pathname:n[2]??"/"}:null}function SC(e){return e===Fi||e===`${Fi}/`?"/":e.startsWith(`${Fi}/`)?e.slice(Fi.length)||"/":e}function gm(e){for(const n of pg)n(e)}const wC="fleet-wiki-web-recent",mg=new Set,oa={health:null,index:[],currentEntry:null,currentMatchHint:null,conflicts:[],currentConflict:null,indexMarkdown:null,log:null,loading:!1,error:null,recentIds:z6(),pendingPatchCount:0,currentWorkspaceId:null,workspaces:[]};function Gu(){return oa}function M6(e){return mg.add(e),()=>mg.delete(e)}async function D6(){Qt({loading:!0,error:null});try{const[e,n,r,a]=await Promise.all([c6(),h6(),Mh("pending").catch(()=>null),u6().catch(()=>null)]);Qt({health:e,index:n,pendingPatchCount:r?.pendingCount??0,currentWorkspaceId:a?.currentWorkspaceId??null,workspaces:a?.workspaces??[],loading:!1})}catch(e){Qt({loading:!1,error:yo(e)})}}async function O6(e){Qt({loading:!0,error:null,currentEntry:null,currentMatchHint:oa.currentMatchHint?.id===e?oa.currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null});try{const n=await f6(e),r=$6(e);Qt({currentEntry:n,currentConflict:null,indexMarkdown:null,log:null,recentIds:r,loading:!1})}catch(n){Qt({loading:!1,error:yo(n)})}}async function N6(){Qt({loading:!0,error:null,currentEntry:null,currentConflict:null,log:null});try{Qt({indexMarkdown:await d6(),loading:!1})}catch(e){Qt({loading:!1,error:yo(e)})}}async function I6(e){Qt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null});try{Qt({log:await y6(e),loading:!1})}catch(n){Qt({loading:!1,error:yo(n)})}}async function B6(){Qt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null,log:null});try{Qt({conflicts:await pC(),loading:!1})}catch(e){Qt({loading:!1,error:yo(e)})}}async function j6(e){Qt({loading:!0,error:null,currentEntry:null,indexMarkdown:null,log:null});try{const[n,r]=await Promise.all([b6(e),pC().catch(()=>oa.conflicts)]);Qt({currentConflict:n,conflicts:r,loading:!1})}catch(n){Qt({loading:!1,error:yo(n)})}}function bp(){Qt({currentEntry:null,currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null,error:null,loading:!1})}function CC(e){Qt({currentMatchHint:e})}function mm(e){Qt({pendingPatchCount:e})}function Qt(e){Object.assign(oa,e);for(const n of mg)n(oa)}function $6(e){const n=[e,...oa.recentIds.filter(r=>r!==e)].slice(0,8);return window.localStorage.setItem(wC,JSON.stringify(n)),n}function z6(){try{const e=window.localStorage.getItem(wC),n=e?JSON.parse(e):[];return Array.isArray(n)?n.filter(r=>typeof r=="string").slice(0,8):[]}catch{return[]}}function yo(e){return e instanceof Error?e.message:String(e)}const Ae={open:!1,query:"",selectedIndex:0,results:[],debounceId:null,searchSeq:0,previousBodyOverflow:null,previousActiveElement:null};let _g=[],_m=[];function P6(e,n){_g=e,_m=n,Ae.open&&!Ae.query&&(Ae.results=vm(),Ae.selectedIndex=0,sh())}function xC(){if(Ae.open){J1();return}Ae.open=!0,Ae.query="",Ae.selectedIndex=0,Ae.results=vm(),Ae.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null,Z6(),G6(),sh(),J1()}function ao(){Ae.open&&(Ae.open=!1,Ae.searchSeq++,Ae.debounceId!==null&&(window.clearTimeout(Ae.debounceId),Ae.debounceId=null),K6(),J6(),Q6())}function H6(){document.addEventListener("keydown",EC),document.addEventListener("input",TC),document.addEventListener("click",kC),document.addEventListener("mouseover",AC)}function U6(){Ae.open&&ao(),document.removeEventListener("keydown",EC),document.removeEventListener("input",TC),document.removeEventListener("click",kC),document.removeEventListener("mouseover",AC)}function F6(){return Ae.open}function EC(e){if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="k"){e.preventDefault(),Ae.open?ao():xC();return}if(Ae.open){if(e.key==="Tab"){e4(e);return}if(e.key==="Escape"){e.preventDefault(),ao();return}if(e.key==="ArrowDown"){e.preventDefault(),Ae.selectedIndex=Math.min(Ae.selectedIndex+1,Math.max(0,Ae.results.length-1)),vg({scroll:!0});return}if(e.key==="ArrowUp"){e.preventDefault(),Ae.selectedIndex=Math.max(0,Ae.selectedIndex-1),vg({scroll:!0});return}if(e.key==="Enter"){e.preventDefault();const r=Ae.results[Ae.selectedIndex];if(!r)return;CC(r),aa(Pr(r.id)),ao()}}}function TC(e){const n=e.target;!(n instanceof HTMLInputElement)||n.id!=="command-input"||(Ae.query=n.value.trim(),Ae.selectedIndex=0,Ae.debounceId!==null&&window.clearTimeout(Ae.debounceId),Ae.debounceId=window.setTimeout(()=>{q6(Ae.query)},150))}function kC(e){const n=e.target;if(!(n instanceof Element))return;if(n.matches("[data-action='open-command']")||n.closest("[data-action='open-command']")){xC();return}if(!Ae.open)return;if(n.classList.contains("command-overlay")){ao();return}const r=n.closest("[data-command-entry-id]");if(r){const a=Ae.results.find(o=>o.id===(r.dataset.commandEntryId??""));CC(a??null),aa(Pr(r.dataset.commandEntryId??"")),ao()}}function AC(e){if(!Ae.open)return;const n=e.target;if(!(n instanceof Element))return;const r=n.closest("[data-command-index]");if(!r)return;const a=Number(r.dataset.commandIndex);!Number.isInteger(a)||a<0||a>=Ae.results.length||(Ae.selectedIndex=a,vg({scroll:!1}))}async function q6(e){const n=++Ae.searchSeq;if(!e){Ae.results=vm(),Ae.selectedIndex=0,sh();return}let r;try{r=await p6(e)}catch{r=[]}n!==Ae.searchSeq||!Ae.open||(Ae.results=r,Ae.selectedIndex=0,sh())}function W6(){let e=document.querySelector("#command-palette-root");return e||(e=document.createElement("div"),e.id="command-palette-root",document.body.append(e)),e}function G6(){const e=W6();e.querySelector(".command-overlay")||(e.innerHTML=V6())}function K6(){const e=document.querySelector("#command-palette-root");e&&(e.innerHTML="")}function sh(){const e=document.querySelector("#command-results-list");if(e){if(Ae.results.length===0){e.innerHTML=`<p class="empty-state">${Ee("No results found.")}</p>`;return}e.innerHTML=Ae.query?Ae.results.map(RC).join(""):Y6()}}function vg(e={scroll:!0}){const n=document.querySelectorAll(".command-result");n.forEach((a,o)=>{a.classList.toggle("active",o===Ae.selectedIndex)});const r=n[Ae.selectedIndex];e.scroll&&r?.scrollIntoView({block:"nearest"})}function V6(){const e=Ye("Command palette"),n=Ye("Search titles · tags · content");return`
114
- <div class="command-overlay">
115
- <section class="command-card" role="dialog" aria-modal="true" aria-label="${e}" tabindex="-1">
116
- <div class="command-search">
117
- <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">
118
- <circle cx="11" cy="11" r="6.5" />
119
- <path d="m20 20-3.5-3.5" />
120
- </svg>
121
- <input id="command-input" type="search" autocomplete="off" spellcheck="false" placeholder="${n}" />
122
- <kbd>esc</kbd>
123
- </div>
124
- <div class="command-results" id="command-results-list"></div>
125
- </section>
126
- </div>
127
- `}function RC(e,n){const r=n===Ae.selectedIndex?" active":"",a=Ye(e.title),o=e.tags.slice(0,2),v=e.tags.length-o.length,m=r4(e),c=o.map(h=>`<span class="chip chip-tag">${Ee(h)}</span>`).join(""),u=v>0?`<span class="chip chip-muted">+${v}</span>`:"";return`
128
- <button class="command-result${r}" type="button" data-command-entry-id="${Ye(e.id)}" data-command-index="${n}" title="${a}">
129
- <span class="command-result-text">
130
- <strong>${n4(e.title,Ae.query)}</strong>
131
- <small>${Ee(i4(e))}</small>
132
- ${m?`<small class="command-result-excerpt">${Ee(m)}</small>`:""}
133
- </span>
134
- <span class="command-result-aside">${c}${u}</span>
135
- </button>
136
- `}function Y6(){const e=X6(),n=Ae.results.slice(0,e),r=Ae.results.slice(e);return[n.length>0?Z1("Recent",n,0):"",r.length>0?Z1("All",r,e):""].join("")}function Z1(e,n,r){return`
137
- <div class="command-section-heading">${Ee(e)}</div>
138
- ${n.map((a,o)=>RC(a,r+o)).join("")}
139
- `}function vm(){const e=new Set(_m),n=LC().map(a=>_g.find(o=>o.id===a)).filter(a=>!!a),r=_g.filter(a=>!e.has(a.id));return[...n,...r].slice(0,12).map((a,o)=>({id:a.id,title:a.title,score:Math.max(1,100-o),reason:"title",excerpt:"",path:a.path,tags:a.tags,updated:a.updated}))}function X6(){return LC().filter((e,n)=>Ae.results[n]?.id===e).length}function LC(){return Array.from(new Set(_m))}function Z6(){Ae.previousBodyOverflow===null&&(Ae.previousBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden")}function J6(){Ae.previousBodyOverflow!==null&&(document.body.style.overflow=Ae.previousBodyOverflow,Ae.previousBodyOverflow=null)}function Q6(){const e=Ae.previousActiveElement;Ae.previousActiveElement=null,e?.isConnected&&e.focus()}function J1(){window.setTimeout(()=>{const e=document.querySelector("#command-input");e&&(e.focus(),e.select())},0)}function e4(e){const n=document.querySelector(".command-card");if(!n)return;const r=t4(n);if(r.length===0){e.preventDefault(),n.focus();return}const a=document.activeElement,o=a instanceof HTMLElement?r.indexOf(a):-1,v=e.shiftKey?o<=0?r.length-1:o-1:o===-1||o===r.length-1?0:o+1;(o===-1||e.shiftKey&&o===0||!e.shiftKey&&o===r.length-1)&&(e.preventDefault(),r[v]?.focus())}function t4(e){const n=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");return Array.from(e.querySelectorAll(n)).filter(r=>!r.hasAttribute("hidden")&&r.offsetParent!==null)}function n4(e,n){if(!n)return Ee(e);const r=e.toLocaleLowerCase(),a=n.toLocaleLowerCase();if(!a)return Ee(e);let o=0,v="";for(;o<e.length;){const m=r.indexOf(a,o);if(m===-1)break;v+=Ee(e.slice(o,m)),v+=`<mark class="command-highlight">${Ee(e.slice(m,m+n.length))}</mark>`,o=m+n.length}return v+Ee(e.slice(o))}function i4(e){switch(e.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 r4(e){const n=e.matchedSnippets?.find(a=>a.field==="body")?.snippet;if(e.reason!=="body")return"";const r=n??e.excerpt;return s4(r??"")}function s4(e){return o4(a4(e)).replace(/\s+/g," ").trim().slice(0,180)}function a4(e){return e.replace(/<<<[^>]*>>>/g," ")}function o4(e){return e.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 bm(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ua=bm();function MC(e){ua=e}var Bl={exec:()=>null};function ct(e,n=""){let r=typeof e=="string"?e:e.source,a={replace:(o,v)=>{let m=typeof v=="string"?v:v.source;return m=m.replace(zn.caret,"$1"),r=r.replace(o,m),a},getRegex:()=>new RegExp(r,n)};return a}var l4=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),zn={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:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},c4=/^(?:[ \t]*(?:\n|$))+/,u4=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,h4=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,tc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,d4=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ym=/(?:[*+-]|\d{1,9}[.)])/,DC=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,OC=ct(DC).replace(/bull/g,ym).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(),f4=ct(DC).replace(/bull/g,ym).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(),Sm=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,p4=/^[^\n]+/,wm=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,g4=ct(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",wm).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),m4=ct(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ym).getRegex(),Dh="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",Cm=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,_4=ct("^ {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",Cm).replace("tag",Dh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),NC=ct(Sm).replace("hr",tc).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",Dh).getRegex(),v4=ct(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",NC).getRegex(),xm={blockquote:v4,code:u4,def:g4,fences:h4,heading:d4,hr:tc,html:_4,lheading:OC,list:m4,newline:c4,paragraph:NC,table:Bl,text:p4},Q1=ct("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",tc).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",Dh).getRegex(),b4={...xm,lheading:f4,table:Q1,paragraph:ct(Sm).replace("hr",tc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Q1).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",Dh).getRegex()},y4={...xm,html:ct(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Cm).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:Bl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ct(Sm).replace("hr",tc).replace("heading",` *#{1,6} *[^
140
- ]`).replace("lheading",OC).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},S4=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,w4=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,IC=/^( {2,}|\\)\n(?!\s*$)/,C4=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Oh=/[\p{P}\p{S}]/u,Em=/[\s\p{P}\p{S}]/u,BC=/[^\s\p{P}\p{S}]/u,x4=ct(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Em).getRegex(),jC=/(?!~)[\p{P}\p{S}]/u,E4=/(?!~)[\s\p{P}\p{S}]/u,T4=/(?:[^\s\p{P}\p{S}]|~)/u,k4=ct(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",l4?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),$C=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,A4=ct($C,"u").replace(/punct/g,Oh).getRegex(),R4=ct($C,"u").replace(/punct/g,jC).getRegex(),zC="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",L4=ct(zC,"gu").replace(/notPunctSpace/g,BC).replace(/punctSpace/g,Em).replace(/punct/g,Oh).getRegex(),M4=ct(zC,"gu").replace(/notPunctSpace/g,T4).replace(/punctSpace/g,E4).replace(/punct/g,jC).getRegex(),D4=ct("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,BC).replace(/punctSpace/g,Em).replace(/punct/g,Oh).getRegex(),O4=ct(/\\(punct)/,"gu").replace(/punct/g,Oh).getRegex(),N4=ct(/^<(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(),I4=ct(Cm).replace("(?:-->|$)","-->").getRegex(),B4=ct("^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",I4).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ah=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,j4=ct(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ah).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),PC=ct(/^!?\[(label)\]\[(ref)\]/).replace("label",ah).replace("ref",wm).getRegex(),HC=ct(/^!?\[(ref)\](?:\[\])?/).replace("ref",wm).getRegex(),$4=ct("reflink|nolink(?!\\()","g").replace("reflink",PC).replace("nolink",HC).getRegex(),ey=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Tm={_backpedal:Bl,anyPunctuation:O4,autolink:N4,blockSkip:k4,br:IC,code:w4,del:Bl,emStrongLDelim:A4,emStrongRDelimAst:L4,emStrongRDelimUnd:D4,escape:S4,link:j4,nolink:HC,punctuation:x4,reflink:PC,reflinkSearch:$4,tag:B4,text:C4,url:Bl},z4={...Tm,link:ct(/^!?\[(label)\]\((.*?)\)/).replace("label",ah).getRegex(),reflink:ct(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ah).getRegex()},bg={...Tm,emStrongRDelimAst:M4,emStrongLDelim:R4,url:ct(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ey).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:ct(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ey).getRegex()},P4={...bg,br:ct(IC).replace("{2,}","*").getRegex(),text:ct(bg.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Cu={normal:xm,gfm:b4,pedantic:y4},Sl={normal:Tm,gfm:bg,breaks:P4,pedantic:z4},H4={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ty=e=>H4[e];function er(e,n){if(n){if(zn.escapeTest.test(e))return e.replace(zn.escapeReplace,ty)}else if(zn.escapeTestNoEncode.test(e))return e.replace(zn.escapeReplaceNoEncode,ty);return e}function ny(e){try{e=encodeURI(e).replace(zn.percentDecode,"%")}catch{return null}return e}function iy(e,n){let r=e.replace(zn.findPipe,(v,m,c)=>{let u=!1,h=m;for(;--h>=0&&c[h]==="\\";)u=!u;return u?"|":" |"}),a=r.split(zn.splitPipe),o=0;if(a[0].trim()||a.shift(),a.length>0&&!a.at(-1)?.trim()&&a.pop(),n)if(a.length>n)a.splice(n);else for(;a.length<n;)a.push("");for(;o<a.length;o++)a[o]=a[o].trim().replace(zn.slashPipe,"|");return a}function wl(e,n,r){let a=e.length;if(a===0)return"";let o=0;for(;o<a&&e.charAt(a-o-1)===n;)o++;return e.slice(0,a-o)}function U4(e,n){if(e.indexOf(n[1])===-1)return-1;let r=0;for(let a=0;a<e.length;a++)if(e[a]==="\\")a++;else if(e[a]===n[0])r++;else if(e[a]===n[1]&&(r--,r<0))return a;return r>0?-2:-1}function ry(e,n,r,a,o){let v=n.href,m=n.title||null,c=e[1].replace(o.other.outputLinkReplace,"$1");a.state.inLink=!0;let u={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:v,title:m,text:c,tokens:a.inlineTokens(c)};return a.state.inLink=!1,u}function F4(e,n,r){let a=e.match(r.other.indentCodeCompensation);if(a===null)return n;let o=a[1];return n.split(`
141
- `).map(v=>{let m=v.match(r.other.beginningSpace);if(m===null)return v;let[c]=m;return c.length>=o.length?v.slice(o.length):v}).join(`
142
- `)}var oh=class{options;rules;lexer;constructor(e){this.options=e||ua}space(e){let n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){let n=this.rules.block.code.exec(e);if(n){let r=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:wl(r,`
143
- `)}}}fences(e){let n=this.rules.block.fences.exec(e);if(n){let r=n[0],a=F4(r,n[3]||"",this.rules);return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:a}}}heading(e){let n=this.rules.block.heading.exec(e);if(n){let r=n[2].trim();if(this.rules.other.endingHash.test(r)){let a=wl(r,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(r=a.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:wl(n[0],`
144
- `)}}blockquote(e){let n=this.rules.block.blockquote.exec(e);if(n){let r=wl(n[0],`
145
- `).split(`
146
- `),a="",o="",v=[];for(;r.length>0;){let m=!1,c=[],u;for(u=0;u<r.length;u++)if(this.rules.other.blockquoteStart.test(r[u]))c.push(r[u]),m=!0;else if(!m)c.push(r[u]);else break;r=r.slice(u);let h=c.join(`
147
- `),S=h.replace(this.rules.other.blockquoteSetextReplace,`
148
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");a=a?`${a}
149
- ${h}`:h,o=o?`${o}
150
- ${S}`:S;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(S,v,!0),this.lexer.state.top=f,r.length===0)break;let C=v.at(-1);if(C?.type==="code")break;if(C?.type==="blockquote"){let x=C,k=x.raw+`
151
- `+r.join(`
152
- `),E=this.blockquote(k);v[v.length-1]=E,a=a.substring(0,a.length-x.raw.length)+E.raw,o=o.substring(0,o.length-x.text.length)+E.text;break}else if(C?.type==="list"){let x=C,k=x.raw+`
153
- `+r.join(`
154
- `),E=this.list(k);v[v.length-1]=E,a=a.substring(0,a.length-C.raw.length)+E.raw,o=o.substring(0,o.length-x.raw.length)+E.raw,r=k.substring(v.at(-1).raw.length).split(`
155
- `);continue}}return{type:"blockquote",raw:a,tokens:v,text:o}}}list(e){let n=this.rules.block.list.exec(e);if(n){let r=n[1].trim(),a=r.length>1,o={type:"list",raw:"",ordered:a,start:a?+r.slice(0,-1):"",loose:!1,items:[]};r=a?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=a?r:"[*+-]");let v=this.rules.other.listItemRegex(r),m=!1;for(;e;){let u=!1,h="",S="";if(!(n=v.exec(e))||this.rules.block.hr.test(e))break;h=n[0],e=e.substring(h.length);let f=n[2].split(`
156
- `,1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),C=e.split(`
157
- `,1)[0],x=!f.trim(),k=0;if(this.options.pedantic?(k=2,S=f.trimStart()):x?k=n[1].length+1:(k=n[2].search(this.rules.other.nonSpaceChar),k=k>4?1:k,S=f.slice(k),k+=n[1].length),x&&this.rules.other.blankLine.test(C)&&(h+=C+`
158
- `,e=e.substring(C.length+1),u=!0),!u){let b=this.rules.other.nextBulletRegex(k),p=this.rules.other.hrRegex(k),y=this.rules.other.fencesBeginRegex(k),T=this.rules.other.headingBeginRegex(k),A=this.rules.other.htmlBeginRegex(k);for(;e;){let L=e.split(`
159
- `,1)[0],M;if(C=L,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),M=C):M=C.replace(this.rules.other.tabCharGlobal," "),y.test(C)||T.test(C)||A.test(C)||b.test(C)||p.test(C))break;if(M.search(this.rules.other.nonSpaceChar)>=k||!C.trim())S+=`
160
- `+M.slice(k);else{if(x||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||y.test(f)||T.test(f)||p.test(f))break;S+=`
161
- `+C}!x&&!C.trim()&&(x=!0),h+=L+`
162
- `,e=e.substring(L.length+1),f=M.slice(k)}}o.loose||(m?o.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(m=!0));let E=null,g;this.options.gfm&&(E=this.rules.other.listIsTask.exec(S),E&&(g=E[0]!=="[ ] ",S=S.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:h,task:!!E,checked:g,loose:!1,text:S,tokens:[]}),o.raw+=h}let c=o.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let u=0;u<o.items.length;u++)if(this.lexer.state.top=!1,o.items[u].tokens=this.lexer.blockTokens(o.items[u].text,[]),!o.loose){let h=o.items[u].tokens.filter(f=>f.type==="space"),S=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));o.loose=S}if(o.loose)for(let u=0;u<o.items.length;u++)o.items[u].loose=!0;return o}}html(e){let n=this.rules.block.html.exec(e);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(e){let n=this.rules.block.def.exec(e);if(n){let r=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:a,title:o}}}table(e){let n=this.rules.block.table.exec(e);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let r=iy(n[1]),a=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=n[3]?.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
163
- `):[],v={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===a.length){for(let m of a)this.rules.other.tableAlignRight.test(m)?v.align.push("right"):this.rules.other.tableAlignCenter.test(m)?v.align.push("center"):this.rules.other.tableAlignLeft.test(m)?v.align.push("left"):v.align.push(null);for(let m=0;m<r.length;m++)v.header.push({text:r[m],tokens:this.lexer.inline(r[m]),header:!0,align:v.align[m]});for(let m of o)v.rows.push(iy(m,v.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:v.align[u]})));return v}}lheading(e){let n=this.rules.block.lheading.exec(e);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(e){let n=this.rules.block.paragraph.exec(e);if(n){let r=n[1].charAt(n[1].length-1)===`
164
- `?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){let n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(e){let n=this.rules.inline.tag.exec(e);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(e){let n=this.rules.inline.link.exec(e);if(n){let r=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let v=wl(r.slice(0,-1),"\\");if((r.length-v.length)%2===0)return}else{let v=U4(n[2],"()");if(v===-2)return;if(v>-1){let m=(n[0].indexOf("!")===0?5:4)+n[1].length+v;n[2]=n[2].substring(0,v),n[0]=n[0].substring(0,m).trim(),n[3]=""}}let a=n[2],o="";if(this.options.pedantic){let v=this.rules.other.pedanticHrefTitle.exec(a);v&&(a=v[1],o=v[3])}else o=n[3]?n[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?a=a.slice(1):a=a.slice(1,-1)),ry(n,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(e,n){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let a=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=n[a.toLowerCase()];if(!o){let v=r[0].charAt(0);return{type:"text",raw:v,text:v}}return ry(r,o,r[0],this.lexer,this.rules)}}emStrong(e,n,r=""){let a=this.rules.inline.emStrongLDelim.exec(e);if(!(!a||a[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[2])||!r||this.rules.inline.punctuation.exec(r))){let o=[...a[0]].length-1,v,m,c=o,u=0,h=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,n=n.slice(-1*e.length+o);(a=h.exec(n))!=null;){if(v=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!v)continue;if(m=[...v].length,a[3]||a[4]){c+=m;continue}else if((a[5]||a[6])&&o%3&&!((o+m)%3)){u+=m;continue}if(c-=m,c>0)continue;m=Math.min(m,m+c+u);let S=[...a[0]][0].length,f=e.slice(0,o+a.index+S+m);if(Math.min(o,m)%2){let x=f.slice(1,-1);return{type:"em",raw:f,text:x,tokens:this.lexer.inlineTokens(x)}}let C=f.slice(2,-2);return{type:"strong",raw:f,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(e){let n=this.rules.inline.code.exec(e);if(n){let r=n[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return a&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:n[0],text:r}}}br(e){let n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e){let n=this.rules.inline.del.exec(e);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(e){let n=this.rules.inline.autolink.exec(e);if(n){let r,a;return n[2]==="@"?(r=n[1],a="mailto:"+r):(r=n[1],a=r),{type:"link",raw:n[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let n;if(n=this.rules.inline.url.exec(e)){let r,a;if(n[2]==="@")r=n[0],a="mailto:"+r;else{let o;do o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(o!==n[0]);r=n[0],n[1]==="www."?a="http://"+n[0]:a=n[0]}return{type:"link",raw:n[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let n=this.rules.inline.text.exec(e);if(n){let r=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:r}}}},Pi=class yg{tokens;options;state;tokenizer;inlineQueue;constructor(n){this.tokens=[],this.tokens.links=Object.create(null),this.options=n||ua,this.options.tokenizer=this.options.tokenizer||new oh,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 r={other:zn,block:Cu.normal,inline:Sl.normal};this.options.pedantic?(r.block=Cu.pedantic,r.inline=Sl.pedantic):this.options.gfm&&(r.block=Cu.gfm,this.options.breaks?r.inline=Sl.breaks:r.inline=Sl.gfm),this.tokenizer.rules=r}static get rules(){return{block:Cu,inline:Sl}}static lex(n,r){return new yg(r).lex(n)}static lexInline(n,r){return new yg(r).inlineTokens(n)}lex(n){n=n.replace(zn.carriageReturn,`
165
- `),this.blockTokens(n,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let a=this.inlineQueue[r];this.inlineTokens(a.src,a.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(n,r=[],a=!1){for(this.options.pedantic&&(n=n.replace(zn.tabCharGlobal," ").replace(zn.spaceLine,""));n;){let o;if(this.options.extensions?.block?.some(m=>(o=m.call({lexer:this},n,r))?(n=n.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(n)){n=n.substring(o.raw.length);let m=r.at(-1);o.raw.length===1&&m!==void 0?m.raw+=`
166
- `:r.push(o);continue}if(o=this.tokenizer.code(n)){n=n.substring(o.raw.length);let m=r.at(-1);m?.type==="paragraph"||m?.type==="text"?(m.raw+=(m.raw.endsWith(`
167
- `)?"":`
168
- `)+o.raw,m.text+=`
169
- `+o.text,this.inlineQueue.at(-1).src=m.text):r.push(o);continue}if(o=this.tokenizer.fences(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(n)){n=n.substring(o.raw.length);let m=r.at(-1);m?.type==="paragraph"||m?.type==="text"?(m.raw+=(m.raw.endsWith(`
170
- `)?"":`
171
- `)+o.raw,m.text+=`
172
- `+o.raw,this.inlineQueue.at(-1).src=m.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(n)){n=n.substring(o.raw.length),r.push(o);continue}let v=n;if(this.options.extensions?.startBlock){let m=1/0,c=n.slice(1),u;this.options.extensions.startBlock.forEach(h=>{u=h.call({lexer:this},c),typeof u=="number"&&u>=0&&(m=Math.min(m,u))}),m<1/0&&m>=0&&(v=n.substring(0,m+1))}if(this.state.top&&(o=this.tokenizer.paragraph(v))){let m=r.at(-1);a&&m?.type==="paragraph"?(m.raw+=(m.raw.endsWith(`
173
- `)?"":`
174
- `)+o.raw,m.text+=`
175
- `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(o),a=v.length!==n.length,n=n.substring(o.raw.length);continue}if(o=this.tokenizer.text(n)){n=n.substring(o.raw.length);let m=r.at(-1);m?.type==="text"?(m.raw+=(m.raw.endsWith(`
176
- `)?"":`
177
- `)+o.raw,m.text+=`
178
- `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(o);continue}if(n){let m="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return this.state.top=!0,r}inline(n,r=[]){return this.inlineQueue.push({src:n,tokens:r}),r}inlineTokens(n,r=[]){let a=n,o=null;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)u.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,o.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let v;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)v=o[2]?o[2].length:0,a=a.slice(0,o.index+v)+"["+"a".repeat(o[0].length-v-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=this.options.hooks?.emStrongMask?.call({lexer:this},a)??a;let m=!1,c="";for(;n;){m||(c=""),m=!1;let u;if(this.options.extensions?.inline?.some(S=>(u=S.call({lexer:this},n,r))?(n=n.substring(u.raw.length),r.push(u),!0):!1))continue;if(u=this.tokenizer.escape(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.tag(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.link(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(u.raw.length);let S=r.at(-1);u.type==="text"&&S?.type==="text"?(S.raw+=u.raw,S.text+=u.text):r.push(u);continue}if(u=this.tokenizer.emStrong(n,a,c)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.codespan(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.br(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.del(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.autolink(n)){n=n.substring(u.raw.length),r.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(n))){n=n.substring(u.raw.length),r.push(u);continue}let h=n;if(this.options.extensions?.startInline){let S=1/0,f=n.slice(1),C;this.options.extensions.startInline.forEach(x=>{C=x.call({lexer:this},f),typeof C=="number"&&C>=0&&(S=Math.min(S,C))}),S<1/0&&S>=0&&(h=n.substring(0,S+1))}if(u=this.tokenizer.inlineText(h)){n=n.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(c=u.raw.slice(-1)),m=!0;let S=r.at(-1);S?.type==="text"?(S.raw+=u.raw,S.text+=u.text):r.push(u);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 r}},lh=class{options;parser;constructor(e){this.options=e||ua}space(e){return""}code({text:e,lang:n,escaped:r}){let a=(n||"").match(zn.notSpaceStart)?.[0],o=e.replace(zn.endingNewline,"")+`
179
- `;return a?'<pre><code class="language-'+er(a)+'">'+(r?o:er(o,!0))+`</code></pre>
180
- `:"<pre><code>"+(r?o:er(o,!0))+`</code></pre>
181
- `}blockquote({tokens:e}){return`<blockquote>
182
- ${this.parser.parse(e)}</blockquote>
183
- `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:n}){return`<h${n}>${this.parser.parseInline(e)}</h${n}>
184
- `}hr(e){return`<hr>
185
- `}list(e){let n=e.ordered,r=e.start,a="";for(let m=0;m<e.items.length;m++){let c=e.items[m];a+=this.listitem(c)}let o=n?"ol":"ul",v=n&&r!==1?' start="'+r+'"':"";return"<"+o+v+`>
186
- `+a+"</"+o+`>
187
- `}listitem(e){let n="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+er(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):n+=r+" "}return n+=this.parser.parse(e.tokens,!!e.loose),`<li>${n}</li>
188
- `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
189
- `}table(e){let n="",r="";for(let o=0;o<e.header.length;o++)r+=this.tablecell(e.header[o]);n+=this.tablerow({text:r});let a="";for(let o=0;o<e.rows.length;o++){let v=e.rows[o];r="";for(let m=0;m<v.length;m++)r+=this.tablecell(v[m]);a+=this.tablerow({text:r})}return a&&(a=`<tbody>${a}</tbody>`),`<table>
190
- <thead>
191
- `+n+`</thead>
192
- `+a+`</table>
193
- `}tablerow({text:e}){return`<tr>
194
- ${e}</tr>
195
- `}tablecell(e){let n=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+n+`</${r}>
196
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${er(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:n,tokens:r}){let a=this.parser.parseInline(r),o=ny(e);if(o===null)return a;e=o;let v='<a href="'+e+'"';return n&&(v+=' title="'+er(n)+'"'),v+=">"+a+"</a>",v}image({href:e,title:n,text:r,tokens:a}){a&&(r=this.parser.parseInline(a,this.parser.textRenderer));let o=ny(e);if(o===null)return er(r);e=o;let v=`<img src="${e}" alt="${r}"`;return n&&(v+=` title="${er(n)}"`),v+=">",v}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:er(e.text)}},km=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Hi=class Sg{options;renderer;textRenderer;constructor(n){this.options=n||ua,this.options.renderer=this.options.renderer||new lh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new km}static parse(n,r){return new Sg(r).parse(n)}static parseInline(n,r){return new Sg(r).parseInline(n)}parse(n,r=!0){let a="";for(let o=0;o<n.length;o++){let v=n[o];if(this.options.extensions?.renderers?.[v.type]){let c=v,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)){a+=u||"";continue}}let m=v;switch(m.type){case"space":{a+=this.renderer.space(m);continue}case"hr":{a+=this.renderer.hr(m);continue}case"heading":{a+=this.renderer.heading(m);continue}case"code":{a+=this.renderer.code(m);continue}case"table":{a+=this.renderer.table(m);continue}case"blockquote":{a+=this.renderer.blockquote(m);continue}case"list":{a+=this.renderer.list(m);continue}case"html":{a+=this.renderer.html(m);continue}case"def":{a+=this.renderer.def(m);continue}case"paragraph":{a+=this.renderer.paragraph(m);continue}case"text":{let c=m,u=this.renderer.text(c);for(;o+1<n.length&&n[o+1].type==="text";)c=n[++o],u+=`
197
- `+this.renderer.text(c);r?a+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):a+=u;continue}default:{let c='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return a}parseInline(n,r=this.renderer){let a="";for(let o=0;o<n.length;o++){let v=n[o];if(this.options.extensions?.renderers?.[v.type]){let c=this.options.extensions.renderers[v.type].call({parser:this},v);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(v.type)){a+=c||"";continue}}let m=v;switch(m.type){case"escape":{a+=r.text(m);break}case"html":{a+=r.html(m);break}case"link":{a+=r.link(m);break}case"image":{a+=r.image(m);break}case"strong":{a+=r.strong(m);break}case"em":{a+=r.em(m);break}case"codespan":{a+=r.codespan(m);break}case"br":{a+=r.br(m);break}case"del":{a+=r.del(m);break}case"text":{a+=r.text(m);break}default:{let c='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return a}},Ll=class{options;block;constructor(e){this.options=e||ua}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Pi.lex:Pi.lexInline}provideParser(){return this.block?Hi.parse:Hi.parseInline}},UC=class{defaults=bm();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Hi;Renderer=lh;TextRenderer=km;Lexer=Pi;Tokenizer=oh;Hooks=Ll;constructor(...e){this.use(...e)}walkTokens(e,n){let r=[];for(let a of e)switch(r=r.concat(n.call(this,a)),a.type){case"table":{let o=a;for(let v of o.header)r=r.concat(this.walkTokens(v.tokens,n));for(let v of o.rows)for(let m of v)r=r.concat(this.walkTokens(m.tokens,n));break}case"list":{let o=a;r=r.concat(this.walkTokens(o.items,n));break}default:{let o=a;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(v=>{let m=o[v].flat(1/0);r=r.concat(this.walkTokens(m,n))}):o.tokens&&(r=r.concat(this.walkTokens(o.tokens,n)))}}return r}use(...e){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let a={...r};if(a.async=this.defaults.async||a.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let v=n.renderers[o.name];v?n.renderers[o.name]=function(...m){let c=o.renderer.apply(this,m);return c===!1&&(c=v.apply(this,m)),c}:n.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let v=n[o.level];v?v.unshift(o.tokenizer):n[o.level]=[o.tokenizer],o.start&&(o.level==="block"?n.startBlock?n.startBlock.push(o.start):n.startBlock=[o.start]:o.level==="inline"&&(n.startInline?n.startInline.push(o.start):n.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(n.childTokens[o.name]=o.childTokens)}),a.extensions=n),r.renderer){let o=this.defaults.renderer||new lh(this.defaults);for(let v in r.renderer){if(!(v in o))throw new Error(`renderer '${v}' does not exist`);if(["options","parser"].includes(v))continue;let m=v,c=r.renderer[m],u=o[m];o[m]=(...h)=>{let S=c.apply(o,h);return S===!1&&(S=u.apply(o,h)),S||""}}a.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new oh(this.defaults);for(let v in r.tokenizer){if(!(v in o))throw new Error(`tokenizer '${v}' does not exist`);if(["options","rules","lexer"].includes(v))continue;let m=v,c=r.tokenizer[m],u=o[m];o[m]=(...h)=>{let S=c.apply(o,h);return S===!1&&(S=u.apply(o,h)),S}}a.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new Ll;for(let v in r.hooks){if(!(v in o))throw new Error(`hook '${v}' does not exist`);if(["options","block"].includes(v))continue;let m=v,c=r.hooks[m],u=o[m];Ll.passThroughHooks.has(v)?o[m]=h=>{if(this.defaults.async&&Ll.passThroughHooksRespectAsync.has(v))return(async()=>{let f=await c.call(o,h);return u.call(o,f)})();let S=c.call(o,h);return u.call(o,S)}:o[m]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await c.apply(o,h);return f===!1&&(f=await u.apply(o,h)),f})();let S=c.apply(o,h);return S===!1&&(S=u.apply(o,h)),S}}a.hooks=o}if(r.walkTokens){let o=this.defaults.walkTokens,v=r.walkTokens;a.walkTokens=function(m){let c=[];return c.push(v.call(this,m)),o&&(c=c.concat(o.call(this,m))),c}}this.defaults={...this.defaults,...a}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,n){return Pi.lex(e,n??this.defaults)}parser(e,n){return Hi.parse(e,n??this.defaults)}parseMarkdown(e){return(n,r)=>{let a={...r},o={...this.defaults,...a},v=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&a.async===!1)return v(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 v(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return v(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return(async()=>{let m=o.hooks?await o.hooks.preprocess(n):n,c=await(o.hooks?await o.hooks.provideLexer():e?Pi.lex:Pi.lexInline)(m,o),u=o.hooks?await o.hooks.processAllTokens(c):c;o.walkTokens&&await Promise.all(this.walkTokens(u,o.walkTokens));let h=await(o.hooks?await o.hooks.provideParser():e?Hi.parse:Hi.parseInline)(u,o);return o.hooks?await o.hooks.postprocess(h):h})().catch(v);try{o.hooks&&(n=o.hooks.preprocess(n));let m=(o.hooks?o.hooks.provideLexer():e?Pi.lex:Pi.lexInline)(n,o);o.hooks&&(m=o.hooks.processAllTokens(m)),o.walkTokens&&this.walkTokens(m,o.walkTokens);let c=(o.hooks?o.hooks.provideParser():e?Hi.parse:Hi.parseInline)(m,o);return o.hooks&&(c=o.hooks.postprocess(c)),c}catch(m){return v(m)}}}onError(e,n){return r=>{if(r.message+=`
198
- Please report this to https://github.com/markedjs/marked.`,e){let a="<p>An error occurred:</p><pre>"+er(r.message+"",!0)+"</pre>";return n?Promise.resolve(a):a}if(n)return Promise.reject(r);throw r}}},la=new UC;function St(e,n){return la.parse(e,n)}St.options=St.setOptions=function(e){return la.setOptions(e),St.defaults=la.defaults,MC(St.defaults),St};St.getDefaults=bm;St.defaults=ua;St.use=function(...e){return la.use(...e),St.defaults=la.defaults,MC(St.defaults),St};St.walkTokens=function(e,n){return la.walkTokens(e,n)};St.parseInline=la.parseInline;St.Parser=Hi;St.parser=Hi.parse;St.Renderer=lh;St.TextRenderer=km;St.Lexer=Pi;St.lexer=Pi.lex;St.Tokenizer=oh;St.Hooks=Ll;St.parse=St;St.options;St.setOptions;St.use;St.walkTokens;St.parseInline;Hi.parse;Pi.lex;const{entries:FC,setPrototypeOf:sy,isFrozen:q4,getPrototypeOf:W4,getOwnPropertyDescriptor:G4}=Object;let{freeze:Pn,seal:Mi,create:Za}=Object,{apply:wg,construct:Cg}=typeof Reflect<"u"&&Reflect;Pn||(Pn=function(n){return n});Mi||(Mi=function(n){return n});wg||(wg=function(n,r){for(var a=arguments.length,o=new Array(a>2?a-2:0),v=2;v<a;v++)o[v-2]=arguments[v];return n.apply(r,o)});Cg||(Cg=function(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return new n(...a)});const Cl=dn(Array.prototype.forEach),K4=dn(Array.prototype.lastIndexOf),ay=dn(Array.prototype.pop),xl=dn(Array.prototype.push),V4=dn(Array.prototype.splice),jn=Array.isArray,Ml=dn(String.prototype.toLowerCase),yp=dn(String.prototype.toString),oy=dn(String.prototype.match),Ya=dn(String.prototype.replace),ly=dn(String.prototype.indexOf),Y4=dn(String.prototype.trim),X4=dn(Number.prototype.toString),Z4=dn(Boolean.prototype.toString),cy=typeof BigInt>"u"?null:dn(BigInt.prototype.toString),uy=typeof Symbol>"u"?null:dn(Symbol.prototype.toString),Gt=dn(Object.prototype.hasOwnProperty),El=dn(Object.prototype.toString),An=dn(RegExp.prototype.test),xu=J4(TypeError);function dn(e){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return wg(e,n,a)}}function J4(e){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Cg(e,r)}}function Ve(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ml;if(sy&&sy(e,null),!jn(n))return e;let a=n.length;for(;a--;){let o=n[a];if(typeof o=="string"){const v=r(o);v!==o&&(q4(n)||(n[a]=v),o=v)}e[o]=!0}return e}function Q4(e){for(let n=0;n<e.length;n++)Gt(e,n)||(e[n]=null);return e}function Jn(e){const n=Za(null);for(const[r,a]of FC(e))Gt(e,r)&&(jn(a)?n[r]=Q4(a):a&&typeof a=="object"&&a.constructor===Object?n[r]=Jn(a):n[r]=a);return n}function eD(e){switch(typeof e){case"string":return e;case"number":return X4(e);case"boolean":return Z4(e);case"bigint":return cy?cy(e):"0";case"symbol":return uy?uy(e):"Symbol()";case"undefined":return El(e);case"function":case"object":{if(e===null)return El(e);const n=e,r=Ja(n,"toString");if(typeof r=="function"){const a=r(n);return typeof a=="string"?a:El(a)}return El(e)}default:return El(e)}}function Ja(e,n){for(;e!==null;){const a=G4(e,n);if(a){if(a.get)return dn(a.get);if(typeof a.value=="function")return dn(a.value)}e=W4(e)}function r(){return null}return r}function tD(e){try{return An(e,""),!0}catch{return!1}}const hy=Pn(["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"]),Sp=Pn(["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"]),wp=Pn(["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"]),nD=Pn(["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"]),Cp=Pn(["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"]),iD=Pn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),dy=Pn(["#text"]),fy=Pn(["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"]),xp=Pn(["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"]),py=Pn(["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"]),Eu=Pn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rD=Mi(/\{\{[\w\W]*|[\w\W]*\}\}/gm),sD=Mi(/<%[\w\W]*|[\w\W]*%>/gm),aD=Mi(/\$\{[\w\W]*/gm),oD=Mi(/^data-[\-\w.\u00B7-\uFFFF]+$/),lD=Mi(/^aria-[\-\w]+$/),qC=Mi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),cD=Mi(/^(?:\w+script|data):/i),uD=Mi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),WC=Mi(/^html$/i),hD=Mi(/^[a-z][.\w]*(-[.\w]+)+$/i);var gy=Object.freeze({__proto__:null,ARIA_ATTR:lD,ATTR_WHITESPACE:uD,CUSTOM_ELEMENT:hD,DATA_ATTR:oD,DOCTYPE_NAME:WC,ERB_EXPR:sD,IS_ALLOWED_URI:qC,IS_SCRIPT_OR_DATA:cD,MUSTACHE_EXPR:rD,TMPLIT_EXPR:aD});const Tl={element:1,text:3,progressingInstruction:7,comment:8,document:9},dD=function(){return typeof window>"u"?null:window},fD=function(n,r){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let a=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(a=r.getAttribute(o));const v="dompurify"+(a?"#"+a:"");try{return n.createPolicy(v,{createHTML(m){return m},createScriptURL(m){return m}})}catch{return console.warn("TrustedTypes policy "+v+" could not be created."),null}},my=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function GC(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dD();const n=De=>GC(De);if(n.version="3.4.2",n.removed=[],!e||!e.document||e.document.nodeType!==Tl.document||!e.Element)return n.isSupported=!1,n;let{document:r}=e;const a=r,o=a.currentScript,{DocumentFragment:v,HTMLTemplateElement:m,Node:c,Element:u,NodeFilter:h,NamedNodeMap:S=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:C,trustedTypes:x}=e,k=u.prototype,E=Ja(k,"cloneNode"),g=Ja(k,"remove"),b=Ja(k,"nextSibling"),p=Ja(k,"childNodes"),y=Ja(k,"parentNode");if(typeof m=="function"){const De=r.createElement("template");De.content&&De.content.ownerDocument&&(r=De.content.ownerDocument)}let T,A="";const{implementation:L,createNodeIterator:M,createDocumentFragment:R,getElementsByTagName:O}=r,{importNode:F}=a;let U=my();n.isSupported=typeof FC=="function"&&typeof y=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:G,ERB_EXPR:B,TMPLIT_EXPR:K,DATA_ATTR:te,ARIA_ATTR:q,IS_SCRIPT_OR_DATA:W,ATTR_WHITESPACE:Y,CUSTOM_ELEMENT:I}=gy;let{IS_ALLOWED_URI:$}=gy,N=null;const H=Ve({},[...hy,...Sp,...wp,...Cp,...dy]);let Z=null;const ae=Ve({},[...fy,...xp,...py,...Eu]);let ce=Object.seal(Za(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}})),_e=null,Q=null;const P=Object.seal(Za(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let oe=!0,ge=!0,Se=!1,ye=!0,Pe=!1,Fe=!0,Xe=!1,xt=!1,Ne=!1,en=!1,bn=!1,yn=!1,gi=!0,Oi=!1;const tn="user-content-";let ut=!0,Vt=!1,$t={},zt=null;const nn=Ve({},["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 Ni=null;const Mn=Ve({},["audio","video","img","source","image","track"]);let ii=null;const dt=Ve({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Hn="http://www.w3.org/1998/Math/MathML",Yt="http://www.w3.org/2000/svg",Xt="http://www.w3.org/1999/xhtml";let Pt=Xt,ks=!1,lr=null;const ha=Ve({},[Hn,Yt,Xt],yp);let Ii=Ve({},["mi","mo","mn","ms","mtext"]),Ki=Ve({},["annotation-xml"]);const cr=Ve({},["title","style","font","a","script"]);let rn=null;const J=["application/xhtml+xml","text/html"],he="text/html";let be=null,Be=null;const wt=r.createElement("form"),ft=function(V){return V instanceof RegExp||V instanceof Function},Te=function(){let V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Be&&Be===V)return;(!V||typeof V!="object")&&(V={}),V=Jn(V),rn=J.indexOf(V.PARSER_MEDIA_TYPE)===-1?he:V.PARSER_MEDIA_TYPE,be=rn==="application/xhtml+xml"?yp:Ml,N=Gt(V,"ALLOWED_TAGS")&&jn(V.ALLOWED_TAGS)?Ve({},V.ALLOWED_TAGS,be):H,Z=Gt(V,"ALLOWED_ATTR")&&jn(V.ALLOWED_ATTR)?Ve({},V.ALLOWED_ATTR,be):ae,lr=Gt(V,"ALLOWED_NAMESPACES")&&jn(V.ALLOWED_NAMESPACES)?Ve({},V.ALLOWED_NAMESPACES,yp):ha,ii=Gt(V,"ADD_URI_SAFE_ATTR")&&jn(V.ADD_URI_SAFE_ATTR)?Ve(Jn(dt),V.ADD_URI_SAFE_ATTR,be):dt,Ni=Gt(V,"ADD_DATA_URI_TAGS")&&jn(V.ADD_DATA_URI_TAGS)?Ve(Jn(Mn),V.ADD_DATA_URI_TAGS,be):Mn,zt=Gt(V,"FORBID_CONTENTS")&&jn(V.FORBID_CONTENTS)?Ve({},V.FORBID_CONTENTS,be):nn,_e=Gt(V,"FORBID_TAGS")&&jn(V.FORBID_TAGS)?Ve({},V.FORBID_TAGS,be):Jn({}),Q=Gt(V,"FORBID_ATTR")&&jn(V.FORBID_ATTR)?Ve({},V.FORBID_ATTR,be):Jn({}),$t=Gt(V,"USE_PROFILES")?V.USE_PROFILES&&typeof V.USE_PROFILES=="object"?Jn(V.USE_PROFILES):V.USE_PROFILES:!1,oe=V.ALLOW_ARIA_ATTR!==!1,ge=V.ALLOW_DATA_ATTR!==!1,Se=V.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=V.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Pe=V.SAFE_FOR_TEMPLATES||!1,Fe=V.SAFE_FOR_XML!==!1,Xe=V.WHOLE_DOCUMENT||!1,en=V.RETURN_DOM||!1,bn=V.RETURN_DOM_FRAGMENT||!1,yn=V.RETURN_TRUSTED_TYPE||!1,Ne=V.FORCE_BODY||!1,gi=V.SANITIZE_DOM!==!1,Oi=V.SANITIZE_NAMED_PROPS||!1,ut=V.KEEP_CONTENT!==!1,Vt=V.IN_PLACE||!1,$=tD(V.ALLOWED_URI_REGEXP)?V.ALLOWED_URI_REGEXP:qC,Pt=typeof V.NAMESPACE=="string"?V.NAMESPACE:Xt,Ii=Gt(V,"MATHML_TEXT_INTEGRATION_POINTS")&&V.MATHML_TEXT_INTEGRATION_POINTS&&typeof V.MATHML_TEXT_INTEGRATION_POINTS=="object"?Jn(V.MATHML_TEXT_INTEGRATION_POINTS):Ve({},["mi","mo","mn","ms","mtext"]),Ki=Gt(V,"HTML_INTEGRATION_POINTS")&&V.HTML_INTEGRATION_POINTS&&typeof V.HTML_INTEGRATION_POINTS=="object"?Jn(V.HTML_INTEGRATION_POINTS):Ve({},["annotation-xml"]);const pe=Gt(V,"CUSTOM_ELEMENT_HANDLING")&&V.CUSTOM_ELEMENT_HANDLING&&typeof V.CUSTOM_ELEMENT_HANDLING=="object"?Jn(V.CUSTOM_ELEMENT_HANDLING):Za(null);if(ce=Za(null),Gt(pe,"tagNameCheck")&&ft(pe.tagNameCheck)&&(ce.tagNameCheck=pe.tagNameCheck),Gt(pe,"attributeNameCheck")&&ft(pe.attributeNameCheck)&&(ce.attributeNameCheck=pe.attributeNameCheck),Gt(pe,"allowCustomizedBuiltInElements")&&typeof pe.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=pe.allowCustomizedBuiltInElements),Pe&&(ge=!1),bn&&(en=!0),$t&&(N=Ve({},dy),Z=Za(null),$t.html===!0&&(Ve(N,hy),Ve(Z,fy)),$t.svg===!0&&(Ve(N,Sp),Ve(Z,xp),Ve(Z,Eu)),$t.svgFilters===!0&&(Ve(N,wp),Ve(Z,xp),Ve(Z,Eu)),$t.mathMl===!0&&(Ve(N,Cp),Ve(Z,py),Ve(Z,Eu))),P.tagCheck=null,P.attributeCheck=null,Gt(V,"ADD_TAGS")&&(typeof V.ADD_TAGS=="function"?P.tagCheck=V.ADD_TAGS:jn(V.ADD_TAGS)&&(N===H&&(N=Jn(N)),Ve(N,V.ADD_TAGS,be))),Gt(V,"ADD_ATTR")&&(typeof V.ADD_ATTR=="function"?P.attributeCheck=V.ADD_ATTR:jn(V.ADD_ATTR)&&(Z===ae&&(Z=Jn(Z)),Ve(Z,V.ADD_ATTR,be))),Gt(V,"ADD_URI_SAFE_ATTR")&&jn(V.ADD_URI_SAFE_ATTR)&&Ve(ii,V.ADD_URI_SAFE_ATTR,be),Gt(V,"FORBID_CONTENTS")&&jn(V.FORBID_CONTENTS)&&(zt===nn&&(zt=Jn(zt)),Ve(zt,V.FORBID_CONTENTS,be)),Gt(V,"ADD_FORBID_CONTENTS")&&jn(V.ADD_FORBID_CONTENTS)&&(zt===nn&&(zt=Jn(zt)),Ve(zt,V.ADD_FORBID_CONTENTS,be)),ut&&(N["#text"]=!0),Xe&&Ve(N,["html","head","body"]),N.table&&(Ve(N,["tbody"]),delete _e.tbody),V.TRUSTED_TYPES_POLICY){if(typeof V.TRUSTED_TYPES_POLICY.createHTML!="function")throw xu('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof V.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw xu('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=V.TRUSTED_TYPES_POLICY,A=T.createHTML("")}else T===void 0&&(T=fD(x,o)),T!==null&&typeof A=="string"&&(A=T.createHTML(""));Pn&&Pn(V),Be=V},Ce=Ve({},[...Sp,...wp,...nD]),je=Ve({},[...Cp,...iD]),Bt=function(V){let pe=y(V);(!pe||!pe.tagName)&&(pe={namespaceURI:Pt,tagName:"template"});const xe=Ml(V.tagName),rt=Ml(pe.tagName);return lr[V.namespaceURI]?V.namespaceURI===Yt?pe.namespaceURI===Xt?xe==="svg":pe.namespaceURI===Hn?xe==="svg"&&(rt==="annotation-xml"||Ii[rt]):!!Ce[xe]:V.namespaceURI===Hn?pe.namespaceURI===Xt?xe==="math":pe.namespaceURI===Yt?xe==="math"&&Ki[rt]:!!je[xe]:V.namespaceURI===Xt?pe.namespaceURI===Yt&&!Ki[rt]||pe.namespaceURI===Hn&&!Ii[rt]?!1:!je[xe]&&(cr[xe]||!Ce[xe]):!!(rn==="application/xhtml+xml"&&lr[V.namespaceURI]):!1},et=function(V){xl(n.removed,{element:V});try{y(V).removeChild(V)}catch{g(V)}},Sn=function(V,pe){try{xl(n.removed,{attribute:pe.getAttributeNode(V),from:pe})}catch{xl(n.removed,{attribute:null,from:pe})}if(pe.removeAttribute(V),V==="is")if(en||bn)try{et(pe)}catch{}else try{pe.setAttribute(V,"")}catch{}},ur=function(V){let pe=null,xe=null;if(Ne)V="<remove></remove>"+V;else{const At=oy(V,/^[\r\n\t ]+/);xe=At&&At[0]}rn==="application/xhtml+xml"&&Pt===Xt&&(V='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+V+"</body></html>");const rt=T?T.createHTML(V):V;if(Pt===Xt)try{pe=new C().parseFromString(rt,rn)}catch{}if(!pe||!pe.documentElement){pe=L.createDocument(Pt,"template",null);try{pe.documentElement.innerHTML=ks?A:rt}catch{}}const Ze=pe.body||pe.documentElement;return V&&xe&&Ze.insertBefore(r.createTextNode(xe),Ze.childNodes[0]||null),Pt===Xt?O.call(pe,Xe?"html":"body")[0]:Xe?pe.documentElement:Ze},hr=function(V){return M.call(V.ownerDocument||V,V,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},Un=function(V){return V instanceof f&&(typeof V.nodeName!="string"||typeof V.textContent!="string"||typeof V.removeChild!="function"||!(V.attributes instanceof S)||typeof V.removeAttribute!="function"||typeof V.setAttribute!="function"||typeof V.namespaceURI!="string"||typeof V.insertBefore!="function"||typeof V.hasChildNodes!="function")},kt=function(V){return typeof c=="function"&&V instanceof c};function Et(De,V,pe){Cl(De,xe=>{xe.call(n,V,pe,Be)})}const Bi=function(V){let pe=null;if(Et(U.beforeSanitizeElements,V,null),Un(V))return et(V),!0;const xe=be(V.nodeName);if(Et(U.uponSanitizeElement,V,{tagName:xe,allowedTags:N}),Fe&&V.hasChildNodes()&&!kt(V.firstElementChild)&&An(/<[/\w!]/g,V.innerHTML)&&An(/<[/\w!]/g,V.textContent)||Fe&&V.namespaceURI===Xt&&xe==="style"&&kt(V.firstElementChild)||V.nodeType===Tl.progressingInstruction||Fe&&V.nodeType===Tl.comment&&An(/<[/\w]/g,V.data))return et(V),!0;if(_e[xe]||!(P.tagCheck instanceof Function&&P.tagCheck(xe))&&!N[xe]){if(!_e[xe]&&dr(xe)&&(ce.tagNameCheck instanceof RegExp&&An(ce.tagNameCheck,xe)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(xe)))return!1;if(ut&&!zt[xe]){const rt=y(V)||V.parentNode,Ze=p(V)||V.childNodes;if(Ze&&rt){const At=Ze.length;for(let Ht=At-1;Ht>=0;--Ht){const Ut=E(Ze[Ht],!0);rt.insertBefore(Ut,b(V))}}}return et(V),!0}return V instanceof u&&!Bt(V)||(xe==="noscript"||xe==="noembed"||xe==="noframes")&&An(/<\/no(script|embed|frames)/i,V.innerHTML)?(et(V),!0):(Pe&&V.nodeType===Tl.text&&(pe=V.textContent,Cl([G,B,K],rt=>{pe=Ya(pe,rt," ")}),V.textContent!==pe&&(xl(n.removed,{element:V.cloneNode()}),V.textContent=pe)),Et(U.afterSanitizeElements,V,null),!1)},Hr=function(V,pe,xe){if(Q[pe]||gi&&(pe==="id"||pe==="name")&&(xe in r||xe in wt))return!1;const rt=Z[pe]||P.attributeCheck instanceof Function&&P.attributeCheck(pe,V);if(!(ge&&!Q[pe]&&An(te,pe))){if(!(oe&&An(q,pe))){if(!rt||Q[pe]){if(!(dr(V)&&(ce.tagNameCheck instanceof RegExp&&An(ce.tagNameCheck,V)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(V))&&(ce.attributeNameCheck instanceof RegExp&&An(ce.attributeNameCheck,pe)||ce.attributeNameCheck instanceof Function&&ce.attributeNameCheck(pe,V))||pe==="is"&&ce.allowCustomizedBuiltInElements&&(ce.tagNameCheck instanceof RegExp&&An(ce.tagNameCheck,xe)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(xe))))return!1}else if(!ii[pe]){if(!An($,Ya(xe,Y,""))){if(!((pe==="src"||pe==="xlink:href"||pe==="href")&&V!=="script"&&ly(xe,"data:")===0&&Ni[V])){if(!(Se&&!An(W,Ya(xe,Y,"")))){if(xe)return!1}}}}}}return!0},da=Ve({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),dr=function(V){return!da[Ml(V)]&&An(I,V)},As=function(V){Et(U.beforeSanitizeAttributes,V,null);const{attributes:pe}=V;if(!pe||Un(V))return;const xe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z,forceKeepAttr:void 0};let rt=pe.length;for(;rt--;){const Ze=pe[rt],{name:At,namespaceURI:Ht,value:Ut}=Ze,me=be(At),Me=Ut;let Oe=At==="value"?Me:Y4(Me);if(xe.attrName=me,xe.attrValue=Oe,xe.keepAttr=!0,xe.forceKeepAttr=void 0,Et(U.uponSanitizeAttribute,V,xe),Oe=xe.attrValue,Oi&&(me==="id"||me==="name")&&ly(Oe,tn)!==0&&(Sn(At,V),Oe=tn+Oe),Fe&&An(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Oe)){Sn(At,V);continue}if(me==="attributename"&&oy(Oe,"href")){Sn(At,V);continue}if(xe.forceKeepAttr)continue;if(!xe.keepAttr){Sn(At,V);continue}if(!ye&&An(/\/>/i,Oe)){Sn(At,V);continue}Pe&&Cl([G,B,K],Ot=>{Oe=Ya(Oe,Ot," ")});const at=be(V.nodeName);if(!Hr(at,me,Oe)){Sn(At,V);continue}if(T&&typeof x=="object"&&typeof x.getAttributeType=="function"&&!Ht)switch(x.getAttributeType(at,me)){case"TrustedHTML":{Oe=T.createHTML(Oe);break}case"TrustedScriptURL":{Oe=T.createScriptURL(Oe);break}}if(Oe!==Me)try{Ht?V.setAttributeNS(Ht,At,Oe):V.setAttribute(At,Oe),Un(V)?et(V):ay(n.removed)}catch{Sn(At,V)}}Et(U.afterSanitizeAttributes,V,null)},Vi=function(V){let pe=null;const xe=hr(V);for(Et(U.beforeSanitizeShadowDOM,V,null);pe=xe.nextNode();)Et(U.uponSanitizeShadowNode,pe,null),Bi(pe),As(pe),pe.content instanceof v&&Vi(pe.content);Et(U.afterSanitizeShadowDOM,V,null)};return n.sanitize=function(De){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},pe=null,xe=null,rt=null,Ze=null;if(ks=!De,ks&&(De="<!-->"),typeof De!="string"&&!kt(De)&&(De=eD(De),typeof De!="string"))throw xu("dirty is not a string, aborting");if(!n.isSupported)return De;if(xt||Te(V),n.removed=[],typeof De=="string"&&(Vt=!1),Vt){const Ut=De.nodeName;if(typeof Ut=="string"){const me=be(Ut);if(!N[me]||_e[me])throw xu("root node is forbidden and cannot be sanitized in-place")}}else if(De instanceof c)pe=ur("<!---->"),xe=pe.ownerDocument.importNode(De,!0),xe.nodeType===Tl.element&&xe.nodeName==="BODY"||xe.nodeName==="HTML"?pe=xe:pe.appendChild(xe);else{if(!en&&!Pe&&!Xe&&De.indexOf("<")===-1)return T&&yn?T.createHTML(De):De;if(pe=ur(De),!pe)return en?null:yn?A:""}pe&&Ne&&et(pe.firstChild);const At=hr(Vt?De:pe);for(;rt=At.nextNode();)Bi(rt),As(rt),rt.content instanceof v&&Vi(rt.content);if(Vt)return De;if(en){if(Pe){pe.normalize();let Ut=pe.innerHTML;Cl([G,B,K],me=>{Ut=Ya(Ut,me," ")}),pe.innerHTML=Ut}if(bn)for(Ze=R.call(pe.ownerDocument);pe.firstChild;)Ze.appendChild(pe.firstChild);else Ze=pe;return(Z.shadowroot||Z.shadowrootmode)&&(Ze=F.call(a,Ze,!0)),Ze}let Ht=Xe?pe.outerHTML:pe.innerHTML;return Xe&&N["!doctype"]&&pe.ownerDocument&&pe.ownerDocument.doctype&&pe.ownerDocument.doctype.name&&An(WC,pe.ownerDocument.doctype.name)&&(Ht="<!DOCTYPE "+pe.ownerDocument.doctype.name+`>
199
- `+Ht),Pe&&Cl([G,B,K],Ut=>{Ht=Ya(Ht,Ut," ")}),T&&yn?T.createHTML(Ht):Ht},n.setConfig=function(){let De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Te(De),xt=!0},n.clearConfig=function(){Be=null,xt=!1},n.isValidAttribute=function(De,V,pe){Be||Te({});const xe=be(De),rt=be(V);return Hr(xe,rt,pe)},n.addHook=function(De,V){typeof V=="function"&&xl(U[De],V)},n.removeHook=function(De,V){if(V!==void 0){const pe=K4(U[De],V);return pe===-1?void 0:V4(U[De],pe,1)[0]}return ay(U[De])},n.removeHooks=function(De){U[De]=[]},n.removeAllHooks=function(){U=my()},n}var jl=GC(),Ep,_y;function pD(){if(_y)return Ep;_y=1;function e(J){return J instanceof Map?J.clear=J.delete=J.set=function(){throw new Error("map is read-only")}:J instanceof Set&&(J.add=J.clear=J.delete=function(){throw new Error("set is read-only")}),Object.freeze(J),Object.getOwnPropertyNames(J).forEach(he=>{const be=J[he],Be=typeof be;(Be==="object"||Be==="function")&&!Object.isFrozen(be)&&e(be)}),J}class n{constructor(he){he.data===void 0&&(he.data={}),this.data=he.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(J){return J.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function a(J,...he){const be=Object.create(null);for(const Be in J)be[Be]=J[Be];return he.forEach(function(Be){for(const wt in Be)be[wt]=Be[wt]}),be}const o="</span>",v=J=>!!J.scope,m=(J,{prefix:he})=>{if(J.startsWith("language:"))return J.replace("language:","language-");if(J.includes(".")){const be=J.split(".");return[`${he}${be.shift()}`,...be.map((Be,wt)=>`${Be}${"_".repeat(wt+1)}`)].join(" ")}return`${he}${J}`};class c{constructor(he,be){this.buffer="",this.classPrefix=be.classPrefix,he.walk(this)}addText(he){this.buffer+=r(he)}openNode(he){if(!v(he))return;const be=m(he.scope,{prefix:this.classPrefix});this.span(be)}closeNode(he){v(he)&&(this.buffer+=o)}value(){return this.buffer}span(he){this.buffer+=`<span class="${he}">`}}const u=(J={})=>{const he={children:[]};return Object.assign(he,J),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 be=u({scope:he});this.add(be),this.stack.push(be)}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,be){return typeof be=="string"?he.addText(be):be.children&&(he.openNode(be),be.children.forEach(Be=>this._walk(he,Be)),he.closeNode(be)),he}static _collapse(he){typeof he!="string"&&he.children&&(he.children.every(be=>typeof be=="string")?he.children=[he.children.join("")]:he.children.forEach(be=>{h._collapse(be)}))}}class S extends h{constructor(he){super(),this.options=he}addText(he){he!==""&&this.add(he)}startScope(he){this.openNode(he)}endScope(){this.closeNode()}__addSublanguage(he,be){const Be=he.root;be&&(Be.scope=`language:${be}`),this.add(Be)}toHTML(){return new c(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function f(J){return J?typeof J=="string"?J:J.source:null}function C(J){return E("(?=",J,")")}function x(J){return E("(?:",J,")*")}function k(J){return E("(?:",J,")?")}function E(...J){return J.map(be=>f(be)).join("")}function g(J){const he=J[J.length-1];return typeof he=="object"&&he.constructor===Object?(J.splice(J.length-1,1),he):{}}function b(...J){return"("+(g(J).capture?"":"?:")+J.map(Be=>f(Be)).join("|")+")"}function p(J){return new RegExp(J.toString()+"|").exec("").length-1}function y(J,he){const be=J&&J.exec(he);return be&&be.index===0}const T=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function A(J,{joinWith:he}){let be=0;return J.map(Be=>{be+=1;const wt=be;let ft=f(Be),Te="";for(;ft.length>0;){const Ce=T.exec(ft);if(!Ce){Te+=ft;break}Te+=ft.substring(0,Ce.index),ft=ft.substring(Ce.index+Ce[0].length),Ce[0][0]==="\\"&&Ce[1]?Te+="\\"+String(Number(Ce[1])+wt):(Te+=Ce[0],Ce[0]==="("&&be++)}return Te}).map(Be=>`(${Be})`).join(he)}const L=/\b\B/,M="[a-zA-Z]\\w*",R="[a-zA-Z_]\\w*",O="\\b\\d+(\\.\\d+)?",F="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",U="\\b(0b[01]+)",G="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",B=(J={})=>{const he=/^#![ ]*\//;return J.binary&&(J.begin=E(he,/.*\b/,J.binary,/\b.*/)),a({scope:"meta",begin:he,end:/$/,relevance:0,"on:begin":(be,Be)=>{be.index!==0&&Be.ignoreMatch()}},J)},K={begin:"\\\\[\\s\\S]",relevance:0},te={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[K]},q={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[K]},W={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/},Y=function(J,he,be={}){const Be=a({scope:"comment",begin:J,end:he,contains:[]},be);Be.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 wt=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 Be.contains.push({begin:E(/[ ]+/,"(",wt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Be},I=Y("//","$"),$=Y("/\\*","\\*/"),N=Y("#","$"),H={scope:"number",begin:O,relevance:0},Z={scope:"number",begin:F,relevance:0},ae={scope:"number",begin:U,relevance:0},ce={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[K,{begin:/\[/,end:/\]/,relevance:0,contains:[K]}]},_e={scope:"title",begin:M,relevance:0},Q={scope:"title",begin:R,relevance:0},P={begin:"\\.\\s*"+R,relevance:0};var ge=Object.freeze({__proto__:null,APOS_STRING_MODE:te,BACKSLASH_ESCAPE:K,BINARY_NUMBER_MODE:ae,BINARY_NUMBER_RE:U,COMMENT:Y,C_BLOCK_COMMENT_MODE:$,C_LINE_COMMENT_MODE:I,C_NUMBER_MODE:Z,C_NUMBER_RE:F,END_SAME_AS_BEGIN:function(J){return Object.assign(J,{"on:begin":(he,be)=>{be.data._beginMatch=he[1]},"on:end":(he,be)=>{be.data._beginMatch!==he[1]&&be.ignoreMatch()}})},HASH_COMMENT_MODE:N,IDENT_RE:M,MATCH_NOTHING_RE:L,METHOD_GUARD:P,NUMBER_MODE:H,NUMBER_RE:O,PHRASAL_WORDS_MODE:W,QUOTE_STRING_MODE:q,REGEXP_MODE:ce,RE_STARTERS_RE:G,SHEBANG:B,TITLE_MODE:_e,UNDERSCORE_IDENT_RE:R,UNDERSCORE_TITLE_MODE:Q});function Se(J,he){J.input[J.index-1]==="."&&he.ignoreMatch()}function ye(J,he){J.className!==void 0&&(J.scope=J.className,delete J.className)}function Pe(J,he){he&&J.beginKeywords&&(J.begin="\\b("+J.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",J.__beforeBegin=Se,J.keywords=J.keywords||J.beginKeywords,delete J.beginKeywords,J.relevance===void 0&&(J.relevance=0))}function Fe(J,he){Array.isArray(J.illegal)&&(J.illegal=b(...J.illegal))}function Xe(J,he){if(J.match){if(J.begin||J.end)throw new Error("begin & end are not supported with match");J.begin=J.match,delete J.match}}function xt(J,he){J.relevance===void 0&&(J.relevance=1)}const Ne=(J,he)=>{if(!J.beforeMatch)return;if(J.starts)throw new Error("beforeMatch cannot be used with starts");const be=Object.assign({},J);Object.keys(J).forEach(Be=>{delete J[Be]}),J.keywords=be.keywords,J.begin=E(be.beforeMatch,C(be.begin)),J.starts={relevance:0,contains:[Object.assign(be,{endsParent:!0})]},J.relevance=0,delete be.beforeMatch},en=["of","and","for","in","not","or","if","then","parent","list","value"],bn="keyword";function yn(J,he,be=bn){const Be=Object.create(null);return typeof J=="string"?wt(be,J.split(" ")):Array.isArray(J)?wt(be,J):Object.keys(J).forEach(function(ft){Object.assign(Be,yn(J[ft],he,ft))}),Be;function wt(ft,Te){he&&(Te=Te.map(Ce=>Ce.toLowerCase())),Te.forEach(function(Ce){const je=Ce.split("|");Be[je[0]]=[ft,gi(je[0],je[1])]})}}function gi(J,he){return he?Number(he):Oi(J)?0:1}function Oi(J){return en.includes(J.toLowerCase())}const tn={},ut=J=>{console.error(J)},Vt=(J,...he)=>{console.log(`WARN: ${J}`,...he)},$t=(J,he)=>{tn[`${J}/${he}`]||(console.log(`Deprecated as of ${J}. ${he}`),tn[`${J}/${he}`]=!0)},zt=new Error;function nn(J,he,{key:be}){let Be=0;const wt=J[be],ft={},Te={};for(let Ce=1;Ce<=he.length;Ce++)Te[Ce+Be]=wt[Ce],ft[Ce+Be]=!0,Be+=p(he[Ce-1]);J[be]=Te,J[be]._emit=ft,J[be]._multi=!0}function Ni(J){if(Array.isArray(J.begin)){if(J.skip||J.excludeBegin||J.returnBegin)throw ut("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),zt;if(typeof J.beginScope!="object"||J.beginScope===null)throw ut("beginScope must be object"),zt;nn(J,J.begin,{key:"beginScope"}),J.begin=A(J.begin,{joinWith:""})}}function Mn(J){if(Array.isArray(J.end)){if(J.skip||J.excludeEnd||J.returnEnd)throw ut("skip, excludeEnd, returnEnd not compatible with endScope: {}"),zt;if(typeof J.endScope!="object"||J.endScope===null)throw ut("endScope must be object"),zt;nn(J,J.end,{key:"endScope"}),J.end=A(J.end,{joinWith:""})}}function ii(J){J.scope&&typeof J.scope=="object"&&J.scope!==null&&(J.beginScope=J.scope,delete J.scope)}function dt(J){ii(J),typeof J.beginScope=="string"&&(J.beginScope={_wrap:J.beginScope}),typeof J.endScope=="string"&&(J.endScope={_wrap:J.endScope}),Ni(J),Mn(J)}function Hn(J){function he(Te,Ce){return new RegExp(f(Te),"m"+(J.case_insensitive?"i":"")+(J.unicodeRegex?"u":"")+(Ce?"g":""))}class be{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ce,je){je.position=this.position++,this.matchIndexes[this.matchAt]=je,this.regexes.push([je,Ce]),this.matchAt+=p(Ce)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ce=this.regexes.map(je=>je[1]);this.matcherRe=he(A(Ce,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ce){this.matcherRe.lastIndex=this.lastIndex;const je=this.matcherRe.exec(Ce);if(!je)return null;const Bt=je.findIndex((Sn,ur)=>ur>0&&Sn!==void 0),et=this.matchIndexes[Bt];return je.splice(0,Bt),Object.assign(je,et)}}class Be{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 je=new be;return this.rules.slice(Ce).forEach(([Bt,et])=>je.addRule(Bt,et)),je.compile(),this.multiRegexes[Ce]=je,je}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ce,je){this.rules.push([Ce,je]),je.type==="begin"&&this.count++}exec(Ce){const je=this.getMatcher(this.regexIndex);je.lastIndex=this.lastIndex;let Bt=je.exec(Ce);if(this.resumingScanAtSamePosition()&&!(Bt&&Bt.index===this.lastIndex)){const et=this.getMatcher(0);et.lastIndex=this.lastIndex+1,Bt=et.exec(Ce)}return Bt&&(this.regexIndex+=Bt.position+1,this.regexIndex===this.count&&this.considerAll()),Bt}}function wt(Te){const Ce=new Be;return Te.contains.forEach(je=>Ce.addRule(je.begin,{rule:je,type:"begin"})),Te.terminatorEnd&&Ce.addRule(Te.terminatorEnd,{type:"end"}),Te.illegal&&Ce.addRule(Te.illegal,{type:"illegal"}),Ce}function ft(Te,Ce){const je=Te;if(Te.isCompiled)return je;[ye,Xe,dt,Ne].forEach(et=>et(Te,Ce)),J.compilerExtensions.forEach(et=>et(Te,Ce)),Te.__beforeBegin=null,[Pe,Fe,xt].forEach(et=>et(Te,Ce)),Te.isCompiled=!0;let Bt=null;return typeof Te.keywords=="object"&&Te.keywords.$pattern&&(Te.keywords=Object.assign({},Te.keywords),Bt=Te.keywords.$pattern,delete Te.keywords.$pattern),Bt=Bt||/\w+/,Te.keywords&&(Te.keywords=yn(Te.keywords,J.case_insensitive)),je.keywordPatternRe=he(Bt,!0),Ce&&(Te.begin||(Te.begin=/\B|\b/),je.beginRe=he(je.begin),!Te.end&&!Te.endsWithParent&&(Te.end=/\B|\b/),Te.end&&(je.endRe=he(je.end)),je.terminatorEnd=f(je.end)||"",Te.endsWithParent&&Ce.terminatorEnd&&(je.terminatorEnd+=(Te.end?"|":"")+Ce.terminatorEnd)),Te.illegal&&(je.illegalRe=he(Te.illegal)),Te.contains||(Te.contains=[]),Te.contains=[].concat(...Te.contains.map(function(et){return Xt(et==="self"?Te:et)})),Te.contains.forEach(function(et){ft(et,je)}),Te.starts&&ft(Te.starts,Ce),je.matcher=wt(je),je}if(J.compilerExtensions||(J.compilerExtensions=[]),J.contains&&J.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return J.classNameAliases=a(J.classNameAliases||{}),ft(J)}function Yt(J){return J?J.endsWithParent||Yt(J.starts):!1}function Xt(J){return J.variants&&!J.cachedVariants&&(J.cachedVariants=J.variants.map(function(he){return a(J,{variants:null},he)})),J.cachedVariants?J.cachedVariants:Yt(J)?a(J,{starts:J.starts?a(J.starts):null}):Object.isFrozen(J)?a(J):J}var Pt="11.11.1";class ks extends Error{constructor(he,be){super(he),this.name="HTMLInjectionError",this.html=be}}const lr=r,ha=a,Ii=Symbol("nomatch"),Ki=7,cr=function(J){const he=Object.create(null),be=Object.create(null),Be=[];let wt=!0;const ft="Could not find the language '{}', did you forget to load/include a language module?",Te={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:S};function je(me){return Ce.noHighlightRe.test(me)}function Bt(me){let Me=me.className+" ";Me+=me.parentNode?me.parentNode.className:"";const Oe=Ce.languageDetectRe.exec(Me);if(Oe){const at=V(Oe[1]);return at||(Vt(ft.replace("{}",Oe[1])),Vt("Falling back to no-highlight mode for this block.",me)),at?Oe[1]:"no-highlight"}return Me.split(/\s+/).find(at=>je(at)||V(at))}function et(me,Me,Oe){let at="",Ot="";typeof Me=="object"?(at=me,Oe=Me.ignoreIllegals,Ot=Me.language):($t("10.7.0","highlight(lang, code, ...args) has been deprecated."),$t("10.7.0",`Please use highlight(code, options) instead.
200
- https://github.com/highlightjs/highlight.js/issues/2277`),Ot=me,at=Me),Oe===void 0&&(Oe=!0);const Dn={code:at,language:Ot};Ht("before:highlight",Dn);const ri=Dn.result?Dn.result:Sn(Dn.language,Dn.code,Oe);return ri.code=Dn.code,Ht("after:highlight",ri),ri}function Sn(me,Me,Oe,at){const Ot=Object.create(null);function Dn(we,Re){return we.keywords[Re]}function ri(){if(!He.keywords){sn.addText(pt);return}let we=0;He.keywordPatternRe.lastIndex=0;let Re=He.keywordPatternRe.exec(pt),qe="";for(;Re;){qe+=pt.substring(we,Re.index);const tt=wn.case_insensitive?Re[0].toLowerCase():Re[0],jt=Dn(He,tt);if(jt){const[mi,Eo]=jt;if(sn.addText(qe),qe="",Ot[tt]=(Ot[tt]||0)+1,Ot[tt]<=Ki&&(Ur+=Eo),mi.startsWith("_"))qe+=Re[0];else{const sc=wn.classNameAliases[mi]||mi;si(Re[0],sc)}}else qe+=Re[0];we=He.keywordPatternRe.lastIndex,Re=He.keywordPatternRe.exec(pt)}qe+=pt.substring(we),sn.addText(qe)}function Fn(){if(pt==="")return;let we=null;if(typeof He.subLanguage=="string"){if(!he[He.subLanguage]){sn.addText(pt);return}we=Sn(He.subLanguage,pt,!0,rc[He.subLanguage]),rc[He.subLanguage]=we._top}else we=hr(pt,He.subLanguage.length?He.subLanguage:null);He.relevance>0&&(Ur+=we.relevance),sn.__addSublanguage(we._emitter,we.language)}function Tt(){He.subLanguage!=null?Fn():ri(),pt=""}function si(we,Re){we!==""&&(sn.startScope(Re),sn.addText(we),sn.endScope())}function nc(we,Re){let qe=1;const tt=Re.length-1;for(;qe<=tt;){if(!we._emit[qe]){qe++;continue}const jt=wn.classNameAliases[we[qe]]||we[qe],mi=Re[qe];jt?si(mi,jt):(pt=mi,ri(),pt=""),qe++}}function fa(we,Re){return we.scope&&typeof we.scope=="string"&&sn.openNode(wn.classNameAliases[we.scope]||we.scope),we.beginScope&&(we.beginScope._wrap?(si(pt,wn.classNameAliases[we.beginScope._wrap]||we.beginScope._wrap),pt=""):we.beginScope._multi&&(nc(we.beginScope,Re),pt="")),He=Object.create(we,{parent:{value:He}}),He}function wo(we,Re,qe){let tt=y(we.endRe,qe);if(tt){if(we["on:end"]){const jt=new n(we);we["on:end"](Re,jt),jt.isMatchIgnored&&(tt=!1)}if(tt){for(;we.endsParent&&we.parent;)we=we.parent;return we}}if(we.endsWithParent)return wo(we.parent,Re,qe)}function pa(we){return He.matcher.regexIndex===0?(pt+=we[0],1):(Fr=!0,0)}function Ih(we){const Re=we[0],qe=we.rule,tt=new n(qe),jt=[qe.__beforeBegin,qe["on:begin"]];for(const mi of jt)if(mi&&(mi(we,tt),tt.isMatchIgnored))return pa(Re);return qe.skip?pt+=Re:(qe.excludeBegin&&(pt+=Re),Tt(),!qe.returnBegin&&!qe.excludeBegin&&(pt=Re)),fa(qe,we),qe.returnBegin?0:Re.length}function qn(we){const Re=we[0],qe=Me.substring(we.index),tt=wo(He,we,qe);if(!tt)return Ii;const jt=He;He.endScope&&He.endScope._wrap?(Tt(),si(Re,He.endScope._wrap)):He.endScope&&He.endScope._multi?(Tt(),nc(He.endScope,we)):jt.skip?pt+=Re:(jt.returnEnd||jt.excludeEnd||(pt+=Re),Tt(),jt.excludeEnd&&(pt=Re));do He.scope&&sn.closeNode(),!He.skip&&!He.subLanguage&&(Ur+=He.relevance),He=He.parent;while(He!==tt.parent);return tt.starts&&fa(tt.starts,we),jt.returnEnd?0:Re.length}function Co(){const we=[];for(let Re=He;Re!==wn;Re=Re.parent)Re.scope&&we.unshift(Re.scope);we.forEach(Re=>sn.openNode(Re))}let Rs={};function ga(we,Re){const qe=Re&&Re[0];if(pt+=we,qe==null)return Tt(),0;if(Rs.type==="begin"&&Re.type==="end"&&Rs.index===Re.index&&qe===""){if(pt+=Me.slice(Re.index,Re.index+1),!wt){const tt=new Error(`0 width match regex (${me})`);throw tt.languageName=me,tt.badRule=Rs.rule,tt}return 1}if(Rs=Re,Re.type==="begin")return Ih(Re);if(Re.type==="illegal"&&!Oe){const tt=new Error('Illegal lexeme "'+qe+'" for mode "'+(He.scope||"<unnamed>")+'"');throw tt.mode=He,tt}else if(Re.type==="end"){const tt=qn(Re);if(tt!==Ii)return tt}if(Re.type==="illegal"&&qe==="")return pt+=`
201
- `,1;if(xo>1e5&&xo>Re.index*3)throw new Error("potential infinite loop, way more iterations than matches");return pt+=qe,qe.length}const wn=V(me);if(!wn)throw ut(ft.replace("{}",me)),new Error('Unknown language: "'+me+'"');const ic=Hn(wn);let ma="",He=at||ic;const rc={},sn=new Ce.__emitter(Ce);Co();let pt="",Ur=0,fr=0,xo=0,Fr=!1;try{if(wn.__emitTokens)wn.__emitTokens(Me,sn);else{for(He.matcher.considerAll();;){xo++,Fr?Fr=!1:He.matcher.considerAll(),He.matcher.lastIndex=fr;const we=He.matcher.exec(Me);if(!we)break;const Re=Me.substring(fr,we.index),qe=ga(Re,we);fr=we.index+qe}ga(Me.substring(fr))}return sn.finalize(),ma=sn.toHTML(),{language:me,value:ma,relevance:Ur,illegal:!1,_emitter:sn,_top:He}}catch(we){if(we.message&&we.message.includes("Illegal"))return{language:me,value:lr(Me),illegal:!0,relevance:0,_illegalBy:{message:we.message,index:fr,context:Me.slice(fr-100,fr+100),mode:we.mode,resultSoFar:ma},_emitter:sn};if(wt)return{language:me,value:lr(Me),illegal:!1,relevance:0,errorRaised:we,_emitter:sn,_top:He};throw we}}function ur(me){const Me={value:lr(me),illegal:!1,relevance:0,_top:Te,_emitter:new Ce.__emitter(Ce)};return Me._emitter.addText(me),Me}function hr(me,Me){Me=Me||Ce.languages||Object.keys(he);const Oe=ur(me),at=Me.filter(V).filter(xe).map(Tt=>Sn(Tt,me,!1));at.unshift(Oe);const Ot=at.sort((Tt,si)=>{if(Tt.relevance!==si.relevance)return si.relevance-Tt.relevance;if(Tt.language&&si.language){if(V(Tt.language).supersetOf===si.language)return 1;if(V(si.language).supersetOf===Tt.language)return-1}return 0}),[Dn,ri]=Ot,Fn=Dn;return Fn.secondBest=ri,Fn}function Un(me,Me,Oe){const at=Me&&be[Me]||Oe;me.classList.add("hljs"),me.classList.add(`language-${at}`)}function kt(me){let Me=null;const Oe=Bt(me);if(je(Oe))return;if(Ht("before:highlightElement",{el:me,language:Oe}),me.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",me);return}if(me.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(me)),Ce.throwUnescapedHTML))throw new ks("One of your code blocks includes unescaped HTML.",me.innerHTML);Me=me;const at=Me.textContent,Ot=Oe?et(at,{language:Oe,ignoreIllegals:!0}):hr(at);me.innerHTML=Ot.value,me.dataset.highlighted="yes",Un(me,Oe,Ot.language),me.result={language:Ot.language,re:Ot.relevance,relevance:Ot.relevance},Ot.secondBest&&(me.secondBest={language:Ot.secondBest.language,relevance:Ot.secondBest.relevance}),Ht("after:highlightElement",{el:me,result:Ot,text:at})}function Et(me){Ce=ha(Ce,me)}const Bi=()=>{dr(),$t("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Hr(){dr(),$t("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let da=!1;function dr(){function me(){dr()}if(document.readyState==="loading"){da||window.addEventListener("DOMContentLoaded",me,!1),da=!0;return}document.querySelectorAll(Ce.cssSelector).forEach(kt)}function As(me,Me){let Oe=null;try{Oe=Me(J)}catch(at){if(ut("Language definition for '{}' could not be registered.".replace("{}",me)),wt)ut(at);else throw at;Oe=Te}Oe.name||(Oe.name=me),he[me]=Oe,Oe.rawDefinition=Me.bind(null,J),Oe.aliases&&pe(Oe.aliases,{languageName:me})}function Vi(me){delete he[me];for(const Me of Object.keys(be))be[Me]===me&&delete be[Me]}function De(){return Object.keys(he)}function V(me){return me=(me||"").toLowerCase(),he[me]||he[be[me]]}function pe(me,{languageName:Me}){typeof me=="string"&&(me=[me]),me.forEach(Oe=>{be[Oe.toLowerCase()]=Me})}function xe(me){const Me=V(me);return Me&&!Me.disableAutodetect}function rt(me){me["before:highlightBlock"]&&!me["before:highlightElement"]&&(me["before:highlightElement"]=Me=>{me["before:highlightBlock"](Object.assign({block:Me.el},Me))}),me["after:highlightBlock"]&&!me["after:highlightElement"]&&(me["after:highlightElement"]=Me=>{me["after:highlightBlock"](Object.assign({block:Me.el},Me))})}function Ze(me){rt(me),Be.push(me)}function At(me){const Me=Be.indexOf(me);Me!==-1&&Be.splice(Me,1)}function Ht(me,Me){const Oe=me;Be.forEach(function(at){at[Oe]&&at[Oe](Me)})}function Ut(me){return $t("10.7.0","highlightBlock will be removed entirely in v12.0"),$t("10.7.0","Please use highlightElement now."),kt(me)}Object.assign(J,{highlight:et,highlightAuto:hr,highlightAll:dr,highlightElement:kt,highlightBlock:Ut,configure:Et,initHighlighting:Bi,initHighlightingOnLoad:Hr,registerLanguage:As,unregisterLanguage:Vi,listLanguages:De,getLanguage:V,registerAliases:pe,autoDetection:xe,inherit:ha,addPlugin:Ze,removePlugin:At}),J.debugMode=function(){wt=!1},J.safeMode=function(){wt=!0},J.versionString=Pt,J.regex={concat:E,lookahead:C,either:b,optional:k,anyNumberOfTimes:x};for(const me in ge)typeof ge[me]=="object"&&e(ge[me]);return Object.assign(J,ge),J},rn=cr({});return rn.newInstance=()=>cr({}),Ep=rn,rn.HighlightJS=rn,rn.default=rn,Ep}var gD=pD();const Ei=ME(gD);function vy(e){const n=e.regex,r={},a={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},v=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),m={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,r,o]};o.contains.push(c);const u={match:/\\"/},h={className:"string",begin:/'/,end:/'/},S={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,r]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],x=e.SHEBANG({binary:`(${C.join("|")})`,relevance:10}),k={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},E=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],g=["true","false"],b={match:/(\/[a-z._-]+)+/},p=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],y=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],T=["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"],A=["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:E,literal:g,built_in:[...p,...y,"set","shopt",...T,...A]},contains:[x,e.SHEBANG(),k,f,v,m,b,c,u,h,S,r]}}const by="[A-Za-z$_][0-9A-Za-z$_]*",mD=["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"],_D=["true","false","null","undefined","NaN","Infinity"],KC=["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"],VC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],YC=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],vD=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],bD=[].concat(YC,KC,VC);function yy(e){const n=e.regex,r=(Y,{after:I})=>{const $="</"+Y[0].slice(1);return Y.input.indexOf($,I)!==-1},a=by,o={begin:"<>",end:"</>"},v=/<[A-Za-z0-9\\._:-]+\s*\/>/,m={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Y,I)=>{const $=Y[0].length+Y.index,N=Y.input[$];if(N==="<"||N===","){I.ignoreMatch();return}N===">"&&(r(Y,{after:$})||I.ignoreMatch());let H;const Z=Y.input.substring($);if(H=Z.match(/^\s*=/)){I.ignoreMatch();return}if((H=Z.match(/^\s+extends\s+/))&&H.index===0){I.ignoreMatch();return}}},c={$pattern:by,keyword:mD,literal:_D,built_in:bD,"variable.language":vD},u="[0-9](_?[0-9])*",h=`\\.(${u})`,S="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${S})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${S})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},k={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,C]},p={className:"comment",variants:[e.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:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},y=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,k,E,g,{match:/\$\d+/},f];C.contains=y.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(y)});const T=[].concat(p,C.contains),A=T.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(T)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:A},M={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,n.concat(a,"(",n.concat(/\./,a),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,a],scope:{1:"keyword",3:"title.class"}}]},R={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:{_:[...KC,...VC]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},F={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(Y){return n.concat("(?!",Y.join("|"),")")}const B={match:n.concat(/\b/,G([...YC,"super","import"].map(Y=>`${Y}\\s*\\(`)),a,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},K={begin:n.concat(/\./,n.lookahead(n.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},te={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",W={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(q)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:A,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,k,E,g,p,{match:/\$\d+/},f,R,{scope:"attr",match:a+n.lookahead(":"),relevance:0},W,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[p,e.REGEXP_MODE,{className:"function",begin:q,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:A}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:v},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:"xml",contains:[{begin:m.begin,end:m.end,skip:!0,contains:["self"]}]}]},F,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},B,U,M,te,{match:/\$[(.]/}]}}function yD(e){const n={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},a=["true","false","null"],o={scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:a},contains:[n,r,e.QUOTE_STRING_MODE,o,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Sy(e){const n=e.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},a={begin:"^[-\\*]{3,}",end:"$"},o={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}]},v={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},m={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}/}]},S={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(h,{contains:[]}),C=e.inherit(S,{contains:[]});h.contains.push(C),S.contains.push(f);let x=[r,u];return[h,S,f,C].forEach(b=>{b.contains=b.contains.concat(x)}),x=x.concat(h,S),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:x},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:x}]}]},r,v,h,S,{className:"quote",begin:"^>\\s+",contains:x,end:"$"},o,a,u,m,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function wy(e){const n=e.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),a=["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:a,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:/#/},S={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u,S,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u,S,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:[e.BACKSLASH_ESCAPE,S,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,S,h]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",x=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,k=`\\b|${a.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${x}))[eE][+-]?(${C})[jJ]?(?=${k})`},{begin:`(${x})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${k})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${k})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${k})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${k})`},{begin:`\\b(${C})[jJ](?=${k})`}]},g={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,E,f,e.HASH_COMMENT_MODE]}]};return h.contains=[f,E,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[u,E,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,g,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[b]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[E,b,f]}]}}const ch="[A-Za-z$_][0-9A-Za-z$_]*",XC=["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"],ZC=["true","false","null","undefined","NaN","Infinity"],JC=["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"],QC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ex=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],tx=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],nx=[].concat(ex,JC,QC);function SD(e){const n=e.regex,r=(Y,{after:I})=>{const $="</"+Y[0].slice(1);return Y.input.indexOf($,I)!==-1},a=ch,o={begin:"<>",end:"</>"},v=/<[A-Za-z0-9\\._:-]+\s*\/>/,m={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Y,I)=>{const $=Y[0].length+Y.index,N=Y.input[$];if(N==="<"||N===","){I.ignoreMatch();return}N===">"&&(r(Y,{after:$})||I.ignoreMatch());let H;const Z=Y.input.substring($);if(H=Z.match(/^\s*=/)){I.ignoreMatch();return}if((H=Z.match(/^\s+extends\s+/))&&H.index===0){I.ignoreMatch();return}}},c={$pattern:ch,keyword:XC,literal:ZC,built_in:nx,"variable.language":tx},u="[0-9](_?[0-9])*",h=`\\.(${u})`,S="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${S})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${S})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},k={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,C]},p={className:"comment",variants:[e.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:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},y=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,k,E,g,{match:/\$\d+/},f];C.contains=y.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(y)});const T=[].concat(p,C.contains),A=T.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(T)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:A},M={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,n.concat(a,"(",n.concat(/\./,a),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,a],scope:{1:"keyword",3:"title.class"}}]},R={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:{_:[...JC,...QC]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},F={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(Y){return n.concat("(?!",Y.join("|"),")")}const B={match:n.concat(/\b/,G([...ex,"super","import"].map(Y=>`${Y}\\s*\\(`)),a,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},K={begin:n.concat(/\./,n.lookahead(n.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},te={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",W={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(q)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:A,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,k,E,g,p,{match:/\$\d+/},f,R,{scope:"attr",match:a+n.lookahead(":"),relevance:0},W,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[p,e.REGEXP_MODE,{className:"function",begin:q,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:A}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:v},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:"xml",contains:[{begin:m.begin,end:m.end,skip:!0,contains:["self"]}]}]},F,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},B,U,M,te,{match:/\$[(.]/}]}}function Cy(e){const n=e.regex,r=SD(e),a=ch,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],v={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},m={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[r.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:ch,keyword:XC.concat(u),literal:ZC,built_in:nx.concat(o),"variable.language":tx},S={className:"meta",begin:"@"+a},f=(E,g,b)=>{const p=E.contains.findIndex(y=>y.label===g);if(p===-1)throw new Error("can not find mode to replace");E.contains.splice(p,1,b)};Object.assign(r.keywords,h),r.exports.PARAMS_CONTAINS.push(S);const C=r.contains.find(E=>E.scope==="attr"),x=Object.assign({},C,{match:n.concat(a,n.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,C,x]),r.contains=r.contains.concat([S,v,m,x]),f(r,"shebang",e.SHEBANG()),f(r,"use_strict",c);const k=r.contains.find(E=>E.label==="func.def");return k.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}const wD=/\[\[wiki:([^\]]+)\]\]/g,CD=new UC({gfm:!0,breaks:!1}),xy={ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto):|[#/]|\.{0,2}\/|[^:]+$)/i,ADD_ATTR:["target","rel","data-entry-id"]},Tp=ND();function So(e,n={}){const r=TD(e),a=CD.parse(r,{async:!1}),o=jl.sanitize(a,xy),v=new DOMParser().parseFromString(o,"text/html");return AD(v,n.omitDuplicateTitle),kD(v),RD(v),MD(v),{html:jl.sanitize(v.body.innerHTML,xy),toc:DD(v)}}function xD(e){const n=new TextEncoder().encode(e);let r="";for(const a of n)r+=String.fromCharCode(a);return btoa(r)}function ED(e){const n=atob(e),r=new Uint8Array(n.length);for(let a=0;a<n.length;a++)r[a]=n.charCodeAt(a);return new TextDecoder().decode(r)}function TD(e){return e.replace(wD,(n,r)=>{const a=r.trim();if(!a)return"";const o=Ee(a),v=encodeURIComponent(a);return`<a href="${Pr(a)}" data-entry-id="${v}">${o}</a>`})}function kD(e){const n=new Map;for(const r of e.querySelectorAll("h2, h3")){const a=r.textContent?.trim()??"",o=jD(a||"section"),v=n.get(o)??0;n.set(o,v+1),r.id=v===0?o:`${o}-${v+1}`}}function AD(e,n){if(!n)return;const r=e.body.querySelector("h1, h2, h3, h4, h5, h6");!r||r.tagName.toLowerCase()!=="h1"||Ey(r.textContent??"")===Ey(n)&&r.remove()}function RD(e){for(const n of e.querySelectorAll("pre > code")){const r=ID(n.className),a=n.textContent??"",o=n.parentElement;if(!o)continue;if(r==="mermaid"){const m=e.createElement("div");m.className="diagram-block",m.setAttribute("data-mermaid-source",xD(a)),m.setAttribute("data-diagram-state","pending"),o.replaceWith(m);continue}const v=OD(a,r);n.innerHTML=v,n.classList.add("hljs"),o.classList.add("code-block"),o.dataset.code=a,o.insertBefore(LD(e,r||"text"),o.firstChild)}}function LD(e,n){const r=e.createElement("div");r.className="code-block-toolbar";const a=e.createElement("span");a.className="code-block-dots",a.setAttribute("aria-hidden","true");for(let m=0;m<3;m++)a.append(e.createElement("span"));const o=e.createElement("span");o.className="code-block-language",o.textContent=n;const v=e.createElement("button");return v.className="copy-code",v.type="button",v.dataset.action="copy-code",v.setAttribute("aria-label",`Copy ${n} code`),v.textContent="Copy",r.append(a,o,v),r}function MD(e){for(const n of e.querySelectorAll("a")){const r=n.getAttribute("href")??"";BD(r)&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))}}function DD(e){return[...e.querySelectorAll("h2, h3")].map(n=>({id:n.id,text:n.textContent?.trim()??n.id,level:n.tagName.toLowerCase()==="h2"?2:3}))}function OD(e,n){return n&&Tp.getLanguage(n)?Tp.highlight(e,{language:n}).value:Tp.highlightAuto(e).value}function ND(){return Ei.registerLanguage("bash",vy),Ei.registerLanguage("sh",vy),Ei.registerLanguage("javascript",yy),Ei.registerLanguage("js",yy),Ei.registerLanguage("json",yD),Ei.registerLanguage("markdown",Sy),Ei.registerLanguage("md",Sy),Ei.registerLanguage("python",wy),Ei.registerLanguage("py",wy),Ei.registerLanguage("typescript",Cy),Ei.registerLanguage("ts",Cy),Ei}function ID(e){return e.match(/language-([a-z0-9_-]+)/i)?.[1]?.toLowerCase()??null}function BD(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)&&!e.startsWith(window.location.origin)}function jD(e){return e.trim().toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"")||"section"}function Ey(e){return e.trim().replace(/\s+/g," ").toLocaleLowerCase("en-US")}function $D(e){return`
202
- <article class="document">
203
- <header class="document-header">
204
- <p class="eyebrow">MANIFEST · DRYDOCK</p>
205
- <h1>Conflicts</h1>
206
- </header>
207
- ${e.length>0?`
208
- <ul class="conflict-list">
209
- ${e.map(n=>`
210
- <li>
211
- <a class="conflict-list-item" href="${A6(n.id)}">
212
- <span class="conflict-list-copy">
213
- <strong>${Ee(n.title)}</strong>
214
- <small>${Ee(n.id)}</small>
215
- </span>
216
- <span class="chip ${n.status==="open"?"chip-coral":"chip"}">${Ee(n.status)}</span>
217
- </a>
218
- </li>
219
- `).join("")}
220
- </ul>
221
- `:'<p class="empty-state">No conflicts to display.</p>'}
222
- </article>
223
- `}function zD(e){const n=[kp("Current",e.current),kp("Proposed",e.proposed),kp("Raw Source",e.rawSource)].filter(Boolean).join("");return`
224
- <article class="document">
225
- <header class="document-header">
226
- <p class="eyebrow">MANIFEST · DRYDOCK</p>
227
- <h1>${Ee(e.id)}</h1>
228
- <div class="meta-chips">
229
- <span class="chip chip-coral">${Ee(String(e.meta.status??"unknown"))}</span>
230
- </div>
231
- </header>
232
- <section class="conflict-meta-card">
233
- <pre>${Ee(JSON.stringify(e.meta,null,2))}</pre>
234
- </section>
235
- ${n||'<p class="empty-state">No conflicts to display.</p>'}
236
- </article>
237
- `}function kp(e,n){if(!n)return"";const r=So(n);return`
238
- <section class="conflict-section">
239
- <h2>${Ee(e)}</h2>
240
- <div class="markdown-body">${r.html}</div>
241
- </section>
242
- `}function PD(e){return`
243
- <article class="document">
244
- <header class="document-header">
245
- <p class="eyebrow">MANIFEST · CODEX</p>
246
- <h1>Index</h1>
247
- </header>
248
- <div class="markdown-body">${So(e).html}</div>
249
- </article>
250
- `}function xg(e,n){try{return new Date(e).toLocaleString(n??"en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}catch{return e}}function uh(e){const n=Date.now()-new Date(e).getTime(),r=Math.floor(n/6e4);if(r<1)return"just now";if(r<60)return`${r} min ago`;const a=Math.floor(r/60);if(a<24)return`${a} hr ago`;const o=Math.floor(a/24);return o<30?`${o} days ago`:`${Math.floor(o/30)} months ago`}const HD=`
251
- <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">
252
- <path d="M7 17 17 7M9 7h8v8" />
253
- </svg>
254
- `;function UD(e,n,r){if(!e)return"";const{frontmatter:a}=e,o=xg(a.created),v=uh(a.created),m=xg(a.updated),c=uh(a.updated),u=l6(e,n,r),h=a.tags.length>0?`<div class="queue-card-chips">${a.tags.map(f=>`<span class="chip chip-muted">${Ee(f)}</span>`).join("")}</div>`:'<span class="queue-dl-muted">None</span>',S=a.rawSourceRef?`<a class="manifest-link queue-raw-link" href="${Ye(_C(a.rawSourceRef))}" data-raw-ref="${Ye(a.rawSourceRef)}">
255
- <span class="manifest-ref">${Ee(a.rawSourceRef)}</span>
256
- <span class="manifest-arrow" aria-hidden="true">${HD}</span>
257
- </a>`:'<span class="queue-dl-muted">None</span>';return`
258
- <details class="manifest-card" open>
259
- <summary class="manifest-summary" aria-label="Toggle document manifest">
260
- <span class="manifest-summary-copy">
261
- <span class="drydock-eyebrow">MANIFEST · CODEX</span>
262
- <span class="manifest-subtitle">Document Manifest</span>
263
- </span>
264
- <span class="manifest-summary-indicator" aria-hidden="true"></span>
265
- </summary>
266
- <dl class="queue-dl">
267
- <dt class="queue-dl-key">Created</dt>
268
- <dd class="queue-dl-value queue-dl-time">
269
- <time datetime="${Ye(a.created)}" title="${Ye(o)}">
270
- ${Ee(o)}
271
- <span class="queue-dl-relative">(${Ee(v)})</span>
272
- </time>
273
- </dd>
274
- <dt class="queue-dl-key">Updated</dt>
275
- <dd class="queue-dl-value queue-dl-time">
276
- <time datetime="${Ye(a.updated)}" title="${Ye(m)}">
277
- ${Ee(m)}
278
- <span class="queue-dl-relative">(${Ee(c)})</span>
279
- </time>
280
- </dd>
281
- <dt class="queue-dl-key">Version</dt>
282
- <dd class="queue-dl-value queue-dl-mono">v${a.version}</dd>
283
- <dt class="queue-dl-key">Tags</dt>
284
- <dd class="queue-dl-value">${h}</dd>
285
- <dt class="queue-dl-key">Source</dt>
286
- <dd class="queue-dl-value">${S}</dd>
287
- </dl>
288
- ${u?`<div class="manifest-actions">${u}</div>`:""}
289
- </details>
290
- `}const FD="modulepreload",qD=function(e){return"/console/"+e},Ty={},WD=function(n,r,a){let o=Promise.resolve();if(r&&r.length>0){let u=function(h){return Promise.all(h.map(S=>Promise.resolve(S).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),c=m?.nonce||m?.getAttribute("nonce");o=u(r.map(h=>{if(h=qD(h),h in Ty)return;Ty[h]=!0;const S=h.endsWith(".css"),f=S?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${f}`))return;const C=document.createElement("link");if(C.rel=S?"stylesheet":FD,S||(C.as="script"),C.crossOrigin="",C.href=h,c&&C.setAttribute("nonce",c),document.head.appendChild(C),S)return new Promise((x,k)=>{C.addEventListener("load",x),C.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function v(m){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=m,window.dispatchEvent(c),!c.defaultPrevented)throw m}return o.then(m=>{for(const c of m||[])c.status==="rejected"&&v(c.reason);return n().catch(v)})},GD=".diagram-block[data-mermaid-source]:not([data-diagram-state='rendered']):not([data-diagram-state='error'])",KD=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),VD=/^on/i,YD={USE_PROFILES:{svg:!0,svgFilters:!1},FORBID_TAGS:["foreignObject","script"],FORBID_ATTR:["href","xlink:href"]},ky="diagramInteractionBound",XD=/^oklch\s*\(\s*([^)]+)\s*\)$/i,ZD=/^(-?\d+(?:\.\d+)?)(deg)?$/i,Ai=[25,50,75,100,125,150,200],JD=["pie1","pie2","pie3","pie4","pie5","pie6","pie7","pie8","pie9","pie10","pie11","pie12"];let Ap=null,Ay=!1,QD=0,eO=0,Wl=null;function vs(e){const n=e.trim();if(!n)return n;const r=CO(n);return r?xO(r):n}function tO(e){if(Ay)return;Ay=!0,Ry(e);const n=e instanceof Node?e:document.body;new MutationObserver(a=>{let o=!1;for(const v of a)if(v.type==="childList"){Wl&&!Wl.trigger.isConnected&&Dl(!1);for(const m of v.addedNodes)if(m instanceof Element&&(m.matches?.(".diagram-block[data-mermaid-source]")||m.querySelector?.(".diagram-block[data-mermaid-source]"))){o=!0;break}if(o)break}o&&Ry(e)}).observe(n,{childList:!0,subtree:!0})}function Ry(e){const n=e.querySelectorAll(GD);for(const r of n)r.dataset.diagramHydrating!=="true"&&(r.dataset.diagramHydrating="true",r.dataset.diagramState="pending",nO(r))}async function nO(e){const n=e.getAttribute("data-mermaid-source")??"";let r="";try{r=ED(n)}catch{Rp(e,"Invalid diagram source");return}if(!r.trim()){Rp(e,"Empty diagram source");return}try{const a=await rO(),o=`mermaid-diagram-${++QD}`,{svg:v}=await a.render(o,r);e.innerHTML=iO(v),oO(e,v),lO(e),cO(e),e.dataset.diagramState="rendered"}catch(a){const o=a instanceof Error?a.message:String(a);Rp(e,o)}}function Rp(e,n){e.dataset.diagramState="error",e.textContent=`Diagram render failed: ${n}`}function iO(e){const n=(r,a)=>{VD.test(a.attrName)&&(a.keepAttr=!1)};jl.addHook("uponSanitizeAttribute",n);try{return jl.sanitize(e,YD)}finally{jl.removeHook("uponSanitizeAttribute",n)}}async function rO(){return Ap||(Ap=(async()=>{const e=await WD(()=>import("./mermaid.core-ISlBhdkY.js").then(r=>r.bC),[]),n=e.default??e;return n.initialize({securityLevel:"strict",htmlLabels:!1,suppressErrorRendering:!0,startOnLoad:!1,theme:"base",look:"handDrawn",themeVariables:sO(),themeCSS:aO(),flowchart:{htmlLabels:!1,useMaxWidth:!1}}),n})()),Ap}function sO(){const e=getComputedStyle(document.documentElement),n=(E,g)=>{const b=e.getPropertyValue(E).trim();return vs(b||g)},r=(E,g)=>e.getPropertyValue(E).trim()||g,a=n("--brass","#c69a4a"),o=n("--brass-bright","#e6b86a"),v=n("--brass-deep","#a0782a"),m=n("--aurora","#8bd7e6"),c=n("--aurora-deep","#1f8aa8"),u=n("--coral","#ef7c63"),h=n("--ink-deep","#1d2734"),S=n("--ink-fog","#a6afbb"),f=n("--ink-pearl","#e6e9ef"),C=n("--ink-spectral","#bcc4d0"),x=[o,a,m,u,vs("oklch(70% 0.11 68)"),c,vs("oklch(76% 0.09 205)"),v,vs("oklch(68% 0.14 30)"),S,vs("oklch(62% 0.08 228)"),vs("oklch(52% 0.05 248)")],k=Object.fromEntries(JD.map((E,g)=>[E,x[g]??h]));return{background:"transparent",primaryColor:"transparent",primaryTextColor:f,primaryBorderColor:a,secondaryColor:"transparent",secondaryTextColor:f,secondaryBorderColor:o,tertiaryColor:"transparent",tertiaryTextColor:C,tertiaryBorderColor:a,lineColor:c,edgeLabelBackground:"transparent",titleColor:o,fontFamily:"JetBrains Mono Variable, ui-monospace, monospace",mainBkg:"transparent",nodeBorder:a,clusterBkg:"transparent",clusterBorder:a,pieTitleTextColor:o,pieTitleTextSize:r("--font-size-title-lg","19px"),pieSectionTextColor:f,pieSectionTextSize:r("--font-size-md","13px"),pieLegendTextColor:f,pieLegendTextSize:r("--font-size-lg","14px"),pieStrokeColor:v,pieStrokeWidth:"1.35px",pieOuterStrokeColor:o,pieOuterStrokeWidth:"2.5px",pieOpacity:"0.96",...k}}function aO(){const e=getComputedStyle(document.documentElement),n=(h,S)=>{const f=e.getPropertyValue(h).trim();return vs(f||S)},r=n("--brass-deep","#a0782a"),a=n("--brass-bright","#e6b86a"),o=n("--aurora-deep","#1f8aa8"),v=n("--ink-abyss","#131920"),m=vs("oklch(15% 0.04 250 / 34%)"),c=n("--surface-glass","#1d2734"),u=n("--ink-pearl","#e6e9ef");return`
291
- .node rect, .node polygon, .node circle, .node ellipse, .actor, .classGroup rect {
292
- stroke: ${r};
293
- fill: ${c};
294
- }
295
- .edgePath path, .messageLine0, .messageLine1, .relation {
296
- stroke: ${o};
297
- }
298
- .nodeLabel, .edgeLabel, .actor text, .messageText {
299
- fill: ${u};
300
- font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
301
- }
302
- .pieCircle {
303
- stroke: ${r};
304
- stroke-width: 1.35px;
305
- opacity: 0.96;
306
- filter: drop-shadow(0 0 1.5px ${m});
307
- }
308
- .pieOuterCircle {
309
- stroke: ${a};
310
- opacity: 0.7;
311
- }
312
- .slice, .legend text, .pieTitleText {
313
- fill: ${u};
314
- paint-order: stroke;
315
- stroke: ${v};
316
- stroke-width: 3px;
317
- stroke-linejoin: round;
318
- font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
319
- }
320
- .slice {
321
- font-weight: 600;
322
- letter-spacing: 0.04em;
323
- font-style: italic;
324
- }
325
- .pieTitleText {
326
- font-weight: 600;
327
- letter-spacing: 0.12em;
328
- font-style: italic;
329
- }
330
- .legend text {
331
- font-weight: 500;
332
- letter-spacing: 0.03em;
333
- }
334
- .legend rect {
335
- rx: 999px;
336
- ry: 999px;
337
- opacity: 0.9;
338
- stroke: ${v};
339
- stroke-width: 1.5px;
340
- paint-order: stroke;
341
- filter: saturate(0.78) brightness(0.92) drop-shadow(0 0 0.55px ${a});
342
- }
343
- `}function oO(e,n){const r=new DOMParser().parseFromString(n,"image/svg+xml"),a=Array.from(r.querySelectorAll("a")),o=Array.from(e.querySelectorAll("a")),v=Math.min(a.length,o.length);for(let m=0;m<v;m++){const c=a[m],u=o[m];if(!c||!u)continue;const h=c.getAttribute("href")??c.getAttribute("xlink:href")??"",S=rx(h);S&&u.setAttribute("href",S)}}function lO(e){const n=e.querySelector("svg");if(!n)return;let r;try{r=n.getBBox()}catch{return}const{x:a,y:o,width:v,height:m}=r;!Number.isFinite(a)||!Number.isFinite(o)||!Number.isFinite(v)||!Number.isFinite(m)||a<0||o<0||v<=0||m<=0||n.setAttribute("viewBox",`${no(a)} ${no(o)} ${no(v)} ${no(m)}`)}function cO(e){e.tabIndex=0,e.setAttribute("aria-label","Open diagram in expanded view"),yO(e),e.dataset[ky]!=="true"&&(e.dataset[ky]="true",e.addEventListener("click",uO),e.addEventListener("keydown",hO))}function uO(e){if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||hh(e.target))return;const n=e.currentTarget;n instanceof HTMLElement&&(e.preventDefault(),ix(n))}function hO(e){if(e.key!=="Enter"&&e.key!==" "||hh(e.target))return;const n=e.currentTarget;n instanceof HTMLElement&&(e.preventDefault(),ix(n))}function ix(e){const n=e.querySelector("svg");if(!n)return;Dl(!1);const r=typeof HTMLDialogElement<"u"&&typeof HTMLDialogElement.prototype.showModal=="function",a=document.createElement(r?"dialog":"div"),o=++eO,v=`diagram-lightbox-title-${o}`;a.className="diagram-lightbox",a.setAttribute("aria-labelledby",v),r||(a.setAttribute("role","dialog"),a.setAttribute("aria-modal","true"),a.tabIndex=-1);const m=document.createElement("div");m.className="diagram-lightbox__frame";const c=document.createElement("div");c.className="diagram-lightbox__header";const u=document.createElement("h2");u.id=v,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 S=document.createElement("div");S.className="diagram-lightbox__controls",S.setAttribute("aria-label","Diagram zoom controls");const f=Tu("−","Zoom out","out"),C=document.createElement("span");C.className="diagram-lightbox__zoom-readout",C.setAttribute("aria-live","polite");const x=Tu("+","Zoom in","in"),k=Tu("Fit","Fit diagram to viewport","fit"),E=Tu("Reset","Reset diagram zoom","reset");S.append(f,C,x,k,E);const g=document.createElement("div");g.className="diagram-lightbox__viewport";const b=pO(n),p=n.cloneNode(!0);p.removeAttribute("style"),mO(p,`diagram-lightbox-svg-${o}`),g.append(p),c.append(u,S,h),m.append(c,g),a.append(m),document.body.append(a);const y=new dO(g,p,C,b);f.addEventListener("click",()=>y.zoomOut()),x.addEventListener("click",()=>y.zoomIn()),k.addEventListener("click",()=>y.fit()),E.addEventListener("click",()=>y.reset());const T=_O(a),A=R=>{(R.target===a||R.target===h)&&Dl(!0)},L=R=>{if(R.key==="Escape"){R.preventDefault(),Dl(!0);return}y.handleKeyboard(R)||R.key==="Tab"&&bO(R,a)},M={dialog:a,trigger:e,inertStates:T,onClick:A,onKeyDown:L,cleanupPanZoom:()=>y.destroy()};r&&(M.onCancel=R=>{R.preventDefault(),Dl(!0)},a.addEventListener("cancel",M.onCancel),a.showModal()),a.addEventListener("click",A),document.addEventListener("keydown",L,!0),Wl=M,y.fit(),h.focus()}function Tu(e,n,r){const a=document.createElement("button");return a.className="diagram-lightbox__zoom-button",a.type="button",a.dataset.zoomAction=r,a.setAttribute("aria-label",n),a.textContent=e,a}class dO{constructor(n,r,a,o){this.viewport=n,this.svg=r,this.readout=a,this.baseSize=o,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=Ai.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,Ai.length-1))}zoomOut(){this.zoomAroundViewportCenter(Math.max(this.zoomIndex-1,0))}reset(){this.zoomAroundViewportCenter(Ai.indexOf(100))}fit(){const n=this.viewport.clientWidth||this.viewport.getBoundingClientRect().width||this.baseSize.width,r=this.viewport.clientHeight||this.viewport.getBoundingClientRect().height||this.baseSize.height,a=Math.min(n/this.baseSize.width,r/this.baseSize.height),o=Math.floor(a*100),v=Ai.findIndex(c=>c>o),m=v===-1?Ai.length-1:Math.max(0,v-1);this.applyZoom(m),this.viewport.scrollLeft=Math.max(0,(this.svgWidth-n)/2),this.viewport.scrollTop=Math.max(0,(this.svgHeight-r)/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*(ku(this.zoomIndex)/100)}get svgHeight(){return this.baseSize.height*(ku(this.zoomIndex)/100)}applyZoom(n){this.zoomIndex=n;const r=ku(this.zoomIndex),a=r/100;this.svg.setAttribute("width",no(this.baseSize.width*a)),this.svg.setAttribute("height",no(this.baseSize.height*a)),this.readout.textContent=`${r}%`}zoomAroundViewportCenter(n){const r=this.viewport.getBoundingClientRect();this.zoomAroundPoint(n,r.left+r.width/2,r.top+r.height/2)}zoomAroundPoint(n,r,a){if(n===this.zoomIndex)return;const o=this.svgWidth,v=this.svgHeight,m=this.viewport.getBoundingClientRect(),c=this.viewport.scrollLeft+r-m.left,u=this.viewport.scrollTop+a-m.top;this.applyZoom(n),this.viewport.scrollLeft=c/o*this.svgWidth-(r-m.left),this.viewport.scrollTop=u/v*this.svgHeight-(a-m.top)}onPointerDown=n=>{if(n.button!==0||hh(n.target))return;const r=n.pointerId??1;if(this.pointers.set(r,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:r},this.viewport.setPointerCapture?.(r)};onPointerMove=n=>{const r=n.pointerId??1;if(this.pointers.has(r)&&this.pointers.set(r,n),this.pinchStart&&this.pointers.size>=2){const a=this.pointerDistance()/this.pinchStart.distance,o=ku(this.pinchStart.zoomIndex)*a;this.applyZoom(gO(o));return}!this.dragStart||this.dragStart.pointerId!==r||(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 r=n.pointerId??1;this.pointers.delete(r),this.viewport.releasePointerCapture?.(r),this.dragStart?.pointerId===r&&(this.dragStart=null),this.pointers.size<2&&(this.pinchStart=null)};onWheel=n=>{if(!n.ctrlKey&&!n.metaKey)return;n.preventDefault();const r=n.deltaY<0?Math.min(this.zoomIndex+1,Ai.length-1):Math.max(this.zoomIndex-1,0);this.zoomAroundPoint(r,n.clientX,n.clientY)};onDoubleClick=n=>{hh(n.target)||(n.preventDefault(),this.zoomAroundPoint(this.zoomIndex===Ai.indexOf(200)?Ai.indexOf(100):Ai.indexOf(200),n.clientX,n.clientY))};onResize=()=>{this.fit()};pointerDistance(){const[n,r]=Array.from(this.pointers.values());return!n||!r?1:Math.hypot(r.clientX-n.clientX,r.clientY-n.clientY)}}function fO(e){const n=Ly(e.getAttribute("width")),r=Ly(e.getAttribute("height"));if(n&&r)return{width:n,height:r};const a=e.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number)??[],o=a[2],v=a[3],m=o!==void 0&&Number.isFinite(o)&&o>0?o:null,c=v!==void 0&&Number.isFinite(v)&&v>0?v:null;return{width:n??m??800,height:r??c??600}}function pO(e){const n=e.getBoundingClientRect();return n.width>0&&n.height>0?{width:n.width,height:n.height}:fO(e)}function Ly(e){if(!e)return null;const n=/^(\d+(?:\.\d+)?)/.exec(e.trim());if(!n)return null;const r=Number(n[1]);return Number.isFinite(r)&&r>0?r:null}function no(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,"")}function gO(e){let n=0,r=Number.POSITIVE_INFINITY;return Ai.forEach((a,o)=>{const v=Math.abs(a-e);v<r&&(r=v,n=o)}),n}function ku(e){return Ai[e]??Ai[0]}function mO(e,n){const r=e.getAttribute("id")??"";e.setAttribute("id",n);const a=e.querySelector("style");!r||!a?.textContent||(a.textContent=a.textContent.split(`#${r}`).join(`#${n}`))}function Dl(e){const n=Wl;n&&(n.dialog.removeEventListener("click",n.onClick),document.removeEventListener("keydown",n.onKeyDown,!0),n.onCancel&&n.dialog.removeEventListener("cancel",n.onCancel),n.cleanupPanZoom(),vO(n.inertStates),n.dialog instanceof HTMLDialogElement&&n.dialog.open&&typeof n.dialog.close=="function"&&n.dialog.close(),n.dialog.remove(),Wl=null,e&&n.trigger.isConnected&&n.trigger.focus())}function _O(e){const n=[];for(const r of Array.from(document.body.children))!(r instanceof HTMLElement)||r===e||(n.push({element:r,ariaHidden:r.getAttribute("aria-hidden"),inert:r.inert}),r.inert=!0,r.setAttribute("aria-hidden","true"));return n}function vO(e){for(const n of e)n.element.inert=n.inert,n.ariaHidden===null?n.element.removeAttribute("aria-hidden"):n.element.setAttribute("aria-hidden",n.ariaHidden)}function bO(e,n){const r=Array.from(n.querySelectorAll(KD)).filter(wO);if(r.length===0){e.preventDefault(),n.focus();return}const a=r[0],o=r[r.length-1];!a||!o||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a.focus()))}function yO(e){e.querySelector("a[href]")?e.removeAttribute("role"):e.setAttribute("role","button")}function hh(e){if(!(e instanceof Element))return!1;const n=e.closest("a[href]");return!n||!(n.getAttribute("href")?.trim()??"")?!1:!SO(n)}function SO(e){return Array.from(e.children).some(n=>n.tagName.toLowerCase()==="svg")}function wO(e){return!(e.inert||e.hidden||e.getAttribute("aria-hidden")==="true"||"disabled"in e&&e.disabled)}function rx(e){const n=e.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 a;try{a=new URL(n)}catch{return null}return a.origin!==window.location.origin?null:rx(a.pathname)}if(/^\/entry\/[^/?#]+$/.exec(n)){const a=n.slice(7);let o;try{o=decodeURIComponent(a)}catch{return null}return/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(o)?`/entry/${encodeURIComponent(o)}`:null}return/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(n)?`/entry/${encodeURIComponent(n)}`:null}function CO(e){const n=XD.exec(e);if(!n)return null;const r=n[1]?.trim();if(!r)return null;const a=r.indexOf("/"),o=a>=0?r.slice(0,a):r,v=a>=0?r.slice(a+1).trim():"",m=o.trim().split(/[\s,]+/).filter(Boolean);if(m.length!==3)return null;const[c,u,h]=m;if(!c||!u||!h)return null;const S=Lp(c,1),f=Lp(u,.4),C=EO(h);if(S===null||f===null||C===null)return null;let x=1;if(a>=0){const k=Lp(v,1);if(k===null)return null;x=k}return{L:S,C:f,h:C,alpha:x}}function xO(e){const n=e.h*Math.PI/180,r=e.C*Math.cos(n),a=e.C*Math.sin(n),o=e.L,v=o+.3963377774*r+.2158037573*a,m=o-.1055613458*r-.0638541728*a,c=o-.0894841775*r-1.291485548*a,u=v**3,h=m**3,S=c**3,f=4.0767416621*u-3.3077115913*h+.2309699292*S,C=-1.2684380046*u+2.6097574011*h-.3413193965*S,x=-.0041960863*u-.7034186147*h+1.707614701*S,k=Au(Mp(f)),E=Au(Mp(C)),g=Au(Mp(x));if(e.alpha<1){const b=Au(e.alpha);return`#${Ks(k)}${Ks(E)}${Ks(g)}${Ks(b)}`}return`#${Ks(k)}${Ks(E)}${Ks(g)}`}function Lp(e,n){if(!e)return null;if(e.endsWith("%")){const a=Number(e.slice(0,-1));return Number.isFinite(a)?a/100*n:null}const r=Number(e);return Number.isFinite(r)?r:null}function EO(e){const n=ZD.exec(e);if(!n)return null;const r=Number(n[1]);return Number.isFinite(r)?r:null}function Mp(e){const n=Math.max(0,Math.min(1,e));return n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n}function Au(e){return Math.round(Math.max(0,Math.min(1,e))*255)}function Ks(e){return e.toString(16).padStart(2,"0")}function TO(e,n){const r=kO(e,n);return`
344
- <nav class="breadcrumb" aria-label="Entry location">
345
- <ol>
346
- ${r.map((a,o)=>`
347
- <li>
348
- ${a.href?`<a href="${Ye(a.href)}">${Ee(a.label)}</a>`:`<span aria-current="${o===r.length-1?"page":"false"}">${Ee(a.label)}</span>`}
349
- </li>
350
- `).join("")}
351
- </ol>
352
- </nav>
353
- `}function kO(e,n){const r=n.find(v=>v.id===e.frontmatter.id),a=e.frontmatter.tags[0]??r?.tags[0]??null,o=[{label:"Codex",href:pm()},{label:"Index",href:vC()}];return a&&o.push({label:a}),o.push({label:e.frontmatter.title}),o}function AO(e){const n=e.tags.map(a=>`<span class="chip chip-tag">${Ee(a)}</span>`).join(""),r=LO(e);return`
354
- <div class="meta-chips">
355
- ${n}
356
- ${r}
357
- <span class="chip">Updated ${Ee(RO(e.updated))}</span>
358
- </div>
359
- `}function sx(e){return e.map(n=>`<span class="chip chip-muted">${Ee(n)}</span>`).join("")}function RO(e){const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function LO(e){const n=MO(e);return n?`<span class="chip ${n.tone==="deprecated"?"chip-coral":n.tone==="stale"?"chip-stale":""}" title="${Ye(n.title)}">${Ee(n.label)}</span>`:""}function MO(e,n=new Date){const r=e.status,a=typeof e.revalidateAfter=="string"&&!Number.isNaN(Date.parse(e.revalidateAfter))&&Date.parse(e.revalidateAfter)<n.getTime();return r==="deprecated"||r==="superseded"?{label:r,tone:"deprecated",title:a?`${r} · stale`:r}:a?{label:"stale",tone:"stale",title:e.revalidateAfter??"stale"}:r==="current"||r==="draft"?{label:r,tone:"neutral",title:r}:null}function DO(e,n,r){const a=OO(e,n,r);return a.length===0?"":`
360
- <section class="related-list">
361
- <h2>Related entries</h2>
362
- <div class="related-items">
363
- ${a.map(o=>`
364
- <a class="related-card" href="${Pr(o.entry.id)}" data-entry-id="${Ye(o.entry.id)}">
365
- <strong>${Ee(o.entry.title)}</strong>
366
- <span>${sx(o.matchingTags)}</span>
367
- </a>
368
- `).join("")}
369
- </div>
370
- </section>
371
- `}function OO(e,n,r){const a=new Set(n),o="en-US";return r.filter(v=>v.id!==e).map(v=>({entry:v,matchingTags:v.tags.filter(m=>a.has(m))})).filter(v=>v.matchingTags.length>0).sort((v,m)=>m.matchingTags.length-v.matchingTags.length||v.entry.title.localeCompare(m.entry.title,o,{sensitivity:"base",numeric:!0})).slice(0,5)}const NO=`
372
- <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
373
- <path d="M6 6 18 18M18 6 6 18" />
374
- </svg>
375
- `,IO=`
376
- <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
377
- <path d="M8 6h12M8 12h12M8 18h12" />
378
- <path d="M4 6h.01M4 12h.01M4 18h.01" />
379
- </svg>
380
- `;function BO(e){return e.length===0?"":`
381
- <button class="toc-drawer-trigger" type="button" data-action="open-toc-drawer" aria-haspopup="dialog" aria-controls="toc-drawer">
382
- ${IO}
383
- <span>Contents</span>
384
- </button>
385
- `}function jO(e){return e.length===0?"":`
386
- <div class="toc-drawer" id="toc-drawer" role="dialog" aria-modal="true" aria-labelledby="toc-drawer-title" hidden>
387
- <button class="toc-drawer-backdrop" type="button" data-action="close-toc-drawer" aria-label="Close contents"></button>
388
- <section class="toc-drawer-panel">
389
- <header class="toc-drawer-header">
390
- <div>
391
- <p class="drydock-eyebrow">Reading Position</p>
392
- <h2 id="toc-drawer-title">Contents</h2>
393
- </div>
394
- <button class="icon-button" type="button" data-action="close-toc-drawer" aria-label="Close contents">${NO}</button>
395
- </header>
396
- <nav class="toc-drawer-nav" aria-label="Document contents">
397
- ${e.map(n=>`
398
- <a class="toc-drawer-link toc-level-${n.level}" href="#${Ye(n.id)}" data-toc-id="${Ye(n.id)}">
399
- ${Ee(n.text)}
400
- </a>
401
- `).join("")}
402
- </nav>
403
- </section>
404
- </div>
405
- `}const $O=`
406
- <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">
407
- <path d="M5 12h14M13 6l6 6-6 6" />
408
- </svg>
409
- `;function zO(e,n,r=!0){const a=e.length,o=e.slice(0,6),v=e[0]??null;return`
410
- <article class="document welcome">
411
- <header class="welcome-title">
412
- <p class="eyebrow">Fleet · Codex</p>
413
- <h1>The <em>Codex</em></h1>
414
- </header>
415
- <div class="welcome-divider"></div>
416
- <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>
417
- ${r?"":'<p class="error-box">No workspace is registered in this daemon. Re-run <code>fleet-wiki</code> in the target directory.</p>'}
418
- <div class="workspace-meta">
419
- <span class="chip chip-aurora">${a} entries</span>
420
- ${n?`<span class="workspace-path">${Ee(n)}</span>`:""}
421
- </div>
422
- ${v?`
423
- <a class="primary-link" href="${Ye(Pr(v.id))}" data-entry-id="${Ye(v.id)}">
424
- <span>Open first entry — ${Ee(v.title)}</span>
425
- ${$O}
426
- </a>
427
- `:'<p class="empty-state">No wiki entries yet. Add entries with <code>wiki_ingest</code>.</p>'}
428
- ${o.length>0?`
429
- <div class="welcome-grid">
430
- ${o.map(m=>`
431
- <a class="welcome-card" href="${Ye(Pr(m.id))}" data-entry-id="${Ye(m.id)}">
432
- <strong>${Ee(m.title)}</strong>
433
- <span class="welcome-card-tags">${sx(m.tags.slice(0,3))}</span>
434
- </a>
435
- `).join("")}
436
- </div>
437
- `:""}
438
- </article>
439
- `}function PO(e,n){const r=So(e.body,{omitDuplicateTitle:e.frontmatter.title});return{toc:r.toc,html:`
440
- <article class="document">
441
- <header class="document-header">
442
- ${TO(e,n)}
443
- <p class="eyebrow">Current Entry</p>
444
- <h1>${Ee(e.frontmatter.title)}</h1>
445
- ${AO(e.frontmatter)}
446
- ${BO(r.toc)}
447
- </header>
448
- <div class="markdown-body" id="markdown-body">
449
- ${r.html}
450
- </div>
451
- ${DO(e.frontmatter.id,e.frontmatter.tags,n)}
452
- ${jO(r.toc)}
453
- </article>
454
- `}}function HO(){return`
455
- <article class="document">
456
- <p class="loading">Loading entry</p>
457
- </article>
458
- `}function UO(e){return`
459
- <article class="document">
460
- <p class="error-box">${Ee(e)}</p>
461
- </article>
462
- `}const Ku=new Set;let Nr="entries";const FO=`
463
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
464
- <circle cx="11" cy="11" r="6.5" />
465
- <path d="m20 20-3.5-3.5" />
466
- </svg>
467
- `,qO=`
468
- <svg class="caret" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
469
- <path d="m6 9 6 6 6-6" />
470
- </svg>
471
- `,WO=`
472
- <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">
473
- <path d="M6 6 18 18M18 6 6 18" />
474
- </svg>
475
- `,GO=`
476
- <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">
477
- <circle cx="12" cy="5" r="2" />
478
- <path d="M12 7v14M8 11H4a8 8 0 0 0 16 0h-4" />
479
- </svg>
480
- `;function KO(e,n,r,a=[],o=null,v){const m=e.length,c=XO(e),u=m===0?'<p class="empty-state">No wiki entries yet.</p>':Nr==="tags"?ZO(e,n):JO(e,n),h=Nr==="tags"?`Tags · ${c}`:`Entries · ${m}`,S=Nr==="tags"?"tag-tree":"entry-list",f=Nr==="tags"?"Entries by tag":"All entries",C=tN(v??(typeof window<"u"?window.location.pathname:"")),x=C.startsWith("/queue"),k=C==="/index",E=C==="/log",g=C.startsWith("/conflicts"),b=r>0?`<span class="nav-drydock-badge">${r}</span>`:"";return`
481
- <aside class="sidebar" id="sidebar">
482
- <div class="sidebar-header">
483
- <div class="sidebar-header-actions">
484
- <button class="icon-button mobile-close" type="button" data-action="toggle-nav" aria-label="Close">${WO}</button>
485
- </div>
486
- </div>
487
- <button class="command-entry" type="button" data-action="open-command">
488
- <span class="command-entry-label">${FO}<span>Search entries</span></span>
489
- <kbd>⌘K</kbd>
490
- </button>
491
- <div class="nav-drydock-section">
492
- <a class="nav-drydock-link${x?" active":""}" href="${Ye(ho())}">
493
- <span class="nav-drydock-icon">${GO}</span>
494
- <span class="nav-drydock-label">Drydock</span>
495
- ${b}
496
- </a>
497
- <a class="nav-drydock-link${k?" active":""}" href="${Ye(vC())}">
498
- <span class="nav-drydock-label">Index</span>
499
- </a>
500
- <a class="nav-drydock-link${E?" active":""}" href="${Ye(bC())}">
501
- <span class="nav-drydock-label">Log</span>
502
- </a>
503
- <a class="nav-drydock-link${g?" active":""}" href="${Ye(k6())}">
504
- <span class="nav-drydock-label">Conflicts</span>
505
- </a>
506
- </div>
507
- <div class="nav-tabs" role="tablist" aria-label="Navigation mode">
508
- <button class="nav-tab${Nr==="entries"?" active":""}" type="button" role="tab" aria-selected="${Nr==="entries"}" data-action="set-nav-mode" data-mode="entries">
509
- Entries
510
- </button>
511
- <button class="nav-tab${Nr==="tags"?" active":""}" type="button" role="tab" aria-selected="${Nr==="tags"}" data-action="set-nav-mode" data-mode="tags">
512
- Tags
513
- </button>
514
- </div>
515
- <p class="nav-section-label">${h}</p>
516
- <nav class="${S}" aria-label="${f}">
517
- ${u}
518
- </nav>
519
- </aside>
520
- `}function VO(e){if(Ku.has(e)){Ku.delete(e);return}Ku.add(e)}function YO(e){Nr=e}function XO(e){const n=new Set;for(const r of e){if(r.tags.length===0){n.add("untagged");continue}for(const a of r.tags)n.add(a)}return n.size}function ZO(e,n){return QO(e).map(a=>eN(a,n)).join("")}function JO(e,n){const r="en-US";return[...e].sort((o,v)=>o.title.localeCompare(v.title,r,{sensitivity:"base",numeric:!0})).map(o=>ax(o,n)).join("")}function QO(e){const n="en-US",r=new Map;for(const a of e){const o=a.tags.length>0?a.tags:["untagged"];for(const v of o){const m=r.get(v)??[];m.push(a),r.set(v,m)}}return[...r.entries()].map(([a,o])=>({tag:a,entries:o.sort((v,m)=>v.title.localeCompare(m.title,n,{sensitivity:"base",numeric:!0}))})).sort((a,o)=>a.tag.localeCompare(o.tag,n,{sensitivity:"base",numeric:!0}))}function eN(e,n){const r=Ku.has(e.tag),a=r?"":e.entries.map(o=>ax(o,n)).join("");return`
521
- <section class="tag-group" data-collapsed="${r?"true":"false"}">
522
- <button class="tag-group-button" type="button" data-action="toggle-tag" data-tag="${Ye(e.tag)}">
523
- ${qO}
524
- <span>${e.tag==="untagged"?"Untagged":Ee(e.tag)}</span>
525
- <span class="count">${e.entries.length}</span>
526
- </button>
527
- <div class="tag-group-list">${a}</div>
528
- </section>
529
- `}function ax(e,n){const r=e.id===n?" active":"",a=Ye(e.title);return`
530
- <a class="nav-entry${r}" href="${Pr(e.id)}" data-entry-id="${Ye(e.id)}" title="${a}">
531
- <span class="nav-entry-text">${Ee(e.title)}</span>
532
- </a>
533
- `}function tN(e){const n=e===Fi||e===`${Fi}/`?"/":e.startsWith(`${Fi}/`)?e.slice(Fi.length)||"/":e,r=n.match(/^\/w\/[^/]+(\/.*)?$/);return r?r[1]??"/":n}const nN=`
534
- <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">
535
- <path d="M15 18 9 12l6-6" />
536
- </svg>
537
- `,iN=`
538
- <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">
539
- <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" />
540
- <path d="M9 9h6M9 13h6" />
541
- </svg>
542
- `;function rN(e){const n=e.ref??"";let r;return e.loading?r='<p class="loading">Loading source</p>':e.error?r=`<p class="error-box">Failed to load source — ${Ee(e.error)}</p>`:e.content?r=`<div class="markdown-body">${So(e.content).html}</div>`:r='<p class="empty-state">Source is empty.</p>',`
543
- <div class="raw-shell">
544
- <header class="raw-header">
545
- <a class="raw-back" href="/" data-action="navigate-home" aria-label="Back to Codex">
546
- ${nN}
547
- <span>Codex</span>
548
- </a>
549
- <div class="raw-meta">
550
- <span class="raw-glyph">${iN}</span>
551
- <div class="raw-meta-text">
552
- <p class="eyebrow">Manifest · Raw Source</p>
553
- <h1 class="raw-title">${Ee(n)}</h1>
554
- </div>
555
- </div>
556
- <div class="raw-divider"></div>
557
- </header>
558
- <article class="raw-document">
559
- ${r}
560
- </article>
561
- </div>
562
- `}function Am(e,n){const r=e==="create_wiki"||!n,a=r?"+":"↻",o=r?"CREATE":"UPDATE";return`<span class="op-badge ${r?"op-badge--create":"op-badge--update"}" aria-label="${o}">
563
- <span class="op-badge-glyph" aria-hidden="true">${a}</span>
564
- <span class="op-badge-label">${o}</span>
565
- </span>`}function sN(e){const{tab:n,items:r,pendingCount:a,archivedCount:o,loading:v,error:m}=e;if(v&&r.length===0)return'<div class="queue-view"><p class="loading">Loading patch queue</p></div>';if(m)return`<div class="queue-view"><p class="error-box">Failed to load queue — ${Ee(m)}</p></div>`;const c=r.length===0?aN(n):r.map(S=>oN(S)).join(""),u=a>0?`<span class="queue-badge">${a}</span>`:"",h=o>0?`<span class="queue-badge queue-badge--muted">${o}</span>`:"";return`
566
- <div class="queue-view">
567
- <div class="queue-header">
568
- <p class="drydock-eyebrow">MANIFEST · DRYDOCK</p>
569
- <h1 class="queue-title">Patch Queue</h1>
570
- </div>
571
- <div class="queue-tabs" role="tablist" aria-label="Queue tabs">
572
- <a class="queue-tab${n==="pending"?" active":""}"
573
- href="${Ye(ho("pending"))}"
574
- role="tab"
575
- aria-selected="${n==="pending"}">
576
- Pending${u}
577
- </a>
578
- <a class="queue-tab${n==="archived"?" active":""}"
579
- href="${Ye(ho("archived"))}"
580
- role="tab"
581
- aria-selected="${n==="archived"}">
582
- Archived${h}
583
- </a>
584
- </div>
585
- <div class="queue-list">
586
- ${c}
587
- </div>
588
- </div>
589
- `}function aN(e){return`<p class="queue-empty">${e==="pending"?"No pending patches.":"No archived patches."}</p>`}function oN(e){const{id:n,meta:r,source:a,summary:o,op:v,target:m}=e,c=lN(r.status),u=uh(r.createdAt),h=r.warnings??[],S=h.slice(0,3).map(g=>`<span class="chip chip-muted">${Ee(g)}</span>`).join(""),f=h.length>3?`<span class="chip chip-muted">+${h.length-3}</span>`:"",C=a==="archive"?`<span class="chip">${Ee(r.status)}</span>`:"",x=v?Am(v,!0):"",k=o?`<p class="queue-card-summary">${Ee(o)}</p>`:"",E=m?`<span class="queue-card-target">${Ee(m)}</span>`:"";return`
590
- <a class="queue-card" href="${Ye(T6(n))}">
591
- ${k}
592
- <div class="queue-card-top">
593
- <span class="queue-card-id">${Ee(n)}</span>
594
- ${c}
595
- </div>
596
- <div class="queue-card-meta">
597
- ${x}
598
- ${E}
599
- <span class="queue-card-time">${Ee(u)}</span>
600
- ${C}
601
- <div class="queue-card-chips">
602
- ${S}${f}
603
- </div>
604
- </div>
605
- </a>
606
- `}function lN(e){return`<span class="status-dot ${e==="pending"?"status-dot--pending":e==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Ye(e)}"></span>`}const cN=`
607
- <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">
608
- <path d="M15 18 9 12l6-6" />
609
- </svg>
610
- `,uN=`
611
- <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">
612
- <path d="M7 17 17 7M9 7h8v8" />
613
- </svg>
614
- `;function hN(e){const{current:n,loading:r,error:a}=e;return r?'<div class="queue-detail-view"><p class="loading">Loading patch</p></div>':a?`<div class="queue-detail-view"><p class="error-box">Failed to load patch — ${Ee(a)}</p></div>`:n?dN(n,e):'<div class="queue-detail-view"><p class="empty-state">Patch not found.</p></div>'}function dN(e,n){const{patch:r,meta:a,wikiEntry:o,targetExists:v}=e,{frontmatter:m}=r,c=So(o.body),u=Am(m.op,v),h=a.rawSourceRef;return`
615
- <div class="queue-detail-view">
616
- <div class="queue-detail-layout">
617
- <div class="queue-detail-main">
618
- <a class="raw-back queue-back" href="${Ye(ho())}" aria-label="Back to Drydock">
619
- ${cN}
620
- <span>Drydock</span>
621
- </a>
622
- <div class="queue-detail-header">
623
- <p class="drydock-eyebrow">MANIFEST · PATCH</p>
624
- <p class="queue-patch-id">${Ee(a.id)}</p>
625
- <h1 class="queue-summary">${Ee(m.summary)}</h1>
626
- ${u}
627
- </div>
628
- <article class="document">
629
- <div class="markdown-body" id="markdown-body">${c.html}</div>
630
- </article>
631
- </div>
632
- <aside class="queue-rail">
633
- ${fN(e,h)}
634
- ${mN(c.toc)}
635
- ${gN(e)}
636
- ${pN(e,n)}
637
- </aside>
638
- </div>
639
- </div>
640
- `}function fN(e,n){const{patch:r,meta:a,targetExists:o}=e,{frontmatter:v}=r,m=Am(v.op,o),c=xg(a.createdAt),u=uh(a.createdAt),h=_N(a.status),S=a.warnings??[],f=n?`<dd class="queue-dl-value">
641
- <a class="manifest-link queue-raw-link" href="${Ye(_C(n))}" data-raw-ref="${Ye(n)}">
642
- <span class="manifest-ref">${Ee(n)}</span>
643
- <span class="manifest-arrow">${uN}</span>
644
- </a>
645
- </dd>`:'<dd class="queue-dl-value queue-dl-muted">None</dd>',C=S.length>0?`<dt class="queue-dl-key">Warnings</dt>
646
- <dd class="queue-dl-value">
647
- <div class="queue-card-chips">
648
- ${S.map(x=>`<span class="chip chip-muted">${Ee(x)}</span>`).join("")}
649
- </div>
650
- </dd>`:"";return`
651
- <div class="queue-rail-card">
652
- <div class="queue-rail-header">
653
- <p class="drydock-eyebrow">MANIFEST · PATCH</p>
654
- <p class="queue-rail-subtitle">Patch Manifest</p>
655
- </div>
656
- <dl class="queue-dl">
657
- <dt class="queue-dl-key">OP</dt>
658
- <dd class="queue-dl-value">${m}</dd>
659
- <dt class="queue-dl-key">Target</dt>
660
- <dd class="queue-dl-value queue-dl-mono">${Ee(v.target)}</dd>
661
- <dt class="queue-dl-key">Proposer</dt>
662
- <dd class="queue-dl-value">${Ee(v.proposer)}</dd>
663
- <dt class="queue-dl-key">Created</dt>
664
- <dd class="queue-dl-value queue-dl-time">
665
- <time datetime="${Ye(a.createdAt)}" title="${Ye(c)}">
666
- ${Ee(c)}
667
- <span class="queue-dl-relative">(${Ee(u)})</span>
668
- </time>
669
- </dd>
670
- <dt class="queue-dl-key">Status</dt>
671
- <dd class="queue-dl-value queue-dl-status">${h}<span>${Ee(a.status)}</span></dd>
672
- <dt class="queue-dl-key">Source</dt>
673
- ${f}
674
- ${C}
675
- </dl>
676
- </div>
677
- `}function pN(e,n){const{meta:r,source:a}=e;if(r.status!=="pending"||a!=="queue")return"";const{actionPending:o,actionError:v}=n,m=o?" disabled":"",c=Ye(r.id),u=v?`<p class="queue-action-error">${Ee(v)}</p>`:"";return`
678
- <div class="queue-rail-card queue-actions-card">
679
- <div class="queue-rail-header">
680
- <p class="drydock-eyebrow">ACTIONS</p>
681
- <p class="queue-rail-subtitle">Decision</p>
682
- </div>
683
- ${o?'<span class="queue-action-spinner" aria-label="Processing"></span>':""}
684
- <div class="queue-action-buttons">
685
- <button class="queue-action-btn queue-action-btn--approve" type="button"
686
- data-action="queue-approve" data-patch-id="${c}"${m}
687
- aria-label="Approve this patch">
688
- <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>
689
- Approve
690
- </button>
691
- <button class="queue-action-btn queue-action-btn--reject" type="button"
692
- data-action="queue-reject-toggle"${m}
693
- aria-label="Reject this patch">
694
- <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>
695
- Reject
696
- </button>
697
- </div>
698
- <form class="queue-reject-form" hidden data-action="queue-reject-submit" data-patch-id="${c}">
699
- <textarea class="queue-reject-textarea" name="reason" minlength="1" maxlength="256" required placeholder="Enter rejection reason (max 256 chars)"></textarea>
700
- <div class="queue-action-buttons">
701
- <button class="queue-action-btn queue-action-btn--reject-submit" type="submit"${m}>Confirm</button>
702
- <button class="queue-action-btn queue-action-btn--cancel" type="button" data-action="queue-reject-cancel"${m}>Cancel</button>
703
- </div>
704
- </form>
705
- ${u}
706
- </div>
707
- `}function gN(e){const n=e.patchSet;return!n||n.members.length===0?"":`
708
- <div class="queue-rail-card">
709
- <div class="queue-rail-header">
710
- <p class="drydock-eyebrow">MANIFEST · DRYDOCK</p>
711
- <p class="queue-rail-subtitle">Patch Set</p>
712
- </div>
713
- <p class="queue-patch-id">${Ee(n.id)}</p>
714
- <ul class="patch-set-list">
715
- ${n.members.map(r=>`
716
- <li class="patch-set-item">
717
- <span class="patch-set-item-copy">
718
- <strong>${Ee(r.summary??r.id)}</strong>
719
- <small>${Ee(r.target??r.id)}</small>
720
- </span>
721
- <span class="chip ${r.status==="rejected"?"chip-coral":""}">${Ee(r.status??r.source)}</span>
722
- </li>
723
- `).join("")}
724
- </ul>
725
- </div>
726
- `}function mN(e){return e.length===0?"":`
727
- <div class="queue-rail-card queue-toc-card">
728
- <div class="queue-rail-header">
729
- <p class="drydock-eyebrow">CONTENTS</p>
730
- </div>
731
- <nav class="queue-toc-nav" aria-label="Table of contents">
732
- ${e.map(r=>`<a class="queue-toc-link queue-toc-level-${r.level}" href="#${Ye(r.id)}">${Ee(r.text)}</a>`).join("")}
733
- </nav>
734
- </div>
735
- `}function _N(e){return`<span class="status-dot ${e==="pending"?"status-dot--pending":e==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Ye(e)}"></span>`}const vN="active",bN=".toc-panel a[data-toc-id], .toc-drawer-link[data-toc-id]";function yN(e){return e.length===0?"":`
736
- <nav class="toc-panel" aria-label="Table of contents">
737
- <h2>Contents</h2>
738
- ${e.map(n=>`
739
- <a class="toc-level-${n.level}" href="#${Ye(n.id)}" data-toc-id="${Ye(n.id)}">
740
- ${Ee(n.text)}
741
- </a>
742
- `).join("")}
743
- </nav>
744
- `}function SN(e,n){if(n.length===0||typeof IntersectionObserver>"u")return()=>{};const r=[...e.querySelectorAll(bN)],a=new Set(n.map(u=>u.id)),o=[...e.querySelectorAll("#markdown-body h2[id], #markdown-body h3[id]")].filter(u=>a.has(u.id));if(r.length===0||o.length===0)return()=>{};const v=e instanceof HTMLElement?e.closest(".codex-host"):null,m=new Set,c=new IntersectionObserver(u=>{for(const S of u){const f=S.target instanceof HTMLElement?S.target.id:"";f&&(S.isIntersecting?m.add(f):m.delete(f))}const h=wN(o,m)??CN(o,v)??o[0]?.id??null;My(r,h)},{root:v,rootMargin:"-20% 0px -65% 0px",threshold:[0,.2,.6,1]});for(const u of o)c.observe(u);return My(r,o[0]?.id??null),()=>c.disconnect()}function wN(e,n){for(const r of e)if(n.has(r.id))return r.id;return null}function CN(e,n){const r=n?n.getBoundingClientRect().top:0;let a=null;for(const o of e)if(o.getBoundingClientRect().top-r<=80)a=o.id;else break;return a}function My(e,n){for(const r of e){const a=!!(n&&r.dataset.tocId===n);r.classList.toggle(vN,a),a?r.setAttribute("aria-current","location"):r.removeAttribute("aria-current")}}function xN(e){const n=e.entries.join(`
745
-
746
- `),r=So(n);return`
747
- <article class="document">
748
- <header class="document-header">
749
- <p class="eyebrow">MANIFEST · DRYDOCK</p>
750
- <h1>Log</h1>
751
- <div class="log-controls">
752
- ${[10,20,50,100].map(o=>`
753
- <a class="chip ${o===e.limit?"chip-tag":""}" href="${bC(o)}">${o}</a>
754
- `).join("")}
755
- </div>
756
- </header>
757
- <p class="empty-state">${`Latest ${e.limit} of ${e.totalEntries} entries`}</p>
758
- <div class="markdown-body">${r.html}</div>
759
- </article>
760
- `}const Eg=new Set,ca={tab:"pending",items:[],pendingCount:0,archivedCount:0,current:null,loading:!1,error:null,actionPending:!1,actionError:null};function dh(){return ca}function EN(e){return Eg.add(e),()=>Eg.delete(e)}async function TN(e){ei({tab:e,loading:!0,error:null,current:null});try{const n=await Mh(e);ei({items:n.items,pendingCount:n.pendingCount,archivedCount:n.archivedCount,loading:!1}),mm(n.pendingCount)}catch(n){ei({loading:!1,error:Nh(n)})}}async function kN(e){ei({loading:!0,error:null,current:null});try{const n=await m6(e);ei({current:n,loading:!1})}catch(n){ei({loading:!1,error:Nh(n)})}}function Vs(){ei({items:[],current:null,error:null,loading:!1,actionPending:!1,actionError:null})}async function AN(){if(ca.actionPending)return;const e=ca.current?.meta.id;if(e){ei({actionPending:!0,actionError:null});try{await _6(e);const n=await Mh("pending");ei({actionPending:!1,pendingCount:n.pendingCount,archivedCount:n.archivedCount}),mm(n.pendingCount),aa(ho("archived"))}catch(n){ei({actionPending:!1,actionError:Nh(n)})}}}async function RN(e){if(ca.actionPending)return;const n=ca.current?.meta.id;if(!n)return;const r=e.trim();if(!r||r.length>256){ei({actionError:r?"Rejection reason must be 256 characters or less.":"Please enter a rejection reason."});return}ei({actionPending:!0,actionError:null});try{await v6(n,r);const a=await Mh("pending");ei({actionPending:!1,pendingCount:a.pendingCount,archivedCount:a.archivedCount}),mm(a.pendingCount),aa(ho("archived"))}catch(a){ei({actionPending:!1,actionError:Nh(a)})}}function ei(e){Object.assign(ca,e);for(const n of Eg)n(ca)}function Nh(e){return e instanceof Error?e.message:String(e)}const Tg=new Set,bs={ref:null,content:null,loading:!1,error:null};function LN(){return bs}function MN(e){return Tg.add(e),()=>Tg.delete(e)}async function DN(e){if(!(bs.ref===e&&bs.content!==null&&!bs.error)){Vu({ref:e,content:null,loading:!0,error:null});try{const n=await g6(e);if(bs.ref!==e)return;Vu({content:n,loading:!1})}catch(n){if(bs.ref!==e)return;Vu({loading:!1,error:ON(n)})}}}function ps(){Vu({ref:null,content:null,loading:!1,error:null})}function Vu(e){Object.assign(bs,e);for(const n of Tg)n(bs)}function ON(e){return e instanceof Error?e.message:String(e)}let oo,kg=!1;const ox="fleet-console.codex.nav-collapsed",lx="fleet-console.codex.rail-collapsed";let fh=cx("nav"),ph=cx("rail"),Ag=null,Rg=null,$l="route";function NN(e,n={}){oo=e,kg=!1,document.documentElement.lang="en",x6(),H6();const r=M6(()=>jr()),a=MN(()=>jr()),o=EN(()=>jr()),v=C6(m=>{ux(m)});return document.addEventListener("click",Oy),document.addEventListener("submit",Iy),window.addEventListener("keydown",Ny,!0),tO(e),n.initialWorkspaceId&&gg()!==n.initialWorkspaceId&&w6(X1(n.initialWorkspaceId)),$N(),{navigateToWorkspace(m){gg()!==m&&aa(X1(m))},destroy(){r(),a(),o(),v(),document.removeEventListener("click",Oy),document.removeEventListener("submit",Iy),window.removeEventListener("keydown",Ny,!0),fx(),Gl(!1),U6(),E6(),e.innerHTML=""}}}function IN(e,n){e==="nav"?fh=n:ph=n,jN(e,n),oo&&jr()}function Dy(e){return e==="nav"?fh:ph}function BN(e){$l!==e&&($l=e,oo&&jr())}function cx(e){if(typeof window>"u")return!1;try{return window.localStorage.getItem(e==="nav"?ox:lx)==="true"}catch{return!1}}function jN(e,n){if(!(typeof window>"u"))try{window.localStorage.setItem(e==="nav"?ox:lx,String(n))}catch{}}async function $N(){jr(),await D6(),await ux(ec())}async function ux(e){if(e.name==="entry"){Vs(),ps(),await O6(e.id);return}if(e.name==="raw"){Vs(),await DN(e.ref);return}if(e.name==="queue"){bp(),ps(),await TN(e.tab);return}if(e.name==="queue-detail"){bp(),ps(),await kN(e.patchId);return}if(e.name==="index-md"){Vs(),ps(),await N6();return}if(e.name==="log"){Vs(),ps(),await I6(e.limit);return}if(e.name==="conflicts"){Vs(),ps(),await B6();return}if(e.name==="conflict-detail"){Vs(),ps(),await j6(e.id);return}bp(),ps(),Vs(),jr()}function jr(){const e=ec();zN(Gu(),e)}function zN(e,n){const r=n.name==="entry"?n.id:null,a=UN(n),o=$l!=="side"||!fh,v=!dx(n)&&($l!=="side"||!ph),m=e.currentEntry?PO(e.currentEntry,e.index):null;P6(e.index,e.recentIds);const c=$l==="side"?`${fh?" app-shell--nav-collapsed":""}${ph?" app-shell--rail-collapsed":""}`:"";fx(),Gl(!1),oo.innerHTML=`
761
- <div class="app-shell${a}${c}">
762
- <button class="mobile-menu" type="button" data-action="toggle-nav" aria-label="Open menu">
763
- <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">
764
- <path d="M4 7h16M4 12h16M4 17h10" />
765
- </svg>
766
- </button>
767
- ${o?KO(e.index,r,e.pendingPatchCount,e.workspaces,e.currentWorkspaceId,window.location.pathname):""}
768
- <main class="content">
769
- ${PN(e,n,m)}
770
- </main>
771
- ${v?`<div class="rail">${HN(e,n,m)}</div>`:""}
772
- </div>
773
- <div class="toast" id="toast" aria-live="polite"></div>
774
- `,kg?oo.classList.add("is-revealed"):kg=!0,n.name==="entry"&&m&&(Ag=SN(oo,m.toc))}function PN(e,n,r){return n.name==="raw"?rN(LN()):n.name==="queue"?sN(dh()):n.name==="queue-detail"?hN(dh()):e.error?UO(e.error):e.loading&&!e.currentEntry&&!e.indexMarkdown&&!e.log&&!e.currentConflict?HO():n.name==="index-md"&&e.indexMarkdown?PD(e.indexMarkdown):n.name==="log"&&e.log?xN(e.log):n.name==="conflicts"?$D(e.conflicts):n.name==="conflict-detail"&&e.currentConflict?zD(e.currentConflict):e.currentEntry&&r?r.html:zO(e.index,e.health?.cwd??null,!!e.currentWorkspaceId)}function HN(e,n,r){return dx(n)?"":`
775
- ${r?yN(r.toc):""}
776
- ${UD(e.currentEntry,e.index,e.currentMatchHint)}
777
- `}function UN(e){return e.name==="raw"?" app-shell--raw":hx(e)?" app-shell--wide":""}function hx(e){return e.name==="home"||e.name==="index-md"||e.name==="log"||e.name==="conflicts"||e.name==="queue"||e.name==="queue-detail"}function dx(e){return e.name==="raw"||hx(e)}function Oy(e){const n=e.target;if(!(n instanceof Element))return;const r=n.closest("[data-action]");if(r?.dataset.action==="toggle-nav"){document.body.classList.toggle("nav-open");return}if(r?.dataset.action==="navigate-home"){if(jy(e))return;e.preventDefault(),document.body.classList.remove("nav-open"),aa(pm());return}if(r?.dataset.action==="set-nav-mode"){const m=r.dataset.mode;(m==="tags"||m==="entries")&&(YO(m),jr());return}if(r?.dataset.action==="toggle-tag"){VO(r.dataset.tag??""),jr();return}if(r?.dataset.action==="open-toc-drawer"){qN(r);return}if(r?.dataset.action==="close-toc-drawer"){Gl(!0);return}if(r?.dataset.action==="copy-code"){WN(r);return}if(r?.dataset.action==="copy-compact-context"){const m=Gu();m.currentEntry&&Yu(hC(m.currentEntry),"Copied compact context.");return}if(r?.dataset.action==="copy-provenance-context"){const m=Gu();m.currentEntry&&Yu(dC(m.currentEntry),"Copied provenance context.");return}if(r?.dataset.action==="copy-related-context"){const m=Gu();m.currentEntry&&Yu(fC(m.currentEntry,m.index),"Copied related context pack.");return}if(r?.dataset.action==="toggle-why-matched"){const m=r.closest(".context-actions-grid")?.querySelector(".context-why-matched");m&&(m.hidden=!m.hidden);return}if(r?.dataset.action==="queue-approve"){if(dh().actionPending||!confirm("Approve this patch?"))return;r.setAttribute("disabled",""),AN();return}if(r?.dataset.action==="queue-reject-toggle"){const c=r.closest(".queue-actions-card")?.querySelector(".queue-reject-form");c&&(c.hidden=!c.hidden,c.hidden||c.querySelector("textarea")?.focus());return}if(r?.dataset.action==="queue-reject-cancel"){const c=r.closest(".queue-actions-card")?.querySelector(".queue-reject-form");c&&(c.hidden=!0);return}const a=n.closest("[data-toc-id]");if(a){e.preventDefault(),document.getElementById(a.dataset.tocId??"")?.scrollIntoView({block:"start"}),Gl(!1);return}const o=n.closest("a");if(!o||jy(e))return;const v=GN(o);v&&(e.preventDefault(),document.body.classList.remove("nav-open"),aa(v))}function Ny(e){const n=document.querySelector("#toc-drawer:not([hidden])");if(!n)return;if(e.key==="Escape"){e.preventDefault(),e.stopImmediatePropagation(),Gl(!0);return}if(e.key==="Tab"){FN(n,e),e.stopImmediatePropagation();return}const r=e.target,a=r instanceof Node&&n.contains(r),o=e.metaKey||e.ctrlKey||e.altKey;(!a||o)&&(e.preventDefault(),e.stopImmediatePropagation())}function FN(e,n){const r=[...e.querySelectorAll("a[href], button:not([disabled])")].filter(m=>m.offsetParent!==null),a=r[0],o=r[r.length-1];if(!a||!o)return;const v=document.activeElement;e.contains(v)?n.shiftKey&&v===a?(n.preventDefault(),o.focus()):!n.shiftKey&&v===o&&(n.preventDefault(),a.focus()):(n.preventDefault(),a.focus())}function qN(e){const n=document.querySelector("#toc-drawer");n&&(Rg=e,document.body.classList.remove("nav-open"),document.body.classList.add("toc-open"),n.hidden=!1,(n.querySelector(".toc-drawer-link")??n.querySelector(".toc-drawer-panel [data-action='close-toc-drawer']"))?.focus())}function Gl(e){const n=document.querySelector("#toc-drawer");n&&(n.hidden=!0,document.body.classList.remove("toc-open"),e&&Rg?.focus(),Rg=null)}function fx(){Ag?.(),Ag=null}function Iy(e){const n=e.target;if(n instanceof HTMLFormElement&&n.dataset.action==="queue-reject-submit"){if(e.preventDefault(),dh().actionPending)return;const r=n.querySelector("button[type='submit']");r&&(r.disabled=!0);const a=n.querySelector("textarea[name='reason']");RN(a?.value??"")}}async function WN(e){const r=e.closest(".code-block")?.dataset.code??"";r&&await Yu(r,"Code copied.")}async function Yu(e,n){try{await navigator.clipboard.writeText(e),By(n)}catch{By("Failed to copy to clipboard.")}}function By(e){const n=document.querySelector("#toast");n&&(n.textContent=e,n.classList.add("visible"),window.setTimeout(()=>n.classList.remove("visible"),1400))}function jy(e){return e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0}function GN(e){const n=e.getAttribute("href")??"",r=e.dataset.entryId;if(r)return Pr(decodeURIComponent(r));if(/^[a-z][a-z0-9+.-]*:/i.test(n)&&!n.startsWith(window.location.origin))return null;const a=new URL(n,window.location.origin);if(a.origin!==window.location.origin)return null;if(a.pathname==="/"||a.pathname==="/console/codex"||a.pathname==="/console/codex/")return pm();if(a.pathname.match(/^\/w\/[^/]+(\/|$)/)||a.pathname.match(/^\/console\/codex\/w\/[^/]+(\/|$)/))return a.pathname+a.search;if(a.pathname.startsWith("/console/codex/entry/")||a.pathname.startsWith("/console/codex/raw/"))return a.pathname;if(a.pathname.startsWith("/console/codex/queue")||a.pathname.startsWith("/console/codex/conflicts")||a.pathname==="/console/codex/index"||a.pathname==="/console/codex/index-md"||a.pathname==="/console/codex/log")return a.pathname+a.search;if(a.pathname.startsWith("/entry/")||a.pathname.startsWith("/raw/"))return a.pathname;if(a.pathname.startsWith("/queue")||a.pathname.startsWith("/conflicts")||a.pathname==="/index"||a.pathname==="/index-md"||a.pathname==="/log")return a.pathname+a.search;if(!a.pathname.endsWith(".md"))return null;const o=a.pathname.split("/").pop()??"",v=decodeURIComponent(o.replace(/\.md$/,""));return v?Pr(v):null}let Js=null,Kl=null;function KN(e,n){const r=YN();r.parentElement!==e&&e.appendChild(r),Kl||(Kl=NN(r,{initialWorkspaceId:n}))}function VN(e){Kl?.navigateToWorkspace(e)}function $y(){Kl?.destroy(),Kl=null,Js?.parentElement&&Js.parentElement.removeChild(Js)}function YN(){return Js||(Js=document.createElement("div"),Js.className="codex-host"),Js}function XN({state:e,mode:n,onClose:r}){const a=z.useRef(null),o=$S(),v=z.useRef(null),m=e.theaters.find(k=>k.id===e.activeTheaterId)??null,c=m?.id??null,u=!!m?.hasWiki;z.useEffect(()=>{if(!u){$y();return}return()=>{$y()}},[u]),z.useEffect(()=>{!u||!a.current||!c||(BN(n),KN(a.current,c))},[n,u,c]),z.useEffect(()=>{!u||!c||VN(c)},[c,u]),z.useEffect(()=>{if(n==="route")return;const k=E=>{E.key!=="Escape"||F6()||(E.preventDefault(),r())};return window.addEventListener("keydown",k,!0),()=>window.removeEventListener("keydown",k,!0)},[n,r]);const h=k=>{k.preventDefault(),v.current={pointerId:k.pointerId,startX:k.clientX,startWidth:o},k.currentTarget.setPointerCapture(k.pointerId),k.currentTarget.classList.add("is-dragging")},S=k=>{const E=v.current;!E||E.pointerId!==k.pointerId||hk(E.startWidth+(E.startX-k.clientX))},f=k=>{v.current?.pointerId===k.pointerId&&(v.current=null,k.currentTarget.releasePointerCapture(k.pointerId),k.currentTarget.classList.remove("is-dragging"))},C=m?.label??"Fleet Wiki",x=u?d.jsx("div",{className:"codex-surface-host",ref:a}):d.jsx(JN,{activeTheater:m,hasTheaters:e.theaters.length>0});return n==="route"?d.jsx("section",{className:"codex-route-host","aria-label":"Codex",children:x}):d.jsx("aside",{className:"codex-side-layer",style:{"--codex-side-width":`${o}px`},role:"complementary","aria-label":"Codex",children:d.jsxs("div",{className:"codex-side-panel",children:[d.jsx("div",{className:"codex-side-resize",role:"separator","aria-orientation":"vertical","aria-label":"Resize Codex panel",onPointerDown:h,onPointerMove:S,onPointerUp:f,onPointerCancel:f}),d.jsx(ZN,{title:C,onClose:r}),x]})})}function ZN({title:e,onClose:n}){const[r,a]=z.useState(()=>Dy("nav")),[o,v]=z.useState(()=>Dy("rail")),m=c=>{const u=c==="nav"?!r:!o;IN(c,u),c==="nav"?a(u):v(u)};return d.jsxs("header",{className:"codex-surface-header",children:[d.jsxs("div",{className:"codex-surface-heading",children:[d.jsx("span",{className:"codex-surface-eyebrow",children:"Codex"}),d.jsx("h2",{className:"codex-surface-title",title:e,children:e})]}),d.jsxs("div",{className:"codex-surface-actions",children:[d.jsx("button",{type:"button",className:`codex-pane-toggle ${r?"is-collapsed":""}`,onClick:()=>m("nav"),"aria-pressed":!r,"aria-label":r?"Nav 펼치기":"Nav 접기",title:r?"Nav 펼치기":"Nav 접기",children:d.jsx(QN,{})}),d.jsx("button",{type:"button",className:`codex-pane-toggle ${o?"is-collapsed":""}`,onClick:()=>m("rail"),"aria-pressed":!o,"aria-label":o?"ToC 펼치기":"ToC 접기",title:o?"ToC 펼치기":"ToC 접기",children:d.jsx(e8,{})}),d.jsx("button",{type:"button",className:"codex-surface-close",onClick:n,"aria-label":"Close Codex",children:"×"})]})]})}function JN({activeTheater:e,hasTheaters:n}){return n?d.jsxs("section",{className:"codex-empty-state",children:[d.jsx("p",{className:"codex-empty-eyebrow",children:"Codex unavailable"}),d.jsx("h1",{children:e?.label??"This Theater"}),d.jsx("p",{children:"This Theater does not have Fleet Wiki data mounted."})]}):d.jsxs("section",{className:"codex-empty-state",children:[d.jsx("p",{className:"codex-empty-eyebrow",children:"Codex"}),d.jsx("h1",{children:"Add a Theater"}),d.jsx("p",{children:"Use the top bar Theater control to choose a project root before opening Codex."})]})}function QN(){return d.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[d.jsx("rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),d.jsx("path",{d:"M6.1 3.5v9",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),d.jsx("rect",{x:"3.2",y:"4.2",width:"2.2",height:"7.6",rx:"0.7",fill:"currentColor",opacity:"0.5",stroke:"none"})]})}function e8(){return d.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[d.jsx("rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),d.jsx("path",{d:"M9.9 3.5v9",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),d.jsx("rect",{x:"10.6",y:"4.2",width:"2.2",height:"7.6",rx:"0.7",fill:"currentColor",opacity:"0.5",stroke:"none"})]})}async function t8(e){const n=await fetch("/agent-cli/state",{signal:e});return await n8(n),i8(await n.json(),n.status)}async function n8(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Ge(e.status,n)}function i8(e,n){const r=e;if(!r||typeof r!="object"||!Array.isArray(r.clis))throw new Ge(n,"Invalid agent CLI state response");return{clis:r.clis.map(a=>r8(a,n))}}function r8(e,n){const r=e;if(!r||typeof r!="object"||typeof r.id!="string"||typeof r.displayName!="string"||typeof r.available!="boolean"||!(r.version===null||typeof r.version=="string"))throw new Ge(n,"Invalid agent CLI status entry");if(Object.prototype.hasOwnProperty.call(r,"path"))throw new Ge(n,"Agent CLI status must not expose filesystem paths");return{id:r.id,displayName:r.displayName,available:r.available,version:r.version}}const Lg=new Set;let Mg={loading:!1,state:null,error:null};function s8(){return z.useSyncExternalStore(a8,zy,zy)}function zy(){return Mg}function a8(e){return Lg.add(e),()=>{Lg.delete(e)}}async function o8(e){Dp({loading:!0,error:null});try{const n=await t8(e);Dp({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;Dp({loading:!1,error:l8(n)})}}function Dp(e){Mg={...Mg,...e};for(const n of Lg)n()}function l8(e){return e instanceof Error?e.message:String(e)}function c8(){const e=s8();return z.useEffect(()=>{const n=new AbortController;return o8(n.signal),()=>n.abort()},[]),d.jsxs("section",{className:"global-settings-card","aria-label":"Agent CLI availability",children:[d.jsxs("div",{className:"agent-cli-head",children:[d.jsx("p",{className:"global-settings-resp-title",children:"Agent CLI"}),d.jsx("p",{className:"global-settings-help",children:"Whether each Agent CLI is installed and discoverable on this machine's PATH, with its detected version. Carriers can only run on an Agent CLI shown as available here."})]}),e.error?d.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?d.jsx("p",{className:"global-settings-help",children:"Checking Agent CLIs."}):null,e.state?.clis.map(n=>d.jsx(u8,{cli:n},n.id)),d.jsx("p",{className:"global-settings-foot",children:"Install or update a CLI, then reopen this page to re-check availability."})]})}function u8({cli:e}){return d.jsxs("div",{className:"agent-cli-row",children:[d.jsx("span",{className:"agent-cli-name",children:e.displayName}),d.jsxs("span",{className:"agent-cli-meta",children:[e.available&&e.version?d.jsx("span",{className:"agent-cli-version",children:e.version}):null,d.jsx("span",{className:`agent-cli-status ${e.available?"is-on":""}`,children:e.available?"Available":"Not found"})]})]})}async function h8(e){const n=await fetch("/model-auth/state",{signal:e});return await Rm(n),gx(await n.json(),n.status)}async function d8(e,n,r){const a=await fetch(`/model-auth/providers/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:n}),signal:r});return await Rm(a),px(await a.json(),a.status)}async function f8(e,n){const r=await fetch(`/model-auth/providers/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});return await Rm(r),px(await r.json(),r.status)}async function Rm(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Ge(e.status,n)}function px(e,n){const r=e;if(!r||typeof r!="object"||!("state"in r))throw new Ge(n,"Invalid model auth mutation response");return{state:gx(r.state,n)}}function gx(e,n){const r=e;if(!r||typeof r!="object"||!Array.isArray(r.providers))throw new Ge(n,"Invalid model auth state response");return{providers:r.providers.map(a=>p8(a,n))}}function p8(e,n){const r=e;if(typeof r.cli!="string"||typeof r.displayName!="string"||typeof r.signedIn!="boolean")throw new Ge(n,"Invalid model auth provider response");return{cli:r.cli,displayName:r.displayName,signedIn:r.signedIn}}const Dg=new Set;let Og={loading:!1,state:null,busyCli:null,error:null};function g8(){return z.useSyncExternalStore(m8,Py,Py)}function Py(){return Og}function m8(e){return Dg.add(e),()=>{Dg.delete(e)}}async function _8(e){$r({loading:!0,error:null});try{const n=await h8(e);$r({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;$r({loading:!1,error:Lm(n)})}}async function v8(e,n){$r({busyCli:e,error:null});try{const r=await d8(e,n);return $r({state:r.state,busyCli:null,error:null}),await mx(),!0}catch(r){return $r({busyCli:null,error:Lm(r)}),!1}}async function b8(e){$r({busyCli:e,error:null});try{const n=await f8(e);return $r({state:n.state,busyCli:null,error:null}),await mx(),!0}catch(n){return $r({busyCli:null,error:Lm(n)}),!1}}async function mx(){try{uw(await US())}catch{}}function $r(e){Og={...Og,...e};for(const n of Dg)n()}function Lm(e){return e instanceof Error?e.message:String(e)}function y8(){const e=g8();return z.useEffect(()=>{const n=new AbortController;return _8(n.signal),()=>n.abort()},[]),d.jsxs("section",{className:"global-settings-card","aria-label":"Model sign-in",children:[d.jsxs("div",{className:"model-auth-head",children:[d.jsx("p",{className:"global-settings-resp-title",children:"Model Sign-in"}),d.jsx("p",{className:"global-settings-help",children:"Register a provider API key so carriers can run on that model. Keys are validated against the provider, stored locally, and never shown back in the browser."})]}),e.error?d.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?d.jsx("p",{className:"global-settings-help",children:"Loading sign-in state."}):null,e.state?.providers.map(n=>d.jsx(S8,{provider:n,busy:e.busyCli===n.cli},n.cli)),d.jsx("p",{className:"global-settings-foot",children:"Sign-in changes apply to newly launched sessions. Running sessions keep their current credentials until relaunched."})]})}function S8({provider:e,busy:n}){const[r,a]=z.useState(""),o=async()=>{await v8(e.cli,r)&&a("")},v=async()=>{await b8(e.cli)};return d.jsxs("div",{className:"model-auth-row",children:[d.jsxs("div",{className:"model-auth-row-head",children:[d.jsx("span",{className:"model-auth-name",children:e.displayName}),d.jsx("span",{className:`model-auth-status ${e.signedIn?"is-on":""}`,children:e.signedIn?"Signed in":"Not signed in"})]}),e.signedIn?d.jsx("div",{className:"model-auth-actions",children:d.jsx("button",{type:"button",className:"model-auth-button",disabled:n,onClick:()=>{v()},children:n?"Working…":"Sign out"})}):d.jsxs("form",{className:"model-auth-form",onSubmit:m=>{m.preventDefault(),o()},children:[d.jsx("input",{type:"password",className:"model-auth-input",placeholder:"API key",value:r,autoComplete:"off",spellCheck:!1,disabled:n,"aria-label":`${e.displayName} API key`,onChange:m=>a(m.target.value)}),d.jsx("button",{type:"submit",className:"model-auth-button is-primary",disabled:n||r.trim().length===0,children:n?"Verifying…":"Sign in"})]})]})}async function w8(e){const n=await fetch("/global-settings/state",{signal:e});return await _x(n),vx(await n.json(),n.status)}async function C8(e,n){const r=await fetch("/global-settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:n});await _x(r);const a=await r.json();if(!a||typeof a!="object"||!("state"in a))throw new Ge(r.status,"Invalid global settings mutation response");return{state:vx(a.state,r.status)}}async function _x(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Ge(e.status,n)}function vx(e,n){const r=e;if(!r||typeof r.replaceSystemPrompt!="boolean"||typeof r.enableMetaphor!="boolean")throw new Ge(n,"Invalid global settings state response");return{replaceSystemPrompt:r.replaceSystemPrompt,enableMetaphor:r.enableMetaphor}}const Ng=new Set;let Ig={loading:!1,state:null,savingField:null,error:null};function x8(){return z.useSyncExternalStore(E8,Hy,Hy)}function Hy(){return Ig}function E8(e){return Ng.add(e),()=>{Ng.delete(e)}}async function T8(e){lo({loading:!0,error:null});try{const n=await w8(e);lo({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;lo({loading:!1,error:bx(n)})}}async function Uy(e,n){lo({savingField:e,error:null});try{const r=await C8({[e]:n});return lo({state:r.state,savingField:null,error:null}),!0}catch(r){return lo({savingField:null,error:bx(r)}),!1}}function lo(e){Ig={...Ig,...e};for(const n of Ng)n()}function bx(e){return e instanceof Error?e.message:String(e)}const k8=[{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)"]}],A8=[{id:"webgl",label:"WebGL"},{id:"dom",label:"DOM"}];function R8(){const e=x8(),n=e.state,r=e.savingField!==null;return z.useEffect(()=>{const a=new AbortController;return T8(a.signal),()=>a.abort()},[]),d.jsxs("main",{className:"global-settings-page",children:[d.jsxs("section",{className:"global-settings-hero","aria-labelledby":"global-settings-title",children:[d.jsxs("div",{children:[d.jsx("p",{className:"bridge-kicker",children:"Fleet Control Surface"}),d.jsx("h2",{id:"global-settings-title",children:"Settings"})]}),d.jsx("div",{className:"global-settings-status",role:"status","aria-live":"polite",children:r?"Saving…":""})]}),e.error?d.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,d.jsx(L8,{}),d.jsxs("section",{className:"global-settings-card","aria-label":"Fleet global settings",children:[e.loading&&!n?d.jsx("p",{className:"global-settings-help",children:"Loading settings."}):null,n?d.jsxs(d.Fragment,{children:[d.jsx(Fy,{title:"System Prompt Injection",help:"Append keeps the Agent CLI's built-in system prompt and layers Fleet doctrine on top. Replace swaps it entirely for Fleet doctrine. Affects Claude-family CLIs only; Codex always receives doctrine through its profile.",onLabel:"Replace",offLabel:"Append",value:n.replaceSystemPrompt,disabled:r,onToggle:()=>{Uy("replaceSystemPrompt",!n.replaceSystemPrompt)}}),d.jsx(Fy,{title:"Metaphor",help:"Enabled layers the naval tone overlay — clipped reporting cadence and Fleet vocabulary — onto every session. Off keeps the Admiral persona without the tone.",onLabel:"Enabled",offLabel:"Off",value:n.enableMetaphor,disabled:r,onToggle:()=>{Uy("enableMetaphor",!n.enableMetaphor)}})]}):null,d.jsx("p",{className:"global-settings-foot",children:"Changes apply to newly launched sessions. Running sessions keep their current configuration until relaunched."})]}),d.jsx(c8,{}),d.jsx(y8,{})]})}function L8(){const{activeTheme:e,terminalRenderer:n}=Ql();return d.jsxs("section",{className:"global-settings-card","aria-label":"Appearance",children:[d.jsxs("div",{className:"global-settings-row",children:[d.jsxs("div",{className:"global-settings-row-text",children:[d.jsx("p",{className:"global-settings-resp-title",children:"Theme"}),d.jsx("p",{className:"global-settings-help",children:"Console color scheme. Applies immediately and is remembered on this browser."})]}),d.jsx("div",{className:"theme-picker",role:"group","aria-label":"Theme",children:k8.map(r=>{const a=r.id===e;return d.jsxs("button",{type:"button","aria-pressed":a,className:`theme-card ${a?"is-active":""}`,onClick:()=>hA(r.id),children:[d.jsx("span",{className:"theme-card-swatch","aria-hidden":"true",children:r.swatch.map(o=>d.jsx("i",{style:{background:o}},o))}),d.jsx("span",{className:"theme-card-label",children:r.label}),d.jsx("span",{className:"theme-card-check","aria-hidden":"true",children:a?d.jsx(M8,{}):null})]},r.id)})})]}),d.jsxs("div",{className:"global-settings-row",children:[d.jsxs("div",{className:"global-settings-row-text",children:[d.jsx("p",{className:"global-settings-resp-title",children:"Terminal Renderer"}),d.jsx("p",{className:"global-settings-help",children:"WebGL paints the terminal on the GPU for sharper, faster output; DOM is a compatibility fallback. Switching applies to the live terminal instantly without dropping the session."})]}),d.jsx("div",{className:"segmented",role:"group","aria-label":"Terminal renderer",children:A8.map(r=>{const a=r.id===n;return d.jsx("button",{type:"button","aria-pressed":a,className:`segmented-option ${a?"is-active":""}`,onClick:()=>dA(r.id),children:r.label},r.id)})})]}),d.jsx("p",{className:"global-settings-foot",children:"Appearance preferences apply immediately and are stored per browser, separate from session settings."})]})}function Fy({title:e,help:n,onLabel:r,offLabel:a,value:o,disabled:v,onToggle:m}){return d.jsxs("div",{className:"global-settings-row",children:[d.jsxs("div",{className:"global-settings-row-text",children:[d.jsx("p",{className:"global-settings-resp-title",children:e}),d.jsx("p",{className:"global-settings-help",children:n})]}),d.jsx("button",{type:"button",className:`global-settings-toggle ${o?"is-on":""}`,disabled:v,"aria-pressed":o,onClick:m,children:d.jsx("span",{children:o?r:a})})]})}function M8(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.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"})})}const D8="button",O8=184,N8=320,Ru=12;function Mm({state:e,onSelect:n,mode:r=D8,anchor:a,viewportBounds:o,onClose:v}){const[m,c]=z.useState(r==="menu"),u=z.useRef(null),h=z.useRef(null),S=z.useRef(null),f=e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId||e.agentClis.length===0,C=r==="menu"||m;z.useEffect(()=>{r==="menu"&&c(!0)},[r,a?.x,a?.y]),z.useEffect(()=>{if(!C)return;const g=p=>{u.current?.contains(p.target)||x()},b=p=>{p.key==="Escape"&&(x(),h.current?.focus())};return document.addEventListener("mousedown",g),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",b)}},[C]),z.useEffect(()=>{C&&S.current?.focus()},[C]);const x=()=>{c(!1),v?.()},k=async g=>{f||Bg(g)!==null||(c(!1),h.current?.focus(),await n(g))},E=g=>{if(g.key!=="ArrowDown"&&g.key!=="ArrowUp")return;g.preventDefault();const b=Array.from(S.current?.querySelectorAll("[role^='menuitem']:not(:disabled)")??[]);if(b.length===0)return;const p=b.indexOf(document.activeElement),y=p===-1?g.key==="ArrowDown"?0:b.length-1:(p+(g.key==="ArrowDown"?1:-1)+b.length)%b.length;b[y]?.focus()};return d.jsxs("div",{className:`operation-launch-control ${r==="menu"?"operation-launch-control--canvas":""}`,ref:u,style:a?I8(a,o):void 0,"data-canvas-blocker":!0,children:[r==="button"?d.jsx("button",{type:"button",ref:h,className:`workspace-add-button ${m?"is-open":""}`,onClick:()=>c(g=>!g),disabled:f,"aria-haspopup":"menu","aria-expanded":m,"aria-label":"Launch operation",children:d.jsx(B8,{})}):null,C?d.jsx("div",{className:"operation-launch-menu theater-menu",role:"menu","aria-label":"Launch operation",tabIndex:-1,ref:S,onKeyDown:E,children:e.agentClis.length>0?d.jsx("ul",{className:"theater-menu-list",children:e.agentClis.map(g=>{const b=Bg(g),p=f||b!==null;return d.jsx("li",{children:d.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item operation-launch-menu-item",disabled:p,"aria-disabled":p,title:b??void 0,onClick:()=>{k(g)},children:[d.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:yx(g.id)}),d.jsx("span",{className:"theater-menu-label",children:g.label}),b?d.jsx("span",{className:"operation-launch-menu-reason",children:b}):null]})},g.id)})}):d.jsx("p",{className:"theater-menu-empty",children:"No Agent CLI available."})}):null]})}function Bg(e){return e.available?e.signedIn?null:"Sign-in required":"Not installed"}function I8(e,n){return n?{left:Math.max(Ru,Math.min(e.x,n.width-O8-Ru)),top:Math.max(Ru,Math.min(e.y,n.height-N8-Ru))}:{left:e.x,top:e.y}}function B8(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function yx(e){return e==="claude"?d.jsx(j8,{}):e==="claude-kimi"?d.jsx($8,{}):e==="claude-glm"?d.jsx(z8,{}):e==="codex"?d.jsx(P8,{}):d.jsx(H8,{})}function j8(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.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 $8(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.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 z8(){return d.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",style:{display:"inline-block",verticalAlign:"middle"},children:d.jsx("polygon",{points:"5,1 8.5,3 8.5,7 5,9 1.5,7 1.5,3",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})})}function P8(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.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 H8(){return d.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[d.jsx("rect",{x:"2.8",y:"3.4",width:"10.4",height:"8.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.15"}),d.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"})]})}const U8=208,F8=360,Lu=12;function q8({state:e,anchor:n,viewportBounds:r,onLaunchCli:a,onOpenShell:o,onResetView:v,onClose:m}){const c=z.useRef(null),u=z.useRef(null),h=e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId||e.agentClis.length===0,S=!e.activeTheaterId;return z.useEffect(()=>{const f=x=>{c.current?.contains(x.target)||m()},C=x=>{x.key==="Escape"&&m()};return document.addEventListener("mousedown",f),document.addEventListener("keydown",C),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",C)}},[m]),z.useEffect(()=>{u.current?.focus()},[]),d.jsx("div",{className:"operation-launch-control operation-launch-control--canvas",ref:c,style:W8(n,r),"data-canvas-blocker":!0,children:d.jsxs("div",{className:"operation-launch-menu theater-menu canvas-context-menu",role:"menu","aria-label":"Canvas actions",tabIndex:-1,ref:u,children:[d.jsx("p",{className:"canvas-context-menu-group",children:"New Operation"}),e.agentClis.length>0?d.jsx("ul",{className:"theater-menu-list",children:e.agentClis.map(f=>{const C=Bg(f),x=h||C!==null;return d.jsx("li",{children:d.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item operation-launch-menu-item",disabled:x,"aria-disabled":x,title:C??void 0,onClick:()=>{C===null&&!h&&a(f)},children:[d.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:yx(f.id)}),d.jsx("span",{className:"theater-menu-label",children:f.label}),C?d.jsx("span",{className:"operation-launch-menu-reason",children:C}):null]})},f.id)})}):d.jsx("p",{className:"theater-menu-empty",children:"No Agent CLI available."}),d.jsx("div",{className:"theater-menu-divider",role:"separator"}),d.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item",disabled:S,onClick:o,children:[d.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:d.jsx(G8,{})}),d.jsx("span",{className:"theater-menu-label",children:"Open Shell"})]}),d.jsx("div",{className:"theater-menu-divider",role:"separator"}),d.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item",onClick:v,children:[d.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:d.jsx(K8,{})}),d.jsx("span",{className:"theater-menu-label",children:"Reset view"})]})]})})}function W8(e,n){return n?{left:Math.max(Lu,Math.min(e.x,n.width-U8-Lu)),top:Math.max(Lu,Math.min(e.y,n.height-F8-Lu))}:{left:e.x,top:e.y}}function G8(){return d.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[d.jsx("rect",{x:"2.8",y:"3.4",width:"10.4",height:"9.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.15"}),d.jsx("path",{d:"M5 6.6 6.8 8.4 5 10.2M8.4 10.2h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinecap:"round",strokeLinejoin:"round"})]})}function K8(){return d.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[d.jsx("path",{d:"M4.4 7.2A4 4 0 1 1 4 9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M2.4 4.6v2.8h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}const qy=256,Wy=176,Op=12,Mu=220,Sx="fleet-console.map.radarCollapsed";function V8({panels:e,shellPanels:n,viewport:r,canvasSize:a,onJump:o}){const v=z.useRef(null),m=z.useRef(!1),[c,u]=z.useState(Y8);if(a.width<=0||a.height<=0||r.zoom<=0)return null;const h=[...Object.entries(e).map(([B,K])=>({id:B,kind:"op",x:K.x,y:K.y,width:K.width,height:K.height})),...Object.entries(n).map(([B,K])=>({id:B,kind:"shell",x:K.geometry.x,y:K.geometry.y,width:K.geometry.width,height:K.geometry.height}))];if(h.length===0)return null;const S=()=>{u(B=>{const K=!B;return X8(K),K})};if(c)return d.jsx("button",{type:"button",className:"canvas-minimap-fab","data-canvas-blocker":!0,onClick:S,"aria-label":"Radar 펼치기",title:"Show radar",children:d.jsx(J8,{})});const f=qy-Op*2,C=Wy-Op*2,x={x:-r.x/r.zoom,y:-r.y/r.zoom,width:a.width/r.zoom,height:a.height/r.zoom};let k=Math.min(x.x,...h.map(B=>B.x)),E=Math.min(x.y,...h.map(B=>B.y)),g=Math.max(x.x+x.width,...h.map(B=>B.x+B.width)),b=Math.max(x.y+x.height,...h.map(B=>B.y+B.height));k-=Mu,E-=Mu,g+=Mu,b+=Mu;const p=g-k,y=b-E,T=Math.min(f/p,C/y),A=(f-p*T)/2,L=(C-y*T)/2,M=B=>A+(B-k)*T,R=B=>L+(B-E)*T,O=B=>{const K=v.current?.getBoundingClientRect();if(!K)return;const te=B.clientX-K.left,q=B.clientY-K.top;o({x:k+(te-A)/T,y:E+(q-L)/T})},F=B=>{B.stopPropagation(),m.current=!0,B.currentTarget.setPointerCapture(B.pointerId),O(B)},U=B=>{m.current&&(B.stopPropagation(),O(B))},G=B=>{m.current=!1;try{B.currentTarget.releasePointerCapture(B.pointerId)}catch{}};return d.jsxs("div",{className:"canvas-minimap","data-canvas-blocker":!0,style:{width:qy,height:Wy},children:[d.jsx("span",{className:"canvas-minimap-label","aria-hidden":"true",children:"Radar"}),d.jsx("button",{type:"button",className:"canvas-minimap-toggle",onClick:S,"aria-label":"Radar 접기",title:"Collapse radar",children:d.jsx(Z8,{})}),d.jsxs("div",{ref:v,className:"canvas-minimap-inner",style:{inset:Op},onPointerDown:F,onPointerMove:U,onPointerUp:G,onPointerCancel:G,role:"presentation","aria-label":"Canvas minimap — drag to navigate",children:[h.map(B=>d.jsx("div",{className:`canvas-minimap-panel ${B.kind==="shell"?"is-shell":""}`,style:{left:M(B.x),top:R(B.y),width:Math.max(2,B.width*T),height:Math.max(2,B.height*T)}},B.id)),d.jsx("div",{className:"canvas-minimap-view",style:{left:M(x.x),top:R(x.y),width:x.width*T,height:x.height*T}})]})]})}function Y8(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Sx)==="true"}catch{return!1}}function X8(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Sx,String(e))}catch{}}function Z8(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M5.5 4.5 10.5 8l-5 3.5M11 8H5.5",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function J8(){return d.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[d.jsx("rect",{x:"2",y:"3",width:"12",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),d.jsx("rect",{x:"4.2",y:"5",width:"4.2",height:"3.1",rx:"0.6",fill:"none",stroke:"currentColor",strokeWidth:"1"}),d.jsx("circle",{cx:"11",cy:"10.2",r:"0.95",fill:"currentColor"})]})}function wx({jobs:e,selectedJobId:n,onSelect:r}){const a=r??Eh;return d.jsx("ol",{className:"terminal-job-lines",children:e.map(o=>d.jsx(Q8,{job:o,active:n===o.jobId,onSelect:a},o.jobId))})}function Q8({job:e,active:n,onSelect:r}){const a=Es(e.status),o=Hk(e),v=e.ownerCarrierId?`${Jg(e.ownerCarrierId)} · ${na(e.status)}`:na(e.status);return d.jsx("li",{children:d.jsxs("button",{type:"button",className:`terminal-job-line ${n?"is-active":""}`,onClick:()=>r(e.jobId),"aria-current":n||void 0,children:[d.jsx("span",{className:`status-dot status-dot--${a}`,"aria-hidden":"true"}),d.jsx("span",{className:"terminal-job-line-label",children:e.label??Fl(e.jobId)}),d.jsx("span",{className:"terminal-job-line-meta",children:v}),o?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"terminal-job-line-sep","aria-hidden":"true",children:"-"}),d.jsx("span",{className:"terminal-job-line-stream",children:o})]}):null]})})}const eI=["n","ne","e","se","s","sw","w","nw"],Np=320,Ip=200;function Cx({geometry:e,zoom:n,onResize:r}){const a=z.useRef(null),o=(c,u)=>{u.preventDefault(),u.stopPropagation(),a.current={direction:c,pointerId:u.pointerId,startX:u.clientX,startY:u.clientY,geometry:e},u.currentTarget.setPointerCapture(u.pointerId)},v=c=>{const u=a.current;if(!u||u.pointerId!==c.pointerId)return;c.preventDefault(),c.stopPropagation();const h=(c.clientX-u.startX)/n,S=(c.clientY-u.startY)/n;r(tI(u.geometry,u.direction,h,S))},m=c=>{a.current?.pointerId===c.pointerId&&(c.preventDefault(),c.stopPropagation(),a.current=null,c.currentTarget.releasePointerCapture(c.pointerId))};return d.jsx(d.Fragment,{children:eI.map(c=>d.jsx("div",{className:`canvas-panel-resize canvas-panel-resize--${c}`,onPointerDown:u=>o(c,u),onPointerMove:v,onPointerUp:m,onPointerCancel:m,"data-canvas-blocker":!0,"aria-hidden":"true"},c))})}function tI(e,n,r,a){let{x:o,y:v,width:m,height:c}=e;return n.includes("e")&&(m+=r),n.includes("s")&&(c+=a),n.includes("w")&&(o+=r,m-=r),n.includes("n")&&(v+=a,c-=a),m<Np&&(n.includes("w")&&(o-=Np-m),m=Np),c<Ip&&(n.includes("n")&&(v-=Ip-c),c=Ip),{...e,x:o,y:v,width:m,height:c}}function nI({state:e,session:n,geometry:r,viewport:a,active:o}){const v=z.useRef(null),[m,c]=z.useState(!1),[u,h]=z.useState(""),S=z.useRef(null),f=z.useRef(!1),C=z.useRef(!1),k=Jl(e,n).filter(({job:W})=>!Li(W.status)).map(({job:W})=>W),E=k.length,g=n.status==="dormant",b=xs(n),p=e.operationNotifications[n.sessionId]?.kind==="input-waiting",y=g?null:p?"awaiting":E>0?"live":n.turnState==="running"?"turn":null,T=()=>{Qn(n.sessionId),Nl(n.sessionId,r)},A=W=>{o||Qn(n.sessionId),Eh(W)},L=W=>{W.button===0&&(W.preventDefault(),W.stopPropagation(),T(),v.current={pointerId:W.pointerId,startX:W.clientX,startY:W.clientY,geometry:r},W.currentTarget.setPointerCapture(W.pointerId))},M=W=>{const Y=v.current;!Y||Y.pointerId!==W.pointerId||(W.preventDefault(),W.stopPropagation(),Nl(n.sessionId,{...Y.geometry,x:Y.geometry.x+(W.clientX-Y.startX)/a.zoom,y:Y.geometry.y+(W.clientY-Y.startY)/a.zoom}))},R=W=>{v.current?.pointerId===W.pointerId&&(W.preventDefault(),W.stopPropagation(),v.current=null,W.currentTarget.releasePointerCapture(W.pointerId))},O=W=>{W.stopPropagation()};z.useEffect(()=>{m&&(S.current?.focus(),S.current?.select())},[m]);const F=()=>{T(),C.current=!1,h(b),c(!0)},U=()=>{C.current=!0,c(!1),h("")},G=async()=>{if(!f.current){f.current=!0;try{Cs(await Zg(n.sessionId,u))}catch(W){nm(W instanceof Error?W.message:String(W))}finally{f.current=!1,C.current=!0,c(!1)}}},B=W=>{if(W.key==="Enter"){W.preventDefault(),G();return}W.key==="Escape"&&(W.preventDefault(),U())},K=W=>{W.stopPropagation(),T()},te=W=>{W.stopPropagation(),T()},q=W=>{W.stopPropagation()};return d.jsxs(d.Fragment,{children:[d.jsxs("article",{className:`canvas-panel ${o?"is-active":""} ${y?`is-running is-running--${y}`:""}`,style:{left:r.x,top:r.y,width:r.width,height:r.height,zIndex:r.zIndex},onPointerDown:T,"data-canvas-panel":!0,"aria-label":`Operation ${b}`,children:[d.jsxs("div",{className:"canvas-panel-titlebar",onPointerDown:L,onPointerMove:M,onPointerUp:R,onPointerCancel:R,"data-canvas-blocker":!0,children:[d.jsx("span",{className:uo(n,E),"aria-hidden":"true"}),m?d.jsx("input",{ref:S,className:"canvas-panel-rename-input",value:u,"aria-label":`${b} 이름 변경`,onPointerDown:W=>W.stopPropagation(),onChange:W=>h(W.target.value),onKeyDown:B,onBlur:()=>{if(C.current){C.current=!1;return}G()}}):d.jsx("span",{className:"canvas-panel-title",onPointerDown:K,onDoubleClick:F,title:"Double-click to rename",children:b}),d.jsx("span",{className:"canvas-panel-cli",children:n.cliLabel??n.cliId??"CLI"}),E>0?d.jsx("span",{className:"canvas-panel-job-count",children:E}):null,d.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:O,onClick:()=>{AT(n.sessionId)},"aria-label":`Minimize operation ${b}`,title:"Minimize panel",children:d.jsx(sI,{})}),d.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:O,onClick:()=>{rI(n.sessionId)},"aria-label":`${g?"Forget":"Terminate"} operation ${b}`,title:g?"Forget operation":"Terminate operation",children:d.jsx(aI,{})})]}),d.jsx("div",{className:"canvas-panel-terminal",onPointerDown:te,onWheel:q,"data-canvas-blocker":!0,children:g?d.jsxs("button",{type:"button",className:"canvas-panel-dormant",onClick:()=>{iI(n.sessionId)},children:[d.jsx("span",{className:"canvas-panel-dormant-status",children:"Dormant"}),d.jsx("span",{className:"canvas-panel-dormant-action",children:"Resume"})]}):d.jsx(Lh,{sessionId:n.sessionId,active:o,zoom:a.zoom,onExit:()=>Zl(n.sessionId)})}),d.jsx(Cx,{geometry:r,zoom:a.zoom,onResize:W=>Nl(n.sessionId,W)})]}),k.length>0?d.jsx("div",{className:"canvas-panel-jobdock",style:{left:r.x,top:r.y+r.height,width:r.width,zIndex:r.zIndex},"data-canvas-blocker":!0,"aria-label":`Active carrier jobs for ${b}`,children:d.jsx(wx,{jobs:k,selectedJobId:e.selectedJobId,onSelect:A})}):null]})}async function iI(e){try{const n=await Sh(e);Cs(n),Qn(n.sessionId)}catch(n){xh(n instanceof Error?n.message:String(n))}}async function rI(e){try{await yh(e)}catch(n){Ch(n instanceof Error?n.message:String(n));return}Zl(e)}function sI(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M3.5 11.5h9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function aI(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M4.6 4.6 11.4 11.4M11.4 4.6 4.6 11.4",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})})}const oI={overflow:!1,atStart:!1,atEnd:!0,page:1,pages:1};function lI({state:e,sessions:n,minimized:r}){const a=TT(),o=z.useRef(null),v=z.useRef(!0),[m,c]=z.useState(oI),u=new Map(n.map(b=>[b.sessionId,b])),h=r.map(b=>u.get(b)).filter(b=>!!b).map(b=>{const p=Jl(e,b).filter(({job:T})=>!Li(T.status)).length,y=b.status==="dormant"?null:p>0?"live":b.turnState==="running"?"turn":null;return{session:b,activeJobCount:p,underway:y,active:e.activeTerminalSessionId===b.sessionId}}),S=h.map(b=>b.session.sessionId).join(","),f=h.map(b=>`${xs(b.session)}${b.session.cliLabel??b.session.cliId??""}${b.activeJobCount}`).join(""),C=z.useCallback(()=>{const b=o.current;if(!b)return;const{scrollLeft:p,clientWidth:y,clientHeight:T,scrollWidth:A}=b,L=Math.max(0,A-y),M=y>0&&T>0&&L>1,R=M?Math.max(1,Math.ceil(A/y)):1,O=p>=L-1,F=M?O?1:Math.min(R,Math.ceil((L-p)/y)+1):1;c({overflow:M,atStart:p<=1,atEnd:O,page:F,pages:R})},[]);if(z.useEffect(()=>{const b=o.current;if(!b)return;v.current=!0,a&&(b.scrollLeft=b.scrollWidth),C();const p=typeof ResizeObserver<"u"?new ResizeObserver(()=>{v.current&&(b.scrollLeft=b.scrollWidth),C()}):null;p?.observe(b);const y=()=>{const T=Math.max(0,b.scrollWidth-b.clientWidth);v.current=b.scrollLeft>=T-1,C()};return b.addEventListener("scroll",y,{passive:!0}),()=>{p?.disconnect(),b.removeEventListener("scroll",y)}},[a,S,C]),z.useEffect(()=>{const b=o.current;!b||!a||(v.current&&(b.scrollLeft=b.scrollWidth),C())},[a,f,C]),h.length===0)return null;const x=h.some(b=>b.underway==="live")?"live":h.some(b=>b.underway==="turn")?"turn":null,k=["canvas-dock-toggle",x?`canvas-dock-toggle--attention-${x}`:""].filter(Boolean).join(" "),E=a&&m.overflow,g=b=>{const p=o.current;if(!p)return;const y=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;p.scrollBy({left:b*p.clientWidth,behavior:y?"auto":"smooth"})};return d.jsxs("div",{className:`canvas-dock ${a?"is-expanded":""}`,"data-canvas-blocker":!0,children:[d.jsxs("button",{type:"button",className:k,onClick:BT,"aria-expanded":a,"aria-label":a?"Collapse minimized panels":"Expand minimized panels",title:a?"Collapse":"Expand",children:[d.jsx("span",{className:"canvas-dock-toggle-beacon","aria-hidden":"true"}),d.jsx("span",{className:"canvas-dock-toggle-chevron","aria-hidden":"true",children:d.jsx(uI,{})}),d.jsx("span",{className:"canvas-dock-toggle-count",children:h.length})]}),d.jsxs("div",{className:"canvas-dock-rail",role:"toolbar","aria-label":"Minimized operations","aria-hidden":!a,inert:!a,children:[E?d.jsx("button",{type:"button",className:"canvas-dock-pager canvas-dock-pager--prev",onClick:()=>g(-1),disabled:m.atStart,"aria-label":"Show older minimized operations",title:"Older",children:d.jsx(Gy,{direction:"prev"})}):null,d.jsx("div",{className:"canvas-dock-chips",ref:o,children:h.map((b,p)=>d.jsx(cI,{entry:b,index:p},b.session.sessionId))}),E?d.jsx("button",{type:"button",className:"canvas-dock-pager canvas-dock-pager--next",onClick:()=>g(1),disabled:m.atEnd,"aria-label":"Show newer minimized operations",title:"Newer",children:d.jsx(Gy,{direction:"next"})}):null,E?d.jsxs("span",{className:"canvas-dock-page","aria-label":`Page ${m.page} of ${m.pages}`,children:[m.page,"/",m.pages]}):null]})]})}function cI({entry:e,index:n}){const{session:r,activeJobCount:a,underway:o,active:v}=e,m=xs(r),c=()=>{RT(r.sessionId),Qn(r.sessionId)},u=["canvas-dock-chip",v?"canvas-dock-chip--active":"",o?`canvas-dock-chip--underway canvas-dock-chip--underway-${o}`:""].filter(Boolean).join(" ");return d.jsxs("div",{className:u,role:"button",tabIndex:0,"aria-label":`Restore operation ${m}`,title:"Click to restore",style:{"--i":n},onClick:c,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),c())},children:[d.jsx("span",{className:uo(r,a),"aria-hidden":"true"}),d.jsx("span",{className:"canvas-dock-chip-name",children:m}),d.jsx("span",{className:"canvas-dock-chip-cli",children:r.cliLabel??r.cliId??"CLI"}),a>0?d.jsx("span",{className:"canvas-dock-chip-count",children:a}):null]})}function uI(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M4 10l4-4 4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Gy({direction:e}){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:e==="prev"?"M10 3.5 5.5 8 10 12.5":"M6 3.5 10.5 8 6 12.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const hI="is-animation-paused";function dI({viewport:e,backgroundAnimationEnabled:n}){const[r,a]=z.useState(()=>document.hidden);return z.useEffect(()=>{function o(){a(document.hidden)}return document.addEventListener("visibilitychange",o),()=>{document.removeEventListener("visibilitychange",o)}},[]),d.jsxs("div",{className:"operations-canvas-background","aria-hidden":"true",children:[d.jsx("div",{className:"operations-canvas-sea"}),d.jsx("div",{className:"operations-canvas-grid",style:{backgroundPosition:`${e.x}px ${e.y}px`,backgroundSize:`${48*e.zoom}px ${48*e.zoom}px, ${12*e.zoom}px ${12*e.zoom}px`}}),n?d.jsxs("div",{className:`operations-radar${r?` ${hI}`:""}`,children:[d.jsx("span",{className:"operations-radar-ring operations-radar-ring--outer"}),d.jsx("span",{className:"operations-radar-ring operations-radar-ring--middle"}),d.jsx("span",{className:"operations-radar-ring operations-radar-ring--inner"}),d.jsx("span",{className:"operations-radar-sweep"})]}):null]})}const xx="fleet-console.map.shortcutsCollapsed",Ky=xw.find(e=>e.title==="Map")??null;function fI(){const[e,n]=z.useState(pI);if(!Ky)return null;const r=()=>{n(a=>{const o=!a;return gI(o),o})};return e?d.jsx("button",{type:"button",className:"map-shortcuts-fab","data-canvas-blocker":!0,onClick:r,"aria-label":"맵 단축키 보기",title:"Map shortcuts",children:d.jsx(mI,{})}):d.jsxs("aside",{className:"map-shortcuts","data-canvas-blocker":!0,"aria-label":"Map shortcuts",children:[d.jsxs("div",{className:"map-shortcuts-head",children:[d.jsx("span",{className:"map-shortcuts-label",children:"Shortcuts"}),d.jsx("button",{type:"button",className:"map-shortcuts-toggle",onClick:r,"aria-label":"맵 단축키 접기",title:"Collapse",children:d.jsx(_I,{})})]}),d.jsx("dl",{className:"map-shortcuts-list",children:Ky.entries.map(a=>d.jsxs("div",{className:"map-shortcuts-entry",children:[d.jsx("dt",{className:"map-shortcuts-combos",children:a.combos.map((o,v)=>d.jsxs("span",{className:"map-shortcuts-combo",children:[v>0?d.jsx("span",{className:"map-shortcuts-or",children:"or"}):null,d.jsx("span",{className:"map-shortcuts-keyset",children:o.map(m=>d.jsx("kbd",{children:m},m))})]},o.join("+")))}),d.jsx("dd",{children:a.description})]},a.description))})]})}function pI(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(xx)==="true"}catch{return!1}}function gI(e){if(!(typeof window>"u"))try{window.localStorage.setItem(xx,String(e))}catch{}}function mI(){return d.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[d.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),d.jsx("path",{d:"M6.3 6.1a1.8 1.8 0 1 1 2.5 1.7c-.5.3-.8.6-.8 1.2v.3",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),d.jsx("circle",{cx:"8",cy:"11.4",r:".8",fill:"currentColor"})]})}function _I(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M10.5 4.5 5.5 8l5 3.5M11 8H5.5",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function vI(e,n){return{x:e.x*n.zoom+n.x,y:e.y*n.zoom+n.y}}function gh(e,n){return{x:(e.x-n.x)/n.zoom,y:(e.y-n.y)/n.zoom}}function bI(e,n){return{...vI(e,n),width:e.width*n.zoom,height:e.height*n.zoom}}function yI({rect:e,viewport:n}){const r=bI(e,n);return d.jsx("div",{className:"canvas-rubber-band",style:{left:r.x,top:r.y,width:r.width,height:r.height},"aria-hidden":"true"})}function SI({id:e,theaterId:n,geometry:r,viewport:a,active:o}){const v=z.useRef(null),m=()=>{Qn(null),Qu(e),Yf(e,{...r,zIndex:mo()})},c=k=>{k.button===0&&(k.preventDefault(),k.stopPropagation(),m(),v.current={pointerId:k.pointerId,startX:k.clientX,startY:k.clientY,geometry:r},k.currentTarget.setPointerCapture(k.pointerId))},u=k=>{const E=v.current;!E||E.pointerId!==k.pointerId||(k.preventDefault(),k.stopPropagation(),Yf(e,{...E.geometry,x:E.geometry.x+(k.clientX-E.startX)/a.zoom,y:E.geometry.y+(k.clientY-E.startY)/a.zoom}))},h=k=>{v.current?.pointerId===k.pointerId&&(k.preventDefault(),k.stopPropagation(),v.current=null,k.currentTarget.releasePointerCapture(k.pointerId))},S=k=>{k.stopPropagation()},f=k=>{k.stopPropagation(),m()},C=k=>{k.stopPropagation()},x=()=>{Vb(e),yh(e).catch(k=>{Ch(k instanceof Error?k.message:String(k))})};return d.jsxs("article",{className:`canvas-panel canvas-panel--shell ${o?"is-active":""}`,style:{left:r.x,top:r.y,width:r.width,height:r.height,zIndex:r.zIndex},onPointerDown:m,"data-canvas-panel":!0,"aria-label":"Shell panel",children:[d.jsxs("div",{className:"canvas-panel-titlebar",onPointerDown:c,onPointerMove:u,onPointerUp:h,onPointerCancel:h,"data-canvas-blocker":!0,children:[d.jsx("span",{className:"tenant-beacon is-live","aria-hidden":"true"}),d.jsx("span",{className:"canvas-panel-title",children:"Shell"}),d.jsx("span",{className:"canvas-panel-cli",children:"shell"}),d.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:S,onClick:x,"aria-label":"Close shell panel",title:"Close shell",children:d.jsx(wI,{})})]}),d.jsx("div",{className:"canvas-panel-terminal",onPointerDown:f,onWheel:C,"data-canvas-blocker":!0,children:d.jsx(Lh,{sessionId:e,kind:"shell",theaterId:n,active:o,zoom:a.zoom,onExit:()=>Vb(e)})}),d.jsx(Cx,{geometry:r,zoom:a.zoom,onResize:k=>Yf(e,k)})]})}function wI(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M4.6 4.6 11.4 11.4M11.4 4.6 4.6 11.4",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})})}const CI=.25,xI=2,EI=200,TI=150,Vy=5,kI=.0018;function AI({viewport:e,disabled:n=!1,consumePointerDown:r=!1,onViewportChange:a,onZoom:o,onCreate:v,onConsumePointerDown:m,onClick:c}){const u=z.useRef(null),h=z.useRef(e),[S,f]=z.useState(null),[C,x]=z.useState(!1),[k,E]=z.useState(!1);z.useEffect(()=>{h.current=e},[e]),z.useEffect(()=>{const L=R=>{R.key==="Shift"&&E(!0),!RI(R.target)&&R.code==="Space"&&(R.preventDefault(),x(!0))},M=R=>{R.key==="Shift"&&E(!1),R.code==="Space"&&x(!1)};return window.addEventListener("keydown",L),window.addEventListener("keyup",M),()=>{window.removeEventListener("keydown",L),window.removeEventListener("keyup",M)}},[]);const g=L=>{if(n||Yy(L.target)||L.button!==0&&L.button!==1)return;if(L.preventDefault(),r){m?.();return}const M=jp(L),R=L.shiftKey&&L.button===0&&!C?"create":"pan";u.current={pointerId:L.pointerId,mode:R,startScreen:M,currentScreen:M,startViewport:h.current},L.currentTarget.setPointerCapture(L.pointerId),R==="create"&&f(Bp(M,M,h.current))},b=L=>{const M=u.current;if(!M||M.pointerId!==L.pointerId)return;L.preventDefault();const R=jp(L);if(u.current={...M,currentScreen:R},M.mode==="pan"){a({...M.startViewport,x:M.startViewport.x+R.x-M.startScreen.x,y:M.startViewport.y+R.y-M.startScreen.y});return}f(Bp(M.startScreen,R,h.current))},p=L=>{A(L,!0)},y=L=>{A(L,!1)},T=L=>{if(n||Yy(L.target))return;L.preventDefault();const M=jp(L),R=h.current,O=LI(R.zoom*Math.exp(-L.deltaY*kI),CI,xI),F=gh(M,R);o({x:M.x-F.x*O,y:M.y-F.y*O,zoom:O})},A=(L,M)=>{const R=u.current;if(!R||R.pointerId!==L.pointerId||(u.current=null,L.currentTarget.releasePointerCapture(L.pointerId),f(null),!M))return;const O=Math.abs(R.currentScreen.x-R.startScreen.x),F=Math.abs(R.currentScreen.y-R.startScreen.y);if(O<Vy&&F<Vy){c?.();return}if(R.mode!=="create")return;const U=Bp(R.startScreen,R.currentScreen,h.current),G={x:U.x,y:U.y,width:Math.max(U.width,EI),height:Math.max(U.height,TI)};v(G,R.currentScreen)};return{rubberBand:S,spaceActive:C,shiftActive:k,onPointerDown:g,onPointerMove:b,onPointerUp:p,onPointerCancel:y,onWheel:T}}function Bp(e,n,r){const a=gh(e,r),o=gh(n,r),v=Math.min(a.x,o.x),m=Math.min(a.y,o.y);return{x:v,y:m,width:Math.abs(a.x-o.x),height:Math.abs(a.y-o.y)}}function jp(e){const n=e.currentTarget.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function Yy(e){return e instanceof Element&&!!e.closest("[data-canvas-blocker], [data-canvas-panel]")}function RI(e){return e instanceof HTMLElement&&!!e.closest("input, textarea, select, [contenteditable='true']")}function LI(e,n,r){return Math.min(r,Math.max(n,e))}const MI="Shift-drag to create an Operation. Right-click for actions. Drag to pan; scroll to zoom.",DI=640,OI=400,NI=560,II=360,BI={x:0,y:0,zoom:1};function jI({state:e}){const n=z.useRef(null),r=ES(),a=xT(),o=Gg(),v=ET(),m=Zk(),c=Jk(),u=OA(e),[h,S]=z.useState(null),[f,C]=z.useState(null),[x,k]=z.useState({width:0,height:0}),E=!e.activeTheaterId||e.agentClis.length===0||e.creatingTerminalSession||e.addingTheater;z.useEffect(()=>{const O=n.current;if(!O||typeof ResizeObserver>"u")return;const F=()=>k({width:O.clientWidth,height:O.clientHeight});F();const U=new ResizeObserver(F);return U.observe(O),()=>U.disconnect()},[]),z.useEffect(()=>{e.activeTerminalSessionId!==null&&Qu(null)},[e.activeTerminalSessionId]),z.useEffect(()=>{e.activeTerminalSessionId!==null&&v.includes(e.activeTerminalSessionId)&&Qn(null)},[e.activeTerminalSessionId,v]);const g=AI({viewport:r.viewport,disabled:E,onViewportChange:zu,onZoom:kT,onCreate:(O,F)=>{C(null),S({rect:O,anchor:F})},consumePointerDown:h!==null||f!==null,onConsumePointerDown:()=>{S(null),C(null)},onClick:HI}),b=async O=>{if(!(!e.activeTheaterId||!h)){eh();try{const F=await Ju(e.activeTheaterId,O.id);Nl(F.sessionId,UI(h.rect)),th(F),Qn(F.sessionId),S(null)}catch(F){nh(F instanceof Error?F.message:String(F))}}},p=async O=>{const F=f?.canvasPoint;if(C(null),!(!e.activeTheaterId||!F)){eh();try{const U=await Ju(e.activeTheaterId,O.id);Nl(U.sessionId,Zy(F,DI,OI)),th(U),Qn(U.sessionId)}catch(U){nh(U instanceof Error?U.message:String(U))}}},y=()=>{const O=f?.canvasPoint;if(C(null),!e.activeTheaterId||!O)return;Qn(null);const F=Qk(e.activeTheaterId,{...Zy(O,NI,II),zIndex:mo()});Qu(F)},T=()=>{C(null),zu({...BI})},A=O=>{if(O.target instanceof Element&&O.target.closest("[data-canvas-blocker], [data-canvas-panel]"))return;O.preventDefault();const F=n.current?.getBoundingClientRect();if(!F)return;const U={x:O.clientX-F.left,y:O.clientY-F.top};S(null),C({anchor:U,canvasPoint:gh(U,r.viewport)})},L=new Set(v),M=Object.fromEntries(Object.entries(r.panels).filter(([O])=>!L.has(O))),R=u.length>0||Object.keys(m).length>0;return d.jsxs("main",{className:`operations-canvas ${g.spaceActive?"is-panning":""} ${g.shiftActive?"is-creating":""}`,onPointerDown:g.onPointerDown,onPointerMove:g.onPointerMove,onPointerUp:g.onPointerUp,onPointerCancel:g.onPointerCancel,onWheel:g.onWheel,onContextMenu:A,ref:n,children:[d.jsx(dI,{viewport:r.viewport,backgroundAnimationEnabled:a}),d.jsx("button",{type:"button",className:`canvas-background-toggle canvas-maximize-toggle ${o?"is-active":""}`,onClick:NT,"data-canvas-blocker":!0,"aria-label":o?"맵 최대화 해제":"맵 최대화","aria-pressed":o,title:o?"Exit fullscreen":"Maximize map",children:o?d.jsx(PI,{}):d.jsx(zI,{})}),d.jsx("button",{type:"button",className:`canvas-background-toggle ${a?"is-active":""}`,onClick:OT,"data-canvas-blocker":!0,"aria-label":a?"배경 애니메이션 끄기":"배경 애니메이션 켜기",title:a?"Background animation: on":"Background animation: off",children:d.jsx($I,{})}),d.jsxs("div",{className:"operations-canvas-world",style:{transform:`translate(${r.viewport.x}px, ${r.viewport.y}px) scale(${r.viewport.zoom})`},children:[u.map(O=>{const F=r.panels[O.sessionId];return!F||L.has(O.sessionId)?null:d.jsx(nI,{state:e,session:O,geometry:F,viewport:r.viewport,active:e.activeTerminalSessionId===O.sessionId},O.sessionId)}),Object.entries(m).map(([O,F])=>d.jsx(SI,{id:O,theaterId:F.theaterId,geometry:F.geometry,viewport:r.viewport,active:c===O},O))]}),R?null:d.jsxs("div",{className:"operations-canvas-empty","data-canvas-blocker":!0,children:[d.jsx("span",{className:"operations-canvas-empty-mark","aria-hidden":"true"}),d.jsx("p",{children:e.activeTheaterId?MI:"Add a Theater from the top bar to start operations."}),e.terminalSessionError?d.jsx("p",{className:"operations-canvas-error",children:e.terminalSessionError}):null]}),g.rubberBand?d.jsx(yI,{rect:g.rubberBand,viewport:r.viewport}):null,h?d.jsx(Mm,{state:e,mode:"menu",anchor:h.anchor,viewportBounds:Xy(n.current),onSelect:b,onClose:()=>S(null)},`${h.anchor.x}:${h.anchor.y}`):null,f?d.jsx(q8,{state:e,anchor:f.anchor,viewportBounds:Xy(n.current),onLaunchCli:O=>{p(O)},onOpenShell:y,onResetView:T,onClose:()=>C(null)},`${f.anchor.x}:${f.anchor.y}`):null,d.jsx(V8,{panels:M,shellPanels:m,viewport:r.viewport,canvasSize:x,onJump:O=>zu({x:x.width/2-O.x*r.viewport.zoom,y:x.height/2-O.y*r.viewport.zoom,zoom:r.viewport.zoom})}),R?d.jsx(fI,{}):null,d.jsx(lI,{state:e,sessions:u,minimized:v})]})}function $I(){return d.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[d.jsx("circle",{cx:"8",cy:"8",r:"5.2",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeDasharray:"2 2"}),d.jsx("circle",{cx:"8",cy:"8",r:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.72"}),d.jsx("path",{d:"M8 8 12.2 5.8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),d.jsx("circle",{cx:"8",cy:"8",r:".9",fill:"currentColor"})]})}function zI(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M3 6.4V3h3.4M13 6.4V3H9.6M3 9.6V13h3.4M13 9.6V13H9.6",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function PI(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M6.4 3v3.4H3M9.6 3v3.4H13M6.4 13V9.6H3M9.6 13V9.6H13",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function Xy(e){if(!e)return;const n=e.getBoundingClientRect();return{width:n.width,height:n.height}}function HI(){if(typeof document<"u"){const e=document.activeElement;e instanceof HTMLElement&&e.blur()}Qn(null),Qu(null)}function UI(e){return{x:e.x,y:e.y,width:e.width,height:e.height,zIndex:0}}function Zy(e,n,r){return{x:e.x,y:e.y,width:n,height:r,zIndex:0}}const FI=56;function qI(e,n){const r=z.useRef(null),a=z.useRef(!0),[o,v]=z.useState(!0),m=z.useCallback(u=>{a.current!==u&&(a.current=u,v(u))},[]);z.useEffect(()=>{const u=r.current;if(!u)return;const h=()=>{const S=u.scrollHeight-u.scrollTop-u.clientHeight;m(S<=FI)};return u.addEventListener("scroll",h,{passive:!0}),()=>u.removeEventListener("scroll",h)},[m]),z.useLayoutEffect(()=>{m(!0);const u=r.current;u&&(u.scrollTop=u.scrollHeight)},[e,m]),z.useLayoutEffect(()=>{const u=r.current;!u||!a.current||(u.scrollTop=u.scrollHeight)},[n]);const c=z.useCallback(()=>{const u=r.current;u&&(u.scrollTop=u.scrollHeight,u.focus({preventScroll:!0}),m(!0))},[m]);return{containerRef:r,pinned:o,jumpToLatest:c}}const Jy=400,WI=["text","fallbackText","fallbackThought"],GI=z.memo(function({events:n}){return d.jsxs("ol",{className:"timeline","aria-label":"Raw event timeline",children:[n.length===0?d.jsx("li",{className:"timeline-empty",children:"No events observed."}):null,n.map((r,a)=>{const o=n[n.length-1-a];return o?d.jsx(KI,{event:o},o.id):null})]})}),KI=z.memo(function({event:n}){return d.jsxs("li",{className:"timeline-row",children:[d.jsx("time",{className:"timeline-time",children:ZS(n.at)}),d.jsx("span",{className:"timeline-type",children:n.type}),d.jsx("code",{className:"timeline-payload",children:VI(n.event)})]})});function VI(e){const n={...e};delete n.type;for(const a of WI){const o=n[a];typeof o=="string"&&(n[a]=o.length>60?`${o.slice(0,60)}… (${o.length} chars)`:o)}const r=JSON.stringify(n);return r.length>Jy?`${r.slice(0,Jy)}…`:r}const YI=z.memo(function({track:n}){const r=Es(n.status),a=n.status==="stream",o=n.sentTextLength>n.text.length||n.sentThoughtLength>n.thought.length,v=n.sentTextLength+n.sentThoughtLength;return d.jsxs("article",{className:`track-card track-card--${r}`,children:[d.jsxs("header",{className:"track-head",children:[d.jsx("span",{className:`status-dot status-dot--${r}`,"aria-hidden":"true"}),d.jsx("h3",{className:"track-name",children:n.displayName}),n.displayCli?d.jsx("span",{className:"track-tag",children:n.displayCli}):null,n.model?d.jsx("span",{className:"track-tag track-tag--dim",children:n.model}):null,n.effort?d.jsx("span",{className:"track-tag track-tag--dim",children:n.effort}):null,d.jsx("span",{className:`track-status track-status--${r}`,children:Pk(n.status)})]}),n.subtitle?d.jsx("p",{className:"track-subtitle",children:n.subtitle}):null,n.requestPreview?d.jsx(XI,{preview:n.requestPreview}):null,n.thought?d.jsx(ZI,{thought:n.thought,streaming:a&&!n.text}):null,d.jsx(JI,{track:n}),n.text?d.jsx("div",{className:"track-output","data-streaming":a||void 0,children:d.jsxs("pre",{className:"track-text",children:[n.text,a?d.jsx("span",{className:"stream-caret","aria-hidden":"true"}):null]})}):a||n.status==="conn"||n.status==="queued"?d.jsxs("p",{className:"track-waiting",children:[d.jsx("span",{className:"stream-caret","aria-hidden":"true"})," awaiting output"]}):null,o?d.jsxs("p",{className:"track-notice",children:["Output partially retained — ",v.toLocaleString()," chars emitted in total."]}):null,n.error?d.jsx("p",{className:"track-error",children:n.error}):null]})});function XI({preview:e}){return d.jsxs("p",{className:"track-request",title:e,children:[d.jsx("span",{className:"track-request-mark","aria-hidden":"true",children:"▸"}),e]})}function ZI({thought:e,streaming:n}){const[r,a]=z.useState(!1);return d.jsxs("div",{className:`thought-fold ${r?"is-open":""}`,children:[d.jsxs("button",{type:"button",className:"thought-toggle",onClick:()=>a(o=>!o),"aria-expanded":r,children:[d.jsx("span",{className:"thought-chevron","aria-hidden":"true",children:r?"▾":"▸"}),"reasoning",n?d.jsx("span",{className:"stream-caret stream-caret--dim","aria-hidden":"true"}):null]}),r?d.jsx("pre",{className:"thought-text",children:e}):null]})}function JI({track:e}){return e.tools.length===0?null:d.jsx("ul",{className:"tool-rail","aria-label":"Tool calls",children:e.tools.map(n=>d.jsxs("li",{className:`tool-chip tool-chip--${QI(n.status)}`,children:[d.jsx("span",{className:"tool-chip-glyph","aria-hidden":"true",children:"⚙"}),d.jsx("span",{className:"tool-chip-title",children:n.title}),n.status?d.jsx("span",{className:"tool-chip-status",children:n.status}):null]},n.key))})}function QI(e){const n=e.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 e7({job:e,timelineOpen:n}){const{containerRef:r,pinned:a,jumpToLatest:o}=qI(e?.jobId??"none",e?.lastEventId??0);return e?d.jsxs("main",{className:"stage",children:[d.jsx(t7,{job:e}),d.jsxs("div",{className:"stage-stream",children:[d.jsx("div",{className:"stage-scroll",ref:r,tabIndex:-1,children:d.jsxs("div",{className:"stage-content",children:[e.trackOrder.length===0?d.jsxs("p",{className:"stage-waiting",children:[d.jsx("span",{className:"stream-caret","aria-hidden":"true"})," waiting for track registration"]}):e.trackOrder.map(v=>{const m=e.tracks[v];return m?d.jsx(YI,{track:m},`${e.jobId}:${v}`):null}),e.summary?d.jsx(n7,{summary:e.summary,status:e.status,error:e.error}):null]})}),a?null:d.jsx("button",{type:"button",className:"follow-button",onClick:o,children:"↓ Follow stream"})]}),d.jsxs("section",{className:`timeline-dock ${n?"is-open":""}`,children:[d.jsxs("button",{type:"button",className:"timeline-toggle",onClick:xA,"aria-expanded":n,children:[d.jsx("span",{className:"timeline-chevron","aria-hidden":"true",children:n?"▾":"▴"}),"Event timeline",d.jsx("span",{className:"timeline-count",children:e.recentEvents.length})]}),n?d.jsx(GI,{events:e.recentEvents}):null]})]}):d.jsx("main",{className:"stage",children:d.jsxs("div",{className:"stage-idle",children:[d.jsx("p",{className:"stage-idle-mark","aria-hidden":"true",children:"▵"}),d.jsx("h2",{children:"Standing by"}),d.jsx("p",{children:"Select a job from the left rail, or dispatch carriers from a Fleet session."})]})})}const t7=z.memo(function({job:n}){const r=Es(n.status),a=n.startedAt?zk(n.startedAt,n.finishedAt??n.updatedAt):null;return d.jsxs("header",{className:"job-head",children:[d.jsxs("div",{className:"job-head-id",children:[d.jsx("span",{className:`status-dot status-dot--${r} status-dot--lg`,"aria-hidden":"true"}),d.jsxs("div",{children:[d.jsx("h2",{className:"job-title",children:n.label??Fl(n.jobId)}),d.jsxs("p",{className:"job-meta",children:[d.jsx("span",{className:`job-status job-status--${r}`,children:na(n.status)}),n.ownerCarrierId?d.jsxs("span",{children:["· ",n.ownerCarrierId]}):null,n.kind?d.jsxs("span",{children:["· ",n.kind]}):null,a?d.jsxs("span",{children:["· ",a]}):null,n.startedAt?d.jsxs("span",{children:["· started ",ZS(n.startedAt)]}):null]})]})]}),d.jsx("code",{className:"job-id",title:n.jobId,children:Fl(n.jobId)})]})});function n7({summary:e,status:n,error:r}){return d.jsxs("aside",{className:`job-summary job-summary--${Es(n)}`,children:[d.jsx("p",{className:"job-summary-eyebrow",children:n==="error"?"Finalized with error":"Finalized"}),d.jsx("p",{className:"job-summary-text",children:e}),r?d.jsx("p",{className:"job-summary-error",children:r}):null]})}function Ex({state:e}){const n=MA(e);return z.useEffect(()=>{const r=a=>{a.key==="Escape"&&np()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),n?d.jsxs("div",{className:"job-overlay",role:"dialog","aria-modal":"true","aria-label":"Carrier job stream",children:[d.jsx("button",{type:"button",className:"job-overlay-scrim",onClick:np,"aria-label":"Close job stream"}),d.jsxs("div",{className:"job-overlay-card",children:[d.jsx("button",{type:"button",className:"job-overlay-close",onClick:np,"aria-label":"Close job stream",children:"×"}),d.jsx(e7,{job:n,timelineOpen:e.timelineOpen})]})]}):null}function i7({state:e}){return d.jsx("div",{className:"floating-job-overlay","data-canvas-blocker":!0,children:d.jsx(Ex,{state:e})})}const Tx="fleet-console.map.operationsCollapsed";function r7({state:e,getViewportSize:n}){const r=Gg(),[a,o]=z.useState(()=>r||Qy()),v=sa(e),m=z.useRef(r);z.useEffect(()=>{m.current!==r&&(m.current=r,o(r?!0:Qy()))},[r]);const c=S=>{o(S),l7(S)},u=async S=>{const f=e.sessions[S];let C=S;if(f?.status==="dormant")try{const k=await Sh(S);Cs(k),C=k.sessionId}catch(k){xh(k instanceof Error?k.message:String(k));return}Qn(C),TS(C);const x=n();x&&kS(C,x)},h=async S=>{if(!(e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId)){eh();try{const f=await Ju(e.activeTheaterId,S.id);th(f),u(f.sessionId)}catch(f){nh(f instanceof Error?f.message:String(f))}}};return a?d.jsx("aside",{className:"floating-sidebar-layer is-collapsed","data-canvas-blocker":!0,children:d.jsx("button",{type:"button",className:"floating-sidebar-collapsed-toggle",onClick:()=>c(!1),"aria-expanded":!1,"aria-label":"Operations 목록 펼치기",title:"Show Operations",children:d.jsx(u7,{})})}):d.jsx("aside",{className:"floating-sidebar-layer","data-canvas-blocker":!0,children:d.jsxs("section",{className:"floating-sidebar","aria-label":"Floating operations list",children:[d.jsxs("div",{className:"floating-sidebar-heading",children:[d.jsx("p",{className:"sidebar-eyebrow",children:"Operations"}),d.jsxs("div",{className:"floating-sidebar-actions",children:[d.jsx(Mm,{state:e,onSelect:h}),d.jsx("button",{type:"button",className:"floating-sidebar-toggle",onClick:()=>c(!0),"aria-expanded":!0,"aria-label":"Operations 목록 접기",children:d.jsx(c7,{})})]})]}),v.length>0?d.jsx("ol",{className:"floating-session-list",children:v.map(S=>{const f=e.sessions[S];return f?d.jsx(s7,{session:f,active:e.activeTerminalSessionId===S,jobs:Jl(e,f),selectedJobId:e.selectedJobId,onFocus:u},S):null})}):null,e.terminalSessionError?d.jsx("p",{className:"sidebar-error",children:e.terminalSessionError}):null,v.length===0?d.jsxs("p",{className:"sidebar-empty",children:[e.activeTheaterId?"No operations in this Theater.":"No Theaters registered.",d.jsx("br",{}),e.activeTheaterId?"Drag on the canvas or use +.":"Add a Theater from the top bar."]}):null]})})}const s7=z.memo(function({session:n,active:r,jobs:a,selectedJobId:o,onFocus:v}){const[m,c]=z.useState(!1),[u,h]=z.useState(""),S=z.useRef(null),f=z.useRef(!1),C=z.useRef(!1),x=a.filter(({job:A})=>!Li(A.status)).length,k=n.status==="dormant",E=xs(n),g=[...a].sort((A,L)=>Number(Li(A.job.status))-Number(Li(L.job.status)));z.useEffect(()=>{m&&(S.current?.focus(),S.current?.select())},[m]);const b=()=>{C.current=!1,h(E),c(!0)},p=()=>{C.current=!0,c(!1),h("")},y=async()=>{if(!f.current){f.current=!0;try{Cs(await Zg(n.sessionId,u))}catch(A){nm(A instanceof Error?A.message:String(A))}finally{f.current=!1,C.current=!0,c(!1)}}},T=A=>{if(A.key==="Enter"){A.preventDefault(),y();return}A.key==="Escape"&&(A.preventDefault(),p())};return d.jsxs("li",{className:`session-item ${r?"is-active":""}`,children:[d.jsxs("div",{className:"session-row-shell",children:[m?d.jsxs("div",{className:`session-row session-row-edit ${r?"is-active":""}`,children:[d.jsx("span",{className:uo(n,x),"aria-hidden":"true"}),d.jsx("input",{ref:S,className:"session-rename-input",value:u,"aria-label":`${E} 이름 변경`,onChange:A=>h(A.target.value),onKeyDown:T,onBlur:()=>{if(C.current){C.current=!1;return}y()}})]}):d.jsxs("button",{type:"button",className:`session-row ${r?"is-active":""}`,onClick:()=>{v(n.sessionId)},onDoubleClick:b,"aria-current":r||void 0,"aria-label":`Operation ${E}`,children:[d.jsx("span",{className:uo(n,x),"aria-hidden":"true"}),d.jsxs("span",{className:"tenant-row-text",children:[d.jsx("span",{className:"tenant-label",children:E}),k?d.jsx("span",{className:"job-row-meta",children:"Dormant"}):null]}),k?d.jsx("span",{className:"tenant-count",children:"Open"}):!r&&a.length>0?d.jsx("span",{className:"tenant-count",children:a.length}):null]}),d.jsx("button",{type:"button",className:"session-close",onClick:()=>{o7(n.sessionId)},"aria-label":`${k?"Forget":"Terminate"} operation ${E}`,title:k?"Forget operation":"Terminate operation",children:d.jsx(h7,{})})]}),r?d.jsx("ol",{className:"session-job-list",children:g.length>0?g.map(({job:A})=>d.jsx(a7,{job:A,active:A.jobId===o},A.jobId)):d.jsx("li",{className:"job-list-empty",children:"No carrier jobs in this session."})}):null]})}),a7=z.memo(function({job:n,active:r}){const a=Es(n.status);return d.jsx("li",{children:d.jsxs("button",{type:"button",className:`job-row ${r?"is-active":""}`,onClick:()=>Eh(n.jobId),"aria-current":r||void 0,children:[d.jsx("span",{className:`status-dot status-dot--${a}`,"aria-hidden":"true"}),d.jsxs("span",{className:"job-row-text",children:[d.jsx("span",{className:"job-row-label",children:n.label??Fl(n.jobId)}),d.jsx("span",{className:"job-row-meta",children:n.ownerCarrierId?`${Jg(n.ownerCarrierId)} · ${na(n.status)}`:na(n.status)})]})]})})});async function o7(e){try{await yh(e)}catch(n){Ch(n instanceof Error?n.message:String(n));return}Zl(e)}function Qy(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Tx)==="true"}catch{return!1}}function l7(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Tx,String(e))}catch{}}function c7(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M4 5h8M4 8h5.5M4 11h8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})})}function u7(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M5 4.6 9 8l-4 3.4M10.5 4.6 14 8l-3.5 3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function h7(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.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 d7({creating:e,error:n,hasTheaters:r,activeTheaterId:a}){const o=r?a?"No operations in this Theater":"Choose a Theater":"Add a Theater",v=r?a?"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 d.jsxs("section",{className:"operations-landing","aria-label":"Operations workspace landing",children:[d.jsx("div",{className:"operations-landing-mark","aria-hidden":"true"}),d.jsxs("div",{children:[d.jsx("p",{className:"operations-landing-eyebrow",children:"Operation"}),d.jsx("h1",{children:o}),d.jsx("p",{children:v})]}),d.jsx("p",{className:`operations-landing-status ${e?"is-live":""}`,children:e?"Launching operation":"No terminal session selected"}),n?d.jsx("p",{className:"operations-landing-error",children:n}):null]})}function f7({state:e}){const n=sa(e);return d.jsxs("nav",{className:"operations-sidebar","aria-label":"Operation sessions and carrier jobs",children:[d.jsxs("div",{className:"sidebar-heading",children:[d.jsx("p",{className:"sidebar-eyebrow",children:"Operations"}),d.jsx(Mm,{state:e,onSelect:r=>_7(e,r)})]}),n.length>0?d.jsx("ol",{className:"session-list",children:n.map(r=>{const a=e.sessions[r];return a?d.jsx(p7,{session:a,active:e.activeTerminalSessionId===r,jobs:Jl(e,a),selectedJobId:e.selectedJobId},r):null})}):null,e.terminalSessionError?d.jsx("p",{className:"sidebar-error",children:e.terminalSessionError}):null,n.length===0?d.jsxs("p",{className:"sidebar-empty",children:[e.activeTheaterId?"No operations in this Theater.":"No Theaters registered.",d.jsx("br",{}),e.activeTheaterId?"Use + to launch one here.":"Add a Theater from the top bar."]}):null]})}const p7=z.memo(function({session:n,active:r,jobs:a,selectedJobId:o}){const[v,m]=z.useState(!1),[c,u]=z.useState(""),h=z.useRef(null),S=z.useRef(!1),f=z.useRef(!1),C=a.filter(({job:A})=>!Li(A.status)).length,x=n.status==="dormant",k=xs(n),E=[...a].sort((A,L)=>Number(Li(A.job.status))-Number(Li(L.job.status)));z.useEffect(()=>{v&&(h.current?.focus(),h.current?.select())},[v]);const g=()=>{f.current=!1,u(k),m(!0)},b=()=>{f.current=!0,m(!1),u("")},p=async()=>{if(!S.current){S.current=!0;try{Cs(await Zg(n.sessionId,c))}catch(A){nm(A instanceof Error?A.message:String(A))}finally{S.current=!1,f.current=!0,m(!1)}}},y=A=>{if(A.key==="Enter"){A.preventDefault(),p();return}A.key==="Escape"&&(A.preventDefault(),b())},T=async()=>{if(!x){Qn(n.sessionId);return}try{const A=await Sh(n.sessionId);Cs(A),Qn(A.sessionId)}catch(A){xh(A instanceof Error?A.message:String(A))}};return d.jsxs("li",{className:`session-item ${r?"is-active":""}`,children:[d.jsxs("div",{className:"session-row-shell",children:[v?d.jsxs("div",{className:`session-row session-row-edit ${r?"is-active":""}`,children:[d.jsx("span",{className:uo(n,C),"aria-hidden":"true"}),d.jsx("input",{ref:h,className:"session-rename-input",value:c,"aria-label":`${k} 이름 변경`,onChange:A=>u(A.target.value),onKeyDown:y,onBlur:()=>{if(f.current){f.current=!1;return}p()}})]}):d.jsxs("button",{type:"button",className:`session-row ${r?"is-active":""}`,onClick:()=>{T()},onDoubleClick:g,"aria-current":r||void 0,"aria-label":`Operation ${k}`,children:[d.jsx("span",{className:uo(n,C),"aria-hidden":"true"}),d.jsxs("span",{className:"tenant-row-text",children:[d.jsx("span",{className:"tenant-label",children:k}),x?d.jsx("span",{className:"job-row-meta",children:"Dormant"}):null]}),x?d.jsx("span",{className:"tenant-count",children:"Open"}):!r&&a.length>0?d.jsx("span",{className:"tenant-count",children:a.length}):null]}),d.jsx("button",{type:"button",className:"session-close",onClick:()=>{m7(n.sessionId)},"aria-label":`Terminate operation ${k}`,title:"Terminate operation",children:d.jsx(v7,{})})]}),r?d.jsx("ol",{className:"session-job-list",children:E.length>0?E.map(({job:A})=>d.jsx(g7,{job:A,active:A.jobId===o},A.jobId)):d.jsx("li",{className:"job-list-empty",children:"No carrier jobs in this session."})}):null]})}),g7=z.memo(function({job:n,active:r}){const a=Es(n.status);return d.jsx("li",{children:d.jsxs("button",{type:"button",className:`job-row ${r?"is-active":""}`,onClick:()=>Eh(n.jobId),"aria-current":r||void 0,children:[d.jsx("span",{className:`status-dot status-dot--${a}`,"aria-hidden":"true"}),d.jsxs("span",{className:"job-row-text",children:[d.jsx("span",{className:"job-row-label",children:n.label??Fl(n.jobId)}),d.jsx("span",{className:"job-row-meta",children:n.ownerCarrierId?`${Jg(n.ownerCarrierId)} · ${na(n.status)}`:na(n.status)})]})]})})});async function m7(e){try{await yh(e)}catch(n){Ch(n instanceof Error?n.message:String(n));return}Zl(e)}async function _7(e,n){if(!(e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId)){eh();try{th(await Ju(e.activeTheaterId,n.id))}catch(r){nh(r instanceof Error?r.message:String(r))}}}function v7(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.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 b7({state:e,sessionId:n,expanded:r}){const a=e.sessions[n],o=a?Jl(e,a).filter(({job:v})=>!Li(v.status)).map(({job:v})=>v):[];return d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:`terminal-zoom-toggle ${r?"is-expanded":""}`,onClick:()=>kA(n),"aria-label":r?"터미널 축소":"터미널 확대",title:r?"터미널 축소":"터미널 확대",children:r?d.jsx(S7,{}):d.jsx(y7,{})}),o.length>0?d.jsx("div",{className:"terminal-job-dock","aria-label":"Active carrier jobs in terminal",children:d.jsx(wx,{jobs:o,selectedJobId:e.selectedJobId})}):null]})}function y7(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.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 S7(){return d.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:d.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 w7({state:e}){const n=e.activeTerminalSessionId&&sa(e).includes(e.activeTerminalSessionId)?e.activeTerminalSessionId:null,r=n?IA(e,n):!1,a=n?e.operationNotifications[n]?.kind==="input-waiting":!1;return d.jsxs("div",{className:`console-body is-classic ${r?"is-expanded":""}`,children:[r?null:d.jsx(f7,{state:e}),d.jsx("main",{className:`operations-terminal-stage ${a?"is-input-waiting":""}`,children:n?d.jsxs(d.Fragment,{children:[d.jsx(Lh,{sessionId:n,onExit:()=>Zl(n)},n),d.jsx(b7,{state:e,sessionId:n,expanded:r}),d.jsx(Ex,{state:e})]}):d.jsx(d7,{creating:e.creatingTerminalSession,error:e.terminalSessionError,hasTheaters:e.theaters.length>0,activeTheaterId:e.activeTheaterId})})]})}function C7({state:e}){const n=z.useRef(null),r=bh(),a=z.useMemo(()=>sa(e),[e.sessions,e.sessionOrder,e.activeTheaterId]),o=z.useRef(e);return o.current=e,z.useEffect(()=>{DT(e.activeTheaterId),eA(e.activeTheaterId)},[e.activeTheaterId]),z.useEffect(()=>{const v=m=>{if(!m.altKey||m.metaKey||m.ctrlKey||m.key!=="ArrowLeft"&&m.key!=="ArrowRight")return;const c=document.activeElement;if(c instanceof HTMLElement&&c.matches("input, textarea, [contenteditable='true']")&&!c.closest(".xterm"))return;const u=sa(o.current);if(u.length===0)return;m.preventDefault(),m.stopImmediatePropagation();const h=vA(u,o.current.activeTerminalSessionId,m.key==="ArrowRight"?1:-1);h&&tm(h)};return window.addEventListener("keydown",v,!0),()=>window.removeEventListener("keydown",v,!0)},[]),z.useEffect(()=>{for(const v of a)TS(v);e.terminalSessionsHydrated&&MT(a)},[a,e.terminalSessionsHydrated]),z.useEffect(()=>{const v=e.pendingOperationFocus;if(v===null)return;if(r==="classic"){Qf();return}let m=!1;return(async()=>{let u=v;if(e.sessions[v]?.status==="dormant")try{const f=await Sh(v);if(m)return;Cs(f),Qn(f.sessionId),u=f.sessionId}catch(f){m||xh(f instanceof Error?f.message:String(f)),Qf();return}if(m)return;const S=eS(n.current);S&&kS(u,S),Qf()})(),()=>{m=!0}},[e.pendingOperationFocus,r]),r==="classic"?d.jsx(w7,{state:e}):d.jsxs("div",{className:"console-body is-canvas",ref:n,children:[d.jsx(jI,{state:e}),d.jsx(r7,{state:e,getViewportSize:()=>eS(n.current)}),d.jsx(i7,{state:e})]})}function eS(e){if(!e)return null;const n=e.getBoundingClientRect();return{width:n.width,height:n.height}}function x7(e){return{activeTheater:k7(e),readiness:T7(e,e.activeTheaterId),theaters:E7(e),connection:e.connection,connectionError:e.connectionError}}function E7(e){return e.theaters.map(n=>{const r=Dm(e,n.id),a=Om(e,n.id),o=Nm(e,a);return{id:n.id,label:n.label,hasWiki:n.hasWiki,activeAdmiralCount:n.activeAdmiralCount,terminalSessionCount:r.length,liveJobCount:o.filter(v=>Es(v.status)==="live").length,lastActivityAt:kx([Date.parse(n.lastOpenedAt),...r.map(v=>v.createdAt),...a.map(v=>v.createdAt),...o.map(v=>v.updatedAt)]),active:n.id===e.activeTheaterId}})}function T7(e,n){const r=n?Dm(e,n):[],a=n?Om(e,n):[],o=Nm(e,a),v=o.filter(h=>Es(h.status)==="live").length,m=o.filter(h=>Li(h.status)&&h.status==="done").length,c=o.filter(h=>Li(h.status)&&(h.status==="error"||h.status==="aborted")).length,u=e.activeTerminalSessionId?e.sessions[e.activeTerminalSessionId]:void 0;return{activeSessionLabel:u&&n&&u.theaterId===n?xs(u):"No active session",terminalSessionCount:r.length,liveJobCount:v,completedJobCount:m,failedJobCount:c,emptyState:A7(e,r,o)}}function k7(e){const n=e.theaters.find(v=>v.id===e.activeTheaterId);if(!n)return null;const r=Dm(e,n.id),a=Om(e,n.id),o=Nm(e,a);return{id:n.id,label:n.label,hasWiki:n.hasWiki,activeAdmiralCount:n.activeAdmiralCount,terminalSessionCount:r.length,registeredTenantCount:a.filter(v=>v.status!=="closed").length,lastActivityAt:kx([Date.parse(n.lastOpenedAt),...r.map(v=>v.createdAt),...a.map(v=>v.createdAt),...o.map(v=>v.updatedAt)])}}function Dm(e,n){return e.sessionOrder.map(r=>e.sessions[r]).filter(r=>r!==void 0&&r.theaterId===n)}function Om(e,n){return e.tenants.filter(r=>r.theaterId===n)}function Nm(e,n){const r=[];for(const a of n){const o=e.tenantJobs[a.tenantId];if(o)for(const v of o.jobOrder){const m=o.jobs[v];m&&r.push(m)}}return r}function A7(e,n,r){return e.theaters.length===0?"no-theaters":n.length===0?"no-sessions":r.length===0?"no-jobs":null}function kx(e){const n=e.filter(r=>Number.isFinite(r));return n.length===0?null:Math.max(...n)}async function R7(e,n){const[r,a,o,v]=await Promise.all([Du(e,"/index",n),Du(e,"/queue?status=all",n),Du(e,"/conflicts",n),Du(e,"/log?limit=3",n)]);return{entryCount:Array.isArray(r)?r.length:0,pendingQueueCount:typeof a.pendingCount=="number"?a.pendingCount:0,archivedQueueCount:typeof a.archivedCount=="number"?a.archivedCount:0,openConflictCount:Array.isArray(o)?o.length:0,logEntryCount:typeof v.totalEntries=="number"?v.totalEntries:Array.isArray(v.entries)?v.entries.length:0,latestLogStatus:Array.isArray(v.entries)&&v.entries.length>0?"available":"empty"}}async function Du(e,n,r){const a=n.startsWith("/")?n:`/${n}`,o=await fetch(`/console/codex/w/${encodeURIComponent(e)}/api${a}`,{signal:r});if(!o.ok)throw new Ge(o.status,o.statusText||`HTTP ${o.status}`);return o.json()}const Ou={loading:!1,value:null,error:null},L7=15e3;function M7({state:e}){const n=x7(e),r=n.activeTheater,[a,o]=z.useState(Ou),[v,m]=z.useState(Ou),[c,u]=z.useState(Ou);return z.useEffect(()=>{if(!r?.hasWiki){o(Ou);return}const h=new AbortController;return o({loading:!0,value:null,error:null}),R7(r.id,h.signal).then(S=>o({loading:!1,value:S,error:null})).catch(S=>{h.signal.aborted||o({loading:!1,value:null,error:S instanceof Error?S.message:String(S)})}),()=>h.abort()},[r?.hasWiki,r?.id]),z.useEffect(()=>{const h=new AbortController;return m(S=>({loading:!0,value:S.value,error:null})),FS(r?.id??null,h.signal).then(S=>m({loading:!1,value:S,error:null})).catch(S=>{h.signal.aborted||m({loading:!1,value:null,error:S instanceof Error?S.message:String(S)})}),()=>h.abort()},[r?.id]),z.useEffect(()=>{const h=new AbortController,S=()=>{u(C=>({loading:!0,value:C.value,error:null})),vk(h.signal).then(C=>u({loading:!1,value:C,error:null})).catch(C=>{h.signal.aborted||u(x=>({loading:!1,value:x.value,error:C instanceof Error?C.message:String(C)}))})};S();const f=window.setInterval(S,L7);return()=>{window.clearInterval(f),h.abort()}},[]),d.jsxs("main",{className:"welcome-page",children:[d.jsxs("header",{className:"welcome-header",children:[d.jsxs("div",{children:[d.jsx("p",{className:"bridge-kicker",children:"Bridge Readiness"}),d.jsx("h2",{children:"Welcome"})]}),d.jsx("button",{type:"button",className:"welcome-guide-button",onClick:e1,children:"Commissioning guide"})]}),d.jsxs("section",{className:"bridge-matrix","aria-labelledby":"bridge-matrix-title",children:[d.jsxs("div",{className:"bridge-section-heading",children:[d.jsx("p",{className:"bridge-kicker",children:"Theater Capability Matrix"}),d.jsx("h3",{id:"bridge-matrix-title",children:"Registered Theaters"})]}),n.theaters.length>0?d.jsxs("div",{className:"bridge-matrix-table",role:"table","aria-label":"Theater capability matrix",children:[d.jsxs("div",{className:"bridge-matrix-row bridge-matrix-head",role:"row",children:[d.jsx("span",{role:"columnheader",children:"Theater"}),d.jsx("span",{role:"columnheader",children:"Codex"}),d.jsx("span",{role:"columnheader",children:"Active"}),d.jsx("span",{role:"columnheader",children:"Terminals"}),d.jsx("span",{role:"columnheader",children:"Updated"})]}),n.theaters.map(h=>d.jsx(I7,{theater:h},h.id))]}):d.jsxs("div",{className:"bridge-matrix-empty bridge-matrix-empty--first-run",children:[d.jsx("p",{children:"No Theaters registered. Set up a project directory first, then open an Operation from that Theater."}),d.jsx("button",{type:"button",className:"bridge-matrix-empty-action",onClick:e1,children:"Set up your fleet"})]})]}),d.jsxs("section",{className:"bridge-carriers","aria-labelledby":"bridge-carriers-title",children:[d.jsxs("div",{className:"bridge-section-heading",children:[d.jsx("p",{className:"bridge-kicker",children:"Carrier Readiness Matrix"}),d.jsx("h3",{id:"bridge-carriers-title",children:"Carrier roster"})]}),d.jsx(N7,{carriers:c})]}),d.jsxs("section",{className:"bridge-knowledge","aria-labelledby":"bridge-knowledge-title",children:[d.jsxs("div",{className:"bridge-section-heading",children:[d.jsx("p",{className:"bridge-kicker",children:"Knowledge Readiness Panel"}),d.jsx("h3",{id:"bridge-knowledge-title",children:"Codex readiness"})]}),d.jsx(D7,{activeTheater:r,knowledge:a})]}),d.jsxs("section",{className:"bridge-health","aria-labelledby":"bridge-health-title",children:[d.jsxs("div",{className:"bridge-section-heading",children:[d.jsx("p",{className:"bridge-kicker",children:"System Information"}),d.jsx("h3",{id:"bridge-health-title",children:"Runtime status"})]}),d.jsx(O7,{health:v})]})]})}function D7({activeTheater:e,knowledge:n}){if(!e)return d.jsx("div",{className:"bridge-empty",children:d.jsx("p",{children:"Add a Theater to inspect Codex readiness."})});if(!e.hasWiki)return d.jsx("div",{className:"bridge-empty",children:d.jsx("p",{children:"Codex unavailable for this Theater."})});if(n.error)return d.jsx("div",{className:"bridge-empty bridge-empty--warn",children:d.jsx("p",{children:"Codex summary degraded."})});const r=n.value,a=[{label:"Entries",value:r?String(r.entryCount):"…",caption:"Indexed knowledge entries"},{label:"Pending",value:r?String(r.pendingQueueCount):"…",caption:"Drydock queue"},{label:"Archived",value:r?String(r.archivedQueueCount):"…",caption:"Archived decisions"},{label:"Conflicts",value:r?String(r.openConflictCount):"…",caption:"Open conflict files",tone:r&&r.openConflictCount>0?"warn":void 0},{label:"Log",value:r?r.latestLogStatus:n.loading?"loading":"empty",caption:r?`${r.logEntryCount} total entries`:"Latest log tail",tone:r?.latestLogStatus==="available"?"good":void 0}];return d.jsx("div",{className:"bridge-knowledge-grid",children:a.map(o=>d.jsx(Ax,{metric:o},o.label))})}function O7({health:e}){const n=e.value,r=[{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}`:e.loading?"loading":"unknown",caption:"Workspaces / jobs"}];return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"bridge-health-strip",children:r.map(a=>d.jsx(Ax,{metric:a},a.label))}),e.error?d.jsx("p",{className:"bridge-health-error",children:"System health unavailable."}):null]})}function N7({carriers:e}){if(e.error)return d.jsx("div",{className:"bridge-empty bridge-empty--warn",children:d.jsx("p",{children:"Carrier readiness degraded."})});const n=e.value??[];return n.length===0?d.jsx("div",{className:"bridge-empty",children:d.jsx("p",{children:e.loading?"Loading carrier readiness.":"No carrier readiness entries available."})}):d.jsxs("div",{className:"bridge-carrier-table",role:"table","aria-label":"Carrier readiness matrix",children:[d.jsxs("div",{className:"bridge-carrier-row bridge-carrier-head",role:"row",children:[d.jsx("span",{role:"columnheader",children:"Carrier"}),d.jsx("span",{role:"columnheader",children:"Role"}),d.jsx("span",{role:"columnheader",children:"Model"}),d.jsx("span",{role:"columnheader",children:"Effort"}),d.jsx("span",{role:"columnheader",children:"Task Force"}),d.jsx("span",{role:"columnheader",children:"Mode"})]}),n.map(r=>d.jsxs("div",{className:"bridge-carrier-row",role:"row",children:[d.jsxs("span",{role:"cell",className:"bridge-carrier-name","data-signature":j7(r),children:[d.jsx("strong",{children:r.displayName}),d.jsx("small",{children:r.category??"unknown"})]}),d.jsx("span",{role:"cell",children:r.role??r.category??"unknown"}),d.jsx("span",{role:"cell",children:r.model||"unknown"}),d.jsx("span",{role:"cell",children:r.effort??"default"}),d.jsx("span",{role:"cell",children:r.taskForceBackendCount}),d.jsx("span",{role:"cell",children:r.subagentMode?"subagent":r.cliType||"cli"})]},r.carrierId))]})}function Ax({metric:e}){return d.jsxs("article",{className:`bridge-card ${e.tone?`bridge-card--${e.tone}`:""}`,children:[d.jsx("p",{className:"bridge-card-label",children:e.label}),d.jsx("strong",{children:e.value}),d.jsx("p",{children:e.caption})]})}function I7({theater:e}){return d.jsxs("div",{className:`bridge-matrix-row ${e.active?"is-active":""}`,role:"row",children:[d.jsxs("span",{role:"cell",children:[d.jsx("span",{className:`bridge-theater-live ${e.liveJobCount>0?"is-live":""}`,"aria-hidden":"true"}),e.label]}),d.jsx("span",{role:"cell",children:e.hasWiki?"available":"unavailable"}),d.jsx("span",{role:"cell",children:e.activeAdmiralCount}),d.jsx("span",{role:"cell",children:e.terminalSessionCount}),d.jsx("span",{role:"cell",children:B7(e.lastActivityAt)})]})}function B7(e){return e?new Date(e).toLocaleString([],{month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"none"}function j7(e){return!e.subagentMode&&e.taskForceBackendCount>=2?"taskforce":e.cliType}const $7=6e3;function z7(){const e=Ql(),n=Di(),r=n.pathname,a=Yl(),o=Gg(),v=bh(),m=ck(),c=uk(),u=$S(),h=r.startsWith("/codex"),S=z.useRef(n),f=z.useRef(!h),C=o&&r.startsWith("/operations")&&v==="canvas",x=h&&m!=="route"&&(f.current||c),k=x?m:"route",E=h&&k==="side",g=f.current?S.current:{pathname:"/",search:"",hash:"",state:null,key:"codex-fallback"},b=x?g:n,p=b.pathname.startsWith("/operations");z.useEffect(()=>bM(),[]),z.useEffect(()=>{h||(S.current=n,f.current=!0)},[h,n]),z.useEffect(()=>{cA(p)},[p]),z.useEffect(()=>{const{body:A}=document;return E?(A.dataset.codexSide="true",A.style.setProperty("--codex-side-width",`${u}px`)):(delete A.dataset.codexSide,A.style.removeProperty("--codex-side-width")),()=>{delete A.dataset.codexSide,A.style.removeProperty("--codex-side-width")}},[E,u]),z.useEffect(()=>{const A=document.querySelector(".topbar");if(!A)return;const L=()=>{document.documentElement.style.setProperty("--console-topbar-offset",`${Math.round(A.getBoundingClientRect().bottom)}px`)};L();const M=new ResizeObserver(L);return M.observe(A),window.addEventListener("resize",L),()=>{M.disconnect(),window.removeEventListener("resize",L)}},[]),z.useEffect(()=>{const A=new AbortController;US(A.signal).then(R=>{uw(R),t1()}).catch(R=>{A.signal.aborted||(ze({theaterError:R instanceof Error?R.message:String(R)}),t1())}),Sk(A.signal).then(gA).catch(R=>{A.signal.aborted||ze({terminalSessionError:R instanceof Error?R.message:String(R)})});const L=()=>{FS(e.activeTheaterId,A.signal).then(pA).catch(()=>{})};L();const M=window.setTimeout(L,$7);return()=>{window.clearTimeout(M),A.abort()}},[]),z.useEffect(()=>{const A=L=>{window.location.pathname.includes("/codex")||(L.metaKey||L.ctrlKey)&&L.key.toLowerCase()==="k"&&(L.preventDefault(),L.stopImmediatePropagation(),bA())};return window.addEventListener("keydown",A,!0),()=>window.removeEventListener("keydown",A,!0)},[]),z.useEffect(()=>{const A=L=>{(L.metaKey||L.ctrlKey)&&L.key==="`"&&(L.preventDefault(),fw())};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[]);const y=()=>{const A=S.current;f.current?a({pathname:A.pathname,search:A.search,hash:A.hash},{state:A.state}):a("/")},T=()=>{a("/codex"),jS("side")};return d.jsxs("div",{className:`console-shell ${C?"is-maximized":""}`,children:[d.jsx(PL,{state:e,codexMode:k}),d.jsxs(z5,{location:b,children:[d.jsx(Ys,{path:"/",element:d.jsx(M7,{state:e})}),d.jsx(Ys,{path:"/operations",element:d.jsx(C7,{state:e})}),d.jsx(Ys,{path:"/carrier-settings",element:d.jsx(YM,{})}),d.jsx(Ys,{path:"/settings",element:d.jsx(R8,{})}),d.jsx(Ys,{path:"/codex/*",element:null}),d.jsx(Ys,{path:"*",element:d.jsx(j5,{to:"/",replace:!0})})]}),h?d.jsx(XN,{state:e,mode:k,onClose:y}):null,h?null:d.jsx(P7,{onOpen:T}),d.jsx(wL,{state:e}),d.jsx(xL,{state:e}),d.jsx(b3,{state:e}),d.jsx(uM,{state:e}),d.jsx(s3,{state:e}),d.jsx(LL,{open:e.connectionError!==null,tone:"error",title:"Console link interrupted",message:e.connectionError??void 0}),d.jsx(l3,{})]})}function P7({onOpen:e}){return d.jsxs("button",{type:"button",className:"codex-edge-handle",onClick:e,"aria-label":"Open Codex side panel",title:"Codex (Side)",children:[d.jsx("span",{className:"codex-edge-handle-chevron","aria-hidden":"true",children:d.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M9.5 4 5.5 8l4 4"})})}),d.jsx("span",{className:"codex-edge-handle-label",children:"Codex"})]})}uA();const tS=document.querySelector("#app");tS&&PE.createRoot(tS).render(d.jsx(z.StrictMode,{children:d.jsx(cT,{basename:"/console",children:d.jsx(z7,{})})}));export{WD as _,H7 as a,ME as g,St as k,jl as p};