mcp-ssh-manager 3.8.7 → 4.0.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 (104) hide show
  1. package/.eslintignore +5 -0
  2. package/.gitattributes +5 -0
  3. package/CHANGELOG.md +371 -6
  4. package/CLAUDE.md +6 -0
  5. package/CODE_OF_CONDUCT.md +18 -0
  6. package/CONTRIBUTING.md +30 -0
  7. package/Formula/ssh-manager.rb +60 -0
  8. package/README.md +484 -964
  9. package/ROADMAP-V4.md +451 -0
  10. package/brand/README.md +43 -0
  11. package/brand/icon.svg +32 -0
  12. package/brand/mark.svg +18 -0
  13. package/brand/wordmark.svg +30 -0
  14. package/cli/app.js +230 -0
  15. package/cli/control.js +116 -0
  16. package/cli/lib/colors.sh +15 -0
  17. package/cli/lib/menu.sh +145 -96
  18. package/cli/portability.js +186 -0
  19. package/cli/ssh-manager +197 -91
  20. package/cli/ssh-manager.js +14 -0
  21. package/cli/style.js +17 -0
  22. package/cli/vault.js +411 -0
  23. package/desktop/ControlPlaneApp.swift +219 -0
  24. package/desktop/build.sh +58 -0
  25. package/desktop/electron/after-pack.cjs +39 -0
  26. package/desktop/electron/electron-builder.yml +148 -0
  27. package/desktop/electron/finalize-artifacts.mjs +83 -0
  28. package/desktop/electron/main.js +815 -0
  29. package/desktop/electron/package-lock.json +3656 -0
  30. package/desktop/electron/package.json +30 -0
  31. package/desktop/electron/prepare-engine.mjs +84 -0
  32. package/desktop/electron/resources/entitlements.mac.plist +22 -0
  33. package/desktop/electron/resources/icon.png +0 -0
  34. package/desktop/electron/resources/trayTemplate.png +0 -0
  35. package/desktop/electron/resources/trayTemplate@2x.png +0 -0
  36. package/desktop/electron/smoke-test.mjs +184 -0
  37. package/dist/ui/app.css +1 -0
  38. package/dist/ui/app.js +501 -0
  39. package/dist/ui/assets/Forum-Regular.woff2 +0 -0
  40. package/dist/ui/assets/JetBrainsMono-Bold.woff2 +0 -0
  41. package/dist/ui/assets/JetBrainsMono-Regular.woff2 +0 -0
  42. package/dist/ui/assets/Karla-Variable.woff2 +0 -0
  43. package/dist/ui/index.html +16 -0
  44. package/docs/DISTRIBUTION.md +136 -0
  45. package/docs/FINAL-TEST-V4.md +209 -0
  46. package/docs/MIGRATION.md +334 -0
  47. package/docs/TESTING-V4.md +119 -0
  48. package/docs/superpowers/specs/2026-10-08-desktop-from-npm-and-cli-design.md +187 -0
  49. package/docs/videos/control-plane.mp4 +0 -0
  50. package/package.json +61 -30
  51. package/scripts/build-interface.mjs +73 -0
  52. package/scripts/capture-screenshots.mjs +191 -0
  53. package/scripts/demo-env.mjs +461 -0
  54. package/scripts/frame-screenshots.py +176 -0
  55. package/scripts/macbook-mockup.py +296 -0
  56. package/scripts/make-tray-icon.py +61 -0
  57. package/scripts/preview-candidate.mjs +291 -0
  58. package/scripts/publish-desktop.mjs +46 -0
  59. package/scripts/record-demo.mjs +229 -0
  60. package/scripts/release-version.mjs +32 -0
  61. package/scripts/render-cli-menu.py +157 -0
  62. package/scripts/requirements-dev.in +12 -0
  63. package/scripts/requirements-dev.txt +424 -0
  64. package/scripts/run-ui-regression.mjs +48 -0
  65. package/scripts/setup-hooks.sh +7 -13
  66. package/scripts/smoke-desktop.mjs +80 -0
  67. package/scripts/test-drag-and-drop.mjs +114 -0
  68. package/scripts/test-first-run.mjs +5 -0
  69. package/scripts/test-import-ui.mjs +5 -0
  70. package/scripts/test-preferences-persist.mjs +5 -0
  71. package/scripts/test-upgrade-from-published.mjs +226 -0
  72. package/scripts/verify-mac-build.sh +153 -0
  73. package/scripts/verify-windows-build.ps1 +15 -0
  74. package/server.json +3 -3
  75. package/skills/README.md +42 -0
  76. package/skills/ssh-incident/SKILL.md +55 -0
  77. package/skills/ssh-operations/SKILL.md +62 -0
  78. package/skills/ssh-restricted/SKILL.md +57 -0
  79. package/src/agent-clients.js +482 -0
  80. package/src/approval.js +291 -0
  81. package/src/audit.js +11 -1
  82. package/src/command-log.js +162 -0
  83. package/src/config-loader.js +119 -4
  84. package/src/config-paths.js +101 -0
  85. package/src/control-plane.js +2730 -0
  86. package/src/desktop-install.js +747 -0
  87. package/src/index.js +179 -213
  88. package/src/live-stream.js +261 -0
  89. package/src/saved-commands.js +150 -0
  90. package/src/secret-store.js +573 -0
  91. package/src/server-aliases.js +8 -7
  92. package/src/server-config-manager.js +33 -7
  93. package/src/server-export.js +106 -0
  94. package/src/server-groups.js +82 -21
  95. package/src/server-import.js +477 -0
  96. package/src/shell-quote.js +9 -2
  97. package/src/ssh-connection.js +155 -0
  98. package/src/ssh-manager.js +186 -13
  99. package/src/tunnel-manager.js +79 -0
  100. package/src/vault-recovery.js +206 -0
  101. package/src/xlsx.js +322 -0
  102. package/docs/images/social-preview.png +0 -0
  103. package/docs/images/social-preview@2x.png +0 -0
  104. package/docs/images/ssh-manager-cli-menu.png +0 -0
package/dist/ui/app.js ADDED
@@ -0,0 +1,501 @@
1
+ var gb=e=>{throw TypeError(e)};var vb=(e,t,s)=>t.has(e)||gb("Cannot "+s);var ri=(e,t,s)=>(vb(e,t,"read from private field"),s?s.call(e):t.get(e)),_b=(e,t,s)=>t.has(e)?gb("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),hm=(e,t,s,n)=>(vb(e,t,"write to private field"),n?n.call(e,s):t.set(e,s),s);function LN(e,t){for(var s=0;s<t.length;s++){const n=t[s];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const l=Object.getOwnPropertyDescriptor(n,a);l&&Object.defineProperty(e,a,l.get?l:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function s(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function n(a){if(a.ep)return;a.ep=!0;const l=s(a);fetch(a.href,l)}})();function BN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dm={exports:{}},fl={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var yb;function PN(){if(yb)return fl;yb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(n,a,l){var u=null;if(l!==void 0&&(u=""+l),a.key!==void 0&&(u=""+a.key),"key"in a){l={};for(var f in a)f!=="key"&&(l[f]=a[f])}else l=a;return a=l.ref,{$$typeof:e,type:n,key:u,ref:a!==void 0?a:null,props:l}}return fl.Fragment=t,fl.jsx=s,fl.jsxs=s,fl}var bb;function HN(){return bb||(bb=1,dm.exports=PN()),dm.exports}var h=HN(),fm={exports:{}},Re={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var xb;function IN(){if(xb)return Re;xb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),b=Symbol.iterator;function y(O){return O===null||typeof O!="object"?null:(O=b&&O[b]||O["@@iterator"],typeof O=="function"?O:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function k(O,Z,te){this.props=O,this.context=Z,this.refs=E,this.updater=te||x}k.prototype.isReactComponent={},k.prototype.setState=function(O,Z){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,Z,"setState")},k.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function T(){}T.prototype=k.prototype;function D(O,Z,te){this.props=O,this.context=Z,this.refs=E,this.updater=te||x}var R=D.prototype=new T;R.constructor=D,S(R,k.prototype),R.isPureReactComponent=!0;var z=Array.isArray;function L(){}var j={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function V(O,Z,te){var oe=te.ref;return{$$typeof:e,type:O,key:Z,ref:oe!==void 0?oe:null,props:te}}function I(O,Z){return V(O.type,Z,O.props)}function J(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function $(O){var Z={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(te){return Z[te]})}var B=/\/+/g;function K(O,Z){return typeof O=="object"&&O!==null&&O.key!=null?$(""+O.key):Z.toString(36)}function q(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(L,L):(O.status="pending",O.then(function(Z){O.status==="pending"&&(O.status="fulfilled",O.value=Z)},function(Z){O.status==="pending"&&(O.status="rejected",O.reason=Z)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function M(O,Z,te,oe,ce){var he=typeof O;(he==="undefined"||he==="boolean")&&(O=null);var Se=!1;if(O===null)Se=!0;else switch(he){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(O.$$typeof){case e:case t:Se=!0;break;case _:return Se=O._init,M(Se(O._payload),Z,te,oe,ce)}}if(Se)return ce=ce(O),Se=oe===""?"."+K(O,0):oe,z(ce)?(te="",Se!=null&&(te=Se.replace(B,"$&/")+"/"),M(ce,Z,te,"",function(Ce){return Ce})):ce!=null&&(J(ce)&&(ce=I(ce,te+(ce.key==null||O&&O.key===ce.key?"":(""+ce.key).replace(B,"$&/")+"/")+Se)),Z.push(ce)),1;Se=0;var me=oe===""?".":oe+":";if(z(O))for(var le=0;le<O.length;le++)oe=O[le],he=me+K(oe,le),Se+=M(oe,Z,te,he,ce);else if(le=y(O),typeof le=="function")for(O=le.call(O),le=0;!(oe=O.next()).done;)oe=oe.value,he=me+K(oe,le++),Se+=M(oe,Z,te,he,ce);else if(he==="object"){if(typeof O.then=="function")return M(q(O),Z,te,oe,ce);throw Z=String(O),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return Se}function H(O,Z,te){if(O==null)return O;var oe=[],ce=0;return M(O,oe,"","",function(he){return Z.call(te,he,ce++)}),oe}function U(O){if(O._status===-1){var Z=O._result;Z=Z(),Z.then(function(te){(O._status===0||O._status===-1)&&(O._status=1,O._result=te)},function(te){(O._status===0||O._status===-1)&&(O._status=2,O._result=te)}),O._status===-1&&(O._status=0,O._result=Z)}if(O._status===1)return O._result.default;throw O._result}var ae=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},Y={map:H,forEach:function(O,Z,te){H(O,function(){Z.apply(this,arguments)},te)},count:function(O){var Z=0;return H(O,function(){Z++}),Z},toArray:function(O){return H(O,function(Z){return Z})||[]},only:function(O){if(!J(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Re.Activity=g,Re.Children=Y,Re.Component=k,Re.Fragment=s,Re.Profiler=a,Re.PureComponent=D,Re.StrictMode=n,Re.Suspense=m,Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Re.__COMPILER_RUNTIME={__proto__:null,c:function(O){return j.H.useMemoCache(O)}},Re.cache=function(O){return function(){return O.apply(null,arguments)}},Re.cacheSignal=function(){return null},Re.cloneElement=function(O,Z,te){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var oe=S({},O.props),ce=O.key;if(Z!=null)for(he in Z.key!==void 0&&(ce=""+Z.key),Z)!A.call(Z,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&Z.ref===void 0||(oe[he]=Z[he]);var he=arguments.length-2;if(he===1)oe.children=te;else if(1<he){for(var Se=Array(he),me=0;me<he;me++)Se[me]=arguments[me+2];oe.children=Se}return V(O.type,ce,oe)},Re.createContext=function(O){return O={$$typeof:u,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:l,_context:O},O},Re.createElement=function(O,Z,te){var oe,ce={},he=null;if(Z!=null)for(oe in Z.key!==void 0&&(he=""+Z.key),Z)A.call(Z,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(ce[oe]=Z[oe]);var Se=arguments.length-2;if(Se===1)ce.children=te;else if(1<Se){for(var me=Array(Se),le=0;le<Se;le++)me[le]=arguments[le+2];ce.children=me}if(O&&O.defaultProps)for(oe in Se=O.defaultProps,Se)ce[oe]===void 0&&(ce[oe]=Se[oe]);return V(O,he,ce)},Re.createRef=function(){return{current:null}},Re.forwardRef=function(O){return{$$typeof:f,render:O}},Re.isValidElement=J,Re.lazy=function(O){return{$$typeof:_,_payload:{_status:-1,_result:O},_init:U}},Re.memo=function(O,Z){return{$$typeof:d,type:O,compare:Z===void 0?null:Z}},Re.startTransition=function(O){var Z=j.T,te={};j.T=te;try{var oe=O(),ce=j.S;ce!==null&&ce(te,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(L,ae)}catch(he){ae(he)}finally{Z!==null&&te.types!==null&&(Z.types=te.types),j.T=Z}},Re.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Re.use=function(O){return j.H.use(O)},Re.useActionState=function(O,Z,te){return j.H.useActionState(O,Z,te)},Re.useCallback=function(O,Z){return j.H.useCallback(O,Z)},Re.useContext=function(O){return j.H.useContext(O)},Re.useDebugValue=function(){},Re.useDeferredValue=function(O,Z){return j.H.useDeferredValue(O,Z)},Re.useEffect=function(O,Z){return j.H.useEffect(O,Z)},Re.useEffectEvent=function(O){return j.H.useEffectEvent(O)},Re.useId=function(){return j.H.useId()},Re.useImperativeHandle=function(O,Z,te){return j.H.useImperativeHandle(O,Z,te)},Re.useInsertionEffect=function(O,Z){return j.H.useInsertionEffect(O,Z)},Re.useLayoutEffect=function(O,Z){return j.H.useLayoutEffect(O,Z)},Re.useMemo=function(O,Z){return j.H.useMemo(O,Z)},Re.useOptimistic=function(O,Z){return j.H.useOptimistic(O,Z)},Re.useReducer=function(O,Z,te){return j.H.useReducer(O,Z,te)},Re.useRef=function(O){return j.H.useRef(O)},Re.useState=function(O){return j.H.useState(O)},Re.useSyncExternalStore=function(O,Z,te){return j.H.useSyncExternalStore(O,Z,te)},Re.useTransition=function(){return j.H.useTransition()},Re.version="19.2.8",Re}var Sb;function Ch(){return Sb||(Sb=1,fm.exports=IN()),fm.exports}var w=Ch();const ci=BN(w),co=LN({__proto__:null,default:ci},[w]);var mm={exports:{}},ml={},pm={exports:{}},gm={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var wb;function $N(){return wb||(wb=1,(function(e){function t(M,H){var U=M.length;M.push(H);e:for(;0<U;){var ae=U-1>>>1,Y=M[ae];if(0<a(Y,H))M[ae]=H,M[U]=Y,U=ae;else break e}}function s(M){return M.length===0?null:M[0]}function n(M){if(M.length===0)return null;var H=M[0],U=M.pop();if(U!==H){M[0]=U;e:for(var ae=0,Y=M.length,O=Y>>>1;ae<O;){var Z=2*(ae+1)-1,te=M[Z],oe=Z+1,ce=M[oe];if(0>a(te,U))oe<Y&&0>a(ce,te)?(M[ae]=ce,M[oe]=U,ae=oe):(M[ae]=te,M[Z]=U,ae=Z);else if(oe<Y&&0>a(ce,U))M[ae]=ce,M[oe]=U,ae=oe;else break e}}return H}function a(M,H){var U=M.sortIndex-H.sortIndex;return U!==0?U:M.id-H.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var m=[],d=[],_=1,g=null,b=3,y=!1,x=!1,S=!1,E=!1,k=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function R(M){for(var H=s(d);H!==null;){if(H.callback===null)n(d);else if(H.startTime<=M)n(d),H.sortIndex=H.expirationTime,t(m,H);else break;H=s(d)}}function z(M){if(S=!1,R(M),!x)if(s(m)!==null)x=!0,L||(L=!0,$());else{var H=s(d);H!==null&&q(z,H.startTime-M)}}var L=!1,j=-1,A=5,V=-1;function I(){return E?!0:!(e.unstable_now()-V<A)}function J(){if(E=!1,L){var M=e.unstable_now();V=M;var H=!0;try{e:{x=!1,S&&(S=!1,T(j),j=-1),y=!0;var U=b;try{t:{for(R(M),g=s(m);g!==null&&!(g.expirationTime>M&&I());){var ae=g.callback;if(typeof ae=="function"){g.callback=null,b=g.priorityLevel;var Y=ae(g.expirationTime<=M);if(M=e.unstable_now(),typeof Y=="function"){g.callback=Y,R(M),H=!0;break t}g===s(m)&&n(m),R(M)}else n(m);g=s(m)}if(g!==null)H=!0;else{var O=s(d);O!==null&&q(z,O.startTime-M),H=!1}}break e}finally{g=null,b=U,y=!1}H=void 0}}finally{H?$():L=!1}}}var $;if(typeof D=="function")$=function(){D(J)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,K=B.port2;B.port1.onmessage=J,$=function(){K.postMessage(null)}}else $=function(){k(J,0)};function q(M,H){j=k(function(){M(e.unstable_now())},H)}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(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(M){switch(b){case 1:case 2:case 3:var H=3;break;default:H=b}var U=b;b=H;try{return M()}finally{b=U}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(M,H){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var U=b;b=M;try{return H()}finally{b=U}},e.unstable_scheduleCallback=function(M,H,U){var ae=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?ae+U:ae):U=ae,M){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=U+Y,M={id:_++,callback:H,priorityLevel:M,startTime:U,expirationTime:Y,sortIndex:-1},U>ae?(M.sortIndex=U,t(d,M),s(m)===null&&M===s(d)&&(S?(T(j),j=-1):S=!0,q(z,U-ae))):(M.sortIndex=Y,t(m,M),x||y||(x=!0,L||(L=!0,$()))),M},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(M){var H=b;return function(){var U=b;b=H;try{return M.apply(this,arguments)}finally{b=U}}}})(gm)),gm}var Cb;function UN(){return Cb||(Cb=1,pm.exports=$N()),pm.exports}var vm={exports:{}},ni={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Eb;function FN(){if(Eb)return ni;Eb=1;var e=Ch();function t(m){var d="https://react.dev/errors/"+m;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)d+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+m+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var n={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},a=Symbol.for("react.portal");function l(m,d,_){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:g==null?null:""+g,children:m,containerInfo:d,implementation:_}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,d){if(m==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return ni.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,ni.createPortal=function(m,d){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return l(m,d,null,_)},ni.flushSync=function(m){var d=u.T,_=n.p;try{if(u.T=null,n.p=2,m)return m()}finally{u.T=d,n.p=_,n.d.f()}},ni.preconnect=function(m,d){typeof m=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,n.d.C(m,d))},ni.prefetchDNS=function(m){typeof m=="string"&&n.d.D(m)},ni.preinit=function(m,d){if(typeof m=="string"&&d&&typeof d.as=="string"){var _=d.as,g=f(_,d.crossOrigin),b=typeof d.integrity=="string"?d.integrity:void 0,y=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;_==="style"?n.d.S(m,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:g,integrity:b,fetchPriority:y}):_==="script"&&n.d.X(m,{crossOrigin:g,integrity:b,fetchPriority:y,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},ni.preinitModule=function(m,d){if(typeof m=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var _=f(d.as,d.crossOrigin);n.d.M(m,{crossOrigin:_,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&n.d.M(m)},ni.preload=function(m,d){if(typeof m=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var _=d.as,g=f(_,d.crossOrigin);n.d.L(m,_,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},ni.preloadModule=function(m,d){if(typeof m=="string")if(d){var _=f(d.as,d.crossOrigin);n.d.m(m,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:_,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else n.d.m(m)},ni.requestFormReset=function(m){n.d.r(m)},ni.unstable_batchedUpdates=function(m,d){return m(d)},ni.useFormState=function(m,d,_){return u.H.useFormState(m,d,_)},ni.useFormStatus=function(){return u.H.useHostTransitionStatus()},ni.version="19.2.8",ni}var kb;function c1(){if(kb)return vm.exports;kb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),vm.exports=FN(),vm.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Nb;function VN(){if(Nb)return ml;Nb=1;var e=UN(),t=Ch(),s=c1();function n(i){var r="https://react.dev/errors/"+i;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)r+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+i+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function l(i){var r=i,o=i;if(i.alternate)for(;r.return;)r=r.return;else{i=r;do r=i,(r.flags&4098)!==0&&(o=r.return),i=r.return;while(i)}return r.tag===3?o:null}function u(i){if(i.tag===13){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function f(i){if(i.tag===31){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function m(i){if(l(i)!==i)throw Error(n(188))}function d(i){var r=i.alternate;if(!r){if(r=l(i),r===null)throw Error(n(188));return r!==i?null:i}for(var o=i,c=r;;){var p=o.return;if(p===null)break;var v=p.alternate;if(v===null){if(c=p.return,c!==null){o=c;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===o)return m(p),i;if(v===c)return m(p),r;v=v.sibling}throw Error(n(188))}if(o.return!==c.return)o=p,c=v;else{for(var C=!1,N=p.child;N;){if(N===o){C=!0,o=p,c=v;break}if(N===c){C=!0,c=p,o=v;break}N=N.sibling}if(!C){for(N=v.child;N;){if(N===o){C=!0,o=v,c=p;break}if(N===c){C=!0,c=v,o=p;break}N=N.sibling}if(!C)throw Error(n(189))}}if(o.alternate!==c)throw Error(n(190))}if(o.tag!==3)throw Error(n(188));return o.stateNode.current===o?i:r}function _(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i;for(i=i.child;i!==null;){if(r=_(i),r!==null)return r;i=i.sibling}return null}var g=Object.assign,b=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),D=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function $(i){return i===null||typeof i!="object"?null:(i=J&&i[J]||i["@@iterator"],typeof i=="function"?i:null)}var B=Symbol.for("react.client.reference");function K(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===B?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case S:return"Fragment";case k:return"Profiler";case E:return"StrictMode";case z:return"Suspense";case L:return"SuspenseList";case V:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case x:return"Portal";case D:return i.displayName||"Context";case T:return(i._context.displayName||"Context")+".Consumer";case R:var r=i.render;return i=i.displayName,i||(i=r.displayName||r.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case j:return r=i.displayName||null,r!==null?r:K(i.type)||"Memo";case A:r=i._payload,i=i._init;try{return K(i(r))}catch{}}return null}var q=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},ae=[],Y=-1;function O(i){return{current:i}}function Z(i){0>Y||(i.current=ae[Y],ae[Y]=null,Y--)}function te(i,r){Y++,ae[Y]=i.current,i.current=r}var oe=O(null),ce=O(null),he=O(null),Se=O(null);function me(i,r){switch(te(he,r),te(ce,i),te(oe,null),r.nodeType){case 9:case 11:i=(i=r.documentElement)&&(i=i.namespaceURI)?H0(i):0;break;default:if(i=r.tagName,r=r.namespaceURI)r=H0(r),i=I0(r,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Z(oe),te(oe,i)}function le(){Z(oe),Z(ce),Z(he)}function Ce(i){i.memoizedState!==null&&te(Se,i);var r=oe.current,o=I0(r,i.type);r!==o&&(te(ce,i),te(oe,o))}function je(i){ce.current===i&&(Z(oe),Z(ce)),Se.current===i&&(Z(Se),cl._currentValue=U)}var it,De;function ht(i){if(it===void 0)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);it=r&&r[1]||"",De=-1<o.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+it+i+De}var br=!1;function Os(i,r){if(!i||br)return"";br=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(r){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(ee){var Q=ee}Reflect.construct(i,[],re)}else{try{re.call()}catch(ee){Q=ee}i.call(re.prototype)}}else{try{throw Error()}catch(ee){Q=ee}(re=i())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(ee){if(ee&&Q&&typeof ee.stack=="string")return[ee.stack,Q.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=c.DetermineComponentFrameRoot(),C=v[0],N=v[1];if(C&&N){var P=C.split(`
44
+ `),X=N.split(`
45
+ `);for(p=c=0;c<P.length&&!P[c].includes("DetermineComponentFrameRoot");)c++;for(;p<X.length&&!X[p].includes("DetermineComponentFrameRoot");)p++;if(c===P.length||p===X.length)for(c=P.length-1,p=X.length-1;1<=c&&0<=p&&P[c]!==X[p];)p--;for(;1<=c&&0<=p;c--,p--)if(P[c]!==X[p]){if(c!==1||p!==1)do if(c--,p--,0>p||P[c]!==X[p]){var ie=`
46
+ `+P[c].replace(" at new "," at ");return i.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",i.displayName)),ie}while(1<=c&&0<=p);break}}}finally{br=!1,Error.prepareStackTrace=o}return(o=i?i.displayName||i.name:"")?ht(o):""}function ln(i,r){switch(i.tag){case 26:case 27:case 5:return ht(i.type);case 16:return ht("Lazy");case 13:return i.child!==r&&r!==null?ht("Suspense Fallback"):ht("Suspense");case 19:return ht("SuspenseList");case 0:case 15:return Os(i.type,!1);case 11:return Os(i.type.render,!1);case 1:return Os(i.type,!0);case 31:return ht("Activity");default:return""}}function cn(i){try{var r="",o=null;do r+=ln(i,o),o=i,i=i.return;while(i);return r}catch(c){return`
47
+ Error generating stack: `+c.message+`
48
+ `+c.stack}}var xr=Object.prototype.hasOwnProperty,un=e.unstable_scheduleCallback,zs=e.unstable_cancelCallback,xe=e.unstable_shouldYield,Te=e.unstable_requestPaint,Ye=e.unstable_now,st=e.unstable_getCurrentPriorityLevel,si=e.unstable_ImmediatePriority,Zh=e.unstable_UserBlockingPriority,ea=e.unstable_NormalPriority,vE=e.unstable_LowPriority,yv=e.unstable_IdlePriority,_E=e.log,yE=e.unstable_setDisableYieldValue,xo=null,Ci=null;function Sr(i){if(typeof _E=="function"&&yE(i),Ci&&typeof Ci.setStrictMode=="function")try{Ci.setStrictMode(xo,i)}catch{}}var Ei=Math.clz32?Math.clz32:SE,bE=Math.log,xE=Math.LN2;function SE(i){return i>>>=0,i===0?32:31-(bE(i)/xE|0)|0}var lc=256,cc=262144,uc=4194304;function hn(i){var r=i&42;if(r!==0)return r;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function hc(i,r,o){var c=i.pendingLanes;if(c===0)return 0;var p=0,v=i.suspendedLanes,C=i.pingedLanes;i=i.warmLanes;var N=c&134217727;return N!==0?(c=N&~v,c!==0?p=hn(c):(C&=N,C!==0?p=hn(C):o||(o=N&~i,o!==0&&(p=hn(o))))):(N=c&~v,N!==0?p=hn(N):C!==0?p=hn(C):o||(o=c&~i,o!==0&&(p=hn(o)))),p===0?0:r!==0&&r!==p&&(r&v)===0&&(v=p&-p,o=r&-r,v>=o||v===32&&(o&4194048)!==0)?r:p}function So(i,r){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&r)===0}function wE(i,r){switch(i){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 bv(){var i=uc;return uc<<=1,(uc&62914560)===0&&(uc=4194304),i}function Qh(i){for(var r=[],o=0;31>o;o++)r.push(i);return r}function wo(i,r){i.pendingLanes|=r,r!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function CE(i,r,o,c,p,v){var C=i.pendingLanes;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=o,i.entangledLanes&=o,i.errorRecoveryDisabledLanes&=o,i.shellSuspendCounter=0;var N=i.entanglements,P=i.expirationTimes,X=i.hiddenUpdates;for(o=C&~o;0<o;){var ie=31-Ei(o),re=1<<ie;N[ie]=0,P[ie]=-1;var Q=X[ie];if(Q!==null)for(X[ie]=null,ie=0;ie<Q.length;ie++){var ee=Q[ie];ee!==null&&(ee.lane&=-536870913)}o&=~re}c!==0&&xv(i,c,0),v!==0&&p===0&&i.tag!==0&&(i.suspendedLanes|=v&~(C&~r))}function xv(i,r,o){i.pendingLanes|=r,i.suspendedLanes&=~r;var c=31-Ei(r);i.entangledLanes|=r,i.entanglements[c]=i.entanglements[c]|1073741824|o&261930}function Sv(i,r){var o=i.entangledLanes|=r;for(i=i.entanglements;o;){var c=31-Ei(o),p=1<<c;p&r|i[c]&r&&(i[c]|=r),o&=~p}}function wv(i,r){var o=r&-r;return o=(o&42)!==0?1:Jh(o),(o&(i.suspendedLanes|r))!==0?0:o}function Jh(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function ed(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Cv(){var i=H.p;return i!==0?i:(i=window.event,i===void 0?32:cb(i.type))}function Ev(i,r){var o=H.p;try{return H.p=i,r()}finally{H.p=o}}var wr=Math.random().toString(36).slice(2),Yt="__reactFiber$"+wr,mi="__reactProps$"+wr,ta="__reactContainer$"+wr,td="__reactEvents$"+wr,EE="__reactListeners$"+wr,kE="__reactHandles$"+wr,kv="__reactResources$"+wr,Co="__reactMarker$"+wr;function id(i){delete i[Yt],delete i[mi],delete i[td],delete i[EE],delete i[kE]}function ia(i){var r=i[Yt];if(r)return r;for(var o=i.parentNode;o;){if(r=o[ta]||o[Yt]){if(o=r.alternate,r.child!==null||o!==null&&o.child!==null)for(i=q0(i);i!==null;){if(o=i[Yt])return o;i=q0(i)}return r}i=o,o=i.parentNode}return null}function sa(i){if(i=i[Yt]||i[ta]){var r=i.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return i}return null}function Eo(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i.stateNode;throw Error(n(33))}function ra(i){var r=i[kv];return r||(r=i[kv]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Pt(i){i[Co]=!0}var Nv=new Set,jv={};function dn(i,r){na(i,r),na(i+"Capture",r)}function na(i,r){for(jv[i]=r,i=0;i<r.length;i++)Nv.add(r[i])}var NE=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]*$"),Dv={},Tv={};function jE(i){return xr.call(Tv,i)?!0:xr.call(Dv,i)?!1:NE.test(i)?Tv[i]=!0:(Dv[i]=!0,!1)}function dc(i,r,o){if(jE(r))if(o===null)i.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":i.removeAttribute(r);return;case"boolean":var c=r.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){i.removeAttribute(r);return}}i.setAttribute(r,""+o)}}function fc(i,r,o){if(o===null)i.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(r);return}i.setAttribute(r,""+o)}}function Ls(i,r,o,c){if(c===null)i.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttributeNS(r,o,""+c)}}function Ii(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Rv(i){var r=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function DE(i,r,o){var c=Object.getOwnPropertyDescriptor(i.constructor.prototype,r);if(!i.hasOwnProperty(r)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,v=c.set;return Object.defineProperty(i,r,{configurable:!0,get:function(){return p.call(this)},set:function(C){o=""+C,v.call(this,C)}}),Object.defineProperty(i,r,{enumerable:c.enumerable}),{getValue:function(){return o},setValue:function(C){o=""+C},stopTracking:function(){i._valueTracker=null,delete i[r]}}}}function sd(i){if(!i._valueTracker){var r=Rv(i)?"checked":"value";i._valueTracker=DE(i,r,""+i[r])}}function Mv(i){if(!i)return!1;var r=i._valueTracker;if(!r)return!0;var o=r.getValue(),c="";return i&&(c=Rv(i)?i.checked?"true":"false":i.value),i=c,i!==o?(r.setValue(i),!0):!1}function mc(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var TE=/[\n"\\]/g;function $i(i){return i.replace(TE,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function rd(i,r,o,c,p,v,C,N){i.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?i.type=C:i.removeAttribute("type"),r!=null?C==="number"?(r===0&&i.value===""||i.value!=r)&&(i.value=""+Ii(r)):i.value!==""+Ii(r)&&(i.value=""+Ii(r)):C!=="submit"&&C!=="reset"||i.removeAttribute("value"),r!=null?nd(i,C,Ii(r)):o!=null?nd(i,C,Ii(o)):c!=null&&i.removeAttribute("value"),p==null&&v!=null&&(i.defaultChecked=!!v),p!=null&&(i.checked=p&&typeof p!="function"&&typeof p!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?i.name=""+Ii(N):i.removeAttribute("name")}function Av(i,r,o,c,p,v,C,N){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(i.type=v),r!=null||o!=null){if(!(v!=="submit"&&v!=="reset"||r!=null)){sd(i);return}o=o!=null?""+Ii(o):"",r=r!=null?""+Ii(r):o,N||r===i.value||(i.value=r),i.defaultValue=r}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,i.checked=N?i.checked:!!c,i.defaultChecked=!!c,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(i.name=C),sd(i)}function nd(i,r,o){r==="number"&&mc(i.ownerDocument)===i||i.defaultValue===""+o||(i.defaultValue=""+o)}function aa(i,r,o,c){if(i=i.options,r){r={};for(var p=0;p<o.length;p++)r["$"+o[p]]=!0;for(o=0;o<i.length;o++)p=r.hasOwnProperty("$"+i[o].value),i[o].selected!==p&&(i[o].selected=p),p&&c&&(i[o].defaultSelected=!0)}else{for(o=""+Ii(o),r=null,p=0;p<i.length;p++){if(i[p].value===o){i[p].selected=!0,c&&(i[p].defaultSelected=!0);return}r!==null||i[p].disabled||(r=i[p])}r!==null&&(r.selected=!0)}}function Ov(i,r,o){if(r!=null&&(r=""+Ii(r),r!==i.value&&(i.value=r),o==null)){i.defaultValue!==r&&(i.defaultValue=r);return}i.defaultValue=o!=null?""+Ii(o):""}function zv(i,r,o,c){if(r==null){if(c!=null){if(o!=null)throw Error(n(92));if(q(c)){if(1<c.length)throw Error(n(93));c=c[0]}o=c}o==null&&(o=""),r=o}o=Ii(r),i.defaultValue=o,c=i.textContent,c===o&&c!==""&&c!==null&&(i.value=c),sd(i)}function oa(i,r){if(r){var o=i.firstChild;if(o&&o===i.lastChild&&o.nodeType===3){o.nodeValue=r;return}}i.textContent=r}var RE=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 Lv(i,r,o){var c=r.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?c?i.setProperty(r,""):r==="float"?i.cssFloat="":i[r]="":c?i.setProperty(r,o):typeof o!="number"||o===0||RE.has(r)?r==="float"?i.cssFloat=o:i[r]=(""+o).trim():i[r]=o+"px"}function Bv(i,r,o){if(r!=null&&typeof r!="object")throw Error(n(62));if(i=i.style,o!=null){for(var c in o)!o.hasOwnProperty(c)||r!=null&&r.hasOwnProperty(c)||(c.indexOf("--")===0?i.setProperty(c,""):c==="float"?i.cssFloat="":i[c]="");for(var p in r)c=r[p],r.hasOwnProperty(p)&&o[p]!==c&&Lv(i,p,c)}else for(var v in r)r.hasOwnProperty(v)&&Lv(i,v,r[v])}function ad(i){if(i.indexOf("-")===-1)return!1;switch(i){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 ME=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"]]),AE=/^[\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 pc(i){return AE.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Bs(){}var od=null;function ld(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var la=null,ca=null;function Pv(i){var r=sa(i);if(r&&(i=r.stateNode)){var o=i[mi]||null;e:switch(i=r.stateNode,r.type){case"input":if(rd(i,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),r=o.name,o.type==="radio"&&r!=null){for(o=i;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+$i(""+r)+'"][type="radio"]'),r=0;r<o.length;r++){var c=o[r];if(c!==i&&c.form===i.form){var p=c[mi]||null;if(!p)throw Error(n(90));rd(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<o.length;r++)c=o[r],c.form===i.form&&Mv(c)}break e;case"textarea":Ov(i,o.value,o.defaultValue);break e;case"select":r=o.value,r!=null&&aa(i,!!o.multiple,r,!1)}}}var cd=!1;function Hv(i,r,o){if(cd)return i(r,o);cd=!0;try{var c=i(r);return c}finally{if(cd=!1,(la!==null||ca!==null)&&(iu(),la&&(r=la,i=ca,ca=la=null,Pv(r),i)))for(r=0;r<i.length;r++)Pv(i[r])}}function ko(i,r){var o=i.stateNode;if(o===null)return null;var c=o[mi]||null;if(c===null)return null;o=c[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(i=i.type,c=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!c;break e;default:i=!1}if(i)return null;if(o&&typeof o!="function")throw Error(n(231,r,typeof o));return o}var Ps=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ud=!1;if(Ps)try{var No={};Object.defineProperty(No,"passive",{get:function(){ud=!0}}),window.addEventListener("test",No,No),window.removeEventListener("test",No,No)}catch{ud=!1}var Cr=null,hd=null,gc=null;function Iv(){if(gc)return gc;var i,r=hd,o=r.length,c,p="value"in Cr?Cr.value:Cr.textContent,v=p.length;for(i=0;i<o&&r[i]===p[i];i++);var C=o-i;for(c=1;c<=C&&r[o-c]===p[v-c];c++);return gc=p.slice(i,1<c?1-c:void 0)}function vc(i){var r=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&r===13&&(i=13)):i=r,i===10&&(i=13),32<=i||i===13?i:0}function _c(){return!0}function $v(){return!1}function pi(i){function r(o,c,p,v,C){this._reactName=o,this._targetInst=p,this.type=c,this.nativeEvent=v,this.target=C,this.currentTarget=null;for(var N in i)i.hasOwnProperty(N)&&(o=i[N],this[N]=o?o(v):v[N]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?_c:$v,this.isPropagationStopped=$v,this}return g(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=_c)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=_c)},persist:function(){},isPersistent:_c}),r}var fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yc=pi(fn),jo=g({},fn,{view:0,detail:0}),OE=pi(jo),dd,fd,Do,bc=g({},jo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pd,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Do&&(Do&&i.type==="mousemove"?(dd=i.screenX-Do.screenX,fd=i.screenY-Do.screenY):fd=dd=0,Do=i),dd)},movementY:function(i){return"movementY"in i?i.movementY:fd}}),Uv=pi(bc),zE=g({},bc,{dataTransfer:0}),LE=pi(zE),BE=g({},jo,{relatedTarget:0}),md=pi(BE),PE=g({},fn,{animationName:0,elapsedTime:0,pseudoElement:0}),HE=pi(PE),IE=g({},fn,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),$E=pi(IE),UE=g({},fn,{data:0}),Fv=pi(UE),FE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},VE={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"},WE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function KE(i){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(i):(i=WE[i])?!!r[i]:!1}function pd(){return KE}var qE=g({},jo,{key:function(i){if(i.key){var r=FE[i.key]||i.key;if(r!=="Unidentified")return r}return i.type==="keypress"?(i=vc(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?VE[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pd,charCode:function(i){return i.type==="keypress"?vc(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?vc(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),YE=pi(qE),GE=g({},bc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vv=pi(GE),XE=g({},jo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pd}),ZE=pi(XE),QE=g({},fn,{propertyName:0,elapsedTime:0,pseudoElement:0}),JE=pi(QE),ek=g({},bc,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),tk=pi(ek),ik=g({},fn,{newState:0,oldState:0}),sk=pi(ik),rk=[9,13,27,32],gd=Ps&&"CompositionEvent"in window,To=null;Ps&&"documentMode"in document&&(To=document.documentMode);var nk=Ps&&"TextEvent"in window&&!To,Wv=Ps&&(!gd||To&&8<To&&11>=To),Kv=" ",qv=!1;function Yv(i,r){switch(i){case"keyup":return rk.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gv(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ua=!1;function ak(i,r){switch(i){case"compositionend":return Gv(r);case"keypress":return r.which!==32?null:(qv=!0,Kv);case"textInput":return i=r.data,i===Kv&&qv?null:i;default:return null}}function ok(i,r){if(ua)return i==="compositionend"||!gd&&Yv(i,r)?(i=Iv(),gc=hd=Cr=null,ua=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Wv&&r.locale!=="ko"?null:r.data;default:return null}}var lk={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 Xv(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r==="input"?!!lk[i.type]:r==="textarea"}function Zv(i,r,o,c){la?ca?ca.push(c):ca=[c]:la=c,r=cu(r,"onChange"),0<r.length&&(o=new yc("onChange","change",null,o,c),i.push({event:o,listeners:r}))}var Ro=null,Mo=null;function ck(i){A0(i,0)}function xc(i){var r=Eo(i);if(Mv(r))return i}function Qv(i,r){if(i==="change")return r}var Jv=!1;if(Ps){var vd;if(Ps){var _d="oninput"in document;if(!_d){var e_=document.createElement("div");e_.setAttribute("oninput","return;"),_d=typeof e_.oninput=="function"}vd=_d}else vd=!1;Jv=vd&&(!document.documentMode||9<document.documentMode)}function t_(){Ro&&(Ro.detachEvent("onpropertychange",i_),Mo=Ro=null)}function i_(i){if(i.propertyName==="value"&&xc(Mo)){var r=[];Zv(r,Mo,i,ld(i)),Hv(ck,r)}}function uk(i,r,o){i==="focusin"?(t_(),Ro=r,Mo=o,Ro.attachEvent("onpropertychange",i_)):i==="focusout"&&t_()}function hk(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return xc(Mo)}function dk(i,r){if(i==="click")return xc(r)}function fk(i,r){if(i==="input"||i==="change")return xc(r)}function mk(i,r){return i===r&&(i!==0||1/i===1/r)||i!==i&&r!==r}var ki=typeof Object.is=="function"?Object.is:mk;function Ao(i,r){if(ki(i,r))return!0;if(typeof i!="object"||i===null||typeof r!="object"||r===null)return!1;var o=Object.keys(i),c=Object.keys(r);if(o.length!==c.length)return!1;for(c=0;c<o.length;c++){var p=o[c];if(!xr.call(r,p)||!ki(i[p],r[p]))return!1}return!0}function s_(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function r_(i,r){var o=s_(i);i=0;for(var c;o;){if(o.nodeType===3){if(c=i+o.textContent.length,i<=r&&c>=r)return{node:o,offset:r-i};i=c}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=s_(o)}}function n_(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?n_(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function a_(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var r=mc(i.document);r instanceof i.HTMLIFrameElement;){try{var o=typeof r.contentWindow.location.href=="string"}catch{o=!1}if(o)i=r.contentWindow;else break;r=mc(i.document)}return r}function yd(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r&&(r==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||r==="textarea"||i.contentEditable==="true")}var pk=Ps&&"documentMode"in document&&11>=document.documentMode,ha=null,bd=null,Oo=null,xd=!1;function o_(i,r,o){var c=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;xd||ha==null||ha!==mc(c)||(c=ha,"selectionStart"in c&&yd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Oo&&Ao(Oo,c)||(Oo=c,c=cu(bd,"onSelect"),0<c.length&&(r=new yc("onSelect","select",null,r,o),i.push({event:r,listeners:c}),r.target=ha)))}function mn(i,r){var o={};return o[i.toLowerCase()]=r.toLowerCase(),o["Webkit"+i]="webkit"+r,o["Moz"+i]="moz"+r,o}var da={animationend:mn("Animation","AnimationEnd"),animationiteration:mn("Animation","AnimationIteration"),animationstart:mn("Animation","AnimationStart"),transitionrun:mn("Transition","TransitionRun"),transitionstart:mn("Transition","TransitionStart"),transitioncancel:mn("Transition","TransitionCancel"),transitionend:mn("Transition","TransitionEnd")},Sd={},l_={};Ps&&(l_=document.createElement("div").style,"AnimationEvent"in window||(delete da.animationend.animation,delete da.animationiteration.animation,delete da.animationstart.animation),"TransitionEvent"in window||delete da.transitionend.transition);function pn(i){if(Sd[i])return Sd[i];if(!da[i])return i;var r=da[i],o;for(o in r)if(r.hasOwnProperty(o)&&o in l_)return Sd[i]=r[o];return i}var c_=pn("animationend"),u_=pn("animationiteration"),h_=pn("animationstart"),gk=pn("transitionrun"),vk=pn("transitionstart"),_k=pn("transitioncancel"),d_=pn("transitionend"),f_=new Map,wd="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(" ");wd.push("scrollEnd");function as(i,r){f_.set(i,r),dn(r,[i])}var Sc=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Ui=[],fa=0,Cd=0;function wc(){for(var i=fa,r=Cd=fa=0;r<i;){var o=Ui[r];Ui[r++]=null;var c=Ui[r];Ui[r++]=null;var p=Ui[r];Ui[r++]=null;var v=Ui[r];if(Ui[r++]=null,c!==null&&p!==null){var C=c.pending;C===null?p.next=p:(p.next=C.next,C.next=p),c.pending=p}v!==0&&m_(o,p,v)}}function Cc(i,r,o,c){Ui[fa++]=i,Ui[fa++]=r,Ui[fa++]=o,Ui[fa++]=c,Cd|=c,i.lanes|=c,i=i.alternate,i!==null&&(i.lanes|=c)}function Ed(i,r,o,c){return Cc(i,r,o,c),Ec(i)}function gn(i,r){return Cc(i,null,null,r),Ec(i)}function m_(i,r,o){i.lanes|=o;var c=i.alternate;c!==null&&(c.lanes|=o);for(var p=!1,v=i.return;v!==null;)v.childLanes|=o,c=v.alternate,c!==null&&(c.childLanes|=o),v.tag===22&&(i=v.stateNode,i===null||i._visibility&1||(p=!0)),i=v,v=v.return;return i.tag===3?(v=i.stateNode,p&&r!==null&&(p=31-Ei(o),i=v.hiddenUpdates,c=i[p],c===null?i[p]=[r]:c.push(r),r.lane=o|536870912),v):null}function Ec(i){if(50<il)throw il=0,zf=null,Error(n(185));for(var r=i.return;r!==null;)i=r,r=i.return;return i.tag===3?i.stateNode:null}var ma={};function yk(i,r,o,c){this.tag=i,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ni(i,r,o,c){return new yk(i,r,o,c)}function kd(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Hs(i,r){var o=i.alternate;return o===null?(o=Ni(i.tag,r,i.key,i.mode),o.elementType=i.elementType,o.type=i.type,o.stateNode=i.stateNode,o.alternate=i,i.alternate=o):(o.pendingProps=r,o.type=i.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=i.flags&65011712,o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,r=i.dependencies,o.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},o.sibling=i.sibling,o.index=i.index,o.ref=i.ref,o.refCleanup=i.refCleanup,o}function p_(i,r){i.flags&=65011714;var o=i.alternate;return o===null?(i.childLanes=0,i.lanes=r,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,r=o.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),i}function kc(i,r,o,c,p,v){var C=0;if(c=i,typeof i=="function")kd(i)&&(C=1);else if(typeof i=="string")C=CN(i,o,oe.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case V:return i=Ni(31,o,r,p),i.elementType=V,i.lanes=v,i;case S:return vn(o.children,p,v,r);case E:C=8,p|=24;break;case k:return i=Ni(12,o,r,p|2),i.elementType=k,i.lanes=v,i;case z:return i=Ni(13,o,r,p),i.elementType=z,i.lanes=v,i;case L:return i=Ni(19,o,r,p),i.elementType=L,i.lanes=v,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case D:C=10;break e;case T:C=9;break e;case R:C=11;break e;case j:C=14;break e;case A:C=16,c=null;break e}C=29,o=Error(n(130,i===null?"null":typeof i,"")),c=null}return r=Ni(C,o,r,p),r.elementType=i,r.type=c,r.lanes=v,r}function vn(i,r,o,c){return i=Ni(7,i,c,r),i.lanes=o,i}function Nd(i,r,o){return i=Ni(6,i,null,r),i.lanes=o,i}function g_(i){var r=Ni(18,null,null,0);return r.stateNode=i,r}function jd(i,r,o){return r=Ni(4,i.children!==null?i.children:[],i.key,r),r.lanes=o,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}var v_=new WeakMap;function Fi(i,r){if(typeof i=="object"&&i!==null){var o=v_.get(i);return o!==void 0?o:(r={value:i,source:r,stack:cn(r)},v_.set(i,r),r)}return{value:i,source:r,stack:cn(r)}}var pa=[],ga=0,Nc=null,zo=0,Vi=[],Wi=0,Er=null,ms=1,ps="";function Is(i,r){pa[ga++]=zo,pa[ga++]=Nc,Nc=i,zo=r}function __(i,r,o){Vi[Wi++]=ms,Vi[Wi++]=ps,Vi[Wi++]=Er,Er=i;var c=ms;i=ps;var p=32-Ei(c)-1;c&=~(1<<p),o+=1;var v=32-Ei(r)+p;if(30<v){var C=p-p%5;v=(c&(1<<C)-1).toString(32),c>>=C,p-=C,ms=1<<32-Ei(r)+p|o<<p|c,ps=v+i}else ms=1<<v|o<<p|c,ps=i}function Dd(i){i.return!==null&&(Is(i,1),__(i,1,0))}function Td(i){for(;i===Nc;)Nc=pa[--ga],pa[ga]=null,zo=pa[--ga],pa[ga]=null;for(;i===Er;)Er=Vi[--Wi],Vi[Wi]=null,ps=Vi[--Wi],Vi[Wi]=null,ms=Vi[--Wi],Vi[Wi]=null}function y_(i,r){Vi[Wi++]=ms,Vi[Wi++]=ps,Vi[Wi++]=Er,ms=r.id,ps=r.overflow,Er=i}var Gt=null,nt=null,Fe=!1,kr=null,Ki=!1,Rd=Error(n(519));function Nr(i){var r=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Lo(Fi(r,i)),Rd}function b_(i){var r=i.stateNode,o=i.type,c=i.memoizedProps;switch(r[Yt]=i,r[mi]=c,o){case"dialog":He("cancel",r),He("close",r);break;case"iframe":case"object":case"embed":He("load",r);break;case"video":case"audio":for(o=0;o<rl.length;o++)He(rl[o],r);break;case"source":He("error",r);break;case"img":case"image":case"link":He("error",r),He("load",r);break;case"details":He("toggle",r);break;case"input":He("invalid",r),Av(r,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":He("invalid",r);break;case"textarea":He("invalid",r),zv(r,c.value,c.defaultValue,c.children)}o=c.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||r.textContent===""+o||c.suppressHydrationWarning===!0||B0(r.textContent,o)?(c.popover!=null&&(He("beforetoggle",r),He("toggle",r)),c.onScroll!=null&&He("scroll",r),c.onScrollEnd!=null&&He("scrollend",r),c.onClick!=null&&(r.onclick=Bs),r=!0):r=!1,r||Nr(i,!0)}function x_(i){for(Gt=i.return;Gt;)switch(Gt.tag){case 5:case 31:case 13:Ki=!1;return;case 27:case 3:Ki=!0;return;default:Gt=Gt.return}}function va(i){if(i!==Gt)return!1;if(!Fe)return x_(i),Fe=!0,!1;var r=i.tag,o;if((o=r!==3&&r!==27)&&((o=r===5)&&(o=i.type,o=!(o!=="form"&&o!=="button")||Xf(i.type,i.memoizedProps)),o=!o),o&&nt&&Nr(i),x_(i),r===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));nt=K0(i)}else if(r===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));nt=K0(i)}else r===27?(r=nt,$r(i.type)?(i=tm,tm=null,nt=i):nt=r):nt=Gt?Yi(i.stateNode.nextSibling):null;return!0}function _n(){nt=Gt=null,Fe=!1}function Md(){var i=kr;return i!==null&&(yi===null?yi=i:yi.push.apply(yi,i),kr=null),i}function Lo(i){kr===null?kr=[i]:kr.push(i)}var Ad=O(null),yn=null,$s=null;function jr(i,r,o){te(Ad,r._currentValue),r._currentValue=o}function Us(i){i._currentValue=Ad.current,Z(Ad)}function Od(i,r,o){for(;i!==null;){var c=i.alternate;if((i.childLanes&r)!==r?(i.childLanes|=r,c!==null&&(c.childLanes|=r)):c!==null&&(c.childLanes&r)!==r&&(c.childLanes|=r),i===o)break;i=i.return}}function zd(i,r,o,c){var p=i.child;for(p!==null&&(p.return=i);p!==null;){var v=p.dependencies;if(v!==null){var C=p.child;v=v.firstContext;e:for(;v!==null;){var N=v;v=p;for(var P=0;P<r.length;P++)if(N.context===r[P]){v.lanes|=o,N=v.alternate,N!==null&&(N.lanes|=o),Od(v.return,o,i),c||(C=null);break e}v=N.next}}else if(p.tag===18){if(C=p.return,C===null)throw Error(n(341));C.lanes|=o,v=C.alternate,v!==null&&(v.lanes|=o),Od(C,o,i),C=null}else C=p.child;if(C!==null)C.return=p;else for(C=p;C!==null;){if(C===i){C=null;break}if(p=C.sibling,p!==null){p.return=C.return,C=p;break}C=C.return}p=C}}function _a(i,r,o,c){i=null;for(var p=r,v=!1;p!==null;){if(!v){if((p.flags&524288)!==0)v=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var C=p.alternate;if(C===null)throw Error(n(387));if(C=C.memoizedProps,C!==null){var N=p.type;ki(p.pendingProps.value,C.value)||(i!==null?i.push(N):i=[N])}}else if(p===Se.current){if(C=p.alternate,C===null)throw Error(n(387));C.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(i!==null?i.push(cl):i=[cl])}p=p.return}i!==null&&zd(r,i,o,c),r.flags|=262144}function jc(i){for(i=i.firstContext;i!==null;){if(!ki(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function bn(i){yn=i,$s=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Xt(i){return S_(yn,i)}function Dc(i,r){return yn===null&&bn(i),S_(i,r)}function S_(i,r){var o=r._currentValue;if(r={context:r,memoizedValue:o,next:null},$s===null){if(i===null)throw Error(n(308));$s=r,i.dependencies={lanes:0,firstContext:r},i.flags|=524288}else $s=$s.next=r;return o}var bk=typeof AbortController<"u"?AbortController:function(){var i=[],r=this.signal={aborted:!1,addEventListener:function(o,c){i.push(c)}};this.abort=function(){r.aborted=!0,i.forEach(function(o){return o()})}},xk=e.unstable_scheduleCallback,Sk=e.unstable_NormalPriority,wt={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ld(){return{controller:new bk,data:new Map,refCount:0}}function Bo(i){i.refCount--,i.refCount===0&&xk(Sk,function(){i.controller.abort()})}var Po=null,Bd=0,ya=0,ba=null;function wk(i,r){if(Po===null){var o=Po=[];Bd=0,ya=$f(),ba={status:"pending",value:void 0,then:function(c){o.push(c)}}}return Bd++,r.then(w_,w_),r}function w_(){if(--Bd===0&&Po!==null){ba!==null&&(ba.status="fulfilled");var i=Po;Po=null,ya=0,ba=null;for(var r=0;r<i.length;r++)(0,i[r])()}}function Ck(i,r){var o=[],c={status:"pending",value:null,reason:null,then:function(p){o.push(p)}};return i.then(function(){c.status="fulfilled",c.value=r;for(var p=0;p<o.length;p++)(0,o[p])(r)},function(p){for(c.status="rejected",c.reason=p,p=0;p<o.length;p++)(0,o[p])(void 0)}),c}var C_=M.S;M.S=function(i,r){o0=Ye(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&wk(i,r),C_!==null&&C_(i,r)};var xn=O(null);function Pd(){var i=xn.current;return i!==null?i:tt.pooledCache}function Tc(i,r){r===null?te(xn,xn.current):te(xn,r.pool)}function E_(){var i=Pd();return i===null?null:{parent:wt._currentValue,pool:i}}var xa=Error(n(460)),Hd=Error(n(474)),Rc=Error(n(542)),Mc={then:function(){}};function k_(i){return i=i.status,i==="fulfilled"||i==="rejected"}function N_(i,r,o){switch(o=i[o],o===void 0?i.push(r):o!==r&&(r.then(Bs,Bs),r=o),r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,D_(i),i;default:if(typeof r.status=="string")r.then(Bs,Bs);else{if(i=tt,i!==null&&100<i.shellSuspendCounter)throw Error(n(482));i=r,i.status="pending",i.then(function(c){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=c}},function(c){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=c}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,D_(i),i}throw wn=r,xa}}function Sn(i){try{var r=i._init;return r(i._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(wn=o,xa):o}}var wn=null;function j_(){if(wn===null)throw Error(n(459));var i=wn;return wn=null,i}function D_(i){if(i===xa||i===Rc)throw Error(n(483))}var Sa=null,Ho=0;function Ac(i){var r=Ho;return Ho+=1,Sa===null&&(Sa=[]),N_(Sa,i,r)}function Io(i,r){r=r.props.ref,i.ref=r!==void 0?r:null}function Oc(i,r){throw r.$$typeof===b?Error(n(525)):(i=Object.prototype.toString.call(r),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":i)))}function T_(i){function r(W,F){if(i){var G=W.deletions;G===null?(W.deletions=[F],W.flags|=16):G.push(F)}}function o(W,F){if(!i)return null;for(;F!==null;)r(W,F),F=F.sibling;return null}function c(W){for(var F=new Map;W!==null;)W.key!==null?F.set(W.key,W):F.set(W.index,W),W=W.sibling;return F}function p(W,F){return W=Hs(W,F),W.index=0,W.sibling=null,W}function v(W,F,G){return W.index=G,i?(G=W.alternate,G!==null?(G=G.index,G<F?(W.flags|=67108866,F):G):(W.flags|=67108866,F)):(W.flags|=1048576,F)}function C(W){return i&&W.alternate===null&&(W.flags|=67108866),W}function N(W,F,G,se){return F===null||F.tag!==6?(F=Nd(G,W.mode,se),F.return=W,F):(F=p(F,G),F.return=W,F)}function P(W,F,G,se){var we=G.type;return we===S?ie(W,F,G.props.children,se,G.key):F!==null&&(F.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===A&&Sn(we)===F.type)?(F=p(F,G.props),Io(F,G),F.return=W,F):(F=kc(G.type,G.key,G.props,null,W.mode,se),Io(F,G),F.return=W,F)}function X(W,F,G,se){return F===null||F.tag!==4||F.stateNode.containerInfo!==G.containerInfo||F.stateNode.implementation!==G.implementation?(F=jd(G,W.mode,se),F.return=W,F):(F=p(F,G.children||[]),F.return=W,F)}function ie(W,F,G,se,we){return F===null||F.tag!==7?(F=vn(G,W.mode,se,we),F.return=W,F):(F=p(F,G),F.return=W,F)}function re(W,F,G){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=Nd(""+F,W.mode,G),F.return=W,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case y:return G=kc(F.type,F.key,F.props,null,W.mode,G),Io(G,F),G.return=W,G;case x:return F=jd(F,W.mode,G),F.return=W,F;case A:return F=Sn(F),re(W,F,G)}if(q(F)||$(F))return F=vn(F,W.mode,G,null),F.return=W,F;if(typeof F.then=="function")return re(W,Ac(F),G);if(F.$$typeof===D)return re(W,Dc(W,F),G);Oc(W,F)}return null}function Q(W,F,G,se){var we=F!==null?F.key:null;if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return we!==null?null:N(W,F,""+G,se);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case y:return G.key===we?P(W,F,G,se):null;case x:return G.key===we?X(W,F,G,se):null;case A:return G=Sn(G),Q(W,F,G,se)}if(q(G)||$(G))return we!==null?null:ie(W,F,G,se,null);if(typeof G.then=="function")return Q(W,F,Ac(G),se);if(G.$$typeof===D)return Q(W,F,Dc(W,G),se);Oc(W,G)}return null}function ee(W,F,G,se,we){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return W=W.get(G)||null,N(F,W,""+se,we);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case y:return W=W.get(se.key===null?G:se.key)||null,P(F,W,se,we);case x:return W=W.get(se.key===null?G:se.key)||null,X(F,W,se,we);case A:return se=Sn(se),ee(W,F,G,se,we)}if(q(se)||$(se))return W=W.get(G)||null,ie(F,W,se,we,null);if(typeof se.then=="function")return ee(W,F,G,Ac(se),we);if(se.$$typeof===D)return ee(W,F,G,Dc(F,se),we);Oc(F,se)}return null}function ye(W,F,G,se){for(var we=null,Ve=null,be=F,Oe=F=0,Ue=null;be!==null&&Oe<G.length;Oe++){be.index>Oe?(Ue=be,be=null):Ue=be.sibling;var We=Q(W,be,G[Oe],se);if(We===null){be===null&&(be=Ue);break}i&&be&&We.alternate===null&&r(W,be),F=v(We,F,Oe),Ve===null?we=We:Ve.sibling=We,Ve=We,be=Ue}if(Oe===G.length)return o(W,be),Fe&&Is(W,Oe),we;if(be===null){for(;Oe<G.length;Oe++)be=re(W,G[Oe],se),be!==null&&(F=v(be,F,Oe),Ve===null?we=be:Ve.sibling=be,Ve=be);return Fe&&Is(W,Oe),we}for(be=c(be);Oe<G.length;Oe++)Ue=ee(be,W,Oe,G[Oe],se),Ue!==null&&(i&&Ue.alternate!==null&&be.delete(Ue.key===null?Oe:Ue.key),F=v(Ue,F,Oe),Ve===null?we=Ue:Ve.sibling=Ue,Ve=Ue);return i&&be.forEach(function(Kr){return r(W,Kr)}),Fe&&Is(W,Oe),we}function Ee(W,F,G,se){if(G==null)throw Error(n(151));for(var we=null,Ve=null,be=F,Oe=F=0,Ue=null,We=G.next();be!==null&&!We.done;Oe++,We=G.next()){be.index>Oe?(Ue=be,be=null):Ue=be.sibling;var Kr=Q(W,be,We.value,se);if(Kr===null){be===null&&(be=Ue);break}i&&be&&Kr.alternate===null&&r(W,be),F=v(Kr,F,Oe),Ve===null?we=Kr:Ve.sibling=Kr,Ve=Kr,be=Ue}if(We.done)return o(W,be),Fe&&Is(W,Oe),we;if(be===null){for(;!We.done;Oe++,We=G.next())We=re(W,We.value,se),We!==null&&(F=v(We,F,Oe),Ve===null?we=We:Ve.sibling=We,Ve=We);return Fe&&Is(W,Oe),we}for(be=c(be);!We.done;Oe++,We=G.next())We=ee(be,W,Oe,We.value,se),We!==null&&(i&&We.alternate!==null&&be.delete(We.key===null?Oe:We.key),F=v(We,F,Oe),Ve===null?we=We:Ve.sibling=We,Ve=We);return i&&be.forEach(function(zN){return r(W,zN)}),Fe&&Is(W,Oe),we}function Je(W,F,G,se){if(typeof G=="object"&&G!==null&&G.type===S&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case y:e:{for(var we=G.key;F!==null;){if(F.key===we){if(we=G.type,we===S){if(F.tag===7){o(W,F.sibling),se=p(F,G.props.children),se.return=W,W=se;break e}}else if(F.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===A&&Sn(we)===F.type){o(W,F.sibling),se=p(F,G.props),Io(se,G),se.return=W,W=se;break e}o(W,F);break}else r(W,F);F=F.sibling}G.type===S?(se=vn(G.props.children,W.mode,se,G.key),se.return=W,W=se):(se=kc(G.type,G.key,G.props,null,W.mode,se),Io(se,G),se.return=W,W=se)}return C(W);case x:e:{for(we=G.key;F!==null;){if(F.key===we)if(F.tag===4&&F.stateNode.containerInfo===G.containerInfo&&F.stateNode.implementation===G.implementation){o(W,F.sibling),se=p(F,G.children||[]),se.return=W,W=se;break e}else{o(W,F);break}else r(W,F);F=F.sibling}se=jd(G,W.mode,se),se.return=W,W=se}return C(W);case A:return G=Sn(G),Je(W,F,G,se)}if(q(G))return ye(W,F,G,se);if($(G)){if(we=$(G),typeof we!="function")throw Error(n(150));return G=we.call(G),Ee(W,F,G,se)}if(typeof G.then=="function")return Je(W,F,Ac(G),se);if(G.$$typeof===D)return Je(W,F,Dc(W,G),se);Oc(W,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,F!==null&&F.tag===6?(o(W,F.sibling),se=p(F,G),se.return=W,W=se):(o(W,F),se=Nd(G,W.mode,se),se.return=W,W=se),C(W)):o(W,F)}return function(W,F,G,se){try{Ho=0;var we=Je(W,F,G,se);return Sa=null,we}catch(be){if(be===xa||be===Rc)throw be;var Ve=Ni(29,be,null,W.mode);return Ve.lanes=se,Ve.return=W,Ve}finally{}}}var Cn=T_(!0),R_=T_(!1),Dr=!1;function Id(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $d(i,r){i=i.updateQueue,r.updateQueue===i&&(r.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Tr(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Rr(i,r,o){var c=i.updateQueue;if(c===null)return null;if(c=c.shared,(Ke&2)!==0){var p=c.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),c.pending=r,r=Ec(i),m_(i,null,o),r}return Cc(i,c,r,o),Ec(i)}function $o(i,r,o){if(r=r.updateQueue,r!==null&&(r=r.shared,(o&4194048)!==0)){var c=r.lanes;c&=i.pendingLanes,o|=c,r.lanes=o,Sv(i,o)}}function Ud(i,r){var o=i.updateQueue,c=i.alternate;if(c!==null&&(c=c.updateQueue,o===c)){var p=null,v=null;if(o=o.firstBaseUpdate,o!==null){do{var C={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};v===null?p=v=C:v=v.next=C,o=o.next}while(o!==null);v===null?p=v=r:v=v.next=r}else p=v=r;o={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:c.shared,callbacks:c.callbacks},i.updateQueue=o;return}i=o.lastBaseUpdate,i===null?o.firstBaseUpdate=r:i.next=r,o.lastBaseUpdate=r}var Fd=!1;function Uo(){if(Fd){var i=ba;if(i!==null)throw i}}function Fo(i,r,o,c){Fd=!1;var p=i.updateQueue;Dr=!1;var v=p.firstBaseUpdate,C=p.lastBaseUpdate,N=p.shared.pending;if(N!==null){p.shared.pending=null;var P=N,X=P.next;P.next=null,C===null?v=X:C.next=X,C=P;var ie=i.alternate;ie!==null&&(ie=ie.updateQueue,N=ie.lastBaseUpdate,N!==C&&(N===null?ie.firstBaseUpdate=X:N.next=X,ie.lastBaseUpdate=P))}if(v!==null){var re=p.baseState;C=0,ie=X=P=null,N=v;do{var Q=N.lane&-536870913,ee=Q!==N.lane;if(ee?($e&Q)===Q:(c&Q)===Q){Q!==0&&Q===ya&&(Fd=!0),ie!==null&&(ie=ie.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var ye=i,Ee=N;Q=r;var Je=o;switch(Ee.tag){case 1:if(ye=Ee.payload,typeof ye=="function"){re=ye.call(Je,re,Q);break e}re=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Ee.payload,Q=typeof ye=="function"?ye.call(Je,re,Q):ye,Q==null)break e;re=g({},re,Q);break e;case 2:Dr=!0}}Q=N.callback,Q!==null&&(i.flags|=64,ee&&(i.flags|=8192),ee=p.callbacks,ee===null?p.callbacks=[Q]:ee.push(Q))}else ee={lane:Q,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ie===null?(X=ie=ee,P=re):ie=ie.next=ee,C|=Q;if(N=N.next,N===null){if(N=p.shared.pending,N===null)break;ee=N,N=ee.next,ee.next=null,p.lastBaseUpdate=ee,p.shared.pending=null}}while(!0);ie===null&&(P=re),p.baseState=P,p.firstBaseUpdate=X,p.lastBaseUpdate=ie,v===null&&(p.shared.lanes=0),Lr|=C,i.lanes=C,i.memoizedState=re}}function M_(i,r){if(typeof i!="function")throw Error(n(191,i));i.call(r)}function A_(i,r){var o=i.callbacks;if(o!==null)for(i.callbacks=null,i=0;i<o.length;i++)M_(o[i],r)}var wa=O(null),zc=O(0);function O_(i,r){i=Zs,te(zc,i),te(wa,r),Zs=i|r.baseLanes}function Vd(){te(zc,Zs),te(wa,wa.current)}function Wd(){Zs=zc.current,Z(wa),Z(zc)}var ji=O(null),qi=null;function Mr(i){var r=i.alternate;te(bt,bt.current&1),te(ji,i),qi===null&&(r===null||wa.current!==null||r.memoizedState!==null)&&(qi=i)}function Kd(i){te(bt,bt.current),te(ji,i),qi===null&&(qi=i)}function z_(i){i.tag===22?(te(bt,bt.current),te(ji,i),qi===null&&(qi=i)):Ar()}function Ar(){te(bt,bt.current),te(ji,ji.current)}function Di(i){Z(ji),qi===i&&(qi=null),Z(bt)}var bt=O(0);function Lc(i){for(var r=i;r!==null;){if(r.tag===13){var o=r.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Jf(o)||em(o)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Fs=0,Ae=null,Ze=null,Ct=null,Bc=!1,Ca=!1,En=!1,Pc=0,Vo=0,Ea=null,Ek=0;function gt(){throw Error(n(321))}function qd(i,r){if(r===null)return!1;for(var o=0;o<r.length&&o<i.length;o++)if(!ki(i[o],r[o]))return!1;return!0}function Yd(i,r,o,c,p,v){return Fs=v,Ae=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,M.H=i===null||i.memoizedState===null?_y:uf,En=!1,v=o(c,p),En=!1,Ca&&(v=B_(r,o,c,p)),L_(i),v}function L_(i){M.H=qo;var r=Ze!==null&&Ze.next!==null;if(Fs=0,Ct=Ze=Ae=null,Bc=!1,Vo=0,Ea=null,r)throw Error(n(300));i===null||Et||(i=i.dependencies,i!==null&&jc(i)&&(Et=!0))}function B_(i,r,o,c){Ae=i;var p=0;do{if(Ca&&(Ea=null),Vo=0,Ca=!1,25<=p)throw Error(n(301));if(p+=1,Ct=Ze=null,i.updateQueue!=null){var v=i.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}M.H=yy,v=r(o,c)}while(Ca);return v}function kk(){var i=M.H,r=i.useState()[0];return r=typeof r.then=="function"?Wo(r):r,i=i.useState()[0],(Ze!==null?Ze.memoizedState:null)!==i&&(Ae.flags|=1024),r}function Gd(){var i=Pc!==0;return Pc=0,i}function Xd(i,r,o){r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~o}function Zd(i){if(Bc){for(i=i.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}Bc=!1}Fs=0,Ct=Ze=Ae=null,Ca=!1,Vo=Pc=0,Ea=null}function oi(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ct===null?Ae.memoizedState=Ct=i:Ct=Ct.next=i,Ct}function xt(){if(Ze===null){var i=Ae.alternate;i=i!==null?i.memoizedState:null}else i=Ze.next;var r=Ct===null?Ae.memoizedState:Ct.next;if(r!==null)Ct=r,Ze=i;else{if(i===null)throw Ae.alternate===null?Error(n(467)):Error(n(310));Ze=i,i={memoizedState:Ze.memoizedState,baseState:Ze.baseState,baseQueue:Ze.baseQueue,queue:Ze.queue,next:null},Ct===null?Ae.memoizedState=Ct=i:Ct=Ct.next=i}return Ct}function Hc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wo(i){var r=Vo;return Vo+=1,Ea===null&&(Ea=[]),i=N_(Ea,i,r),r=Ae,(Ct===null?r.memoizedState:Ct.next)===null&&(r=r.alternate,M.H=r===null||r.memoizedState===null?_y:uf),i}function Ic(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Wo(i);if(i.$$typeof===D)return Xt(i)}throw Error(n(438,String(i)))}function Qd(i){var r=null,o=Ae.updateQueue;if(o!==null&&(r=o.memoCache),r==null){var c=Ae.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(r={data:c.data.map(function(p){return p.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),o===null&&(o=Hc(),Ae.updateQueue=o),o.memoCache=r,o=r.data[r.index],o===void 0)for(o=r.data[r.index]=Array(i),c=0;c<i;c++)o[c]=I;return r.index++,o}function Vs(i,r){return typeof r=="function"?r(i):r}function $c(i){var r=xt();return Jd(r,Ze,i)}function Jd(i,r,o){var c=i.queue;if(c===null)throw Error(n(311));c.lastRenderedReducer=o;var p=i.baseQueue,v=c.pending;if(v!==null){if(p!==null){var C=p.next;p.next=v.next,v.next=C}r.baseQueue=p=v,c.pending=null}if(v=i.baseState,p===null)i.memoizedState=v;else{r=p.next;var N=C=null,P=null,X=r,ie=!1;do{var re=X.lane&-536870913;if(re!==X.lane?($e&re)===re:(Fs&re)===re){var Q=X.revertLane;if(Q===0)P!==null&&(P=P.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),re===ya&&(ie=!0);else if((Fs&Q)===Q){X=X.next,Q===ya&&(ie=!0);continue}else re={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},P===null?(N=P=re,C=v):P=P.next=re,Ae.lanes|=Q,Lr|=Q;re=X.action,En&&o(v,re),v=X.hasEagerState?X.eagerState:o(v,re)}else Q={lane:re,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},P===null?(N=P=Q,C=v):P=P.next=Q,Ae.lanes|=re,Lr|=re;X=X.next}while(X!==null&&X!==r);if(P===null?C=v:P.next=N,!ki(v,i.memoizedState)&&(Et=!0,ie&&(o=ba,o!==null)))throw o;i.memoizedState=v,i.baseState=C,i.baseQueue=P,c.lastRenderedState=v}return p===null&&(c.lanes=0),[i.memoizedState,c.dispatch]}function ef(i){var r=xt(),o=r.queue;if(o===null)throw Error(n(311));o.lastRenderedReducer=i;var c=o.dispatch,p=o.pending,v=r.memoizedState;if(p!==null){o.pending=null;var C=p=p.next;do v=i(v,C.action),C=C.next;while(C!==p);ki(v,r.memoizedState)||(Et=!0),r.memoizedState=v,r.baseQueue===null&&(r.baseState=v),o.lastRenderedState=v}return[v,c]}function P_(i,r,o){var c=Ae,p=xt(),v=Fe;if(v){if(o===void 0)throw Error(n(407));o=o()}else o=r();var C=!ki((Ze||p).memoizedState,o);if(C&&(p.memoizedState=o,Et=!0),p=p.queue,rf($_.bind(null,c,p,i),[i]),p.getSnapshot!==r||C||Ct!==null&&Ct.memoizedState.tag&1){if(c.flags|=2048,ka(9,{destroy:void 0},I_.bind(null,c,p,o,r),null),tt===null)throw Error(n(349));v||(Fs&127)!==0||H_(c,r,o)}return o}function H_(i,r,o){i.flags|=16384,i={getSnapshot:r,value:o},r=Ae.updateQueue,r===null?(r=Hc(),Ae.updateQueue=r,r.stores=[i]):(o=r.stores,o===null?r.stores=[i]:o.push(i))}function I_(i,r,o,c){r.value=o,r.getSnapshot=c,U_(r)&&F_(i)}function $_(i,r,o){return o(function(){U_(r)&&F_(i)})}function U_(i){var r=i.getSnapshot;i=i.value;try{var o=r();return!ki(i,o)}catch{return!0}}function F_(i){var r=gn(i,2);r!==null&&bi(r,i,2)}function tf(i){var r=oi();if(typeof i=="function"){var o=i;if(i=o(),En){Sr(!0);try{o()}finally{Sr(!1)}}}return r.memoizedState=r.baseState=i,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vs,lastRenderedState:i},r}function V_(i,r,o,c){return i.baseState=o,Jd(i,Ze,typeof c=="function"?c:Vs)}function Nk(i,r,o,c,p){if(Vc(i))throw Error(n(485));if(i=r.action,i!==null){var v={payload:p,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){v.listeners.push(C)}};M.T!==null?o(!0):v.isTransition=!1,c(v),o=r.pending,o===null?(v.next=r.pending=v,W_(r,v)):(v.next=o.next,r.pending=o.next=v)}}function W_(i,r){var o=r.action,c=r.payload,p=i.state;if(r.isTransition){var v=M.T,C={};M.T=C;try{var N=o(p,c),P=M.S;P!==null&&P(C,N),K_(i,r,N)}catch(X){sf(i,r,X)}finally{v!==null&&C.types!==null&&(v.types=C.types),M.T=v}}else try{v=o(p,c),K_(i,r,v)}catch(X){sf(i,r,X)}}function K_(i,r,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(c){q_(i,r,c)},function(c){return sf(i,r,c)}):q_(i,r,o)}function q_(i,r,o){r.status="fulfilled",r.value=o,Y_(r),i.state=o,r=i.pending,r!==null&&(o=r.next,o===r?i.pending=null:(o=o.next,r.next=o,W_(i,o)))}function sf(i,r,o){var c=i.pending;if(i.pending=null,c!==null){c=c.next;do r.status="rejected",r.reason=o,Y_(r),r=r.next;while(r!==c)}i.action=null}function Y_(i){i=i.listeners;for(var r=0;r<i.length;r++)(0,i[r])()}function G_(i,r){return r}function X_(i,r){if(Fe){var o=tt.formState;if(o!==null){e:{var c=Ae;if(Fe){if(nt){t:{for(var p=nt,v=Ki;p.nodeType!==8;){if(!v){p=null;break t}if(p=Yi(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){nt=Yi(p.nextSibling),c=p.data==="F!";break e}}Nr(c)}c=!1}c&&(r=o[0])}}return o=oi(),o.memoizedState=o.baseState=r,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:G_,lastRenderedState:r},o.queue=c,o=py.bind(null,Ae,c),c.dispatch=o,c=tf(!1),v=cf.bind(null,Ae,!1,c.queue),c=oi(),p={state:r,dispatch:null,action:i,pending:null},c.queue=p,o=Nk.bind(null,Ae,p,v,o),p.dispatch=o,c.memoizedState=i,[r,o,!1]}function Z_(i){var r=xt();return Q_(r,Ze,i)}function Q_(i,r,o){if(r=Jd(i,r,G_)[0],i=$c(Vs)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var c=Wo(r)}catch(C){throw C===xa?Rc:C}else c=r;r=xt();var p=r.queue,v=p.dispatch;return o!==r.memoizedState&&(Ae.flags|=2048,ka(9,{destroy:void 0},jk.bind(null,p,o),null)),[c,v,i]}function jk(i,r){i.action=r}function J_(i){var r=xt(),o=Ze;if(o!==null)return Q_(r,o,i);xt(),r=r.memoizedState,o=xt();var c=o.queue.dispatch;return o.memoizedState=i,[r,c,!1]}function ka(i,r,o,c){return i={tag:i,create:o,deps:c,inst:r,next:null},r=Ae.updateQueue,r===null&&(r=Hc(),Ae.updateQueue=r),o=r.lastEffect,o===null?r.lastEffect=i.next=i:(c=o.next,o.next=i,i.next=c,r.lastEffect=i),i}function ey(){return xt().memoizedState}function Uc(i,r,o,c){var p=oi();Ae.flags|=i,p.memoizedState=ka(1|r,{destroy:void 0},o,c===void 0?null:c)}function Fc(i,r,o,c){var p=xt();c=c===void 0?null:c;var v=p.memoizedState.inst;Ze!==null&&c!==null&&qd(c,Ze.memoizedState.deps)?p.memoizedState=ka(r,v,o,c):(Ae.flags|=i,p.memoizedState=ka(1|r,v,o,c))}function ty(i,r){Uc(8390656,8,i,r)}function rf(i,r){Fc(2048,8,i,r)}function Dk(i){Ae.flags|=4;var r=Ae.updateQueue;if(r===null)r=Hc(),Ae.updateQueue=r,r.events=[i];else{var o=r.events;o===null?r.events=[i]:o.push(i)}}function iy(i){var r=xt().memoizedState;return Dk({ref:r,nextImpl:i}),function(){if((Ke&2)!==0)throw Error(n(440));return r.impl.apply(void 0,arguments)}}function sy(i,r){return Fc(4,2,i,r)}function ry(i,r){return Fc(4,4,i,r)}function ny(i,r){if(typeof r=="function"){i=i();var o=r(i);return function(){typeof o=="function"?o():r(null)}}if(r!=null)return i=i(),r.current=i,function(){r.current=null}}function ay(i,r,o){o=o!=null?o.concat([i]):null,Fc(4,4,ny.bind(null,r,i),o)}function nf(){}function oy(i,r){var o=xt();r=r===void 0?null:r;var c=o.memoizedState;return r!==null&&qd(r,c[1])?c[0]:(o.memoizedState=[i,r],i)}function ly(i,r){var o=xt();r=r===void 0?null:r;var c=o.memoizedState;if(r!==null&&qd(r,c[1]))return c[0];if(c=i(),En){Sr(!0);try{i()}finally{Sr(!1)}}return o.memoizedState=[c,r],c}function af(i,r,o){return o===void 0||(Fs&1073741824)!==0&&($e&261930)===0?i.memoizedState=r:(i.memoizedState=o,i=c0(),Ae.lanes|=i,Lr|=i,o)}function cy(i,r,o,c){return ki(o,r)?o:wa.current!==null?(i=af(i,o,c),ki(i,r)||(Et=!0),i):(Fs&42)===0||(Fs&1073741824)!==0&&($e&261930)===0?(Et=!0,i.memoizedState=o):(i=c0(),Ae.lanes|=i,Lr|=i,r)}function uy(i,r,o,c,p){var v=H.p;H.p=v!==0&&8>v?v:8;var C=M.T,N={};M.T=N,cf(i,!1,r,o);try{var P=p(),X=M.S;if(X!==null&&X(N,P),P!==null&&typeof P=="object"&&typeof P.then=="function"){var ie=Ck(P,c);Ko(i,r,ie,Mi(i))}else Ko(i,r,c,Mi(i))}catch(re){Ko(i,r,{then:function(){},status:"rejected",reason:re},Mi())}finally{H.p=v,C!==null&&N.types!==null&&(C.types=N.types),M.T=C}}function Tk(){}function of(i,r,o,c){if(i.tag!==5)throw Error(n(476));var p=hy(i).queue;uy(i,p,r,U,o===null?Tk:function(){return dy(i),o(c)})}function hy(i){var r=i.memoizedState;if(r!==null)return r;r={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vs,lastRenderedState:U},next:null};var o={};return r.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vs,lastRenderedState:o},next:null},i.memoizedState=r,i=i.alternate,i!==null&&(i.memoizedState=r),r}function dy(i){var r=hy(i);r.next===null&&(r=i.alternate.memoizedState),Ko(i,r.next.queue,{},Mi())}function lf(){return Xt(cl)}function fy(){return xt().memoizedState}function my(){return xt().memoizedState}function Rk(i){for(var r=i.return;r!==null;){switch(r.tag){case 24:case 3:var o=Mi();i=Tr(o);var c=Rr(r,i,o);c!==null&&(bi(c,r,o),$o(c,r,o)),r={cache:Ld()},i.payload=r;return}r=r.return}}function Mk(i,r,o){var c=Mi();o={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Vc(i)?gy(r,o):(o=Ed(i,r,o,c),o!==null&&(bi(o,i,c),vy(o,r,c)))}function py(i,r,o){var c=Mi();Ko(i,r,o,c)}function Ko(i,r,o,c){var p={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Vc(i))gy(r,p);else{var v=i.alternate;if(i.lanes===0&&(v===null||v.lanes===0)&&(v=r.lastRenderedReducer,v!==null))try{var C=r.lastRenderedState,N=v(C,o);if(p.hasEagerState=!0,p.eagerState=N,ki(N,C))return Cc(i,r,p,0),tt===null&&wc(),!1}catch{}finally{}if(o=Ed(i,r,p,c),o!==null)return bi(o,i,c),vy(o,r,c),!0}return!1}function cf(i,r,o,c){if(c={lane:2,revertLane:$f(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Vc(i)){if(r)throw Error(n(479))}else r=Ed(i,o,c,2),r!==null&&bi(r,i,2)}function Vc(i){var r=i.alternate;return i===Ae||r!==null&&r===Ae}function gy(i,r){Ca=Bc=!0;var o=i.pending;o===null?r.next=r:(r.next=o.next,o.next=r),i.pending=r}function vy(i,r,o){if((o&4194048)!==0){var c=r.lanes;c&=i.pendingLanes,o|=c,r.lanes=o,Sv(i,o)}}var qo={readContext:Xt,use:Ic,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};qo.useEffectEvent=gt;var _y={readContext:Xt,use:Ic,useCallback:function(i,r){return oi().memoizedState=[i,r===void 0?null:r],i},useContext:Xt,useEffect:ty,useImperativeHandle:function(i,r,o){o=o!=null?o.concat([i]):null,Uc(4194308,4,ny.bind(null,r,i),o)},useLayoutEffect:function(i,r){return Uc(4194308,4,i,r)},useInsertionEffect:function(i,r){Uc(4,2,i,r)},useMemo:function(i,r){var o=oi();r=r===void 0?null:r;var c=i();if(En){Sr(!0);try{i()}finally{Sr(!1)}}return o.memoizedState=[c,r],c},useReducer:function(i,r,o){var c=oi();if(o!==void 0){var p=o(r);if(En){Sr(!0);try{o(r)}finally{Sr(!1)}}}else p=r;return c.memoizedState=c.baseState=p,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:p},c.queue=i,i=i.dispatch=Mk.bind(null,Ae,i),[c.memoizedState,i]},useRef:function(i){var r=oi();return i={current:i},r.memoizedState=i},useState:function(i){i=tf(i);var r=i.queue,o=py.bind(null,Ae,r);return r.dispatch=o,[i.memoizedState,o]},useDebugValue:nf,useDeferredValue:function(i,r){var o=oi();return af(o,i,r)},useTransition:function(){var i=tf(!1);return i=uy.bind(null,Ae,i.queue,!0,!1),oi().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,r,o){var c=Ae,p=oi();if(Fe){if(o===void 0)throw Error(n(407));o=o()}else{if(o=r(),tt===null)throw Error(n(349));($e&127)!==0||H_(c,r,o)}p.memoizedState=o;var v={value:o,getSnapshot:r};return p.queue=v,ty($_.bind(null,c,v,i),[i]),c.flags|=2048,ka(9,{destroy:void 0},I_.bind(null,c,v,o,r),null),o},useId:function(){var i=oi(),r=tt.identifierPrefix;if(Fe){var o=ps,c=ms;o=(c&~(1<<32-Ei(c)-1)).toString(32)+o,r="_"+r+"R_"+o,o=Pc++,0<o&&(r+="H"+o.toString(32)),r+="_"}else o=Ek++,r="_"+r+"r_"+o.toString(32)+"_";return i.memoizedState=r},useHostTransitionStatus:lf,useFormState:X_,useActionState:X_,useOptimistic:function(i){var r=oi();r.memoizedState=r.baseState=i;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=o,r=cf.bind(null,Ae,!0,o),o.dispatch=r,[i,r]},useMemoCache:Qd,useCacheRefresh:function(){return oi().memoizedState=Rk.bind(null,Ae)},useEffectEvent:function(i){var r=oi(),o={impl:i};return r.memoizedState=o,function(){if((Ke&2)!==0)throw Error(n(440));return o.impl.apply(void 0,arguments)}}},uf={readContext:Xt,use:Ic,useCallback:oy,useContext:Xt,useEffect:rf,useImperativeHandle:ay,useInsertionEffect:sy,useLayoutEffect:ry,useMemo:ly,useReducer:$c,useRef:ey,useState:function(){return $c(Vs)},useDebugValue:nf,useDeferredValue:function(i,r){var o=xt();return cy(o,Ze.memoizedState,i,r)},useTransition:function(){var i=$c(Vs)[0],r=xt().memoizedState;return[typeof i=="boolean"?i:Wo(i),r]},useSyncExternalStore:P_,useId:fy,useHostTransitionStatus:lf,useFormState:Z_,useActionState:Z_,useOptimistic:function(i,r){var o=xt();return V_(o,Ze,i,r)},useMemoCache:Qd,useCacheRefresh:my};uf.useEffectEvent=iy;var yy={readContext:Xt,use:Ic,useCallback:oy,useContext:Xt,useEffect:rf,useImperativeHandle:ay,useInsertionEffect:sy,useLayoutEffect:ry,useMemo:ly,useReducer:ef,useRef:ey,useState:function(){return ef(Vs)},useDebugValue:nf,useDeferredValue:function(i,r){var o=xt();return Ze===null?af(o,i,r):cy(o,Ze.memoizedState,i,r)},useTransition:function(){var i=ef(Vs)[0],r=xt().memoizedState;return[typeof i=="boolean"?i:Wo(i),r]},useSyncExternalStore:P_,useId:fy,useHostTransitionStatus:lf,useFormState:J_,useActionState:J_,useOptimistic:function(i,r){var o=xt();return Ze!==null?V_(o,Ze,i,r):(o.baseState=i,[i,o.queue.dispatch])},useMemoCache:Qd,useCacheRefresh:my};yy.useEffectEvent=iy;function hf(i,r,o,c){r=i.memoizedState,o=o(c,r),o=o==null?r:g({},r,o),i.memoizedState=o,i.lanes===0&&(i.updateQueue.baseState=o)}var df={enqueueSetState:function(i,r,o){i=i._reactInternals;var c=Mi(),p=Tr(c);p.payload=r,o!=null&&(p.callback=o),r=Rr(i,p,c),r!==null&&(bi(r,i,c),$o(r,i,c))},enqueueReplaceState:function(i,r,o){i=i._reactInternals;var c=Mi(),p=Tr(c);p.tag=1,p.payload=r,o!=null&&(p.callback=o),r=Rr(i,p,c),r!==null&&(bi(r,i,c),$o(r,i,c))},enqueueForceUpdate:function(i,r){i=i._reactInternals;var o=Mi(),c=Tr(o);c.tag=2,r!=null&&(c.callback=r),r=Rr(i,c,o),r!==null&&(bi(r,i,o),$o(r,i,o))}};function by(i,r,o,c,p,v,C){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(c,v,C):r.prototype&&r.prototype.isPureReactComponent?!Ao(o,c)||!Ao(p,v):!0}function xy(i,r,o,c){i=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(o,c),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(o,c),r.state!==i&&df.enqueueReplaceState(r,r.state,null)}function kn(i,r){var o=r;if("ref"in r){o={};for(var c in r)c!=="ref"&&(o[c]=r[c])}if(i=i.defaultProps){o===r&&(o=g({},o));for(var p in i)o[p]===void 0&&(o[p]=i[p])}return o}function Sy(i){Sc(i)}function wy(i){console.error(i)}function Cy(i){Sc(i)}function Wc(i,r){try{var o=i.onUncaughtError;o(r.value,{componentStack:r.stack})}catch(c){setTimeout(function(){throw c})}}function Ey(i,r,o){try{var c=i.onCaughtError;c(o.value,{componentStack:o.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function ff(i,r,o){return o=Tr(o),o.tag=3,o.payload={element:null},o.callback=function(){Wc(i,r)},o}function ky(i){return i=Tr(i),i.tag=3,i}function Ny(i,r,o,c){var p=o.type.getDerivedStateFromError;if(typeof p=="function"){var v=c.value;i.payload=function(){return p(v)},i.callback=function(){Ey(r,o,c)}}var C=o.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(i.callback=function(){Ey(r,o,c),typeof p!="function"&&(Br===null?Br=new Set([this]):Br.add(this));var N=c.stack;this.componentDidCatch(c.value,{componentStack:N!==null?N:""})})}function Ak(i,r,o,c,p){if(o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(r=o.alternate,r!==null&&_a(r,o,p,!0),o=ji.current,o!==null){switch(o.tag){case 31:case 13:return qi===null?su():o.alternate===null&&vt===0&&(vt=3),o.flags&=-257,o.flags|=65536,o.lanes=p,c===Mc?o.flags|=16384:(r=o.updateQueue,r===null?o.updateQueue=new Set([c]):r.add(c),Pf(i,c,p)),!1;case 22:return o.flags|=65536,c===Mc?o.flags|=16384:(r=o.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([c])},o.updateQueue=r):(o=r.retryQueue,o===null?r.retryQueue=new Set([c]):o.add(c)),Pf(i,c,p)),!1}throw Error(n(435,o.tag))}return Pf(i,c,p),su(),!1}if(Fe)return r=ji.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,c!==Rd&&(i=Error(n(422),{cause:c}),Lo(Fi(i,o)))):(c!==Rd&&(r=Error(n(423),{cause:c}),Lo(Fi(r,o))),i=i.current.alternate,i.flags|=65536,p&=-p,i.lanes|=p,c=Fi(c,o),p=ff(i.stateNode,c,p),Ud(i,p),vt!==4&&(vt=2)),!1;var v=Error(n(520),{cause:c});if(v=Fi(v,o),tl===null?tl=[v]:tl.push(v),vt!==4&&(vt=2),r===null)return!0;c=Fi(c,o),o=r;do{switch(o.tag){case 3:return o.flags|=65536,i=p&-p,o.lanes|=i,i=ff(o.stateNode,c,i),Ud(o,i),!1;case 1:if(r=o.type,v=o.stateNode,(o.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Br===null||!Br.has(v))))return o.flags|=65536,p&=-p,o.lanes|=p,p=ky(p),Ny(p,i,o,c),Ud(o,p),!1}o=o.return}while(o!==null);return!1}var mf=Error(n(461)),Et=!1;function Zt(i,r,o,c){r.child=i===null?R_(r,null,o,c):Cn(r,i.child,o,c)}function jy(i,r,o,c,p){o=o.render;var v=r.ref;if("ref"in c){var C={};for(var N in c)N!=="ref"&&(C[N]=c[N])}else C=c;return bn(r),c=Yd(i,r,o,C,v,p),N=Gd(),i!==null&&!Et?(Xd(i,r,p),Ws(i,r,p)):(Fe&&N&&Dd(r),r.flags|=1,Zt(i,r,c,p),r.child)}function Dy(i,r,o,c,p){if(i===null){var v=o.type;return typeof v=="function"&&!kd(v)&&v.defaultProps===void 0&&o.compare===null?(r.tag=15,r.type=v,Ty(i,r,v,c,p)):(i=kc(o.type,null,c,r,r.mode,p),i.ref=r.ref,i.return=r,r.child=i)}if(v=i.child,!Sf(i,p)){var C=v.memoizedProps;if(o=o.compare,o=o!==null?o:Ao,o(C,c)&&i.ref===r.ref)return Ws(i,r,p)}return r.flags|=1,i=Hs(v,c),i.ref=r.ref,i.return=r,r.child=i}function Ty(i,r,o,c,p){if(i!==null){var v=i.memoizedProps;if(Ao(v,c)&&i.ref===r.ref)if(Et=!1,r.pendingProps=c=v,Sf(i,p))(i.flags&131072)!==0&&(Et=!0);else return r.lanes=i.lanes,Ws(i,r,p)}return pf(i,r,o,c,p)}function Ry(i,r,o,c){var p=c.children,v=i!==null?i.memoizedState:null;if(i===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((r.flags&128)!==0){if(v=v!==null?v.baseLanes|o:o,i!==null){for(c=r.child=i.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~v}else c=0,r.child=null;return My(i,r,v,o,c)}if((o&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},i!==null&&Tc(r,v!==null?v.cachePool:null),v!==null?O_(r,v):Vd(),z_(r);else return c=r.lanes=536870912,My(i,r,v!==null?v.baseLanes|o:o,o,c)}else v!==null?(Tc(r,v.cachePool),O_(r,v),Ar(),r.memoizedState=null):(i!==null&&Tc(r,null),Vd(),Ar());return Zt(i,r,p,o),r.child}function Yo(i,r){return i!==null&&i.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function My(i,r,o,c,p){var v=Pd();return v=v===null?null:{parent:wt._currentValue,pool:v},r.memoizedState={baseLanes:o,cachePool:v},i!==null&&Tc(r,null),Vd(),z_(r),i!==null&&_a(i,r,c,!0),r.childLanes=p,null}function Kc(i,r){return r=Yc({mode:r.mode,children:r.children},i.mode),r.ref=i.ref,i.child=r,r.return=i,r}function Ay(i,r,o){return Cn(r,i.child,null,o),i=Kc(r,r.pendingProps),i.flags|=2,Di(r),r.memoizedState=null,i}function Ok(i,r,o){var c=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,i===null){if(Fe){if(c.mode==="hidden")return i=Kc(r,c),r.lanes=536870912,Yo(null,i);if(Kd(r),(i=nt)?(i=W0(i,Ki),i=i!==null&&i.data==="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:Er!==null?{id:ms,overflow:ps}:null,retryLane:536870912,hydrationErrors:null},o=g_(i),o.return=r,r.child=o,Gt=r,nt=null)):i=null,i===null)throw Nr(r);return r.lanes=536870912,null}return Kc(r,c)}var v=i.memoizedState;if(v!==null){var C=v.dehydrated;if(Kd(r),p)if(r.flags&256)r.flags&=-257,r=Ay(i,r,o);else if(r.memoizedState!==null)r.child=i.child,r.flags|=128,r=null;else throw Error(n(558));else if(Et||_a(i,r,o,!1),p=(o&i.childLanes)!==0,Et||p){if(c=tt,c!==null&&(C=wv(c,o),C!==0&&C!==v.retryLane))throw v.retryLane=C,gn(i,C),bi(c,i,C),mf;su(),r=Ay(i,r,o)}else i=v.treeContext,nt=Yi(C.nextSibling),Gt=r,Fe=!0,kr=null,Ki=!1,i!==null&&y_(r,i),r=Kc(r,c),r.flags|=4096;return r}return i=Hs(i.child,{mode:c.mode,children:c.children}),i.ref=r.ref,r.child=i,i.return=r,i}function qc(i,r){var o=r.ref;if(o===null)i!==null&&i.ref!==null&&(r.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(n(284));(i===null||i.ref!==o)&&(r.flags|=4194816)}}function pf(i,r,o,c,p){return bn(r),o=Yd(i,r,o,c,void 0,p),c=Gd(),i!==null&&!Et?(Xd(i,r,p),Ws(i,r,p)):(Fe&&c&&Dd(r),r.flags|=1,Zt(i,r,o,p),r.child)}function Oy(i,r,o,c,p,v){return bn(r),r.updateQueue=null,o=B_(r,c,o,p),L_(i),c=Gd(),i!==null&&!Et?(Xd(i,r,v),Ws(i,r,v)):(Fe&&c&&Dd(r),r.flags|=1,Zt(i,r,o,v),r.child)}function zy(i,r,o,c,p){if(bn(r),r.stateNode===null){var v=ma,C=o.contextType;typeof C=="object"&&C!==null&&(v=Xt(C)),v=new o(c,v),r.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=df,r.stateNode=v,v._reactInternals=r,v=r.stateNode,v.props=c,v.state=r.memoizedState,v.refs={},Id(r),C=o.contextType,v.context=typeof C=="object"&&C!==null?Xt(C):ma,v.state=r.memoizedState,C=o.getDerivedStateFromProps,typeof C=="function"&&(hf(r,o,C,c),v.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(C=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),C!==v.state&&df.enqueueReplaceState(v,v.state,null),Fo(r,c,v,p),Uo(),v.state=r.memoizedState),typeof v.componentDidMount=="function"&&(r.flags|=4194308),c=!0}else if(i===null){v=r.stateNode;var N=r.memoizedProps,P=kn(o,N);v.props=P;var X=v.context,ie=o.contextType;C=ma,typeof ie=="object"&&ie!==null&&(C=Xt(ie));var re=o.getDerivedStateFromProps;ie=typeof re=="function"||typeof v.getSnapshotBeforeUpdate=="function",N=r.pendingProps!==N,ie||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N||X!==C)&&xy(r,v,c,C),Dr=!1;var Q=r.memoizedState;v.state=Q,Fo(r,c,v,p),Uo(),X=r.memoizedState,N||Q!==X||Dr?(typeof re=="function"&&(hf(r,o,re,c),X=r.memoizedState),(P=Dr||by(r,o,P,c,Q,X,C))?(ie||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(r.flags|=4194308)):(typeof v.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=c,r.memoizedState=X),v.props=c,v.state=X,v.context=C,c=P):(typeof v.componentDidMount=="function"&&(r.flags|=4194308),c=!1)}else{v=r.stateNode,$d(i,r),C=r.memoizedProps,ie=kn(o,C),v.props=ie,re=r.pendingProps,Q=v.context,X=o.contextType,P=ma,typeof X=="object"&&X!==null&&(P=Xt(X)),N=o.getDerivedStateFromProps,(X=typeof N=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(C!==re||Q!==P)&&xy(r,v,c,P),Dr=!1,Q=r.memoizedState,v.state=Q,Fo(r,c,v,p),Uo();var ee=r.memoizedState;C!==re||Q!==ee||Dr||i!==null&&i.dependencies!==null&&jc(i.dependencies)?(typeof N=="function"&&(hf(r,o,N,c),ee=r.memoizedState),(ie=Dr||by(r,o,ie,c,Q,ee,P)||i!==null&&i.dependencies!==null&&jc(i.dependencies))?(X||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(c,ee,P),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(c,ee,P)),typeof v.componentDidUpdate=="function"&&(r.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof v.componentDidUpdate!="function"||C===i.memoizedProps&&Q===i.memoizedState||(r.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===i.memoizedProps&&Q===i.memoizedState||(r.flags|=1024),r.memoizedProps=c,r.memoizedState=ee),v.props=c,v.state=ee,v.context=P,c=ie):(typeof v.componentDidUpdate!="function"||C===i.memoizedProps&&Q===i.memoizedState||(r.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===i.memoizedProps&&Q===i.memoizedState||(r.flags|=1024),c=!1)}return v=c,qc(i,r),c=(r.flags&128)!==0,v||c?(v=r.stateNode,o=c&&typeof o.getDerivedStateFromError!="function"?null:v.render(),r.flags|=1,i!==null&&c?(r.child=Cn(r,i.child,null,p),r.child=Cn(r,null,o,p)):Zt(i,r,o,p),r.memoizedState=v.state,i=r.child):i=Ws(i,r,p),i}function Ly(i,r,o,c){return _n(),r.flags|=256,Zt(i,r,o,c),r.child}var gf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vf(i){return{baseLanes:i,cachePool:E_()}}function _f(i,r,o){return i=i!==null?i.childLanes&~o:0,r&&(i|=Ri),i}function By(i,r,o){var c=r.pendingProps,p=!1,v=(r.flags&128)!==0,C;if((C=v)||(C=i!==null&&i.memoizedState===null?!1:(bt.current&2)!==0),C&&(p=!0,r.flags&=-129),C=(r.flags&32)!==0,r.flags&=-33,i===null){if(Fe){if(p?Mr(r):Ar(),(i=nt)?(i=W0(i,Ki),i=i!==null&&i.data!=="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:Er!==null?{id:ms,overflow:ps}:null,retryLane:536870912,hydrationErrors:null},o=g_(i),o.return=r,r.child=o,Gt=r,nt=null)):i=null,i===null)throw Nr(r);return em(i)?r.lanes=32:r.lanes=536870912,null}var N=c.children;return c=c.fallback,p?(Ar(),p=r.mode,N=Yc({mode:"hidden",children:N},p),c=vn(c,p,o,null),N.return=r,c.return=r,N.sibling=c,r.child=N,c=r.child,c.memoizedState=vf(o),c.childLanes=_f(i,C,o),r.memoizedState=gf,Yo(null,c)):(Mr(r),yf(r,N))}var P=i.memoizedState;if(P!==null&&(N=P.dehydrated,N!==null)){if(v)r.flags&256?(Mr(r),r.flags&=-257,r=bf(i,r,o)):r.memoizedState!==null?(Ar(),r.child=i.child,r.flags|=128,r=null):(Ar(),N=c.fallback,p=r.mode,c=Yc({mode:"visible",children:c.children},p),N=vn(N,p,o,null),N.flags|=2,c.return=r,N.return=r,c.sibling=N,r.child=c,Cn(r,i.child,null,o),c=r.child,c.memoizedState=vf(o),c.childLanes=_f(i,C,o),r.memoizedState=gf,r=Yo(null,c));else if(Mr(r),em(N)){if(C=N.nextSibling&&N.nextSibling.dataset,C)var X=C.dgst;C=X,c=Error(n(419)),c.stack="",c.digest=C,Lo({value:c,source:null,stack:null}),r=bf(i,r,o)}else if(Et||_a(i,r,o,!1),C=(o&i.childLanes)!==0,Et||C){if(C=tt,C!==null&&(c=wv(C,o),c!==0&&c!==P.retryLane))throw P.retryLane=c,gn(i,c),bi(C,i,c),mf;Jf(N)||su(),r=bf(i,r,o)}else Jf(N)?(r.flags|=192,r.child=i.child,r=null):(i=P.treeContext,nt=Yi(N.nextSibling),Gt=r,Fe=!0,kr=null,Ki=!1,i!==null&&y_(r,i),r=yf(r,c.children),r.flags|=4096);return r}return p?(Ar(),N=c.fallback,p=r.mode,P=i.child,X=P.sibling,c=Hs(P,{mode:"hidden",children:c.children}),c.subtreeFlags=P.subtreeFlags&65011712,X!==null?N=Hs(X,N):(N=vn(N,p,o,null),N.flags|=2),N.return=r,c.return=r,c.sibling=N,r.child=c,Yo(null,c),c=r.child,N=i.child.memoizedState,N===null?N=vf(o):(p=N.cachePool,p!==null?(P=wt._currentValue,p=p.parent!==P?{parent:P,pool:P}:p):p=E_(),N={baseLanes:N.baseLanes|o,cachePool:p}),c.memoizedState=N,c.childLanes=_f(i,C,o),r.memoizedState=gf,Yo(i.child,c)):(Mr(r),o=i.child,i=o.sibling,o=Hs(o,{mode:"visible",children:c.children}),o.return=r,o.sibling=null,i!==null&&(C=r.deletions,C===null?(r.deletions=[i],r.flags|=16):C.push(i)),r.child=o,r.memoizedState=null,o)}function yf(i,r){return r=Yc({mode:"visible",children:r},i.mode),r.return=i,i.child=r}function Yc(i,r){return i=Ni(22,i,null,r),i.lanes=0,i}function bf(i,r,o){return Cn(r,i.child,null,o),i=yf(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function Py(i,r,o){i.lanes|=r;var c=i.alternate;c!==null&&(c.lanes|=r),Od(i.return,r,o)}function xf(i,r,o,c,p,v){var C=i.memoizedState;C===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:c,tail:o,tailMode:p,treeForkCount:v}:(C.isBackwards=r,C.rendering=null,C.renderingStartTime=0,C.last=c,C.tail=o,C.tailMode=p,C.treeForkCount=v)}function Hy(i,r,o){var c=r.pendingProps,p=c.revealOrder,v=c.tail;c=c.children;var C=bt.current,N=(C&2)!==0;if(N?(C=C&1|2,r.flags|=128):C&=1,te(bt,C),Zt(i,r,c,o),c=Fe?zo:0,!N&&i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Py(i,o,r);else if(i.tag===19)Py(i,o,r);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(p){case"forwards":for(o=r.child,p=null;o!==null;)i=o.alternate,i!==null&&Lc(i)===null&&(p=o),o=o.sibling;o=p,o===null?(p=r.child,r.child=null):(p=o.sibling,o.sibling=null),xf(r,!1,p,o,v,c);break;case"backwards":case"unstable_legacy-backwards":for(o=null,p=r.child,r.child=null;p!==null;){if(i=p.alternate,i!==null&&Lc(i)===null){r.child=p;break}i=p.sibling,p.sibling=o,o=p,p=i}xf(r,!0,o,null,v,c);break;case"together":xf(r,!1,null,null,void 0,c);break;default:r.memoizedState=null}return r.child}function Ws(i,r,o){if(i!==null&&(r.dependencies=i.dependencies),Lr|=r.lanes,(o&r.childLanes)===0)if(i!==null){if(_a(i,r,o,!1),(o&r.childLanes)===0)return null}else return null;if(i!==null&&r.child!==i.child)throw Error(n(153));if(r.child!==null){for(i=r.child,o=Hs(i,i.pendingProps),r.child=o,o.return=r;i.sibling!==null;)i=i.sibling,o=o.sibling=Hs(i,i.pendingProps),o.return=r;o.sibling=null}return r.child}function Sf(i,r){return(i.lanes&r)!==0?!0:(i=i.dependencies,!!(i!==null&&jc(i)))}function zk(i,r,o){switch(r.tag){case 3:me(r,r.stateNode.containerInfo),jr(r,wt,i.memoizedState.cache),_n();break;case 27:case 5:Ce(r);break;case 4:me(r,r.stateNode.containerInfo);break;case 10:jr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Kd(r),null;break;case 13:var c=r.memoizedState;if(c!==null)return c.dehydrated!==null?(Mr(r),r.flags|=128,null):(o&r.child.childLanes)!==0?By(i,r,o):(Mr(r),i=Ws(i,r,o),i!==null?i.sibling:null);Mr(r);break;case 19:var p=(i.flags&128)!==0;if(c=(o&r.childLanes)!==0,c||(_a(i,r,o,!1),c=(o&r.childLanes)!==0),p){if(c)return Hy(i,r,o);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),te(bt,bt.current),c)break;return null;case 22:return r.lanes=0,Ry(i,r,o,r.pendingProps);case 24:jr(r,wt,i.memoizedState.cache)}return Ws(i,r,o)}function Iy(i,r,o){if(i!==null)if(i.memoizedProps!==r.pendingProps)Et=!0;else{if(!Sf(i,o)&&(r.flags&128)===0)return Et=!1,zk(i,r,o);Et=(i.flags&131072)!==0}else Et=!1,Fe&&(r.flags&1048576)!==0&&__(r,zo,r.index);switch(r.lanes=0,r.tag){case 16:e:{var c=r.pendingProps;if(i=Sn(r.elementType),r.type=i,typeof i=="function")kd(i)?(c=kn(i,c),r.tag=1,r=zy(null,r,i,c,o)):(r.tag=0,r=pf(null,r,i,c,o));else{if(i!=null){var p=i.$$typeof;if(p===R){r.tag=11,r=jy(null,r,i,c,o);break e}else if(p===j){r.tag=14,r=Dy(null,r,i,c,o);break e}}throw r=K(i)||i,Error(n(306,r,""))}}return r;case 0:return pf(i,r,r.type,r.pendingProps,o);case 1:return c=r.type,p=kn(c,r.pendingProps),zy(i,r,c,p,o);case 3:e:{if(me(r,r.stateNode.containerInfo),i===null)throw Error(n(387));c=r.pendingProps;var v=r.memoizedState;p=v.element,$d(i,r),Fo(r,c,null,o);var C=r.memoizedState;if(c=C.cache,jr(r,wt,c),c!==v.cache&&zd(r,[wt],o,!0),Uo(),c=C.element,v.isDehydrated)if(v={element:c,isDehydrated:!1,cache:C.cache},r.updateQueue.baseState=v,r.memoizedState=v,r.flags&256){r=Ly(i,r,c,o);break e}else if(c!==p){p=Fi(Error(n(424)),r),Lo(p),r=Ly(i,r,c,o);break e}else{switch(i=r.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(nt=Yi(i.firstChild),Gt=r,Fe=!0,kr=null,Ki=!0,o=R_(r,null,c,o),r.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(_n(),c===p){r=Ws(i,r,o);break e}Zt(i,r,c,o)}r=r.child}return r;case 26:return qc(i,r),i===null?(o=Z0(r.type,null,r.pendingProps,null))?r.memoizedState=o:Fe||(o=r.type,i=r.pendingProps,c=uu(he.current).createElement(o),c[Yt]=r,c[mi]=i,Qt(c,o,i),Pt(c),r.stateNode=c):r.memoizedState=Z0(r.type,i.memoizedProps,r.pendingProps,i.memoizedState),null;case 27:return Ce(r),i===null&&Fe&&(c=r.stateNode=Y0(r.type,r.pendingProps,he.current),Gt=r,Ki=!0,p=nt,$r(r.type)?(tm=p,nt=Yi(c.firstChild)):nt=p),Zt(i,r,r.pendingProps.children,o),qc(i,r),i===null&&(r.flags|=4194304),r.child;case 5:return i===null&&Fe&&((p=c=nt)&&(c=hN(c,r.type,r.pendingProps,Ki),c!==null?(r.stateNode=c,Gt=r,nt=Yi(c.firstChild),Ki=!1,p=!0):p=!1),p||Nr(r)),Ce(r),p=r.type,v=r.pendingProps,C=i!==null?i.memoizedProps:null,c=v.children,Xf(p,v)?c=null:C!==null&&Xf(p,C)&&(r.flags|=32),r.memoizedState!==null&&(p=Yd(i,r,kk,null,null,o),cl._currentValue=p),qc(i,r),Zt(i,r,c,o),r.child;case 6:return i===null&&Fe&&((i=o=nt)&&(o=dN(o,r.pendingProps,Ki),o!==null?(r.stateNode=o,Gt=r,nt=null,i=!0):i=!1),i||Nr(r)),null;case 13:return By(i,r,o);case 4:return me(r,r.stateNode.containerInfo),c=r.pendingProps,i===null?r.child=Cn(r,null,c,o):Zt(i,r,c,o),r.child;case 11:return jy(i,r,r.type,r.pendingProps,o);case 7:return Zt(i,r,r.pendingProps,o),r.child;case 8:return Zt(i,r,r.pendingProps.children,o),r.child;case 12:return Zt(i,r,r.pendingProps.children,o),r.child;case 10:return c=r.pendingProps,jr(r,r.type,c.value),Zt(i,r,c.children,o),r.child;case 9:return p=r.type._context,c=r.pendingProps.children,bn(r),p=Xt(p),c=c(p),r.flags|=1,Zt(i,r,c,o),r.child;case 14:return Dy(i,r,r.type,r.pendingProps,o);case 15:return Ty(i,r,r.type,r.pendingProps,o);case 19:return Hy(i,r,o);case 31:return Ok(i,r,o);case 22:return Ry(i,r,o,r.pendingProps);case 24:return bn(r),c=Xt(wt),i===null?(p=Pd(),p===null&&(p=tt,v=Ld(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=o),p=v),r.memoizedState={parent:c,cache:p},Id(r),jr(r,wt,p)):((i.lanes&o)!==0&&($d(i,r),Fo(r,null,null,o),Uo()),p=i.memoizedState,v=r.memoizedState,p.parent!==c?(p={parent:c,cache:c},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),jr(r,wt,c)):(c=v.cache,jr(r,wt,c),c!==p.cache&&zd(r,[wt],o,!0))),Zt(i,r,r.pendingProps.children,o),r.child;case 29:throw r.pendingProps}throw Error(n(156,r.tag))}function Ks(i){i.flags|=4}function wf(i,r,o,c,p){if((r=(i.mode&32)!==0)&&(r=!1),r){if(i.flags|=16777216,(p&335544128)===p)if(i.stateNode.complete)i.flags|=8192;else if(f0())i.flags|=8192;else throw wn=Mc,Hd}else i.flags&=-16777217}function $y(i,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!ib(r))if(f0())i.flags|=8192;else throw wn=Mc,Hd}function Gc(i,r){r!==null&&(i.flags|=4),i.flags&16384&&(r=i.tag!==22?bv():536870912,i.lanes|=r,Ta|=r)}function Go(i,r){if(!Fe)switch(i.tailMode){case"hidden":r=i.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?i.tail=null:o.sibling=null;break;case"collapsed":o=i.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?r||i.tail===null?i.tail=null:i.tail.sibling=null:c.sibling=null}}function at(i){var r=i.alternate!==null&&i.alternate.child===i.child,o=0,c=0;if(r)for(var p=i.child;p!==null;)o|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=i,p=p.sibling;else for(p=i.child;p!==null;)o|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=i,p=p.sibling;return i.subtreeFlags|=c,i.childLanes=o,r}function Lk(i,r,o){var c=r.pendingProps;switch(Td(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return at(r),null;case 1:return at(r),null;case 3:return o=r.stateNode,c=null,i!==null&&(c=i.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),Us(wt),le(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(i===null||i.child===null)&&(va(r)?Ks(r):i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Md())),at(r),null;case 26:var p=r.type,v=r.memoizedState;return i===null?(Ks(r),v!==null?(at(r),$y(r,v)):(at(r),wf(r,p,null,c,o))):v?v!==i.memoizedState?(Ks(r),at(r),$y(r,v)):(at(r),r.flags&=-16777217):(i=i.memoizedProps,i!==c&&Ks(r),at(r),wf(r,p,i,c,o)),null;case 27:if(je(r),o=he.current,p=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==c&&Ks(r);else{if(!c){if(r.stateNode===null)throw Error(n(166));return at(r),null}i=oe.current,va(r)?b_(r):(i=Y0(p,c,o),r.stateNode=i,Ks(r))}return at(r),null;case 5:if(je(r),p=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==c&&Ks(r);else{if(!c){if(r.stateNode===null)throw Error(n(166));return at(r),null}if(v=oe.current,va(r))b_(r);else{var C=uu(he.current);switch(v){case 1:v=C.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=C.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=C.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=C.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=C.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof c.is=="string"?C.createElement("select",{is:c.is}):C.createElement("select"),c.multiple?v.multiple=!0:c.size&&(v.size=c.size);break;default:v=typeof c.is=="string"?C.createElement(p,{is:c.is}):C.createElement(p)}}v[Yt]=r,v[mi]=c;e:for(C=r.child;C!==null;){if(C.tag===5||C.tag===6)v.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===r)break e;for(;C.sibling===null;){if(C.return===null||C.return===r)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}r.stateNode=v;e:switch(Qt(v,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Ks(r)}}return at(r),wf(r,r.type,i===null?null:i.memoizedProps,r.pendingProps,o),null;case 6:if(i&&r.stateNode!=null)i.memoizedProps!==c&&Ks(r);else{if(typeof c!="string"&&r.stateNode===null)throw Error(n(166));if(i=he.current,va(r)){if(i=r.stateNode,o=r.memoizedProps,c=null,p=Gt,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}i[Yt]=r,i=!!(i.nodeValue===o||c!==null&&c.suppressHydrationWarning===!0||B0(i.nodeValue,o)),i||Nr(r,!0)}else i=uu(i).createTextNode(c),i[Yt]=r,r.stateNode=i}return at(r),null;case 31:if(o=r.memoizedState,i===null||i.memoizedState!==null){if(c=va(r),o!==null){if(i===null){if(!c)throw Error(n(318));if(i=r.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(557));i[Yt]=r}else _n(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;at(r),i=!1}else o=Md(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=o),i=!0;if(!i)return r.flags&256?(Di(r),r):(Di(r),null);if((r.flags&128)!==0)throw Error(n(558))}return at(r),null;case 13:if(c=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(p=va(r),c!==null&&c.dehydrated!==null){if(i===null){if(!p)throw Error(n(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(n(317));p[Yt]=r}else _n(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;at(r),p=!1}else p=Md(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(Di(r),r):(Di(r),null)}return Di(r),(r.flags&128)!==0?(r.lanes=o,r):(o=c!==null,i=i!==null&&i.memoizedState!==null,o&&(c=r.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),v=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),v!==p&&(c.flags|=2048)),o!==i&&o&&(r.child.flags|=8192),Gc(r,r.updateQueue),at(r),null);case 4:return le(),i===null&&Wf(r.stateNode.containerInfo),at(r),null;case 10:return Us(r.type),at(r),null;case 19:if(Z(bt),c=r.memoizedState,c===null)return at(r),null;if(p=(r.flags&128)!==0,v=c.rendering,v===null)if(p)Go(c,!1);else{if(vt!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(v=Lc(i),v!==null){for(r.flags|=128,Go(c,!1),i=v.updateQueue,r.updateQueue=i,Gc(r,i),r.subtreeFlags=0,i=o,o=r.child;o!==null;)p_(o,i),o=o.sibling;return te(bt,bt.current&1|2),Fe&&Is(r,c.treeForkCount),r.child}i=i.sibling}c.tail!==null&&Ye()>eu&&(r.flags|=128,p=!0,Go(c,!1),r.lanes=4194304)}else{if(!p)if(i=Lc(v),i!==null){if(r.flags|=128,p=!0,i=i.updateQueue,r.updateQueue=i,Gc(r,i),Go(c,!0),c.tail===null&&c.tailMode==="hidden"&&!v.alternate&&!Fe)return at(r),null}else 2*Ye()-c.renderingStartTime>eu&&o!==536870912&&(r.flags|=128,p=!0,Go(c,!1),r.lanes=4194304);c.isBackwards?(v.sibling=r.child,r.child=v):(i=c.last,i!==null?i.sibling=v:r.child=v,c.last=v)}return c.tail!==null?(i=c.tail,c.rendering=i,c.tail=i.sibling,c.renderingStartTime=Ye(),i.sibling=null,o=bt.current,te(bt,p?o&1|2:o&1),Fe&&Is(r,c.treeForkCount),i):(at(r),null);case 22:case 23:return Di(r),Wd(),c=r.memoizedState!==null,i!==null?i.memoizedState!==null!==c&&(r.flags|=8192):c&&(r.flags|=8192),c?(o&536870912)!==0&&(r.flags&128)===0&&(at(r),r.subtreeFlags&6&&(r.flags|=8192)):at(r),o=r.updateQueue,o!==null&&Gc(r,o.retryQueue),o=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),c=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),c!==o&&(r.flags|=2048),i!==null&&Z(xn),null;case 24:return o=null,i!==null&&(o=i.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),Us(wt),at(r),null;case 25:return null;case 30:return null}throw Error(n(156,r.tag))}function Bk(i,r){switch(Td(r),r.tag){case 1:return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return Us(wt),le(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 26:case 27:case 5:return je(r),null;case 31:if(r.memoizedState!==null){if(Di(r),r.alternate===null)throw Error(n(340));_n()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 13:if(Di(r),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(n(340));_n()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return Z(bt),null;case 4:return le(),null;case 10:return Us(r.type),null;case 22:case 23:return Di(r),Wd(),i!==null&&Z(xn),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 24:return Us(wt),null;case 25:return null;default:return null}}function Uy(i,r){switch(Td(r),r.tag){case 3:Us(wt),le();break;case 26:case 27:case 5:je(r);break;case 4:le();break;case 31:r.memoizedState!==null&&Di(r);break;case 13:Di(r);break;case 19:Z(bt);break;case 10:Us(r.type);break;case 22:case 23:Di(r),Wd(),i!==null&&Z(xn);break;case 24:Us(wt)}}function Xo(i,r){try{var o=r.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var p=c.next;o=p;do{if((o.tag&i)===i){c=void 0;var v=o.create,C=o.inst;c=v(),C.destroy=c}o=o.next}while(o!==p)}}catch(N){Xe(r,r.return,N)}}function Or(i,r,o){try{var c=r.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var v=p.next;c=v;do{if((c.tag&i)===i){var C=c.inst,N=C.destroy;if(N!==void 0){C.destroy=void 0,p=r;var P=o,X=N;try{X()}catch(ie){Xe(p,P,ie)}}}c=c.next}while(c!==v)}}catch(ie){Xe(r,r.return,ie)}}function Fy(i){var r=i.updateQueue;if(r!==null){var o=i.stateNode;try{A_(r,o)}catch(c){Xe(i,i.return,c)}}}function Vy(i,r,o){o.props=kn(i.type,i.memoizedProps),o.state=i.memoizedState;try{o.componentWillUnmount()}catch(c){Xe(i,r,c)}}function Zo(i,r){try{var o=i.ref;if(o!==null){switch(i.tag){case 26:case 27:case 5:var c=i.stateNode;break;case 30:c=i.stateNode;break;default:c=i.stateNode}typeof o=="function"?i.refCleanup=o(c):o.current=c}}catch(p){Xe(i,r,p)}}function gs(i,r){var o=i.ref,c=i.refCleanup;if(o!==null)if(typeof c=="function")try{c()}catch(p){Xe(i,r,p)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(p){Xe(i,r,p)}else o.current=null}function Wy(i){var r=i.type,o=i.memoizedProps,c=i.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":o.autoFocus&&c.focus();break e;case"img":o.src?c.src=o.src:o.srcSet&&(c.srcset=o.srcSet)}}catch(p){Xe(i,i.return,p)}}function Cf(i,r,o){try{var c=i.stateNode;nN(c,i.type,o,r),c[mi]=r}catch(p){Xe(i,i.return,p)}}function Ky(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&$r(i.type)||i.tag===4}function Ef(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Ky(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&$r(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function kf(i,r,o){var c=i.tag;if(c===5||c===6)i=i.stateNode,r?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(i,r):(r=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,r.appendChild(i),o=o._reactRootContainer,o!=null||r.onclick!==null||(r.onclick=Bs));else if(c!==4&&(c===27&&$r(i.type)&&(o=i.stateNode,r=null),i=i.child,i!==null))for(kf(i,r,o),i=i.sibling;i!==null;)kf(i,r,o),i=i.sibling}function Xc(i,r,o){var c=i.tag;if(c===5||c===6)i=i.stateNode,r?o.insertBefore(i,r):o.appendChild(i);else if(c!==4&&(c===27&&$r(i.type)&&(o=i.stateNode),i=i.child,i!==null))for(Xc(i,r,o),i=i.sibling;i!==null;)Xc(i,r,o),i=i.sibling}function qy(i){var r=i.stateNode,o=i.memoizedProps;try{for(var c=i.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);Qt(r,c,o),r[Yt]=i,r[mi]=o}catch(v){Xe(i,i.return,v)}}var qs=!1,kt=!1,Nf=!1,Yy=typeof WeakSet=="function"?WeakSet:Set,Ht=null;function Pk(i,r){if(i=i.containerInfo,Yf=vu,i=a_(i),yd(i)){if("selectionStart"in i)var o={start:i.selectionStart,end:i.selectionEnd};else e:{o=(o=i.ownerDocument)&&o.defaultView||window;var c=o.getSelection&&o.getSelection();if(c&&c.rangeCount!==0){o=c.anchorNode;var p=c.anchorOffset,v=c.focusNode;c=c.focusOffset;try{o.nodeType,v.nodeType}catch{o=null;break e}var C=0,N=-1,P=-1,X=0,ie=0,re=i,Q=null;t:for(;;){for(var ee;re!==o||p!==0&&re.nodeType!==3||(N=C+p),re!==v||c!==0&&re.nodeType!==3||(P=C+c),re.nodeType===3&&(C+=re.nodeValue.length),(ee=re.firstChild)!==null;)Q=re,re=ee;for(;;){if(re===i)break t;if(Q===o&&++X===p&&(N=C),Q===v&&++ie===c&&(P=C),(ee=re.nextSibling)!==null)break;re=Q,Q=re.parentNode}re=ee}o=N===-1||P===-1?null:{start:N,end:P}}else o=null}o=o||{start:0,end:0}}else o=null;for(Gf={focusedElem:i,selectionRange:o},vu=!1,Ht=r;Ht!==null;)if(r=Ht,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,Ht=i;else for(;Ht!==null;){switch(r=Ht,v=r.alternate,i=r.flags,r.tag){case 0:if((i&4)!==0&&(i=r.updateQueue,i=i!==null?i.events:null,i!==null))for(o=0;o<i.length;o++)p=i[o],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&v!==null){i=void 0,o=r,p=v.memoizedProps,v=v.memoizedState,c=o.stateNode;try{var ye=kn(o.type,p);i=c.getSnapshotBeforeUpdate(ye,v),c.__reactInternalSnapshotBeforeUpdate=i}catch(Ee){Xe(o,o.return,Ee)}}break;case 3:if((i&1024)!==0){if(i=r.stateNode.containerInfo,o=i.nodeType,o===9)Qf(i);else if(o===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Qf(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(n(163))}if(i=r.sibling,i!==null){i.return=r.return,Ht=i;break}Ht=r.return}}function Gy(i,r,o){var c=o.flags;switch(o.tag){case 0:case 11:case 15:Gs(i,o),c&4&&Xo(5,o);break;case 1:if(Gs(i,o),c&4)if(i=o.stateNode,r===null)try{i.componentDidMount()}catch(C){Xe(o,o.return,C)}else{var p=kn(o.type,r.memoizedProps);r=r.memoizedState;try{i.componentDidUpdate(p,r,i.__reactInternalSnapshotBeforeUpdate)}catch(C){Xe(o,o.return,C)}}c&64&&Fy(o),c&512&&Zo(o,o.return);break;case 3:if(Gs(i,o),c&64&&(i=o.updateQueue,i!==null)){if(r=null,o.child!==null)switch(o.child.tag){case 27:case 5:r=o.child.stateNode;break;case 1:r=o.child.stateNode}try{A_(i,r)}catch(C){Xe(o,o.return,C)}}break;case 27:r===null&&c&4&&qy(o);case 26:case 5:Gs(i,o),r===null&&c&4&&Wy(o),c&512&&Zo(o,o.return);break;case 12:Gs(i,o);break;case 31:Gs(i,o),c&4&&Qy(i,o);break;case 13:Gs(i,o),c&4&&Jy(i,o),c&64&&(i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(o=qk.bind(null,o),fN(i,o))));break;case 22:if(c=o.memoizedState!==null||qs,!c){r=r!==null&&r.memoizedState!==null||kt,p=qs;var v=kt;qs=c,(kt=r)&&!v?Xs(i,o,(o.subtreeFlags&8772)!==0):Gs(i,o),qs=p,kt=v}break;case 30:break;default:Gs(i,o)}}function Xy(i){var r=i.alternate;r!==null&&(i.alternate=null,Xy(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&id(r)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var ct=null,gi=!1;function Ys(i,r,o){for(o=o.child;o!==null;)Zy(i,r,o),o=o.sibling}function Zy(i,r,o){if(Ci&&typeof Ci.onCommitFiberUnmount=="function")try{Ci.onCommitFiberUnmount(xo,o)}catch{}switch(o.tag){case 26:kt||gs(o,r),Ys(i,r,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:kt||gs(o,r);var c=ct,p=gi;$r(o.type)&&(ct=o.stateNode,gi=!1),Ys(i,r,o),al(o.stateNode),ct=c,gi=p;break;case 5:kt||gs(o,r);case 6:if(c=ct,p=gi,ct=null,Ys(i,r,o),ct=c,gi=p,ct!==null)if(gi)try{(ct.nodeType===9?ct.body:ct.nodeName==="HTML"?ct.ownerDocument.body:ct).removeChild(o.stateNode)}catch(v){Xe(o,r,v)}else try{ct.removeChild(o.stateNode)}catch(v){Xe(o,r,v)}break;case 18:ct!==null&&(gi?(i=ct,F0(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,o.stateNode),Pa(i)):F0(ct,o.stateNode));break;case 4:c=ct,p=gi,ct=o.stateNode.containerInfo,gi=!0,Ys(i,r,o),ct=c,gi=p;break;case 0:case 11:case 14:case 15:Or(2,o,r),kt||Or(4,o,r),Ys(i,r,o);break;case 1:kt||(gs(o,r),c=o.stateNode,typeof c.componentWillUnmount=="function"&&Vy(o,r,c)),Ys(i,r,o);break;case 21:Ys(i,r,o);break;case 22:kt=(c=kt)||o.memoizedState!==null,Ys(i,r,o),kt=c;break;default:Ys(i,r,o)}}function Qy(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Pa(i)}catch(o){Xe(r,r.return,o)}}}function Jy(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Pa(i)}catch(o){Xe(r,r.return,o)}}function Hk(i){switch(i.tag){case 31:case 13:case 19:var r=i.stateNode;return r===null&&(r=i.stateNode=new Yy),r;case 22:return i=i.stateNode,r=i._retryCache,r===null&&(r=i._retryCache=new Yy),r;default:throw Error(n(435,i.tag))}}function Zc(i,r){var o=Hk(i);r.forEach(function(c){if(!o.has(c)){o.add(c);var p=Yk.bind(null,i,c);c.then(p,p)}})}function vi(i,r){var o=r.deletions;if(o!==null)for(var c=0;c<o.length;c++){var p=o[c],v=i,C=r,N=C;e:for(;N!==null;){switch(N.tag){case 27:if($r(N.type)){ct=N.stateNode,gi=!1;break e}break;case 5:ct=N.stateNode,gi=!1;break e;case 3:case 4:ct=N.stateNode.containerInfo,gi=!0;break e}N=N.return}if(ct===null)throw Error(n(160));Zy(v,C,p),ct=null,gi=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)e0(r,i),r=r.sibling}var os=null;function e0(i,r){var o=i.alternate,c=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:vi(r,i),_i(i),c&4&&(Or(3,i,i.return),Xo(3,i),Or(5,i,i.return));break;case 1:vi(r,i),_i(i),c&512&&(kt||o===null||gs(o,o.return)),c&64&&qs&&(i=i.updateQueue,i!==null&&(c=i.callbacks,c!==null&&(o=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=o===null?c:o.concat(c))));break;case 26:var p=os;if(vi(r,i),_i(i),c&512&&(kt||o===null||gs(o,o.return)),c&4){var v=o!==null?o.memoizedState:null;if(c=i.memoizedState,o===null)if(c===null)if(i.stateNode===null){e:{c=i.type,o=i.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":v=p.getElementsByTagName("title")[0],(!v||v[Co]||v[Yt]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(c),p.head.insertBefore(v,p.querySelector("head > title"))),Qt(v,c,o),v[Yt]=i,Pt(v),c=v;break e;case"link":var C=eb("link","href",p).get(c+(o.href||""));if(C){for(var N=0;N<C.length;N++)if(v=C[N],v.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&v.getAttribute("rel")===(o.rel==null?null:o.rel)&&v.getAttribute("title")===(o.title==null?null:o.title)&&v.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){C.splice(N,1);break t}}v=p.createElement(c),Qt(v,c,o),p.head.appendChild(v);break;case"meta":if(C=eb("meta","content",p).get(c+(o.content||""))){for(N=0;N<C.length;N++)if(v=C[N],v.getAttribute("content")===(o.content==null?null:""+o.content)&&v.getAttribute("name")===(o.name==null?null:o.name)&&v.getAttribute("property")===(o.property==null?null:o.property)&&v.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&v.getAttribute("charset")===(o.charSet==null?null:o.charSet)){C.splice(N,1);break t}}v=p.createElement(c),Qt(v,c,o),p.head.appendChild(v);break;default:throw Error(n(468,c))}v[Yt]=i,Pt(v),c=v}i.stateNode=c}else tb(p,i.type,i.stateNode);else i.stateNode=J0(p,c,i.memoizedProps);else v!==c?(v===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):v.count--,c===null?tb(p,i.type,i.stateNode):J0(p,c,i.memoizedProps)):c===null&&i.stateNode!==null&&Cf(i,i.memoizedProps,o.memoizedProps)}break;case 27:vi(r,i),_i(i),c&512&&(kt||o===null||gs(o,o.return)),o!==null&&c&4&&Cf(i,i.memoizedProps,o.memoizedProps);break;case 5:if(vi(r,i),_i(i),c&512&&(kt||o===null||gs(o,o.return)),i.flags&32){p=i.stateNode;try{oa(p,"")}catch(ye){Xe(i,i.return,ye)}}c&4&&i.stateNode!=null&&(p=i.memoizedProps,Cf(i,p,o!==null?o.memoizedProps:p)),c&1024&&(Nf=!0);break;case 6:if(vi(r,i),_i(i),c&4){if(i.stateNode===null)throw Error(n(162));c=i.memoizedProps,o=i.stateNode;try{o.nodeValue=c}catch(ye){Xe(i,i.return,ye)}}break;case 3:if(fu=null,p=os,os=hu(r.containerInfo),vi(r,i),os=p,_i(i),c&4&&o!==null&&o.memoizedState.isDehydrated)try{Pa(r.containerInfo)}catch(ye){Xe(i,i.return,ye)}Nf&&(Nf=!1,t0(i));break;case 4:c=os,os=hu(i.stateNode.containerInfo),vi(r,i),_i(i),os=c;break;case 12:vi(r,i),_i(i);break;case 31:vi(r,i),_i(i),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,Zc(i,c)));break;case 13:vi(r,i),_i(i),i.child.flags&8192&&i.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Jc=Ye()),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,Zc(i,c)));break;case 22:p=i.memoizedState!==null;var P=o!==null&&o.memoizedState!==null,X=qs,ie=kt;if(qs=X||p,kt=ie||P,vi(r,i),kt=ie,qs=X,_i(i),c&8192)e:for(r=i.stateNode,r._visibility=p?r._visibility&-2:r._visibility|1,p&&(o===null||P||qs||kt||Nn(i)),o=null,r=i;;){if(r.tag===5||r.tag===26){if(o===null){P=o=r;try{if(v=P.stateNode,p)C=v.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{N=P.stateNode;var re=P.memoizedProps.style,Q=re!=null&&re.hasOwnProperty("display")?re.display:null;N.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(ye){Xe(P,P.return,ye)}}}else if(r.tag===6){if(o===null){P=r;try{P.stateNode.nodeValue=p?"":P.memoizedProps}catch(ye){Xe(P,P.return,ye)}}}else if(r.tag===18){if(o===null){P=r;try{var ee=P.stateNode;p?V0(ee,!0):V0(P.stateNode,!1)}catch(ye){Xe(P,P.return,ye)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===i)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;o===r&&(o=null),r=r.return}o===r&&(o=null),r.sibling.return=r.return,r=r.sibling}c&4&&(c=i.updateQueue,c!==null&&(o=c.retryQueue,o!==null&&(c.retryQueue=null,Zc(i,o))));break;case 19:vi(r,i),_i(i),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,Zc(i,c)));break;case 30:break;case 21:break;default:vi(r,i),_i(i)}}function _i(i){var r=i.flags;if(r&2){try{for(var o,c=i.return;c!==null;){if(Ky(c)){o=c;break}c=c.return}if(o==null)throw Error(n(160));switch(o.tag){case 27:var p=o.stateNode,v=Ef(i);Xc(i,v,p);break;case 5:var C=o.stateNode;o.flags&32&&(oa(C,""),o.flags&=-33);var N=Ef(i);Xc(i,N,C);break;case 3:case 4:var P=o.stateNode.containerInfo,X=Ef(i);kf(i,X,P);break;default:throw Error(n(161))}}catch(ie){Xe(i,i.return,ie)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function t0(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var r=i;t0(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),i=i.sibling}}function Gs(i,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Gy(i,r.alternate,r),r=r.sibling}function Nn(i){for(i=i.child;i!==null;){var r=i;switch(r.tag){case 0:case 11:case 14:case 15:Or(4,r,r.return),Nn(r);break;case 1:gs(r,r.return);var o=r.stateNode;typeof o.componentWillUnmount=="function"&&Vy(r,r.return,o),Nn(r);break;case 27:al(r.stateNode);case 26:case 5:gs(r,r.return),Nn(r);break;case 22:r.memoizedState===null&&Nn(r);break;case 30:Nn(r);break;default:Nn(r)}i=i.sibling}}function Xs(i,r,o){for(o=o&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var c=r.alternate,p=i,v=r,C=v.flags;switch(v.tag){case 0:case 11:case 15:Xs(p,v,o),Xo(4,v);break;case 1:if(Xs(p,v,o),c=v,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(X){Xe(c,c.return,X)}if(c=v,p=c.updateQueue,p!==null){var N=c.stateNode;try{var P=p.shared.hiddenCallbacks;if(P!==null)for(p.shared.hiddenCallbacks=null,p=0;p<P.length;p++)M_(P[p],N)}catch(X){Xe(c,c.return,X)}}o&&C&64&&Fy(v),Zo(v,v.return);break;case 27:qy(v);case 26:case 5:Xs(p,v,o),o&&c===null&&C&4&&Wy(v),Zo(v,v.return);break;case 12:Xs(p,v,o);break;case 31:Xs(p,v,o),o&&C&4&&Qy(p,v);break;case 13:Xs(p,v,o),o&&C&4&&Jy(p,v);break;case 22:v.memoizedState===null&&Xs(p,v,o),Zo(v,v.return);break;case 30:break;default:Xs(p,v,o)}r=r.sibling}}function jf(i,r){var o=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==o&&(i!=null&&i.refCount++,o!=null&&Bo(o))}function Df(i,r){i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&Bo(i))}function ls(i,r,o,c){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)i0(i,r,o,c),r=r.sibling}function i0(i,r,o,c){var p=r.flags;switch(r.tag){case 0:case 11:case 15:ls(i,r,o,c),p&2048&&Xo(9,r);break;case 1:ls(i,r,o,c);break;case 3:ls(i,r,o,c),p&2048&&(i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&Bo(i)));break;case 12:if(p&2048){ls(i,r,o,c),i=r.stateNode;try{var v=r.memoizedProps,C=v.id,N=v.onPostCommit;typeof N=="function"&&N(C,r.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(P){Xe(r,r.return,P)}}else ls(i,r,o,c);break;case 31:ls(i,r,o,c);break;case 13:ls(i,r,o,c);break;case 23:break;case 22:v=r.stateNode,C=r.alternate,r.memoizedState!==null?v._visibility&2?ls(i,r,o,c):Qo(i,r):v._visibility&2?ls(i,r,o,c):(v._visibility|=2,Na(i,r,o,c,(r.subtreeFlags&10256)!==0||!1)),p&2048&&jf(C,r);break;case 24:ls(i,r,o,c),p&2048&&Df(r.alternate,r);break;default:ls(i,r,o,c)}}function Na(i,r,o,c,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var v=i,C=r,N=o,P=c,X=C.flags;switch(C.tag){case 0:case 11:case 15:Na(v,C,N,P,p),Xo(8,C);break;case 23:break;case 22:var ie=C.stateNode;C.memoizedState!==null?ie._visibility&2?Na(v,C,N,P,p):Qo(v,C):(ie._visibility|=2,Na(v,C,N,P,p)),p&&X&2048&&jf(C.alternate,C);break;case 24:Na(v,C,N,P,p),p&&X&2048&&Df(C.alternate,C);break;default:Na(v,C,N,P,p)}r=r.sibling}}function Qo(i,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var o=i,c=r,p=c.flags;switch(c.tag){case 22:Qo(o,c),p&2048&&jf(c.alternate,c);break;case 24:Qo(o,c),p&2048&&Df(c.alternate,c);break;default:Qo(o,c)}r=r.sibling}}var Jo=8192;function ja(i,r,o){if(i.subtreeFlags&Jo)for(i=i.child;i!==null;)s0(i,r,o),i=i.sibling}function s0(i,r,o){switch(i.tag){case 26:ja(i,r,o),i.flags&Jo&&i.memoizedState!==null&&EN(o,os,i.memoizedState,i.memoizedProps);break;case 5:ja(i,r,o);break;case 3:case 4:var c=os;os=hu(i.stateNode.containerInfo),ja(i,r,o),os=c;break;case 22:i.memoizedState===null&&(c=i.alternate,c!==null&&c.memoizedState!==null?(c=Jo,Jo=16777216,ja(i,r,o),Jo=c):ja(i,r,o));break;default:ja(i,r,o)}}function r0(i){var r=i.alternate;if(r!==null&&(i=r.child,i!==null)){r.child=null;do r=i.sibling,i.sibling=null,i=r;while(i!==null)}}function el(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var c=r[o];Ht=c,a0(c,i)}r0(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)n0(i),i=i.sibling}function n0(i){switch(i.tag){case 0:case 11:case 15:el(i),i.flags&2048&&Or(9,i,i.return);break;case 3:el(i);break;case 12:el(i);break;case 22:var r=i.stateNode;i.memoizedState!==null&&r._visibility&2&&(i.return===null||i.return.tag!==13)?(r._visibility&=-3,Qc(i)):el(i);break;default:el(i)}}function Qc(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var c=r[o];Ht=c,a0(c,i)}r0(i)}for(i=i.child;i!==null;){switch(r=i,r.tag){case 0:case 11:case 15:Or(8,r,r.return),Qc(r);break;case 22:o=r.stateNode,o._visibility&2&&(o._visibility&=-3,Qc(r));break;default:Qc(r)}i=i.sibling}}function a0(i,r){for(;Ht!==null;){var o=Ht;switch(o.tag){case 0:case 11:case 15:Or(8,o,r);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var c=o.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Bo(o.memoizedState.cache)}if(c=o.child,c!==null)c.return=o,Ht=c;else e:for(o=i;Ht!==null;){c=Ht;var p=c.sibling,v=c.return;if(Xy(c),c===o){Ht=null;break e}if(p!==null){p.return=v,Ht=p;break e}Ht=v}}}var Ik={getCacheForType:function(i){var r=Xt(wt),o=r.data.get(i);return o===void 0&&(o=i(),r.data.set(i,o)),o},cacheSignal:function(){return Xt(wt).controller.signal}},$k=typeof WeakMap=="function"?WeakMap:Map,Ke=0,tt=null,Pe=null,$e=0,Ge=0,Ti=null,zr=!1,Da=!1,Tf=!1,Zs=0,vt=0,Lr=0,jn=0,Rf=0,Ri=0,Ta=0,tl=null,yi=null,Mf=!1,Jc=0,o0=0,eu=1/0,tu=null,Br=null,Rt=0,Pr=null,Ra=null,Qs=0,Af=0,Of=null,l0=null,il=0,zf=null;function Mi(){return(Ke&2)!==0&&$e!==0?$e&-$e:M.T!==null?$f():Cv()}function c0(){if(Ri===0)if(($e&536870912)===0||Fe){var i=cc;cc<<=1,(cc&3932160)===0&&(cc=262144),Ri=i}else Ri=536870912;return i=ji.current,i!==null&&(i.flags|=32),Ri}function bi(i,r,o){(i===tt&&(Ge===2||Ge===9)||i.cancelPendingCommit!==null)&&(Ma(i,0),Hr(i,$e,Ri,!1)),wo(i,o),((Ke&2)===0||i!==tt)&&(i===tt&&((Ke&2)===0&&(jn|=o),vt===4&&Hr(i,$e,Ri,!1)),vs(i))}function u0(i,r,o){if((Ke&6)!==0)throw Error(n(327));var c=!o&&(r&127)===0&&(r&i.expiredLanes)===0||So(i,r),p=c?Vk(i,r):Bf(i,r,!0),v=c;do{if(p===0){Da&&!c&&Hr(i,r,0,!1);break}else{if(o=i.current.alternate,v&&!Uk(o)){p=Bf(i,r,!1),v=!1;continue}if(p===2){if(v=r,i.errorRecoveryDisabledLanes&v)var C=0;else C=i.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){r=C;e:{var N=i;p=tl;var P=N.current.memoizedState.isDehydrated;if(P&&(Ma(N,C).flags|=256),C=Bf(N,C,!1),C!==2){if(Tf&&!P){N.errorRecoveryDisabledLanes|=v,jn|=v,p=4;break e}v=yi,yi=p,v!==null&&(yi===null?yi=v:yi.push.apply(yi,v))}p=C}if(v=!1,p!==2)continue}}if(p===1){Ma(i,0),Hr(i,r,0,!0);break}e:{switch(c=i,v=p,v){case 0:case 1:throw Error(n(345));case 4:if((r&4194048)!==r)break;case 6:Hr(c,r,Ri,!zr);break e;case 2:yi=null;break;case 3:case 5:break;default:throw Error(n(329))}if((r&62914560)===r&&(p=Jc+300-Ye(),10<p)){if(Hr(c,r,Ri,!zr),hc(c,0,!0)!==0)break e;Qs=r,c.timeoutHandle=$0(h0.bind(null,c,o,yi,tu,Mf,r,Ri,jn,Ta,zr,v,"Throttled",-0,0),p);break e}h0(c,o,yi,tu,Mf,r,Ri,jn,Ta,zr,v,null,-0,0)}}break}while(!0);vs(i)}function h0(i,r,o,c,p,v,C,N,P,X,ie,re,Q,ee){if(i.timeoutHandle=-1,re=r.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Bs},s0(r,v,re);var ye=(v&62914560)===v?Jc-Ye():(v&4194048)===v?o0-Ye():0;if(ye=kN(re,ye),ye!==null){Qs=v,i.cancelPendingCommit=ye(y0.bind(null,i,r,v,o,c,p,C,N,P,ie,re,null,Q,ee)),Hr(i,v,C,!X);return}}y0(i,r,v,o,c,p,C,N,P)}function Uk(i){for(var r=i;;){var o=r.tag;if((o===0||o===11||o===15)&&r.flags&16384&&(o=r.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var c=0;c<o.length;c++){var p=o[c],v=p.getSnapshot;p=p.value;try{if(!ki(v(),p))return!1}catch{return!1}}if(o=r.child,r.subtreeFlags&16384&&o!==null)o.return=r,r=o;else{if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Hr(i,r,o,c){r&=~Rf,r&=~jn,i.suspendedLanes|=r,i.pingedLanes&=~r,c&&(i.warmLanes|=r),c=i.expirationTimes;for(var p=r;0<p;){var v=31-Ei(p),C=1<<v;c[v]=-1,p&=~C}o!==0&&xv(i,o,r)}function iu(){return(Ke&6)===0?(sl(0),!1):!0}function Lf(){if(Pe!==null){if(Ge===0)var i=Pe.return;else i=Pe,$s=yn=null,Zd(i),Sa=null,Ho=0,i=Pe;for(;i!==null;)Uy(i.alternate,i),i=i.return;Pe=null}}function Ma(i,r){var o=i.timeoutHandle;o!==-1&&(i.timeoutHandle=-1,lN(o)),o=i.cancelPendingCommit,o!==null&&(i.cancelPendingCommit=null,o()),Qs=0,Lf(),tt=i,Pe=o=Hs(i.current,null),$e=r,Ge=0,Ti=null,zr=!1,Da=So(i,r),Tf=!1,Ta=Ri=Rf=jn=Lr=vt=0,yi=tl=null,Mf=!1,(r&8)!==0&&(r|=r&32);var c=i.entangledLanes;if(c!==0)for(i=i.entanglements,c&=r;0<c;){var p=31-Ei(c),v=1<<p;r|=i[p],c&=~v}return Zs=r,wc(),o}function d0(i,r){Ae=null,M.H=qo,r===xa||r===Rc?(r=j_(),Ge=3):r===Hd?(r=j_(),Ge=4):Ge=r===mf?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Ti=r,Pe===null&&(vt=1,Wc(i,Fi(r,i.current)))}function f0(){var i=ji.current;return i===null?!0:($e&4194048)===$e?qi===null:($e&62914560)===$e||($e&536870912)!==0?i===qi:!1}function m0(){var i=M.H;return M.H=qo,i===null?qo:i}function p0(){var i=M.A;return M.A=Ik,i}function su(){vt=4,zr||($e&4194048)!==$e&&ji.current!==null||(Da=!0),(Lr&134217727)===0&&(jn&134217727)===0||tt===null||Hr(tt,$e,Ri,!1)}function Bf(i,r,o){var c=Ke;Ke|=2;var p=m0(),v=p0();(tt!==i||$e!==r)&&(tu=null,Ma(i,r)),r=!1;var C=vt;e:do try{if(Ge!==0&&Pe!==null){var N=Pe,P=Ti;switch(Ge){case 8:Lf(),C=6;break e;case 3:case 2:case 9:case 6:ji.current===null&&(r=!0);var X=Ge;if(Ge=0,Ti=null,Aa(i,N,P,X),o&&Da){C=0;break e}break;default:X=Ge,Ge=0,Ti=null,Aa(i,N,P,X)}}Fk(),C=vt;break}catch(ie){d0(i,ie)}while(!0);return r&&i.shellSuspendCounter++,$s=yn=null,Ke=c,M.H=p,M.A=v,Pe===null&&(tt=null,$e=0,wc()),C}function Fk(){for(;Pe!==null;)g0(Pe)}function Vk(i,r){var o=Ke;Ke|=2;var c=m0(),p=p0();tt!==i||$e!==r?(tu=null,eu=Ye()+500,Ma(i,r)):Da=So(i,r);e:do try{if(Ge!==0&&Pe!==null){r=Pe;var v=Ti;t:switch(Ge){case 1:Ge=0,Ti=null,Aa(i,r,v,1);break;case 2:case 9:if(k_(v)){Ge=0,Ti=null,v0(r);break}r=function(){Ge!==2&&Ge!==9||tt!==i||(Ge=7),vs(i)},v.then(r,r);break e;case 3:Ge=7;break e;case 4:Ge=5;break e;case 7:k_(v)?(Ge=0,Ti=null,v0(r)):(Ge=0,Ti=null,Aa(i,r,v,7));break;case 5:var C=null;switch(Pe.tag){case 26:C=Pe.memoizedState;case 5:case 27:var N=Pe;if(C?ib(C):N.stateNode.complete){Ge=0,Ti=null;var P=N.sibling;if(P!==null)Pe=P;else{var X=N.return;X!==null?(Pe=X,ru(X)):Pe=null}break t}}Ge=0,Ti=null,Aa(i,r,v,5);break;case 6:Ge=0,Ti=null,Aa(i,r,v,6);break;case 8:Lf(),vt=6;break e;default:throw Error(n(462))}}Wk();break}catch(ie){d0(i,ie)}while(!0);return $s=yn=null,M.H=c,M.A=p,Ke=o,Pe!==null?0:(tt=null,$e=0,wc(),vt)}function Wk(){for(;Pe!==null&&!xe();)g0(Pe)}function g0(i){var r=Iy(i.alternate,i,Zs);i.memoizedProps=i.pendingProps,r===null?ru(i):Pe=r}function v0(i){var r=i,o=r.alternate;switch(r.tag){case 15:case 0:r=Oy(o,r,r.pendingProps,r.type,void 0,$e);break;case 11:r=Oy(o,r,r.pendingProps,r.type.render,r.ref,$e);break;case 5:Zd(r);default:Uy(o,r),r=Pe=p_(r,Zs),r=Iy(o,r,Zs)}i.memoizedProps=i.pendingProps,r===null?ru(i):Pe=r}function Aa(i,r,o,c){$s=yn=null,Zd(r),Sa=null,Ho=0;var p=r.return;try{if(Ak(i,p,r,o,$e)){vt=1,Wc(i,Fi(o,i.current)),Pe=null;return}}catch(v){if(p!==null)throw Pe=p,v;vt=1,Wc(i,Fi(o,i.current)),Pe=null;return}r.flags&32768?(Fe||c===1?i=!0:Da||($e&536870912)!==0?i=!1:(zr=i=!0,(c===2||c===9||c===3||c===6)&&(c=ji.current,c!==null&&c.tag===13&&(c.flags|=16384))),_0(r,i)):ru(r)}function ru(i){var r=i;do{if((r.flags&32768)!==0){_0(r,zr);return}i=r.return;var o=Lk(r.alternate,r,Zs);if(o!==null){Pe=o;return}if(r=r.sibling,r!==null){Pe=r;return}Pe=r=i}while(r!==null);vt===0&&(vt=5)}function _0(i,r){do{var o=Bk(i.alternate,i);if(o!==null){o.flags&=32767,Pe=o;return}if(o=i.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!r&&(i=i.sibling,i!==null)){Pe=i;return}Pe=i=o}while(i!==null);vt=6,Pe=null}function y0(i,r,o,c,p,v,C,N,P){i.cancelPendingCommit=null;do nu();while(Rt!==0);if((Ke&6)!==0)throw Error(n(327));if(r!==null){if(r===i.current)throw Error(n(177));if(v=r.lanes|r.childLanes,v|=Cd,CE(i,o,v,C,N,P),i===tt&&(Pe=tt=null,$e=0),Ra=r,Pr=i,Qs=o,Af=v,Of=p,l0=c,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,Gk(ea,function(){return C0(),null})):(i.callbackNode=null,i.callbackPriority=0),c=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||c){c=M.T,M.T=null,p=H.p,H.p=2,C=Ke,Ke|=4;try{Pk(i,r,o)}finally{Ke=C,H.p=p,M.T=c}}Rt=1,b0(),x0(),S0()}}function b0(){if(Rt===1){Rt=0;var i=Pr,r=Ra,o=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||o){o=M.T,M.T=null;var c=H.p;H.p=2;var p=Ke;Ke|=4;try{e0(r,i);var v=Gf,C=a_(i.containerInfo),N=v.focusedElem,P=v.selectionRange;if(C!==N&&N&&N.ownerDocument&&n_(N.ownerDocument.documentElement,N)){if(P!==null&&yd(N)){var X=P.start,ie=P.end;if(ie===void 0&&(ie=X),"selectionStart"in N)N.selectionStart=X,N.selectionEnd=Math.min(ie,N.value.length);else{var re=N.ownerDocument||document,Q=re&&re.defaultView||window;if(Q.getSelection){var ee=Q.getSelection(),ye=N.textContent.length,Ee=Math.min(P.start,ye),Je=P.end===void 0?Ee:Math.min(P.end,ye);!ee.extend&&Ee>Je&&(C=Je,Je=Ee,Ee=C);var W=r_(N,Ee),F=r_(N,Je);if(W&&F&&(ee.rangeCount!==1||ee.anchorNode!==W.node||ee.anchorOffset!==W.offset||ee.focusNode!==F.node||ee.focusOffset!==F.offset)){var G=re.createRange();G.setStart(W.node,W.offset),ee.removeAllRanges(),Ee>Je?(ee.addRange(G),ee.extend(F.node,F.offset)):(G.setEnd(F.node,F.offset),ee.addRange(G))}}}}for(re=[],ee=N;ee=ee.parentNode;)ee.nodeType===1&&re.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<re.length;N++){var se=re[N];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}vu=!!Yf,Gf=Yf=null}finally{Ke=p,H.p=c,M.T=o}}i.current=r,Rt=2}}function x0(){if(Rt===2){Rt=0;var i=Pr,r=Ra,o=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||o){o=M.T,M.T=null;var c=H.p;H.p=2;var p=Ke;Ke|=4;try{Gy(i,r.alternate,r)}finally{Ke=p,H.p=c,M.T=o}}Rt=3}}function S0(){if(Rt===4||Rt===3){Rt=0,Te();var i=Pr,r=Ra,o=Qs,c=l0;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Rt=5:(Rt=0,Ra=Pr=null,w0(i,i.pendingLanes));var p=i.pendingLanes;if(p===0&&(Br=null),ed(o),r=r.stateNode,Ci&&typeof Ci.onCommitFiberRoot=="function")try{Ci.onCommitFiberRoot(xo,r,void 0,(r.current.flags&128)===128)}catch{}if(c!==null){r=M.T,p=H.p,H.p=2,M.T=null;try{for(var v=i.onRecoverableError,C=0;C<c.length;C++){var N=c[C];v(N.value,{componentStack:N.stack})}}finally{M.T=r,H.p=p}}(Qs&3)!==0&&nu(),vs(i),p=i.pendingLanes,(o&261930)!==0&&(p&42)!==0?i===zf?il++:(il=0,zf=i):il=0,sl(0)}}function w0(i,r){(i.pooledCacheLanes&=r)===0&&(r=i.pooledCache,r!=null&&(i.pooledCache=null,Bo(r)))}function nu(){return b0(),x0(),S0(),C0()}function C0(){if(Rt!==5)return!1;var i=Pr,r=Af;Af=0;var o=ed(Qs),c=M.T,p=H.p;try{H.p=32>o?32:o,M.T=null,o=Of,Of=null;var v=Pr,C=Qs;if(Rt=0,Ra=Pr=null,Qs=0,(Ke&6)!==0)throw Error(n(331));var N=Ke;if(Ke|=4,n0(v.current),i0(v,v.current,C,o),Ke=N,sl(0,!1),Ci&&typeof Ci.onPostCommitFiberRoot=="function")try{Ci.onPostCommitFiberRoot(xo,v)}catch{}return!0}finally{H.p=p,M.T=c,w0(i,r)}}function E0(i,r,o){r=Fi(o,r),r=ff(i.stateNode,r,2),i=Rr(i,r,2),i!==null&&(wo(i,2),vs(i))}function Xe(i,r,o){if(i.tag===3)E0(i,i,o);else for(;r!==null;){if(r.tag===3){E0(r,i,o);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Br===null||!Br.has(c))){i=Fi(o,i),o=ky(2),c=Rr(r,o,2),c!==null&&(Ny(o,c,r,i),wo(c,2),vs(c));break}}r=r.return}}function Pf(i,r,o){var c=i.pingCache;if(c===null){c=i.pingCache=new $k;var p=new Set;c.set(r,p)}else p=c.get(r),p===void 0&&(p=new Set,c.set(r,p));p.has(o)||(Tf=!0,p.add(o),i=Kk.bind(null,i,r,o),r.then(i,i))}function Kk(i,r,o){var c=i.pingCache;c!==null&&c.delete(r),i.pingedLanes|=i.suspendedLanes&o,i.warmLanes&=~o,tt===i&&($e&o)===o&&(vt===4||vt===3&&($e&62914560)===$e&&300>Ye()-Jc?(Ke&2)===0&&Ma(i,0):Rf|=o,Ta===$e&&(Ta=0)),vs(i)}function k0(i,r){r===0&&(r=bv()),i=gn(i,r),i!==null&&(wo(i,r),vs(i))}function qk(i){var r=i.memoizedState,o=0;r!==null&&(o=r.retryLane),k0(i,o)}function Yk(i,r){var o=0;switch(i.tag){case 31:case 13:var c=i.stateNode,p=i.memoizedState;p!==null&&(o=p.retryLane);break;case 19:c=i.stateNode;break;case 22:c=i.stateNode._retryCache;break;default:throw Error(n(314))}c!==null&&c.delete(r),k0(i,o)}function Gk(i,r){return un(i,r)}var au=null,Oa=null,Hf=!1,ou=!1,If=!1,Ir=0;function vs(i){i!==Oa&&i.next===null&&(Oa===null?au=Oa=i:Oa=Oa.next=i),ou=!0,Hf||(Hf=!0,Zk())}function sl(i,r){if(!If&&ou){If=!0;do for(var o=!1,c=au;c!==null;){if(i!==0){var p=c.pendingLanes;if(p===0)var v=0;else{var C=c.suspendedLanes,N=c.pingedLanes;v=(1<<31-Ei(42|i)+1)-1,v&=p&~(C&~N),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(o=!0,T0(c,v))}else v=$e,v=hc(c,c===tt?v:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(v&3)===0||So(c,v)||(o=!0,T0(c,v));c=c.next}while(o);If=!1}}function Xk(){N0()}function N0(){ou=Hf=!1;var i=0;Ir!==0&&oN()&&(i=Ir);for(var r=Ye(),o=null,c=au;c!==null;){var p=c.next,v=j0(c,r);v===0?(c.next=null,o===null?au=p:o.next=p,p===null&&(Oa=o)):(o=c,(i!==0||(v&3)!==0)&&(ou=!0)),c=p}Rt!==0&&Rt!==5||sl(i),Ir!==0&&(Ir=0)}function j0(i,r){for(var o=i.suspendedLanes,c=i.pingedLanes,p=i.expirationTimes,v=i.pendingLanes&-62914561;0<v;){var C=31-Ei(v),N=1<<C,P=p[C];P===-1?((N&o)===0||(N&c)!==0)&&(p[C]=wE(N,r)):P<=r&&(i.expiredLanes|=N),v&=~N}if(r=tt,o=$e,o=hc(i,i===r?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),c=i.callbackNode,o===0||i===r&&(Ge===2||Ge===9)||i.cancelPendingCommit!==null)return c!==null&&c!==null&&zs(c),i.callbackNode=null,i.callbackPriority=0;if((o&3)===0||So(i,o)){if(r=o&-o,r===i.callbackPriority)return r;switch(c!==null&&zs(c),ed(o)){case 2:case 8:o=Zh;break;case 32:o=ea;break;case 268435456:o=yv;break;default:o=ea}return c=D0.bind(null,i),o=un(o,c),i.callbackPriority=r,i.callbackNode=o,r}return c!==null&&c!==null&&zs(c),i.callbackPriority=2,i.callbackNode=null,2}function D0(i,r){if(Rt!==0&&Rt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var o=i.callbackNode;if(nu()&&i.callbackNode!==o)return null;var c=$e;return c=hc(i,i===tt?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),c===0?null:(u0(i,c,r),j0(i,Ye()),i.callbackNode!=null&&i.callbackNode===o?D0.bind(null,i):null)}function T0(i,r){if(nu())return null;u0(i,r,!0)}function Zk(){cN(function(){(Ke&6)!==0?un(si,Xk):N0()})}function $f(){if(Ir===0){var i=ya;i===0&&(i=lc,lc<<=1,(lc&261888)===0&&(lc=256)),Ir=i}return Ir}function R0(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:pc(""+i)}function M0(i,r){var o=r.ownerDocument.createElement("input");return o.name=r.name,o.value=r.value,i.id&&o.setAttribute("form",i.id),r.parentNode.insertBefore(o,r),i=new FormData(i),o.parentNode.removeChild(o),i}function Qk(i,r,o,c,p){if(r==="submit"&&o&&o.stateNode===p){var v=R0((p[mi]||null).action),C=c.submitter;C&&(r=(r=C[mi]||null)?R0(r.formAction):C.getAttribute("formAction"),r!==null&&(v=r,C=null));var N=new yc("action","action",null,c,p);i.push({event:N,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Ir!==0){var P=C?M0(p,C):new FormData(p);of(o,{pending:!0,data:P,method:p.method,action:v},null,P)}}else typeof v=="function"&&(N.preventDefault(),P=C?M0(p,C):new FormData(p),of(o,{pending:!0,data:P,method:p.method,action:v},v,P))},currentTarget:p}]})}}for(var Uf=0;Uf<wd.length;Uf++){var Ff=wd[Uf],Jk=Ff.toLowerCase(),eN=Ff[0].toUpperCase()+Ff.slice(1);as(Jk,"on"+eN)}as(c_,"onAnimationEnd"),as(u_,"onAnimationIteration"),as(h_,"onAnimationStart"),as("dblclick","onDoubleClick"),as("focusin","onFocus"),as("focusout","onBlur"),as(gk,"onTransitionRun"),as(vk,"onTransitionStart"),as(_k,"onTransitionCancel"),as(d_,"onTransitionEnd"),na("onMouseEnter",["mouseout","mouseover"]),na("onMouseLeave",["mouseout","mouseover"]),na("onPointerEnter",["pointerout","pointerover"]),na("onPointerLeave",["pointerout","pointerover"]),dn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),dn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),dn("onBeforeInput",["compositionend","keypress","textInput","paste"]),dn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),dn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),dn("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(" "),tN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(rl));function A0(i,r){r=(r&4)!==0;for(var o=0;o<i.length;o++){var c=i[o],p=c.event;c=c.listeners;e:{var v=void 0;if(r)for(var C=c.length-1;0<=C;C--){var N=c[C],P=N.instance,X=N.currentTarget;if(N=N.listener,P!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=X;try{v(p)}catch(ie){Sc(ie)}p.currentTarget=null,v=P}else for(C=0;C<c.length;C++){if(N=c[C],P=N.instance,X=N.currentTarget,N=N.listener,P!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=X;try{v(p)}catch(ie){Sc(ie)}p.currentTarget=null,v=P}}}}function He(i,r){var o=r[td];o===void 0&&(o=r[td]=new Set);var c=i+"__bubble";o.has(c)||(O0(r,i,2,!1),o.add(c))}function Vf(i,r,o){var c=0;r&&(c|=4),O0(o,i,c,r)}var lu="_reactListening"+Math.random().toString(36).slice(2);function Wf(i){if(!i[lu]){i[lu]=!0,Nv.forEach(function(o){o!=="selectionchange"&&(tN.has(o)||Vf(o,!1,i),Vf(o,!0,i))});var r=i.nodeType===9?i:i.ownerDocument;r===null||r[lu]||(r[lu]=!0,Vf("selectionchange",!1,r))}}function O0(i,r,o,c){switch(cb(r)){case 2:var p=DN;break;case 8:p=TN;break;default:p=am}o=p.bind(null,r,o,i),p=void 0,!ud||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),c?p!==void 0?i.addEventListener(r,o,{capture:!0,passive:p}):i.addEventListener(r,o,!0):p!==void 0?i.addEventListener(r,o,{passive:p}):i.addEventListener(r,o,!1)}function Kf(i,r,o,c,p){var v=c;if((r&1)===0&&(r&2)===0&&c!==null)e:for(;;){if(c===null)return;var C=c.tag;if(C===3||C===4){var N=c.stateNode.containerInfo;if(N===p)break;if(C===4)for(C=c.return;C!==null;){var P=C.tag;if((P===3||P===4)&&C.stateNode.containerInfo===p)return;C=C.return}for(;N!==null;){if(C=ia(N),C===null)return;if(P=C.tag,P===5||P===6||P===26||P===27){c=v=C;continue e}N=N.parentNode}}c=c.return}Hv(function(){var X=v,ie=ld(o),re=[];e:{var Q=f_.get(i);if(Q!==void 0){var ee=yc,ye=i;switch(i){case"keypress":if(vc(o)===0)break e;case"keydown":case"keyup":ee=YE;break;case"focusin":ye="focus",ee=md;break;case"focusout":ye="blur",ee=md;break;case"beforeblur":case"afterblur":ee=md;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ee=Uv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=LE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=ZE;break;case c_:case u_:case h_:ee=HE;break;case d_:ee=JE;break;case"scroll":case"scrollend":ee=OE;break;case"wheel":ee=tk;break;case"copy":case"cut":case"paste":ee=$E;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=Vv;break;case"toggle":case"beforetoggle":ee=sk}var Ee=(r&4)!==0,Je=!Ee&&(i==="scroll"||i==="scrollend"),W=Ee?Q!==null?Q+"Capture":null:Q;Ee=[];for(var F=X,G;F!==null;){var se=F;if(G=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||G===null||W===null||(se=ko(F,W),se!=null&&Ee.push(nl(F,se,G))),Je)break;F=F.return}0<Ee.length&&(Q=new ee(Q,ye,null,o,ie),re.push({event:Q,listeners:Ee}))}}if((r&7)===0){e:{if(Q=i==="mouseover"||i==="pointerover",ee=i==="mouseout"||i==="pointerout",Q&&o!==od&&(ye=o.relatedTarget||o.fromElement)&&(ia(ye)||ye[ta]))break e;if((ee||Q)&&(Q=ie.window===ie?ie:(Q=ie.ownerDocument)?Q.defaultView||Q.parentWindow:window,ee?(ye=o.relatedTarget||o.toElement,ee=X,ye=ye?ia(ye):null,ye!==null&&(Je=l(ye),Ee=ye.tag,ye!==Je||Ee!==5&&Ee!==27&&Ee!==6)&&(ye=null)):(ee=null,ye=X),ee!==ye)){if(Ee=Uv,se="onMouseLeave",W="onMouseEnter",F="mouse",(i==="pointerout"||i==="pointerover")&&(Ee=Vv,se="onPointerLeave",W="onPointerEnter",F="pointer"),Je=ee==null?Q:Eo(ee),G=ye==null?Q:Eo(ye),Q=new Ee(se,F+"leave",ee,o,ie),Q.target=Je,Q.relatedTarget=G,se=null,ia(ie)===X&&(Ee=new Ee(W,F+"enter",ye,o,ie),Ee.target=G,Ee.relatedTarget=Je,se=Ee),Je=se,ee&&ye)t:{for(Ee=iN,W=ee,F=ye,G=0,se=W;se;se=Ee(se))G++;se=0;for(var we=F;we;we=Ee(we))se++;for(;0<G-se;)W=Ee(W),G--;for(;0<se-G;)F=Ee(F),se--;for(;G--;){if(W===F||F!==null&&W===F.alternate){Ee=W;break t}W=Ee(W),F=Ee(F)}Ee=null}else Ee=null;ee!==null&&z0(re,Q,ee,Ee,!1),ye!==null&&Je!==null&&z0(re,Je,ye,Ee,!0)}}e:{if(Q=X?Eo(X):window,ee=Q.nodeName&&Q.nodeName.toLowerCase(),ee==="select"||ee==="input"&&Q.type==="file")var Ve=Qv;else if(Xv(Q))if(Jv)Ve=fk;else{Ve=hk;var be=uk}else ee=Q.nodeName,!ee||ee.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?X&&ad(X.elementType)&&(Ve=Qv):Ve=dk;if(Ve&&(Ve=Ve(i,X))){Zv(re,Ve,o,ie);break e}be&&be(i,Q,X),i==="focusout"&&X&&Q.type==="number"&&X.memoizedProps.value!=null&&nd(Q,"number",Q.value)}switch(be=X?Eo(X):window,i){case"focusin":(Xv(be)||be.contentEditable==="true")&&(ha=be,bd=X,Oo=null);break;case"focusout":Oo=bd=ha=null;break;case"mousedown":xd=!0;break;case"contextmenu":case"mouseup":case"dragend":xd=!1,o_(re,o,ie);break;case"selectionchange":if(pk)break;case"keydown":case"keyup":o_(re,o,ie)}var Oe;if(gd)e:{switch(i){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else ua?Yv(i,o)&&(Ue="onCompositionEnd"):i==="keydown"&&o.keyCode===229&&(Ue="onCompositionStart");Ue&&(Wv&&o.locale!=="ko"&&(ua||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&ua&&(Oe=Iv()):(Cr=ie,hd="value"in Cr?Cr.value:Cr.textContent,ua=!0)),be=cu(X,Ue),0<be.length&&(Ue=new Fv(Ue,i,null,o,ie),re.push({event:Ue,listeners:be}),Oe?Ue.data=Oe:(Oe=Gv(o),Oe!==null&&(Ue.data=Oe)))),(Oe=nk?ak(i,o):ok(i,o))&&(Ue=cu(X,"onBeforeInput"),0<Ue.length&&(be=new Fv("onBeforeInput","beforeinput",null,o,ie),re.push({event:be,listeners:Ue}),be.data=Oe)),Qk(re,i,X,o,ie)}A0(re,r)})}function nl(i,r,o){return{instance:i,listener:r,currentTarget:o}}function cu(i,r){for(var o=r+"Capture",c=[];i!==null;){var p=i,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=ko(i,o),p!=null&&c.unshift(nl(i,p,v)),p=ko(i,r),p!=null&&c.push(nl(i,p,v))),i.tag===3)return c;i=i.return}return[]}function iN(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function z0(i,r,o,c,p){for(var v=r._reactName,C=[];o!==null&&o!==c;){var N=o,P=N.alternate,X=N.stateNode;if(N=N.tag,P!==null&&P===c)break;N!==5&&N!==26&&N!==27||X===null||(P=X,p?(X=ko(o,v),X!=null&&C.unshift(nl(o,X,P))):p||(X=ko(o,v),X!=null&&C.push(nl(o,X,P)))),o=o.return}C.length!==0&&i.push({event:r,listeners:C})}var sN=/\r\n?/g,rN=/\u0000|\uFFFD/g;function L0(i){return(typeof i=="string"?i:""+i).replace(sN,`
49
+ `).replace(rN,"")}function B0(i,r){return r=L0(r),L0(i)===r}function Qe(i,r,o,c,p,v){switch(o){case"children":typeof c=="string"?r==="body"||r==="textarea"&&c===""||oa(i,c):(typeof c=="number"||typeof c=="bigint")&&r!=="body"&&oa(i,""+c);break;case"className":fc(i,"class",c);break;case"tabIndex":fc(i,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":fc(i,o,c);break;case"style":Bv(i,c,v);break;case"data":if(r!=="object"){fc(i,"data",c);break}case"src":case"href":if(c===""&&(r!=="a"||o!=="href")){i.removeAttribute(o);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){i.removeAttribute(o);break}c=pc(""+c),i.setAttribute(o,c);break;case"action":case"formAction":if(typeof c=="function"){i.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(o==="formAction"?(r!=="input"&&Qe(i,r,"name",p.name,p,null),Qe(i,r,"formEncType",p.formEncType,p,null),Qe(i,r,"formMethod",p.formMethod,p,null),Qe(i,r,"formTarget",p.formTarget,p,null)):(Qe(i,r,"encType",p.encType,p,null),Qe(i,r,"method",p.method,p,null),Qe(i,r,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){i.removeAttribute(o);break}c=pc(""+c),i.setAttribute(o,c);break;case"onClick":c!=null&&(i.onclick=Bs);break;case"onScroll":c!=null&&He("scroll",i);break;case"onScrollEnd":c!=null&&He("scrollend",i);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(n(61));if(o=c.__html,o!=null){if(p.children!=null)throw Error(n(60));i.innerHTML=o}}break;case"multiple":i.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":i.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){i.removeAttribute("xlink:href");break}o=pc(""+c),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(o,""+c):i.removeAttribute(o);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":c&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(o,""):i.removeAttribute(o);break;case"capture":case"download":c===!0?i.setAttribute(o,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(o,c):i.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?i.setAttribute(o,c):i.removeAttribute(o);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?i.removeAttribute(o):i.setAttribute(o,c);break;case"popover":He("beforetoggle",i),He("toggle",i),dc(i,"popover",c);break;case"xlinkActuate":Ls(i,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Ls(i,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Ls(i,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Ls(i,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Ls(i,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Ls(i,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Ls(i,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Ls(i,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Ls(i,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":dc(i,"is",c);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=ME.get(o)||o,dc(i,o,c))}}function qf(i,r,o,c,p,v){switch(o){case"style":Bv(i,c,v);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(n(61));if(o=c.__html,o!=null){if(p.children!=null)throw Error(n(60));i.innerHTML=o}}break;case"children":typeof c=="string"?oa(i,c):(typeof c=="number"||typeof c=="bigint")&&oa(i,""+c);break;case"onScroll":c!=null&&He("scroll",i);break;case"onScrollEnd":c!=null&&He("scrollend",i);break;case"onClick":c!=null&&(i.onclick=Bs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!jv.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(p=o.endsWith("Capture"),r=o.slice(2,p?o.length-7:void 0),v=i[mi]||null,v=v!=null?v[o]:null,typeof v=="function"&&i.removeEventListener(r,v,p),typeof c=="function")){typeof v!="function"&&v!==null&&(o in i?i[o]=null:i.hasAttribute(o)&&i.removeAttribute(o)),i.addEventListener(r,c,p);break e}o in i?i[o]=c:c===!0?i.setAttribute(o,""):dc(i,o,c)}}}function Qt(i,r,o){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",i),He("load",i);var c=!1,p=!1,v;for(v in o)if(o.hasOwnProperty(v)){var C=o[v];if(C!=null)switch(v){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,r));default:Qe(i,r,v,C,o,null)}}p&&Qe(i,r,"srcSet",o.srcSet,o,null),c&&Qe(i,r,"src",o.src,o,null);return;case"input":He("invalid",i);var N=v=C=p=null,P=null,X=null;for(c in o)if(o.hasOwnProperty(c)){var ie=o[c];if(ie!=null)switch(c){case"name":p=ie;break;case"type":C=ie;break;case"checked":P=ie;break;case"defaultChecked":X=ie;break;case"value":v=ie;break;case"defaultValue":N=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(n(137,r));break;default:Qe(i,r,c,ie,o,null)}}Av(i,v,N,P,X,C,p,!1);return;case"select":He("invalid",i),c=C=v=null;for(p in o)if(o.hasOwnProperty(p)&&(N=o[p],N!=null))switch(p){case"value":v=N;break;case"defaultValue":C=N;break;case"multiple":c=N;default:Qe(i,r,p,N,o,null)}r=v,o=C,i.multiple=!!c,r!=null?aa(i,!!c,r,!1):o!=null&&aa(i,!!c,o,!0);return;case"textarea":He("invalid",i),v=p=c=null;for(C in o)if(o.hasOwnProperty(C)&&(N=o[C],N!=null))switch(C){case"value":c=N;break;case"defaultValue":p=N;break;case"children":v=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(n(91));break;default:Qe(i,r,C,N,o,null)}zv(i,c,p,v);return;case"option":for(P in o)if(o.hasOwnProperty(P)&&(c=o[P],c!=null))switch(P){case"selected":i.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:Qe(i,r,P,c,o,null)}return;case"dialog":He("beforetoggle",i),He("toggle",i),He("cancel",i),He("close",i);break;case"iframe":case"object":He("load",i);break;case"video":case"audio":for(c=0;c<rl.length;c++)He(rl[c],i);break;case"image":He("error",i),He("load",i);break;case"details":He("toggle",i);break;case"embed":case"source":case"link":He("error",i),He("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(X in o)if(o.hasOwnProperty(X)&&(c=o[X],c!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,r));default:Qe(i,r,X,c,o,null)}return;default:if(ad(r)){for(ie in o)o.hasOwnProperty(ie)&&(c=o[ie],c!==void 0&&qf(i,r,ie,c,o,void 0));return}}for(N in o)o.hasOwnProperty(N)&&(c=o[N],c!=null&&Qe(i,r,N,c,o,null))}function nN(i,r,o,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,v=null,C=null,N=null,P=null,X=null,ie=null;for(ee in o){var re=o[ee];if(o.hasOwnProperty(ee)&&re!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":P=re;default:c.hasOwnProperty(ee)||Qe(i,r,ee,null,c,re)}}for(var Q in c){var ee=c[Q];if(re=o[Q],c.hasOwnProperty(Q)&&(ee!=null||re!=null))switch(Q){case"type":v=ee;break;case"name":p=ee;break;case"checked":X=ee;break;case"defaultChecked":ie=ee;break;case"value":C=ee;break;case"defaultValue":N=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(n(137,r));break;default:ee!==re&&Qe(i,r,Q,ee,c,re)}}rd(i,C,N,P,X,ie,v,p);return;case"select":ee=C=N=Q=null;for(v in o)if(P=o[v],o.hasOwnProperty(v)&&P!=null)switch(v){case"value":break;case"multiple":ee=P;default:c.hasOwnProperty(v)||Qe(i,r,v,null,c,P)}for(p in c)if(v=c[p],P=o[p],c.hasOwnProperty(p)&&(v!=null||P!=null))switch(p){case"value":Q=v;break;case"defaultValue":N=v;break;case"multiple":C=v;default:v!==P&&Qe(i,r,p,v,c,P)}r=N,o=C,c=ee,Q!=null?aa(i,!!o,Q,!1):!!c!=!!o&&(r!=null?aa(i,!!o,r,!0):aa(i,!!o,o?[]:"",!1));return;case"textarea":ee=Q=null;for(N in o)if(p=o[N],o.hasOwnProperty(N)&&p!=null&&!c.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Qe(i,r,N,null,c,p)}for(C in c)if(p=c[C],v=o[C],c.hasOwnProperty(C)&&(p!=null||v!=null))switch(C){case"value":Q=p;break;case"defaultValue":ee=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(n(91));break;default:p!==v&&Qe(i,r,C,p,c,v)}Ov(i,Q,ee);return;case"option":for(var ye in o)if(Q=o[ye],o.hasOwnProperty(ye)&&Q!=null&&!c.hasOwnProperty(ye))switch(ye){case"selected":i.selected=!1;break;default:Qe(i,r,ye,null,c,Q)}for(P in c)if(Q=c[P],ee=o[P],c.hasOwnProperty(P)&&Q!==ee&&(Q!=null||ee!=null))switch(P){case"selected":i.selected=Q&&typeof Q!="function"&&typeof Q!="symbol";break;default:Qe(i,r,P,Q,c,ee)}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 Ee in o)Q=o[Ee],o.hasOwnProperty(Ee)&&Q!=null&&!c.hasOwnProperty(Ee)&&Qe(i,r,Ee,null,c,Q);for(X in c)if(Q=c[X],ee=o[X],c.hasOwnProperty(X)&&Q!==ee&&(Q!=null||ee!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(n(137,r));break;default:Qe(i,r,X,Q,c,ee)}return;default:if(ad(r)){for(var Je in o)Q=o[Je],o.hasOwnProperty(Je)&&Q!==void 0&&!c.hasOwnProperty(Je)&&qf(i,r,Je,void 0,c,Q);for(ie in c)Q=c[ie],ee=o[ie],!c.hasOwnProperty(ie)||Q===ee||Q===void 0&&ee===void 0||qf(i,r,ie,Q,c,ee);return}}for(var W in o)Q=o[W],o.hasOwnProperty(W)&&Q!=null&&!c.hasOwnProperty(W)&&Qe(i,r,W,null,c,Q);for(re in c)Q=c[re],ee=o[re],!c.hasOwnProperty(re)||Q===ee||Q==null&&ee==null||Qe(i,r,re,Q,c,ee)}function P0(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function aN(){if(typeof performance.getEntriesByType=="function"){for(var i=0,r=0,o=performance.getEntriesByType("resource"),c=0;c<o.length;c++){var p=o[c],v=p.transferSize,C=p.initiatorType,N=p.duration;if(v&&N&&P0(C)){for(C=0,N=p.responseEnd,c+=1;c<o.length;c++){var P=o[c],X=P.startTime;if(X>N)break;var ie=P.transferSize,re=P.initiatorType;ie&&P0(re)&&(P=P.responseEnd,C+=ie*(P<N?1:(N-X)/(P-X)))}if(--c,r+=8*(v+C)/(p.duration/1e3),i++,10<i)break}}if(0<i)return r/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Yf=null,Gf=null;function uu(i){return i.nodeType===9?i:i.ownerDocument}function H0(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function I0(i,r){if(i===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&r==="foreignObject"?0:i}function Xf(i,r){return i==="textarea"||i==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Zf=null;function oN(){var i=window.event;return i&&i.type==="popstate"?i===Zf?!1:(Zf=i,!0):(Zf=null,!1)}var $0=typeof setTimeout=="function"?setTimeout:void 0,lN=typeof clearTimeout=="function"?clearTimeout:void 0,U0=typeof Promise=="function"?Promise:void 0,cN=typeof queueMicrotask=="function"?queueMicrotask:typeof U0<"u"?function(i){return U0.resolve(null).then(i).catch(uN)}:$0;function uN(i){setTimeout(function(){throw i})}function $r(i){return i==="head"}function F0(i,r){var o=r,c=0;do{var p=o.nextSibling;if(i.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"||o==="/&"){if(c===0){i.removeChild(p),Pa(r);return}c--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")c++;else if(o==="html")al(i.ownerDocument.documentElement);else if(o==="head"){o=i.ownerDocument.head,al(o);for(var v=o.firstChild;v;){var C=v.nextSibling,N=v.nodeName;v[Co]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&v.rel.toLowerCase()==="stylesheet"||o.removeChild(v),v=C}}else o==="body"&&al(i.ownerDocument.body);o=p}while(o);Pa(r)}function V0(i,r){var o=i;i=0;do{var c=o.nextSibling;if(o.nodeType===1?r?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(r?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),c&&c.nodeType===8)if(o=c.data,o==="/$"){if(i===0)break;i--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||i++;o=c}while(o)}function Qf(i){var r=i.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var o=r;switch(r=r.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Qf(o),id(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}i.removeChild(o)}}function hN(i,r,o,c){for(;i.nodeType===1;){var p=o;if(i.nodeName.toLowerCase()!==r.toLowerCase()){if(!c&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(c){if(!i[Co])switch(r){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(v=i.getAttribute("rel"),v==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(v!==p.rel||i.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||i.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||i.getAttribute("title")!==(p.title==null?null:p.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(v=i.getAttribute("src"),(v!==(p.src==null?null:p.src)||i.getAttribute("type")!==(p.type==null?null:p.type)||i.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&v&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(r==="input"&&i.type==="hidden"){var v=p.name==null?null:""+p.name;if(p.type==="hidden"&&i.getAttribute("name")===v)return i}else return i;if(i=Yi(i.nextSibling),i===null)break}return null}function dN(i,r,o){if(r==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=Yi(i.nextSibling),i===null))return null;return i}function W0(i,r){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!r||(i=Yi(i.nextSibling),i===null))return null;return i}function Jf(i){return i.data==="$?"||i.data==="$~"}function em(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function fN(i,r){var o=i.ownerDocument;if(i.data==="$~")i._reactRetry=r;else if(i.data!=="$?"||o.readyState!=="loading")r();else{var c=function(){r(),o.removeEventListener("DOMContentLoaded",c)};o.addEventListener("DOMContentLoaded",c),i._reactRetry=c}}function Yi(i){for(;i!=null;i=i.nextSibling){var r=i.nodeType;if(r===1||r===3)break;if(r===8){if(r=i.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return i}var tm=null;function K0(i){i=i.nextSibling;for(var r=0;i;){if(i.nodeType===8){var o=i.data;if(o==="/$"||o==="/&"){if(r===0)return Yi(i.nextSibling);r--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||r++}i=i.nextSibling}return null}function q0(i){i=i.previousSibling;for(var r=0;i;){if(i.nodeType===8){var o=i.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(r===0)return i;r--}else o!=="/$"&&o!=="/&"||r++}i=i.previousSibling}return null}function Y0(i,r,o){switch(r=uu(o),i){case"html":if(i=r.documentElement,!i)throw Error(n(452));return i;case"head":if(i=r.head,!i)throw Error(n(453));return i;case"body":if(i=r.body,!i)throw Error(n(454));return i;default:throw Error(n(451))}}function al(i){for(var r=i.attributes;r.length;)i.removeAttributeNode(r[0]);id(i)}var Gi=new Map,G0=new Set;function hu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Js=H.d;H.d={f:mN,r:pN,D:gN,C:vN,L:_N,m:yN,X:xN,S:bN,M:SN};function mN(){var i=Js.f(),r=iu();return i||r}function pN(i){var r=sa(i);r!==null&&r.tag===5&&r.type==="form"?dy(r):Js.r(i)}var za=typeof document>"u"?null:document;function X0(i,r,o){var c=za;if(c&&typeof r=="string"&&r){var p=$i(r);p='link[rel="'+i+'"][href="'+p+'"]',typeof o=="string"&&(p+='[crossorigin="'+o+'"]'),G0.has(p)||(G0.add(p),i={rel:i,crossOrigin:o,href:r},c.querySelector(p)===null&&(r=c.createElement("link"),Qt(r,"link",i),Pt(r),c.head.appendChild(r)))}}function gN(i){Js.D(i),X0("dns-prefetch",i,null)}function vN(i,r){Js.C(i,r),X0("preconnect",i,r)}function _N(i,r,o){Js.L(i,r,o);var c=za;if(c&&i&&r){var p='link[rel="preload"][as="'+$i(r)+'"]';r==="image"&&o&&o.imageSrcSet?(p+='[imagesrcset="'+$i(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(p+='[imagesizes="'+$i(o.imageSizes)+'"]')):p+='[href="'+$i(i)+'"]';var v=p;switch(r){case"style":v=La(i);break;case"script":v=Ba(i)}Gi.has(v)||(i=g({rel:"preload",href:r==="image"&&o&&o.imageSrcSet?void 0:i,as:r},o),Gi.set(v,i),c.querySelector(p)!==null||r==="style"&&c.querySelector(ol(v))||r==="script"&&c.querySelector(ll(v))||(r=c.createElement("link"),Qt(r,"link",i),Pt(r),c.head.appendChild(r)))}}function yN(i,r){Js.m(i,r);var o=za;if(o&&i){var c=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+$i(c)+'"][href="'+$i(i)+'"]',v=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Ba(i)}if(!Gi.has(v)&&(i=g({rel:"modulepreload",href:i},r),Gi.set(v,i),o.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(ll(v)))return}c=o.createElement("link"),Qt(c,"link",i),Pt(c),o.head.appendChild(c)}}}function bN(i,r,o){Js.S(i,r,o);var c=za;if(c&&i){var p=ra(c).hoistableStyles,v=La(i);r=r||"default";var C=p.get(v);if(!C){var N={loading:0,preload:null};if(C=c.querySelector(ol(v)))N.loading=5;else{i=g({rel:"stylesheet",href:i,"data-precedence":r},o),(o=Gi.get(v))&&im(i,o);var P=C=c.createElement("link");Pt(P),Qt(P,"link",i),P._p=new Promise(function(X,ie){P.onload=X,P.onerror=ie}),P.addEventListener("load",function(){N.loading|=1}),P.addEventListener("error",function(){N.loading|=2}),N.loading|=4,du(C,r,c)}C={type:"stylesheet",instance:C,count:1,state:N},p.set(v,C)}}}function xN(i,r){Js.X(i,r);var o=za;if(o&&i){var c=ra(o).hoistableScripts,p=Ba(i),v=c.get(p);v||(v=o.querySelector(ll(p)),v||(i=g({src:i,async:!0},r),(r=Gi.get(p))&&sm(i,r),v=o.createElement("script"),Pt(v),Qt(v,"link",i),o.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(p,v))}}function SN(i,r){Js.M(i,r);var o=za;if(o&&i){var c=ra(o).hoistableScripts,p=Ba(i),v=c.get(p);v||(v=o.querySelector(ll(p)),v||(i=g({src:i,async:!0,type:"module"},r),(r=Gi.get(p))&&sm(i,r),v=o.createElement("script"),Pt(v),Qt(v,"link",i),o.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(p,v))}}function Z0(i,r,o,c){var p=(p=he.current)?hu(p):null;if(!p)throw Error(n(446));switch(i){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(r=La(o.href),o=ra(p).hoistableStyles,c=o.get(r),c||(c={type:"style",instance:null,count:0,state:null},o.set(r,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){i=La(o.href);var v=ra(p).hoistableStyles,C=v.get(i);if(C||(p=p.ownerDocument||p,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(i,C),(v=p.querySelector(ol(i)))&&!v._p&&(C.instance=v,C.state.loading=5),Gi.has(i)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Gi.set(i,o),v||wN(p,i,o,C.state))),r&&c===null)throw Error(n(528,""));return C}if(r&&c!==null)throw Error(n(529,""));return null;case"script":return r=o.async,o=o.src,typeof o=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Ba(o),o=ra(p).hoistableScripts,c=o.get(r),c||(c={type:"script",instance:null,count:0,state:null},o.set(r,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,i))}}function La(i){return'href="'+$i(i)+'"'}function ol(i){return'link[rel="stylesheet"]['+i+"]"}function Q0(i){return g({},i,{"data-precedence":i.precedence,precedence:null})}function wN(i,r,o,c){i.querySelector('link[rel="preload"][as="style"]['+r+"]")?c.loading=1:(r=i.createElement("link"),c.preload=r,r.addEventListener("load",function(){return c.loading|=1}),r.addEventListener("error",function(){return c.loading|=2}),Qt(r,"link",o),Pt(r),i.head.appendChild(r))}function Ba(i){return'[src="'+$i(i)+'"]'}function ll(i){return"script[async]"+i}function J0(i,r,o){if(r.count++,r.instance===null)switch(r.type){case"style":var c=i.querySelector('style[data-href~="'+$i(o.href)+'"]');if(c)return r.instance=c,Pt(c),c;var p=g({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return c=(i.ownerDocument||i).createElement("style"),Pt(c),Qt(c,"style",p),du(c,o.precedence,i),r.instance=c;case"stylesheet":p=La(o.href);var v=i.querySelector(ol(p));if(v)return r.state.loading|=4,r.instance=v,Pt(v),v;c=Q0(o),(p=Gi.get(p))&&im(c,p),v=(i.ownerDocument||i).createElement("link"),Pt(v);var C=v;return C._p=new Promise(function(N,P){C.onload=N,C.onerror=P}),Qt(v,"link",c),r.state.loading|=4,du(v,o.precedence,i),r.instance=v;case"script":return v=Ba(o.src),(p=i.querySelector(ll(v)))?(r.instance=p,Pt(p),p):(c=o,(p=Gi.get(v))&&(c=g({},o),sm(c,p)),i=i.ownerDocument||i,p=i.createElement("script"),Pt(p),Qt(p,"link",c),i.head.appendChild(p),r.instance=p);case"void":return null;default:throw Error(n(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(c=r.instance,r.state.loading|=4,du(c,o.precedence,i));return r.instance}function du(i,r,o){for(var c=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,v=p,C=0;C<c.length;C++){var N=c[C];if(N.dataset.precedence===r)v=N;else if(v!==p)break}v?v.parentNode.insertBefore(i,v.nextSibling):(r=o.nodeType===9?o.head:o,r.insertBefore(i,r.firstChild))}function im(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.title==null&&(i.title=r.title)}function sm(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.integrity==null&&(i.integrity=r.integrity)}var fu=null;function eb(i,r,o){if(fu===null){var c=new Map,p=fu=new Map;p.set(o,c)}else p=fu,c=p.get(o),c||(c=new Map,p.set(o,c));if(c.has(i))return c;for(c.set(i,null),o=o.getElementsByTagName(i),p=0;p<o.length;p++){var v=o[p];if(!(v[Co]||v[Yt]||i==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var C=v.getAttribute(r)||"";C=i+C;var N=c.get(C);N?N.push(v):c.set(C,[v])}}return c}function tb(i,r,o){i=i.ownerDocument||i,i.head.insertBefore(o,r==="title"?i.querySelector("head > title"):null)}function CN(i,r,o){if(o===1||r.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return i=r.disabled,typeof r.precedence=="string"&&i==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function ib(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function EN(i,r,o,c){if(o.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var p=La(c.href),v=r.querySelector(ol(p));if(v){r=v._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(i.count++,i=mu.bind(i),r.then(i,i)),o.state.loading|=4,o.instance=v,Pt(v);return}v=r.ownerDocument||r,c=Q0(c),(p=Gi.get(p))&&im(c,p),v=v.createElement("link"),Pt(v);var C=v;C._p=new Promise(function(N,P){C.onload=N,C.onerror=P}),Qt(v,"link",c),o.instance=v}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(o,r),(r=o.state.preload)&&(o.state.loading&3)===0&&(i.count++,o=mu.bind(i),r.addEventListener("load",o),r.addEventListener("error",o))}}var rm=0;function kN(i,r){return i.stylesheets&&i.count===0&&gu(i,i.stylesheets),0<i.count||0<i.imgCount?function(o){var c=setTimeout(function(){if(i.stylesheets&&gu(i,i.stylesheets),i.unsuspend){var v=i.unsuspend;i.unsuspend=null,v()}},6e4+r);0<i.imgBytes&&rm===0&&(rm=62500*aN());var p=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&gu(i,i.stylesheets),i.unsuspend)){var v=i.unsuspend;i.unsuspend=null,v()}},(i.imgBytes>rm?50:800)+r);return i.unsuspend=o,function(){i.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function mu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gu(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var pu=null;function gu(i,r){i.stylesheets=null,i.unsuspend!==null&&(i.count++,pu=new Map,r.forEach(NN,i),pu=null,mu.call(i))}function NN(i,r){if(!(r.state.loading&4)){var o=pu.get(i);if(o)var c=o.get(null);else{o=new Map,pu.set(i,o);for(var p=i.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var C=p[v];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(o.set(C.dataset.precedence,C),c=C)}c&&o.set(null,c)}p=r.instance,C=p.getAttribute("data-precedence"),v=o.get(C)||c,v===c&&o.set(null,p),o.set(C,p),this.count++,c=mu.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),v?v.parentNode.insertBefore(p,v.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(p,i.firstChild)),r.state.loading|=4}}var cl={$$typeof:D,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function jN(i,r,o,c,p,v,C,N,P){this.tag=1,this.containerInfo=i,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=Qh(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qh(0),this.hiddenUpdates=Qh(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=P,this.incompleteTransitions=new Map}function sb(i,r,o,c,p,v,C,N,P,X,ie,re){return i=new jN(i,r,o,C,P,X,ie,re,N),r=1,v===!0&&(r|=24),v=Ni(3,null,null,r),i.current=v,v.stateNode=i,r=Ld(),r.refCount++,i.pooledCache=r,r.refCount++,v.memoizedState={element:c,isDehydrated:o,cache:r},Id(v),i}function rb(i){return i?(i=ma,i):ma}function nb(i,r,o,c,p,v){p=rb(p),c.context===null?c.context=p:c.pendingContext=p,c=Tr(r),c.payload={element:o},v=v===void 0?null:v,v!==null&&(c.callback=v),o=Rr(i,c,r),o!==null&&(bi(o,i,r),$o(o,i,r))}function ab(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var o=i.retryLane;i.retryLane=o!==0&&o<r?o:r}}function nm(i,r){ab(i,r),(i=i.alternate)&&ab(i,r)}function ob(i){if(i.tag===13||i.tag===31){var r=gn(i,67108864);r!==null&&bi(r,i,67108864),nm(i,67108864)}}function lb(i){if(i.tag===13||i.tag===31){var r=Mi();r=Jh(r);var o=gn(i,r);o!==null&&bi(o,i,r),nm(i,r)}}var vu=!0;function DN(i,r,o,c){var p=M.T;M.T=null;var v=H.p;try{H.p=2,am(i,r,o,c)}finally{H.p=v,M.T=p}}function TN(i,r,o,c){var p=M.T;M.T=null;var v=H.p;try{H.p=8,am(i,r,o,c)}finally{H.p=v,M.T=p}}function am(i,r,o,c){if(vu){var p=om(c);if(p===null)Kf(i,r,c,_u,o),ub(i,c);else if(MN(p,i,r,o,c))c.stopPropagation();else if(ub(i,c),r&4&&-1<RN.indexOf(i)){for(;p!==null;){var v=sa(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var C=hn(v.pendingLanes);if(C!==0){var N=v;for(N.pendingLanes|=2,N.entangledLanes|=2;C;){var P=1<<31-Ei(C);N.entanglements[1]|=P,C&=~P}vs(v),(Ke&6)===0&&(eu=Ye()+500,sl(0))}}break;case 31:case 13:N=gn(v,2),N!==null&&bi(N,v,2),iu(),nm(v,2)}if(v=om(c),v===null&&Kf(i,r,c,_u,o),v===p)break;p=v}p!==null&&c.stopPropagation()}else Kf(i,r,c,null,o)}}function om(i){return i=ld(i),lm(i)}var _u=null;function lm(i){if(_u=null,i=ia(i),i!==null){var r=l(i);if(r===null)i=null;else{var o=r.tag;if(o===13){if(i=u(r),i!==null)return i;i=null}else if(o===31){if(i=f(r),i!==null)return i;i=null}else if(o===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null)}}return _u=i,null}function cb(i){switch(i){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(st()){case si:return 2;case Zh:return 8;case ea:case vE:return 32;case yv:return 268435456;default:return 32}default:return 32}}var cm=!1,Ur=null,Fr=null,Vr=null,ul=new Map,hl=new Map,Wr=[],RN="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 ub(i,r){switch(i){case"focusin":case"focusout":Ur=null;break;case"dragenter":case"dragleave":Fr=null;break;case"mouseover":case"mouseout":Vr=null;break;case"pointerover":case"pointerout":ul.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":hl.delete(r.pointerId)}}function dl(i,r,o,c,p,v){return i===null||i.nativeEvent!==v?(i={blockedOn:r,domEventName:o,eventSystemFlags:c,nativeEvent:v,targetContainers:[p]},r!==null&&(r=sa(r),r!==null&&ob(r)),i):(i.eventSystemFlags|=c,r=i.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),i)}function MN(i,r,o,c,p){switch(r){case"focusin":return Ur=dl(Ur,i,r,o,c,p),!0;case"dragenter":return Fr=dl(Fr,i,r,o,c,p),!0;case"mouseover":return Vr=dl(Vr,i,r,o,c,p),!0;case"pointerover":var v=p.pointerId;return ul.set(v,dl(ul.get(v)||null,i,r,o,c,p)),!0;case"gotpointercapture":return v=p.pointerId,hl.set(v,dl(hl.get(v)||null,i,r,o,c,p)),!0}return!1}function hb(i){var r=ia(i.target);if(r!==null){var o=l(r);if(o!==null){if(r=o.tag,r===13){if(r=u(o),r!==null){i.blockedOn=r,Ev(i.priority,function(){lb(o)});return}}else if(r===31){if(r=f(o),r!==null){i.blockedOn=r,Ev(i.priority,function(){lb(o)});return}}else if(r===3&&o.stateNode.current.memoizedState.isDehydrated){i.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}i.blockedOn=null}function yu(i){if(i.blockedOn!==null)return!1;for(var r=i.targetContainers;0<r.length;){var o=om(i.nativeEvent);if(o===null){o=i.nativeEvent;var c=new o.constructor(o.type,o);od=c,o.target.dispatchEvent(c),od=null}else return r=sa(o),r!==null&&ob(r),i.blockedOn=o,!1;r.shift()}return!0}function db(i,r,o){yu(i)&&o.delete(r)}function AN(){cm=!1,Ur!==null&&yu(Ur)&&(Ur=null),Fr!==null&&yu(Fr)&&(Fr=null),Vr!==null&&yu(Vr)&&(Vr=null),ul.forEach(db),hl.forEach(db)}function bu(i,r){i.blockedOn===r&&(i.blockedOn=null,cm||(cm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,AN)))}var xu=null;function fb(i){xu!==i&&(xu=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){xu===i&&(xu=null);for(var r=0;r<i.length;r+=3){var o=i[r],c=i[r+1],p=i[r+2];if(typeof c!="function"){if(lm(c||o)===null)continue;break}var v=sa(o);v!==null&&(i.splice(r,3),r-=3,of(v,{pending:!0,data:p,method:o.method,action:c},c,p))}}))}function Pa(i){function r(P){return bu(P,i)}Ur!==null&&bu(Ur,i),Fr!==null&&bu(Fr,i),Vr!==null&&bu(Vr,i),ul.forEach(r),hl.forEach(r);for(var o=0;o<Wr.length;o++){var c=Wr[o];c.blockedOn===i&&(c.blockedOn=null)}for(;0<Wr.length&&(o=Wr[0],o.blockedOn===null);)hb(o),o.blockedOn===null&&Wr.shift();if(o=(i.ownerDocument||i).$$reactFormReplay,o!=null)for(c=0;c<o.length;c+=3){var p=o[c],v=o[c+1],C=p[mi]||null;if(typeof v=="function")C||fb(o);else if(C){var N=null;if(v&&v.hasAttribute("formAction")){if(p=v,C=v[mi]||null)N=C.formAction;else if(lm(p)!==null)continue}else N=C.action;typeof N=="function"?o[c+1]=N:(o.splice(c,3),c-=3),fb(o)}}}function mb(){function i(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(C){return p=C})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),c||setTimeout(o,20)}function o(){if(!c&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(o,100),function(){c=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function um(i){this._internalRoot=i}Su.prototype.render=um.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(n(409));var o=r.current,c=Mi();nb(o,c,i,r,null,null)},Su.prototype.unmount=um.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;nb(i.current,2,null,i,null,null),iu(),r[ta]=null}};function Su(i){this._internalRoot=i}Su.prototype.unstable_scheduleHydration=function(i){if(i){var r=Cv();i={blockedOn:null,target:i,priority:r};for(var o=0;o<Wr.length&&r!==0&&r<Wr[o].priority;o++);Wr.splice(o,0,i),o===0&&hb(i)}};var pb=t.version;if(pb!=="19.2.8")throw Error(n(527,pb,"19.2.8"));H.findDOMNode=function(i){var r=i._reactInternals;if(r===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=d(r),i=i!==null?_(i):null,i=i===null?null:i.stateNode,i};var ON={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wu.isDisabled&&wu.supportsFiber)try{xo=wu.inject(ON),Ci=wu}catch{}}return ml.createRoot=function(i,r){if(!a(i))throw Error(n(299));var o=!1,c="",p=Sy,v=wy,C=Cy;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(v=r.onCaughtError),r.onRecoverableError!==void 0&&(C=r.onRecoverableError)),r=sb(i,1,!1,null,null,o,c,null,p,v,C,mb),i[ta]=r.current,Wf(i),new um(r)},ml.hydrateRoot=function(i,r,o){if(!a(i))throw Error(n(299));var c=!1,p="",v=Sy,C=wy,N=Cy,P=null;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(v=o.onUncaughtError),o.onCaughtError!==void 0&&(C=o.onCaughtError),o.onRecoverableError!==void 0&&(N=o.onRecoverableError),o.formState!==void 0&&(P=o.formState)),r=sb(i,1,!0,r,o??null,c,p,P,v,C,N,mb),r.context=rb(null),o=r.current,c=Mi(),c=Jh(c),p=Tr(c),p.callback=null,Rr(o,p,c),o=c,r.current.lanes=o,wo(r,o),vs(r),i[ta]=r.current,Wf(i),new Su(r)},ml.version="19.2.8",ml}var jb;function WN(){if(jb)return mm.exports;jb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),mm.exports=VN(),mm.exports}var KN=WN(),Sg=c1(),qN=Object.defineProperty,wg=(e,t)=>qN(e,"name",{value:t,configurable:!0});function op(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}wg(op,"setRef");function u1(...e){return t=>{let s=!1;const n=e.map(a=>{const l=op(a,t);return!s&&typeof l=="function"&&(s=!0),l});if(s)return()=>{for(let a=0;a<n.length;a++){const l=n[a];typeof l=="function"?l():op(e[a],null)}}}}wg(u1,"composeRefs");function mt(...e){return w.useCallback(u1(...e),e)}wg(mt,"useComposedRefs");var YN=Object.defineProperty,hs=(e,t)=>YN(e,"name",{value:t,configurable:!0});function cr(e){const t=w.forwardRef((s,n)=>{let{children:a,...l}=s,u=null,f=!1;const m=[];lp(a)&&typeof Cu=="function"&&(a=Cu(a._payload)),w.Children.forEach(a,b=>{var y;if(g1(b)){f=!0;const x=b;let S="child"in x.props?x.props.child:x.props.children;lp(S)&&typeof Cu=="function"&&(S=Cu(S._payload)),u=GN(x,S),m.push((y=u==null?void 0:u.props)==null?void 0:y.children)}else m.push(b)}),u?u=w.cloneElement(u,void 0,m):!f&&w.Children.count(a)===1&&w.isValidElement(a)&&(u=a);const d=u?p1(u):void 0,_=mt(n,d);if(!u){if(a||a===0)throw new Error(f?QN(e):ZN(e));return a}const g=m1(l,u.props??{});return u.type!==w.Fragment&&(g.ref=n?_:d),w.cloneElement(u,g)});return t.displayName=`${e}.Slot`,t}hs(cr,"createSlot");var h1=cr("Slot"),d1=Symbol.for("radix.slottable");function f1(e){const t=hs(s=>"child"in s?s.children(s.child):s.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=d1,t}hs(f1,"createSlottable");var GN=hs((e,t)=>{if("child"in e.props){const s=e.props.child;return w.isValidElement(s)?w.cloneElement(s,void 0,e.props.children(s.props.children)):null}return w.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function m1(e,t){const s={...t};for(const n in t){const a=e[n],l=t[n];/^on[A-Z]/.test(n)?a&&l?s[n]=(...f)=>{const m=l(...f);return a(...f),m}:a&&(s[n]=a):n==="style"?s[n]={...a,...l}:n==="className"&&(s[n]=[a,l].filter(Boolean).join(" "))}return{...e,...s}}hs(m1,"mergeProps");function p1(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}hs(p1,"getElementRef");function g1(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===d1}hs(g1,"isSlottable");var XN=Symbol.for("react.lazy");function lp(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===XN&&"_payload"in e&&v1(e._payload)}hs(lp,"isLazyComponent");function v1(e){return typeof e=="object"&&e!==null&&"then"in e}hs(v1,"isPromiseLike");var ZN=hs(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),QN=hs(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Cu=co[" use ".trim().toString()],JN=Object.defineProperty,e5=(e,t)=>JN(e,"name",{value:t,configurable:!0}),t5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pt=t5.reduce((e,t)=>{const s=cr(`Primitive.${t}`),n=w.forwardRef((a,l)=>{const{asChild:u,...f}=a,m=u?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(m,{...f,ref:l})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Cg(e,t){e&&Sg.flushSync(()=>e.dispatchEvent(t))}e5(Cg,"dispatchDiscreteCustomEvent");var i5=Object.defineProperty,s5=(e,t)=>i5(e,"name",{value:t,configurable:!0}),r5=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),n5=w.forwardRef(s5(function(t,s){return h.jsx(pt.span,{...t,ref:s,style:{...r5,...t.style}})},"VisuallyHidden")),a5=n5,o5=Object.defineProperty,is=(e,t)=>o5(e,"name",{value:t,configurable:!0});function l5(e,t){const s=w.createContext(t);s.displayName=e+"Context";const n=is(l=>{const{children:u,...f}=l,m=w.useMemo(()=>f,Object.values(f));return h.jsx(s.Provider,{value:m,children:u})},"Provider");n.displayName=e+"Provider";function a(l,u={}){const{optional:f=!1}=u,m=w.useContext(s);if(m)return m;if(t!==void 0)return t;if(!f)throw new Error(`\`${l}\` must be used within \`${e}\``)}return is(a,"useContext"),[n,a]}is(l5,"createContext");function ds(e,t=[]){let s=[];function n(l,u){const f=w.createContext(u);f.displayName=l+"Context";const m=s.length;s=[...s,u];const d=is(g=>{var k;const{scope:b,children:y,...x}=g,S=((k=b==null?void 0:b[e])==null?void 0:k[m])||f,E=w.useMemo(()=>x,Object.values(x));return h.jsx(S.Provider,{value:E,children:y})},"Provider");d.displayName=l+"Provider";function _(g,b,y={}){var k;const{optional:x=!1}=y,S=((k=b==null?void 0:b[e])==null?void 0:k[m])||f,E=w.useContext(S);if(E)return E;if(u!==void 0)return u;if(!x)throw new Error(`\`${g}\` must be used within \`${l}\``)}return is(_,"useContext"),[d,_]}is(n,"createContext");const a=is(()=>{const l=s.map(u=>w.createContext(u));return is(function(f){const m=(f==null?void 0:f[e])||l;return w.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])},"useScope")},"createScope");return a.scopeName=e,[n,_1(a,...t)]}is(ds,"createContextScope");function _1(...e){const t=e[0];if(e.length===1)return t;const s=is(()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return is(function(l){const u=n.reduce((f,{useScope:m,scopeName:d})=>{const g=m(l)[`__scope${d}`];return{...f,...g}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])},"useComposedScopes")},"createScope");return s.scopeName=t.scopeName,s}is(_1,"composeContextScopes");var c5=Object.defineProperty,Wt=(e,t)=>c5(e,"name",{value:t,configurable:!0});function Eg(e){const t=e+"CollectionProvider",[s,n]=ds(t),[a,l]=s(t,{collectionRef:{current:null},itemMap:new Map}),u=Wt(S=>{const{scope:E,children:k}=S,T=w.useRef(null),D=w.useRef(new Map).current;return h.jsx(a,{scope:E,itemMap:D,collectionRef:T,children:k})},"CollectionProvider");u.displayName=t;const f=e+"CollectionSlot",m=cr(f),d=w.forwardRef((S,E)=>{const{scope:k,children:T}=S,D=l(f,k),R=mt(E,D.collectionRef);return h.jsx(m,{ref:R,children:T})});d.displayName=f;const _=e+"CollectionItemSlot",g="data-radix-collection-item",b=cr(_),y=w.forwardRef((S,E)=>{const{scope:k,children:T,...D}=S,R=w.useRef(null),z=mt(E,R),L=l(_,k);return w.useEffect(()=>(L.itemMap.set(R,{ref:R,...D}),()=>void L.itemMap.delete(R))),h.jsx(b,{[g]:"",ref:z,children:T})});y.displayName=_;function x(S){const E=l(e+"CollectionConsumer",S);return w.useCallback(()=>{const T=E.collectionRef.current;if(!T)return[];const D=Array.from(T.querySelectorAll(`[${g}]`));return Array.from(E.itemMap.values()).sort((L,j)=>D.indexOf(L.ref.current)-D.indexOf(j.ref.current))},[E.collectionRef,E.itemMap])}return Wt(x,"useCollection"),[{Provider:u,Slot:d,ItemSlot:y},x,n]}Wt(Eg,"createCollection");var Db=new WeakMap,Nt,zi,_m=(zi=class extends Map{constructor(s){super(s);_b(this,Nt);hm(this,Nt,[...super.keys()]),Db.set(this,!0)}set(s,n){return Db.get(this)&&(this.has(s)?ri(this,Nt)[ri(this,Nt).indexOf(s)]=s:ri(this,Nt).push(s)),super.set(s,n),this}insert(s,n,a){const l=this.has(n),u=ri(this,Nt).length,f=kg(s);let m=f>=0?f:u+f;const d=m<0||m>=u?-1:m;if(d===this.size||l&&d===this.size-1||d===-1)return this.set(n,a),this;const _=this.size+(l?0:1);f<0&&m++;const g=[...ri(this,Nt)];let b,y=!1;for(let x=m;x<_;x++)if(m===x){let S=g[x];g[x]===n&&(S=g[x+1]),l&&this.delete(n),b=this.get(S),this.set(n,a)}else{!y&&g[x-1]===n&&(y=!0);const S=g[y?x:x-1],E=b;b=this.get(S),this.delete(S),this.set(S,E)}return this}with(s,n,a){const l=new zi(this);return l.insert(s,n,a),l}before(s){const n=ri(this,Nt).indexOf(s)-1;if(!(n<0))return this.entryAt(n)}setBefore(s,n,a){const l=ri(this,Nt).indexOf(s);return l===-1?this:this.insert(l,n,a)}after(s){let n=ri(this,Nt).indexOf(s);if(n=n===-1||n===this.size-1?-1:n+1,n!==-1)return this.entryAt(n)}setAfter(s,n,a){const l=ri(this,Nt).indexOf(s);return l===-1?this:this.insert(l+1,n,a)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return hm(this,Nt,[]),super.clear()}delete(s){const n=super.delete(s);return n&&ri(this,Nt).splice(ri(this,Nt).indexOf(s),1),n}deleteAt(s){const n=this.keyAt(s);return n!==void 0?this.delete(n):!1}at(s){const n=Ku(ri(this,Nt),s);if(n!==void 0)return this.get(n)}entryAt(s){const n=Ku(ri(this,Nt),s);if(n!==void 0)return[n,this.get(n)]}indexOf(s){return ri(this,Nt).indexOf(s)}keyAt(s){return Ku(ri(this,Nt),s)}from(s,n){const a=this.indexOf(s);if(a===-1)return;let l=a+n;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.at(l)}keyFrom(s,n){const a=this.indexOf(s);if(a===-1)return;let l=a+n;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.keyAt(l)}find(s,n){let a=0;for(const l of this){if(Reflect.apply(s,n,[l,a,this]))return l;a++}}findIndex(s,n){let a=0;for(const l of this){if(Reflect.apply(s,n,[l,a,this]))return a;a++}return-1}filter(s,n){const a=[];let l=0;for(const u of this)Reflect.apply(s,n,[u,l,this])&&a.push(u),l++;return new zi(a)}map(s,n){const a=[];let l=0;for(const u of this)a.push([u[0],Reflect.apply(s,n,[u,l,this])]),l++;return new zi(a)}reduce(...s){const[n,a]=s;let l=0,u=a??this.at(0);for(const f of this)l===0&&s.length===1?u=f:u=Reflect.apply(n,this,[u,f,l,this]),l++;return u}reduceRight(...s){const[n,a]=s;let l=a??this.at(-1);for(let u=this.size-1;u>=0;u--){const f=this.at(u);u===this.size-1&&s.length===1?l=f:l=Reflect.apply(n,this,[l,f,u,this])}return l}toSorted(s){const n=[...this.entries()].sort(s);return new zi(n)}toReversed(){const s=new zi;for(let n=this.size-1;n>=0;n--){const a=this.keyAt(n),l=this.get(a);s.set(a,l)}return s}toSpliced(...s){const n=[...this.entries()];return n.splice(...s),new zi(n)}slice(s,n){const a=new zi;let l=this.size-1;if(s===void 0)return a;s<0&&(s=s+this.size),n!==void 0&&n>0&&(l=n-1);for(let u=s;u<=l;u++){const f=this.keyAt(u),m=this.get(f);a.set(f,m)}return a}every(s,n){let a=0;for(const l of this){if(!Reflect.apply(s,n,[l,a,this]))return!1;a++}return!0}some(s,n){let a=0;for(const l of this){if(Reflect.apply(s,n,[l,a,this]))return!0;a++}return!1}},Nt=new WeakMap,Wt(zi,"OrderedDict"),zi);function Ku(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const s=y1(e,t);return s===-1?void 0:e[s]}Wt(Ku,"at");function y1(e,t){const s=e.length,n=kg(t),a=n>=0?n:s+n;return a<0||a>=s?-1:a}Wt(y1,"toSafeIndex");function kg(e){return e!==e||e===0?0:Math.trunc(e)}Wt(kg,"toSafeInteger");function u5(e){const t=e+"CollectionProvider",[s,n]=ds(t),[a,l]=s(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new _m,setItemMap:Wt(()=>{},"setItemMap")}),u=Wt(({state:D,...R})=>D?h.jsx(m,{...R,state:D}):h.jsx(f,{...R}),"CollectionProvider");u.displayName=t;const f=Wt(D=>{const R=E();return h.jsx(m,{...D,state:R})},"CollectionInit");f.displayName=t+"Init";const m=Wt(D=>{const{scope:R,children:z,state:L}=D,j=w.useRef(null),[A,V]=w.useState(null),I=mt(j,V),[J,$]=L;return w.useEffect(()=>{if(!A)return;const B=S1(()=>{});return B.observe(A,{childList:!0,subtree:!0}),()=>{B.disconnect()}},[A]),h.jsx(a,{scope:R,itemMap:J,setItemMap:$,collectionRef:I,collectionRefObject:j,collectionElement:A,children:z})},"CollectionProviderImpl");m.displayName=t+"Impl";const d=e+"CollectionSlot",_=cr(d),g=w.forwardRef((D,R)=>{const{scope:z,children:L}=D,j=l(d,z),A=mt(R,j.collectionRef);return h.jsx(_,{ref:A,children:L})});g.displayName=d;const b=e+"CollectionItemSlot",y="data-radix-collection-item",x=cr(b),S=w.forwardRef((D,R)=>{const{scope:z,children:L,...j}=D,A=w.useRef(null),[V,I]=w.useState(null),J=mt(R,A,I),$=l(b,z),{setItemMap:B}=$,K=w.useRef(j);b1(K.current,j)||(K.current=j);const q=K.current;return w.useEffect(()=>{const M=q;return B(H=>V?H.has(V)?H.set(V,{...M,element:V}).toSorted(cp):(H.set(V,{...M,element:V}),H.toSorted(cp)):H),()=>{B(H=>!V||!H.has(V)?H:(H.delete(V),new _m(H)))}},[V,q,B]),h.jsx(x,{[y]:"",ref:J,children:L})});S.displayName=b;function E(){return w.useState(new _m)}Wt(E,"useInitCollection");function k(D){const{itemMap:R}=l(e+"CollectionConsumer",D);return R}return Wt(k,"useCollection"),[{Provider:u,Slot:g,ItemSlot:S},{createCollectionScope:n,useCollection:k,useInitCollection:E}]}Wt(u5,"createCollection");function b1(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const s=Object.keys(e),n=Object.keys(t);if(s.length!==n.length)return!1;for(const a of s)if(!Object.prototype.hasOwnProperty.call(t,a)||e[a]!==t[a])return!1;return!0}Wt(b1,"shallowEqual");function x1(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Wt(x1,"isElementPreceding");function cp(e,t){return!e[1].element||!t[1].element?0:x1(e[1].element,t[1].element)?-1:1}Wt(cp,"sortByDocumentPosition");function S1(e){return new MutationObserver(s=>{for(const n of s)if(n.type==="childList"){e();return}})}Wt(S1,"getChildListObserver");var h5=Object.defineProperty,uo=(e,t)=>h5(e,"name",{value:t,configurable:!0}),w1=!!(typeof window<"u"&&window.document&&window.document.createElement);function Me(e,t,{checkForDefaultPrevented:s=!0}={}){return uo(function(a){if(e==null||e(a),s===!1||!a||!a.defaultPrevented)return t==null?void 0:t(a)},"handleEvent")}uo(Me,"composeEventHandlers");function d5(e){var t;if(!w1)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}uo(d5,"getOwnerWindow");function up(e){if(!w1)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}uo(up,"getOwnerDocument");function C1(e,t=!1){const{activeElement:s}=up(e);if(!(s!=null&&s.nodeName))return null;if(E1(s)&&s.contentDocument)return C1(s.contentDocument.body,t);if(t){const n=s.getAttribute("aria-activedescendant");if(n){const a=up(s).getElementById(n);if(a)return a}}return s}uo(C1,"getActiveElement");function E1(e){return e.tagName==="IFRAME"}uo(E1,"isFrame");var Si=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},f5=Object.defineProperty,m5=(e,t)=>f5(e,"name",{value:t,configurable:!0}),Tb=co[" useEffectEvent ".trim().toString()],Rb=co[" useInsertionEffect ".trim().toString()];function k1(e){if(typeof Tb=="function")return Tb(e);const t=w.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Rb=="function"?Rb(()=>{t.current=e}):Si(()=>{t.current=e}),w.useMemo(()=>((...s)=>{var n;return(n=t.current)==null?void 0:n.call(t,...s)}),[])}m5(k1,"useEffectEvent");var p5=Object.defineProperty,Kl=(e,t)=>p5(e,"name",{value:t,configurable:!0}),g5=co[" useInsertionEffect ".trim().toString()]||Si;function ho({prop:e,defaultProp:t,onChange:s=Kl(()=>{},"onChange"),caller:n}){const[a,l,u]=N1({defaultProp:t,onChange:s}),f=e!==void 0,m=f?e:a,d=w.useCallback(_=>{var g;if(f){const b=j1(_)?_(e):_;b!==e&&((g=u.current)==null||g.call(u,b))}else l(_)},[f,e,l,u]);return[m,d]}Kl(ho,"useControllableState");function N1({defaultProp:e,onChange:t}){const[s,n]=w.useState(e),a=w.useRef(s),l=w.useRef(t);return g5(()=>{l.current=t},[t]),w.useEffect(()=>{var u;a.current!==s&&((u=l.current)==null||u.call(l,s),a.current=s)},[s,a]),[s,n,l]}Kl(N1,"useUncontrolledState");function j1(e){return typeof e=="function"}Kl(j1,"isFunction");var Mb=Symbol("RADIX:SYNC_STATE");function v5(e,t,s,n){const{prop:a,defaultProp:l,onChange:u,caller:f}=t,m=a!==void 0,d=k1(u),_=[{...s,state:l}];n&&_.push(n);const[g,b]=w.useReducer((E,k)=>{if(k.type===Mb)return{...E,state:k.state};const T=e(E,k);return m&&!Object.is(T.state,E.state)&&d(T.state),T},..._),y=g.state,x=w.useRef(y);w.useEffect(()=>{x.current!==y&&(x.current=y,m||d(y))},[y,x,m]);const S=w.useMemo(()=>a!==void 0?{...g,state:a}:g,[g,a]);return w.useEffect(()=>{m&&!Object.is(a,g.state)&&b({type:Mb,state:a})},[a,g.state,m]),[S,b]}Kl(v5,"useControllableStateReducer");var _5=Object.defineProperty,ur=(e,t)=>_5(e,"name",{value:t,configurable:!0});function D1(e,t){return w.useReducer((s,n)=>t[s][n]??s,e)}ur(D1,"useStateMachine");var nn=ur(e=>{const{present:t,children:s}=e,n=T1(t),a=typeof s=="function"?s({present:n.isPresent}):w.Children.only(s),l=R1(n.ref,M1(a));return typeof s=="function"||n.isPresent?w.cloneElement(a,{ref:l}):null},"Presence");function T1(e){const[t,s]=w.useState(),n=w.useRef(null),a=w.useRef(e),l=w.useRef("none"),u=w.useRef(void 0),f=e?"mounted":"unmounted",[m,d]=D1(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{m==="mounted"?(l.current=u.current??qa(n.current),u.current=void 0):l.current="none"},[m]),Si(()=>{const _=n.current,g=a.current;if(g!==e){const y=l.current,x=qa(_);e?(u.current=x,d("MOUNT")):x==="none"||(_==null?void 0:_.display)==="none"?d("UNMOUNT"):d(g&&y!==x?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),Si(()=>{if(t){let _;const g=t.ownerDocument.defaultView??window,b=ur(x=>{const E=qa(n.current).includes(CSS.escape(x.animationName));if(x.target===t&&E&&(d("ANIMATION_END"),!a.current)){const k=t.style.animationFillMode;t.style.animationFillMode="forwards",_=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=k)})}},"handleAnimationEnd"),y=ur(x=>{x.target===t&&(l.current=qa(n.current))},"handleAnimationStart");return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",b),t.addEventListener("animationend",b),()=>{g.clearTimeout(_),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",b),t.removeEventListener("animationend",b)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:w.useCallback(_=>{if(_){const g=getComputedStyle(_);n.current=g,u.current=qa(g)}else n.current=null;s(_)},[])}}ur(T1,"usePresence");function hp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}ur(hp,"setRef");function R1(...e){const t=w.useRef(e);return t.current=e,w.useCallback(s=>{const n=t.current;let a=!1;const l=n.map(u=>{const f=hp(u,s);return!a&&typeof f=="function"&&(a=!0),f});if(a)return()=>{for(let u=0;u<l.length;u++){const f=l[u];typeof f=="function"?f():hp(n[u],null)}}},[])}ur(R1,"useStableComposedRefs");function qa(e){return(e==null?void 0:e.animationName)||"none"}ur(qa,"getAnimationName");function M1(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}ur(M1,"getElementRef");var y5=Object.defineProperty,b5=(e,t)=>y5(e,"name",{value:t,configurable:!0}),x5=co[" useId ".trim().toString()]||(()=>{}),S5=0;function Bn(e){const[t,s]=w.useState(x5());return Si(()=>{e||s(n=>n??String(S5++))},[e]),e||(t?`radix-${t}`:"")}b5(Bn,"useId");var w5=Object.defineProperty,C5=(e,t)=>w5(e,"name",{value:t,configurable:!0}),E5=w.createContext(void 0);function Eh(e){const t=w.useContext(E5);return e||t||"ltr"}C5(Eh,"useDirection");var k5=Object.defineProperty,N5=(e,t)=>k5(e,"name",{value:t,configurable:!0});function hr(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>((...s)=>{var n;return(n=t.current)==null?void 0:n.call(t,...s)}),[])}N5(hr,"useCallbackRef");var j5=Object.defineProperty,Vt=(e,t)=>j5(e,"name",{value:t,configurable:!0}),dp="dismissableLayer.update",D5="dismissableLayer.pointerDownOutside",T5="dismissableLayer.focusOutside",Ab,A1=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ng=w.forwardRef(Vt(function(t,s){const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:a=!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:m,onDismiss:d,..._}=t,g=w.useContext(A1),[b,y]=w.useState(null),x=(b==null?void 0:b.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=w.useState({}),E=mt(s,y),k=Array.from(g.layers),[T]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),D=T?k.indexOf(T):-1,R=b?k.indexOf(b):-1,z=g.layersWithOutsidePointerEventsDisabled.size>0,L=R>=D,j=w.useRef(!1),A=z1($=>{u==null||u($),m==null||m($),$.defaultPrevented||d==null||d()},{ownerDocument:x,deferPointerDownOutside:a,isDeferredPointerDownOutsideRef:j,dismissableSurfaces:g.dismissableSurfaces,shouldHandlePointerDownOutside:w.useCallback($=>{if(!($ instanceof Node))return!1;const B=[...g.branches].some(K=>K.contains($));return L&&!B},[g.branches,L])}),V=L1($=>{if(a&&j.current)return;const B=$.target;[...g.branches].some(q=>q.contains(B))||(f==null||f($),m==null||m($),$.defaultPrevented||d==null||d())},x),I=b?R===k.length-1:!1,J=hr($=>{$.key==="Escape"&&(l==null||l($),!$.defaultPrevented&&d&&($.preventDefault(),d()))});return w.useEffect(()=>{if(I)return x.addEventListener("keydown",J,{capture:!0}),()=>x.removeEventListener("keydown",J,{capture:!0})},[x,I,J]),w.useEffect(()=>{if(b)return n&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(Ab=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(b)),g.layers.add(b),fp(),()=>{n&&(g.layersWithOutsidePointerEventsDisabled.delete(b),g.layersWithOutsidePointerEventsDisabled.size===0&&(x.body.style.pointerEvents=Ab))}},[b,x,n,g]),w.useEffect(()=>()=>{b&&(g.layers.delete(b),g.layersWithOutsidePointerEventsDisabled.delete(b),fp())},[b,g]),w.useEffect(()=>{const $=Vt(()=>S({}),"handleUpdate");return document.addEventListener(dp,$),()=>document.removeEventListener(dp,$)},[]),h.jsx(pt.div,{..._,ref:E,style:{pointerEvents:z?L?"auto":"none":void 0,...t.style},onFocusCapture:Me(t.onFocusCapture,V.onFocusCapture),onBlurCapture:Me(t.onBlurCapture,V.onBlurCapture),onPointerDownCapture:Me(t.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function O1(){const e=w.useContext(A1),[t,s]=w.useState(null);return w.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),s}Vt(O1,"useDismissableLayerSurface");var R5=Vt(()=>!0,"IS_TRUE");function z1(e,t){const{ownerDocument:s=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:l,shouldHandlePointerDownOutside:u=R5}=t,f=hr(e),m=w.useRef(!1),d=w.useRef(!1),_=w.useRef(new Map),g=w.useRef(()=>{});return w.useEffect(()=>{function b(){d.current=!1,a.current=!1,_.current.clear()}Vt(b,"resetOutsideInteraction");function y(){return Array.from(_.current.values()).some(Boolean)}Vt(y,"isOutsideInteractionIntercepted");function x(D){if(!d.current)return;const R=D.target;R instanceof Node&&[...l].some(L=>L.contains(R))||_.current.set(D.type,!0),D.type==="click"&&window.setTimeout(()=>{d.current&&g.current()},0)}Vt(x,"handleInteractionCapture");function S(D){d.current&&_.current.set(D.type,!1)}Vt(S,"handleInteractionBubble");const E=Vt(D=>{if(D.target&&!m.current){let R=function(){s.removeEventListener("click",g.current);const L=y();b(),L||jg(D5,f,z,{discrete:!0})};if(Vt(R,"handleAndDispatchPointerDownOutsideEvent"),!u(D.target)){s.removeEventListener("click",g.current),b(),m.current=!1;return}const z={originalEvent:D};d.current=!0,a.current=n&&D.button===0,_.current.clear(),!n||D.button!==0?R():(s.removeEventListener("click",g.current),g.current=R,s.addEventListener("click",g.current,{once:!0}))}else s.removeEventListener("click",g.current),b();m.current=!1},"handlePointerDown"),k=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const D of k)s.addEventListener(D,x,!0),s.addEventListener(D,S);const T=window.setTimeout(()=>{s.addEventListener("pointerdown",E)},0);return()=>{window.clearTimeout(T),s.removeEventListener("pointerdown",E),s.removeEventListener("click",g.current);for(const D of k)s.removeEventListener(D,x,!0),s.removeEventListener(D,S)}},[s,f,n,a,l,u]),{onPointerDownCapture:Vt(()=>m.current=!0,"onPointerDownCapture")}}Vt(z1,"usePointerDownOutside");function L1(e,t=globalThis==null?void 0:globalThis.document){const s=hr(e),n=w.useRef(!1);return w.useEffect(()=>{const a=Vt(l=>{l.target&&!n.current&&jg(T5,s,{originalEvent:l},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,s]),{onFocusCapture:Vt(()=>n.current=!0,"onFocusCapture"),onBlurCapture:Vt(()=>n.current=!1,"onBlurCapture")}}Vt(L1,"useFocusOutside");function fp(){const e=new CustomEvent(dp);document.dispatchEvent(e)}Vt(fp,"dispatchUpdate");function jg(e,t,s,{discrete:n}){const a=s.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});t&&a.addEventListener(e,t,{once:!0}),n?Cg(a,l):a.dispatchEvent(l)}Vt(jg,"handleAndDispatchCustomEvent");var M5=Object.defineProperty,ui=(e,t)=>M5(e,"name",{value:t,configurable:!0}),ym="focusScope.autoFocusOnMount",bm="focusScope.autoFocusOnUnmount",Ob={bubbles:!1,cancelable:!0},B1=w.forwardRef(ui(function(t,s){const{loop:n=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:u,...f}=t,[m,d]=w.useState(null),_=hr(l),g=hr(u),b=w.useRef(null),y=mt(s,d),x=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(a){let E=function(R){if(x.paused||!m)return;const z=R.target;m.contains(z)?b.current=z:sr(b.current,{select:!0})},k=function(R){if(x.paused||!m)return;const z=R.relatedTarget;z!==null&&(m.contains(z)||sr(b.current,{select:!0}))},T=function(R){if(document.activeElement===document.body)for(const L of R)L.removedNodes.length>0&&sr(m)};ui(E,"handleFocusIn"),ui(k,"handleFocusOut"),ui(T,"handleMutations"),document.addEventListener("focusin",E),document.addEventListener("focusout",k);const D=new MutationObserver(T);return m&&D.observe(m,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",k),D.disconnect()}}},[a,m,x.paused]),w.useEffect(()=>{if(m){zb.add(x);const E=document.activeElement;if(!m.contains(E)){const T=new CustomEvent(ym,Ob);m.addEventListener(ym,_),m.dispatchEvent(T),T.defaultPrevented||(P1(F1(Dg(m)),{select:!0}),document.activeElement===E&&sr(m))}return()=>{m.removeEventListener(ym,_),setTimeout(()=>{const T=new CustomEvent(bm,Ob);m.addEventListener(bm,g),m.dispatchEvent(T),T.defaultPrevented||sr(E??document.body,{select:!0}),m.removeEventListener(bm,g),zb.remove(x)},0)}}},[m,_,g,x]);const S=w.useCallback(E=>{if(!n&&!a||x.paused)return;const k=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,T=document.activeElement;if(k&&T){const D=E.currentTarget,[R,z]=H1(D);R&&z?!E.shiftKey&&T===z?(E.preventDefault(),n&&sr(R,{select:!0})):E.shiftKey&&T===R&&(E.preventDefault(),n&&sr(z,{select:!0})):T===D&&E.preventDefault()}},[n,a,x.paused]);return h.jsx(pt.div,{tabIndex:-1,...f,ref:y,onKeyDown:S})},"FocusScope"));function P1(e,{select:t=!1}={}){const s=document.activeElement;for(const n of e)if(sr(n,{select:t}),document.activeElement!==s)return}ui(P1,"focusFirst");function H1(e){const t=Dg(e),s=mp(t,e),n=mp(t.reverse(),e);return[s,n]}ui(H1,"getTabbableEdges");function Dg(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ui(n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;s.nextNode();)t.push(s.currentNode);return t}ui(Dg,"getTabbableCandidates");function mp(e,t){const s=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const n of e)if(!(s?!n.checkVisibility({checkVisibilityCSS:!0}):I1(n,{upTo:t})))return n}ui(mp,"findVisible");function I1(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}ui(I1,"isHidden");function $1(e){return e instanceof HTMLInputElement&&"select"in e}ui($1,"isSelectableInput");function sr(e,{select:t=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&$1(e)&&t&&e.select()}}ui(sr,"focus");var zb=U1();function U1(){let e=[];return{add(t){const s=e[0];t!==s&&(s==null||s.pause()),e=pp(e,t),e.unshift(t)},remove(t){var s;e=pp(e,t),(s=e[0])==null||s.resume()}}}ui(U1,"createFocusScopesStack");function pp(e,t){const s=[...e],n=s.indexOf(t);return n!==-1&&s.splice(n,1),s}ui(pp,"arrayRemove");function F1(e){return e.filter(t=>t.tagName!=="A")}ui(F1,"removeLinks");var A5=Object.defineProperty,O5=(e,t)=>A5(e,"name",{value:t,configurable:!0}),Tg=w.forwardRef(O5(function(t,s){var m;const{container:n,...a}=t,[l,u]=w.useState(!1);Si(()=>u(!0),[]);const f=n||l&&((m=globalThis==null?void 0:globalThis.document)==null?void 0:m.body);return f?Sg.createPortal(h.jsx(pt.div,{...a,ref:s}),f):null},"Portal")),z5=Object.defineProperty,Rg=(e,t)=>z5(e,"name",{value:t,configurable:!0}),Eu=0,_s=null;function L5(e){return kh(),e.children}Rg(L5,"FocusGuards");function kh(){w.useEffect(()=>{_s||(_s={start:gp(),end:gp()});const{start:e,end:t}=_s;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Eu++,()=>{Eu===1&&(_s==null||_s.start.remove(),_s==null||_s.end.remove(),_s=null),Eu=Math.max(0,Eu-1)}},[])}Rg(kh,"useFocusGuards");function gp(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}Rg(gp,"createFocusGuard");var Es=function(){return Es=Object.assign||function(t){for(var s,n=1,a=arguments.length;n<a;n++){s=arguments[n];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(t[l]=s[l])}return t},Es.apply(this,arguments)};function V1(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(s[n[a]]=e[n[a]]);return s}function B5(e,t,s){if(s||arguments.length===2)for(var n=0,a=t.length,l;n<a;n++)(l||!(n in t))&&(l||(l=Array.prototype.slice.call(t,0,n)),l[n]=t[n]);return e.concat(l||Array.prototype.slice.call(t))}var qu="right-scroll-bar-position",Yu="width-before-scroll-bar",P5="with-scroll-bars-hidden",H5="--removed-body-scroll-bar-size";function xm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function I5(e,t){var s=w.useState(function(){return{value:e,callback:t,facade:{get current(){return s.value},set current(n){var a=s.value;a!==n&&(s.value=n,s.callback(n,a))}}}})[0];return s.callback=t,s.facade}var $5=typeof window<"u"?w.useLayoutEffect:w.useEffect,Lb=new WeakMap;function U5(e,t){var s=I5(null,function(n){return e.forEach(function(a){return xm(a,n)})});return $5(function(){var n=Lb.get(s);if(n){var a=new Set(n),l=new Set(e),u=s.current;a.forEach(function(f){l.has(f)||xm(f,null)}),l.forEach(function(f){a.has(f)||xm(f,u)})}Lb.set(s,e)},[e]),s}function F5(e){return e}function V5(e,t){t===void 0&&(t=F5);var s=[],n=!1,a={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:e},useMedium:function(l){var u=t(l,n);return s.push(u),function(){s=s.filter(function(f){return f!==u})}},assignSyncMedium:function(l){for(n=!0;s.length;){var u=s;s=[],u.forEach(l)}s={push:function(f){return l(f)},filter:function(){return s}}},assignMedium:function(l){n=!0;var u=[];if(s.length){var f=s;s=[],f.forEach(l),u=s}var m=function(){var _=u;u=[],_.forEach(l)},d=function(){return Promise.resolve().then(m)};d(),s={push:function(_){u.push(_),d()},filter:function(_){return u=u.filter(_),s}}}};return a}function W5(e){e===void 0&&(e={});var t=V5(null);return t.options=Es({async:!0,ssr:!1},e),t}var W1=function(e){var t=e.sideCar,s=V1(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return w.createElement(n,Es({},s))};W1.isSideCarExport=!0;function K5(e,t){return e.useMedium(t),W1}var K1=W5(),Sm=function(){},Nh=w.forwardRef(function(e,t){var s=w.useRef(null),n=w.useState({onScrollCapture:Sm,onWheelCapture:Sm,onTouchMoveCapture:Sm}),a=n[0],l=n[1],u=e.forwardProps,f=e.children,m=e.className,d=e.removeScrollBar,_=e.enabled,g=e.shards,b=e.sideCar,y=e.noRelative,x=e.noIsolation,S=e.inert,E=e.allowPinchZoom,k=e.as,T=k===void 0?"div":k,D=e.gapMode,R=V1(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),z=b,L=U5([s,t]),j=Es(Es({},R),a);return w.createElement(w.Fragment,null,_&&w.createElement(z,{sideCar:K1,removeScrollBar:d,shards:g,noRelative:y,noIsolation:x,inert:S,setCallbacks:l,allowPinchZoom:!!E,lockRef:s,gapMode:D}),u?w.cloneElement(w.Children.only(f),Es(Es({},j),{ref:L})):w.createElement(T,Es({},j,{className:m,ref:L}),f))});Nh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Nh.classNames={fullWidth:Yu,zeroRight:qu};var q5=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Y5(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=q5();return t&&e.setAttribute("nonce",t),e}function G5(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function X5(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Z5=function(){var e=0,t=null;return{add:function(s){e==0&&(t=Y5())&&(G5(t,s),X5(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Q5=function(){var e=Z5();return function(t,s){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&s])}},q1=function(){var e=Q5(),t=function(s){var n=s.styles,a=s.dynamic;return e(n,a),null};return t},J5={left:0,top:0,right:0,gap:0},wm=function(e){return parseInt(e||"",10)||0},ej=function(e){var t=window.getComputedStyle(document.body),s=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[wm(s),wm(n),wm(a)]},tj=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return J5;var t=ej(e),s=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-s+t[2]-t[0])}},ij=q1(),Za="data-scroll-locked",sj=function(e,t,s,n){var a=e.left,l=e.top,u=e.right,f=e.gap;return s===void 0&&(s="margin"),`
50
+ .`.concat(P5,` {
51
+ overflow: hidden `).concat(n,`;
52
+ padding-right: `).concat(f,"px ").concat(n,`;
53
+ }
54
+ body[`).concat(Za,`] {
55
+ overflow: hidden `).concat(n,`;
56
+ overscroll-behavior: contain;
57
+ `).concat([t&&"position: relative ".concat(n,";"),s==="margin"&&`
58
+ padding-left: `.concat(a,`px;
59
+ padding-top: `).concat(l,`px;
60
+ padding-right: `).concat(u,`px;
61
+ margin-left:0;
62
+ margin-top:0;
63
+ margin-right: `).concat(f,"px ").concat(n,`;
64
+ `),s==="padding"&&"padding-right: ".concat(f,"px ").concat(n,";")].filter(Boolean).join(""),`
65
+ }
66
+
67
+ .`).concat(qu,` {
68
+ right: `).concat(f,"px ").concat(n,`;
69
+ }
70
+
71
+ .`).concat(Yu,` {
72
+ margin-right: `).concat(f,"px ").concat(n,`;
73
+ }
74
+
75
+ .`).concat(qu," .").concat(qu,` {
76
+ right: 0 `).concat(n,`;
77
+ }
78
+
79
+ .`).concat(Yu," .").concat(Yu,` {
80
+ margin-right: 0 `).concat(n,`;
81
+ }
82
+
83
+ body[`).concat(Za,`] {
84
+ `).concat(H5,": ").concat(f,`px;
85
+ }
86
+ `)},Bb=function(){var e=parseInt(document.body.getAttribute(Za)||"0",10);return isFinite(e)?e:0},rj=function(){w.useEffect(function(){return document.body.setAttribute(Za,(Bb()+1).toString()),function(){var e=Bb()-1;e<=0?document.body.removeAttribute(Za):document.body.setAttribute(Za,e.toString())}},[])},nj=function(e){var t=e.noRelative,s=e.noImportant,n=e.gapMode,a=n===void 0?"margin":n;rj();var l=w.useMemo(function(){return tj(a)},[a]);return w.createElement(ij,{styles:sj(l,!t,a,s?"":"!important")})},vp=!1;if(typeof window<"u")try{var ku=Object.defineProperty({},"passive",{get:function(){return vp=!0,!0}});window.addEventListener("test",ku,ku),window.removeEventListener("test",ku,ku)}catch{vp=!1}var Ha=vp?{passive:!1}:!1,aj=function(e){return e.tagName==="TEXTAREA"},Y1=function(e,t){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[t]!=="hidden"&&!(s.overflowY===s.overflowX&&!aj(e)&&s[t]==="visible")},oj=function(e){return Y1(e,"overflowY")},lj=function(e){return Y1(e,"overflowX")},Pb=function(e,t){var s=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var a=G1(e,n);if(a){var l=X1(e,n),u=l[1],f=l[2];if(u>f)return!0}n=n.parentNode}while(n&&n!==s.body);return!1},cj=function(e){var t=e.scrollTop,s=e.scrollHeight,n=e.clientHeight;return[t,s,n]},uj=function(e){var t=e.scrollLeft,s=e.scrollWidth,n=e.clientWidth;return[t,s,n]},G1=function(e,t){return e==="v"?oj(t):lj(t)},X1=function(e,t){return e==="v"?cj(t):uj(t)},hj=function(e,t){return e==="h"&&t==="rtl"?-1:1},dj=function(e,t,s,n,a){var l=hj(e,window.getComputedStyle(t).direction),u=l*n,f=s.target,m=t.contains(f),d=!1,_=u>0,g=0,b=0;do{if(!f)break;var y=X1(e,f),x=y[0],S=y[1],E=y[2],k=S-E-l*x;(x||k)&&G1(e,f)&&(g+=k,b+=x);var T=f.parentNode;f=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(_&&Math.abs(g)<1||!_&&Math.abs(b)<1)&&(d=!0),d},Nu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Hb=function(e){return[e.deltaX,e.deltaY]},Ib=function(e){return e&&"current"in e?e.current:e},fj=function(e,t){return e[0]===t[0]&&e[1]===t[1]},mj=function(e){return`
87
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
88
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
89
+ `)},pj=0,Ia=[];function gj(e){var t=w.useRef([]),s=w.useRef([0,0]),n=w.useRef(),a=w.useState(pj++)[0],l=w.useState(q1)[0],u=w.useRef(e);w.useEffect(function(){u.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var S=B5([e.lockRef.current],(e.shards||[]).map(Ib),!0).filter(Boolean);return S.forEach(function(E){return E.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),S.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var f=w.useCallback(function(S,E){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!u.current.allowPinchZoom;var k=Nu(S),T=s.current,D="deltaX"in S?S.deltaX:T[0]-k[0],R="deltaY"in S?S.deltaY:T[1]-k[1],z,L=S.target,j=Math.abs(D)>Math.abs(R)?"h":"v";if("touches"in S&&j==="h"&&L.type==="range")return!1;var A=window.getSelection(),V=A&&A.anchorNode,I=V?V===L||V.contains(L):!1;if(I)return!1;var J=Pb(j,L);if(!J)return!0;if(J?z=j:(z=j==="v"?"h":"v",J=Pb(j,L)),!J)return!1;if(!n.current&&"changedTouches"in S&&(D||R)&&(n.current=z),!z)return!0;var $=n.current||z;return dj($,E,S,$==="h"?D:R)},[]),m=w.useCallback(function(S){var E=S;if(!(!Ia.length||Ia[Ia.length-1]!==l)){var k="deltaY"in E?Hb(E):Nu(E),T=t.current.filter(function(z){return z.name===E.type&&(z.target===E.target||E.target===z.shadowParent)&&fj(z.delta,k)})[0];if(T&&T.should){E.cancelable&&E.preventDefault();return}if(!T){var D=(u.current.shards||[]).map(Ib).filter(Boolean).filter(function(z){return z.contains(E.target)}),R=D.length>0?f(E,D[0]):!u.current.noIsolation;R&&E.cancelable&&E.preventDefault()}}},[]),d=w.useCallback(function(S,E,k,T){var D={name:S,delta:E,target:k,should:T,shadowParent:vj(k)};t.current.push(D),setTimeout(function(){t.current=t.current.filter(function(R){return R!==D})},1)},[]),_=w.useCallback(function(S){s.current=Nu(S),n.current=void 0},[]),g=w.useCallback(function(S){d(S.type,Hb(S),S.target,f(S,e.lockRef.current))},[]),b=w.useCallback(function(S){d(S.type,Nu(S),S.target,f(S,e.lockRef.current))},[]);w.useEffect(function(){return Ia.push(l),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",m,Ha),document.addEventListener("touchmove",m,Ha),document.addEventListener("touchstart",_,Ha),function(){Ia=Ia.filter(function(S){return S!==l}),document.removeEventListener("wheel",m,Ha),document.removeEventListener("touchmove",m,Ha),document.removeEventListener("touchstart",_,Ha)}},[]);var y=e.removeScrollBar,x=e.inert;return w.createElement(w.Fragment,null,x?w.createElement(l,{styles:mj(a)}):null,y?w.createElement(nj,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function vj(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const _j=K5(K1,gj);var Mg=w.forwardRef(function(e,t){return w.createElement(Nh,Es({},e,{ref:t,sideCar:_j}))});Mg.classNames=Nh.classNames;var yj=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},$a=new WeakMap,ju=new WeakMap,Du={},Cm=0,Z1=function(e){return e&&(e.host||Z1(e.parentNode))},bj=function(e,t){return t.map(function(s){if(e.contains(s))return s;var n=Z1(s);return n&&e.contains(n)?n:(console.error("aria-hidden",s,"in not contained inside",e,". Doing nothing"),null)}).filter(function(s){return!!s})},xj=function(e,t,s,n){var a=bj(t,Array.isArray(e)?e:[e]);Du[s]||(Du[s]=new WeakMap);var l=Du[s],u=[],f=new Set,m=new Set(a),d=function(g){!g||f.has(g)||(f.add(g),d(g.parentNode))};a.forEach(d);var _=function(g){!g||m.has(g)||Array.prototype.forEach.call(g.children,function(b){if(f.has(b))_(b);else try{var y=b.getAttribute(n),x=y!==null&&y!=="false",S=($a.get(b)||0)+1,E=(l.get(b)||0)+1;$a.set(b,S),l.set(b,E),u.push(b),S===1&&x&&ju.set(b,!0),E===1&&b.setAttribute(s,"true"),x||b.setAttribute(n,"true")}catch(k){console.error("aria-hidden: cannot operate on ",b,k)}})};return _(t),f.clear(),Cm++,function(){u.forEach(function(g){var b=$a.get(g)-1,y=l.get(g)-1;$a.set(g,b),l.set(g,y),b||(ju.has(g)||g.removeAttribute(n),ju.delete(g)),y||g.removeAttribute(s)}),Cm--,Cm||($a=new WeakMap,$a=new WeakMap,ju=new WeakMap,Du={})}},Q1=function(e,t,s){s===void 0&&(s="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=yj(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),xj(n,a,s,"aria-hidden")):function(){return null}},Sj=Object.defineProperty,Hi=(e,t)=>Sj(e,"name",{value:t,configurable:!0}),Ag="Dialog",[J1,ew]=ds(Ag),[wj,fs]=J1(Ag),tw=Hi(e=>{const{__scopeDialog:t,children:s,open:n,defaultOpen:a,onOpenChange:l,modal:u=!0}=e,f=w.useRef(null),m=w.useRef(null),[d,_]=ho({prop:n,defaultProp:a??!1,onChange:l,caller:Ag}),[g,b]=w.useState(0),[y,x]=w.useState(0);return h.jsx(wj,{scope:t,triggerRef:f,contentRef:m,contentId:Bn(),titleId:Bn(),descriptionId:Bn(),titlePresent:g>0,descriptionPresent:y>0,setTitleCount:b,setDescriptionCount:x,open:d,onOpenChange:_,onOpenToggle:w.useCallback(()=>_(S=>!S),[_]),modal:u,children:s})},"Dialog"),Cj="DialogTrigger",Ej=w.forwardRef(Hi(function(t,s){const{__scopeDialog:n,...a}=t,l=fs(Cj,n),u=mt(s,l.triggerRef);return h.jsx(pt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":Dh(l.open),...a,ref:u,onClick:Me(t.onClick,l.onOpenToggle)})},"DialogTrigger")),iw="DialogPortal",[kj,sw]=J1(iw,{forceMount:void 0}),rw=Hi(e=>{const{__scopeDialog:t,forceMount:s,children:n,container:a}=e,l=fs(iw,t);return h.jsx(kj,{scope:t,forceMount:s,children:w.Children.map(n,u=>h.jsx(nn,{present:s||l.open,children:h.jsx(Tg,{asChild:!0,container:a,children:u})}))})},"DialogPortal"),_p="DialogOverlay",nw=w.forwardRef(Hi(function(t,s){const n=sw(_p,t.__scopeDialog),{forceMount:a=n.forceMount,...l}=t,u=fs(_p,t.__scopeDialog);return u.modal?h.jsx(nn,{present:a||u.open,children:h.jsx(jj,{...l,ref:s})}):null},"DialogOverlay")),Nj=cr("DialogOverlay.RemoveScroll"),jj=w.forwardRef(Hi(function(t,s){const{__scopeDialog:n,...a}=t,l=fs(_p,n),u=O1(),f=mt(s,u);return h.jsx(Mg,{as:Nj,allowPinchZoom:!0,shards:[l.contentRef],children:h.jsx(pt.div,{"data-state":Dh(l.open),...a,ref:f,style:{pointerEvents:"auto",...a.style}})})},"DialogOverlayImpl")),Ll="DialogContent",aw=w.forwardRef(Hi(function(t,s){const n=sw(Ll,t.__scopeDialog),{forceMount:a=n.forceMount,...l}=t,u=fs(Ll,t.__scopeDialog);return h.jsx(nn,{present:a||u.open,children:u.modal?h.jsx(Dj,{...l,ref:s}):h.jsx(Tj,{...l,ref:s})})},"DialogContent")),Dj=w.forwardRef(Hi(function(t,s){const n=fs(Ll,t.__scopeDialog),a=w.useRef(null),l=mt(s,n.contentRef,a);return w.useEffect(()=>{const u=a.current;if(u)return Q1(u)},[]),h.jsx(ow,{...t,ref:l,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Me(t.onCloseAutoFocus,u=>{var f;u.preventDefault(),(f=n.triggerRef.current)==null||f.focus()}),onPointerDownOutside:Me(t.onPointerDownOutside,u=>{const f=u.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0;(f.button===2||m)&&u.preventDefault()}),onFocusOutside:Me(t.onFocusOutside,u=>u.preventDefault())})},"DialogContentModal")),Tj=w.forwardRef(Hi(function(t,s){const n=fs(Ll,t.__scopeDialog),a=w.useRef(!1),l=w.useRef(!1);return h.jsx(ow,{...t,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{var f,m;(f=t.onCloseAutoFocus)==null||f.call(t,u),u.defaultPrevented||(a.current||(m=n.triggerRef.current)==null||m.focus(),u.preventDefault()),a.current=!1,l.current=!1},onInteractOutside:u=>{var d,_;(d=t.onInteractOutside)==null||d.call(t,u),u.defaultPrevented||(a.current=!0,u.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const f=u.target;((_=n.triggerRef.current)==null?void 0:_.contains(f))&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&l.current&&u.preventDefault()}})},"DialogContentNonModal")),ow=w.forwardRef(Hi(function(t,s){const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:u,...f}=t,m=fs(Ll,n);return kh(),h.jsx(h.Fragment,{children:h.jsx(B1,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:u,children:h.jsx(Ng,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionPresent?m.descriptionId:void 0,"aria-labelledby":m.titlePresent?m.titleId:void 0,"data-state":Dh(m.open),...f,ref:s,deferPointerDownOutside:!0,onDismiss:()=>m.onOpenChange(!1)})})})},"DialogContentImpl")),Rj="DialogTitle",lw=w.forwardRef(Hi(function(t,s){const{__scopeDialog:n,...a}=t,l=fs(Rj,n),{setTitleCount:u}=l;return Si(()=>(u(f=>f+1),()=>u(f=>f-1)),[u]),h.jsx(pt.h2,{id:l.titleId,...a,ref:s})},"DialogTitle")),Mj="DialogDescription",cw=w.forwardRef(Hi(function(t,s){const{__scopeDialog:n,...a}=t,l=fs(Mj,n),{setDescriptionCount:u}=l;return Si(()=>(u(f=>f+1),()=>u(f=>f-1)),[u]),h.jsx(pt.p,{id:l.descriptionId,...a,ref:s})},"DialogDescription")),Aj="DialogClose",jh=w.forwardRef(Hi(function(t,s){const{__scopeDialog:n,...a}=t,l=fs(Aj,n);return h.jsx(pt.button,{type:"button",...a,ref:s,onClick:Me(t.onClick,()=>l.onOpenChange(!1))})},"DialogClose"));function Dh(e){return e?"open":"closed"}Hi(Dh,"getState");var Oj=Object.defineProperty,mr=(e,t)=>Oj(e,"name",{value:t,configurable:!0}),zj="AlertDialog",[Lj,g8]=ds(zj,[ew]),pr=ew(),Bj=mr(e=>{const{__scopeAlertDialog:t,...s}=e,n=pr(t);return h.jsx(tw,{...n,...s,modal:!0})},"AlertDialog");w.forwardRef(mr(function(t,s){const{__scopeAlertDialog:n,...a}=t,l=pr(n);return h.jsx(Ej,{...l,...a,ref:s})},"AlertDialogTrigger"));var Pj=mr(e=>{const{__scopeAlertDialog:t,...s}=e,n=pr(t);return h.jsx(rw,{...n,...s})},"AlertDialogPortal"),Hj=w.forwardRef(mr(function(t,s){const{__scopeAlertDialog:n,...a}=t,l=pr(n);return h.jsx(nw,{...l,...a,ref:s})},"AlertDialogOverlay")),Ij="AlertDialogContent",[$j,Uj]=Lj(Ij),Fj=w.forwardRef(mr(function(t,s){const{__scopeAlertDialog:n,children:a,...l}=t,u=pr(n),f=w.useRef(null),m=mt(s,f),d=w.useRef(null);return h.jsx($j,{scope:n,cancelRef:d,children:h.jsx(aw,{role:"alertdialog",...u,...l,ref:m,onOpenAutoFocus:Me(l.onOpenAutoFocus,_=>{var g;_.preventDefault(),(g=d.current)==null||g.focus({preventScroll:!0})}),onPointerDownOutside:_=>_.preventDefault(),onInteractOutside:_=>_.preventDefault(),children:a})})},"AlertDialogContent")),Vj=w.forwardRef(mr(function(t,s){const{__scopeAlertDialog:n,...a}=t,l=pr(n);return h.jsx(lw,{...l,...a,ref:s})},"AlertDialogTitle")),Wj=w.forwardRef(mr(function(t,s){const{__scopeAlertDialog:n,...a}=t,l=pr(n);return h.jsx(cw,{...l,...a,ref:s})},"AlertDialogDescription")),Kj=w.forwardRef(mr(function(t,s){const{__scopeAlertDialog:n,...a}=t,l=pr(n);return h.jsx(jh,{...l,...a,ref:s})},"AlertDialogAction")),qj="AlertDialogCancel",Yj=w.forwardRef(mr(function(t,s){const{__scopeAlertDialog:n,...a}=t,{cancelRef:l}=Uj(qj,n),u=pr(n),f=mt(s,l);return h.jsx(jh,{...u,...a,ref:f})},"AlertDialogCancel")),Gj=Bj,Xj=Pj,Zj=Hj,Qj=Fj,Jj=Kj,eD=Yj,tD=Vj,iD=Wj,sD=Object.defineProperty,rD=(e,t)=>sD(e,"name",{value:t,configurable:!0});function uw(e){const[t,s]=w.useState(void 0);return Si(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const l=a[0];let u,f;if("borderBoxSize"in l){const m=l.borderBoxSize,d=Array.isArray(m)?m[0]:m;u=d.inlineSize,f=d.blockSize}else u=e.offsetWidth,f=e.offsetHeight;s({width:u,height:f})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else s(void 0)},[e]),t}rD(uw,"useSize");const nD=["top","right","bottom","left"],sn=Math.min,nr=Math.max,ah=Math.round,Tu=Math.floor,ar=e=>({x:e,y:e}),aD={left:"right",right:"left",bottom:"top",top:"bottom"};function hw(e,t,s){return nr(e,sn(t,s))}function dr(e,t){return typeof e=="function"?e(t):e}function rn(e){return e.split("-")[0]}function fo(e){return e.split("-")[1]}function Og(e){return e==="x"?"y":"x"}function zg(e){return e==="y"?"height":"width"}function Ns(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Lg(e){return Og(Ns(e))}function oD(e,t,s){s===void 0&&(s=!1);const n=fo(e),a=Lg(e),l=zg(a);let u=a==="x"?n===(s?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(u=oh(u)),[u,oh(u)]}function lD(e){const t=oh(e);return[yp(e),t,yp(t)]}function yp(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const $b=["left","right"],Ub=["right","left"],cD=["top","bottom"],uD=["bottom","top"];function hD(e,t,s){switch(e){case"top":case"bottom":return s?t?Ub:$b:t?$b:Ub;case"left":case"right":return t?cD:uD;default:return[]}}function dD(e,t,s,n){const a=fo(e);let l=hD(rn(e),s==="start",n);return a&&(l=l.map(u=>u+"-"+a),t&&(l=l.concat(l.map(yp)))),l}function oh(e){const t=rn(e);return aD[t]+e.slice(t.length)}function fD(e){var t,s,n,a;return{top:(t=e.top)!=null?t:0,right:(s=e.right)!=null?s:0,bottom:(n=e.bottom)!=null?n:0,left:(a=e.left)!=null?a:0}}function dw(e){return typeof e!="number"?fD(e):{top:e,right:e,bottom:e,left:e}}function lh(e){const{x:t,y:s,width:n,height:a}=e;return{width:n,height:a,top:s,left:t,right:t+n,bottom:s+a,x:t,y:s}}function Fb(e,t,s){let{reference:n,floating:a}=e;const l=Ns(t),u=Lg(t),f=zg(u),m=rn(t),d=l==="y",_=n.x+n.width/2-a.width/2,g=n.y+n.height/2-a.height/2,b=n[f]/2-a[f]/2;let y;switch(m){case"top":y={x:_,y:n.y-a.height};break;case"bottom":y={x:_,y:n.y+n.height};break;case"right":y={x:n.x+n.width,y:g};break;case"left":y={x:n.x-a.width,y:g};break;default:y={x:n.x,y:n.y}}const x=fo(t);return x&&(y[u]+=b*(x==="end"?1:-1)*(s&&d?-1:1)),y}async function mD(e,t){var s;t===void 0&&(t={});const{x:n,y:a,platform:l,rects:u,elements:f,strategy:m}=e,{boundary:d="clippingAncestors",rootBoundary:_="viewport",elementContext:g="floating",altBoundary:b=!1,padding:y=0}=dr(t,e),x=dw(y),E=f[b?g==="floating"?"reference":"floating":g],k=lh(await l.getClippingRect({element:(s=await(l.isElement==null?void 0:l.isElement(E)))==null||s?E:E.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(f.floating)),boundary:d,rootBoundary:_,strategy:m})),T=g==="floating"?{x:n,y:a,width:u.floating.width,height:u.floating.height}:u.reference,D=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f.floating)),R=await(l.isElement==null?void 0:l.isElement(D))&&await(l.getScale==null?void 0:l.getScale(D))||{x:1,y:1},z=lh(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:T,offsetParent:D,strategy:m}):T);return{top:(k.top-z.top+x.top)/R.y,bottom:(z.bottom-k.bottom+x.bottom)/R.y,left:(k.left-z.left+x.left)/R.x,right:(z.right-k.right+x.right)/R.x}}const pD=50,gD=async(e,t,s)=>{const{placement:n="bottom",strategy:a="absolute",middleware:l=[],platform:u}=s,f=u.detectOverflow?u:{...u,detectOverflow:mD},m=await(u.isRTL==null?void 0:u.isRTL(t));let d=await u.getElementRects({reference:e,floating:t,strategy:a}),{x:_,y:g}=Fb(d,n,m),b=n,y=0;const x={};for(let S=0;S<l.length;S++){const E=l[S];if(!E)continue;const{name:k,fn:T}=E,{x:D,y:R,data:z,reset:L}=await T({x:_,y:g,initialPlacement:n,placement:b,strategy:a,middlewareData:x,rects:d,platform:f,elements:{reference:e,floating:t}});_=D??_,g=R??g,x[k]={...x[k],...z},L&&y<pD&&(y++,typeof L=="object"&&(L.placement&&(b=L.placement),L.rects&&(d=L.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:a}):L.rects),{x:_,y:g}=Fb(d,b,m)),S=-1)}return{x:_,y:g,placement:b,strategy:a,middlewareData:x}},vD=e=>({name:"arrow",options:e,async fn(t){const{x:s,y:n,placement:a,rects:l,platform:u,elements:f,middlewareData:m}=t,{element:d,padding:_=0}=dr(e,t)||{};if(d==null)return{};const g=dw(_),b={x:s,y:n},y=Lg(a),x=zg(y),S=await u.getDimensions(d),E=y==="y",k=E?"top":"left",T=E?"bottom":"right",D=E?"clientHeight":"clientWidth",R=l.reference[x]+l.reference[y]-b[y]-l.floating[x],z=b[y]-l.reference[y],L=await(u.getOffsetParent==null?void 0:u.getOffsetParent(d));let j=L?L[D]:0;(!j||!await(u.isElement==null?void 0:u.isElement(L)))&&(j=f.floating[D]||l.floating[x]);const A=R/2-z/2,V=j/2-S[x]/2-1,I=sn(g[k],V),J=sn(g[T],V),$=j-S[x]-J,B=j/2-S[x]/2+A,K=hw(I,B,$),q=!m.arrow&&fo(a)!=null&&B!==K&&l.reference[x]/2-(B<I?I:J)-S[x]/2<0,M=q?B<I?B-I:B-$:0;return{[y]:b[y]+M,data:{[y]:K,centerOffset:B-K-M,...q&&{alignmentOffset:M}},reset:q}}}),_D=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var s,n;const{placement:a,middlewareData:l,rects:u,initialPlacement:f,platform:m,elements:d}=t,{mainAxis:_=!0,crossAxis:g=!0,fallbackPlacements:b,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:S=!0,...E}=dr(e,t);if((s=l.arrow)!=null&&s.alignmentOffset)return{};const k=rn(a),T=Ns(f),D=rn(f)===f,R=await(m.isRTL==null?void 0:m.isRTL(d.floating)),z=b||(D||!S?[oh(f)]:lD(f)),L=x!=="none";!b&&L&&z.push(...dD(f,S,x,R));const j=[f,...z],A=await m.detectOverflow(t,E),V=[];let I=((n=l.flip)==null?void 0:n.overflows)||[];if(_&&V.push(A[k]),g){const K=oD(a,u,R);V.push(A[K[0]],A[K[1]])}if(I=[...I,{placement:a,overflows:V}],!V.every(K=>K<=0)){var J,$;const K=(((J=l.flip)==null?void 0:J.index)||0)+1,q=j[K];if(q&&(!(g==="alignment"?T!==Ns(q):!1)||I.every(U=>Ns(U.placement)===T?U.overflows[0]>0:!0)))return{data:{index:K,overflows:I},reset:{placement:q}};let M=($=I.filter(H=>H.overflows[0]<=0).sort((H,U)=>H.overflows[1]-U.overflows[1])[0])==null?void 0:$.placement;if(!M)switch(y){case"bestFit":{var B;const H=(B=I.filter(U=>{if(L){const ae=Ns(U.placement);return ae===T||ae==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(ae=>ae>0).reduce((ae,Y)=>ae+Y,0)]).sort((U,ae)=>U[1]-ae[1])[0])==null?void 0:B[0];H&&(M=H);break}case"initialPlacement":M=f;break}if(a!==M)return{reset:{placement:M}}}return{}}}};function Vb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Wb(e){return nD.some(t=>e[t]>=0)}const yD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:s,platform:n}=t,{strategy:a="referenceHidden",...l}=dr(e,t);switch(a){case"referenceHidden":{const u=await n.detectOverflow(t,{...l,elementContext:"reference"}),f=Vb(u,s.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:Wb(f)}}}case"escaped":{const u=await n.detectOverflow(t,{...l,altBoundary:!0}),f=Vb(u,s.floating);return{data:{escapedOffsets:f,escaped:Wb(f)}}}default:return{}}}}},fw=new Set(["left","top"]);async function bD(e,t){const{placement:s,platform:n,elements:a}=e,l=await(n.isRTL==null?void 0:n.isRTL(a.floating)),u=rn(s),f=fo(s),m=Ns(s)==="y",d=fw.has(u)?-1:1,_=l&&m?-1:1,g=dr(t,e);let{mainAxis:b,crossAxis:y,alignmentAxis:x}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return f&&typeof x=="number"&&(y=f==="end"?x*-1:x),m?{x:y*_,y:b*d}:{x:b*d,y:y*_}}const xD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var s,n;const{x:a,y:l,placement:u,middlewareData:f}=t,m=await bD(t,e);return u===((s=f.offset)==null?void 0:s.placement)&&(n=f.arrow)!=null&&n.alignmentOffset?{}:{x:a+m.x,y:l+m.y,data:{...m,placement:u}}}}},SD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:s,y:n,placement:a,platform:l}=t,{mainAxis:u=!0,crossAxis:f=!1,limiter:m={fn:T=>{let{x:D,y:R}=T;return{x:D,y:R}}},...d}=dr(e,t),_={x:s,y:n},g=await l.detectOverflow(t,d),b=Ns(a),y=Og(b);let x=_[y],S=_[b];const E=(T,D)=>hw(D+g[T==="y"?"top":"left"],D,D-g[T==="y"?"bottom":"right"]);u&&(x=E(y,x)),f&&(S=E(b,S));const k=m.fn({...t,[y]:x,[b]:S});return{...k,data:{x:k.x-s,y:k.y-n,enabled:{[y]:u,[b]:f}}}}}},wD=function(e){return e===void 0&&(e={}),{options:e,fn(t){var s,n;const{x:a,y:l,placement:u,rects:f,middlewareData:m}=t,{offset:d=0,mainAxis:_=!0,crossAxis:g=!0}=dr(e,t),b={x:a,y:l},y=Ns(u),x=Og(y);let S=b[x],E=b[y];const k=dr(d,t),T=typeof k=="number"?{mainAxis:k,crossAxis:0}:{mainAxis:(s=k.mainAxis)!=null?s:0,crossAxis:(n=k.crossAxis)!=null?n:0};if(_){const z=x==="y"?"height":"width",L=f.reference[x]-f.floating[z]+T.mainAxis,j=f.reference[x]+f.reference[z]-T.mainAxis;S<L?S=L:S>j&&(S=j)}if(g){var D,R;const z=x==="y"?"width":"height",L=fw.has(rn(u)),j=f.reference[y]-f.floating[z]+(L&&((D=m.offset)==null?void 0:D[y])||0)+(L?0:T.crossAxis),A=f.reference[y]+f.reference[z]+(L?0:((R=m.offset)==null?void 0:R[y])||0)-(L?T.crossAxis:0);E<j?E=j:E>A&&(E=A)}return{[x]:S,[y]:E}}}},CD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:s,rects:n,platform:a,elements:l}=t,{apply:u=()=>{},...f}=dr(e,t),m=await a.detectOverflow(t,f),d=rn(s),_=fo(s),g=Ns(s)==="y",{width:b,height:y}=n.floating;let x,S;d==="top"||d==="bottom"?(x=d,S=_===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(S=d,x=_==="end"?"top":"bottom");const E=y-m.top-m.bottom,k=b-m.left-m.right,T=sn(y-m[x],E),D=sn(b-m[S],k),R=t.middlewareData.shift,z=!R;let L=T,j=D;R!=null&&R.enabled.x&&(j=k),R!=null&&R.enabled.y&&(L=E),z&&!_&&(g?j=b-2*nr(m.left,m.right):L=y-2*nr(m.top,m.bottom)),await u({...t,availableWidth:j,availableHeight:L});const A=await a.getDimensions(l.floating);return b!==A.width||y!==A.height?{reset:{rects:!0}}:{}}}};function Th(){return typeof window<"u"}function mo(e){return mw(e)?(e.nodeName||"").toLowerCase():"#document"}function wi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gr(e){var t;return(t=(mw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function mw(e){return Th()?e instanceof Node||e instanceof wi(e).Node:!1}function Rs(e){return Th()?e instanceof Element||e instanceof wi(e).Element:!1}function an(e){return Th()?e instanceof HTMLElement||e instanceof wi(e).HTMLElement:!1}function Kb(e){return!Th()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wi(e).ShadowRoot}function Rh(e){const{overflow:t,overflowX:s,overflowY:n,display:a}=Ms(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+s)&&a!=="inline"&&a!=="contents"}function ED(e){return/^(table|td|th)$/.test(mo(e))}function Mh(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const kD=/transform|translate|scale|rotate|perspective|filter/,ND=/paint|layout|strict|content/,Dn=e=>!!e&&e!=="none";let Em;function Bg(e){const t=Rs(e)?Ms(e):e;return Dn(t.transform)||Dn(t.translate)||Dn(t.scale)||Dn(t.rotate)||Dn(t.perspective)||!Pg()&&(Dn(t.backdropFilter)||Dn(t.filter))||kD.test(t.willChange||"")||ND.test(t.contain||"")}function jD(e){let t=In(e);for(;an(t)&&!Bl(t);){if(Bg(t))return t;if(Mh(t))return null;t=In(t)}return null}function Pg(){return Em==null&&(Em=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Em}function Bl(e){return/^(html|body|#document)$/.test(mo(e))}function Ms(e){return wi(e).getComputedStyle(e)}function Ah(e){return Rs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function In(e){if(mo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Kb(e)&&e.host||gr(e);return Kb(t)?t.host:t}function pw(e){const t=In(e);return Bl(t)?(e.ownerDocument||e).body:an(t)&&Rh(t)?t:pw(t)}function Pl(e,t,s){var n;t===void 0&&(t=[]),s===void 0&&(s=!0);const a=pw(e),l=a===((n=e.ownerDocument)==null?void 0:n.body),u=wi(a);if(l){const f=bp(u);return t.concat(u,u.visualViewport||[],Rh(a)?a:[],f&&s?Pl(f):[])}else return t.concat(a,Pl(a,[],s))}function bp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gw(e){const t=Ms(e);let s=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=an(e),l=a?e.offsetWidth:s,u=a?e.offsetHeight:n,f=ah(s)!==l||ah(n)!==u;return f&&(s=l,n=u),{width:s,height:n,$:f}}function Hg(e){return Rs(e)?e:e.contextElement}function Qa(e){const t=Hg(e);if(!an(t))return ar(1);const s=t.getBoundingClientRect(),{width:n,height:a,$:l}=gw(t);let u=(l?ah(s.width):s.width)/n,f=(l?ah(s.height):s.height)/a;return(!u||!Number.isFinite(u))&&(u=1),(!f||!Number.isFinite(f))&&(f=1),{x:u,y:f}}const DD=ar(0);function vw(e){const t=wi(e);return!Pg()||!t.visualViewport?DD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function TD(e,t,s){return t===void 0&&(t=!1),!!s&&t&&s===wi(e)}function $n(e,t,s,n){t===void 0&&(t=!1),s===void 0&&(s=!1);const a=e.getBoundingClientRect(),l=Hg(e);let u=ar(1);t&&(n?Rs(n)&&(u=Qa(n)):u=Qa(e));const f=TD(l,s,n)?vw(l):ar(0);let m=(a.left+f.x)/u.x,d=(a.top+f.y)/u.y,_=a.width/u.x,g=a.height/u.y;if(l&&n){const b=wi(l),y=Rs(n)?wi(n):n;let x=b,S=bp(x);for(;S&&y!==x;){const E=Qa(S),k=S.getBoundingClientRect(),T=Ms(S),D=k.left+(S.clientLeft+parseFloat(T.paddingLeft))*E.x,R=k.top+(S.clientTop+parseFloat(T.paddingTop))*E.y;m*=E.x,d*=E.y,_*=E.x,g*=E.y,m+=D,d+=R,x=wi(S),S=bp(x)}}return lh({width:_,height:g,x:m,y:d})}function Oh(e,t){const s=Ah(e).scrollLeft;return t?t.left+s:$n(gr(e)).left+s}function _w(e,t){const s=e.getBoundingClientRect(),n=s.left+t.scrollLeft-Oh(e,s),a=s.top+t.scrollTop;return{x:n,y:a}}function RD(e){let{elements:t,rect:s,offsetParent:n,strategy:a}=e;const l=a==="fixed",u=gr(n),f=t?Mh(t.floating):!1;if(n===u||f&&l)return s;let m={scrollLeft:0,scrollTop:0},d=ar(1);const _=ar(0),g=an(n);if((g||!l)&&((mo(n)!=="body"||Rh(u))&&(m=Ah(n)),g)){const y=$n(n);d=Qa(n),_.x=y.x+n.clientLeft,_.y=y.y+n.clientTop}const b=u&&!g&&!l?_w(u,m):ar(0);return{width:s.width*d.x,height:s.height*d.y,x:s.x*d.x-m.scrollLeft*d.x+_.x+b.x,y:s.y*d.y-m.scrollTop*d.y+_.y+b.y}}function MD(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function AD(e){const t=Ah(e),s=e.ownerDocument.body,n=nr(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),a=nr(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let l=-t.scrollLeft+Oh(e);const u=-t.scrollTop;return Ms(s).direction==="rtl"&&(l+=nr(e.clientWidth,s.clientWidth)-n),{width:n,height:a,x:l,y:u}}const OD=25;function zD(e,t,s){s===void 0&&(s="viewport");const n=s==="layoutViewport",a=wi(e),l=gr(e),u=a.visualViewport;let f=l.clientWidth,m=l.clientHeight,d=0,_=0;if(u){const b=!Pg()||t==="fixed";n?b||(d=-u.offsetLeft,_=-u.offsetTop):(f=u.width,m=u.height,b&&(d=u.offsetLeft,_=u.offsetTop))}if(Oh(l)<=0){const b=l.ownerDocument,y=b.body,x=getComputedStyle(y),S=b.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,E=Math.abs(l.clientWidth-y.clientWidth-S),k=getComputedStyle(l).scrollbarGutter==="stable both-edges"?E/2:E;k<=OD&&(f-=k)}return{width:f,height:m,x:d,y:_}}function LD(e,t){const s=$n(e,!0,t==="fixed"),n=s.top+e.clientTop,a=s.left+e.clientLeft,l=Qa(e),u=e.clientWidth*l.x,f=e.clientHeight*l.y,m=a*l.x,d=n*l.y;return{width:u,height:f,x:m,y:d}}function qb(e,t,s){let n;if(t==="viewport"||t==="layoutViewport")n=zD(e,s,t);else if(t==="document")n=AD(gr(e));else if(Rs(t))n=LD(t,s);else{const a=vw(e);n={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return lh(n)}function BD(e,t){const s=t.get(e);if(s)return s;let n=Pl(e,[],!1).filter(f=>Rs(f)&&mo(f)!=="body"),a=null;const l=Ms(e).position==="fixed";let u=l?In(e):e;for(;Rs(u)&&!Bl(u);){const f=Ms(u),m=Bg(u),d=a?a.position:l?"fixed":"";!m&&(d==="fixed"||d==="absolute"&&f.position==="static")?n=n.filter(g=>g!==u):a=f,u=In(u)}return t.set(e,n),n}function PD(e){let{element:t,boundary:s,rootBoundary:n,strategy:a}=e;const u=[...s==="clippingAncestors"?Mh(t)?[]:BD(t,this._c):[].concat(s),n],f=qb(t,u[0],a);let m=f.top,d=f.right,_=f.bottom,g=f.left;for(let b=1;b<u.length;b++){const y=qb(t,u[b],a);m=nr(y.top,m),d=sn(y.right,d),_=sn(y.bottom,_),g=nr(y.left,g)}return{width:d-g,height:_-m,x:g,y:m}}function HD(e){const{width:t,height:s}=gw(e);return{width:t,height:s}}function ID(e,t,s){const n=an(t),a=gr(t),l=s==="fixed",u=$n(e,!0,l,t);let f={scrollLeft:0,scrollTop:0};const m=ar(0);if((n||!l)&&((mo(t)!=="body"||Rh(a))&&(f=Ah(t)),n)){const b=$n(t,!0,l,t);m.x=b.x+t.clientLeft,m.y=b.y+t.clientTop}!n&&a&&(m.x=Oh(a));const d=a&&!n&&!l?_w(a,f):ar(0),_=u.left+f.scrollLeft-m.x-d.x,g=u.top+f.scrollTop-m.y-d.y;return{x:_,y:g,width:u.width,height:u.height}}function km(e){return Ms(e).position==="static"}function Yb(e,t){if(!an(e)||Ms(e).position==="fixed")return null;if(t)return t(e);let s=e.offsetParent;return gr(e)===s&&(s=s.ownerDocument.body),s}function yw(e,t){const s=wi(e);if(Mh(e))return s;if(!an(e)){let a=In(e);for(;a&&!Bl(a);){if(Rs(a)&&!km(a))return a;a=In(a)}return s}let n=Yb(e,t);for(;n&&ED(n)&&km(n);)n=Yb(n,t);return n&&Bl(n)&&km(n)&&!Bg(n)?s:n||jD(e)||s}const $D=async function(e){const t=this.getOffsetParent||yw,s=this.getDimensions,n=await s(e.floating);return{reference:ID(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function UD(e){return Ms(e).direction==="rtl"}const FD={convertOffsetParentRelativeRectToViewportRelativeRect:RD,getDocumentElement:gr,getClippingRect:PD,getOffsetParent:yw,getElementRects:$D,getClientRects:MD,getDimensions:HD,getScale:Qa,isElement:Rs,isRTL:UD};function bw(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function VD(e,t,s){let n=null,a;const l=gr(e);function u(){var _;clearTimeout(a),(_=n)==null||_.disconnect(),n=null}function f(_,g){_===void 0&&(_=!1),g===void 0&&(g=1),u();const b=e.getBoundingClientRect(),{left:y,top:x,width:S,height:E}=b;if(_||t(),!S||!E)return;const k=Tu(x),T=Tu(l.clientWidth-(y+S)),D=Tu(l.clientHeight-(x+E)),R=Tu(y),L={rootMargin:-k+"px "+-T+"px "+-D+"px "+-R+"px",threshold:nr(0,sn(1,g))||1};let j=!0;function A(V){const I=V[0].intersectionRatio;if(!bw(b,e.getBoundingClientRect()))return f();if(I!==g){if(!j)return f();I?f(!1,I):a=setTimeout(()=>{f(!1,1e-7)},1e3)}j=!1}try{n=new IntersectionObserver(A,{...L,root:l.ownerDocument})}catch{n=new IntersectionObserver(A,L)}n.observe(e)}const m=wi(e),d=()=>f(s);return m.addEventListener("resize",d),f(!0),()=>{m.removeEventListener("resize",d),u()}}function WD(e,t,s,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:m=!1}=n,d=Hg(e),_=a||l?[...d?Pl(d):[],...t?Pl(t):[]]:[];_.forEach(k=>{a&&k.addEventListener("scroll",s),l&&k.addEventListener("resize",s)});const g=d&&f?VD(d,s,l):null;let b=-1,y=null;u&&(y=new ResizeObserver(k=>{let[T]=k;T&&T.target===d&&y&&t&&(y.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var D;(D=y)==null||D.observe(t)})),s()}),d&&!m&&y.observe(d),t&&y.observe(t));let x,S=m?$n(e):null;m&&E();function E(){const k=$n(e);S&&!bw(S,k)&&s(),S=k,x=requestAnimationFrame(E)}return s(),()=>{var k;_.forEach(T=>{a&&T.removeEventListener("scroll",s),l&&T.removeEventListener("resize",s)}),g==null||g(),(k=y)==null||k.disconnect(),y=null,m&&cancelAnimationFrame(x)}}const KD=xD,qD=SD,YD=_D,GD=CD,XD=yD,Gb=vD,ZD=wD,QD=(e,t,s)=>{const n=new Map,a=s??{},l={...FD,...a.platform,_c:n};return gD(e,t,{...a,platform:l})};var JD=typeof document<"u",eT=function(){},Gu=JD?w.useLayoutEffect:eT;function ch(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let s,n,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(s=e.length,s!==t.length)return!1;for(n=s;n--!==0;)if(!ch(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),s=a.length,s!==Object.keys(t).length)return!1;for(n=s;n--!==0;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=s;n--!==0;){const l=a[n];if(!(l==="_owner"&&e.$$typeof)&&!ch(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function xw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Xb(e,t){const s=xw(e);return Math.round(t*s)/s}function Nm(e){const t=w.useRef(e);return Gu(()=>{t.current=e}),t}function tT(e){e===void 0&&(e={});const{placement:t="bottom",strategy:s="absolute",middleware:n=[],platform:a,elements:{reference:l,floating:u}={},transform:f=!0,whileElementsMounted:m,open:d}=e,[_,g]=w.useState({x:0,y:0,strategy:s,placement:t,middlewareData:{},isPositioned:!1}),[b,y]=w.useState(n);ch(b,n)||y(n);const[x,S]=w.useState(null),[E,k]=w.useState(null),T=w.useCallback(U=>{U!==L.current&&(L.current=U,S(U))},[]),D=w.useCallback(U=>{U!==j.current&&(j.current=U,k(U))},[]),R=l||x,z=u||E,L=w.useRef(null),j=w.useRef(null),A=w.useRef(_),V=m!=null,I=Nm(m),J=Nm(a),$=Nm(d),B=w.useCallback(()=>{if(!L.current||!j.current)return;const U={placement:t,strategy:s,middleware:b};J.current&&(U.platform=J.current),QD(L.current,j.current,U).then(ae=>{const Y={...ae,isPositioned:$.current!==!1};K.current&&!ch(A.current,Y)&&(A.current=Y,Sg.flushSync(()=>{g(Y)}))})},[b,t,s,J,$]);Gu(()=>{d===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,g(U=>({...U,isPositioned:!1})))},[d]);const K=w.useRef(!1);Gu(()=>(K.current=!0,()=>{K.current=!1}),[]),Gu(()=>{if(R&&(L.current=R),z&&(j.current=z),R&&z){if(I.current)return I.current(R,z,B);B()}},[R,z,B,I,V]);const q=w.useMemo(()=>({reference:L,floating:j,setReference:T,setFloating:D}),[T,D]),M=w.useMemo(()=>({reference:R,floating:z}),[R,z]),H=w.useMemo(()=>{const U={position:s,left:0,top:0};if(!M.floating)return U;const ae=Xb(M.floating,_.x),Y=Xb(M.floating,_.y);return f?{...U,transform:"translate("+ae+"px, "+Y+"px)",...xw(M.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:ae,top:Y}},[s,f,M.floating,_.x,_.y]);return w.useMemo(()=>({..._,update:B,refs:q,elements:M,floatingStyles:H}),[_,B,q,M,H])}const iT=e=>{function t(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:e,fn(s){const{element:n,padding:a}=typeof e=="function"?e(s):e;return n&&t(n)?n.current!=null?Gb({element:n.current,padding:a}).fn(s):{}:n?Gb({element:n,padding:a}).fn(s):{}}}},sT=(e,t)=>{const s=KD(e);return{name:s.name,fn:s.fn,options:[e,t]}},rT=(e,t)=>{const s=qD(e);return{name:s.name,fn:s.fn,options:[e,t]}},nT=(e,t)=>({fn:ZD(e).fn,options:[e,t]}),aT=(e,t)=>{const s=YD(e);return{name:s.name,fn:s.fn,options:[e,t]}},oT=(e,t)=>{const s=GD(e);return{name:s.name,fn:s.fn,options:[e,t]}},lT=(e,t)=>{const s=XD(e);return{name:s.name,fn:s.fn,options:[e,t]}},cT=(e,t)=>{const s=iT(e);return{name:s.name,fn:s.fn,options:[e,t]}};var uT=Object.defineProperty,hT=(e,t)=>uT(e,"name",{value:t,configurable:!0}),dT=w.forwardRef(hT(function(t,s){const{children:n,width:a=10,height:l=5,...u}=t;return h.jsx(pt.svg,{...u,ref:s,width:a,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),fT=dT,mT=Object.defineProperty,or=(e,t)=>mT(e,"name",{value:t,configurable:!0}),Sw="Popper",[ww,zh]=ds(Sw),[pT,Cw]=ww(Sw),gT=or(e=>{const{__scopePopper:t,children:s}=e,[n,a]=w.useState(null),[l,u]=w.useState(void 0);return h.jsx(pT,{scope:t,anchor:n,onAnchorChange:a,placementState:l,setPlacementState:u,children:s})},"Popper"),vT="PopperAnchor",_T=w.forwardRef(or(function(t,s){const{__scopePopper:n,virtualRef:a,...l}=t,u=Cw(vT,n),f=w.useRef(null),m=u.onAnchorChange,d=w.useCallback(S=>{f.current=S,S&&m(S)},[m]),_=mt(s,d),g=w.useRef(null);w.useEffect(()=>{if(!a)return;const S=g.current;g.current=a.current,S!==g.current&&m(g.current)});const b=u.placementState&&Lh(u.placementState),y=b==null?void 0:b[0],x=b==null?void 0:b[1];return a?null:h.jsx(pt.div,{"data-radix-popper-side":y,"data-radix-popper-align":x,...l,ref:_})},"PopperAnchor")),Ew="PopperContent",[yT,bT]=ww(Ew),xT=w.forwardRef(or(function(t,s){var le,Ce,je,it,De,ht,br;const{__scopePopper:n,side:a="bottom",sideOffset:l=0,align:u="center",alignOffset:f=0,arrowPadding:m=0,avoidCollisions:d=!0,collisionBoundary:_=[],collisionPadding:g=0,sticky:b="partial",hideWhenDetached:y=!1,updatePositionStrategy:x="optimized",onPlaced:S,...E}=t,k=Cw(Ew,n),[T,D]=w.useState(null),R=mt(s,D),[z,L]=w.useState(null),j=uw(z),A=(j==null?void 0:j.width)??0,V=(j==null?void 0:j.height)??0,I=a+(u!=="center"?"-"+u:""),J=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},$=Array.isArray(_)?_:[_],B=$.length>0,K={padding:J,boundary:$.filter(kw),altBoundary:B},{refs:q,floatingStyles:M,placement:H,isPositioned:U,middlewareData:ae}=tT({strategy:"fixed",placement:I,whileElementsMounted:or((...Os)=>WD(...Os,{animationFrame:x==="always"}),"whileElementsMounted"),elements:{reference:k.anchor},middleware:[sT({mainAxis:l+V,alignmentAxis:f}),d&&rT({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?nT():void 0,...K}),d&&aT({...K}),oT({...K,apply:or(({elements:Os,rects:ln,availableWidth:cn,availableHeight:xr})=>{const{width:un,height:zs}=ln.reference,xe=Os.floating.style;xe.setProperty("--radix-popper-available-width",`${cn}px`),xe.setProperty("--radix-popper-available-height",`${xr}px`),xe.setProperty("--radix-popper-anchor-width",`${un}px`),xe.setProperty("--radix-popper-anchor-height",`${zs}px`)},"apply")}),z&&cT({element:z,padding:m}),ET({arrowWidth:A,arrowHeight:V}),y&&lT({strategy:"referenceHidden",...K,boundary:B?K.boundary:void 0})]}),Y=k.setPlacementState;Si(()=>(Y(H),()=>{Y(void 0)}),[H,Y]);const[O,Z]=Lh(H),te=hr(S);Si(()=>{U&&(te==null||te())},[U,te]);const oe=(le=ae.arrow)==null?void 0:le.x,ce=(Ce=ae.arrow)==null?void 0:Ce.y,he=((je=ae.arrow)==null?void 0:je.centerOffset)!==0,[Se,me]=w.useState();return Si(()=>{T&&me(window.getComputedStyle(T).zIndex)},[T]),h.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:U?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Se,"--radix-popper-transform-origin":[(it=ae.transformOrigin)==null?void 0:it.x,(De=ae.transformOrigin)==null?void 0:De.y].join(" "),...((ht=ae.hide)==null?void 0:ht.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:h.jsx(yT,{scope:n,placedSide:O,placedAlign:Z,onArrowChange:L,arrowX:oe,arrowY:ce,shouldHideArrow:he,children:h.jsx(pt.div,{"data-side":O,"data-align":Z,...E,ref:R,style:{...E.style,animation:U?(br=E.style)==null?void 0:br.animation:"none"}})})})},"PopperContent")),ST="PopperArrow",wT={top:"bottom",right:"left",bottom:"top",left:"right"},CT=w.forwardRef(or(function(t,s){const{__scopePopper:n,...a}=t,l=bT(ST,n),u=wT[l.placedSide];return h.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:h.jsx(fT,{...a,ref:s,style:{...a.style,display:"block"}})})},"PopperArrow"));function kw(e){return e!==null}or(kw,"isNotNull");var ET=or(e=>({name:"transformOrigin",options:e,fn(t){var E,k,T;const{placement:s,rects:n,middlewareData:a}=t,u=((E=a.arrow)==null?void 0:E.centerOffset)!==0,f=u?0:e.arrowWidth,m=u?0:e.arrowHeight,[d,_]=Lh(s),g={start:"0%",center:"50%",end:"100%"}[_],b=(((k=a.arrow)==null?void 0:k.x)??0)+f/2,y=(((T=a.arrow)==null?void 0:T.y)??0)+m/2;let x="",S="";return d==="bottom"?(x=u?g:`${b}px`,S=`${-m}px`):d==="top"?(x=u?g:`${b}px`,S=`${n.floating.height+m}px`):d==="right"?(x=`${-m}px`,S=u?g:`${y}px`):d==="left"&&(x=`${n.floating.width+m}px`,S=u?g:`${y}px`),{data:{x,y:S}}}}),"transformOrigin");function Lh(e){const[t,s="center"]=e.split("-");return[t,s]}or(Lh,"getSideAndAlignFromPlacement");var Nw=gT,jw=_T,Dw=xT,kT=CT,NT=Object.defineProperty,Ig=(e,t)=>NT(e,"name",{value:t,configurable:!0}),jm=!1;function Tw(){const[e,t]=w.useState(jm);return w.useEffect(()=>{jm||(jm=!0,t(!0))},[]),e}Ig(Tw,"useIsHydrated");var Rw=co[" useSyncExternalStore ".trim().toString()];function Mw(){return()=>{}}Ig(Mw,"subscribe");function Aw(){return Rw(Mw,()=>!0,()=>!1)}Ig(Aw,"useIsHydratedModern");var jT=typeof Rw=="function"?Aw:Tw,DT=Object.defineProperty,Yn=(e,t)=>DT(e,"name",{value:t,configurable:!0}),Dm="rovingFocusGroup.onEntryFocus",TT={bubbles:!1,cancelable:!0},Bh="RovingFocusGroup",[xp,Ow,RT]=Eg(Bh),[MT,Ph]=ds(Bh,[RT]),[AT,OT]=MT(Bh),zT=w.forwardRef(Yn(function(t,s){return h.jsx(xp.Provider,{scope:t.__scopeRovingFocusGroup,children:h.jsx(xp.Slot,{scope:t.__scopeRovingFocusGroup,children:h.jsx(LT,{...t,ref:s})})})},"RovingFocusGroup")),LT=w.forwardRef(Yn(function(t,s){const{__scopeRovingFocusGroup:n,orientation:a,loop:l=!1,dir:u,currentTabStopId:f,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:d,onEntryFocus:_,preventScrollOnEntryFocus:g=!1,...b}=t,y=w.useRef(null),x=mt(s,y),S=Eh(u),[E,k]=ho({prop:f,defaultProp:m??null,onChange:d,caller:Bh}),[T,D]=w.useState(!1),R=hr(_),z=Ow(n),L=w.useRef(!1),[j,A]=w.useState(0);return w.useEffect(()=>{const V=y.current;if(V)return V.addEventListener(Dm,R),()=>V.removeEventListener(Dm,R)},[R]),h.jsx(AT,{scope:n,orientation:a,dir:S,loop:l,currentTabStopId:E,onItemFocus:w.useCallback(V=>k(V),[k]),onItemShiftTab:w.useCallback(()=>D(!0),[]),onFocusableItemAdd:w.useCallback(()=>A(V=>V+1),[]),onFocusableItemRemove:w.useCallback(()=>A(V=>V-1),[]),children:h.jsx(pt.div,{tabIndex:T||j===0?-1:0,"data-orientation":a,...b,ref:x,style:{outline:"none",...t.style},onMouseDown:Me(t.onMouseDown,()=>{L.current=!0}),onFocus:Me(t.onFocus,V=>{const I=!L.current;if(V.target===V.currentTarget&&I&&!T){const J=new CustomEvent(Dm,TT);if(V.currentTarget.dispatchEvent(J),!J.defaultPrevented){const $=z().filter(H=>H.focusable),B=$.find(H=>H.active),K=$.find(H=>H.id===E),M=[B,K,...$].filter(Boolean).map(H=>H.ref.current);$g(M,g)}}L.current=!1}),onBlur:Me(t.onBlur,()=>D(!1))})})},"RovingFocusGroupImpl")),BT="RovingFocusGroupItem",PT=w.forwardRef(Yn(function(t,s){const{__scopeRovingFocusGroup:n,focusable:a=!0,active:l=!1,tabStopId:u,children:f,...m}=t,d=Bn(),_=u||d,g=OT(BT,n),b=g.currentTabStopId===_,y=Ow(n),{onFocusableItemAdd:x,onFocusableItemRemove:S,currentTabStopId:E}=g,k=jT();return Si(()=>{if(!(!k||!a))return x(),()=>S()},[k,a,x,S]),w.useEffect(()=>{if(!(k||!a))return x(),()=>S()},[k,a,x,S]),h.jsx(xp.ItemSlot,{scope:n,id:_,focusable:a,active:l,children:h.jsx(pt.span,{tabIndex:b?0:-1,"data-orientation":g.orientation,...m,ref:s,onMouseDown:Me(t.onMouseDown,T=>{a?g.onItemFocus(_):T.preventDefault()}),onFocus:Me(t.onFocus,()=>g.onItemFocus(_)),onKeyDown:Me(t.onKeyDown,T=>{if(T.key==="Tab"&&T.shiftKey){g.onItemShiftTab();return}if(T.target!==T.currentTarget)return;const D=Lw(T,g.orientation,g.dir);if(D!==void 0){if(T.metaKey||T.ctrlKey||T.altKey||T.shiftKey)return;T.preventDefault();let z=y().filter(L=>L.focusable).map(L=>L.ref.current);if(D==="last")z.reverse();else if(D==="prev"||D==="next"){D==="prev"&&z.reverse();const L=z.indexOf(T.currentTarget);z=g.loop?Bw(z,L+1):z.slice(L+1)}setTimeout(()=>$g(z))}}),children:typeof f=="function"?f({isCurrentTabStop:b,hasTabStop:E!=null}):f})})},"RovingFocusGroupItem")),HT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function zw(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Yn(zw,"getDirectionAwareKey");function Lw(e,t,s){const n=zw(e.key,s);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return HT[n]}Yn(Lw,"getFocusIntent");function $g(e,t=!1){const s=document.activeElement;for(const n of e)if(n===s||(n.focus({preventScroll:t}),document.activeElement!==s))return}Yn($g,"focusFirst");function Bw(e,t){return e.map((s,n)=>e[(t+n)%e.length])}Yn(Bw,"wrapArray");var Pw=zT,Hw=PT,IT=Object.defineProperty,rt=(e,t)=>IT(e,"name",{value:t,configurable:!0}),$T=["Enter"," "],UT=["ArrowDown","PageUp","Home"],Iw=["ArrowUp","PageDown","End"],FT=[...UT,...Iw],Hh="Menu",[Sp,VT,WT]=Eg(Hh),[Gn,$w]=ds(Hh,[WT,zh,Ph]),Ug=zh(),Uw=Ph(),[KT,ql]=Gn(Hh),[qT,Fg]=Gn(Hh),YT=rt(e=>{const{__scopeMenu:t,open:s=!1,children:n,dir:a,onOpenChange:l,modal:u=!0}=e,f=Ug(t),[m,d]=w.useState(null),_=w.useRef(!1),g=hr(l),b=Eh(a);return w.useEffect(()=>{const y=rt(()=>{_.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},"handleKeyDown"),x=rt(()=>_.current=!1,"handlePointer");return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),w.useEffect(()=>{if(!s)return;const y=rt(()=>g(!1),"handleBlur");return window.addEventListener("blur",y),()=>window.removeEventListener("blur",y)},[s,g]),h.jsx(Nw,{...f,children:h.jsx(KT,{scope:t,open:s,onOpenChange:g,content:m,onContentChange:d,children:h.jsx(qT,{scope:t,onClose:w.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:_,dir:b,modal:u,children:n})})})},"Menu"),GT=w.forwardRef(rt(function(t,s){const{__scopeMenu:n,...a}=t,l=Ug(n);return h.jsx(jw,{...l,...a,ref:s})},"MenuAnchor")),Fw="MenuPortal",[XT,ZT]=Gn(Fw,{forceMount:void 0}),QT=rt(e=>{const{__scopeMenu:t,forceMount:s,children:n,container:a}=e,l=ql(Fw,t);return h.jsx(XT,{scope:t,forceMount:s,children:h.jsx(nn,{present:s||l.open,children:h.jsx(Tg,{asChild:!0,container:a,children:n})})})},"MenuPortal"),en="MenuContent",[JT,Vw]=Gn(en),eR=w.forwardRef(rt(function(t,s){const n=ZT(en,t.__scopeMenu),{forceMount:a=n.forceMount,...l}=t,u=ql(en,t.__scopeMenu),f=Fg(en,t.__scopeMenu);return h.jsx(Sp.Provider,{scope:t.__scopeMenu,children:h.jsx(nn,{present:a||u.open,children:h.jsx(Sp.Slot,{scope:t.__scopeMenu,children:f.modal?h.jsx(tR,{...l,ref:s}):h.jsx(iR,{...l,ref:s})})})})},"MenuContent")),tR=w.forwardRef(rt(function(t,s){const n=ql(en,t.__scopeMenu),a=w.useRef(null),l=mt(s,a);return w.useEffect(()=>{const u=a.current;if(u)return Q1(u)},[]),h.jsx(Ww,{...t,ref:l,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Me(t.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentModal")),iR=w.forwardRef(rt(function(t,s){const n=ql(en,t.__scopeMenu);return h.jsx(Ww,{...t,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentNonModal")),sR=cr("MenuContent.ScrollLock"),Ww=w.forwardRef(rt(function(t,s){const{__scopeMenu:n,loop:a=!1,trapFocus:l,onOpenAutoFocus:u,onCloseAutoFocus:f,disableOutsidePointerEvents:m,onEntryFocus:d,onEscapeKeyDown:_,onPointerDownOutside:g,onFocusOutside:b,onInteractOutside:y,onDismiss:x,disableOutsideScroll:S,...E}=t,k=ql(en,n),T=Fg(en,n),D=Ug(n),R=Uw(n),z=VT(n),[L,j]=w.useState(null),A=w.useRef(null),V=mt(s,A,k.onContentChange),I=w.useRef(0),J=w.useRef(""),$=w.useRef(0),B=w.useRef(null),K=w.useRef("right"),q=w.useRef(0),M=S?Mg:w.Fragment,H=S?{as:sR,allowPinchZoom:!0}:void 0,U=rt(Y=>{var me,le;const O=J.current+Y,Z=z().filter(Ce=>!Ce.disabled),te=document.activeElement,oe=(me=Z.find(Ce=>Ce.ref.current===te))==null?void 0:me.textValue,ce=Z.map(Ce=>Ce.textValue),he=Xw(ce,O,oe),Se=(le=Z.find(Ce=>Ce.textValue===he))==null?void 0:le.ref.current;rt((function Ce(je){J.current=je,window.clearTimeout(I.current),je!==""&&(I.current=window.setTimeout(()=>Ce(""),1e3))}),"updateSearch")(O),Se&&setTimeout(()=>Se.focus())},"handleTypeaheadSearch");w.useEffect(()=>()=>window.clearTimeout(I.current),[]),kh();const ae=w.useCallback(Y=>{var Z,te;return K.current===((Z=B.current)==null?void 0:Z.side)&&Qw(Y,(te=B.current)==null?void 0:te.area)},[]);return h.jsx(JT,{scope:n,searchRef:J,onItemEnter:w.useCallback(Y=>{ae(Y)&&Y.preventDefault()},[ae]),onItemLeave:w.useCallback(Y=>{var O;ae(Y)||((O=A.current)==null||O.focus(),j(null))},[ae]),onTriggerLeave:w.useCallback(Y=>{ae(Y)&&Y.preventDefault()},[ae]),pointerGraceTimerRef:$,onPointerGraceIntentChange:w.useCallback(Y=>{B.current=Y},[]),children:h.jsx(M,{...H,children:h.jsx(B1,{asChild:!0,trapped:l,onMountAutoFocus:Me(u,Y=>{var O;Y.preventDefault(),(O=A.current)==null||O.focus({preventScroll:!0})}),onUnmountAutoFocus:f,children:h.jsx(Ng,{asChild:!0,disableOutsidePointerEvents:m,onEscapeKeyDown:_,onPointerDownOutside:g,onFocusOutside:b,onInteractOutside:y,onDismiss:x,children:h.jsx(Pw,{asChild:!0,...R,dir:T.dir,orientation:"vertical",loop:a,currentTabStopId:L,onCurrentTabStopIdChange:j,onEntryFocus:Me(d,Y=>{T.isUsingKeyboardRef.current||Y.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(Dw,{role:"menu","aria-orientation":"vertical","data-state":Kw(k.open),"data-radix-menu-content":"",dir:T.dir,...D,...E,ref:V,style:{outline:"none",...E.style},onKeyDown:Me(E.onKeyDown,Y=>{const Z=Y.target.closest("[data-radix-menu-content]")===Y.currentTarget,te=Y.ctrlKey||Y.altKey||Y.metaKey,oe=Y.key.length===1;Z&&(Y.key==="Tab"&&Y.preventDefault(),!te&&oe&&U(Y.key));const ce=A.current;if(Y.target!==ce||!FT.includes(Y.key))return;Y.preventDefault();const Se=z().filter(me=>!me.disabled).map(me=>me.ref.current);Iw.includes(Y.key)&&Se.reverse(),Yw(Se)}),onBlur:Me(t.onBlur,Y=>{Y.currentTarget.contains(Y.target)||(window.clearTimeout(I.current),J.current="")}),onPointerMove:Me(t.onPointerMove,uh(Y=>{const O=Y.target,Z=q.current!==Y.clientX;if(Y.currentTarget.contains(O)&&Z){const te=Y.clientX>q.current?"right":"left";K.current=te,q.current=Y.clientX}}))})})})})})})},"MenuContentImpl")),wp="MenuItem",Zb="menu.itemSelect",rR=w.forwardRef(rt(function(t,s){const{disabled:n=!1,onSelect:a,...l}=t,u=w.useRef(null),f=Fg(wp,t.__scopeMenu),m=Vw(wp,t.__scopeMenu),d=mt(s,u),_=w.useRef(!1),g=rt(()=>{const b=u.current;if(!n&&b){const y=new CustomEvent(Zb,{bubbles:!0,cancelable:!0});b.addEventListener(Zb,x=>a==null?void 0:a(x),{once:!0}),Cg(b,y),y.defaultPrevented?_.current=!1:f.onClose()}},"handleSelect");return h.jsx(nR,{...l,ref:d,disabled:n,onClick:Me(t.onClick,g),onPointerDown:b=>{var y;(y=t.onPointerDown)==null||y.call(t,b),_.current=!0},onPointerUp:Me(t.onPointerUp,b=>{var y;_.current||(y=b.currentTarget)==null||y.click()}),onKeyDown:Me(t.onKeyDown,b=>{n||b.target!==b.currentTarget||m.searchRef.current!==""&&b.key===" "||$T.includes(b.key)&&(b.currentTarget.click(),b.preventDefault())})})},"MenuItem")),nR=w.forwardRef(rt(function(t,s){const{__scopeMenu:n,disabled:a=!1,textValue:l,...u}=t,f=Vw(wp,n),m=Uw(n),d=w.useRef(null),_=mt(s,d),[g,b]=w.useState(!1),[y,x]=w.useState("");return w.useEffect(()=>{const S=d.current;S&&x((S.textContent??"").trim())},[u.children]),h.jsx(Sp.ItemSlot,{scope:n,disabled:a,textValue:l??y,children:h.jsx(Hw,{asChild:!0,...m,focusable:!a,children:h.jsx(pt.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...u,ref:_,onPointerMove:Me(t.onPointerMove,uh(S=>{a?f.onItemLeave(S):(f.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Me(t.onPointerLeave,uh(S=>f.onItemLeave(S))),onFocus:Me(t.onFocus,()=>b(!0)),onBlur:Me(t.onBlur,()=>b(!1))})})})},"MenuItemImpl")),aR="MenuRadioGroup",[v8,_8]=Gn(aR,{value:void 0,onValueChange:rt(()=>{},"onValueChange")}),oR="MenuItemIndicator",[y8,b8]=Gn(oR,{checked:!1}),lR=w.forwardRef(rt(function(t,s){const{__scopeMenu:n,...a}=t;return h.jsx(pt.div,{role:"separator","aria-orientation":"horizontal",...a,ref:s})},"MenuSeparator")),cR="MenuSub",[x8,S8]=Gn(cR);function Kw(e){return e?"open":"closed"}rt(Kw,"getOpenState");function qw(e){return e==="indeterminate"}rt(qw,"isIndeterminate");function uR(e){return qw(e)?"indeterminate":e?"checked":"unchecked"}rt(uR,"getCheckedState");function Yw(e){const t=document.activeElement;for(const s of e)if(s===t||(s.focus(),document.activeElement!==t))return}rt(Yw,"focusFirst");function Gw(e,t){return e.map((s,n)=>e[(t+n)%e.length])}rt(Gw,"wrapArray");function Xw(e,t,s){const a=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,l=s?e.indexOf(s):-1;let u=Gw(e,Math.max(l,0));a.length===1&&(u=u.filter(d=>d!==s));const m=u.find(d=>d.toLowerCase().startsWith(a.toLowerCase()));return m!==s?m:void 0}rt(Xw,"getNextMatch");function Zw(e,t){const{x:s,y:n}=e;let a=!1;for(let l=0,u=t.length-1;l<t.length;u=l++){const f=t[l],m=t[u],d=f.x,_=f.y,g=m.x,b=m.y;_>n!=b>n&&s<(g-d)*(n-_)/(b-_)+d&&(a=!a)}return a}rt(Zw,"isPointInPolygon");function Qw(e,t){if(!t)return!1;const s={x:e.clientX,y:e.clientY};return Zw(s,t)}rt(Qw,"isPointerInGraceArea");function uh(e){return t=>t.pointerType==="mouse"?e(t):void 0}rt(uh,"whenMouse");var hR=YT,dR=GT,fR=QT,mR=eR,pR=rR,gR=lR,vR=Object.defineProperty,lr=(e,t)=>vR(e,"name",{value:t,configurable:!0}),Vg="ContextMenu",[_R,w8]=ds(Vg,[$w]),po=$w(),[yR,Jw]=_R(Vg),bR=lr(e=>{const{__scopeContextMenu:t,children:s,onOpenChange:n,open:a,dir:l,modal:u=!0}=e,f=w.useRef(!1),[m,d]=ho({prop:a,defaultProp:!1,onChange:n,caller:Vg}),_=po(t);return h.jsx(yR,{scope:t,open:m,onOpenChange:d,modal:u,hasInteractedRef:f,children:h.jsx(hR,{..._,dir:l,open:m,onOpenChange:d,modal:u,children:s})})},"ContextMenu"),xR="ContextMenuTrigger",SR=w.forwardRef(lr(function(t,s){const{__scopeContextMenu:n,disabled:a=!1,...l}=t,u=Jw(xR,n),f=po(n),[m,d]=w.useState({x:0,y:0}),_=w.useMemo(()=>({current:{getBoundingClientRect:lr(()=>DOMRect.fromRect({width:0,height:0,...m}),"getBoundingClientRect")}}),[m]),g=w.useRef(0),b=w.useCallback(()=>window.clearTimeout(g.current),[]),y=lr(x=>{u.hasInteractedRef.current=!0,d({x:x.clientX,y:x.clientY}),u.onOpenChange(!0)},"handleOpen");return w.useEffect(()=>b,[b]),w.useEffect(()=>void(a&&b()),[a,b]),h.jsxs(h.Fragment,{children:[h.jsx(dR,{...f,virtualRef:_}),h.jsx(pt.span,{"data-state":u.open?"open":"closed","data-disabled":a?"":void 0,...l,ref:s,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:a?t.onContextMenu:Me(t.onContextMenu,x=>{b(),y(x),x.preventDefault()}),onPointerDown:a?t.onPointerDown:Me(t.onPointerDown,kl(x=>{b(),u.open&&u.onOpenChange(!1),g.current=window.setTimeout(()=>y(x),700)})),onPointerMove:a?t.onPointerMove:Me(t.onPointerMove,kl(b)),onPointerCancel:a?t.onPointerCancel:Me(t.onPointerCancel,kl(b)),onPointerUp:a?t.onPointerUp:Me(t.onPointerUp,kl(b))})]})},"ContextMenuTrigger")),wR=lr(e=>{const{__scopeContextMenu:t,...s}=e,n=po(t);return h.jsx(fR,{...n,...s})},"ContextMenuPortal"),CR="ContextMenuContent",ER=w.forwardRef(lr(function(t,s){const{__scopeContextMenu:n,...a}=t,l=Jw(CR,n),u=po(n),f=w.useRef(!1);return h.jsx(mR,{...u,...a,ref:s,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:m=>{var d;(d=t.onCloseAutoFocus)==null||d.call(t,m),!m.defaultPrevented&&f.current&&m.preventDefault(),f.current=!1},onInteractOutside:m=>{var d;(d=t.onInteractOutside)==null||d.call(t,m),!m.defaultPrevented&&!l.modal&&(f.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuContent")),kR=w.forwardRef(lr(function(t,s){const{__scopeContextMenu:n,...a}=t,l=po(n);return h.jsx(pR,{...l,...a,ref:s})},"ContextMenuItem")),NR=w.forwardRef(lr(function(t,s){const{__scopeContextMenu:n,...a}=t,l=po(n);return h.jsx(gR,{...l,...a,ref:s})},"ContextMenuSeparator"));function kl(e){return t=>t.pointerType!=="mouse"?e(t):void 0}lr(kl,"whenTouchOrPen");var jR=bR,DR=SR,TR=wR,RR=ER,MR=kR,AR=NR,OR=Object.defineProperty,zR=(e,t)=>OR(e,"name",{value:t,configurable:!0}),LR=w.forwardRef(zR(function(t,s){return h.jsx(pt.label,{...t,ref:s,onMouseDown:n=>{var l;n.target.closest("button, input, select, textarea")||((l=t.onMouseDown)==null||l.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}})},"Label")),BR=LR,PR=Object.defineProperty,go=(e,t)=>PR(e,"name",{value:t,configurable:!0}),Wg="Tabs",[HR,C8]=ds(Wg,[Ph]),eC=Ph(),[IR,Kg]=HR(Wg),$R=w.forwardRef(go(function(t,s){const{__scopeTabs:n,value:a,onValueChange:l,defaultValue:u,orientation:f="horizontal",dir:m,activationMode:d="automatic",..._}=t,g=Eh(m),[b,y]=ho({prop:a,onChange:l,defaultProp:u??"",caller:Wg});return h.jsx(IR,{scope:n,baseId:Bn(),value:b,onValueChange:y,orientation:f,dir:g,activationMode:d,children:h.jsx(pt.div,{dir:g,"data-orientation":f,..._,ref:s})})},"Tabs")),UR="TabsList",FR=w.forwardRef(go(function(t,s){const{__scopeTabs:n,loop:a=!0,...l}=t,u=Kg(UR,n),f=eC(n);return h.jsx(Pw,{asChild:!0,...f,orientation:u.orientation,dir:u.dir,loop:a,children:h.jsx(pt.div,{role:"tablist","aria-orientation":u.orientation,...l,ref:s})})},"TabsList")),VR="TabsTrigger",WR=w.forwardRef(go(function(t,s){const{__scopeTabs:n,value:a,disabled:l=!1,...u}=t,f=Kg(VR,n),m=eC(n),d=qg(f.baseId,a),_=Yg(f.baseId,a),g=a===f.value;return h.jsx(Hw,{asChild:!0,...m,focusable:!l,active:g,children:h.jsx(pt.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":_,"data-state":g?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:d,...u,ref:s,onMouseDown:Me(t.onMouseDown,b=>{!l&&b.button===0&&b.ctrlKey===!1?f.onValueChange(a):b.preventDefault()}),onKeyDown:Me(t.onKeyDown,b=>{l||b.target!==b.currentTarget||[" ","Enter"].includes(b.key)&&f.onValueChange(a)}),onFocus:Me(t.onFocus,()=>{const b=f.activationMode!=="manual";!g&&!l&&b&&f.onValueChange(a)})})})},"TabsTrigger")),KR="TabsContent",qR=w.forwardRef(go(function(t,s){const{__scopeTabs:n,value:a,forceMount:l,children:u,...f}=t,m=Kg(KR,n),d=qg(m.baseId,a),_=Yg(m.baseId,a),g=a===m.value,b=w.useRef(g);return w.useEffect(()=>{const y=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(y)},[]),h.jsx(nn,{present:l||g,children:({present:y})=>h.jsx(pt.div,{"data-state":g?"active":"inactive","data-orientation":m.orientation,role:"tabpanel","aria-labelledby":d,hidden:!y,id:_,tabIndex:0,...f,ref:s,style:{...t.style,animationDuration:b.current?"0s":void 0},children:y&&u})})},"TabsContent"));function qg(e,t){return`${e}-trigger-${t}`}go(qg,"makeTriggerId");function Yg(e,t){return`${e}-content-${t}`}go(Yg,"makeContentId");var YR=$R,GR=FR,XR=WR,ZR=qR,QR=Object.defineProperty,Lt=(e,t)=>QR(e,"name",{value:t,configurable:!0}),[Gg,E8]=ds("Tooltip",[zh]),Ih=zh(),JR="TooltipProvider",eM=700,Cp="tooltip.open",[tM,Xg]=Gg(JR),iM=Lt(e=>{const{__scopeTooltip:t,delayDuration:s=eM,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:l}=e,u=w.useRef(!0),f=w.useRef(!1),m=w.useRef(0);return w.useEffect(()=>{const d=m.current;return()=>window.clearTimeout(d)},[]),h.jsx(tM,{scope:t,isOpenDelayedRef:u,delayDuration:s,onOpen:w.useCallback(()=>{n<=0||(window.clearTimeout(m.current),u.current=!1)},[n]),onClose:w.useCallback(()=>{n<=0||(window.clearTimeout(m.current),m.current=window.setTimeout(()=>u.current=!0,n))},[n]),isPointerInTransitRef:f,onPointerInTransitChange:w.useCallback(d=>{f.current=d},[]),disableHoverableContent:a,children:l})},"TooltipProvider"),Ep="Tooltip",[sM,Yl]=Gg(Ep),rM=Lt(e=>{const{__scopeTooltip:t,children:s,open:n,defaultOpen:a,onOpenChange:l,disableHoverableContent:u,delayDuration:f}=e,m=Xg(Ep,e.__scopeTooltip),d=Ih(t),[_,g]=w.useState(null),[b,y]=w.useState(void 0),x=Bn(),S=w.useRef(0),E=u??m.disableHoverableContent,k=f??m.delayDuration,T=w.useRef(!1),[D,R]=ho({prop:n,defaultProp:a??!1,onChange:Lt(I=>{I?(m.onOpen(),document.dispatchEvent(new CustomEvent(Cp))):m.onClose(),l==null||l(I)},"onChange"),caller:Ep}),z=w.useMemo(()=>D?T.current?"delayed-open":"instant-open":"closed",[D]),L=w.useCallback(()=>{window.clearTimeout(S.current),S.current=0,T.current=!1,R(!0)},[R]),j=w.useCallback(()=>{window.clearTimeout(S.current),S.current=0,R(!1)},[R]),A=w.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{T.current=!0,R(!0),S.current=0},k)},[k,R]);w.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]);const V=b??x;return h.jsx(Nw,{...d,children:h.jsx(sM,{scope:t,contentId:V,setContentId:y,open:D,stateAttribute:z,trigger:_,onTriggerChange:g,onTriggerEnter:w.useCallback(()=>{m.isOpenDelayedRef.current?A():L()},[m.isOpenDelayedRef,A,L]),onTriggerLeave:w.useCallback(()=>{E?j():(window.clearTimeout(S.current),S.current=0)},[j,E]),onOpen:L,onClose:j,disableHoverableContent:E,children:s})})},"Tooltip"),Qb="TooltipTrigger",nM=w.forwardRef(Lt(function(t,s){const{__scopeTooltip:n,...a}=t,l=Yl(Qb,n),u=Xg(Qb,n),f=Ih(n),m=w.useRef(null),d=mt(s,m,l.onTriggerChange),_=w.useRef(!1),g=w.useRef(!1),b=w.useCallback(()=>_.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",b),[b]),h.jsx(jw,{asChild:!0,...f,children:h.jsx(pt.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...a,ref:d,onPointerMove:Me(t.onPointerMove,y=>{y.pointerType!=="touch"&&!g.current&&!u.isPointerInTransitRef.current&&(l.onTriggerEnter(),g.current=!0)}),onPointerLeave:Me(t.onPointerLeave,()=>{l.onTriggerLeave(),g.current=!1}),onPointerDown:Me(t.onPointerDown,()=>{l.open&&l.onClose(),_.current=!0,document.addEventListener("pointerup",b,{once:!0})}),onFocus:Me(t.onFocus,()=>{_.current||l.onOpen()}),onBlur:Me(t.onBlur,l.onClose),onClick:Me(t.onClick,l.onClose)})})},"TooltipTrigger")),tC="TooltipPortal",[aM,oM]=Gg(tC,{forceMount:void 0}),lM=Lt(e=>{const{__scopeTooltip:t,forceMount:s,children:n,container:a}=e,l=Yl(tC,t);return h.jsx(aM,{scope:t,forceMount:s,children:h.jsx(nn,{present:s||l.open,children:h.jsx(Tg,{asChild:!0,container:a,children:n})})})},"TooltipPortal"),Hl="TooltipContent",cM=w.forwardRef(Lt(function(t,s){const n=oM(Hl,t.__scopeTooltip),{forceMount:a=n.forceMount,side:l="top",...u}=t,f=Yl(Hl,t.__scopeTooltip);return h.jsx(nn,{present:a||f.open,children:f.disableHoverableContent?h.jsx(iC,{side:l,...u,ref:s}):h.jsx(uM,{side:l,...u,ref:s})})},"TooltipContent")),uM=w.forwardRef(Lt(function(t,s){const n=Yl(Hl,t.__scopeTooltip),a=Xg(Hl,t.__scopeTooltip),l=w.useRef(null),u=mt(s,l),[f,m]=w.useState(null),{trigger:d,onClose:_}=n,g=l.current,{onPointerInTransitChange:b}=a,y=w.useCallback(()=>{m(null),b(!1)},[b]),x=w.useCallback((S,E)=>{const k=S.currentTarget,T={x:S.clientX,y:S.clientY},D=sC(T,k.getBoundingClientRect()),R=rC(T,D),z=nC(E.getBoundingClientRect()),L=oC([...R,...z]);m(L),b(!0)},[b]);return w.useEffect(()=>()=>y(),[y]),w.useEffect(()=>{if(d&&g){const S=Lt(k=>x(k,g),"handleTriggerLeave"),E=Lt(k=>x(k,d),"handleContentLeave");return d.addEventListener("pointerleave",S),g.addEventListener("pointerleave",E),()=>{d.removeEventListener("pointerleave",S),g.removeEventListener("pointerleave",E)}}},[d,g,x,y]),w.useEffect(()=>{if(f){const S=Lt(E=>{const k=E.target,T={x:E.clientX,y:E.clientY},D=(d==null?void 0:d.contains(k))||(g==null?void 0:g.contains(k)),R=!aC(T,f);D?y():R&&(y(),_())},"handleTrackPointerGrace");return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[d,g,f,_,y]),h.jsx(iC,{...t,ref:u})},"TooltipContentHoverable")),hM=f1("TooltipContent"),iC=w.forwardRef(Lt(function(t,s){const{__scopeTooltip:n,children:a,"aria-label":l,id:u,onEscapeKeyDown:f,onPointerDownOutside:m,...d}=t,_=Yl(Hl,n),g=Ih(n),{onClose:b}=_;w.useEffect(()=>(document.addEventListener(Cp,b),()=>document.removeEventListener(Cp,b)),[b]),w.useEffect(()=>{if(_.trigger){const x=Lt(S=>{S.target instanceof Node&&S.target.contains(_.trigger)&&b()},"handleScroll");return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[_.trigger,b]);const{setContentId:y}=_;return Si(()=>(y(u),()=>{y(void 0)}),[u,y]),h.jsx(Ng,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:x=>x.preventDefault(),onDismiss:b,children:h.jsxs(Dw,{"data-state":_.stateAttribute,role:l?void 0:"tooltip",id:l?void 0:_.contentId,...g,...d,ref:s,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(hM,{children:a}),l?h.jsx(a5,{id:_.contentId,role:"tooltip",children:l}):null]})})},"TooltipContentImpl")),dM=w.forwardRef(Lt(function(t,s){const{__scopeTooltip:n,...a}=t,l=Ih(n);return h.jsx(kT,{...l,...a,ref:s})},"TooltipArrow"));function sC(e,t){const s=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(s,n,a,l)){case l:return"left";case a:return"right";case s:return"top";case n:return"bottom";default:throw new Error("unreachable")}}Lt(sC,"getExitSideFromRect");function rC(e,t,s=5){const n=[];switch(t){case"top":n.push({x:e.x-s,y:e.y+s},{x:e.x+s,y:e.y+s});break;case"bottom":n.push({x:e.x-s,y:e.y-s},{x:e.x+s,y:e.y-s});break;case"left":n.push({x:e.x+s,y:e.y-s},{x:e.x+s,y:e.y+s});break;case"right":n.push({x:e.x-s,y:e.y-s},{x:e.x-s,y:e.y+s});break}return n}Lt(rC,"getPaddedExitPoints");function nC(e){const{top:t,right:s,bottom:n,left:a}=e;return[{x:a,y:t},{x:s,y:t},{x:s,y:n},{x:a,y:n}]}Lt(nC,"getPointsFromRect");function aC(e,t){const{x:s,y:n}=e;let a=!1;for(let l=0,u=t.length-1;l<t.length;u=l++){const f=t[l],m=t[u],d=f.x,_=f.y,g=m.x,b=m.y;_>n!=b>n&&s<(g-d)*(n-_)/(b-_)+d&&(a=!a)}return a}Lt(aC,"isPointInPolygon");function oC(e){const t=e.slice();return t.sort((s,n)=>s.x<n.x?-1:s.x>n.x?1:s.y<n.y?-1:s.y>n.y?1:0),lC(t)}Lt(oC,"getHull");function lC(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const a=e[n];for(;t.length>=2;){const l=t[t.length-1],u=t[t.length-2];if((l.x-u.x)*(a.y-u.y)>=(l.y-u.y)*(a.x-u.x))t.pop();else break}t.push(a)}t.pop();const s=[];for(let n=e.length-1;n>=0;n--){const a=e[n];for(;s.length>=2;){const l=s[s.length-1],u=s[s.length-2];if((l.x-u.x)*(a.y-u.y)>=(l.y-u.y)*(a.x-u.x))s.pop();else break}s.push(a)}return s.pop(),t.length===1&&s.length===1&&t[0].x===s[0].x&&t[0].y===s[0].y?t:t.concat(s)}Lt(lC,"getHullPresorted");var fM=iM,mM=rM,pM=nM,gM=lM,vM=cM,_M=dM,Tm={};const Ne=e=>typeof e=="string",pl=()=>{let e,t;const s=new Promise((n,a)=>{e=n,t=a});return s.resolve=e,s.reject=t,s},Jb=e=>e==null?"":""+e,yM=(e,t,s)=>{e.forEach(n=>{t[n]&&(s[n]=t[n])})},bM=/###/g,ex=e=>e&&e.indexOf("###")>-1?e.replace(bM,"."):e,tx=e=>!e||Ne(e),Al=(e,t,s)=>{const n=Ne(t)?t.split("."):t;let a=0;for(;a<n.length-1;){if(tx(e))return{};const l=ex(n[a]);!e[l]&&s&&(e[l]=new s),Object.prototype.hasOwnProperty.call(e,l)?e=e[l]:e={},++a}return tx(e)?{}:{obj:e,k:ex(n[a])}},ix=(e,t,s)=>{const{obj:n,k:a}=Al(e,t,Object);if(n!==void 0||t.length===1){n[a]=s;return}let l=t[t.length-1],u=t.slice(0,t.length-1),f=Al(e,u,Object);for(;f.obj===void 0&&u.length;)l=`${u[u.length-1]}.${l}`,u=u.slice(0,u.length-1),f=Al(e,u,Object),f!=null&&f.obj&&typeof f.obj[`${f.k}.${l}`]<"u"&&(f.obj=void 0);f.obj[`${f.k}.${l}`]=s},xM=(e,t,s,n)=>{const{obj:a,k:l}=Al(e,t,Object);a[l]=a[l]||[],a[l].push(s)},hh=(e,t)=>{const{obj:s,k:n}=Al(e,t);if(s&&Object.prototype.hasOwnProperty.call(s,n))return s[n]},SM=(e,t,s)=>{const n=hh(e,s);return n!==void 0?n:hh(t,s)},cC=(e,t,s)=>{for(const n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?Ne(e[n])||e[n]instanceof String||Ne(t[n])||t[n]instanceof String?s&&(e[n]=t[n]):cC(e[n],t[n],s):e[n]=t[n]);return e},Tn=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var wM={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const CM=e=>Ne(e)?e.replace(/[&<>"'\/]/g,t=>wM[t]):e;class EM{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const s=this.regExpMap.get(t);if(s!==void 0)return s;const n=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,n),this.regExpQueue.push(t),n}}const kM=[" ",",","?","!",";"],NM=new EM(20),jM=(e,t,s)=>{t=t||"",s=s||"";const n=kM.filter(u=>t.indexOf(u)<0&&s.indexOf(u)<0);if(n.length===0)return!0;const a=NM.getRegExp(`(${n.map(u=>u==="?"?"\\?":u).join("|")})`);let l=!a.test(e);if(!l){const u=e.indexOf(s);u>0&&!a.test(e.substring(0,u))&&(l=!0)}return l},kp=(e,t,s=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const n=t.split(s);let a=e;for(let l=0;l<n.length;){if(!a||typeof a!="object")return;let u,f="";for(let m=l;m<n.length;++m)if(m!==l&&(f+=s),f+=n[m],u=a[f],u!==void 0){if(["string","number","boolean"].indexOf(typeof u)>-1&&m<n.length-1)continue;l+=m-l+1;break}a=u}return a},Il=e=>e==null?void 0:e.replace(/_/g,"-"),DM={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var s,n;(n=(s=console==null?void 0:console[e])==null?void 0:s.apply)==null||n.call(s,console,t)}};class dh{constructor(t,s={}){this.init(t,s)}init(t,s={}){this.prefix=s.prefix||"i18next:",this.logger=t||DM,this.options=s,this.debug=s.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,s,n,a){return a&&!this.debug?null:(Ne(t[0])&&(t[0]=`${n}${this.prefix} ${t[0]}`),this.logger[s](t))}create(t){return new dh(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new dh(this.logger,t)}}var js=new dh;class $h{constructor(){this.observers={}}on(t,s){return t.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const a=this.observers[n].get(s)||0;this.observers[n].set(s,a+1)}),this}off(t,s){if(this.observers[t]){if(!s){delete this.observers[t];return}this.observers[t].delete(s)}}emit(t,...s){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([a,l])=>{for(let u=0;u<l;u++)a(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([a,l])=>{for(let u=0;u<l;u++)a.apply(a,[t,...s])})}}class sx extends $h{constructor(t,s={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const s=this.options.ns.indexOf(t);s>-1&&this.options.ns.splice(s,1)}getResource(t,s,n,a={}){var d,_;const l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,u=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let f;t.indexOf(".")>-1?f=t.split("."):(f=[t,s],n&&(Array.isArray(n)?f.push(...n):Ne(n)&&l?f.push(...n.split(l)):f.push(n)));const m=hh(this.data,f);return!m&&!s&&!n&&t.indexOf(".")>-1&&(t=f[0],s=f[1],n=f.slice(2).join(".")),m||!u||!Ne(n)?m:kp((_=(d=this.data)==null?void 0:d[t])==null?void 0:_[s],n,l)}addResource(t,s,n,a,l={silent:!1}){const u=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator;let f=[t,s];n&&(f=f.concat(u?n.split(u):n)),t.indexOf(".")>-1&&(f=t.split("."),a=s,s=f[1]),this.addNamespaces(s),ix(this.data,f,a),l.silent||this.emit("added",t,s,n,a)}addResources(t,s,n,a={silent:!1}){for(const l in n)(Ne(n[l])||Array.isArray(n[l]))&&this.addResource(t,s,l,n[l],{silent:!0});a.silent||this.emit("added",t,s,n)}addResourceBundle(t,s,n,a,l,u={silent:!1,skipCopy:!1}){let f=[t,s];t.indexOf(".")>-1&&(f=t.split("."),a=n,n=s,s=f[1]),this.addNamespaces(s);let m=hh(this.data,f)||{};u.skipCopy||(n=JSON.parse(JSON.stringify(n))),a?cC(m,n,l):m={...m,...n},ix(this.data,f,m),u.silent||this.emit("added",t,s,n)}removeResourceBundle(t,s){this.hasResourceBundle(t,s)&&delete this.data[t][s],this.removeNamespaces(s),this.emit("removed",t,s)}hasResourceBundle(t,s){return this.getResource(t,s)!==void 0}getResourceBundle(t,s){return s||(s=this.options.defaultNS),this.getResource(t,s)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const s=this.getDataByLanguage(t);return!!(s&&Object.keys(s)||[]).find(a=>s[a]&&Object.keys(s[a]).length>0)}toJSON(){return this.data}}var uC={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,s,n,a){return e.forEach(l=>{var u;t=((u=this.processors[l])==null?void 0:u.process(t,s,n,a))??t}),t}};const hC=Symbol("i18next/PATH_KEY");function TM(){const e=[],t=Object.create(null);let s;return t.get=(n,a)=>{var l;return(l=s==null?void 0:s.revoke)==null||l.call(s),a===hC?e:(e.push(a),s=Proxy.revocable(n,t),s.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Ja(e,t){const{[hC]:s}=e(TM()),n=(t==null?void 0:t.keySeparator)??".",a=(t==null?void 0:t.nsSeparator)??":";if(s.length>1&&a){const l=t==null?void 0:t.ns,u=Array.isArray(l)?l:null;if(u&&u.length>1&&u.slice(1).includes(s[0]))return`${s[0]}${a}${s.slice(1).join(n)}`}return s.join(n)}const rx={},Rm=e=>!Ne(e)&&typeof e!="boolean"&&typeof e!="number";class fh extends $h{constructor(t,s={}){super(),yM(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=js.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,s={interpolation:{}}){const n={...s};if(t==null)return!1;const a=this.resolve(t,n);if((a==null?void 0:a.res)===void 0)return!1;const l=Rm(a.res);return!(n.returnObjects===!1&&l)}extractFromKey(t,s){let n=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let l=s.ns||this.options.defaultNS||[];const u=n&&t.indexOf(n)>-1,f=!this.options.userDefinedKeySeparator&&!s.keySeparator&&!this.options.userDefinedNsSeparator&&!s.nsSeparator&&!jM(t,n,a);if(u&&!f){const m=t.match(this.interpolator.nestingRegexp);if(m&&m.length>0)return{key:t,namespaces:Ne(l)?[l]:l};const d=t.split(n);(n!==a||n===a&&this.options.ns.indexOf(d[0])>-1)&&(l=d.shift()),t=d.join(a)}return{key:t,namespaces:Ne(l)?[l]:l}}translate(t,s,n){let a=typeof s=="object"?{...s}:s;if(typeof a!="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),typeof a=="object"&&(a={...a}),a||(a={}),t==null)return"";typeof t=="function"&&(t=Ja(t,{...this.options,...a})),Array.isArray(t)||(t=[String(t)]),t=t.map(B=>typeof B=="function"?Ja(B,{...this.options,...a}):String(B));const l=a.returnDetails!==void 0?a.returnDetails:this.options.returnDetails,u=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,{key:f,namespaces:m}=this.extractFromKey(t[t.length-1],a),d=m[m.length-1];let _=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;_===void 0&&(_=":");const g=a.lng||this.language,b=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((g==null?void 0:g.toLowerCase())==="cimode")return b?l?{res:`${d}${_}${f}`,usedKey:f,exactUsedKey:f,usedLng:g,usedNS:d,usedParams:this.getUsedParamsDetails(a)}:`${d}${_}${f}`:l?{res:f,usedKey:f,exactUsedKey:f,usedLng:g,usedNS:d,usedParams:this.getUsedParamsDetails(a)}:f;const y=this.resolve(t,a);let x=y==null?void 0:y.res;const S=(y==null?void 0:y.usedKey)||f,E=(y==null?void 0:y.exactUsedKey)||f,k=["[object Number]","[object Function]","[object RegExp]"],T=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,D=!this.i18nFormat||this.i18nFormat.handleAsObject,R=a.count!==void 0&&!Ne(a.count),z=fh.hasDefaultValue(a),L=R?this.pluralResolver.getSuffix(g,a.count,a):"",j=a.ordinal&&R?this.pluralResolver.getSuffix(g,a.count,{ordinal:!1}):"",A=R&&!a.ordinal&&a.count===0,V=A&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${L}`]||a[`defaultValue${j}`]||a.defaultValue;let I=x;D&&!x&&z&&(I=V);const J=Rm(I),$=Object.prototype.toString.apply(I);if(D&&I&&J&&k.indexOf($)<0&&!(Ne(T)&&Array.isArray(I))){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const B=this.options.returnedObjectHandler?this.options.returnedObjectHandler(S,I,{...a,ns:m}):`key '${f} (${this.language})' returned an object instead of string.`;return l?(y.res=B,y.usedParams=this.getUsedParamsDetails(a),y):B}if(u){const B=Array.isArray(I),K=B?[]:{},q=B?E:S;for(const M in I)if(Object.prototype.hasOwnProperty.call(I,M)){const H=`${q}${u}${M}`;z&&!x?K[M]=this.translate(H,{...a,defaultValue:Rm(V)?V[M]:void 0,joinArrays:!1,ns:m}):K[M]=this.translate(H,{...a,joinArrays:!1,ns:m}),K[M]===H&&(K[M]=I[M])}x=K}}else if(D&&Ne(T)&&Array.isArray(x))x=x.join(T),x&&(x=this.extendTranslation(x,t,a,n));else{let B=!1,K=!1;!this.isValidLookup(x)&&z&&(B=!0,x=V),this.isValidLookup(x)||(K=!0,x=f);const M=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&K?void 0:x,H=z&&V!==x&&this.options.updateMissing;if(K||B||H){if(this.logger.log(H?"updateKey":"missingKey",g,d,f,H?V:x),u){const O=this.resolve(f,{...a,keySeparator:!1});O&&O.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let U=[];const ae=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ae&&ae[0])for(let O=0;O<ae.length;O++)U.push(ae[O]);else this.options.saveMissingTo==="all"?U=this.languageUtils.toResolveHierarchy(a.lng||this.language):U.push(a.lng||this.language);const Y=(O,Z,te)=>{var ce;const oe=z&&te!==x?te:M;this.options.missingKeyHandler?this.options.missingKeyHandler(O,d,Z,oe,H,a):(ce=this.backendConnector)!=null&&ce.saveMissing&&this.backendConnector.saveMissing(O,d,Z,oe,H,a),this.emit("missingKey",O,d,Z,x)};this.options.saveMissing&&(this.options.saveMissingPlurals&&R?U.forEach(O=>{const Z=this.pluralResolver.getSuffixes(O,a);A&&a[`defaultValue${this.options.pluralSeparator}zero`]&&Z.indexOf(`${this.options.pluralSeparator}zero`)<0&&Z.push(`${this.options.pluralSeparator}zero`),Z.forEach(te=>{Y([O],f+te,a[`defaultValue${te}`]||V)})}):Y(U,f,V))}x=this.extendTranslation(x,t,a,y,n),K&&x===f&&this.options.appendNamespaceToMissingKey&&(x=`${d}${_}${f}`),(K||B)&&this.options.parseMissingKeyHandler&&(x=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${d}${_}${f}`:f,B?x:void 0,a))}return l?(y.res=x,y.usedParams=this.getUsedParamsDetails(a),y):x}extendTranslation(t,s,n,a,l){var m,d;if((m=this.i18nFormat)!=null&&m.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const _=Ne(t)&&(((d=n==null?void 0:n.interpolation)==null?void 0:d.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let g;if(_){const y=t.match(this.interpolator.nestingRegexp);g=y&&y.length}let b=n.replace&&!Ne(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(b={...this.options.interpolation.defaultVariables,...b}),t=this.interpolator.interpolate(t,b,n.lng||this.language||a.usedLng,n),_){const y=t.match(this.interpolator.nestingRegexp),x=y&&y.length;g<x&&(n.nest=!1)}!n.lng&&a&&a.res&&(n.lng=this.language||a.usedLng),n.nest!==!1&&(t=this.interpolator.nest(t,(...y)=>(l==null?void 0:l[0])===y[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${s[0]}`),null):this.translate(...y,s),n)),n.interpolation&&this.interpolator.reset()}const u=n.postProcess||this.options.postProcess,f=Ne(u)?[u]:u;return t!=null&&(f!=null&&f.length)&&n.applyPostProcessor!==!1&&(t=uC.handle(f,t,s,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),t}resolve(t,s={}){let n,a,l,u,f;return Ne(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(m=>typeof m=="function"?Ja(m,{...this.options,...s}):m)),t.forEach(m=>{if(this.isValidLookup(n))return;const d=this.extractFromKey(m,s),_=d.key;a=_;let g=d.namespaces;this.options.fallbackNS&&(g=g.concat(this.options.fallbackNS));const b=s.count!==void 0&&!Ne(s.count),y=b&&!s.ordinal&&s.count===0,x=s.context!==void 0&&(Ne(s.context)||typeof s.context=="number")&&s.context!=="",S=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);g.forEach(E=>{var k,T;this.isValidLookup(n)||(f=E,!rx[`${S[0]}-${E}`]&&((k=this.utils)!=null&&k.hasLoadedNamespace)&&!((T=this.utils)!=null&&T.hasLoadedNamespace(f))&&(rx[`${S[0]}-${E}`]=!0,this.logger.warn(`key "${a}" for languages "${S.join(", ")}" won't get resolved as namespace "${f}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),S.forEach(D=>{var L;if(this.isValidLookup(n))return;u=D;const R=[_];if((L=this.i18nFormat)!=null&&L.addLookupKeys)this.i18nFormat.addLookupKeys(R,_,D,E,s);else{let j;b&&(j=this.pluralResolver.getSuffix(D,s.count,s));const A=`${this.options.pluralSeparator}zero`,V=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(b&&(s.ordinal&&j.indexOf(V)===0&&R.push(_+j.replace(V,this.options.pluralSeparator)),R.push(_+j),y&&R.push(_+A)),x){const I=`${_}${this.options.contextSeparator||"_"}${s.context}`;R.push(I),b&&(s.ordinal&&j.indexOf(V)===0&&R.push(I+j.replace(V,this.options.pluralSeparator)),R.push(I+j),y&&R.push(I+A))}}let z;for(;z=R.pop();)this.isValidLookup(n)||(l=z,n=this.getResource(D,E,z,s))}))})}),{res:n,usedKey:a,exactUsedKey:l,usedLng:u,usedNS:f}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,s,n,a={}){var l;return(l=this.i18nFormat)!=null&&l.getResource?this.i18nFormat.getResource(t,s,n,a):this.resourceStore.getResource(t,s,n,a)}getUsedParamsDetails(t={}){const s=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=t.replace&&!Ne(t.replace);let a=n?t.replace:t;if(n&&typeof t.count<"u"&&(a.count=t.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!n){a={...a};for(const l of s)delete a[l]}return a}static hasDefaultValue(t){const s="defaultValue";for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&s===n.substring(0,s.length)&&t[n]!==void 0)return!0;return!1}}class nx{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=js.create("languageUtils")}getScriptPartFromCode(t){if(t=Il(t),!t||t.indexOf("-")<0)return null;const s=t.split("-");return s.length===2||(s.pop(),s[s.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(s.join("-"))}getLanguagePartFromCode(t){if(t=Il(t),!t||t.indexOf("-")<0)return t;const s=t.split("-");return this.formatLanguageCode(s[0])}formatLanguageCode(t){if(Ne(t)&&t.indexOf("-")>-1){let s;try{s=Intl.getCanonicalLocales(t)[0]}catch{}return s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let s;return t.forEach(n=>{if(s)return;const a=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(a))&&(s=a)}),!s&&this.options.supportedLngs&&t.forEach(n=>{if(s)return;const a=this.getScriptPartFromCode(n);if(this.isSupportedCode(a))return s=a;const l=this.getLanguagePartFromCode(n);if(this.isSupportedCode(l))return s=l;s=this.options.supportedLngs.find(u=>{if(u===l)return u;if(!(u.indexOf("-")<0&&l.indexOf("-")<0)&&(u.indexOf("-")>0&&l.indexOf("-")<0&&u.substring(0,u.indexOf("-"))===l||u.indexOf(l)===0&&l.length>1))return u})}),s||(s=this.getFallbackCodes(this.options.fallbackLng)[0]),s}getFallbackCodes(t,s){if(!t)return[];if(typeof t=="function"&&(t=t(s)),Ne(t)&&(t=[t]),Array.isArray(t))return t;if(!s)return t.default||[];let n=t[s];return n||(n=t[this.getScriptPartFromCode(s)]),n||(n=t[this.formatLanguageCode(s)]),n||(n=t[this.getLanguagePartFromCode(s)]),n||(n=t.default),n||[]}toResolveHierarchy(t,s){const n=this.getFallbackCodes((s===!1?[]:s)||this.options.fallbackLng||[],t),a=[],l=u=>{u&&(this.isSupportedCode(u)?a.push(u):this.logger.warn(`rejecting language code not found in supportedLngs: ${u}`))};return Ne(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&l(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&l(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&l(this.getLanguagePartFromCode(t))):Ne(t)&&l(this.formatLanguageCode(t)),n.forEach(u=>{a.indexOf(u)<0&&l(this.formatLanguageCode(u))}),a}}const ax={zero:0,one:1,two:2,few:3,many:4,other:5},ox={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class RM{constructor(t,s={}){this.languageUtils=t,this.options=s,this.logger=js.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,s={}){const n=Il(t==="dev"?"en":t),a=s.ordinal?"ordinal":"cardinal",l=JSON.stringify({cleanedCode:n,type:a});if(l in this.pluralRulesCache)return this.pluralRulesCache[l];let u;try{u=new Intl.PluralRules(n,{type:a})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),ox;if(!t.match(/-|_/))return ox;const m=this.languageUtils.getLanguagePartFromCode(t);u=this.getRule(m,s)}return this.pluralRulesCache[l]=u,u}needsPlural(t,s={}){let n=this.getRule(t,s);return n||(n=this.getRule("dev",s)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,s,n={}){return this.getSuffixes(t,n).map(a=>`${s}${a}`)}getSuffixes(t,s={}){let n=this.getRule(t,s);return n||(n=this.getRule("dev",s)),n?n.resolvedOptions().pluralCategories.sort((a,l)=>ax[a]-ax[l]).map(a=>`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${a}`):[]}getSuffix(t,s,n={}){const a=this.getRule(t,n);return a?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a.select(s)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",s,n))}}const lx=(e,t,s,n=".",a=!0)=>{let l=SM(e,t,s);return!l&&a&&Ne(s)&&(l=kp(e,s,n),l===void 0&&(l=kp(t,s,n))),l},Mm=e=>e.replace(/\$/g,"$$$$");class cx{constructor(t={}){var s;this.logger=js.create("interpolator"),this.options=t,this.format=((s=t==null?void 0:t.interpolation)==null?void 0:s.format)||(n=>n),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:s,escapeValue:n,useRawValueToEscape:a,prefix:l,prefixEscaped:u,suffix:f,suffixEscaped:m,formatSeparator:d,unescapeSuffix:_,unescapePrefix:g,nestingPrefix:b,nestingPrefixEscaped:y,nestingSuffix:x,nestingSuffixEscaped:S,nestingOptionsSeparator:E,maxReplaces:k,alwaysFormat:T}=t.interpolation;this.escape=s!==void 0?s:CM,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=a!==void 0?a:!1,this.prefix=l?Tn(l):u||"{{",this.suffix=f?Tn(f):m||"}}",this.formatSeparator=d||",",this.unescapePrefix=_?"":g||"-",this.unescapeSuffix=this.unescapePrefix?"":_||"",this.nestingPrefix=b?Tn(b):y||Tn("$t("),this.nestingSuffix=x?Tn(x):S||Tn(")"),this.nestingOptionsSeparator=E||",",this.maxReplaces=k||1e3,this.alwaysFormat=T!==void 0?T:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(s,n)=>(s==null?void 0:s.source)===n?(s.lastIndex=0,s):new RegExp(n,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,s,n,a){var y;let l,u,f;const m=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=x=>{if(x.indexOf(this.formatSeparator)<0){const T=lx(s,m,x,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(T,void 0,n,{...a,...s,interpolationkey:x}):T}const S=x.split(this.formatSeparator),E=S.shift().trim(),k=S.join(this.formatSeparator).trim();return this.format(lx(s,m,E,this.options.keySeparator,this.options.ignoreJSONStructure),k,n,{...a,...s,interpolationkey:E})};this.resetRegExp();const _=(a==null?void 0:a.missingInterpolationHandler)||this.options.missingInterpolationHandler,g=((y=a==null?void 0:a.interpolation)==null?void 0:y.skipOnVariables)!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:x=>Mm(x)},{regex:this.regexp,safeValue:x=>this.escapeValue?Mm(this.escape(x)):Mm(x)}].forEach(x=>{for(f=0;l=x.regex.exec(t);){const S=l[1].trim();if(u=d(S),u===void 0)if(typeof _=="function"){const k=_(t,l,a);u=Ne(k)?k:""}else if(a&&Object.prototype.hasOwnProperty.call(a,S))u="";else if(g){u=l[0];continue}else this.logger.warn(`missed to pass in variable ${S} for interpolating ${t}`),u="";else!Ne(u)&&!this.useRawValueToEscape&&(u=Jb(u));const E=x.safeValue(u);if(t=t.replace(l[0],E),g?(x.regex.lastIndex+=u.length,x.regex.lastIndex-=l[0].length):x.regex.lastIndex=0,f++,f>=this.maxReplaces)break}}),t}nest(t,s,n={}){let a,l,u;const f=(m,d)=>{const _=this.nestingOptionsSeparator;if(m.indexOf(_)<0)return m;const g=m.split(new RegExp(`${Tn(_)}[ ]*{`));let b=`{${g[1]}`;m=g[0],b=this.interpolate(b,u);const y=b.match(/'/g),x=b.match(/"/g);(((y==null?void 0:y.length)??0)%2===0&&!x||((x==null?void 0:x.length)??0)%2!==0)&&(b=b.replace(/'/g,'"'));try{u=JSON.parse(b),d&&(u={...d,...u})}catch(S){return this.logger.warn(`failed parsing options string in nesting for key ${m}`,S),`${m}${_}${b}`}return u.defaultValue&&u.defaultValue.indexOf(this.prefix)>-1&&delete u.defaultValue,m};for(;a=this.nestingRegexp.exec(t);){let m=[];u={...n},u=u.replace&&!Ne(u.replace)?u.replace:u,u.applyPostProcessor=!1,delete u.defaultValue;const d=/{.*}/.test(a[1])?a[1].lastIndexOf("}")+1:a[1].indexOf(this.formatSeparator);if(d!==-1&&(m=a[1].slice(d).split(this.formatSeparator).map(_=>_.trim()).filter(Boolean),a[1]=a[1].slice(0,d)),l=s(f.call(this,a[1].trim(),u),u),l&&a[0]===t&&!Ne(l))return l;Ne(l)||(l=Jb(l)),l||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${t}`),l=""),m.length&&(l=m.reduce((_,g)=>this.format(_,g,n.lng,{...n,interpolationkey:a[1].trim()}),l.trim())),t=t.replace(a[0],l),this.regexp.lastIndex=0}return t}}const MM=e=>{let t=e.toLowerCase().trim();const s={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const a=n[1].substring(0,n[1].length-1);t==="currency"&&a.indexOf(":")<0?s.currency||(s.currency=a.trim()):t==="relativetime"&&a.indexOf(":")<0?s.range||(s.range=a.trim()):a.split(";").forEach(u=>{if(u){const[f,...m]=u.split(":"),d=m.join(":").trim().replace(/^'+|'+$/g,""),_=f.trim();s[_]||(s[_]=d),d==="false"&&(s[_]=!1),d==="true"&&(s[_]=!0),isNaN(d)||(s[_]=parseInt(d,10))}})}return{formatName:t,formatOptions:s}},ux=e=>{const t={};return(s,n,a)=>{let l=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(l={...l,[a.interpolationkey]:void 0});const u=n+JSON.stringify(l);let f=t[u];return f||(f=e(Il(n),a),t[u]=f),f(s)}},AM=e=>(t,s,n)=>e(Il(s),n)(t);class OM{constructor(t={}){this.logger=js.create("formatter"),this.options=t,this.init(t)}init(t,s={interpolation:{}}){this.formatSeparator=s.interpolation.formatSeparator||",";const n=s.cacheInBuiltFormats?ux:AM;this.formats={number:n((a,l)=>{const u=new Intl.NumberFormat(a,{...l});return f=>u.format(f)}),currency:n((a,l)=>{const u=new Intl.NumberFormat(a,{...l,style:"currency"});return f=>u.format(f)}),datetime:n((a,l)=>{const u=new Intl.DateTimeFormat(a,{...l});return f=>u.format(f)}),relativetime:n((a,l)=>{const u=new Intl.RelativeTimeFormat(a,{...l});return f=>u.format(f,l.range||"day")}),list:n((a,l)=>{const u=new Intl.ListFormat(a,{...l});return f=>u.format(f)})}}add(t,s){this.formats[t.toLowerCase().trim()]=s}addCached(t,s){this.formats[t.toLowerCase().trim()]=ux(s)}format(t,s,n,a={}){const l=s.split(this.formatSeparator);if(l.length>1&&l[0].indexOf("(")>1&&l[0].indexOf(")")<0&&l.find(f=>f.indexOf(")")>-1)){const f=l.findIndex(m=>m.indexOf(")")>-1);l[0]=[l[0],...l.splice(1,f)].join(this.formatSeparator)}return l.reduce((f,m)=>{var g;const{formatName:d,formatOptions:_}=MM(m);if(this.formats[d]){let b=f;try{const y=((g=a==null?void 0:a.formatParams)==null?void 0:g[a.interpolationkey])||{},x=y.locale||y.lng||a.locale||a.lng||n;b=this.formats[d](f,x,{..._,...a,...y})}catch(y){this.logger.warn(y)}return b}else this.logger.warn(`there was no format function for ${d}`);return f},t)}}const zM=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class LM extends $h{constructor(t,s,n,a={}){var l,u;super(),this.backend=t,this.store=s,this.services=n,this.languageUtils=n.languageUtils,this.options=a,this.logger=js.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],(u=(l=this.backend)==null?void 0:l.init)==null||u.call(l,n,a.backend,a)}queueLoad(t,s,n,a){const l={},u={},f={},m={};return t.forEach(d=>{let _=!0;s.forEach(g=>{const b=`${d}|${g}`;!n.reload&&this.store.hasResourceBundle(d,g)?this.state[b]=2:this.state[b]<0||(this.state[b]===1?u[b]===void 0&&(u[b]=!0):(this.state[b]=1,_=!1,u[b]===void 0&&(u[b]=!0),l[b]===void 0&&(l[b]=!0),m[g]===void 0&&(m[g]=!0)))}),_||(f[d]=!0)}),(Object.keys(l).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(l),pending:Object.keys(u),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(m)}}loaded(t,s,n){const a=t.split("|"),l=a[0],u=a[1];s&&this.emit("failedLoading",l,u,s),!s&&n&&this.store.addResourceBundle(l,u,n,void 0,void 0,{skipCopy:!0}),this.state[t]=s?-1:2,s&&n&&(this.state[t]=0);const f={};this.queue.forEach(m=>{xM(m.loaded,[l],u),zM(m,t),s&&m.errors.push(s),m.pendingCount===0&&!m.done&&(Object.keys(m.loaded).forEach(d=>{f[d]||(f[d]={});const _=m.loaded[d];_.length&&_.forEach(g=>{f[d][g]===void 0&&(f[d][g]=!0)})}),m.done=!0,m.errors.length?m.callback(m.errors):m.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(m=>!m.done)}read(t,s,n,a=0,l=this.retryTimeout,u){if(!t.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:s,fcName:n,tried:a,wait:l,callback:u});return}this.readingCalls++;const f=(d,_)=>{if(this.readingCalls--,this.waitingReads.length>0){const g=this.waitingReads.shift();this.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(d&&_&&a<this.maxRetries){setTimeout(()=>{this.read.call(this,t,s,n,a+1,l*2,u)},l);return}u(d,_)},m=this.backend[n].bind(this.backend);if(m.length===2){try{const d=m(t,s);d&&typeof d.then=="function"?d.then(_=>f(null,_)).catch(f):f(null,d)}catch(d){f(d)}return}return m(t,s,f)}prepareLoading(t,s,n={},a){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();Ne(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Ne(s)&&(s=[s]);const l=this.queueLoad(t,s,n,a);if(!l.toLoad.length)return l.pending.length||a(),null;l.toLoad.forEach(u=>{this.loadOne(u)})}load(t,s,n){this.prepareLoading(t,s,{},n)}reload(t,s,n){this.prepareLoading(t,s,{reload:!0},n)}loadOne(t,s=""){const n=t.split("|"),a=n[0],l=n[1];this.read(a,l,"read",void 0,void 0,(u,f)=>{u&&this.logger.warn(`${s}loading namespace ${l} for language ${a} failed`,u),!u&&f&&this.logger.log(`${s}loaded namespace ${l} for language ${a}`,f),this.loaded(t,u,f)})}saveMissing(t,s,n,a,l,u={},f=()=>{}){var m,d,_,g,b;if((d=(m=this.services)==null?void 0:m.utils)!=null&&d.hasLoadedNamespace&&!((g=(_=this.services)==null?void 0:_.utils)!=null&&g.hasLoadedNamespace(s))){this.logger.warn(`did not save key "${n}" as the namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((b=this.backend)!=null&&b.create){const y={...u,isUpdate:l},x=this.backend.create.bind(this.backend);if(x.length<6)try{let S;x.length===5?S=x(t,s,n,a,y):S=x(t,s,n,a),S&&typeof S.then=="function"?S.then(E=>f(null,E)).catch(f):f(null,S)}catch(S){f(S)}else x(t,s,n,a,f,y)}!t||!t[0]||this.store.addResource(t[0],s,n,a)}}}const Am=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Ne(e[1])&&(t.defaultValue=e[1]),Ne(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const s=e[3]||e[2];Object.keys(s).forEach(n=>{t[n]=s[n]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),hx=e=>{var t,s;return Ne(e.ns)&&(e.ns=[e.ns]),Ne(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ne(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((s=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:s.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},Ru=()=>{},BM=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(s=>{typeof e[s]=="function"&&(e[s]=e[s].bind(e))})},dC="__i18next_supportNoticeShown",PM=()=>!!(typeof globalThis<"u"&&globalThis[dC]||typeof process<"u"&&Tm&&Tm.I18NEXT_NO_SUPPORT_NOTICE||typeof process<"u"&&Tm),HM=()=>{typeof globalThis<"u"&&(globalThis[dC]=!0)},IM=e=>{var t,s,n,a,l,u,f,m,d,_,g,b,y;return!!(((n=(s=(t=e==null?void 0:e.modules)==null?void 0:t.backend)==null?void 0:s.name)==null?void 0:n.indexOf("Locize"))>0||((f=(u=(l=(a=e==null?void 0:e.modules)==null?void 0:a.backend)==null?void 0:l.constructor)==null?void 0:u.name)==null?void 0:f.indexOf("Locize"))>0||(d=(m=e==null?void 0:e.options)==null?void 0:m.backend)!=null&&d.backends&&e.options.backend.backends.some(x=>{var S,E,k;return((S=x==null?void 0:x.name)==null?void 0:S.indexOf("Locize"))>0||((k=(E=x==null?void 0:x.constructor)==null?void 0:E.name)==null?void 0:k.indexOf("Locize"))>0})||(g=(_=e==null?void 0:e.options)==null?void 0:_.backend)!=null&&g.projectId||(y=(b=e==null?void 0:e.options)==null?void 0:b.backend)!=null&&y.backendOptions&&e.options.backend.backendOptions.some(x=>x==null?void 0:x.projectId))};class Ol extends $h{constructor(t={},s){if(super(),this.options=hx(t),this.services={},this.logger=js,this.modules={external:[]},BM(this),s&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,s),this;setTimeout(()=>{this.init(t,s)},0)}}init(t={},s){this.isInitializing=!0,typeof t=="function"&&(s=t,t={}),t.defaultNS==null&&t.ns&&(Ne(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const n=Am();this.options={...n,...this.options,...hx(t)},this.options.interpolation={...n.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!IM(this)&&!PM()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),HM());const a=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?js.init(a(this.modules.logger),this.options):js.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:d=OM;const _=new nx(this.options);this.store=new sx(this.options.resources,this.options);const g=this.services;g.logger=js,g.resourceStore=this.store,g.languageUtils=_,g.pluralResolver=new RM(_,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),d&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(g.formatter=a(d),g.formatter.init&&g.formatter.init(g,this.options),this.options.interpolation.format=g.formatter.format.bind(g.formatter)),g.interpolator=new cx(this.options),g.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},g.backendConnector=new LM(a(this.modules.backend),g.resourceStore,g,this.options),g.backendConnector.on("*",(y,...x)=>{this.emit(y,...x)}),this.modules.languageDetector&&(g.languageDetector=a(this.modules.languageDetector),g.languageDetector.init&&g.languageDetector.init(g,this.options.detection,this.options)),this.modules.i18nFormat&&(g.i18nFormat=a(this.modules.i18nFormat),g.i18nFormat.init&&g.i18nFormat.init(this)),this.translator=new fh(this.services,this.options),this.translator.on("*",(y,...x)=>{this.emit(y,...x)}),this.modules.external.forEach(y=>{y.init&&y.init(this)})}if(this.format=this.options.interpolation.format,s||(s=Ru),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=(..._)=>this.store[d](..._)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=(..._)=>(this.store[d](..._),this)});const f=pl(),m=()=>{const d=(_,g)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),f.resolve(g),s(_,g)};if(this.languages&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initAsync?m():setTimeout(m,0),f}loadResources(t,s=Ru){var l,u;let n=s;const a=Ne(t)?t:this.language;if(typeof t=="function"&&(n=t),!this.options.resources||this.options.partialBundledLanguages){if((a==null?void 0:a.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const f=[],m=d=>{if(!d||d==="cimode")return;this.services.languageUtils.toResolveHierarchy(d).forEach(g=>{g!=="cimode"&&f.indexOf(g)<0&&f.push(g)})};a?m(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(_=>m(_)),(u=(l=this.options.preload)==null?void 0:l.forEach)==null||u.call(l,d=>m(d)),this.services.backendConnector.load(f,this.options.ns,d=>{!d&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(d)})}else n(null)}reloadResources(t,s,n){const a=pl();return typeof t=="function"&&(n=t,t=void 0),typeof s=="function"&&(n=s,s=void 0),t||(t=this.languages),s||(s=this.options.ns),n||(n=Ru),this.services.backendConnector.reload(t,s,l=>{a.resolve(),n(l)}),a}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&uC.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let s=0;s<this.languages.length;s++){const n=this.languages[s];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,s){this.isLanguageChangingTo=t;const n=pl();this.emit("languageChanging",t);const a=f=>{this.language=f,this.languages=this.services.languageUtils.toResolveHierarchy(f),this.resolvedLanguage=void 0,this.setResolvedLanguage(f)},l=(f,m)=>{m?this.isLanguageChangingTo===t&&(a(m),this.translator.changeLanguage(m),this.isLanguageChangingTo=void 0,this.emit("languageChanged",m),this.logger.log("languageChanged",m)):this.isLanguageChangingTo=void 0,n.resolve((...d)=>this.t(...d)),s&&s(f,(...d)=>this.t(...d))},u=f=>{var _,g;!t&&!f&&this.services.languageDetector&&(f=[]);const m=Ne(f)?f:f&&f[0],d=this.store.hasLanguageSomeTranslations(m)?m:this.services.languageUtils.getBestMatchFromCodes(Ne(f)?[f]:f);d&&(this.language||a(d),this.translator.language||this.translator.changeLanguage(d),(g=(_=this.services.languageDetector)==null?void 0:_.cacheUserLanguage)==null||g.call(_,d)),this.loadResources(d,b=>{l(b,d)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(u):this.services.languageDetector.detect(u):u(t),n}getFixedT(t,s,n){const a=(l,u,...f)=>{let m;typeof u!="object"?m=this.options.overloadTranslationOptionHandler([l,u].concat(f)):m={...u},m.lng=m.lng||a.lng,m.lngs=m.lngs||a.lngs,m.ns=m.ns||a.ns,m.keyPrefix!==""&&(m.keyPrefix=m.keyPrefix||n||a.keyPrefix);const d={...this.options,...m};typeof m.keyPrefix=="function"&&(m.keyPrefix=Ja(m.keyPrefix,d));const _=this.options.keySeparator||".";let g;return m.keyPrefix&&Array.isArray(l)?g=l.map(b=>(typeof b=="function"&&(b=Ja(b,d)),`${m.keyPrefix}${_}${b}`)):(typeof l=="function"&&(l=Ja(l,d)),g=m.keyPrefix?`${m.keyPrefix}${_}${l}`:l),this.t(g,m)};return Ne(t)?a.lng=t:a.lngs=t,a.ns=s,a.keyPrefix=n,a}t(...t){var s;return(s=this.translator)==null?void 0:s.translate(...t)}exists(...t){var s;return(s=this.translator)==null?void 0:s.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,s={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=s.lng||this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,l=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const u=(f,m)=>{const d=this.services.backendConnector.state[`${f}|${m}`];return d===-1||d===0||d===2};if(s.precheck){const f=s.precheck(this,u);if(f!==void 0)return f}return!!(this.hasResourceBundle(n,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(n,t)&&(!a||u(l,t)))}loadNamespaces(t,s){const n=pl();return this.options.ns?(Ne(t)&&(t=[t]),t.forEach(a=>{this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}),this.loadResources(a=>{n.resolve(),s&&s(a)}),n):(s&&s(),Promise.resolve())}loadLanguages(t,s){const n=pl();Ne(t)&&(t=[t]);const a=this.options.preload||[],l=t.filter(u=>a.indexOf(u)<0&&this.services.languageUtils.isSupportedCode(u));return l.length?(this.options.preload=a.concat(l),this.loadResources(u=>{n.resolve(),s&&s(u)}),n):(s&&s(),Promise.resolve())}dir(t){var a,l;if(t||(t=this.resolvedLanguage||(((a=this.languages)==null?void 0:a.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const u=new Intl.Locale(t);if(u&&u.getTextInfo){const f=u.getTextInfo();if(f&&f.direction)return f.direction}}catch{}const s=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((l=this.services)==null?void 0:l.languageUtils)||new nx(Am());return t.toLowerCase().indexOf("-latn")>1?"ltr":s.indexOf(n.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},s){const n=new Ol(t,s);return n.createInstance=Ol.createInstance,n}cloneInstance(t={},s=Ru){const n=t.forkResourceStore;n&&delete t.forkResourceStore;const a={...this.options,...t,isClone:!0},l=new Ol(a);if((t.debug!==void 0||t.prefix!==void 0)&&(l.logger=l.logger.clone(t)),["store","services","language"].forEach(f=>{l[f]=this[f]}),l.services={...this.services},l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},n){const f=Object.keys(this.store.data).reduce((m,d)=>(m[d]={...this.store.data[d]},m[d]=Object.keys(m[d]).reduce((_,g)=>(_[g]={...m[d][g]},_),m[d]),m),{});l.store=new sx(f,a),l.services.resourceStore=l.store}if(t.interpolation){const m={...Am().interpolation,...this.options.interpolation,...t.interpolation},d={...a,interpolation:m};l.services.interpolator=new cx(d)}return l.translator=new fh(l.services,a),l.translator.on("*",(f,...m)=>{l.emit(f,...m)}),l.init(a,s),l.translator.options=a,l.translator.backendConnector.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const hi=Ol.createInstance();hi.createInstance;hi.dir;hi.init;hi.loadResources;hi.reloadResources;hi.use;hi.changeLanguage;hi.getFixedT;hi.t;hi.exists;hi.setDefaultNamespace;hi.hasLoadedNamespace;hi.loadNamespaces;hi.loadLanguages;const $M=(e,t,s,n)=>{var l,u,f,m;const a=[s,{code:t,...n||{}}];if((u=(l=e==null?void 0:e.services)==null?void 0:l.logger)!=null&&u.forward)return e.services.logger.forward(a,"warn","react-i18next::",!0);Un(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),(m=(f=e==null?void 0:e.services)==null?void 0:f.logger)!=null&&m.warn?e.services.logger.warn(...a):console!=null&&console.warn&&console.warn(...a)},dx={},Np=(e,t,s,n)=>{Un(s)&&dx[s]||(Un(s)&&(dx[s]=new Date),$M(e,t,s,n))},fC=(e,t)=>()=>{if(e.isInitialized)t();else{const s=()=>{setTimeout(()=>{e.off("initialized",s)},0),t()};e.on("initialized",s)}},jp=(e,t,s)=>{e.loadNamespaces(t,fC(e,s))},fx=(e,t,s,n)=>{if(Un(s)&&(s=[s]),e.options.preload&&e.options.preload.indexOf(t)>-1)return jp(e,s,n);s.forEach(a=>{e.options.ns.indexOf(a)<0&&e.options.ns.push(a)}),e.loadLanguages(t,fC(e,n))},UM=(e,t,s={})=>!t.languages||!t.languages.length?(Np(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:s.lng,precheck:(n,a)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!a(n.isLanguageChangingTo,e))return!1}}),Un=e=>typeof e=="string",FM=e=>typeof e=="object"&&e!==null,VM=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,WM={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},KM=e=>WM[e],qM=e=>e.replace(VM,KM);let Dp={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:qM,transDefaultProps:void 0};const YM=(e={})=>{Dp={...Dp,...e}},GM=()=>Dp;let mC;const XM=e=>{mC=e},ZM=()=>mC,QM={type:"3rdParty",init(e){YM(e.options.react),XM(e)}},JM=w.createContext();class e3{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(s=>{this.usedNamespaces[s]||(this.usedNamespaces[s]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Om={exports:{}},zm={};/**
90
+ * @license React
91
+ * use-sync-external-store-shim.production.js
92
+ *
93
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
94
+ *
95
+ * This source code is licensed under the MIT license found in the
96
+ * LICENSE file in the root directory of this source tree.
97
+ */var mx;function t3(){if(mx)return zm;mx=1;var e=Ch();function t(g,b){return g===b&&(g!==0||1/g===1/b)||g!==g&&b!==b}var s=typeof Object.is=="function"?Object.is:t,n=e.useState,a=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function f(g,b){var y=b(),x=n({inst:{value:y,getSnapshot:b}}),S=x[0].inst,E=x[1];return l(function(){S.value=y,S.getSnapshot=b,m(S)&&E({inst:S})},[g,y,b]),a(function(){return m(S)&&E({inst:S}),g(function(){m(S)&&E({inst:S})})},[g]),u(y),y}function m(g){var b=g.getSnapshot;g=g.value;try{var y=b();return!s(g,y)}catch{return!0}}function d(g,b){return b()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:f;return zm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:_,zm}var px;function i3(){return px||(px=1,Om.exports=t3()),Om.exports}var s3=i3();const r3=(e,t)=>{if(Un(t))return t;if(FM(t)&&Un(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const s=e[e.length-1];return typeof s=="function"?"":s}return e},n3={t:r3,ready:!1},a3=()=>()=>{},Zg=(e,t={})=>{var V,I,J;const{i18n:s}=t,{i18n:n,defaultNS:a}=w.useContext(JM)||{},l=s||n||ZM();l&&!l.reportNamespaces&&(l.reportNamespaces=new e3),l||Np(l,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const u=w.useMemo(()=>{var $;return{...GM(),...($=l==null?void 0:l.options)==null?void 0:$.react,...t}},[l,t]),{useSuspense:f,keyPrefix:m}=u,d=a||((V=l==null?void 0:l.options)==null?void 0:V.defaultNS),_=Un(d)?[d]:d||["translation"],g=w.useMemo(()=>_,_);(J=(I=l==null?void 0:l.reportNamespaces)==null?void 0:I.addUsedNamespaces)==null||J.call(I,g);const b=w.useRef(0),y=w.useCallback($=>{if(!l)return a3;const{bindI18n:B,bindI18nStore:K}=u,q=()=>{b.current+=1,$()};return B&&l.on(B,q),K&&l.store.on(K,q),()=>{B&&B.split(" ").forEach(M=>l.off(M,q)),K&&K.split(" ").forEach(M=>l.store.off(M,q))}},[l,u]),x=w.useRef(),S=w.useCallback(()=>{if(!l)return n3;const $=!!(l.isInitialized||l.initializedStoreOnce)&&g.every(U=>UM(U,l,u)),B=t.lng||l.language,K=b.current,q=x.current;if(q&&q.ready===$&&q.lng===B&&q.keyPrefix===m&&q.revision===K)return q;const H={t:l.getFixedT(B,u.nsMode==="fallback"?g:g[0],m),ready:$,lng:B,keyPrefix:m,revision:K};return x.current=H,H},[l,g,m,u,t.lng]),[E,k]=w.useState(0),{t:T,ready:D}=s3.useSyncExternalStore(y,S,S);w.useEffect(()=>{if(l&&!D&&!f){const $=()=>k(B=>B+1);t.lng?fx(l,t.lng,g,$):jp(l,g,$)}},[l,t.lng,g,D,f,E]);const R=l||{},z=w.useRef(null),L=w.useRef(),j=$=>{const B=Object.getOwnPropertyDescriptors($);B.__original&&delete B.__original;const K=Object.create(Object.getPrototypeOf($),B);if(!Object.prototype.hasOwnProperty.call(K,"__original"))try{Object.defineProperty(K,"__original",{value:$,writable:!1,enumerable:!1,configurable:!1})}catch{}return K},A=w.useMemo(()=>{const $=R,B=$==null?void 0:$.language;let K=$;$&&(z.current&&z.current.__original===$?L.current!==B?(K=j($),z.current=K,L.current=B):K=z.current:(K=j($),z.current=K,L.current=B));const q=!D&&!f?(...H)=>(Np(l,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),T(...H)):T,M=[q,K,D];return M.t=q,M.i18n=K,M.ready=D,M},[T,R,D,R.resolvedLanguage,R.language,R.languages]);if(l&&f&&!D)throw new Promise($=>{const B=()=>$();t.lng?fx(l,t.lng,g,B):jp(l,g,B)});return A},o3={browse:"Browse files",cancel:"Cancel",connect:"Connect SSH",delete:"Delete",edit:"Edit"},l3={columnModified:"Modified",columnName:"Name",columnSize:"Size",contextCompressZip:"Compress to Zip",contextCopyPath:"Copy Path",contextDelete:"Delete",contextDownload:"Download",contextExtractZip:"Extract Zip",contextGetInfo:"Get Info",contextNewFile:"New File",contextNewFolder:"New Folder",contextOpen:"Open",contextOpenTerminal:"Open Terminal",contextQuickLook:"Quick Look",contextRefresh:"Refresh",contextRename:"Rename",contextShowInFinder:"Show in Finder",contextUpload:"Upload",copyPath:"Copy path",download:"Download",emptyDirectory:"Empty directory",goUp:"Go up",hideHidden:"Hide hidden files",home:"Home (~)",modified:"Modified",name:"Name",newFolder:"New folder",openInCode:"Open in Code",openInEditor:"Open in editor",openTerminal:"Open terminal here",permissions:"Permissions",refresh:"Refresh",root:"Root (/)",setDefault:"Set as default directory",showHidden:"Show hidden files",size:"Size",statusHidden:"hidden",statusItems:"items",statusLink:"link",statusSelected:"selected",upload:"Upload"},c3={addFirst:"Add a server",dupDialog:{description:"A {{type}} session is already open for {{name}}.",goExisting:"Go to existing",openNew:"Open new",title:"Connection already open"},emptyDescription:"Connect to your SSH servers to manage files, run commands, and access your infrastructure remotely.",emptyTitle:"Add your first server",import:"Import",noResults:"No servers match your search",status:{browserActive:"File browser active",browserAndTerminal:"File browser + SSH terminal",terminalActive:"SSH terminal active"}},u3={actions:o3,files:l3,servers:c3};hi.use(QM).init({resources:{en:{translation:u3}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1},returnEmptyString:!1});const h3=new URLSearchParams(window.location.search).get("token")??"";function Kt(e,t={}){const s=new URLSearchParams({token:h3});for(const[n,a]of Object.entries(t))a!==void 0&&s.set(n,String(a));return`${e}?${s}`}async function Pi(e,t){const s=await fetch(Kt(e,t));if(!s.ok)throw new Error((await s.json().catch(()=>({}))).error??s.statusText);return s.json()}async function qe(e,t,s){const n=await fetch(Kt(e,s),{method:"POST",headers:t===void 0?{}:{"content-type":"application/json"},body:t===void 0?void 0:JSON.stringify(t)});if(!n.ok)throw new Error((await n.json().catch(()=>({}))).error??n.statusText);return n.json()}function d3(e){return{id:e.name,name:e.name,host:e.host,port:e.port??22,username:e.user??"",privateKey:e.keyPath,defaultDirectory:e.defaultDir,category:e.group,mode:e.mode,approval:e.approval,accounts:e.accounts,description:e.description,proxyJump:e.proxyJump,proxyCommand:e.proxyCommand,platform:e.platform,forwardAgent:e.forwardAgent,allowPatterns:e.allowPatterns,denyPatterns:e.denyPatterns,auditLog:e.auditLog}}const Lm={sources:()=>Pi("/api/import/sources"),preview:e=>qe("/api/import/preview",e),apply:e=>qe("/api/import/apply",{servers:e})},Ya={async list(){return(await Pi("/api/servers")).servers.map(d3)},async save(e){await qe("/api/servers",{name:e.name,host:e.host,port:e.port,user:e.username,password:e.password,keyPath:e.privateKey,passphrase:e.passphrase,defaultDir:e.defaultDirectory,group:e.category,mode:e.mode,approval:e.approval,description:e.description,proxyJump:e.proxyJump,proxyCommand:e.proxyCommand,platform:e.platform,forwardAgent:e.forwardAgent,allowPatterns:e.allowPatterns,denyPatterns:e.denyPatterns,auditLog:e.auditLog})},async remove(e){const t=await fetch(Kt("/api/servers",{name:e}),{method:"DELETE"});if(!t.ok)throw new Error(t.statusText)}},Pn={list:e=>Pi("/api/commands",{server:e}),save:async e=>(await qe("/api/commands",e)).command,remove:async e=>{const t=await fetch(Kt("/api/commands",{id:e}),{method:"DELETE"});if(!t.ok)throw new Error(t.statusText)}},Tp={state:()=>Pi("/api/migration"),run:e=>qe("/api/migration",{servers:e})},Ua={list:(e,t)=>Pi("/api/files",{server:e,path:t}),write:(e,t,s)=>qe("/api/files/write",{content:s},{server:e,path:t}),mkdir:(e,t)=>qe("/api/files/mkdir",{server:e,path:t}),rename:(e,t,s)=>qe("/api/files/rename",{server:e,from:t,to:s}),remove:(e,t,s)=>qe("/api/files/delete",{server:e,path:t,isDirectory:s}),downloadUrl:(e,t)=>Kt("/api/files/read",{server:e,path:t}),async upload(e,t,s){const n=await fetch(Kt("/api/files/write",{server:e,path:t}),{method:"POST",body:s});if(!n.ok)throw new Error((await n.json().catch(()=>({}))).error??n.statusText)}},Fa={list:e=>Pi("/api/local/files",{path:e}),mkdir:e=>qe("/api/local/mkdir",{path:e}),rename:(e,t)=>qe("/api/local/rename",{from:e,to:t}),remove:(e,t)=>qe("/api/local/delete",{path:e,isDirectory:t}),touch:e=>qe("/api/local/touch",{path:e}),reveal:e=>qe("/api/local/reveal",{path:e})},pC={start:e=>qe("/api/transfer",e)},f3=new TextEncoder,m3=e=>btoa(String.fromCharCode(...e)),p3=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),g3={async open(e,t,s){const{id:n}=await qe("/api/terminal",{...e,cols:t,rows:s}),a=new EventSource(Kt("/api/terminal/stream",{id:n}));let l=null;return a.onerror=()=>{a.readyState===EventSource.CLOSED&&(l==null||l())},{id:n,write:u=>{fetch(Kt("/api/terminal/input",{id:n}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({data:m3(f3.encode(u))})})},resize:(u,f)=>{fetch(Kt("/api/terminal/resize",{id:n}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({cols:u,rows:f})})},onData:u=>{const f=m=>u(p3(JSON.parse(m.data).chunk));return a.addEventListener("message",f),()=>a.removeEventListener("message",f)},onExit:u=>{l=u},close:async()=>{a.close(),await fetch(Kt("/api/terminal",{id:n}),{method:"DELETE"})}}}},gx={get:(e=500)=>Pi("/api/history",{limit:e}),clear:async()=>{const e=await fetch(Kt("/api/history"),{method:"DELETE"});if(!e.ok)throw new Error(e.statusText)}},Rp={get:()=>Pi("/api/thresholds"),save:e=>qe("/api/thresholds",e)},v3={check:e=>qe("/api/health",void 0,{name:e})},Mp={save:e=>qe("/api/groups",e),remove:async e=>{const t=await fetch(Kt("/api/groups",{name:e}),{method:"DELETE"});if(!t.ok)throw new Error((await t.json().catch(()=>({}))).error??t.statusText)},run:(e,t)=>qe("/api/groups/run",{group:e,command:t})},_3={forget:async(e,t)=>{const s=await fetch(Kt("/api/hostkey",{host:e,port:t}),{method:"DELETE"});if(!s.ok)throw new Error((await s.json().catch(()=>({}))).error??s.statusText)}},gC=["pending","resolved","expired"],Nl=new Set;let er=null,Ap="connecting";function vx(e){Ap=e;for(const t of[...Nl])t({type:"connection",status:e})}const Tt={get:()=>Pi("/api/state"),streams:()=>Pi("/api/streams"),options:()=>Pi("/api/options"),decide:(e,t)=>qe("/api/decide",{id:e,decision:t?"allow":"deny"}),subscribe(e){return Nl.add(e),er||(er=new EventSource(Kt("/api/events")),Ap="connecting",er.addEventListener("open",()=>vx("connected")),er.addEventListener("error",()=>vx("disconnected")),er.addEventListener("message",t=>{let s;try{s=JSON.parse(t.data)}catch{return}for(const n of[...Nl])n(s)})),e({type:"connection",status:Ap}),()=>{Nl.delete(e),Nl.size===0&&(er==null||er.close(),er=null)}}},Bm={status:async()=>{const e=await fetch(Kt("/api/desktop"));if(e.status===404)return null;if(!e.ok)throw new Error((await e.json().catch(()=>({}))).error??e.statusText);return e.json()},install:()=>qe("/api/desktop/install"),open:()=>qe("/api/desktop/open")},_x={status:()=>Pi("/api/agents"),use:(e,t)=>qe("/api/agents/use",{client:e,engine:t})},Mu={status:async()=>{const e=await fetch(Kt("/api/app-update"));if(e.status===404)return null;if(!e.ok)throw new Error((await e.json().catch(()=>({}))).error??e.statusText);return e.json()},check:()=>qe("/api/app-update/check"),download:()=>qe("/api/app-update/download"),install:()=>qe("/api/app-update/install")},gl={status:()=>Pi("/api/vault/status"),backup:e=>qe("/api/vault/backup",{passphrase:e}),preview:(e,t)=>qe("/api/vault/restore",{content:e,passphrase:t}),restore:(e,t,s)=>qe("/api/vault/restore",{content:e,passphrase:t,revision:s,confirm:!0})};let eo={};async function y3(){try{const e=await fetch(Kt("/api/preferences"));if(!e.ok)return;const{preferences:t}=await e.json();if(t&&typeof t=="object"){eo={...eo,...t};for(const[s,n]of Object.entries(eo))try{localStorage.setItem(s,String(n))}catch{}}}catch{}}function vo(e){if(e in eo)return eo[e];try{return localStorage.getItem(e)}catch{return null}}function _o(e,t){eo[e]=t;try{localStorage.setItem(e,t)}catch{}fetch(Kt("/api/preferences"),{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({[e]:t})}).catch(()=>{})}const yx=e=>{let t;const s=new Set,n=(d,_)=>{const g=typeof d=="function"?d(t):d;if(!Object.is(g,t)){const b=t;t=_??(typeof g!="object"||g===null)?g:Object.assign({},t,g),s.forEach(y=>y(t,b))}},a=()=>t,f={setState:n,getState:a,getInitialState:()=>m,subscribe:d=>(s.add(d),()=>s.delete(d))},m=t=e(n,a,f);return f},b3=(e=>e?yx(e):yx),x3=e=>e;function S3(e,t=x3){const s=ci.useSyncExternalStore(e.subscribe,ci.useCallback(()=>t(e.getState()),[e,t]),ci.useCallback(()=>t(e.getInitialState()),[e,t]));return ci.useDebugValue(s),s}const bx=e=>{const t=b3(e),s=n=>S3(t,n);return Object.assign(s,t),s},Gl=(e=>e?bx(e):bx),vC="ssh-manager.theme",_C=()=>window.matchMedia("(prefers-color-scheme: dark)");function Xu(){try{return _C().matches?"dark":"light"}catch{return"light"}}function yC(){const e=vo(vC);return e==="light"||e==="dark"?e:"system"}function Zu(e){document.documentElement.classList.toggle("dark",e==="dark"),document.documentElement.style.colorScheme=e}const Uh=Gl(e=>{const t=yC(),s=t==="system"?Xu():t;Zu(s);try{_C().addEventListener("change",()=>{e(n=>{if(n.mode!=="system")return n;const a=Xu();return Zu(a),{resolved:a}})})}catch{}return{mode:t,resolved:s,setMode:n=>{const a=n==="system"?Xu():n;Zu(a),_o(vC,n),e({mode:n,resolved:a})}}});function w3(){const e=yC(),t=e==="system"?Xu():e;Zu(t),Uh.setState({mode:e,resolved:t})}const bC="ssh-manager.sidebar-expanded";function xC(){return vo(bC)!=="false"}const Ie=Gl((e,t)=>({view:"servers",tabs:[],activeTabId:null,expanded:xC(),pendingCount:0,handedOver:!1,setHandedOver:s=>e({handedOver:s}),setView:s=>e({view:s,activeTabId:null}),optionsTab:"appearance",setOptionsTab:s=>e({optionsTab:s}),wantsImport:!1,setWantsImport:s=>e({wantsImport:s}),wantsAdd:!1,setWantsAdd:s=>e({wantsAdd:s}),serverDraft:null,setServerDraft:s=>e({serverDraft:s}),addTab:s=>{const n=t().tabs.find(l=>l.id===s.id);if(n)return e({activeTabId:n.id});const a={closable:!0,...s};e(l=>({tabs:[...l.tabs,a],activeTabId:a.id}))},activateTab:s=>e({activeTabId:s}),removeTab:s=>e(n=>{var u;const a=n.tabs.filter(f=>f.id!==s),l=n.activeTabId===s?((u=a.at(-1))==null?void 0:u.id)??null:n.activeTabId;return{tabs:a,activeTabId:l}}),updateTab:(s,n)=>e(a=>({tabs:a.tabs.map(l=>l.id===s?{...l,...n}:l)})),toggleExpanded:()=>e(s=>{const n=!s.expanded;return _o(bC,String(n)),{expanded:n}}),setPendingCount:s=>e({pendingCount:s})}));function C3(){Ie.setState({expanded:xC()})}const SC="ssh-manager.view-settings";function wC(){try{const e=JSON.parse(vo(SC)??"{}");return{serverViewMode:(e==null?void 0:e.serverViewMode)==="list"?"list":"grid",collapsedCategories:Array.isArray(e==null?void 0:e.collapsedCategories)?e.collapsedCategories.filter(t=>typeof t=="string"):[]}}catch{return{}}}const $l=Gl((e,t)=>({serverViewMode:"grid",collapsedCategories:[],...wC(),toggleCategoryCollapse:s=>{const{collapsedCategories:n}=t(),a=n.includes(s)?n.filter(l=>l!==s):[...n,s];t().updateSetting("collapsedCategories",a)},updateSetting:(s,n)=>{e({[s]:n});const{serverViewMode:a,collapsedCategories:l}=t();_o(SC,JSON.stringify({serverViewMode:a,collapsedCategories:l}))}}));function E3(){$l.setState({serverViewMode:"grid",collapsedCategories:[],...wC()})}const zt=Gl((e,t)=>({servers:[],loading:!0,error:null,searchQuery:"",categoryFilter:null,viewMode:"grid",editMode:!1,sortBy:"name",sortDirection:"asc",setSearchQuery:s=>e({searchQuery:s}),setCategoryFilter:s=>e({categoryFilter:s}),setViewMode:s=>{$l.getState().updateSetting("serverViewMode",s),e({viewMode:s})},setEditMode:s=>e({editMode:s}),setSortBy:s=>e({sortBy:s}),setSortDirection:s=>e({sortDirection:s}),load:async()=>{try{e({servers:await Ya.list(),loading:!1,error:null})}catch(s){e({loading:!1,error:s.message})}},save:async s=>{await Ya.save(s),e({servers:await Ya.list()})},remove:async s=>{await Ya.remove(s),e({servers:await Ya.list()})},getFilteredServers:()=>{const{servers:s,searchQuery:n,sortBy:a,sortDirection:l}=t();let u=s;if(n.trim()){const f=n.toLowerCase();u=s.filter(m=>m.name.toLowerCase().includes(f)||m.host.toLowerCase().includes(f)||m.username.toLowerCase().includes(f)||(m.category||"").toLowerCase().includes(f))}return[...u].sort((f,m)=>{const d=a==="host"?f.host.localeCompare(m.host):f.name.localeCompare(m.name);return l==="asc"?d:-d})},getServersByCategory:()=>{const{categoryFilter:s}=t(),n=new Map;for(const a of t().getFilteredServers()){const l=a.category||"Uncategorized";s!==null&&l!==s||(n.has(l)||n.set(l,[]),n.get(l).push(a))}return n}}));/**
98
+ * @license lucide-react v0.474.0 - ISC
99
+ *
100
+ * This source code is licensed under the ISC license.
101
+ * See the LICENSE file in the root directory of this source tree.
102
+ */const k3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),CC=(...e)=>e.filter((t,s,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===s).join(" ").trim();/**
103
+ * @license lucide-react v0.474.0 - ISC
104
+ *
105
+ * This source code is licensed under the ISC license.
106
+ * See the LICENSE file in the root directory of this source tree.
107
+ */var N3={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
108
+ * @license lucide-react v0.474.0 - ISC
109
+ *
110
+ * This source code is licensed under the ISC license.
111
+ * See the LICENSE file in the root directory of this source tree.
112
+ */const j3=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:n,className:a="",children:l,iconNode:u,...f},m)=>w.createElement("svg",{ref:m,...N3,width:t,height:t,stroke:e,strokeWidth:n?Number(s)*24/Number(t):s,className:CC("lucide",a),...f},[...u.map(([d,_])=>w.createElement(d,_)),...Array.isArray(l)?l:[l]]));/**
113
+ * @license lucide-react v0.474.0 - ISC
114
+ *
115
+ * This source code is licensed under the ISC license.
116
+ * See the LICENSE file in the root directory of this source tree.
117
+ */const _e=(e,t)=>{const s=w.forwardRef(({className:n,...a},l)=>w.createElement(j3,{ref:l,iconNode:t,className:CC(`lucide-${k3(e)}`,n),...a}));return s.displayName=`${e}`,s};/**
118
+ * @license lucide-react v0.474.0 - ISC
119
+ *
120
+ * This source code is licensed under the ISC license.
121
+ * See the LICENSE file in the root directory of this source tree.
122
+ */const D3=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],EC=_e("Activity",D3);/**
123
+ * @license lucide-react v0.474.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */const T3=[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]],R3=_e("AppWindow",T3);/**
128
+ * @license lucide-react v0.474.0 - ISC
129
+ *
130
+ * This source code is licensed under the ISC license.
131
+ * See the LICENSE file in the root directory of this source tree.
132
+ */const M3=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],A3=_e("ArchiveRestore",M3);/**
133
+ * @license lucide-react v0.474.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */const O3=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],z3=_e("ArrowLeft",O3);/**
138
+ * @license lucide-react v0.474.0 - ISC
139
+ *
140
+ * This source code is licensed under the ISC license.
141
+ * See the LICENSE file in the root directory of this source tree.
142
+ */const L3=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],kC=_e("ArrowRight",L3);/**
143
+ * @license lucide-react v0.474.0 - ISC
144
+ *
145
+ * This source code is licensed under the ISC license.
146
+ * See the LICENSE file in the root directory of this source tree.
147
+ */const B3=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],P3=_e("ArrowUp",B3);/**
148
+ * @license lucide-react v0.474.0 - ISC
149
+ *
150
+ * This source code is licensed under the ISC license.
151
+ * See the LICENSE file in the root directory of this source tree.
152
+ */const H3=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],I3=_e("Bot",H3);/**
153
+ * @license lucide-react v0.474.0 - ISC
154
+ *
155
+ * This source code is licensed under the ISC license.
156
+ * See the LICENSE file in the root directory of this source tree.
157
+ */const $3=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ro=_e("Check",$3);/**
158
+ * @license lucide-react v0.474.0 - ISC
159
+ *
160
+ * This source code is licensed under the ISC license.
161
+ * See the LICENSE file in the root directory of this source tree.
162
+ */const U3=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Xl=_e("ChevronDown",U3);/**
163
+ * @license lucide-react v0.474.0 - ISC
164
+ *
165
+ * This source code is licensed under the ISC license.
166
+ * See the LICENSE file in the root directory of this source tree.
167
+ */const F3=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Qg=_e("ChevronRight",F3);/**
168
+ * @license lucide-react v0.474.0 - ISC
169
+ *
170
+ * This source code is licensed under the ISC license.
171
+ * See the LICENSE file in the root directory of this source tree.
172
+ */const V3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],W3=_e("CircleArrowUp",V3);/**
173
+ * @license lucide-react v0.474.0 - ISC
174
+ *
175
+ * This source code is licensed under the ISC license.
176
+ * See the LICENSE file in the root directory of this source tree.
177
+ */const K3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],q3=_e("CircleCheck",K3);/**
178
+ * @license lucide-react v0.474.0 - ISC
179
+ *
180
+ * This source code is licensed under the ISC license.
181
+ * See the LICENSE file in the root directory of this source tree.
182
+ */const Y3=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]],Op=_e("ClipboardCopy",Y3);/**
183
+ * @license lucide-react v0.474.0 - ISC
184
+ *
185
+ * This source code is licensed under the ISC license.
186
+ * See the LICENSE file in the root directory of this source tree.
187
+ */const G3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],mh=_e("Clock",G3);/**
188
+ * @license lucide-react v0.474.0 - ISC
189
+ *
190
+ * This source code is licensed under the ISC license.
191
+ * See the LICENSE file in the root directory of this source tree.
192
+ */const X3=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],NC=_e("Copy",X3);/**
193
+ * @license lucide-react v0.474.0 - ISC
194
+ *
195
+ * This source code is licensed under the ISC license.
196
+ * See the LICENSE file in the root directory of this source tree.
197
+ */const Z3=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Xn=_e("Download",Z3);/**
198
+ * @license lucide-react v0.474.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ */const Q3=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],jC=_e("ExternalLink",Q3);/**
203
+ * @license lucide-react v0.474.0 - ISC
204
+ *
205
+ * This source code is licensed under the ISC license.
206
+ * See the LICENSE file in the root directory of this source tree.
207
+ */const J3=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],eA=_e("EyeOff",J3);/**
208
+ * @license lucide-react v0.474.0 - ISC
209
+ *
210
+ * This source code is licensed under the ISC license.
211
+ * See the LICENSE file in the root directory of this source tree.
212
+ */const tA=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],DC=_e("Eye",tA);/**
213
+ * @license lucide-react v0.474.0 - ISC
214
+ *
215
+ * This source code is licensed under the ISC license.
216
+ * See the LICENSE file in the root directory of this source tree.
217
+ */const iA=[["path",{d:"M10 12v-1",key:"v7bkov"}],["path",{d:"M10 18v-2",key:"1cjy8d"}],["path",{d:"M10 7V6",key:"dljcrl"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01",key:"gkbcor"}],["circle",{cx:"10",cy:"20",r:"2",key:"1xzdoj"}]],zp=_e("FileArchive",iA);/**
218
+ * @license lucide-react v0.474.0 - ISC
219
+ *
220
+ * This source code is licensed under the ISC license.
221
+ * See the LICENSE file in the root directory of this source tree.
222
+ */const sA=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],TC=_e("FileCode",sA);/**
223
+ * @license lucide-react v0.474.0 - ISC
224
+ *
225
+ * This source code is licensed under the ISC license.
226
+ * See the LICENSE file in the root directory of this source tree.
227
+ */const rA=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["circle",{cx:"10",cy:"16",r:"2",key:"4ckbqe"}],["path",{d:"m16 10-4.5 4.5",key:"7p3ebg"}],["path",{d:"m15 11 1 1",key:"1bsyx3"}]],nA=_e("FileKey",rA);/**
228
+ * @license lucide-react v0.474.0 - ISC
229
+ *
230
+ * This source code is licensed under the ISC license.
231
+ * See the LICENSE file in the root directory of this source tree.
232
+ */const aA=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],oA=_e("FileSpreadsheet",aA);/**
233
+ * @license lucide-react v0.474.0 - ISC
234
+ *
235
+ * This source code is licensed under the ISC license.
236
+ * See the LICENSE file in the root directory of this source tree.
237
+ */const lA=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],cA=_e("FileText",lA);/**
238
+ * @license lucide-react v0.474.0 - ISC
239
+ *
240
+ * This source code is licensed under the ISC license.
241
+ * See the LICENSE file in the root directory of this source tree.
242
+ */const uA=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],RC=_e("File",uA);/**
243
+ * @license lucide-react v0.474.0 - ISC
244
+ *
245
+ * This source code is licensed under the ISC license.
246
+ * See the LICENSE file in the root directory of this source tree.
247
+ */const hA=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],fr=_e("FolderOpen",hA);/**
248
+ * @license lucide-react v0.474.0 - ISC
249
+ *
250
+ * This source code is licensed under the ISC license.
251
+ * See the LICENSE file in the root directory of this source tree.
252
+ */const dA=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],MC=_e("FolderPlus",dA);/**
253
+ * @license lucide-react v0.474.0 - ISC
254
+ *
255
+ * This source code is licensed under the ISC license.
256
+ * See the LICENSE file in the root directory of this source tree.
257
+ */const fA=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],mA=_e("HardDrive",fA);/**
258
+ * @license lucide-react v0.474.0 - ISC
259
+ *
260
+ * This source code is licensed under the ISC license.
261
+ * See the LICENSE file in the root directory of this source tree.
262
+ */const pA=[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"1uw2ng"}]],AC=_e("HeartPulse",pA);/**
263
+ * @license lucide-react v0.474.0 - ISC
264
+ *
265
+ * This source code is licensed under the ISC license.
266
+ * See the LICENSE file in the root directory of this source tree.
267
+ */const gA=[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]],vA=_e("Heart",gA);/**
268
+ * @license lucide-react v0.474.0 - ISC
269
+ *
270
+ * This source code is licensed under the ISC license.
271
+ * See the LICENSE file in the root directory of this source tree.
272
+ */const _A=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],OC=_e("House",_A);/**
273
+ * @license lucide-react v0.474.0 - ISC
274
+ *
275
+ * This source code is licensed under the ISC license.
276
+ * See the LICENSE file in the root directory of this source tree.
277
+ */const yA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],bA=_e("Image",yA);/**
278
+ * @license lucide-react v0.474.0 - ISC
279
+ *
280
+ * This source code is licensed under the ISC license.
281
+ * See the LICENSE file in the root directory of this source tree.
282
+ */const xA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],zC=_e("Info",xA);/**
283
+ * @license lucide-react v0.474.0 - ISC
284
+ *
285
+ * This source code is licensed under the ISC license.
286
+ * See the LICENSE file in the root directory of this source tree.
287
+ */const SA=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],wA=_e("KeyRound",SA);/**
288
+ * @license lucide-react v0.474.0 - ISC
289
+ *
290
+ * This source code is licensed under the ISC license.
291
+ * See the LICENSE file in the root directory of this source tree.
292
+ */const CA=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],EA=_e("Layers",CA);/**
293
+ * @license lucide-react v0.474.0 - ISC
294
+ *
295
+ * This source code is licensed under the ISC license.
296
+ * See the LICENSE file in the root directory of this source tree.
297
+ */const kA=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],NA=_e("LayoutGrid",kA);/**
298
+ * @license lucide-react v0.474.0 - ISC
299
+ *
300
+ * This source code is licensed under the ISC license.
301
+ * See the LICENSE file in the root directory of this source tree.
302
+ */const jA=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],DA=_e("List",jA);/**
303
+ * @license lucide-react v0.474.0 - ISC
304
+ *
305
+ * This source code is licensed under the ISC license.
306
+ * See the LICENSE file in the root directory of this source tree.
307
+ */const TA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ss=_e("LoaderCircle",TA);/**
308
+ * @license lucide-react v0.474.0 - ISC
309
+ *
310
+ * This source code is licensed under the ISC license.
311
+ * See the LICENSE file in the root directory of this source tree.
312
+ */const RA=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],Jg=_e("LockKeyhole",RA);/**
313
+ * @license lucide-react v0.474.0 - ISC
314
+ *
315
+ * This source code is licensed under the ISC license.
316
+ * See the LICENSE file in the root directory of this source tree.
317
+ */const MA=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Zl=_e("Monitor",MA);/**
318
+ * @license lucide-react v0.474.0 - ISC
319
+ *
320
+ * This source code is licensed under the ISC license.
321
+ * See the LICENSE file in the root directory of this source tree.
322
+ */const AA=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],OA=_e("Moon",AA);/**
323
+ * @license lucide-react v0.474.0 - ISC
324
+ *
325
+ * This source code is licensed under the ISC license.
326
+ * See the LICENSE file in the root directory of this source tree.
327
+ */const zA=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],LA=_e("Music",zA);/**
328
+ * @license lucide-react v0.474.0 - ISC
329
+ *
330
+ * This source code is licensed under the ISC license.
331
+ * See the LICENSE file in the root directory of this source tree.
332
+ */const BA=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],PA=_e("Network",BA);/**
333
+ * @license lucide-react v0.474.0 - ISC
334
+ *
335
+ * This source code is licensed under the ISC license.
336
+ * See the LICENSE file in the root directory of this source tree.
337
+ */const HA=[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]],IA=_e("Palette",HA);/**
338
+ * @license lucide-react v0.474.0 - ISC
339
+ *
340
+ * This source code is licensed under the ISC license.
341
+ * See the LICENSE file in the root directory of this source tree.
342
+ */const $A=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],UA=_e("PanelLeftClose",$A);/**
343
+ * @license lucide-react v0.474.0 - ISC
344
+ *
345
+ * This source code is licensed under the ISC license.
346
+ * See the LICENSE file in the root directory of this source tree.
347
+ */const FA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],VA=_e("PanelLeftOpen",FA);/**
348
+ * @license lucide-react v0.474.0 - ISC
349
+ *
350
+ * This source code is licensed under the ISC license.
351
+ * See the LICENSE file in the root directory of this source tree.
352
+ */const WA=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],no=_e("Pencil",WA);/**
353
+ * @license lucide-react v0.474.0 - ISC
354
+ *
355
+ * This source code is licensed under the ISC license.
356
+ * See the LICENSE file in the root directory of this source tree.
357
+ */const KA=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],LC=_e("Play",KA);/**
358
+ * @license lucide-react v0.474.0 - ISC
359
+ *
360
+ * This source code is licensed under the ISC license.
361
+ * See the LICENSE file in the root directory of this source tree.
362
+ */const qA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Bi=_e("Plus",qA);/**
363
+ * @license lucide-react v0.474.0 - ISC
364
+ *
365
+ * This source code is licensed under the ISC license.
366
+ * See the LICENSE file in the root directory of this source tree.
367
+ */const YA=[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]],BC=_e("Radio",YA);/**
368
+ * @license lucide-react v0.474.0 - ISC
369
+ *
370
+ * This source code is licensed under the ISC license.
371
+ * See the LICENSE file in the root directory of this source tree.
372
+ */const GA=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],ao=_e("RefreshCw",GA);/**
373
+ * @license lucide-react v0.474.0 - ISC
374
+ *
375
+ * This source code is licensed under the ISC license.
376
+ * See the LICENSE file in the root directory of this source tree.
377
+ */const XA=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],ZA=_e("RotateCw",XA);/**
378
+ * @license lucide-react v0.474.0 - ISC
379
+ *
380
+ * This source code is licensed under the ISC license.
381
+ * See the LICENSE file in the root directory of this source tree.
382
+ */const QA=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],JA=_e("Search",QA);/**
383
+ * @license lucide-react v0.474.0 - ISC
384
+ *
385
+ * This source code is licensed under the ISC license.
386
+ * See the LICENSE file in the root directory of this source tree.
387
+ */const eO=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],PC=_e("Server",eO);/**
388
+ * @license lucide-react v0.474.0 - ISC
389
+ *
390
+ * This source code is licensed under the ISC license.
391
+ * See the LICENSE file in the root directory of this source tree.
392
+ */const tO=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],iO=_e("Settings",tO);/**
393
+ * @license lucide-react v0.474.0 - ISC
394
+ *
395
+ * This source code is licensed under the ISC license.
396
+ * See the LICENSE file in the root directory of this source tree.
397
+ */const sO=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Fh=_e("ShieldCheck",sO);/**
398
+ * @license lucide-react v0.474.0 - ISC
399
+ *
400
+ * This source code is licensed under the ISC license.
401
+ * See the LICENSE file in the root directory of this source tree.
402
+ */const rO=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],Fn=_e("SquareTerminal",rO);/**
403
+ * @license lucide-react v0.474.0 - ISC
404
+ *
405
+ * This source code is licensed under the ISC license.
406
+ * See the LICENSE file in the root directory of this source tree.
407
+ */const nO=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],aO=_e("Sun",nO);/**
408
+ * @license lucide-react v0.474.0 - ISC
409
+ *
410
+ * This source code is licensed under the ISC license.
411
+ * See the LICENSE file in the root directory of this source tree.
412
+ */const oO=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],oo=_e("Terminal",oO);/**
413
+ * @license lucide-react v0.474.0 - ISC
414
+ *
415
+ * This source code is licensed under the ISC license.
416
+ * See the LICENSE file in the root directory of this source tree.
417
+ */const lO=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Vn=_e("Trash2",lO);/**
418
+ * @license lucide-react v0.474.0 - ISC
419
+ *
420
+ * This source code is licensed under the ISC license.
421
+ * See the LICENSE file in the root directory of this source tree.
422
+ */const cO=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],ph=_e("TriangleAlert",cO);/**
423
+ * @license lucide-react v0.474.0 - ISC
424
+ *
425
+ * This source code is licensed under the ISC license.
426
+ * See the LICENSE file in the root directory of this source tree.
427
+ */const uO=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],hO=_e("Unplug",uO);/**
428
+ * @license lucide-react v0.474.0 - ISC
429
+ *
430
+ * This source code is licensed under the ISC license.
431
+ * See the LICENSE file in the root directory of this source tree.
432
+ */const dO=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],Ql=_e("Upload",dO);/**
433
+ * @license lucide-react v0.474.0 - ISC
434
+ *
435
+ * This source code is licensed under the ISC license.
436
+ * See the LICENSE file in the root directory of this source tree.
437
+ */const fO=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],mO=_e("Video",fO);/**
438
+ * @license lucide-react v0.474.0 - ISC
439
+ *
440
+ * This source code is licensed under the ISC license.
441
+ * See the LICENSE file in the root directory of this source tree.
442
+ */const pO=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],gO=_e("WifiOff",pO);/**
443
+ * @license lucide-react v0.474.0 - ISC
444
+ *
445
+ * This source code is licensed under the ISC license.
446
+ * See the LICENSE file in the root directory of this source tree.
447
+ */const vO=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],vr=_e("X",vO);function HC(e){var t,s,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(s=HC(e[t]))&&(n&&(n+=" "),n+=s)}else for(s in e)e[s]&&(n&&(n+=" "),n+=s);return n}function IC(){for(var e,t,s=0,n="",a=arguments.length;s<a;s++)(e=arguments[s])&&(t=HC(e))&&(n&&(n+=" "),n+=t);return n}const _O=(e,t)=>{const s=new Array(e.length+t.length);for(let n=0;n<e.length;n++)s[n]=e[n];for(let n=0;n<t.length;n++)s[e.length+n]=t[n];return s},yO=(e,t)=>({classGroupId:e,validator:t}),$C=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),gh="-",xx=[],bO="arbitrary..",xO=e=>{const t=wO(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return SO(u);const f=u.split(gh),m=f[0]===""&&f.length>1?1:0;return UC(f,m,t)},getConflictingClassGroupIds:(u,f)=>{if(f){const m=n[u],d=s[u];return m?d?_O(d,m):m:d||xx}return s[u]||xx}}},UC=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const a=e[t],l=s.nextPart.get(a);if(l){const d=UC(e,t+1,l);if(d)return d}const u=s.validators;if(u===null)return;const f=t===0?e.join(gh):e.slice(t).join(gh),m=u.length;for(let d=0;d<m;d++){const _=u[d];if(_.validator(f))return _.classGroupId}},SO=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),n=t.slice(0,s);return n?bO+n:void 0})(),wO=e=>{const{theme:t,classGroups:s}=e;return CO(s,t)},CO=(e,t)=>{const s=$C();for(const n in e){const a=e[n];ev(a,s,n,t)}return s},ev=(e,t,s,n)=>{const a=e.length;for(let l=0;l<a;l++){const u=e[l];EO(u,t,s,n)}},EO=(e,t,s,n)=>{if(typeof e=="string"){kO(e,t,s);return}if(typeof e=="function"){NO(e,t,s,n);return}jO(e,t,s,n)},kO=(e,t,s)=>{const n=e===""?t:FC(t,e);n.classGroupId=s},NO=(e,t,s,n)=>{if(DO(e)){ev(e(n),t,s,n);return}t.validators===null&&(t.validators=[]),t.validators.push(yO(s,e))},jO=(e,t,s,n)=>{const a=Object.entries(e),l=a.length;for(let u=0;u<l;u++){const[f,m]=a[u];ev(m,FC(t,f),s,n)}},FC=(e,t)=>{let s=e;const n=t.split(gh),a=n.length;for(let l=0;l<a;l++){const u=n[l];let f=s.nextPart.get(u);f||(f=$C(),s.nextPart.set(u,f)),s=f}return s},DO=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,TO=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),n=Object.create(null);const a=(l,u)=>{s[l]=u,t++,t>e&&(t=0,n=s,s=Object.create(null))};return{get(l){let u=s[l];if(u!==void 0)return u;if((u=n[l])!==void 0)return a(l,u),u},set(l,u){l in s?s[l]=u:a(l,u)}}},Lp="!",Sx=":",RO=[],wx=(e,t,s,n,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:n,isExternal:a}),MO=e=>{const{prefix:t,experimentalParseClassName:s}=e;let n=a=>{const l=[];let u=0,f=0,m=0,d;const _=a.length;for(let S=0;S<_;S++){const E=a[S];if(u===0&&f===0){if(E===Sx){l.push(a.slice(m,S)),m=S+1;continue}if(E==="/"){d=S;continue}}E==="["?u++:E==="]"?u--:E==="("?f++:E===")"&&f--}const g=l.length===0?a:a.slice(m);let b=g,y=!1;g.endsWith(Lp)?(b=g.slice(0,-1),y=!0):g.startsWith(Lp)&&(b=g.slice(1),y=!0);const x=d&&d>m?d-m:void 0;return wx(l,y,b,x)};if(t){const a=t+Sx,l=n;n=u=>u.startsWith(a)?l(u.slice(a.length)):wx(RO,!1,u,void 0,!0)}if(s){const a=n;n=l=>s({className:l,parseClassName:a})}return n},AO=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,n)=>{t.set(s,1e6+n)}),s=>{const n=[];let a=[];for(let l=0;l<s.length;l++){const u=s[l],f=u[0]==="[",m=t.has(u);f||m?(a.length>0&&(a.sort(),n.push(...a),a=[]),n.push(u)):a.push(u)}return a.length>0&&(a.sort(),n.push(...a)),n}},OO=e=>({cache:TO(e.cacheSize),parseClassName:MO(e),sortModifiers:AO(e),postfixLookupClassGroupIds:zO(e),...xO(e)}),zO=e=>{const t=Object.create(null),s=e.postfixLookupClassGroups;if(s)for(let n=0;n<s.length;n++)t[s[n]]=!0;return t},LO=/\s+/,BO=(e,t)=>{const{parseClassName:s,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:l,postfixLookupClassGroupIds:u}=t,f=[],m=e.trim().split(LO);let d="";for(let _=m.length-1;_>=0;_-=1){const g=m[_],{isExternal:b,modifiers:y,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:E}=s(g);if(b){d=g+(d.length>0?" "+d:d);continue}let k=!!E,T;if(k){const j=S.substring(0,E);T=n(j);const A=T&&u[T]?n(S):void 0;A&&A!==T&&(T=A,k=!1)}else T=n(S);if(!T){if(!k){d=g+(d.length>0?" "+d:d);continue}if(T=n(S),!T){d=g+(d.length>0?" "+d:d);continue}k=!1}const D=y.length===0?"":y.length===1?y[0]:l(y).join(":"),R=x?D+Lp:D,z=R+T;if(f.indexOf(z)>-1)continue;f.push(z);const L=a(T,k);for(let j=0;j<L.length;++j){const A=L[j];f.push(R+A)}d=g+(d.length>0?" "+d:d)}return d},PO=(...e)=>{let t=0,s,n,a="";for(;t<e.length;)(s=e[t++])&&(n=VC(s))&&(a&&(a+=" "),a+=n);return a},VC=e=>{if(typeof e=="string")return e;let t,s="";for(let n=0;n<e.length;n++)e[n]&&(t=VC(e[n]))&&(s&&(s+=" "),s+=t);return s},HO=(e,...t)=>{let s,n,a,l;const u=m=>{const d=t.reduce((_,g)=>g(_),e());return s=OO(d),n=s.cache.get,a=s.cache.set,l=f,f(m)},f=m=>{const d=n(m);if(d)return d;const _=BO(m,s);return a(m,_),_};return l=u,(...m)=>l(PO(...m))},IO=[],Mt=e=>{const t=s=>s[e]||IO;return t.isThemeGetter=!0,t},WC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,KC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$O=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,UO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,FO=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,VO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,WO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,KO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qr=e=>$O.test(e),Le=e=>!!e&&!Number.isNaN(Number(e)),ys=e=>!!e&&Number.isInteger(Number(e)),Pm=e=>e.endsWith("%")&&Le(e.slice(0,-1)),tr=e=>UO.test(e),qC=()=>!0,qO=e=>FO.test(e)&&!VO.test(e),tv=()=>!1,YO=e=>WO.test(e),GO=e=>KO.test(e),XO=e=>!pe(e)&&!ve(e),ZO=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),QO=e=>on(e,XC,tv),pe=e=>WC.test(e),Rn=e=>on(e,ZC,qO),Cx=e=>on(e,a4,Le),JO=e=>on(e,JC,qC),e4=e=>on(e,QC,tv),Ex=e=>on(e,YC,tv),t4=e=>on(e,GC,GO),Au=e=>on(e,e2,YO),ve=e=>KC.test(e),vl=e=>Zn(e,ZC),i4=e=>Zn(e,QC),kx=e=>Zn(e,YC),s4=e=>Zn(e,XC),r4=e=>Zn(e,GC),Ou=e=>Zn(e,e2,!0),n4=e=>Zn(e,JC,!0),on=(e,t,s)=>{const n=WC.exec(e);return n?n[1]?t(n[1]):s(n[2]):!1},Zn=(e,t,s=!1)=>{const n=KC.exec(e);return n?n[1]?t(n[1]):s:!1},YC=e=>e==="position"||e==="percentage",GC=e=>e==="image"||e==="url",XC=e=>e==="length"||e==="size"||e==="bg-size",ZC=e=>e==="length",a4=e=>e==="number",QC=e=>e==="family-name",JC=e=>e==="number"||e==="weight",e2=e=>e==="shadow",o4=()=>{const e=Mt("color"),t=Mt("font"),s=Mt("text"),n=Mt("font-weight"),a=Mt("tracking"),l=Mt("leading"),u=Mt("breakpoint"),f=Mt("container"),m=Mt("spacing"),d=Mt("radius"),_=Mt("shadow"),g=Mt("inset-shadow"),b=Mt("text-shadow"),y=Mt("drop-shadow"),x=Mt("blur"),S=Mt("perspective"),E=Mt("aspect"),k=Mt("ease"),T=Mt("animate"),D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],z=()=>[...R(),ve,pe],L=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],A=()=>[ve,pe,m],V=()=>[qr,"full","auto",...A()],I=()=>[ys,"none","subgrid",ve,pe],J=()=>["auto",{span:["full",ys,ve,pe]},ys,ve,pe],$=()=>[ys,"auto",ve,pe],B=()=>["auto","min","max","fr",ve,pe],K=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...A()],H=()=>[qr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],U=()=>[qr,"screen","full","dvw","lvw","svw","min","max","fit",...A()],ae=()=>[qr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],Y=()=>[e,ve,pe],O=()=>[...R(),kx,Ex,{position:[ve,pe]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],te=()=>["auto","cover","contain",s4,QO,{size:[ve,pe]}],oe=()=>[Pm,vl,Rn],ce=()=>["","none","full",d,ve,pe],he=()=>["",Le,vl,Rn],Se=()=>["solid","dashed","dotted","double"],me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[Le,Pm,kx,Ex],Ce=()=>["","none",x,ve,pe],je=()=>["none",Le,ve,pe],it=()=>["none",Le,ve,pe],De=()=>[Le,ve,pe],ht=()=>[qr,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[tr],breakpoint:[tr],color:[qC],container:[tr],"drop-shadow":[tr],ease:["in","out","in-out"],font:[XO],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[tr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[tr],shadow:[tr],spacing:["px",Le],text:[tr],"text-shadow":[tr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qr,pe,ve,E]}],container:["container"],"container-type":[{"@container":["","normal","size",ve,pe]}],"container-named":[ZO],columns:[{columns:[Le,pe,ve,f]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:z()}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{"inset-s":V(),start:V()}],end:[{"inset-e":V(),end:V()}],"inset-bs":[{"inset-bs":V()}],"inset-be":[{"inset-be":V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[ys,"auto",ve,pe]}],basis:[{basis:[qr,"full","auto",f,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Le,qr,"auto","initial","none",pe]}],grow:[{grow:["",Le,ve,pe]}],shrink:[{shrink:["",Le,ve,pe]}],order:[{order:[ys,"first","last","none",ve,pe]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:J()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:J()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...K(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...K()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":K()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],"inline-size":[{inline:["auto",...U()]}],"min-inline-size":[{"min-inline":["auto",...U()]}],"max-inline-size":[{"max-inline":["none",...U()]}],"block-size":[{block:["auto",...ae()]}],"min-block-size":[{"min-block":["auto",...ae()]}],"max-block-size":[{"max-block":["none",...ae()]}],w:[{w:[f,"screen",...H()]}],"min-w":[{"min-w":[f,"screen","none",...H()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",s,vl,Rn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,n4,JO]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Pm,pe]}],"font-family":[{font:[i4,e4,t]}],"font-features":[{"font-features":[pe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,ve,pe]}],"line-clamp":[{"line-clamp":[Le,"none",ve,Cx]}],leading:[{leading:[l,...A()]}],"list-image":[{"list-image":["none",ve,pe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ve,pe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Y()}],"text-color":[{text:Y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Se(),"wavy"]}],"text-decoration-thickness":[{decoration:[Le,"from-font","auto",ve,Rn]}],"text-decoration-color":[{decoration:Y()}],"underline-offset":[{"underline-offset":[Le,"auto",ve,pe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"tab-size":[{tab:[ys,ve,pe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ve,pe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ve,pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ys,ve,pe],radial:["",ve,pe],conic:[ys,ve,pe]},r4,t4]}],"bg-color":[{bg:Y()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:Y()}],"gradient-via":[{via:Y()}],"gradient-to":[{to:Y()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:he()}],"border-w-x":[{"border-x":he()}],"border-w-y":[{"border-y":he()}],"border-w-s":[{"border-s":he()}],"border-w-e":[{"border-e":he()}],"border-w-bs":[{"border-bs":he()}],"border-w-be":[{"border-be":he()}],"border-w-t":[{"border-t":he()}],"border-w-r":[{"border-r":he()}],"border-w-b":[{"border-b":he()}],"border-w-l":[{"border-l":he()}],"divide-x":[{"divide-x":he()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":he()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Se(),"hidden","none"]}],"divide-style":[{divide:[...Se(),"hidden","none"]}],"border-color":[{border:Y()}],"border-color-x":[{"border-x":Y()}],"border-color-y":[{"border-y":Y()}],"border-color-s":[{"border-s":Y()}],"border-color-e":[{"border-e":Y()}],"border-color-bs":[{"border-bs":Y()}],"border-color-be":[{"border-be":Y()}],"border-color-t":[{"border-t":Y()}],"border-color-r":[{"border-r":Y()}],"border-color-b":[{"border-b":Y()}],"border-color-l":[{"border-l":Y()}],"divide-color":[{divide:Y()}],"outline-style":[{outline:[...Se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Le,ve,pe]}],"outline-w":[{outline:["",Le,vl,Rn]}],"outline-color":[{outline:Y()}],shadow:[{shadow:["","none",_,Ou,Au]}],"shadow-color":[{shadow:Y()}],"inset-shadow":[{"inset-shadow":["none",g,Ou,Au]}],"inset-shadow-color":[{"inset-shadow":Y()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Y()}],"ring-offset-w":[{"ring-offset":[Le,Rn]}],"ring-offset-color":[{"ring-offset":Y()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":Y()}],"text-shadow":[{"text-shadow":["none",b,Ou,Au]}],"text-shadow-color":[{"text-shadow":Y()}],opacity:[{opacity:[Le,ve,pe]}],"mix-blend":[{"mix-blend":[...me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":me()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Le]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":Y()}],"mask-image-linear-to-color":[{"mask-linear-to":Y()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":Y()}],"mask-image-t-to-color":[{"mask-t-to":Y()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":Y()}],"mask-image-r-to-color":[{"mask-r-to":Y()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":Y()}],"mask-image-b-to-color":[{"mask-b-to":Y()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":Y()}],"mask-image-l-to-color":[{"mask-l-to":Y()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":Y()}],"mask-image-x-to-color":[{"mask-x-to":Y()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":Y()}],"mask-image-y-to-color":[{"mask-y-to":Y()}],"mask-image-radial":[{"mask-radial":[ve,pe]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":Y()}],"mask-image-radial-to-color":[{"mask-radial-to":Y()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[Le]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":Y()}],"mask-image-conic-to-color":[{"mask-conic-to":Y()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ve,pe]}],filter:[{filter:["","none",ve,pe]}],blur:[{blur:Ce()}],brightness:[{brightness:[Le,ve,pe]}],contrast:[{contrast:[Le,ve,pe]}],"drop-shadow":[{"drop-shadow":["","none",y,Ou,Au]}],"drop-shadow-color":[{"drop-shadow":Y()}],grayscale:[{grayscale:["",Le,ve,pe]}],"hue-rotate":[{"hue-rotate":[Le,ve,pe]}],invert:[{invert:["",Le,ve,pe]}],saturate:[{saturate:[Le,ve,pe]}],sepia:[{sepia:["",Le,ve,pe]}],"backdrop-filter":[{"backdrop-filter":["","none",ve,pe]}],"backdrop-blur":[{"backdrop-blur":Ce()}],"backdrop-brightness":[{"backdrop-brightness":[Le,ve,pe]}],"backdrop-contrast":[{"backdrop-contrast":[Le,ve,pe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Le,ve,pe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Le,ve,pe]}],"backdrop-invert":[{"backdrop-invert":["",Le,ve,pe]}],"backdrop-opacity":[{"backdrop-opacity":[Le,ve,pe]}],"backdrop-saturate":[{"backdrop-saturate":[Le,ve,pe]}],"backdrop-sepia":[{"backdrop-sepia":["",Le,ve,pe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ve,pe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Le,"initial",ve,pe]}],ease:[{ease:["linear","initial",k,ve,pe]}],delay:[{delay:[Le,ve,pe]}],animate:[{animate:["none",T,ve,pe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,ve,pe]}],"perspective-origin":[{"perspective-origin":z()}],rotate:[{rotate:je()}],"rotate-x":[{"rotate-x":je()}],"rotate-y":[{"rotate-y":je()}],"rotate-z":[{"rotate-z":je()}],scale:[{scale:it()}],"scale-x":[{"scale-x":it()}],"scale-y":[{"scale-y":it()}],"scale-z":[{"scale-z":it()}],"scale-3d":["scale-3d"],skew:[{skew:De()}],"skew-x":[{"skew-x":De()}],"skew-y":[{"skew-y":De()}],transform:[{transform:[ve,pe,"","none","gpu","cpu"]}],"transform-origin":[{origin:z()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ht()}],"translate-x":[{"translate-x":ht()}],"translate-y":[{"translate-y":ht()}],"translate-z":[{"translate-z":ht()}],"translate-none":["translate-none"],zoom:[{zoom:[ys,ve,pe]}],accent:[{accent:Y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Y()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ve,pe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":Y()}],"scrollbar-track-color":[{"scrollbar-track":Y()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ve,pe]}],fill:[{fill:["none",...Y()]}],"stroke-w":[{stroke:[Le,vl,Rn,Cx]}],stroke:[{stroke:["none",...Y()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},l4=HO(o4);function fe(...e){return l4(IC(e))}function c4(e){if(e===0)return"0 B";const t=["B","KB","MB","GB","TB"],s=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,s)).toFixed(s>0?1:0)} ${t[s]}`}function u4(e){return new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(e))}function Nx(){return`${Date.now()}-${Math.random().toString(36).slice(2,8)}`}const to=Gl(e=>{const t=async s=>{e({busy:!0,error:null});try{const n=await s();n&&typeof n=="object"&&"currentVersion"in n&&e({info:n})}catch(n){e({error:n.message})}finally{e({busy:!1})}};return{info:null,busy:!1,error:null,load:async()=>{try{e({info:await Mu.status()})}catch{}},check:()=>t(Mu.check),download:()=>t(Mu.download),install:()=>t(Mu.install)}});let jx=!1;function h4(){jx||(jx=!0,to.getState().load(),Tt.subscribe(e=>{if(e.type==="connection"&&e.status==="connected"&&to.getState().load(),e.type==="app-update"){const{type:t,...s}=e;to.setState({info:s})}}))}function Vh({...e}){return h.jsx(mM,{"data-slot":"tooltip",...e})}function Wh({...e}){return h.jsx(pM,{"data-slot":"tooltip-trigger",...e})}function Kh({className:e,sideOffset:t=0,children:s,...n}){return h.jsx(gM,{children:h.jsxs(vM,{"data-slot":"tooltip-content",sideOffset:t,className:fe("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...n,children:[s,h.jsx(_M,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const iv=new URLSearchParams(window.location.search).get("shell"),Dx=iv!==null,Qu=iv==="macos",t2=iv==="overlay",i2=Qu||t2;function s2(){const[e,t]=w.useState("connecting");return w.useEffect(()=>Tt.subscribe(s=>{s.type==="connection"&&t(String(s.status))}),[]),e}function Bp(e){return e==="connected"?"Control plane connected":e==="connecting"?"Connecting to the control plane…":"Connection lost. Reconnecting — displayed activity may be out of date."}function d4({expanded:e}){const t=Ie(l=>l.handedOver),s=s2(),n=t&&s!=="connected"?"connected":s,a=n==="connected";return h.jsxs("div",{role:"status","aria-live":"polite",title:Bp(n),className:fe("flex items-center gap-2 rounded-lg text-xs",e?"border border-sidebar-border bg-card px-3 py-2.5":"justify-center py-2"),children:[h.jsx("span",{"aria-hidden":"true",className:fe("h-2 w-2 shrink-0 rounded-full",a?"bg-success":n==="connecting"?"bg-muted-foreground":"bg-warning")}),h.jsxs("span",{className:fe("min-w-0 truncate font-bold",!e&&"sr-only"),children:[a?"Control plane connected":n==="connecting"?"Connecting…":"Connection lost",h.jsx("span",{className:"sr-only",children:a?"":` — ${Bp(n)}`})]})]})}function f4(){const e=s2(),t=Ie(s=>s.handedOver);return e==="connected"||t?null:h.jsxs("div",{className:fe("flex shrink-0 items-center gap-2 border-b px-6 py-2 text-sm",e==="disconnected"?"border-warning/30 bg-warning-light text-foreground":"border-border bg-muted text-muted-foreground"),children:[e==="connecting"?h.jsx(ss,{className:"h-4 w-4 animate-spin motion-reduce:animate-none","aria-hidden":"true"}):h.jsx(hO,{className:"h-4 w-4 text-warning","aria-hidden":"true"}),Bp(e)]})}const m4=[{items:[{id:"servers",label:"Servers",icon:PC},{id:"terminal",label:"Terminal",icon:Fn}]},{label:"Agents",items:[{id:"waiting",label:"Waiting",icon:mh},{id:"live",label:"Live",icon:BC},{id:"activity",label:"Activity",icon:EC}]},{label:"Fleet",items:[{id:"health",label:"Health",icon:AC}]}];function p4(e){const t=e.trim().split(/\s+/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e.slice(0,2).charAt(0).toUpperCase()+e.slice(1,2).toLowerCase()}function g4(){return h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 28 28","aria-hidden":"true",className:"shrink-0 text-foreground",children:[h.jsx("rect",{x:"0.5",y:"0.5",width:"27",height:"27",rx:"6.5",fill:"#141413",stroke:"currentColor",strokeOpacity:"0.18"}),h.jsx("polyline",{points:"8.5 9 13.5 14 8.5 19",fill:"none",stroke:"#E0611A",strokeWidth:"2.6",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("line",{x1:"15.5",y1:"19.5",x2:"20.5",y2:"19.5",stroke:"#FFFFFF",strokeWidth:"2.4",strokeLinecap:"round"})]})}function v4(){const{view:e,tabs:t,activeTabId:s,expanded:n,pendingCount:a,setView:l,activateTab:u,removeTab:f,updateTab:m,toggleExpanded:d}=Ie(),_=zt(E=>E.servers.length),g=to(E=>E.info),b=Ie(E=>E.setOptionsTab),y=g&&["available","downloading","ready"].includes(g.status)?g.status:null,x=()=>{b("updates"),l("options")},S=h.jsx("button",{onClick:d,"aria-label":n?"Collapse the sidebar":"Expand the sidebar",title:n?"Collapse the sidebar":"Expand the sidebar",className:"no-drag flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:n?h.jsx(UA,{className:"h-4 w-4"}):h.jsx(VA,{className:"h-4 w-4"})});return h.jsxs("div",{className:fe("sidebar-nav flex h-full shrink-0 flex-col border-r border-sidebar-border bg-sidebar transition-[width] duration-200",n?"w-56":Qu?"w-[76px]":"w-14"),children:[Qu&&h.jsx("div",{className:"drag-region flex h-12 shrink-0 items-center justify-end px-3",children:n&&S}),h.jsx("div",{className:fe("flex h-12 shrink-0 items-center gap-2.5",n?"px-4":"justify-center",t2&&"drag-region"),children:n?h.jsxs(h.Fragment,{children:[h.jsx(g4,{}),h.jsxs("span",{className:"whitespace-nowrap text-[17px] tracking-[-0.01em]",children:[h.jsx("b",{className:"font-bold",children:"ssh"})," manager"]}),!Qu&&h.jsx("span",{className:"ml-auto",children:S})]}):S}),h.jsxs("nav",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-2 pt-2 scrollbar-none","aria-label":"Main",children:[m4.map((E,k)=>h.jsxs("div",{className:"flex flex-col gap-0.5",children:[E.label&&(n?h.jsx("div",{className:"px-2.5 pb-1.5 text-[11px] font-bold uppercase tracking-[0.08em] text-muted-foreground",children:E.label}):h.jsx("div",{className:"mx-2 mb-1 border-t border-sidebar-border"})),E.items.map(T=>h.jsx(Tx,{icon:T.icon,label:T.label,active:s===null&&e===T.id,expanded:n,badge:T.id==="waiting"&&a>0?a:void 0,meta:T.id==="servers"&&_>0?String(_):void 0,onClick:()=>l(T.id)},T.id))]},E.label??k)),t.length>0&&h.jsxs("div",{className:"flex flex-col gap-0.5",children:[n?h.jsx("div",{className:"px-2.5 pb-1.5 text-[11px] font-bold uppercase tracking-[0.08em] text-muted-foreground",children:"Open"}):h.jsx("div",{className:"mx-2 mb-1 border-t border-sidebar-border"}),t.map(E=>h.jsx(_4,{session:E,active:s===E.id,expanded:n,onActivate:()=>u(E.id),onClose:()=>f(E.id),onRename:k=>m(E.id,{title:k})},E.id))]})]}),h.jsxs("div",{className:"flex flex-col gap-1.5 px-2 pb-3 pt-2",children:[n&&g&&y&&h.jsxs("button",{type:"button",onClick:x,className:"no-drag flex items-center gap-2 rounded-lg border border-primary/30 bg-primary/5 px-2.5 py-2 text-left text-xs transition-colors hover:bg-primary/10",children:[h.jsx(W3,{className:"h-4 w-4 shrink-0 text-primary","aria-hidden":"true"}),h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"block font-bold",children:y==="ready"?"Restart to update":y==="downloading"?"Downloading update":"Update available"}),h.jsx("span",{className:"block truncate text-muted-foreground",children:y==="downloading"?`${g.percent??0}%`:`Version ${g.version}`})]})]}),h.jsx(Tx,{icon:iO,label:"Options",dot:y!==null,dotLabel:"update available",active:s===null&&e==="options",expanded:n,onClick:()=>l("options")}),h.jsx(d4,{expanded:n})]})]})}function Tx({icon:e,label:t,active:s,expanded:n,onClick:a,badge:l,meta:u,dot:f,dotLabel:m}){const d=f&&m?`${t} (${m})`:t,_=h.jsxs("button",{"aria-label":d,"aria-current":s?"page":void 0,title:d,onClick:a,className:fe("no-drag relative flex h-10 w-full items-center gap-2.5 rounded-lg transition-colors",n?"px-2.5":"justify-center",s?"bg-sidebar-accent font-bold text-sidebar-accent-foreground":"font-medium text-sidebar-foreground hover:bg-accent/50"),children:[h.jsxs("span",{className:"relative shrink-0",children:[h.jsx(e,{className:"h-[18px] w-[18px]"}),f&&h.jsx("span",{"aria-hidden":"true",className:"absolute -right-0.5 -top-0.5 h-2 w-2 rounded-full bg-primary ring-2 ring-sidebar"}),!n&&l!==void 0&&h.jsx("span",{className:"absolute -right-1.5 -top-1 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-primary px-0.5 text-[9px] font-bold leading-none text-primary-foreground",children:l})]}),n&&h.jsx("span",{className:"flex-1 truncate text-left text-sm",children:t}),n&&l!==void 0&&h.jsx("span",{className:"flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full bg-primary px-1.5 text-xs font-bold text-primary-foreground tabular-nums",children:l}),n&&l===void 0&&u!==void 0&&h.jsx("span",{className:"shrink-0 text-xs font-medium text-muted-foreground tabular-nums",children:u})]});return n?_:h.jsxs(Vh,{children:[h.jsx(Wh,{asChild:!0,children:_}),h.jsx(Kh,{side:"right",children:d})]})}function _4({session:e,active:t,expanded:s,onActivate:n,onClose:a,onRename:l}){const[u,f]=w.useState(!1),[m,d]=w.useState(e.title),_=w.useRef(null);w.useEffect(()=>{u&&_.current&&(_.current.focus(),_.current.select())},[u]);const g=()=>{const D=m.trim();D&&D!==e.title&&l(D),f(!1)},b=()=>{d(e.title),f(!1)},y=D=>{D.stopPropagation(),d(e.title),f(!0)},x=D=>{D.key==="Enter"?g():D.key==="Escape"&&b()},S=e.type==="dual-browser"?fr:Fn,E=e.type==="dual-browser"?"files":"shell",k=p4(e.title),T=h.jsxs("button",{"aria-label":e.title,"aria-current":t?"page":void 0,title:e.title,onClick:n,className:fe("no-drag group relative flex h-10 w-full items-center gap-2.5 rounded-lg transition-colors",s?"pl-2.5 pr-1":"justify-center",t?"bg-sidebar-accent font-bold text-sidebar-accent-foreground":"font-medium text-sidebar-foreground hover:bg-accent/50"),children:[h.jsxs("span",{className:"relative shrink-0",children:[h.jsx(S,{className:"h-[18px] w-[18px]"}),!s&&e.badge&&e.badge>1&&h.jsx("span",{className:"absolute -right-1.5 -top-1 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-primary px-0.5 text-[9px] font-bold leading-none text-primary-foreground",children:e.badge})]}),s?h.jsxs(h.Fragment,{children:[u?h.jsx("input",{ref:_,value:m,onChange:D=>d(D.target.value),onBlur:g,onKeyDown:x,onClick:D=>D.stopPropagation(),className:"flex-1 min-w-0 bg-transparent text-sm font-medium outline-none border-b border-primary"}):h.jsx("span",{className:"flex-1 truncate text-left text-sm",onDoubleClick:y,children:e.title}),e.badge&&e.badge>1&&h.jsx("span",{className:"flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full bg-primary/15 px-1 text-xs font-medium text-primary",children:e.badge}),h.jsx("span",{className:"text-xs font-medium text-muted-foreground group-hover:hidden",children:E}),h.jsx("span",{role:"button",tabIndex:0,"aria-label":`Close ${e.title}`,onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),D.stopPropagation(),a())},onClick:D=>{D.stopPropagation(),a()},className:"hidden h-6 w-6 shrink-0 items-center justify-center rounded hover:bg-accent group-hover:flex focus-visible:flex cursor-pointer",children:h.jsx(vr,{className:"h-3.5 w-3.5"})})]}):h.jsx("span",{className:"absolute bottom-0.5 text-[8px] font-bold leading-none",children:k})]});return s?T:h.jsxs(Vh,{children:[h.jsx(Wh,{asChild:!0,children:T}),h.jsx(Kh,{side:"right",children:e.title})]})}const Rx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Mx=IC,sv=(e,t)=>s=>{var n;if((t==null?void 0:t.variants)==null)return Mx(e,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:a,defaultVariants:l}=t,u=Object.keys(a).map(d=>{const _=s==null?void 0:s[d],g=l==null?void 0:l[d];if(_===null)return null;const b=Rx(_)||Rx(g);return a[d][b]}),f=s&&Object.entries(s).reduce((d,_)=>{let[g,b]=_;return b===void 0||(d[g]=b),d},{}),m=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,_)=>{let{class:g,className:b,...y}=_;return Object.entries(y).every(x=>{let[S,E]=x;return Array.isArray(E)?E.includes({...l,...f}[S]):{...l,...f}[S]===E})?[...d,g,b]:d},[]);return Mx(e,u,m,s==null?void 0:s.class,s==null?void 0:s.className)},y4=sv("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-[color-mix(in_oklab,var(--color-primary)_88%,var(--color-foreground))]",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function ge({className:e,variant:t="default",size:s="default",asChild:n=!1,...a}){const l=n?h1:"button";return h.jsx(l,{"data-slot":"button","data-variant":t,"data-size":s,className:fe(y4({variant:t,size:s,className:e})),...a})}function lt({className:e,type:t,...s}){return h.jsx("input",{type:t,"data-slot":"input",className:fe("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...s})}function b4({...e}){return h.jsx(Gj,{"data-slot":"alert-dialog",...e})}function x4({...e}){return h.jsx(Xj,{"data-slot":"alert-dialog-portal",...e})}function S4({className:e,...t}){return h.jsx(Zj,{"data-slot":"alert-dialog-overlay",className:fe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function w4({className:e,size:t="default",...s}){return h.jsxs(x4,{children:[h.jsx(S4,{}),h.jsx(Qj,{"data-slot":"alert-dialog-content","data-size":t,className:fe("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg",e),...s})]})}function C4({className:e,...t}){return h.jsx("div",{"data-slot":"alert-dialog-header",className:fe("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function E4({className:e,...t}){return h.jsx("div",{"data-slot":"alert-dialog-footer",className:fe("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function k4({className:e,...t}){return h.jsx(tD,{"data-slot":"alert-dialog-title",className:fe("text-lg font-semibold font-display sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function N4({className:e,...t}){return h.jsx(iD,{"data-slot":"alert-dialog-description",className:fe("text-muted-foreground text-sm",e),...t})}function Ax({className:e,variant:t="default",size:s="default",...n}){return h.jsx(ge,{variant:t,size:s,asChild:!0,children:h.jsx(Jj,{"data-slot":"alert-dialog-action",className:fe(e),...n})})}function j4({className:e,variant:t="outline",size:s="default",...n}){return h.jsx(ge,{variant:t,size:s,asChild:!0,children:h.jsx(eD,{"data-slot":"alert-dialog-cancel",className:fe(e),...n})})}function D4({server:e,editMode:t,viewMode:s,onEdit:n,onDelete:a}){const{t:l}=Zg(),{addTab:u,activateTab:f}=Ie(),[m,d]=w.useState(null),_=Ie(A=>A.tabs.some(V=>V.serverId===e.id&&V.type==="dual-browser")),g=Ie(A=>A.tabs.some(V=>V.serverId===e.id&&V.type==="ssh-terminal")),b=Ie(A=>{var V;return(V=A.tabs.find(I=>I.serverId===e.id&&I.type==="dual-browser"))==null?void 0:V.id}),y=Ie(A=>{var V;return(V=A.tabs.find(I=>I.serverId===e.id&&I.type==="ssh-terminal"))==null?void 0:V.id}),x=_||g,S=w.useCallback(A=>{const V=A==="dual-browser"?b:y;V?d({type:A,existingId:V}):u({id:Nx(),type:A,title:e.name,serverId:e.id})},[b,y,e.name,e.id,u]),E=w.useCallback(()=>S("dual-browser"),[S]),k=w.useCallback(()=>S("ssh-terminal"),[S]),T=(m==null?void 0:m.type)==="dual-browser"?l("actions.browse"):l("actions.connect"),D=w.useCallback(()=>{m&&f(m.existingId),d(null)},[m,f]),R=w.useCallback(()=>{if(m){const{tabs:A}=Ie.getState(),V={id:Nx(),type:m.type,title:e.name,serverId:e.id,closable:!0};Ie.setState({tabs:[...A,V],activeTabId:V.id})}d(null)},[m,e.name,e.id]),z=h.jsx(b4,{open:!!m,onOpenChange:A=>!A&&d(null),children:h.jsxs(w4,{children:[h.jsxs(C4,{children:[h.jsx(k4,{children:l("servers.dupDialog.title")}),h.jsx(N4,{children:l("servers.dupDialog.description",{name:e.name,type:T})})]}),h.jsxs(E4,{children:[h.jsx(j4,{children:l("actions.cancel")}),h.jsx(Ax,{onClick:D,children:l("servers.dupDialog.goExisting")}),h.jsx(Ax,{onClick:R,children:l("servers.dupDialog.openNew")})]})]})}),L=_&&g?"files and shell open":_?"files open":"shell open",j=`${e.username}@${e.host}`;return s==="list"?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:fe("group flex items-center gap-3 border-b border-border-subtle px-4 py-2.5 transition-colors last:border-b-0","hover:bg-card-hover",t&&"bg-destructive-light/40"),children:[h.jsx("span",{"aria-hidden":"true",className:fe("h-2 w-2 shrink-0 rounded-full",x?"bg-success":"bg-border")}),h.jsx("span",{className:"w-[160px] shrink-0 truncate text-sm font-bold text-foreground",children:e.name}),h.jsx("span",{className:"w-[220px] shrink-0 truncate font-mono text-xs text-muted-foreground",children:j}),h.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:e.defaultDirectory||""}),h.jsx(Ox,{server:e}),!t&&x&&h.jsx("span",{className:"shrink-0 text-xs font-bold text-success",children:L}),h.jsx("div",{className:"flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:t?h.jsxs(h.Fragment,{children:[h.jsx(zu,{icon:no,tooltip:l("actions.edit"),onClick:()=>n(e)}),h.jsx(zu,{icon:Vn,tooltip:l("actions.delete"),onClick:()=>a(e),variant:"destructive"})]}):h.jsxs(h.Fragment,{children:[h.jsx(zu,{icon:fr,tooltip:l("actions.browse"),onClick:E}),h.jsx(zu,{icon:oo,tooltip:l("actions.connect"),onClick:k})]})})]}),z]}):h.jsxs(h.Fragment,{children:[h.jsxs("article",{className:fe("flex min-w-0 flex-col gap-2.5 rounded-xl border border-border bg-card p-4 transition-shadow","hover:shadow-card-hover",t&&"border-destructive/30"),children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{"aria-hidden":"true",className:fe("h-2 w-2 shrink-0 rounded-full",x?"bg-success":"bg-border")}),h.jsx("h3",{className:"min-w-0 flex-1 truncate text-[15px] font-bold text-foreground",children:e.name}),!t&&x&&h.jsx("span",{className:"shrink-0 text-xs font-bold text-success",children:L})]}),h.jsxs("p",{className:"truncate font-mono text-[12.5px] text-muted-foreground",title:j,children:[j,e.defaultDirectory&&h.jsxs(h.Fragment,{children:[" · ",e.defaultDirectory]})]}),h.jsx(Ox,{server:e}),h.jsx("div",{className:"mt-0.5 flex flex-wrap items-center gap-2",children:t?h.jsxs(h.Fragment,{children:[h.jsxs(ge,{variant:"outline",size:"sm",onClick:()=>n(e),children:[h.jsx(no,{className:"h-3.5 w-3.5"}),l("actions.edit")]}),h.jsxs(ge,{variant:"outline",size:"sm",className:"text-destructive hover:bg-destructive-light hover:text-destructive",onClick:()=>a(e),children:[h.jsx(Vn,{className:"h-3.5 w-3.5"}),l("actions.delete")]})]}):h.jsxs(h.Fragment,{children:[h.jsxs(ge,{variant:"outline",size:"sm","aria-label":l("actions.browse"),onClick:E,children:[h.jsx(fr,{className:"h-3.5 w-3.5"}),"Files"]}),h.jsxs(ge,{variant:"outline",size:"sm","aria-label":"Open a shell",onClick:k,children:[h.jsx(oo,{className:"h-3.5 w-3.5"}),"Shell"]})]})})]}),z]})}function Ox({server:e}){const t=e.approval??"never",s="inline-flex h-6 items-center gap-1 rounded-md px-2 text-xs";return h.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.mode==="readonly"?h.jsx("span",{className:fe(s,"bg-info-light font-bold text-info"),children:"Read only"}):e.mode==="restricted"?h.jsx("span",{className:fe(s,"bg-warning-light font-bold text-warning"),children:"Restricted"}):h.jsx("span",{className:fe(s,"border border-border text-muted-foreground"),children:"Unrestricted"}),t==="never"?h.jsx("span",{className:fe(s,"border border-border text-muted-foreground"),children:"Approval off"}):h.jsxs("span",{className:fe(s,"bg-accent font-bold text-accent-foreground"),children:[h.jsx(Fh,{className:"h-3.5 w-3.5","aria-hidden":"true"}),t==="always"?"Approval: every request":"Approval: destructive"]})]})}function zu({icon:e,tooltip:t,onClick:s,variant:n}){return h.jsxs(Vh,{children:[h.jsx(Wh,{asChild:!0,children:h.jsx("button",{"aria-label":t,onClick:a=>{a.stopPropagation(),s()},className:fe("flex h-8 w-8 items-center justify-center rounded-md transition-colors",n==="destructive"?"text-destructive hover:bg-destructive/10":"text-muted-foreground hover:bg-secondary hover:text-foreground"),children:h.jsx(e,{className:"h-4 w-4"})})}),h.jsx(Kh,{children:t})]})}const T4=ci.memo(function({name:t,servers:s,editMode:n,viewMode:a,onEditServer:l,onDeleteServer:u}){const f=$l(_=>_.collapsedCategories),m=$l(_=>_.toggleCategoryCollapse),d=f.includes(t);return h.jsxs("section",{className:"mb-7",children:[h.jsxs("button",{onClick:()=>m(t),"aria-expanded":!d,className:"-ml-1.5 mb-3 flex items-center gap-2 rounded-md px-1.5 py-1 transition-colors hover:bg-secondary",children:[h.jsx(Xl,{className:fe("h-4 w-4 text-muted-foreground transition-transform",d&&"-rotate-90")}),h.jsx("span",{className:"text-xs font-bold uppercase tracking-[0.08em] text-muted-foreground",children:t}),h.jsx("span",{className:"text-xs font-medium text-muted-foreground tabular-nums",children:s.length})]}),!d&&h.jsx("div",{className:fe(a==="grid"?"grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-3":"flex flex-col overflow-hidden rounded-xl border border-border bg-card"),children:s.map(_=>h.jsx(D4,{server:_,editMode:n,viewMode:a,onEdit:l,onDelete:u},_.id))})]})});function R4({onEditServer:e,onDeleteServer:t,onAddServer:s,onImportServers:n}){const{t:a}=Zg(),l=zt(y=>y.getServersByCategory),u=zt(y=>y.getFilteredServers),f=zt(y=>y.servers),m=zt(y=>y.searchQuery),d=zt(y=>y.editMode),_=zt(y=>y.viewMode),g=u(),b=l();return f.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[h.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-accent",children:h.jsx(Zl,{className:"h-8 w-8 text-accent-foreground"})}),h.jsx("h3",{className:"text-lg font-semibold",children:a("servers.emptyTitle")}),h.jsx("p",{className:"mt-1 text-sm text-muted-foreground max-w-sm",children:a("servers.emptyDescription")}),h.jsxs("div",{className:"mt-6 flex gap-3",children:[s&&h.jsxs(ge,{onClick:s,children:[h.jsx(Bi,{className:"mr-1.5 h-4 w-4"}),a("servers.addFirst")]}),n&&h.jsxs(ge,{variant:"outline",onClick:n,children:[h.jsx(Ql,{className:"mr-1.5 h-4 w-4"}),a("servers.import")]})]})]}):g.length===0&&m?h.jsx("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:h.jsx("p",{className:"text-sm text-muted-foreground",children:a("servers.noResults")})}):h.jsx("div",{children:Array.from(b.entries()).map(([y,x])=>h.jsx(T4,{name:y,servers:x,editMode:d,viewMode:_,onEditServer:e,onDeleteServer:t},y))})}function Jl({...e}){return h.jsx(tw,{"data-slot":"dialog",...e})}function M4({...e}){return h.jsx(rw,{"data-slot":"dialog-portal",...e})}function A4({className:e,...t}){return h.jsx(nw,{"data-slot":"dialog-overlay",className:fe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function ec({className:e,children:t,showCloseButton:s=!0,...n}){return h.jsxs(M4,{"data-slot":"dialog-portal",children:[h.jsx(A4,{}),h.jsxs(aw,{"data-slot":"dialog-content",className:fe("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",e),...n,children:[t,s&&h.jsxs(jh,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[h.jsx(vr,{}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function rv({className:e,...t}){return h.jsx("div",{"data-slot":"dialog-header",className:fe("flex flex-col gap-2 text-center sm:text-left",e),...t})}function nv({className:e,showCloseButton:t=!1,children:s,...n}){return h.jsxs("div",{"data-slot":"dialog-footer",className:fe("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...n,children:[s,t&&h.jsx(jh,{asChild:!0,children:h.jsx(ge,{variant:"outline",children:"Close"})})]})}function tc({className:e,...t}){return h.jsx(lw,{"data-slot":"dialog-title",className:fe("text-lg leading-none font-semibold font-display",e),...t})}function ic({className:e,...t}){return h.jsx(cw,{"data-slot":"dialog-description",className:fe("text-muted-foreground text-sm",e),...t})}const O4={id:"",name:"",host:"",port:22,username:"",mode:"unrestricted",approval:"never"},Ju="w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:outline-2 focus-visible:outline-ring";function z4({server:e,prefill:t,onClose:s,onSaved:n}){var b;const[a,l]=w.useState(e??{...O4,...t}),[u,f]=w.useState(!1),[m,d]=w.useState(null),_=(y,x)=>l(S=>({...S,[y]:x})),g=async()=>{f(!0),d(null);try{await Ya.save(a),n()}catch(y){d(y.message)}finally{f(!1)}};return h.jsx(Jl,{open:!0,onOpenChange:y=>!y&&s(),children:h.jsxs(ec,{className:"max-h-[85dvh] overflow-y-auto sm:max-w-xl",children:[h.jsxs(rv,{children:[h.jsxs(tc,{className:"flex items-center gap-2",children:[h.jsx(Jg,{className:"h-5 w-5 text-primary"}),e?`Edit ${e.name}`:"Add a server"]}),h.jsx(ic,{children:"Credentials stay encrypted on this machine. Leave a password or passphrase blank to keep its saved value."})]}),h.jsxs("form",{className:"grid gap-4",onSubmit:y=>{y.preventDefault(),g()},children:[h.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[h.jsx(ei,{label:"Name",children:h.jsx(lt,{required:!0,value:a.name,disabled:!!e,placeholder:"production",onChange:y=>_("name",y.target.value.toLowerCase().replace(/[^a-z0-9_]/g,""))})}),h.jsx(ei,{label:"Group",children:h.jsx(lt,{value:a.category??"",placeholder:"optional",onChange:y=>_("category",y.target.value)})})]}),h.jsxs("div",{className:"grid grid-cols-[1fr_6rem] gap-3",children:[h.jsx(ei,{label:"Host",children:h.jsx(lt,{required:!0,value:a.host,placeholder:"example.com",onChange:y=>_("host",y.target.value)})}),h.jsx(ei,{label:"Port",children:h.jsx(lt,{required:!0,type:"number",min:1,max:65535,value:a.port||"",onChange:y=>_("port",Number(y.target.value))})})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[h.jsx(ei,{label:"User",children:h.jsx(lt,{required:!0,value:a.username,autoComplete:"off",onChange:y=>_("username",y.target.value)})}),h.jsx(ei,{label:"Password",children:h.jsx(lt,{type:"password",autoComplete:"new-password",placeholder:e?"unchanged":"optional",onChange:y=>_("password",y.target.value)})})]}),h.jsx(ei,{label:"Private key",children:h.jsx(lt,{value:a.privateKey??"",placeholder:"~/.ssh/id_ed25519",onChange:y=>_("privateKey",y.target.value)})}),h.jsx(ei,{label:"Key passphrase",children:h.jsx(lt,{type:"password",autoComplete:"new-password",placeholder:e?"unchanged":"if your key is encrypted",onChange:y=>_("passphrase",y.target.value)})}),h.jsx(ei,{label:"Default directory",children:h.jsx(lt,{value:a.defaultDirectory??"",placeholder:"/var/www",onChange:y=>_("defaultDirectory",y.target.value)})}),h.jsxs("fieldset",{className:"grid gap-3 rounded-lg border border-border bg-sidebar p-3",children:[h.jsxs("legend",{className:"flex items-center gap-1.5 px-1 text-sm font-medium",children:[h.jsx(Fh,{className:"h-4 w-4"})," Agent permissions"]}),h.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[h.jsx(ei,{label:"Mode",children:h.jsxs("select",{className:Ju,value:a.mode??"unrestricted",onChange:y=>_("mode",y.target.value),children:[h.jsx("option",{value:"unrestricted",children:"Unrestricted"}),h.jsx("option",{value:"readonly",children:"Read only"}),h.jsx("option",{value:"restricted",children:"Restricted"})]})}),h.jsx(ei,{label:"Approval",children:h.jsxs("select",{className:Ju,value:a.approval??"never",onChange:y=>_("approval",y.target.value),children:[h.jsx("option",{value:"never",children:"Off"}),h.jsx("option",{value:"destructive",children:"Destructive requests"}),h.jsx("option",{value:"always",children:"Every request"})]})})]}),h.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:a.approval&&a.approval!=="never"?"Requests needing approval wait for you. If the control plane is unavailable, they are refused.":"Agents can work without this interface. Turn on approval when you want to review their requests."}),a.mode==="restricted"&&h.jsxs(h.Fragment,{children:[h.jsx(zx,{label:"Allowed command patterns",value:a.allowPatterns,onChange:y=>_("allowPatterns",y)}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"One regular expression per line. With no allowed patterns, all commands are refused."})]}),(a.mode!=="unrestricted"||(((b=a.denyPatterns)==null?void 0:b.length)??0)>0)&&h.jsx(zx,{label:"Denied command patterns",value:a.denyPatterns,onChange:y=>_("denyPatterns",y)})]}),h.jsxs("details",{className:"rounded-lg border border-border",children:[h.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between p-3 text-sm font-medium",children:["Advanced connection settings ",h.jsx(Xl,{className:"h-4 w-4"})]}),h.jsxs("div",{className:"grid gap-3 border-t border-border p-3",children:[h.jsx(ei,{label:"Description",children:h.jsx(lt,{value:a.description??"",onChange:y=>_("description",y.target.value)})}),h.jsx(ei,{label:"Jump server",hint:"Name of another configured server to connect through.",children:h.jsx(lt,{value:a.proxyJump??"",placeholder:"bastion",onChange:y=>_("proxyJump",y.target.value)})}),h.jsx(ei,{label:"Proxy command",children:h.jsx(lt,{value:a.proxyCommand??"",placeholder:"ssh -W %h:%p bastion",onChange:y=>_("proxyCommand",y.target.value)})}),h.jsx(ei,{label:"Remote platform",children:h.jsxs("select",{className:Ju,value:a.platform??"linux",onChange:y=>_("platform",y.target.value),children:[h.jsx("option",{value:"linux",children:"Linux / Unix"}),h.jsx("option",{value:"windows",children:"Windows"}),h.jsx("option",{value:"darwin",children:"macOS"})]})}),h.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[h.jsx("input",{type:"checkbox",checked:a.forwardAgent??!1,onChange:y=>_("forwardAgent",y.target.checked)})," Forward the SSH agent"]}),h.jsx(ei,{label:"Audit log path",children:h.jsx(lt,{value:a.auditLog??"",placeholder:"/path/to/audit.jsonl",onChange:y=>_("auditLog",y.target.value)})})]})]}),m&&h.jsx("p",{role:"alert",className:"text-sm text-destructive",children:m}),h.jsxs(nv,{children:[h.jsx(ge,{type:"button",variant:"ghost",onClick:s,children:"Cancel"}),h.jsx(ge,{type:"submit",disabled:u||!a.name||!a.host||!a.username,children:u?"Saving…":"Save"})]})]})]})})}function ei({label:e,hint:t,children:s}){const n=w.useId();return h.jsxs("div",{className:"grid gap-1.5",children:[h.jsx("label",{htmlFor:n,className:"text-sm font-medium",children:e}),w.cloneElement(s,{id:n}),t&&h.jsx("p",{className:"text-xs text-muted-foreground",children:t})]})}function zx({label:e,value:t,onChange:s}){const[n,a]=w.useState((t??[]).join(`
448
+ `));return h.jsx(ei,{label:e,children:h.jsx("textarea",{className:`${Ju} min-h-20 font-mono text-xs`,value:n,onChange:l=>a(l.target.value),onBlur:()=>s(n.split(`
449
+ `).map(l=>l.trim()).filter(Boolean))})})}const Lx="ssh-manager.migration-dismissed";function L4({onImported:e}){const[t,s]=w.useState(null),[n,a]=w.useState(null),[l,u]=w.useState(!1),[f,m]=w.useState(null),[d,_]=w.useState(()=>vo(Lx)==="true");if(w.useEffect(()=>{Tp.state().then(y=>{s(y.pending),a(y.envPath)}).catch(()=>{})},[]),d||!t||t.length===0)return null;const g=t.filter(y=>y.secrets>0).length,b=()=>{_(!0),_o(Lx,"true")};return h.jsx("div",{className:"mb-4 rounded-lg border border-accent/30 bg-accent/5 p-4",children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(nA,{className:"mt-0.5 h-4 w-4 shrink-0 text-accent"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"text-sm font-medium",children:"Your existing setup keeps working"}),h.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[n&&h.jsxs(h.Fragment,{children:[h.jsx("code",{className:"font-mono",children:n})," — "]}),g>0?`${g} of them keep${g>1?"":"s"} credentials in clear text. `:"","Bring ",t.length," server",t.length>1?"s":""," into this workspace to edit them here. Importing is optional and leaves the original configuration unchanged."]}),h.jsx("ul",{className:"mt-2 flex flex-wrap gap-1.5",children:t.map(y=>h.jsxs("li",{className:"rounded-md border border-border bg-card px-2 py-0.5 text-xs",children:[y.name,h.jsxs("span",{className:"ml-1.5 text-muted-foreground",children:[y.user?`${y.user}@`:"",y.host]}),y.secrets>0&&h.jsxs("span",{className:"ml-1.5 text-accent",children:[y.secrets," secret",y.secrets>1?"s":""]})]},y.name))}),h.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[h.jsxs(ge,{size:"sm",disabled:l,onClick:async()=>{u(!0),m(null);try{await Tp.run(t.map(y=>y.name)),s([]),e()}catch(y){m(y.message)}finally{u(!1)}},children:[l?"Importing…":`Import ${t.length>1?"them":"it"}`,h.jsx(kC,{className:"h-3.5 w-3.5"})]}),h.jsx(ge,{variant:"ghost",size:"sm",onClick:b,children:"Not now"}),h.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Afterwards, create a recovery backup in Options → Vault. Your encryption key belongs to this machine; the backup lets you restore elsewhere."})]}),f&&h.jsx("p",{role:"alert",className:"mt-2 text-sm text-destructive",children:f})]}),h.jsx("button",{onClick:b,"aria-label":"Dismiss",className:"shrink-0 rounded p-1 text-muted-foreground transition-colors hover:bg-accent/10 hover:text-foreground",children:h.jsx(vr,{className:"h-3.5 w-3.5"})})]})})}function Qn({title:e,count:t,hint:s,children:n,actions:a,className:l}){const u=Ie(f=>f.tabs.length>0);return h.jsxs("header",{className:fe("page-header flex min-h-[72px] shrink-0 flex-wrap items-center gap-x-4 gap-y-2 border-b border-border py-3 pl-8",u&&"under-tabs",i2&&!u&&"drag-region",l),children:[h.jsxs("div",{className:"min-w-0",children:[h.jsxs("h1",{className:"flex items-baseline gap-2 text-xl font-bold tracking-[-0.01em]",children:[e,t!==void 0&&t>0&&h.jsx("span",{className:"text-sm font-medium text-muted-foreground tabular-nums",children:t})]}),s&&h.jsx("p",{className:"mt-0.5 truncate text-sm text-muted-foreground",children:s})]}),n,a&&h.jsx("div",{className:"ml-auto flex shrink-0 flex-wrap items-center gap-2",children:a})]})}const B4=sv("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-[color-mix(in_oklab,var(--color-primary)_88%,var(--color-foreground))]",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline",success:"bg-success-light text-success border-transparent",danger:"bg-destructive/10 text-destructive border-destructive/20",accent:"bg-accent/10 text-accent border-accent/20",warning:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20"}},defaultVariants:{variant:"default"}});function rs({className:e,variant:t="default",asChild:s=!1,...n}){const a=s?h1:"span";return h.jsx(a,{"data-slot":"badge","data-variant":t,className:fe(B4({variant:t}),e),...n})}function P4(e){return new Promise((t,s)=>{const n=new FileReader;n.onerror=()=>s(new Error(`Could not read ${e.name}`)),n.onload=()=>t(String(n.result).split(",")[1]??""),n.readAsDataURL(e)})}function H4({onClose:e,onImported:t}){const[s,n]=w.useState(null),[a,l]=w.useState(null),[u,f]=w.useState(!1),[m,d]=w.useState(null),[_,g]=w.useState(!1),b=w.useRef(null);w.useEffect(()=>{Lm.sources().then(k=>n(k.sources)).catch(()=>n([]))},[]);const y=async k=>{f(!0),d(null);try{l(await Lm.preview(k))}catch(T){d(T.message)}finally{f(!1)}},x=async k=>{k&&await y({filename:k.name,content:await P4(k)})},S=async()=>{if(a){f(!0);try{const k=_?[...a.fresh,...a.conflicts]:a.fresh,{written:T}=await Lm.apply(k);t(T)}catch(k){d(k.message),f(!1)}}},E=a?_?a.fresh.length+a.conflicts.length:a.fresh.length:0;return h.jsx(Jl,{open:!0,onOpenChange:k=>!k&&e(),children:h.jsxs(ec,{showCloseButton:!1,className:"flex max-h-[85dvh] flex-col gap-0 overflow-hidden p-0 sm:max-w-xl",children:[h.jsxs("div",{className:"flex items-start gap-3 border-b border-border px-5 py-4",children:[h.jsx("span",{className:"mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-primary/10",children:h.jsx(Xn,{className:"h-4.5 w-4.5 text-primary"})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx(tc,{className:"text-sm font-medium",children:"Import servers"}),h.jsx(ic,{className:"mt-0.5 text-xs text-muted-foreground",children:a?a.source:"From another tool, or from a file. No password is ever read."})]}),h.jsx(ge,{variant:"ghost",size:"icon","aria-label":"Close",onClick:e,children:h.jsx(vr,{className:"h-4 w-4"})})]}),m&&h.jsx("p",{className:"border-b border-destructive/30 bg-destructive-light px-5 py-2 text-xs",children:m}),h.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-4",children:[u&&!a&&h.jsxs("p",{className:"flex items-center justify-center gap-2 py-8 text-xs text-muted-foreground",children:[h.jsx(ss,{className:"h-4 w-4 animate-spin"})," Reading…"]}),!a&&!u&&h.jsxs("div",{className:"space-y-4",children:[s===null&&h.jsxs("p",{className:"flex items-center justify-center gap-2 py-6 text-xs text-muted-foreground",children:[h.jsx(ss,{className:"h-4 w-4 animate-spin"})," Looking around…"]}),s&&s.length>0&&h.jsxs("div",{children:[h.jsx("h3",{className:"mb-2 text-xs font-medium tracking-wider uppercase text-muted-foreground",children:"Already on this machine"}),h.jsx("div",{className:"overflow-hidden rounded-lg border border-border",children:s.map(k=>h.jsxs("button",{onClick:()=>void y({source:k.id}),className:"flex w-full items-center gap-3 border-b border-border-subtle px-3 py-2.5 text-left transition-colors last:border-b-0 hover:bg-card-hover",children:[h.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:k.label}),h.jsxs(rs,{variant:"secondary",className:"shrink-0",children:[k.count," server",k.count===1?"":"s"]})]},k.id))})]}),h.jsxs("div",{children:[h.jsx("h3",{className:"mb-2 text-xs font-medium tracking-wider uppercase text-muted-foreground",children:"From a file"}),h.jsx("input",{ref:b,type:"file",className:"hidden",accept:".xlsx,.csv,.xml,.reg,.json,.mxtsessions,.txt,config",onChange:k=>{var T;return void x((T=k.target.files)==null?void 0:T[0])}}),h.jsxs(ge,{variant:"outline",size:"sm",onClick:()=>{var k;return(k=b.current)==null?void 0:k.click()},children:[h.jsx(Ql,{className:"h-3.5 w-3.5"}),"Choose a file"]}),h.jsx("p",{className:"mt-2 text-xs leading-relaxed text-muted-foreground",children:"A spreadsheet, a CSV, an OpenSSH config, or an export from FileZilla, PuTTY, Termius or MobaXterm. The format is worked out for you."})]})]}),a&&h.jsxs("div",{className:"space-y-3",children:[a.fresh.length===0&&a.conflicts.length===0&&h.jsx("p",{className:"py-6 text-center text-xs text-muted-foreground",children:"Nothing to import from that."}),[...a.fresh,...a.conflicts].length>0&&h.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[a.fresh.map(k=>h.jsxs("div",{className:"flex items-center gap-3 border-b border-border-subtle px-3 py-2 last:border-b-0",children:[h.jsx("span",{className:"w-4 shrink-0 text-center text-xs text-success",children:"+"}),h.jsx("span",{className:"w-36 shrink-0 truncate text-sm",children:k.name}),h.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:[k.user?`${k.user}@`:"",k.host,k.port?`:${k.port}`:""]}),k.group&&h.jsx(rs,{variant:"outline",className:"shrink-0",children:k.group})]},`n-${k.name}`)),a.conflicts.map(k=>h.jsxs("div",{className:"flex items-center gap-3 border-b border-border-subtle px-3 py-2 opacity-60 last:border-b-0",children:[h.jsx("span",{className:"w-4 shrink-0 text-center text-xs",children:"="}),h.jsx("span",{className:"w-36 shrink-0 truncate text-sm",children:k.name}),h.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:_?"will be replaced":"already configured — left alone"})]},`c-${k.name}`))]}),a.conflicts.length>0&&h.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[h.jsx("input",{type:"checkbox",checked:_,onChange:k=>g(k.target.checked)}),"Replace the ",a.conflicts.length," that already exist"]}),a.warnings.length>0&&h.jsxs("div",{className:"rounded-lg border border-border bg-muted p-3",children:[h.jsx("h3",{className:"mb-1 text-xs font-medium",children:"Notes"}),h.jsxs("ul",{className:"space-y-0.5",children:[a.warnings.slice(0,8).map((k,T)=>h.jsx("li",{className:"text-[11px] leading-relaxed text-muted-foreground",children:k},T)),a.warnings.length>8&&h.jsxs("li",{className:"text-[11px] text-muted-foreground",children:["…and ",a.warnings.length-8," more"]})]})]})]})]}),a&&h.jsxs("div",{className:"flex items-center gap-2 border-t border-border px-5 py-3",children:[h.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>{l(null),g(!1)},children:"Back"}),h.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[h.jsx(oA,{className:"h-3.5 w-3.5 text-muted-foreground"}),h.jsxs(ge,{size:"sm",disabled:u||E===0,onClick:()=>void S(),children:[u&&h.jsx(ss,{className:"h-3.5 w-3.5 animate-spin"}),"Import ",E," server",E===1?"":"s"]})]})]})]})})}function r2(){const[e,t]=w.useState([]);w.useEffect(()=>{const n=()=>Tt.get().then(a=>t(a.pending)).catch(()=>{});return n(),Tt.subscribe(a=>{gC.includes(a.type)&&n()})},[]);const s=w.useCallback(n=>{t(a=>a.filter(l=>l.id!==n))},[]);return{pending:e,drop:s}}const Bx=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function I4(){const{servers:e,load:t,remove:s,error:n,searchQuery:a,setSearchQuery:l,viewMode:u,setViewMode:f,editMode:m,setEditMode:d,categoryFilter:_,setCategoryFilter:g}=zt(),[b,y]=w.useState(null),[x,S]=w.useState(!1),[E,k]=w.useState(!1),T=Ie(J=>J.wantsImport),D=Ie(J=>J.setWantsImport),R=Ie(J=>J.wantsAdd),z=Ie(J=>J.setWantsAdd),L=Ie(J=>J.serverDraft),j=Ie(J=>J.setServerDraft),A=Ie(J=>J.setView),{pending:V}=r2();w.useEffect(()=>{t()},[t]),w.useEffect(()=>{R&&(S(!0),z(!1))},[R,z]),w.useEffect(()=>{T&&(k(!0),D(!1))},[T,D]),w.useEffect(()=>{if(L)return S(!0),()=>j(null)},[L,j]);const I=w.useMemo(()=>{const J=new Map;for(const $ of e){const B=$.category||"Uncategorized";J.set(B,(J.get(B)??0)+1)}return[...J.entries()].sort(([$],[B])=>$.localeCompare(B))},[e]);return w.useEffect(()=>{_!==null&&!I.some(([J])=>J===_)&&g(null)},[I,_,g]),h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[h.jsx(Qn,{title:"Servers",hint:e.length>0?`${Bx(e.length,"server")} in ${Bx(I.length,"group")}. Your agents reach them through this engine.`:void 0,actions:h.jsxs(h.Fragment,{children:[h.jsx(ge,{variant:m?"secondary":"ghost",size:"icon","aria-label":"Toggle edit mode","aria-pressed":m,title:m?"Done editing":"Edit or remove servers",onClick:()=>d(!m),children:h.jsx(no,{className:"h-4 w-4"})}),h.jsxs(ge,{variant:"outline",onClick:()=>k(!0),children:[h.jsx(Xn,{className:"h-4 w-4"}),"Import"]}),h.jsxs(ge,{className:"font-bold",onClick:()=>S(!0),children:[h.jsx(Bi,{className:"h-4 w-4"}),"Add a server"]})]})}),n&&h.jsx("p",{className:"border-b border-destructive/30 bg-destructive-light px-8 py-2 text-sm",children:n}),h.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-8 pb-10 pt-5",children:[h.jsx(L4,{onImported:()=>void t()}),V.length>0&&h.jsx($4,{pending:V,onOpen:()=>A("waiting")}),e.length>0&&h.jsxs("div",{className:"mb-6 flex flex-col gap-3",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"relative min-w-0 max-w-md flex-1",children:[h.jsx(JA,{className:"pointer-events-none absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 text-muted-foreground","aria-hidden":"true"}),h.jsx(lt,{type:"search",value:a,onChange:J=>l(J.target.value),placeholder:"Search a name, host or user","aria-label":"Search servers",className:"h-10 bg-card pl-9 text-sm"})]}),h.jsxs("div",{role:"group","aria-label":"Layout",className:"ml-auto flex shrink-0 overflow-hidden rounded-lg border border-border bg-card",children:[h.jsx("button",{type:"button","aria-label":"Show as a grid","aria-pressed":u==="grid",title:"Cards",onClick:()=>f("grid"),className:fe("flex h-[38px] w-10 items-center justify-center transition-colors",u==="grid"?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:h.jsx(NA,{className:"h-4 w-4"})}),h.jsx("button",{type:"button","aria-label":"Show as a list","aria-pressed":u==="list",title:"List",onClick:()=>f("list"),className:fe("flex h-[38px] w-10 items-center justify-center border-l border-border transition-colors",u==="list"?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:h.jsx(DA,{className:"h-4 w-4"})})]})]}),I.length>1&&h.jsxs("div",{role:"group","aria-label":"Filter by group",className:"flex flex-wrap gap-1.5",children:[h.jsx(Px,{label:"All",count:e.length,active:_===null,onClick:()=>g(null),ariaLabel:"Show every group"}),I.map(([J,$])=>h.jsx(Px,{label:J,count:$,active:_===J,onClick:()=>g(_===J?null:J),ariaLabel:`Show only ${J}`},J))]})]}),h.jsx(R4,{onImportServers:()=>k(!0),onEditServer:y,onDeleteServer:J=>void s(J.name),onAddServer:()=>S(!0)})]}),E&&h.jsx(H4,{onClose:()=>k(!1),onImported:()=>{k(!1),t()}}),(x||b)&&h.jsx(z4,{server:b,prefill:b?void 0:L??void 0,onClose:()=>{S(!1),y(null),j(null)},onSaved:()=>{S(!1),y(null),j(null),t()}})]})}function $4({pending:e,onOpen:t}){const s=[...e].sort((n,a)=>a.waitingMs-n.waitingMs)[0];return h.jsxs("button",{type:"button",onClick:t,className:"mb-5 flex w-full flex-wrap items-center gap-x-3.5 gap-y-1 rounded-xl bg-accent px-4 py-3 text-left text-accent-foreground transition-colors hover:bg-accent/70",children:[h.jsx(mh,{className:"h-[18px] w-[18px] shrink-0","aria-hidden":"true"}),h.jsx("span",{className:"font-bold",children:e.length===1?"1 command is waiting for your decision":`${e.length} commands are waiting for your decision`}),h.jsxs("span",{className:"min-w-0 flex-[1_1_240px] truncate font-mono text-[12.5px]",children:[s.server," · ",s.command||s.tool]}),h.jsx("span",{className:"font-bold",children:"Review →"})]})}function Px({label:e,count:t,active:s,onClick:n,ariaLabel:a}){return h.jsxs("button",{type:"button","aria-pressed":s,"aria-label":a,onClick:n,className:fe("h-8 rounded-full border px-3 text-[13px] transition-colors",s?"border-foreground bg-foreground font-bold text-background":"border-border bg-card text-foreground hover:bg-secondary"),children:[e," ",h.jsx("span",{className:s?"":"text-muted-foreground",children:t})]})}/**
450
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
451
+ * @license MIT
452
+ *
453
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
454
+ * @license MIT
455
+ *
456
+ * Originally forked from (with the author's permission):
457
+ * Fabrice Bellard's javascript vt100 for jslinux:
458
+ * http://bellard.org/jslinux/
459
+ * Copyright (c) 2011 Fabrice Bellard
460
+ */var n2=Object.defineProperty,U4=Object.getOwnPropertyDescriptor,F4=(e,t)=>{for(var s in t)n2(e,s,{get:t[s],enumerable:!0})},yt=(e,t,s,n)=>{for(var a=n>1?void 0:n?U4(t,s):t,l=e.length-1,u;l>=0;l--)(u=e[l])&&(a=(n?u(t,s,a):u(a))||a);return n&&a&&n2(t,s,a),a},de=(e,t)=>(s,n)=>t(s,n,e),Hx="Terminal input",Pp={get:()=>Hx,set:e=>Hx=e},Ix="Too much output to announce, navigate to rows manually to read",Hp={get:()=>Ix,set:e=>Ix=e};function V4(e){return e.replace(/\r?\n/g,"\r")}function W4(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function K4(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function q4(e,t,s,n){if(e.stopPropagation(),e.clipboardData){let a=e.clipboardData.getData("text/plain");a2(a,t,s,n)}}function a2(e,t,s,n){e=V4(e),e=W4(e,s.decPrivateModes.bracketedPasteMode&&n.rawOptions.ignoreBracketedPasteMode!==!0),s.triggerDataEvent(e,!0),t.value=""}function o2(e,t,s){let n=s.getBoundingClientRect(),a=e.clientX-n.left-10,l=e.clientY-n.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${a}px`,t.style.top=`${l}px`,t.style.zIndex="1000",t.focus()}function $x(e,t,s,n,a){o2(e,t,s),a&&n.rightClickSelect(e),t.value=n.selectionText,t.select()}function Qr(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function qh(e,t=0,s=e.length){let n="";for(let a=t;a<s;++a){let l=e[a];l>65535?(l-=65536,n+=String.fromCharCode((l>>10)+55296)+String.fromCharCode(l%1024+56320)):n+=String.fromCharCode(l)}return n}var Y4=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let s=e.length;if(!s)return 0;let n=0,a=0;if(this._interim){let l=e.charCodeAt(a++);56320<=l&&l<=57343?t[n++]=(this._interim-55296)*1024+l-56320+65536:(t[n++]=this._interim,t[n++]=l),this._interim=0}for(let l=a;l<s;++l){let u=e.charCodeAt(l);if(55296<=u&&u<=56319){if(++l>=s)return this._interim=u,n;let f=e.charCodeAt(l);56320<=f&&f<=57343?t[n++]=(u-55296)*1024+f-56320+65536:(t[n++]=u,t[n++]=f);continue}u!==65279&&(t[n++]=u)}return n}},G4=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let s=e.length;if(!s)return 0;let n=0,a,l,u,f,m=0,d=0;if(this.interim[0]){let b=!1,y=this.interim[0];y&=(y&224)===192?31:(y&240)===224?15:7;let x=0,S;for(;(S=this.interim[++x]&63)&&x<4;)y<<=6,y|=S;let E=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,k=E-x;for(;d<k;){if(d>=s)return 0;if(S=e[d++],(S&192)!==128){d--,b=!0;break}else this.interim[x++]=S,y<<=6,y|=S&63}b||(E===2?y<128?d--:t[n++]=y:E===3?y<2048||y>=55296&&y<=57343||y===65279||(t[n++]=y):y<65536||y>1114111||(t[n++]=y)),this.interim.fill(0)}let _=s-4,g=d;for(;g<s;){for(;g<_&&!((a=e[g])&128)&&!((l=e[g+1])&128)&&!((u=e[g+2])&128)&&!((f=e[g+3])&128);)t[n++]=a,t[n++]=l,t[n++]=u,t[n++]=f,g+=4;if(a=e[g++],a<128)t[n++]=a;else if((a&224)===192){if(g>=s)return this.interim[0]=a,n;if(l=e[g++],(l&192)!==128){g--;continue}if(m=(a&31)<<6|l&63,m<128){g--;continue}t[n++]=m}else if((a&240)===224){if(g>=s)return this.interim[0]=a,n;if(l=e[g++],(l&192)!==128){g--;continue}if(g>=s)return this.interim[0]=a,this.interim[1]=l,n;if(u=e[g++],(u&192)!==128){g--;continue}if(m=(a&15)<<12|(l&63)<<6|u&63,m<2048||m>=55296&&m<=57343||m===65279)continue;t[n++]=m}else if((a&248)===240){if(g>=s)return this.interim[0]=a,n;if(l=e[g++],(l&192)!==128){g--;continue}if(g>=s)return this.interim[0]=a,this.interim[1]=l,n;if(u=e[g++],(u&192)!==128){g--;continue}if(g>=s)return this.interim[0]=a,this.interim[1]=l,this.interim[2]=u,n;if(f=e[g++],(f&192)!==128){g--;continue}if(m=(a&7)<<18|(l&63)<<12|(u&63)<<6|f&63,m<65536||m>1114111)continue;t[n++]=m}}return n}},l2="",Jr=" ",sc=class c2{constructor(){this.fg=0,this.bg=0,this.extended=new vh}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new c2;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}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}},vh=class u2{constructor(t=0,s=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=s}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new u2(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},ns=class h2 extends sc{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new vh,this.combinedData=""}static fromCharData(t){let s=new h2;return s.setFromCharData(t),s}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Qr(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let s=!1;if(t[1].length>2)s=!0;else if(t[1].length===2){let n=t[1].charCodeAt(0);if(55296<=n&&n<=56319){let a=t[1].charCodeAt(1);56320<=a&&a<=57343?this.content=(n-55296)*1024+a-56320+65536|t[2]<<22:s=!0}else s=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;s&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Ux="di$target",Ip="di$dependencies",Hm=new Map;function X4(e){return e[Ip]||[]}function qt(e){if(Hm.has(e))return Hm.get(e);let t=function(s,n,a){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Z4(t,s,a)};return t._id=e,Hm.set(e,t),t}function Z4(e,t,s){t[Ux]===t?t[Ip].push({id:e,index:s}):(t[Ip]=[{id:e,index:s}],t[Ux]=t)}var di=qt("BufferService"),d2=qt("CoreMouseService"),Jn=qt("CoreService"),Q4=qt("CharsetService"),av=qt("InstantiationService"),f2=qt("LogService"),fi=qt("OptionsService"),m2=qt("OscLinkService"),J4=qt("UnicodeService"),rc=qt("DecorationService"),$p=class{constructor(e,t,s){this._bufferService=e,this._optionsService=t,this._oscLinkService=s}provideLinks(e,t){var _;let s=this._bufferService.buffer.lines.get(e-1);if(!s){t(void 0);return}let n=[],a=this._optionsService.rawOptions.linkHandler,l=new ns,u=s.getTrimmedLength(),f=-1,m=-1,d=!1;for(let g=0;g<u;g++)if(!(m===-1&&!s.hasContent(g))){if(s.loadCell(g,l),l.hasExtendedAttrs()&&l.extended.urlId)if(m===-1){m=g,f=l.extended.urlId;continue}else d=l.extended.urlId!==f;else m!==-1&&(d=!0);if(d||m!==-1&&g===u-1){let b=(_=this._oscLinkService.getLinkData(f))==null?void 0:_.uri;if(b){let y={start:{x:m+1,y:e},end:{x:g+(!d&&g===u-1?1:0),y:e}},x=!1;if(!(a!=null&&a.allowNonHttpProtocols))try{let S=new URL(b);["http:","https:"].includes(S.protocol)||(x=!0)}catch{x=!0}x||n.push({text:b,range:y,activate:(S,E)=>a?a.activate(S,E,y):ez(S,E),hover:(S,E)=>{var k;return(k=a==null?void 0:a.hover)==null?void 0:k.call(a,S,E,y)},leave:(S,E)=>{var k;return(k=a==null?void 0:a.leave)==null?void 0:k.call(a,S,E,y)}})}d=!1,l.hasExtendedAttrs()&&l.extended.urlId?(m=g,f=l.extended.urlId):(m=-1,f=-1)}}t(n)}};$p=yt([de(0,di),de(1,fi),de(2,m2)],$p);function ez(e,t){if(confirm(`Do you want to navigate to ${t}?
461
+
462
+ WARNING: This link could potentially be dangerous`)){let s=window.open();if(s){try{s.opener=null}catch{}s.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Yh=qt("CharSizeService"),_r=qt("CoreBrowserService"),ov=qt("MouseService"),yr=qt("RenderService"),tz=qt("SelectionService"),p2=qt("CharacterJoinerService"),yo=qt("ThemeService"),g2=qt("LinkProviderService"),iz=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Fx.isErrorNoTelemetry(e)?new Fx(e.message+`
463
+
464
+ `+e.stack):new Error(e.message+`
465
+
466
+ `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(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)}},sz=new iz;function eh(e){rz(e)||sz.onUnexpectedError(e)}var Up="Canceled";function rz(e){return e instanceof nz?!0:e instanceof Error&&e.name===Up&&e.message===Up}var nz=class extends Error{constructor(){super(Up),this.name=this.message}};function az(e){return new Error(`Illegal argument: ${e}`)}var Fx=class Fp extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Fp)return t;let s=new Fp;return s.message=t.message,s.stack=t.stack,s}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Vp=class v2 extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,v2.prototype)}};function Ai(e,t=0){return e[e.length-(1+t)]}var oz;(e=>{function t(l){return l<0}e.isLessThan=t;function s(l){return l<=0}e.isLessThanOrEqual=s;function n(l){return l>0}e.isGreaterThan=n;function a(l){return l===0}e.isNeitherLessOrGreaterThan=a,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(oz||(oz={}));function lz(e,t){let s=this,n=!1,a;return function(){return n||(n=!0,t||(a=e.apply(s,arguments))),a}}var _2;(e=>{function t(R){return R&&typeof R=="object"&&typeof R[Symbol.iterator]=="function"}e.is=t;let s=Object.freeze([]);function n(){return s}e.empty=n;function*a(R){yield R}e.single=a;function l(R){return t(R)?R:a(R)}e.wrap=l;function u(R){return R||s}e.from=u;function*f(R){for(let z=R.length-1;z>=0;z--)yield R[z]}e.reverse=f;function m(R){return!R||R[Symbol.iterator]().next().done===!0}e.isEmpty=m;function d(R){return R[Symbol.iterator]().next().value}e.first=d;function _(R,z){let L=0;for(let j of R)if(z(j,L++))return!0;return!1}e.some=_;function g(R,z){for(let L of R)if(z(L))return L}e.find=g;function*b(R,z){for(let L of R)z(L)&&(yield L)}e.filter=b;function*y(R,z){let L=0;for(let j of R)yield z(j,L++)}e.map=y;function*x(R,z){let L=0;for(let j of R)yield*z(j,L++)}e.flatMap=x;function*S(...R){for(let z of R)yield*z}e.concat=S;function E(R,z,L){let j=L;for(let A of R)j=z(j,A);return j}e.reduce=E;function*k(R,z,L=R.length){for(z<0&&(z+=R.length),L<0?L+=R.length:L>R.length&&(L=R.length);z<L;z++)yield R[z]}e.slice=k;function T(R,z=Number.POSITIVE_INFINITY){let L=[];if(z===0)return[L,R];let j=R[Symbol.iterator]();for(let A=0;A<z;A++){let V=j.next();if(V.done)return[L,e.empty()];L.push(V.value)}return[L,{[Symbol.iterator](){return j}}]}e.consume=T;async function D(R){let z=[];for await(let L of R)z.push(L);return Promise.resolve(z)}e.asyncToArray=D})(_2||(_2={}));function Wn(e){if(_2.is(e)){let t=[];for(let s of e)if(s)try{s.dispose()}catch(n){t.push(n)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function cz(...e){return ut(()=>Wn(e))}function ut(e){return{dispose:lz(()=>{e()})}}var y2=class b2{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{Wn(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?b2.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(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};y2.DISABLE_DISPOSED_WARNING=!1;var tn=y2,Be=class{constructor(){this._store=new tn,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};Be.None=Object.freeze({dispose(){}});var lo=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){var s;this._isDisposed||t===this._value||((s=this._value)==null||s.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){var t;this._isDisposed=!0,(t=this._value)==null||t.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t}},rr=typeof window=="object"?window:globalThis,Wp=class Kp{constructor(t){this.element=t,this.next=Kp.Undefined,this.prev=Kp.Undefined}};Wp.Undefined=new Wp(void 0);var dt=Wp,Vx=class{constructor(){this._first=dt.Undefined,this._last=dt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===dt.Undefined}clear(){let e=this._first;for(;e!==dt.Undefined;){let t=e.next;e.prev=dt.Undefined,e.next=dt.Undefined,e=t}this._first=dt.Undefined,this._last=dt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let s=new dt(e);if(this._first===dt.Undefined)this._first=s,this._last=s;else if(t){let a=this._last;this._last=s,s.prev=a,a.next=s}else{let a=this._first;this._first=s,s.next=a,a.prev=s}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(s))}}shift(){if(this._first!==dt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==dt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==dt.Undefined&&e.next!==dt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===dt.Undefined&&e.next===dt.Undefined?(this._first=dt.Undefined,this._last=dt.Undefined):e.next===dt.Undefined?(this._last=this._last.prev,this._last.next=dt.Undefined):e.prev===dt.Undefined&&(this._first=this._first.next,this._first.prev=dt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==dt.Undefined;)yield e.element,e=e.next}},uz=globalThis.performance&&typeof globalThis.performance.now=="function",hz=class x2{static create(t){return new x2(t)}constructor(t){this._now=uz&&t===!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}},ii;(e=>{e.None=()=>Be.None;function t($,B){return g($,()=>{},0,void 0,!0,void 0,B)}e.defer=t;function s($){return(B,K=null,q)=>{let M=!1,H;return H=$(U=>{if(!M)return H?H.dispose():M=!0,B.call(K,U)},null,q),M&&H.dispose(),H}}e.once=s;function n($,B,K){return d((q,M=null,H)=>$(U=>q.call(M,B(U)),null,H),K)}e.map=n;function a($,B,K){return d((q,M=null,H)=>$(U=>{B(U),q.call(M,U)},null,H),K)}e.forEach=a;function l($,B,K){return d((q,M=null,H)=>$(U=>B(U)&&q.call(M,U),null,H),K)}e.filter=l;function u($){return $}e.signal=u;function f(...$){return(B,K=null,q)=>{let M=cz(...$.map(H=>H(U=>B.call(K,U))));return _(M,q)}}e.any=f;function m($,B,K,q){let M=K;return n($,H=>(M=B(M,H),M),q)}e.reduce=m;function d($,B){let K,q={onWillAddFirstListener(){K=$(M.fire,M)},onDidRemoveLastListener(){K==null||K.dispose()}},M=new ue(q);return B==null||B.add(M),M.event}function _($,B){return B instanceof Array?B.push($):B&&B.add($),$}function g($,B,K=100,q=!1,M=!1,H,U){let ae,Y,O,Z=0,te,oe={leakWarningThreshold:H,onWillAddFirstListener(){ae=$(he=>{Z++,Y=B(Y,he),q&&!O&&(ce.fire(Y),Y=void 0),te=()=>{let Se=Y;Y=void 0,O=void 0,(!q||Z>1)&&ce.fire(Se),Z=0},typeof K=="number"?(clearTimeout(O),O=setTimeout(te,K)):O===void 0&&(O=0,queueMicrotask(te))})},onWillRemoveListener(){M&&Z>0&&(te==null||te())},onDidRemoveLastListener(){te=void 0,ae.dispose()}},ce=new ue(oe);return U==null||U.add(ce),ce.event}e.debounce=g;function b($,B=0,K){return e.debounce($,(q,M)=>q?(q.push(M),q):[M],B,void 0,!0,void 0,K)}e.accumulate=b;function y($,B=(q,M)=>q===M,K){let q=!0,M;return l($,H=>{let U=q||!B(H,M);return q=!1,M=H,U},K)}e.latch=y;function x($,B,K){return[e.filter($,B,K),e.filter($,q=>!B(q),K)]}e.split=x;function S($,B=!1,K=[],q){let M=K.slice(),H=$(Y=>{M?M.push(Y):ae.fire(Y)});q&&q.add(H);let U=()=>{M==null||M.forEach(Y=>ae.fire(Y)),M=null},ae=new ue({onWillAddFirstListener(){H||(H=$(Y=>ae.fire(Y)),q&&q.add(H))},onDidAddFirstListener(){M&&(B?setTimeout(U):U())},onDidRemoveLastListener(){H&&H.dispose(),H=null}});return q&&q.add(ae),ae.event}e.buffer=S;function E($,B){return(K,q,M)=>{let H=B(new T);return $(function(U){let ae=H.evaluate(U);ae!==k&&K.call(q,ae)},void 0,M)}}e.chain=E;let k=Symbol("HaltChainable");class T{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:k),this}reduce(B,K){let q=K;return this.steps.push(M=>(q=B(q,M),q)),this}latch(B=(K,q)=>K===q){let K=!0,q;return this.steps.push(M=>{let H=K||!B(M,q);return K=!1,q=M,H?M:k}),this}evaluate(B){for(let K of this.steps)if(B=K(B),B===k)break;return B}}function D($,B,K=q=>q){let q=(...ae)=>U.fire(K(...ae)),M=()=>$.on(B,q),H=()=>$.removeListener(B,q),U=new ue({onWillAddFirstListener:M,onDidRemoveLastListener:H});return U.event}e.fromNodeEventEmitter=D;function R($,B,K=q=>q){let q=(...ae)=>U.fire(K(...ae)),M=()=>$.addEventListener(B,q),H=()=>$.removeEventListener(B,q),U=new ue({onWillAddFirstListener:M,onDidRemoveLastListener:H});return U.event}e.fromDOMEventEmitter=R;function z($){return new Promise(B=>s($)(B))}e.toPromise=z;function L($){let B=new ue;return $.then(K=>{B.fire(K)},()=>{B.fire(void 0)}).finally(()=>{B.dispose()}),B.event}e.fromPromise=L;function j($,B){return $(K=>B.fire(K))}e.forward=j;function A($,B,K){return B(K),$(q=>B(q))}e.runAndSubscribe=A;class V{constructor(B,K){this._observable=B,this._counter=0,this._hasChanged=!1;let q={onWillAddFirstListener:()=>{B.addObserver(this)},onDidRemoveLastListener:()=>{B.removeObserver(this)}};this.emitter=new ue(q),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 I($,B){return new V($,B).emitter.event}e.fromObservable=I;function J($){return(B,K,q)=>{let M=0,H=!1,U={beginUpdate(){M++},endUpdate(){M--,M===0&&($.reportChanges(),H&&(H=!1,B.call(K)))},handlePossibleChange(){},handleChange(){H=!0}};$.addObserver(U),$.reportChanges();let ae={dispose(){$.removeObserver(U)}};return q instanceof tn?q.add(ae):Array.isArray(q)&&q.push(ae),ae}}e.fromObservableLight=J})(ii||(ii={}));var qp=class Yp{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Yp._idPool++}`,Yp.all.add(this)}start(t){this._stopWatch=new hz,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};qp.all=new Set,qp._idPool=0;var dz=qp,fz=-1,S2=class w2{constructor(t,s,n=(w2._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=s,this.name=n,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,s){let n=this.threshold;if(n<=0||s<n)return;this._stacks||(this._stacks=new Map);let a=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,a+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[l,u]=this.getMostFrequentStack(),f=`[${this.name}] potential listener LEAK detected, having ${s} listeners already. MOST frequent listener (${u}):`;console.warn(f),console.warn(l);let m=new gz(f,l);this._errorHandler(m)}return()=>{let l=this._stacks.get(t.value)||0;this._stacks.set(t.value,l-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,s=0;for(let[n,a]of this._stacks)(!t||s<a)&&(t=[n,a],s=a);return t}};S2._idPool=1;var mz=S2,pz=class C2{constructor(t){this.value=t}static create(){let t=new Error;return new C2(t.stack??"")}print(){console.warn(this.value.split(`
467
+ `).slice(2).join(`
468
+ `))}},gz=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},vz=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},_z=0,Im=class{constructor(e){this.value=e,this.id=_z++}},yz=2,bz,ue=class{constructor(t){var s,n,a,l;this._size=0,this._options=t,this._leakageMon=(s=this._options)!=null&&s.leakWarningThreshold?new mz((t==null?void 0:t.onListenerError)??eh,((n=this._options)==null?void 0:n.leakWarningThreshold)??fz):void 0,this._perfMon=(a=this._options)!=null&&a._profName?new dz(this._options._profName):void 0,this._deliveryQueue=(l=this._options)==null?void 0:l.deliveryQueue}dispose(){var t,s,n,a;this._disposed||(this._disposed=!0,((t=this._deliveryQueue)==null?void 0:t.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(s=this._options)==null?void 0:s.onDidRemoveLastListener)==null||n.call(s),(a=this._leakageMon)==null||a.dispose())}get event(){return this._event??(this._event=(t,s,n)=>{var f,m,d,_,g;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let b=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(b);let y=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],x=new vz(`${b}. HINT: Stack shows most frequent listener (${y[1]}-times)`,y[0]);return(((f=this._options)==null?void 0:f.onListenerError)||eh)(x),Be.None}if(this._disposed)return Be.None;s&&(t=t.bind(s));let a=new Im(t),l;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(a.stack=pz.create(),l=this._leakageMon.check(a.stack,this._size+1)),this._listeners?this._listeners instanceof Im?(this._deliveryQueue??(this._deliveryQueue=new xz),this._listeners=[this._listeners,a]):this._listeners.push(a):((d=(m=this._options)==null?void 0:m.onWillAddFirstListener)==null||d.call(m,this),this._listeners=a,(g=(_=this._options)==null?void 0:_.onDidAddFirstListener)==null||g.call(_,this)),this._size++;let u=ut(()=>{l==null||l(),this._removeListener(a)});return n instanceof tn?n.add(u):Array.isArray(n)&&n.push(u),u}),this._event}_removeListener(t){var l,u,f,m;if((u=(l=this._options)==null?void 0:l.onWillRemoveListener)==null||u.call(l,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(m=(f=this._options)==null?void 0:f.onDidRemoveLastListener)==null||m.call(f,this),this._size=0;return}let s=this._listeners,n=s.indexOf(t);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,s[n]=void 0;let a=this._deliveryQueue.current===this;if(this._size*yz<=s.length){let d=0;for(let _=0;_<s.length;_++)s[_]?s[d++]=s[_]:a&&(this._deliveryQueue.end--,d<this._deliveryQueue.i&&this._deliveryQueue.i--);s.length=d}}_deliver(t,s){var a;if(!t)return;let n=((a=this._options)==null?void 0:a.onListenerError)||eh;if(!n){t.value(s);return}try{t.value(s)}catch(l){n(l)}}_deliverQueue(t){let s=t.current._listeners;for(;t.i<t.end;)this._deliver(s[t.i++],t.value);t.reset()}fire(t){var s,n,a,l;if((s=this._deliveryQueue)!=null&&s.current&&(this._deliverQueue(this._deliveryQueue),(n=this._perfMon)==null||n.stop()),(a=this._perfMon)==null||a.start(this._size),this._listeners)if(this._listeners instanceof Im)this._deliver(this._listeners,t);else{let u=this._deliveryQueue;u.enqueue(this,t,this._listeners.length),this._deliverQueue(u)}(l=this._perfMon)==null||l.stop()}hasListeners(){return this._size>0}},xz=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,s){this.i=0,this.end=s,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Gp=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new ue,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new ue,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,s){if(this.getZoomLevel(s)===t)return;let n=this.getWindowId(s);this.mapWindowIdToZoomLevel.set(n,t),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,s){this.mapWindowIdToZoomFactor.set(this.getWindowId(s),t)}setFullscreen(t,s){if(this.isFullscreen(s)===t)return;let n=this.getWindowId(s);this.mapWindowIdToFullScreen.set(n,t),this._onDidChangeFullscreen.fire(n)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Gp.INSTANCE=new Gp;var lv=Gp;function Sz(e,t,s){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",s)}lv.INSTANCE.onDidChangeZoomLevel;function wz(e){return lv.INSTANCE.getZoomFactor(e)}lv.INSTANCE.onDidChangeFullscreen;var bo=typeof navigator=="object"?navigator.userAgent:"",Xp=bo.indexOf("Firefox")>=0,Cz=bo.indexOf("AppleWebKit")>=0,cv=bo.indexOf("Chrome")>=0,Ez=!cv&&bo.indexOf("Safari")>=0;bo.indexOf("Electron/")>=0;bo.indexOf("Android")>=0;var $m=!1;if(typeof rr.matchMedia=="function"){let e=rr.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=rr.matchMedia("(display-mode: fullscreen)");$m=e.matches,Sz(rr,e,({matches:s})=>{$m&&t.matches||($m=s)})}var Xa="en",Zp=!1,Qp=!1,th=!1,E2=!1,Lu,ih=Xa,Wx=Xa,kz,cs,Hn=globalThis,ti,a1;typeof Hn.vscode<"u"&&typeof Hn.vscode.process<"u"?ti=Hn.vscode.process:typeof process<"u"&&typeof((a1=process==null?void 0:process.versions)==null?void 0:a1.node)=="string"&&(ti=process);var o1,Nz=typeof((o1=ti==null?void 0:ti.versions)==null?void 0:o1.electron)=="string",jz=Nz&&(ti==null?void 0:ti.type)==="renderer",l1;if(typeof ti=="object"){Zp=ti.platform==="win32",Qp=ti.platform==="darwin",th=ti.platform==="linux",th&&ti.env.SNAP&&ti.env.SNAP_REVISION,ti.env.CI||ti.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Lu=Xa,ih=Xa;let e=ti.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Lu=t.userLocale,Wx=t.osLocale,ih=t.resolvedLanguage||Xa,kz=(l1=t.languagePack)==null?void 0:l1.translationsConfigFile}catch{}E2=!0}else typeof navigator=="object"&&!jz?(cs=navigator.userAgent,Zp=cs.indexOf("Windows")>=0,Qp=cs.indexOf("Macintosh")>=0,(cs.indexOf("Macintosh")>=0||cs.indexOf("iPad")>=0||cs.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,th=cs.indexOf("Linux")>=0,(cs==null?void 0:cs.indexOf("Mobi"))>=0,ih=globalThis._VSCODE_NLS_LANGUAGE||Xa,Lu=navigator.language.toLowerCase(),Wx=Lu):console.error("Unable to resolve platform.");var k2=Zp,Ts=Qp,Dz=th,Kx=E2,As=cs,Yr=ih,Tz;(e=>{function t(){return Yr}e.value=t;function s(){return Yr.length===2?Yr==="en":Yr.length>=3?Yr[0]==="e"&&Yr[1]==="n"&&Yr[2]==="-":!1}e.isDefaultVariant=s;function n(){return Yr==="en"}e.isDefault=n})(Tz||(Tz={}));var Rz=typeof Hn.postMessage=="function"&&!Hn.importScripts;(()=>{if(Rz){let e=[];Hn.addEventListener("message",s=>{if(s.data&&s.data.vscodeScheduleAsyncWork)for(let n=0,a=e.length;n<a;n++){let l=e[n];if(l.id===s.data.vscodeScheduleAsyncWork){e.splice(n,1),l.callback();return}}});let t=0;return s=>{let n=++t;e.push({id:n,callback:s}),Hn.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})();var Mz=!!(As&&As.indexOf("Chrome")>=0);As&&As.indexOf("Firefox")>=0;!Mz&&As&&As.indexOf("Safari")>=0;As&&As.indexOf("Edg/")>=0;As&&As.indexOf("Android")>=0;var Va=typeof navigator=="object"?navigator:{};Kx||document.queryCommandSupported&&document.queryCommandSupported("copy")||Va&&Va.clipboard&&Va.clipboard.writeText,Kx||Va&&Va.clipboard&&Va.clipboard.readText;var uv=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Um=new uv,qx=new uv,Yx=new uv,Az=new Array(230),N2;(e=>{function t(f){return Um.keyCodeToStr(f)}e.toString=t;function s(f){return Um.strToKeyCode(f)}e.fromString=s;function n(f){return qx.keyCodeToStr(f)}e.toUserSettingsUS=n;function a(f){return Yx.keyCodeToStr(f)}e.toUserSettingsGeneral=a;function l(f){return qx.strToKeyCode(f)||Yx.strToKeyCode(f)}e.fromUserSettings=l;function u(f){if(f>=98&&f<=113)return null;switch(f){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Um.keyCodeToStr(f)}e.toElectronAccelerator=u})(N2||(N2={}));var Oz=class j2{constructor(t,s,n,a,l){this.ctrlKey=t,this.shiftKey=s,this.altKey=n,this.metaKey=a,this.keyCode=l}equals(t){return t instanceof j2&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",s=this.shiftKey?"1":"0",n=this.altKey?"1":"0",a=this.metaKey?"1":"0";return`K${t}${s}${n}${a}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new zz([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},zz=class{constructor(e){if(e.length===0)throw az("chords");this.chords=e}getHashCode(){let e="";for(let t=0,s=this.chords.length;t<s;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function Lz(e){if(e.charCode){let s=String.fromCharCode(e.charCode).toUpperCase();return N2.fromString(s)}let t=e.keyCode;if(t===3)return 7;if(Xp)switch(t){case 59:return 85;case 60:if(Dz)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Ts)return 57;break}else if(Cz&&(Ts&&t===93||!Ts&&t===92))return 57;return Az[t]||0}var Bz=Ts?256:2048,Pz=512,Hz=1024,Iz=Ts?2048:256,Gx=class{constructor(e){var s;this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=(s=t.getModifierState)==null?void 0:s.call(t,"AltGraph"),this.keyCode=Lz(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=Bz),this.altKey&&(t|=Pz),this.shiftKey&&(t|=Hz),this.metaKey&&(t|=Iz),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new Oz(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Xx=new WeakMap;function $z(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,s=e.parent.location;if(t.origin!=="null"&&s.origin!=="null"&&t.origin!==s.origin)return null}catch{return null}return e.parent}var Uz=class{static getSameOriginWindowChain(e){let t=Xx.get(e);if(!t){t=[],Xx.set(e,t);let s=e,n;do n=$z(s),n?t.push({window:new WeakRef(s),iframeElement:s.frameElement||null}):t.push({window:new WeakRef(s),iframeElement:null}),s=n;while(s)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let s=0,n=0,a=this.getSameOriginWindowChain(e);for(let l of a){let u=l.window.deref();if(s+=(u==null?void 0:u.scrollY)??0,n+=(u==null?void 0:u.scrollX)??0,u===t||!l.iframeElement)break;let f=l.iframeElement.getBoundingClientRect();s+=f.top,n+=f.left}return{top:s,left:n}}},Bu=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let s=Uz.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=s.left,this.posy-=s.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Zx=class{constructor(e,t=0,s=0){var a;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=s,this.deltaX=t;let n=!1;if(cv){let l=navigator.userAgent.match(/Chrome\/(\d+)/);n=(l?parseInt(l[1]):123)<=122}if(e){let l=e,u=e,f=((a=e.view)==null?void 0:a.devicePixelRatio)||1;if(typeof l.wheelDeltaY<"u")n?this.deltaY=l.wheelDeltaY/(120*f):this.deltaY=l.wheelDeltaY/120;else if(typeof u.VERTICAL_AXIS<"u"&&u.axis===u.VERTICAL_AXIS)this.deltaY=-u.detail/3;else if(e.type==="wheel"){let m=e;m.deltaMode===m.DOM_DELTA_LINE?Xp&&!Ts?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof l.wheelDeltaX<"u")Ez&&k2?this.deltaX=-(l.wheelDeltaX/120):n?this.deltaX=l.wheelDeltaX/(120*f):this.deltaX=l.wheelDeltaX/120;else if(typeof u.HORIZONTAL_AXIS<"u"&&u.axis===u.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let m=e;m.deltaMode===m.DOM_DELTA_LINE?Xp&&!Ts?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(n?this.deltaY=e.wheelDelta/(120*f):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},D2=Object.freeze(function(e,t){let s=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(s)}}}),Fz;(e=>{function t(s){return s===e.None||s===e.Cancelled||s instanceof Vz?!0:!s||typeof s!="object"?!1:typeof s.isCancellationRequested=="boolean"&&typeof s.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ii.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:D2})})(Fz||(Fz={}));var Vz=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?D2:(this._emitter||(this._emitter=new ue),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},hv=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Vp("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Vp("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},Wz=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,s=globalThis){if(this.isDisposed)throw new Vp("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let n=s.setInterval(()=>{e()},t);this.disposable=ut(()=>{s.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},Kz;(e=>{async function t(n){let a,l=await Promise.all(n.map(u=>u.then(f=>f,f=>{a||(a=f)})));if(typeof a<"u")throw a;return l}e.settled=t;function s(n){return new Promise(async(a,l)=>{try{await n(a,l)}catch(u){l(u)}})}e.withAsyncBody=s})(Kz||(Kz={}));var Qx=class Qi{static fromArray(t){return new Qi(s=>{s.emitMany(t)})}static fromPromise(t){return new Qi(async s=>{s.emitMany(await t)})}static fromPromises(t){return new Qi(async s=>{await Promise.all(t.map(async n=>s.emitOne(await n)))})}static merge(t){return new Qi(async s=>{await Promise.all(t.map(async n=>{for await(let a of n)s.emitOne(a)}))})}constructor(t,s){this._state=0,this._results=[],this._error=null,this._onReturn=s,this._onStateChanged=new ue,queueMicrotask(async()=>{let n={emitOne:a=>this.emitOne(a),emitMany:a=>this.emitMany(a),reject:a=>this.reject(a)};try{await Promise.resolve(t(n)),this.resolve()}catch(a){this.reject(a)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await ii.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var s;return(s=this._onReturn)==null||s.call(this),{done:!0,value:void 0}}}}static map(t,s){return new Qi(async n=>{for await(let a of t)n.emitOne(s(a))})}map(t){return Qi.map(this,t)}static filter(t,s){return new Qi(async n=>{for await(let a of t)s(a)&&n.emitOne(a)})}filter(t){return Qi.filter(this,t)}static coalesce(t){return Qi.filter(t,s=>!!s)}coalesce(){return Qi.coalesce(this)}static async toPromise(t){let s=[];for await(let n of t)s.push(n);return s}toPromise(){return Qi.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};Qx.EMPTY=Qx.fromArray([]);var{getWindow:Ds,getWindowId:qz,onDidRegisterWindow:Yz}=(function(){let e=new Map,t={window:rr,disposables:new tn};e.set(rr.vscodeWindowId,t);let s=new ue,n=new ue,a=new ue;function l(u,f){return(typeof u=="number"?e.get(u):void 0)??(f?t:void 0)}return{onDidRegisterWindow:s.event,onWillUnregisterWindow:a.event,onDidUnregisterWindow:n.event,registerWindow(u){if(e.has(u.vscodeWindowId))return Be.None;let f=new tn,m={window:u,disposables:f.add(new tn)};return e.set(u.vscodeWindowId,m),f.add(ut(()=>{e.delete(u.vscodeWindowId),n.fire(u)})),f.add(ke(u,It.BEFORE_UNLOAD,()=>{a.fire(u)})),s.fire(m),f},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(u){return u.vscodeWindowId},hasWindow(u){return e.has(u)},getWindowById:l,getWindow(u){var d;let f=u;if((d=f==null?void 0:f.ownerDocument)!=null&&d.defaultView)return f.ownerDocument.defaultView.window;let m=u;return m!=null&&m.view?m.view.window:rr},getDocument(u){return Ds(u).document}}})(),Gz=class{constructor(e,t,s,n){this._node=e,this._type=t,this._handler=s,this._options=n||!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 ke(e,t,s,n){return new Gz(e,t,s,n)}var Jx=function(e,t,s,n){return ke(e,t,s,n)},dv,Xz=class extends Wz{constructor(e){super(),this.defaultTarget=e&&Ds(e)}cancelAndSet(e,t,s){return super.cancelAndSet(e,t,s??this.defaultTarget)}},eS=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){eh(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,s=new Map,n=new Map,a=l=>{s.set(l,!1);let u=e.get(l)??[];for(t.set(l,u),e.set(l,[]),n.set(l,!0);u.length>0;)u.sort(eS.sort),u.shift().execute();n.set(l,!1)};dv=(l,u,f=0)=>{let m=qz(l),d=new eS(u,f),_=e.get(m);return _||(_=[],e.set(m,_)),_.push(d),s.get(m)||(s.set(m,!0),l.requestAnimationFrame(()=>a(m))),d}})();function Zz(e){let t=e.getBoundingClientRect(),s=Ds(e);return{left:t.left+s.scrollX,top:t.top+s.scrollY,width:t.width,height:t.height}}var It={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},Qz=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=xi(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=xi(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=xi(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=xi(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=xi(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=xi(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=xi(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=xi(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=xi(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=xi(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=xi(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=xi(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=xi(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=xi(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function xi(e){return typeof e=="number"?`${e}px`:e}function zl(e){return new Qz(e)}var T2=class{constructor(){this._hooks=new tn,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let s=this._onStopCallback;this._onStopCallback=null,e&&s&&s(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,s,n,a){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=a;let l=e;try{e.setPointerCapture(t),this._hooks.add(ut(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{l=Ds(e)}this._hooks.add(ke(l,It.POINTER_MOVE,u=>{if(u.buttons!==s){this.stopMonitoring(!0);return}u.preventDefault(),this._pointerMoveCallback(u)})),this._hooks.add(ke(l,It.POINTER_UP,u=>this.stopMonitoring(!0)))}};function Jz(e,t,s){let n=null,a=null;if(typeof s.value=="function"?(n="value",a=s.value,a.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof s.get=="function"&&(n="get",a=s.get),!a)throw new Error("not supported");let l=`$memoize$${t}`;s[n]=function(...u){return this.hasOwnProperty(l)||Object.defineProperty(this,l,{configurable:!1,enumerable:!1,writable:!1,value:a.apply(this,u)}),this[l]}}var Ss;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Ss||(Ss={}));var jl=class ai extends Be{constructor(){super(),this.dispatched=!1,this.targets=new Vx,this.ignoreTargets=new Vx,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(ii.runAndSubscribe(Yz,({window:t,disposables:s})=>{s.add(ke(t.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),s.add(ke(t.document,"touchend",n=>this.onTouchEnd(t,n))),s.add(ke(t.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:rr,disposables:this._store}))}static addTarget(t){if(!ai.isTouchDevice())return Be.None;ai.INSTANCE||(ai.INSTANCE=new ai);let s=ai.INSTANCE.targets.push(t);return ut(s)}static ignoreTarget(t){if(!ai.isTouchDevice())return Be.None;ai.INSTANCE||(ai.INSTANCE=new ai);let s=ai.INSTANCE.ignoreTargets.push(t);return ut(s)}static isTouchDevice(){return"ontouchstart"in rr||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let s=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let n=0,a=t.targetTouches.length;n<a;n++){let l=t.targetTouches.item(n);this.activeTouches[l.identifier]={id:l.identifier,initialTarget:l.target,initialTimeStamp:s,initialPageX:l.pageX,initialPageY:l.pageY,rollingTimestamps:[s],rollingPageX:[l.pageX],rollingPageY:[l.pageY]};let u=this.newGestureEvent(Ss.Start,l.target);u.pageX=l.pageX,u.pageY=l.pageY,this.dispatchEvent(u)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,s){let n=Date.now(),a=Object.keys(this.activeTouches).length;for(let l=0,u=s.changedTouches.length;l<u;l++){let f=s.changedTouches.item(l);if(!this.activeTouches.hasOwnProperty(String(f.identifier))){console.warn("move of an UNKNOWN touch",f);continue}let m=this.activeTouches[f.identifier],d=Date.now()-m.initialTimeStamp;if(d<ai.HOLD_DELAY&&Math.abs(m.initialPageX-Ai(m.rollingPageX))<30&&Math.abs(m.initialPageY-Ai(m.rollingPageY))<30){let _=this.newGestureEvent(Ss.Tap,m.initialTarget);_.pageX=Ai(m.rollingPageX),_.pageY=Ai(m.rollingPageY),this.dispatchEvent(_)}else if(d>=ai.HOLD_DELAY&&Math.abs(m.initialPageX-Ai(m.rollingPageX))<30&&Math.abs(m.initialPageY-Ai(m.rollingPageY))<30){let _=this.newGestureEvent(Ss.Contextmenu,m.initialTarget);_.pageX=Ai(m.rollingPageX),_.pageY=Ai(m.rollingPageY),this.dispatchEvent(_)}else if(a===1){let _=Ai(m.rollingPageX),g=Ai(m.rollingPageY),b=Ai(m.rollingTimestamps)-m.rollingTimestamps[0],y=_-m.rollingPageX[0],x=g-m.rollingPageY[0],S=[...this.targets].filter(E=>m.initialTarget instanceof Node&&E.contains(m.initialTarget));this.inertia(t,S,n,Math.abs(y)/b,y>0?1:-1,_,Math.abs(x)/b,x>0?1:-1,g)}this.dispatchEvent(this.newGestureEvent(Ss.End,m.initialTarget)),delete this.activeTouches[f.identifier]}this.dispatched&&(s.preventDefault(),s.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,s){let n=document.createEvent("CustomEvent");return n.initEvent(t,!1,!0),n.initialTarget=s,n.tapCount=0,n}dispatchEvent(t){if(t.type===Ss.Tap){let s=new Date().getTime(),n=0;s-this._lastSetTapCountTime>ai.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=s,t.tapCount=n}else(t.type===Ss.Change||t.type===Ss.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let n of this.ignoreTargets)if(n.contains(t.initialTarget))return;let s=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let a=0,l=t.initialTarget;for(;l&&l!==n;)a++,l=l.parentElement;s.push([a,n])}s.sort((n,a)=>n[0]-a[0]);for(let[n,a]of s)a.dispatchEvent(t),this.dispatched=!0}}inertia(t,s,n,a,l,u,f,m,d){this.handle=dv(t,()=>{let _=Date.now(),g=_-n,b=0,y=0,x=!0;a+=ai.SCROLL_FRICTION*g,f+=ai.SCROLL_FRICTION*g,a>0&&(x=!1,b=l*a*g),f>0&&(x=!1,y=m*f*g);let S=this.newGestureEvent(Ss.Change);S.translationX=b,S.translationY=y,s.forEach(E=>E.dispatchEvent(S)),x||this.inertia(t,s,_,a,l,u+b,f,m,d+y)})}onTouchMove(t){let s=Date.now();for(let n=0,a=t.changedTouches.length;n<a;n++){let l=t.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(l.identifier))){console.warn("end of an UNKNOWN touch",l);continue}let u=this.activeTouches[l.identifier],f=this.newGestureEvent(Ss.Change,u.initialTarget);f.translationX=l.pageX-Ai(u.rollingPageX),f.translationY=l.pageY-Ai(u.rollingPageY),f.pageX=l.pageX,f.pageY=l.pageY,this.dispatchEvent(f),u.rollingPageX.length>3&&(u.rollingPageX.shift(),u.rollingPageY.shift(),u.rollingTimestamps.shift()),u.rollingPageX.push(l.pageX),u.rollingPageY.push(l.pageY),u.rollingTimestamps.push(s)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};jl.SCROLL_FRICTION=-.005,jl.HOLD_DELAY=700,jl.CLEAR_TAP_COUNT_TIME=400,yt([Jz],jl,"isTouchDevice",1);var eL=jl,fv=class extends Be{onclick(e,t){this._register(ke(e,It.CLICK,s=>t(new Bu(Ds(e),s))))}onmousedown(e,t){this._register(ke(e,It.MOUSE_DOWN,s=>t(new Bu(Ds(e),s))))}onmouseover(e,t){this._register(ke(e,It.MOUSE_OVER,s=>t(new Bu(Ds(e),s))))}onmouseleave(e,t){this._register(ke(e,It.MOUSE_LEAVE,s=>t(new Bu(Ds(e),s))))}onkeydown(e,t){this._register(ke(e,It.KEY_DOWN,s=>t(new Gx(s))))}onkeyup(e,t){this._register(ke(e,It.KEY_UP,s=>t(new Gx(s))))}oninput(e,t){this._register(ke(e,It.INPUT,t))}onblur(e,t){this._register(ke(e,It.BLUR,t))}onfocus(e,t){this._register(ke(e,It.FOCUS,t))}onchange(e,t){this._register(ke(e,It.CHANGE,t))}ignoreGesture(e){return eL.ignoreTarget(e)}},tS=11,tL=class extends fv{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=tS+"px",this.domNode.style.height=tS+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new T2),this._register(Jx(this.bgDomNode,It.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Jx(this.domNode,It.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new Xz),this._pointerdownScheduleRepeatTimer=this._register(new hv)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Ds(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},iL=class Jp{constructor(t,s,n,a,l,u,f){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(s=s|0,n=n|0,a=a|0,l=l|0,u=u|0,f=f|0),this.rawScrollLeft=a,this.rawScrollTop=f,s<0&&(s=0),a+s>n&&(a=n-s),a<0&&(a=0),l<0&&(l=0),f+l>u&&(f=u-l),f<0&&(f=0),this.width=s,this.scrollWidth=n,this.scrollLeft=a,this.height=l,this.scrollHeight=u,this.scrollTop=f}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,s){return new Jp(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,s?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,s?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new Jp(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,s){let n=this.width!==t.width,a=this.scrollWidth!==t.scrollWidth,l=this.scrollLeft!==t.scrollLeft,u=this.height!==t.height,f=this.scrollHeight!==t.scrollHeight,m=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:s,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:a,scrollLeftChanged:l,heightChanged:u,scrollHeightChanged:f,scrollTopChanged:m}}},sL=class extends Be{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new ue),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new iL(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var n;let s=this._state.withScrollDimensions(e,t);this._setState(s,!!this._smoothScrolling),(n=this._smoothScrolling)==null||n.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let s=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===s.scrollLeft&&this._smoothScrolling.to.scrollTop===s.scrollTop)return;let n;t?n=new sS(this._smoothScrolling.from,s,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,s,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{let s=this._state.withScrollPosition(e);this._smoothScrolling=sS.start(this._state,s,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let s=this._state;s.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(s,t)))}},iS=class{constructor(e,t,s){this.scrollLeft=e,this.scrollTop=t,this.isDone=s}};function Fm(e,t){let s=t-e;return function(n){return e+s*aL(n)}}function rL(e,t,s){return function(n){return n<s?e(n/s):t((n-s)/(1-s))}}var sS=class eg{constructor(t,s,n,a){this.from=t,this.to=s,this.duration=a,this.startTime=n,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,s,n){if(Math.abs(t-s)>2.5*n){let a,l;return t<s?(a=t+.75*n,l=s-.75*n):(a=t-.75*n,l=s+.75*n),rL(Fm(t,a),Fm(l,s),.33)}return Fm(t,s)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let s=(t-this.startTime)/this.duration;if(s<1){let n=this.scrollLeft(s),a=this.scrollTop(s);return new iS(n,a,!1)}return new iS(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,s,n){return eg.start(t,s,n)}static start(t,s,n){n=n+10;let a=Date.now()-10;return new eg(t,s,a,n)}};function nL(e){return Math.pow(e,3)}function aL(e){return 1-nL(1-e)}var oL=class extends Be{constructor(e,t,s){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=s,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new hv)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},lL=140,R2=class extends fv{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new oL(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new T2),this._shouldRender=!0,this.domNode=zl(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(ke(this.domNode.domNode,It.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new tL(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,s,n){this.slider=zl(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof s=="number"&&this.slider.setWidth(s),typeof n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(ke(this.slider.domNode,It.POINTER_DOWN,a=>{a.button===0&&(a.preventDefault(),this._sliderPointerDown(a))})),this.onclick(this.slider.domNode,a=>{a.leftButton&&a.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,s=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),a=this._sliderPointerPosition(e);s<=a&&a<=n?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,s;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,s=e.offsetY;else{let a=Zz(this.domNode.domNode);t=e.pageX-a.left,s=e.pageY-a.top}let n=this._pointerDownRelativePosition(t,s);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),s=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,a=>{let l=this._sliderOrthogonalPointerPosition(a),u=Math.abs(l-s);if(k2&&u>lL){this._setDesiredScrollPositionNow(n.getScrollPosition());return}let f=this._sliderPointerPosition(a)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(f))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},M2=class tg{constructor(t,s,n,a,l,u){this._scrollbarSize=Math.round(s),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(t),this._visibleSize=a,this._scrollSize=l,this._scrollPosition=u,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new tg(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let s=Math.round(t);return this._visibleSize!==s?(this._visibleSize=s,this._refreshComputedValues(),!0):!1}setScrollSize(t){let s=Math.round(t);return this._scrollSize!==s?(this._scrollSize=s,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let s=Math.round(t);return this._scrollPosition!==s?(this._scrollPosition=s,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,s,n,a,l){let u=Math.max(0,n-t),f=Math.max(0,u-2*s),m=a>0&&a>n;if(!m)return{computedAvailableSize:Math.round(u),computedIsNeeded:m,computedSliderSize:Math.round(f),computedSliderRatio:0,computedSliderPosition:0};let d=Math.round(Math.max(20,Math.floor(n*f/a))),_=(f-d)/(a-n),g=l*_;return{computedAvailableSize:Math.round(u),computedIsNeeded:m,computedSliderSize:Math.round(d),computedSliderRatio:_,computedSliderPosition:Math.round(g)}}_refreshComputedValues(){let t=tg._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let s=t-this._arrowSize-this._computedSliderSize/2;return Math.round(s/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let s=t-this._arrowSize,n=this._scrollPosition;return s<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let s=this._computedSliderPosition+t;return Math.round(s/this._computedSliderRatio)}},cL=class extends R2{constructor(e,t,s){let n=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:s,scrollbarState:new M2(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,n.width,n.scrollWidth,a.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},uL=class extends R2{constructor(e,t,s){let n=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:s,scrollbarState:new M2(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,a.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},hL=500,rS=50,dL=class{constructor(e,t,s){this.timestamp=e,this.deltaX=t,this.deltaY=s,this.score=0}},ig=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,s=0,n=1,a=this._rear;do{let l=a===this._front?t:Math.pow(2,-n);if(t-=l,s+=this._memory[a].score*l,a===this._front)break;a=(this._capacity+a-1)%this._capacity,n++}while(!0);return s<=.5}acceptStandardWheelEvent(t){if(cv){let s=Ds(t.browserEvent),n=wz(s);this.accept(Date.now(),t.deltaX*n,t.deltaY*n)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,s,n){let a=null,l=new dL(t,s,n);this._front===-1&&this._rear===-1?(this._memory[0]=l,this._front=0,this._rear=0):(a=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=l),l.score=this._computeScore(l,a)}_computeScore(t,s){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(n+=.25),s){let a=Math.abs(t.deltaX),l=Math.abs(t.deltaY),u=Math.abs(s.deltaX),f=Math.abs(s.deltaY),m=Math.max(Math.min(a,u),1),d=Math.max(Math.min(l,f),1),_=Math.max(a,u),g=Math.max(l,f);_%m===0&&g%d===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};ig.INSTANCE=new ig;var fL=ig,mL=class extends fv{constructor(e,t,s){super(),this._onScroll=this._register(new ue),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new ue),this.onWillScroll=this._onWillScroll.event,this._options=gL(t),this._scrollable=s,this._register(this._scrollable.onScroll(a=>{this._onWillScroll.fire(a),this._onDidScroll(a),this._onScroll.fire(a)}));let n={onMouseWheel:a=>this._onMouseWheel(a),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new uL(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new cL(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=zl(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=zl(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=zl(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,a=>this._onMouseOver(a)),this.onmouseleave(this._listenOnDomNode,a=>this._onMouseLeave(a)),this._hideTimeout=this._register(new hv),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Wn(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Ts&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Zx(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Wn(this._mouseWheelToDispose),e)){let t=s=>{this._onMouseWheel(new Zx(s))};this._mouseWheelToDispose.push(ke(this._listenOnDomNode,It.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var a;if((a=e.browserEvent)!=null&&a.defaultPrevented)return;let t=fL.INSTANCE;t.acceptStandardWheelEvent(e);let s=!1;if(e.deltaY||e.deltaX){let l=e.deltaY*this._options.mouseWheelScrollSensitivity,u=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&u+l===0?u=l=0:Math.abs(l)>=Math.abs(u)?u=0:l=0),this._options.flipAxes&&([l,u]=[u,l]);let f=!Ts&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||f)&&!u&&(u=l,l=0),e.browserEvent&&e.browserEvent.altKey&&(u=u*this._options.fastScrollSensitivity,l=l*this._options.fastScrollSensitivity);let m=this._scrollable.getFutureScrollPosition(),d={};if(l){let _=rS*l,g=m.scrollTop-(_<0?Math.floor(_):Math.ceil(_));this._verticalScrollbar.writeScrollPosition(d,g)}if(u){let _=rS*u,g=m.scrollLeft-(_<0?Math.floor(_):Math.ceil(_));this._horizontalScrollbar.writeScrollPosition(d,g)}d=this._scrollable.validateScrollPosition(d),(m.scrollLeft!==d.scrollLeft||m.scrollTop!==d.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(d):this._scrollable.setScrollPositionNow(d),s=!0)}let n=s;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,s=e.scrollLeft>0,n=s?" left":"",a=t?" top":"",l=s||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${a}`),this._topLeftShadowDomNode.setClassName(`shadow${l}${a}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),hL)}},pL=class extends mL{constructor(e,t,s){super(e,t,s)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function gL(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Ts&&(t.className+=" mac"),t}var sg=class extends Be{constructor(e,t,s,n,a,l,u,f){super(),this._bufferService=s,this._optionsService=u,this._renderService=f,this._onRequestScrollLines=this._register(new ue),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let m=this._register(new sL({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:d=>dv(n.window,d)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{m.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new pL(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},m)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(a.onProtocolChange(d=>{this._scrollableElement.updateOptions({handleMouseWheel:!(d&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(ii.runAndSubscribe(l.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=l.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(ut(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=n.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(ut(()=>this._styleElement.remove())),this._register(ii.runAndSubscribe(l.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${l.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${l.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${l.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
469
+ `)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(d=>this._handleScroll(d)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),s=t-this._bufferService.buffer.ydisp;s!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(s)),this._isHandlingScroll=!1}};sg=yt([de(2,di),de(3,_r),de(4,d2),de(5,yo),de(6,fi),de(7,yr)],sg);var rg=class extends Be{constructor(e,t,s,n,a){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=s,this._decorationService=n,this._renderService=a,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(l=>this._removeDecoration(l))),this._register(ut(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var n;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((n=e==null?void 0:e.options)==null?void 0:n.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let s=e.options.x??0;return s&&s>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let s=this._decorationElements.get(e);s||(s=this._createElement(e),e.element=s,this._decorationElements.set(e,s),this._container.appendChild(s),e.onDispose(()=>{this._decorationElements.delete(e),s.remove()})),s.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(s.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,s.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,s.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,s.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(s)}}_refreshXPosition(e,t=e.element){if(!t)return;let s=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=s?`${s*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=s?`${s*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};rg=yt([de(1,di),de(2,_r),de(3,rc),de(4,yr)],rg);var vL=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(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,s){return t>=e.startBufferLine-this._linePadding[s||"full"]&&t<=e.endBufferLine+this._linePadding[s||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},bs={full:0,left:0,center:0,right:0},Gr={full:0,left:0,center:0,right:0},_l={full:0,left:0,center:0,right:0},_h=class extends Be{constructor(e,t,s,n,a,l,u,f){var d;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=s,this._decorationService=n,this._renderService=a,this._optionsService=l,this._themeService=u,this._coreBrowserService=f,this._colorZoneStore=new vL,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(),(d=this._viewportElement.parentElement)==null||d.insertBefore(this._canvas,this._viewportElement),this._register(ut(()=>{var _;return(_=this._canvas)==null?void 0:_.remove()}));let m=this._canvas.getContext("2d");if(m)this._ctx=m;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),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())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);Gr.full=this._canvas.width,Gr.left=e,Gr.center=t,Gr.right=e,this._refreshDrawHeightConstants(),_l.full=1,_l.left=1,_l.center=1+Gr.left,_l.right=1+Gr.left+Gr.center}_refreshDrawHeightConstants(){bs.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);bs.left=t,bs.center=t,bs.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*bs.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*bs.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*bs.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*bs.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(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(_l[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-bs[e.position||"full"]/2),Gr[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+bs[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};_h=yt([de(2,di),de(3,rc),de(4,yr),de(5,fi),de(6,yo),de(7,_r)],_h);var ne;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
470
+ `,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(ne||(ne={}));var sh;(e=>(e.PAD="€",e.HOP="",e.BPH="‚",e.NBH="ƒ",e.IND="„",e.NEL="…",e.SSA="†",e.ESA="‡",e.HTS="ˆ",e.HTJ="‰",e.VTS="Š",e.PLD="‹",e.PLU="Œ",e.RI="",e.SS2="Ž",e.SS3="",e.DCS="",e.PU1="‘",e.PU2="’",e.STS="“",e.CCH="”",e.MW="•",e.SPA="–",e.EPA="—",e.SOS="˜",e.SGCI="™",e.SCI="š",e.CSI="›",e.ST="œ",e.OSC="",e.PM="ž",e.APC="Ÿ"))(sh||(sh={}));var A2;(e=>e.ST=`${ne.ESC}\\`)(A2||(A2={}));var ng=class{constructor(e,t,s,n,a,l){this._textarea=e,this._compositionView=t,this._bufferService=s,this._optionsService=n,this._coreService=a,this._renderService=l,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}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===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let s;t.start+=this._dataAlreadySent.length,this._isComposing?s=this._textarea.value.substring(t.start,this._compositionPosition.start):s=this._textarea.value.substring(t.start),s.length>0&&this._coreService.triggerDataEvent(s,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,s=t.replace(e,"");this._dataAlreadySent=s,t.length>e.length?this._coreService.triggerDataEvent(s,!0):t.length<e.length?this._coreService.triggerDataEvent(`${ne.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),s=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,a=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=a+"px",this._compositionView.style.top=n+"px",this._compositionView.style.height=s+"px",this._compositionView.style.lineHeight=s+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let l=this._compositionView.getBoundingClientRect();this._textarea.style.left=a+"px",this._textarea.style.top=n+"px",this._textarea.style.width=Math.max(l.width,1)+"px",this._textarea.style.height=Math.max(l.height,1)+"px",this._textarea.style.lineHeight=l.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};ng=yt([de(2,di),de(3,fi),de(4,Jn),de(5,yr)],ng);var $t=0,Ut=0,Ft=0,_t=0,nS={css:"#00000000",rgba:0},Dt;(e=>{function t(a,l,u,f){return f!==void 0?`#${Mn(a)}${Mn(l)}${Mn(u)}${Mn(f)}`:`#${Mn(a)}${Mn(l)}${Mn(u)}`}e.toCss=t;function s(a,l,u,f=255){return(a<<24|l<<16|u<<8|f)>>>0}e.toRgba=s;function n(a,l,u,f){return{css:e.toCss(a,l,u,f),rgba:e.toRgba(a,l,u,f)}}e.toColor=n})(Dt||(Dt={}));var ot;(e=>{function t(m,d){if(_t=(d.rgba&255)/255,_t===1)return{css:d.css,rgba:d.rgba};let _=d.rgba>>24&255,g=d.rgba>>16&255,b=d.rgba>>8&255,y=m.rgba>>24&255,x=m.rgba>>16&255,S=m.rgba>>8&255;$t=y+Math.round((_-y)*_t),Ut=x+Math.round((g-x)*_t),Ft=S+Math.round((b-S)*_t);let E=Dt.toCss($t,Ut,Ft),k=Dt.toRgba($t,Ut,Ft);return{css:E,rgba:k}}e.blend=t;function s(m){return(m.rgba&255)===255}e.isOpaque=s;function n(m,d,_){let g=rh.ensureContrastRatio(m.rgba,d.rgba,_);if(g)return Dt.toColor(g>>24&255,g>>16&255,g>>8&255)}e.ensureContrastRatio=n;function a(m){let d=(m.rgba|255)>>>0;return[$t,Ut,Ft]=rh.toChannels(d),{css:Dt.toCss($t,Ut,Ft),rgba:d}}e.opaque=a;function l(m,d){return _t=Math.round(d*255),[$t,Ut,Ft]=rh.toChannels(m.rgba),{css:Dt.toCss($t,Ut,Ft,_t),rgba:Dt.toRgba($t,Ut,Ft,_t)}}e.opacity=l;function u(m,d){return _t=m.rgba&255,l(m,_t*d/255)}e.multiplyOpacity=u;function f(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}e.toColorRGB=f})(ot||(ot={}));var ft;(e=>{let t,s;try{let a=document.createElement("canvas");a.width=1,a.height=1;let l=a.getContext("2d",{willReadFrequently:!0});l&&(t=l,t.globalCompositeOperation="copy",s=t.createLinearGradient(0,0,1,1))}catch{}function n(a){if(a.match(/#[\da-f]{3,8}/i))switch(a.length){case 4:return $t=parseInt(a.slice(1,2).repeat(2),16),Ut=parseInt(a.slice(2,3).repeat(2),16),Ft=parseInt(a.slice(3,4).repeat(2),16),Dt.toColor($t,Ut,Ft);case 5:return $t=parseInt(a.slice(1,2).repeat(2),16),Ut=parseInt(a.slice(2,3).repeat(2),16),Ft=parseInt(a.slice(3,4).repeat(2),16),_t=parseInt(a.slice(4,5).repeat(2),16),Dt.toColor($t,Ut,Ft,_t);case 7:return{css:a,rgba:(parseInt(a.slice(1),16)<<8|255)>>>0};case 9:return{css:a,rgba:parseInt(a.slice(1),16)>>>0}}let l=a.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(l)return $t=parseInt(l[1]),Ut=parseInt(l[2]),Ft=parseInt(l[3]),_t=Math.round((l[5]===void 0?1:parseFloat(l[5]))*255),Dt.toColor($t,Ut,Ft,_t);if(!t||!s)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=s,t.fillStyle=a,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[$t,Ut,Ft,_t]=t.getImageData(0,0,1,1).data,_t!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Dt.toRgba($t,Ut,Ft,_t),css:a}}e.toColor=n})(ft||(ft={}));var li;(e=>{function t(n){return s(n>>16&255,n>>8&255,n&255)}e.relativeLuminance=t;function s(n,a,l){let u=n/255,f=a/255,m=l/255,d=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),_=f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4),g=m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4);return d*.2126+_*.7152+g*.0722}e.relativeLuminance2=s})(li||(li={}));var rh;(e=>{function t(u,f){if(_t=(f&255)/255,_t===1)return f;let m=f>>24&255,d=f>>16&255,_=f>>8&255,g=u>>24&255,b=u>>16&255,y=u>>8&255;return $t=g+Math.round((m-g)*_t),Ut=b+Math.round((d-b)*_t),Ft=y+Math.round((_-y)*_t),Dt.toRgba($t,Ut,Ft)}e.blend=t;function s(u,f,m){let d=li.relativeLuminance(u>>8),_=li.relativeLuminance(f>>8);if(ir(d,_)<m){if(_<d){let y=n(u,f,m),x=ir(d,li.relativeLuminance(y>>8));if(x<m){let S=a(u,f,m),E=ir(d,li.relativeLuminance(S>>8));return x>E?y:S}return y}let g=a(u,f,m),b=ir(d,li.relativeLuminance(g>>8));if(b<m){let y=n(u,f,m),x=ir(d,li.relativeLuminance(y>>8));return b>x?g:y}return g}}e.ensureContrastRatio=s;function n(u,f,m){let d=u>>24&255,_=u>>16&255,g=u>>8&255,b=f>>24&255,y=f>>16&255,x=f>>8&255,S=ir(li.relativeLuminance2(b,y,x),li.relativeLuminance2(d,_,g));for(;S<m&&(b>0||y>0||x>0);)b-=Math.max(0,Math.ceil(b*.1)),y-=Math.max(0,Math.ceil(y*.1)),x-=Math.max(0,Math.ceil(x*.1)),S=ir(li.relativeLuminance2(b,y,x),li.relativeLuminance2(d,_,g));return(b<<24|y<<16|x<<8|255)>>>0}e.reduceLuminance=n;function a(u,f,m){let d=u>>24&255,_=u>>16&255,g=u>>8&255,b=f>>24&255,y=f>>16&255,x=f>>8&255,S=ir(li.relativeLuminance2(b,y,x),li.relativeLuminance2(d,_,g));for(;S<m&&(b<255||y<255||x<255);)b=Math.min(255,b+Math.ceil((255-b)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),x=Math.min(255,x+Math.ceil((255-x)*.1)),S=ir(li.relativeLuminance2(b,y,x),li.relativeLuminance2(d,_,g));return(b<<24|y<<16|x<<8|255)>>>0}e.increaseLuminance=a;function l(u){return[u>>24&255,u>>16&255,u>>8&255,u&255]}e.toChannels=l})(rh||(rh={}));function Mn(e){let t=e.toString(16);return t.length<2?"0"+t:t}function ir(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var _L=class extends sc{constructor(e,t,s){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=s}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()]}},yh=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new ns}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let s=[],n=t.translateToString(!0),a=0,l=0,u=0,f=t.getFg(0),m=t.getBg(0);for(let d=0;d<t.getTrimmedLength();d++)if(t.loadCell(d,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==f||this._workCell.bg!==m){if(d-a>1){let _=this._getJoinedRanges(n,u,l,t,a);for(let g=0;g<_.length;g++)s.push(_[g])}a=d,u=l,f=this._workCell.fg,m=this._workCell.bg}l+=this._workCell.getChars().length||Jr.length}if(this._bufferService.cols-a>1){let d=this._getJoinedRanges(n,u,l,t,a);for(let _=0;_<d.length;_++)s.push(d[_])}return s}_getJoinedRanges(e,t,s,n,a){let l=e.substring(t,s),u=[];try{u=this._characterJoiners[0].handler(l)}catch(f){console.error(f)}for(let f=1;f<this._characterJoiners.length;f++)try{let m=this._characterJoiners[f].handler(l);for(let d=0;d<m.length;d++)yh._mergeRanges(u,m[d])}catch(m){console.error(m)}return this._stringRangesToCellRanges(u,n,a),u}_stringRangesToCellRanges(e,t,s){let n=0,a=!1,l=0,u=e[n];if(u){for(let f=s;f<this._bufferService.cols;f++){let m=t.getWidth(f),d=t.getString(f).length||Jr.length;if(m!==0){if(!a&&u[0]<=l&&(u[0]=f,a=!0),u[1]<=l){if(u[1]=f,u=e[++n],!u)break;u[0]<=l?(u[0]=f,a=!0):a=!1}l+=d}}u&&(u[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let s=!1;for(let n=0;n<e.length;n++){let a=e[n];if(s){if(t[1]<=a[0])return e[n-1][1]=t[1],e;if(t[1]<=a[1])return e[n-1][1]=Math.max(t[1],a[1]),e.splice(n,1),e;e.splice(n,1),n--}else{if(t[1]<=a[0])return e.splice(n,0,t),e;if(t[1]<=a[1])return a[0]=Math.min(t[0],a[0]),e;t[0]<a[1]&&(a[0]=Math.min(t[0],a[0]),s=!0);continue}}return s?e[e.length-1][1]=t[1]:e.push(t),e}};yh=yt([de(0,di)],yh);function yL(e){return 57508<=e&&e<=57558}function bL(e){return 9472<=e&&e<=9631}function xL(e){return yL(e)||bL(e)}function SL(){return{css:{canvas:Pu(),cell:Pu()},device:{canvas:Pu(),cell:Pu(),char:{width:0,height:0,left:0,top:0}}}}function Pu(){return{width:0,height:0}}var ag=class{constructor(e,t,s,n,a,l,u){this._document=e,this._characterJoinerService=t,this._optionsService=s,this._coreBrowserService=n,this._coreService=a,this._decorationService=l,this._themeService=u,this._workCell=new ns,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,s){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=s}createRow(e,t,s,n,a,l,u,f,m,d,_){let g=[],b=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,x=e.getNoBgTrimmedLength();s&&x<l+1&&(x=l+1);let S,E=0,k="",T=0,D=0,R=0,z=0,L=!1,j=0,A=!1,V=0,I=0,J=[],$=d!==-1&&_!==-1;for(let B=0;B<x;B++){e.loadCell(B,this._workCell);let K=this._workCell.getWidth();if(K===0)continue;let q=!1,M=B>=I,H=B,U=this._workCell;if(b.length>0&&B===b[0][0]&&M){let De=b.shift(),ht=this._isCellInSelection(De[0],t);for(T=De[0]+1;T<De[1];T++)M&&(M=ht===this._isCellInSelection(T,t));M&&(M=!s||l<De[0]||l>=De[1]),M?(q=!0,U=new _L(this._workCell,e.translateToString(!0,De[0],De[1]),De[1]-De[0]),H=De[1]-1,K=U.getWidth()):I=De[1]}let ae=this._isCellInSelection(B,t),Y=s&&B===l,O=$&&B>=d&&B<=_,Z=!1;this._decorationService.forEachDecorationAtCell(B,t,void 0,De=>{Z=!0});let te=U.getChars()||Jr;if(te===" "&&(U.isUnderline()||U.isOverline())&&(te=" "),V=K*f-m.get(te,U.isBold(),U.isItalic()),!S)S=this._document.createElement("span");else if(E&&(ae&&A||!ae&&!A&&U.bg===D)&&(ae&&A&&y.selectionForeground||U.fg===R)&&U.extended.ext===z&&O===L&&V===j&&!Y&&!q&&!Z&&M){U.isInvisible()?k+=Jr:k+=te,E++;continue}else E&&(S.textContent=k),S=this._document.createElement("span"),E=0,k="";if(D=U.bg,R=U.fg,z=U.extended.ext,L=O,j=V,A=ae,q&&l>=B&&l<=H&&(l=B),!this._coreService.isCursorHidden&&Y&&this._coreService.isCursorInitialized){if(J.push("xterm-cursor"),this._coreBrowserService.isFocused)u&&J.push("xterm-cursor-blink"),J.push(n==="bar"?"xterm-cursor-bar":n==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(a)switch(a){case"outline":J.push("xterm-cursor-outline");break;case"block":J.push("xterm-cursor-block");break;case"bar":J.push("xterm-cursor-bar");break;case"underline":J.push("xterm-cursor-underline");break}}if(U.isBold()&&J.push("xterm-bold"),U.isItalic()&&J.push("xterm-italic"),U.isDim()&&J.push("xterm-dim"),U.isInvisible()?k=Jr:k=U.getChars()||Jr,U.isUnderline()&&(J.push(`xterm-underline-${U.extended.underlineStyle}`),k===" "&&(k=" "),!U.isUnderlineColorDefault()))if(U.isUnderlineColorRGB())S.style.textDecorationColor=`rgb(${sc.toColorRGB(U.getUnderlineColor()).join(",")})`;else{let De=U.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&U.isBold()&&De<8&&(De+=8),S.style.textDecorationColor=y.ansi[De].css}U.isOverline()&&(J.push("xterm-overline"),k===" "&&(k=" ")),U.isStrikethrough()&&J.push("xterm-strikethrough"),O&&(S.style.textDecoration="underline");let oe=U.getFgColor(),ce=U.getFgColorMode(),he=U.getBgColor(),Se=U.getBgColorMode(),me=!!U.isInverse();if(me){let De=oe;oe=he,he=De;let ht=ce;ce=Se,Se=ht}let le,Ce,je=!1;this._decorationService.forEachDecorationAtCell(B,t,void 0,De=>{De.options.layer!=="top"&&je||(De.backgroundColorRGB&&(Se=50331648,he=De.backgroundColorRGB.rgba>>8&16777215,le=De.backgroundColorRGB),De.foregroundColorRGB&&(ce=50331648,oe=De.foregroundColorRGB.rgba>>8&16777215,Ce=De.foregroundColorRGB),je=De.options.layer==="top")}),!je&&ae&&(le=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,he=le.rgba>>8&16777215,Se=50331648,je=!0,y.selectionForeground&&(ce=50331648,oe=y.selectionForeground.rgba>>8&16777215,Ce=y.selectionForeground)),je&&J.push("xterm-decoration-top");let it;switch(Se){case 16777216:case 33554432:it=y.ansi[he],J.push(`xterm-bg-${he}`);break;case 50331648:it=Dt.toColor(he>>16,he>>8&255,he&255),this._addStyle(S,`background-color:#${aS((he>>>0).toString(16),"0",6)}`);break;case 0:default:me?(it=y.foreground,J.push("xterm-bg-257")):it=y.background}switch(le||U.isDim()&&(le=ot.multiplyOpacity(it,.5)),ce){case 16777216:case 33554432:U.isBold()&&oe<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(oe+=8),this._applyMinimumContrast(S,it,y.ansi[oe],U,le,void 0)||J.push(`xterm-fg-${oe}`);break;case 50331648:let De=Dt.toColor(oe>>16&255,oe>>8&255,oe&255);this._applyMinimumContrast(S,it,De,U,le,Ce)||this._addStyle(S,`color:#${aS(oe.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(S,it,y.foreground,U,le,Ce)||me&&J.push("xterm-fg-257")}J.length&&(S.className=J.join(" "),J.length=0),!Y&&!q&&!Z&&M?E++:S.textContent=k,V!==this.defaultSpacing&&(S.style.letterSpacing=`${V}px`),g.push(S),B=H}return S&&E&&(S.textContent=k),g}_applyMinimumContrast(e,t,s,n,a,l){if(this._optionsService.rawOptions.minimumContrastRatio===1||xL(n.getCode()))return!1;let u=this._getContrastCache(n),f;if(!a&&!l&&(f=u.getColor(t.rgba,s.rgba)),f===void 0){let m=this._optionsService.rawOptions.minimumContrastRatio/(n.isDim()?2:1);f=ot.ensureContrastRatio(a||t,l||s,m),u.setColor((a||t).rgba,(l||s).rgba,f??null)}return f?(this._addStyle(e,`color:${f.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let s=this._selectionStart,n=this._selectionEnd;return!s||!n?!1:this._columnSelectMode?s[0]<=n[0]?e>=s[0]&&t>=s[1]&&e<n[0]&&t<=n[1]:e<s[0]&&t>=s[1]&&e>=n[0]&&t<=n[1]:t>s[1]&&t<n[1]||s[1]===n[1]&&t===s[1]&&e>=s[0]&&e<n[0]||s[1]<n[1]&&t===n[1]&&e<n[0]||s[1]<n[1]&&t===s[1]&&e>=s[0]}};ag=yt([de(1,p2),de(2,fi),de(3,_r),de(4,Jn),de(5,rc),de(6,yo)],ag);function aS(e,t,s){for(;e.length<s;)e=t+e;return e}var wL=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.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";let s=e.createElement("span");s.classList.add("xterm-char-measure-element");let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";let a=e.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontStyle="italic";let l=e.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold",l.style.fontStyle="italic",this._measureElements=[s,n,a,l],this._container.appendChild(s),this._container.appendChild(n),this._container.appendChild(a),this._container.appendChild(l),t.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(e,t,s,n){e===this._font&&t===this._fontSize&&s===this._weight&&n===this._weightBold||(this._font=e,this._fontSize=t,this._weight=s,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${s}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${s}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(e,t,s){let n=0;if(!t&&!s&&e.length===1&&(n=e.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];let u=this._measure(e,0);return u>0&&(this._flat[n]=u),u}let a=e;t&&(a+="B"),s&&(a+="I");let l=this._holey.get(a);if(l===void 0){let u=0;t&&(u|=1),s&&(u|=2),l=this._measure(e,u),l>0&&this._holey.set(a,l)}return l}_measure(e,t){let s=this._measureElements[t];return s.textContent=e.repeat(32),s.offsetWidth/32}},CL=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,t,s,n=!1){if(this.selectionStart=t,this.selectionEnd=s,!t||!s||t[0]===s[0]&&t[1]===s[1]){this.clear();return}let a=e.buffers.active.ydisp,l=t[1]-a,u=s[1]-a,f=Math.max(l,0),m=Math.min(u,e.rows-1);if(f>=e.rows||m<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=n,this.viewportStartRow=l,this.viewportEndRow=u,this.viewportCappedStartRow=f,this.viewportCappedEndRow=m,this.startCol=t[0],this.endCol=s[0]}isCellSelected(e,t,s){return this.hasSelection?(s-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&s>=this.viewportCappedStartRow&&t<this.endCol&&s<=this.viewportCappedEndRow:t<this.startCol&&s>=this.viewportCappedStartRow&&t>=this.endCol&&s<=this.viewportCappedEndRow:s>this.viewportStartRow&&s<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&s===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&s===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&s===this.viewportStartRow&&t>=this.startCol):!1}};function EL(){return new CL}var Vm="xterm-dom-renderer-owner-",Xi="xterm-rows",Hu="xterm-fg-",oS="xterm-bg-",yl="xterm-focus",Iu="xterm-selection",kL=1,og=class extends Be{constructor(e,t,s,n,a,l,u,f,m,d,_,g,b,y){super(),this._terminal=e,this._document=t,this._element=s,this._screenElement=n,this._viewportElement=a,this._helperContainer=l,this._linkifier2=u,this._charSizeService=m,this._optionsService=d,this._bufferService=_,this._coreService=g,this._coreBrowserService=b,this._themeService=y,this._terminalClass=kL++,this._rowElements=[],this._selectionRenderModel=EL(),this.onRequestRedraw=this._register(new ue).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Xi),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(Iu),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=SL(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(x=>this._injectCss(x))),this._injectCss(this._themeService.colors),this._rowFactory=f.createInstance(ag,document),this._element.classList.add(Vm+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(x=>this._handleLinkHover(x))),this._register(this._linkifier2.onHideLinkUnderline(x=>this._handleLinkLeave(x))),this._register(ut(()=>{this._element.classList.remove(Vm+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new wL(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(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),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/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),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(let s of this._rowElements)s.style.width=`${this.dimensions.css.canvas.width}px`,s.style.height=`${this.dimensions.css.cell.height}px`,s.style.lineHeight=`${this.dimensions.css.cell.height}px`,s.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Xi} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,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(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${Xi} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${Xi} .xterm-dim { color: ${ot.multiplyOpacity(e.foreground,.5).css};}`,t+=`${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;}`;let s=`blink_underline_${this._terminalClass}`,n=`blink_bar_${this._terminalClass}`,a=`blink_block_${this._terminalClass}`;t+=`@keyframes ${s} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${n} { 50% { box-shadow: none; }}`,t+=`@keyframes ${a} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Xi}.${yl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Xi}.${yl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Xi}.${yl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${a} 1s step-end infinite;}${this._terminalSelector} .${Xi} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Xi} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Xi} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Xi} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Xi} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Iu} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Iu} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Iu} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[l,u]of e.ansi.entries())t+=`${this._terminalSelector} .${Hu}${l} { color: ${u.css}; }${this._terminalSelector} .${Hu}${l}.xterm-dim { color: ${ot.multiplyOpacity(u,.5).css}; }${this._terminalSelector} .${oS}${l} { background-color: ${u.css}; }`;t+=`${this._terminalSelector} .${Hu}257 { color: ${ot.opaque(e.background).css}; }${this._terminalSelector} .${Hu}257.xterm-dim { color: ${ot.multiplyOpacity(ot.opaque(e.background),.5).css}; }${this._terminalSelector} .${oS}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let s=this._rowElements.length;s<=t;s++){let n=this._document.createElement("div");this._rowContainer.appendChild(n),this._rowElements.push(n)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),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(yl),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(yl),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,s){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,s),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,s),!this._selectionRenderModel.hasSelection))return;let n=this._selectionRenderModel.viewportStartRow,a=this._selectionRenderModel.viewportEndRow,l=this._selectionRenderModel.viewportCappedStartRow,u=this._selectionRenderModel.viewportCappedEndRow,f=this._document.createDocumentFragment();if(s){let m=e[0]>t[0];f.appendChild(this._createSelectionElement(l,m?t[0]:e[0],m?e[0]:t[0],u-l+1))}else{let m=n===l?e[0]:0,d=l===a?t[0]:this._bufferService.cols;f.appendChild(this._createSelectionElement(l,m,d));let _=u-l-1;if(f.appendChild(this._createSelectionElement(l+1,0,this._bufferService.cols,_)),l!==u){let g=a===u?t[0]:this._bufferService.cols;f.appendChild(this._createSelectionElement(u,0,g))}}this._selectionContainer.appendChild(f)}_createSelectionElement(e,t,s,n=1){let a=this._document.createElement("div"),l=t*this.dimensions.css.cell.width,u=this.dimensions.css.cell.width*(s-t);return l+u>this.dimensions.css.canvas.width&&(u=this.dimensions.css.canvas.width-l),a.style.height=`${n*this.dimensions.css.cell.height}px`,a.style.top=`${e*this.dimensions.css.cell.height}px`,a.style.left=`${l}px`,a.style.width=`${u}px`,a}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(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let s=this._bufferService.buffer,n=s.ybase+s.y,a=Math.min(s.x,this._bufferService.cols-1),l=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,u=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let m=e;m<=t;m++){let d=m+s.ydisp,_=this._rowElements[m],g=s.lines.get(d);if(!_||!g)break;_.replaceChildren(...this._rowFactory.createRow(g,d,d===n,u,f,a,l,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Vm}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,s,n,a,l){s<0&&(e=0),n<0&&(t=0);let u=this._bufferService.rows-1;s=Math.max(Math.min(s,u),0),n=Math.max(Math.min(n,u),0),a=Math.min(a,this._bufferService.cols);let f=this._bufferService.buffer,m=f.ybase+f.y,d=Math.min(f.x,a-1),_=this._optionsService.rawOptions.cursorBlink,g=this._optionsService.rawOptions.cursorStyle,b=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=s;y<=n;++y){let x=y+f.ydisp,S=this._rowElements[y],E=f.lines.get(x);if(!S||!E)break;S.replaceChildren(...this._rowFactory.createRow(E,x,x===m,g,b,d,_,this.dimensions.css.cell.width,this._widthCache,l?y===s?e:0:-1,l?(y===n?t:a)-1:-1))}}};og=yt([de(7,av),de(8,Yh),de(9,fi),de(10,di),de(11,Jn),de(12,_r),de(13,yo)],og);var lg=class extends Be{constructor(e,t,s){super(),this._optionsService=s,this.width=0,this.height=0,this._onCharSizeChange=this._register(new ue),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new jL(this._optionsService))}catch{this._measureStrategy=this._register(new NL(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};lg=yt([de(2,fi)],lg);var O2=class extends Be{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},NL=class extends O2{constructor(e,t,s){super(),this._document=e,this._parentElement=t,this._optionsService=s,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}},jL=class extends O2{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let 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}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},DL=class extends Be{constructor(e,t,s){super(),this._textarea=e,this._window=t,this.mainDocument=s,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new TL(this._window)),this._onDprChange=this._register(new ue),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new ue),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(n=>this._screenDprMonitor.setWindow(n))),this._register(ii.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(ke(this._textarea,"focus",()=>this._isFocused=!0)),this._register(ke(this._textarea,"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}},TL=class extends Be{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new lo),this._onDprChange=this._register(new ue),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(ut(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=ke(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.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)}},RL=class extends Be{constructor(){super(),this.linkProviders=[],this._register(ut(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function mv(e,t,s){let n=s.getBoundingClientRect(),a=e.getComputedStyle(s),l=parseInt(a.getPropertyValue("padding-left")),u=parseInt(a.getPropertyValue("padding-top"));return[t.clientX-n.left-l,t.clientY-n.top-u]}function ML(e,t,s,n,a,l,u,f,m){if(!l)return;let d=mv(e,t,s);if(d)return d[0]=Math.ceil((d[0]+(m?u/2:0))/u),d[1]=Math.ceil(d[1]/f),d[0]=Math.min(Math.max(d[0],1),n+(m?1:0)),d[1]=Math.min(Math.max(d[1],1),a),d}var cg=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,s,n,a){return ML(window,e,t,s,n,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,a)}getMouseReportCoords(e,t){let s=mv(window,e,t);if(this._charSizeService.hasValidSize)return s[0]=Math.min(Math.max(s[0],0),this._renderService.dimensions.css.canvas.width-1),s[1]=Math.min(Math.max(s[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(s[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(s[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(s[0]),y:Math.floor(s[1])}}};cg=yt([de(0,yr),de(1,Yh)],cg);var AL=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,s){this._rowCount=s,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!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){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},z2={};F4(z2,{getSafariVersion:()=>zL,isChromeOS:()=>H2,isFirefox:()=>L2,isIpad:()=>LL,isIphone:()=>BL,isLegacyEdge:()=>OL,isLinux:()=>pv,isMac:()=>bh,isNode:()=>Gh,isSafari:()=>B2,isWindows:()=>P2});var Gh=typeof process<"u"&&"title"in process,nc=Gh?"node":navigator.userAgent,ac=Gh?"node":navigator.platform,L2=nc.includes("Firefox"),OL=nc.includes("Edge"),B2=/^((?!chrome|android).)*safari/i.test(nc);function zL(){if(!B2)return 0;let e=nc.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var bh=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(ac),LL=ac==="iPad",BL=ac==="iPhone",P2=["Windows","Win16","Win32","WinCE"].includes(ac),pv=ac.indexOf("Linux")>=0,H2=/\bCrOS\b/.test(nc),I2=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 t=0,s=0,n=e.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),s=Math.max(t,s),a=e.timeRemaining(),s*1.5>a){n-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-t))}ms`),this._start();return}n=a}this.clear()}},PL=class extends I2{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},HL=class extends I2{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},xh=!Gh&&"requestIdleCallback"in window?HL:PL,IL=class{constructor(){this._queue=new xh}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},ug=class extends Be{constructor(e,t,s,n,a,l,u,f,m){super(),this._rowCount=e,this._optionsService=s,this._charSizeService=n,this._coreService=a,this._coreBrowserService=f,this._renderer=this._register(new lo),this._pausedResizeTask=new IL,this._observerDisposable=this._register(new lo),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 ue),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new ue),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new ue),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new ue),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new AL((d,_)=>this._renderRows(d,_),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new $L(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(ut(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(u.onResize(()=>this._fullRefresh())),this._register(u.buffers.onBufferActivate(()=>{var d;return(d=this._renderer.value)==null?void 0:d.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(l.onDecorationRegistered(()=>this._fullRefresh())),this._register(l.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(u.cols,u.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(u.buffer.y,u.buffer.y,!0))),this._register(m.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(d=>this._registerIntersectionObserver(d,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let s=new e.IntersectionObserver(n=>this._handleIntersectionChange(n[n.length-1]),{threshold:0});s.observe(t),this._observerDisposable.value=ut(()=>s.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,t,s=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let n=this._syncOutputHandler.flush();n&&(e=Math.min(e,n.start),t=Math.max(t,n.end)),s||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var s;return(s=this._renderer.value)==null?void 0:s.handleResize(e,t)}):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,s){var n;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=s,(n=this._renderer.value)==null||n.handleSelectionChanged(e,t,s)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};ug=yt([de(2,fi),de(3,Yh),de(4,Jn),de(5,rc),de(6,di),de(7,_r),de(8,yo)],ug);var $L=class{constructor(e,t,s){this._coreBrowserService=e,this._coreService=t,this._onTimeout=s,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function UL(e,t,s,n){let a=s.buffer.x,l=s.buffer.y;if(!s.buffer.hasScrollback)return WL(a,l,e,t,s,n)+Xh(l,t,s,n)+KL(a,l,e,t,s,n);let u;if(l===t)return u=a>e?"D":"C",Fl(Math.abs(a-e),Ul(u,n));u=l>t?"D":"C";let f=Math.abs(l-t),m=VL(l>t?e:a,s)+(f-1)*s.cols+1+FL(l>t?a:e);return Fl(m,Ul(u,n))}function FL(e,t){return e-1}function VL(e,t){return t.cols-e}function WL(e,t,s,n,a,l){return Xh(t,n,a,l).length===0?"":Fl(U2(e,t,e,t-Kn(t,a),!1,a).length,Ul("D",l))}function Xh(e,t,s,n){let a=e-Kn(e,s),l=t-Kn(t,s),u=Math.abs(a-l)-qL(e,t,s);return Fl(u,Ul($2(e,t),n))}function KL(e,t,s,n,a,l){let u;Xh(t,n,a,l).length>0?u=n-Kn(n,a):u=t;let f=n,m=YL(e,t,s,n,a,l);return Fl(U2(e,u,s,f,m==="C",a).length,Ul(m,l))}function qL(e,t,s){var u;let n=0,a=e-Kn(e,s),l=t-Kn(t,s);for(let f=0;f<Math.abs(a-l);f++){let m=$2(e,t)==="A"?-1:1;(u=s.buffer.lines.get(a+m*f))!=null&&u.isWrapped&&n++}return n}function Kn(e,t){let s=0,n=t.buffer.lines.get(e),a=n==null?void 0:n.isWrapped;for(;a&&e>=0&&e<t.rows;)s++,n=t.buffer.lines.get(--e),a=n==null?void 0:n.isWrapped;return s}function YL(e,t,s,n,a,l){let u;return Xh(s,n,a,l).length>0?u=n-Kn(n,a):u=t,e<s&&u<=n||e>=s&&u<n?"C":"D"}function $2(e,t){return e>t?"A":"B"}function U2(e,t,s,n,a,l){let u=e,f=t,m="";for(;(u!==s||f!==n)&&f>=0&&f<l.buffer.lines.length;)u+=a?1:-1,a&&u>l.cols-1?(m+=l.buffer.translateBufferLineToString(f,!1,e,u),u=0,e=0,f++):!a&&u<0&&(m+=l.buffer.translateBufferLineToString(f,!1,0,e+1),u=l.cols-1,e=u,f--);return m+l.buffer.translateBufferLineToString(f,!1,e,u)}function Ul(e,t){let s=t?"O":"[";return ne.ESC+s+e}function Fl(e,t){e=Math.floor(e);let s="";for(let n=0;n<e;n++)s+=t;return s}var GL=class{constructor(e){this._bufferService=e,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.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()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function lS(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Wm=50,XL=15,ZL=50,QL=500,JL=" ",e6=new RegExp(JL,"g"),hg=class extends Be{constructor(e,t,s,n,a,l,u,f,m){super(),this._element=e,this._screenElement=t,this._linkifier=s,this._bufferService=n,this._coreService=a,this._mouseService=l,this._optionsService=u,this._renderService=f,this._coreBrowserService=m,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new ns,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new ue),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new ue),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new ue),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new ue),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=d=>this._handleMouseMove(d),this._mouseUpListener=d=>this._handleMouseUp(d),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(d=>this._handleTrim(d)),this._register(this._bufferService.buffers.onBufferActivate(d=>this._handleBufferActivate(d))),this.enable(),this._model=new GL(this._bufferService),this._activeSelectionMode=0,this._register(ut(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(d=>{d.rowsChanged&&this.clearSelection()}))}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(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let s=this._bufferService.buffer,n=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let a=e[0]<t[0]?e[0]:t[0],l=e[0]<t[0]?t[0]:e[0];for(let u=e[1];u<=t[1];u++){let f=s.translateBufferLineToString(u,!0,a,l);n.push(f)}}else{let a=e[1]===t[1]?t[0]:void 0;n.push(s.translateBufferLineToString(e[1],!0,e[0],a));for(let l=e[1]+1;l<=t[1]-1;l++){let u=s.lines.get(l),f=s.translateBufferLineToString(l,!0);u!=null&&u.isWrapped?n[n.length-1]+=f:n.push(f)}if(e[1]!==t[1]){let l=s.lines.get(t[1]),u=s.translateBufferLineToString(t[1],!0,0,t[0]);l&&l.isWrapped?n[n.length-1]+=u:n.push(u)}}return n.map(a=>a.replace(e6," ")).join(P2?`\r
471
+ `:`
472
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),pv&&e&&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(e){let t=this._getMouseBufferCoords(e),s=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!s||!n||!t?!1:this._areCoordsInSelection(t,s,n)}isCellInSelection(e,t){let s=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!s||!n?!1:this._areCoordsInSelection([e,t],s,n)}_areCoordsInSelection(e,t,s){return e[1]>t[1]&&e[1]<s[1]||t[1]===s[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<s[0]||t[1]<s[1]&&e[1]===s[1]&&e[0]<s[0]||t[1]<s[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var a,l;let s=(l=(a=this._linkifier.currentLink)==null?void 0:a.link)==null?void 0:l.range;if(s)return this._model.selectionStart=[s.start.x-1,s.start.y-1],this._model.selectionStartLength=lS(s,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let n=this._getMouseBufferCoords(e);return n?(this._selectWordAt(n,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=mv(this._coreBrowserService.window,e,this._screenElement)[1],s=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=s?0:(t>s&&(t-=s),t=Math.min(Math.max(t,-Wm),Wm),t/=Wm,t/Math.abs(t)+Math.round(t*(XL-1)))}shouldForceSelection(e){return bh?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),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(),ZL)}_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(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(bh&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}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(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let s=this._bufferService.buffer;if(this._model.selectionEnd[1]<s.lines.length){let n=s.lines.get(this._model.selectionEnd[1]);n&&n.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[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});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<QL&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let s=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(s&&s[0]!==void 0&&s[1]!==void 0){let n=UL(s[0]-1,s[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(n,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,s=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!s){this._oldHasSelection&&this._fireOnSelectionChange(e,t,s);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,s)}_fireOnSelectionChange(e,t,s){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=s,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let s=t;for(let n=0;t>=n;n++){let a=e.loadCell(n,this._workCell).getChars().length;this._workCell.getWidth()===0?s--:a>1&&t!==n&&(s+=a-1)}return s}setSelection(e,t,s){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=s,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,s=!0,n=!0){if(e[0]>=this._bufferService.cols)return;let a=this._bufferService.buffer,l=a.lines.get(e[1]);if(!l)return;let u=a.translateBufferLineToString(e[1],!1),f=this._convertViewportColToCharacterIndex(l,e[0]),m=f,d=e[0]-f,_=0,g=0,b=0,y=0;if(u.charAt(f)===" "){for(;f>0&&u.charAt(f-1)===" ";)f--;for(;m<u.length&&u.charAt(m+1)===" ";)m++}else{let E=e[0],k=e[0];l.getWidth(E)===0&&(_++,E--),l.getWidth(k)===2&&(g++,k++);let T=l.getString(k).length;for(T>1&&(y+=T-1,m+=T-1);E>0&&f>0&&!this._isCharWordSeparator(l.loadCell(E-1,this._workCell));){l.loadCell(E-1,this._workCell);let D=this._workCell.getChars().length;this._workCell.getWidth()===0?(_++,E--):D>1&&(b+=D-1,f-=D-1),f--,E--}for(;k<l.length&&m+1<u.length&&!this._isCharWordSeparator(l.loadCell(k+1,this._workCell));){l.loadCell(k+1,this._workCell);let D=this._workCell.getChars().length;this._workCell.getWidth()===2?(g++,k++):D>1&&(y+=D-1,m+=D-1),m++,k++}}m++;let x=f+d-_+b,S=Math.min(this._bufferService.cols,m-f+_+g-b-y);if(!(!t&&u.slice(f,m).trim()==="")){if(s&&x===0&&l.getCodePoint(0)!==32){let E=a.lines.get(e[1]-1);if(E&&l.isWrapped&&E.getCodePoint(this._bufferService.cols-1)!==32){let k=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(k){let T=this._bufferService.cols-k.start;x-=T,S+=T}}}if(n&&x+S===this._bufferService.cols&&l.getCodePoint(this._bufferService.cols-1)!==32){let E=a.lines.get(e[1]+1);if(E!=null&&E.isWrapped&&E.getCodePoint(0)!==32){let k=this._getWordAt([0,e[1]+1],!1,!1,!0);k&&(S+=k.length)}}return{start:x,length:S}}}_selectWordAt(e,t){let s=this._getWordAt(e,t);if(s){for(;s.start<0;)s.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[s.start,e[1]],this._model.selectionStartLength=s.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let s=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,s--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,s++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,s]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),s={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=lS(s,this._bufferService.cols)}};hg=yt([de(3,di),de(4,Jn),de(5,ov),de(6,fi),de(7,yr),de(8,_r)],hg);var cS=class{constructor(){this._data={}}set(e,t,s){this._data[e]||(this._data[e]={}),this._data[e][t]=s}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},uS=class{constructor(){this._color=new cS,this._css=new cS}setCss(e,t,s){this._css.set(e,t,s)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,s){this._color.set(e,t,s)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},At=Object.freeze((()=>{let e=[ft.toColor("#2e3436"),ft.toColor("#cc0000"),ft.toColor("#4e9a06"),ft.toColor("#c4a000"),ft.toColor("#3465a4"),ft.toColor("#75507b"),ft.toColor("#06989a"),ft.toColor("#d3d7cf"),ft.toColor("#555753"),ft.toColor("#ef2929"),ft.toColor("#8ae234"),ft.toColor("#fce94f"),ft.toColor("#729fcf"),ft.toColor("#ad7fa8"),ft.toColor("#34e2e2"),ft.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let s=0;s<216;s++){let n=t[s/36%6|0],a=t[s/6%6|0],l=t[s%6];e.push({css:Dt.toCss(n,a,l),rgba:Dt.toRgba(n,a,l)})}for(let s=0;s<24;s++){let n=8+s*10;e.push({css:Dt.toCss(n,n,n),rgba:Dt.toRgba(n,n,n)})}return e})()),On=ft.toColor("#ffffff"),Dl=ft.toColor("#000000"),hS=ft.toColor("#ffffff"),dS=Dl,bl={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},t6=On,dg=class extends Be{constructor(e){super(),this._optionsService=e,this._contrastCache=new uS,this._halfContrastCache=new uS,this._onChangeColors=this._register(new ue),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:On,background:Dl,cursor:hS,cursorAccent:dS,selectionForeground:void 0,selectionBackgroundTransparent:bl,selectionBackgroundOpaque:ot.blend(Dl,bl),selectionInactiveBackgroundTransparent:bl,selectionInactiveBackgroundOpaque:ot.blend(Dl,bl),scrollbarSliderBackground:ot.opacity(On,.2),scrollbarSliderHoverBackground:ot.opacity(On,.4),scrollbarSliderActiveBackground:ot.opacity(On,.5),overviewRulerBorder:On,ansi:At.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)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=et(e.foreground,On),t.background=et(e.background,Dl),t.cursor=ot.blend(t.background,et(e.cursor,hS)),t.cursorAccent=ot.blend(t.background,et(e.cursorAccent,dS)),t.selectionBackgroundTransparent=et(e.selectionBackground,bl),t.selectionBackgroundOpaque=ot.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=et(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=ot.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?et(e.selectionForeground,nS):void 0,t.selectionForeground===nS&&(t.selectionForeground=void 0),ot.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=ot.opacity(t.selectionBackgroundTransparent,.3)),ot.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=ot.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=et(e.scrollbarSliderBackground,ot.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=et(e.scrollbarSliderHoverBackground,ot.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=et(e.scrollbarSliderActiveBackground,ot.opacity(t.foreground,.5)),t.overviewRulerBorder=et(e.overviewRulerBorder,t6),t.ansi=At.slice(),t.ansi[0]=et(e.black,At[0]),t.ansi[1]=et(e.red,At[1]),t.ansi[2]=et(e.green,At[2]),t.ansi[3]=et(e.yellow,At[3]),t.ansi[4]=et(e.blue,At[4]),t.ansi[5]=et(e.magenta,At[5]),t.ansi[6]=et(e.cyan,At[6]),t.ansi[7]=et(e.white,At[7]),t.ansi[8]=et(e.brightBlack,At[8]),t.ansi[9]=et(e.brightRed,At[9]),t.ansi[10]=et(e.brightGreen,At[10]),t.ansi[11]=et(e.brightYellow,At[11]),t.ansi[12]=et(e.brightBlue,At[12]),t.ansi[13]=et(e.brightMagenta,At[13]),t.ansi[14]=et(e.brightCyan,At[14]),t.ansi[15]=et(e.brightWhite,At[15]),e.extendedAnsi){let s=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let n=0;n<s;n++)t.ansi[n+16]=et(e.extendedAnsi[n],At[n+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){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[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(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()}}};dg=yt([de(0,fi)],dg);function et(e,t){if(e!==void 0)try{return ft.toColor(e)}catch{}return t}var i6=class{constructor(...e){this._entries=new Map;for(let[t,s]of e)this.set(t,s)}set(e,t){let s=this._entries.get(e);return this._entries.set(e,t),s}forEach(e){for(let[t,s]of this._entries.entries())e(t,s)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},s6=class{constructor(){this._services=new i6,this._services.set(av,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let s=X4(e).sort((l,u)=>l.index-u.index),n=[];for(let l of s){let u=this._services.get(l.id);if(!u)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${l.id._id}.`);n.push(u)}let a=s.length>0?s[0].index:t.length;if(t.length!==a)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${a+1} conflicts with ${t.length} static arguments`);return new e(...t,...n)}},r6={trace:0,debug:1,info:2,warn:3,error:4,off:5},n6="xterm.js: ",fg=class extends Be{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=r6[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,s){this._evalLazyOptionalParams(s),e.call(console,(this._optionsService.options.logger?"":n6)+t,...s)}trace(e,...t){var s;this._logLevel<=0&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var s;this._logLevel<=1&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var s;this._logLevel<=2&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var s;this._logLevel<=3&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var s;this._logLevel<=4&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,e,t)}};fg=yt([de(0,fi)],fg);var fS=class extends Be{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new ue),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new ue),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new ue),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let s=0;s<Math.min(e,this.length);s++)t[s]=this._array[this._getCyclicIndex(s)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...s){if(t){for(let n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let n=this._length-1;n>=e;n--)this._array[this._getCyclicIndex(n+s.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<s.length;n++)this._array[this._getCyclicIndex(e+n)]=s[n];if(s.length&&this.onInsertEmitter.fire({index:e,amount:s.length}),this._length+s.length>this._maxLength){let n=this._length+s.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=s.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,s){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+s<0)throw new Error("Cannot shift elements in list beyond index 0");if(s>0){for(let a=t-1;a>=0;a--)this.set(e+a+s,this.get(e+a));let n=e+t+s-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<t;n++)this.set(e+n+s,this.get(e+n))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},ze=3,jt=Object.freeze(new sc),$u=0,Km=2,Tl=class F2{constructor(t,s,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*ze);let a=s||ns.fromCharData([0,l2,1,0]);for(let l=0;l<t;++l)this.setCell(l,a);this.length=t}get(t){let s=this._data[t*ze+0],n=s&2097151;return[this._data[t*ze+1],s&2097152?this._combined[t]:n?Qr(n):"",s>>22,s&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n]}set(t,s){this._data[t*ze+1]=s[0],s[1].length>1?(this._combined[t]=s[1],this._data[t*ze+0]=t|2097152|s[2]<<22):this._data[t*ze+0]=s[1].charCodeAt(0)|s[2]<<22}getWidth(t){return this._data[t*ze+0]>>22}hasWidth(t){return this._data[t*ze+0]&12582912}getFg(t){return this._data[t*ze+1]}getBg(t){return this._data[t*ze+2]}hasContent(t){return this._data[t*ze+0]&4194303}getCodePoint(t){let s=this._data[t*ze+0];return s&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s&2097151}isCombined(t){return this._data[t*ze+0]&2097152}getString(t){let s=this._data[t*ze+0];return s&2097152?this._combined[t]:s&2097151?Qr(s&2097151):""}isProtected(t){return this._data[t*ze+2]&536870912}loadCell(t,s){return $u=t*ze,s.content=this._data[$u+0],s.fg=this._data[$u+1],s.bg=this._data[$u+2],s.content&2097152&&(s.combinedData=this._combined[t]),s.bg&268435456&&(s.extended=this._extendedAttrs[t]),s}setCell(t,s){s.content&2097152&&(this._combined[t]=s.combinedData),s.bg&268435456&&(this._extendedAttrs[t]=s.extended),this._data[t*ze+0]=s.content,this._data[t*ze+1]=s.fg,this._data[t*ze+2]=s.bg}setCellFromCodepoint(t,s,n,a){a.bg&268435456&&(this._extendedAttrs[t]=a.extended),this._data[t*ze+0]=s|n<<22,this._data[t*ze+1]=a.fg,this._data[t*ze+2]=a.bg}addCodepointToCell(t,s,n){let a=this._data[t*ze+0];a&2097152?this._combined[t]+=Qr(s):a&2097151?(this._combined[t]=Qr(a&2097151)+Qr(s),a&=-2097152,a|=2097152):a=s|1<<22,n&&(a&=-12582913,a|=n<<22),this._data[t*ze+0]=a}insertCells(t,s,n){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),s<this.length-t){let a=new ns;for(let l=this.length-t-s-1;l>=0;--l)this.setCell(t+s+l,this.loadCell(t+l,a));for(let l=0;l<s;++l)this.setCell(t+l,n)}else for(let a=t;a<this.length;++a)this.setCell(a,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(t,s,n){if(t%=this.length,s<this.length-t){let a=new ns;for(let l=0;l<this.length-t-s;++l)this.setCell(t+l,this.loadCell(t+s+l,a));for(let l=this.length-s;l<this.length;++l)this.setCell(l,n)}else for(let a=t;a<this.length;++a)this.setCell(a,n);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,n)}replaceCells(t,s,n,a=!1){if(a){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,n),s<this.length&&this.getWidth(s-1)===2&&!this.isProtected(s)&&this.setCellFromCodepoint(s,0,1,n);t<s&&t<this.length;)this.isProtected(t)||this.setCell(t,n),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),s<this.length&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s,0,1,n);t<s&&t<this.length;)this.setCell(t++,n)}resize(t,s){if(t===this.length)return this._data.length*4*Km<this._data.buffer.byteLength;let n=t*ze;if(t>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let a=new Uint32Array(n);a.set(this._data),this._data=a}for(let a=this.length;a<t;++a)this.setCell(a,s)}else{this._data=this._data.subarray(0,n);let a=Object.keys(this._combined);for(let u=0;u<a.length;u++){let f=parseInt(a[u],10);f>=t&&delete this._combined[f]}let l=Object.keys(this._extendedAttrs);for(let u=0;u<l.length;u++){let f=parseInt(l[u],10);f>=t&&delete this._extendedAttrs[f]}}return this.length=t,n*4*Km<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Km<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,s=!1){if(s){for(let n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,t);return}this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let s in t._combined)this._combined[s]=t._combined[s];this._extendedAttrs={};for(let s in t._extendedAttrs)this._extendedAttrs[s]=t._extendedAttrs[s];this.isWrapped=t.isWrapped}clone(){let t=new F2(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let s in this._combined)t._combined[s]=this._combined[s];for(let s in this._extendedAttrs)t._extendedAttrs[s]=this._extendedAttrs[s];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*ze+0]&4194303)return t+(this._data[t*ze+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*ze+0]&4194303||this._data[t*ze+2]&50331648)return t+(this._data[t*ze+0]>>22);return 0}copyCellsFrom(t,s,n,a,l){let u=t._data;if(l)for(let m=a-1;m>=0;m--){for(let d=0;d<ze;d++)this._data[(n+m)*ze+d]=u[(s+m)*ze+d];u[(s+m)*ze+2]&268435456&&(this._extendedAttrs[n+m]=t._extendedAttrs[s+m])}else for(let m=0;m<a;m++){for(let d=0;d<ze;d++)this._data[(n+m)*ze+d]=u[(s+m)*ze+d];u[(s+m)*ze+2]&268435456&&(this._extendedAttrs[n+m]=t._extendedAttrs[s+m])}let f=Object.keys(t._combined);for(let m=0;m<f.length;m++){let d=parseInt(f[m],10);d>=s&&(this._combined[d-s+n]=t._combined[d])}}translateToString(t,s,n,a){s=s??0,n=n??this.length,t&&(n=Math.min(n,this.getTrimmedLength())),a&&(a.length=0);let l="";for(;s<n;){let u=this._data[s*ze+0],f=u&2097151,m=u&2097152?this._combined[s]:f?Qr(f):Jr;if(l+=m,a)for(let d=0;d<m.length;++d)a.push(s);s+=u>>22||1}return a&&a.push(s),l}};function a6(e,t,s,n,a,l){let u=[];for(let f=0;f<e.length-1;f++){let m=f,d=e.get(++m);if(!d.isWrapped)continue;let _=[e.get(f)];for(;m<e.length&&d.isWrapped;)_.push(d),d=e.get(++m);if(!l&&n>=f&&n<m){f+=_.length-1;continue}let g=0,b=Vl(_,g,t),y=1,x=0;for(;y<_.length;){let E=Vl(_,y,t),k=E-x,T=s-b,D=Math.min(k,T);_[g].copyCellsFrom(_[y],x,b,D,!1),b+=D,b===s&&(g++,b=0),x+=D,x===E&&(y++,x=0),b===0&&g!==0&&_[g-1].getWidth(s-1)===2&&(_[g].copyCellsFrom(_[g-1],s-1,b++,1,!1),_[g-1].setCell(s-1,a))}_[g].replaceCells(b,s,a);let S=0;for(let E=_.length-1;E>0&&(E>g||_[E].getTrimmedLength()===0);E--)S++;S>0&&(u.push(f+_.length-S),u.push(S)),f+=_.length-1}return u}function o6(e,t){let s=[],n=0,a=t[n],l=0;for(let u=0;u<e.length;u++)if(a===u){let f=t[++n];e.onDeleteEmitter.fire({index:u-l,amount:f}),u+=f-1,l+=f,a=t[++n]}else s.push(u);return{layout:s,countRemoved:l}}function l6(e,t){let s=[];for(let n=0;n<t.length;n++)s.push(e.get(t[n]));for(let n=0;n<s.length;n++)e.set(n,s[n]);e.length=t.length}function c6(e,t,s){let n=[],a=e.map((m,d)=>Vl(e,d,t)).reduce((m,d)=>m+d),l=0,u=0,f=0;for(;f<a;){if(a-f<s){n.push(a-f);break}l+=s;let m=Vl(e,u,t);l>m&&(l-=m,u++);let d=e[u].getWidth(l-1)===2;d&&l--;let _=d?s-1:s;n.push(_),f+=_}return n}function Vl(e,t,s){if(t===e.length-1)return e[t].getTrimmedLength();let n=!e[t].hasContent(s-1)&&e[t].getWidth(s-1)===1,a=e[t+1].getWidth(0)===2;return n&&a?s-1:s}var V2=class W2{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=W2._nextId++,this._onDispose=this.register(new ue),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Wn(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};V2._nextId=1;var u6=V2,Bt={},zn=Bt.B;Bt[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:"≥","{":"π","|":"≠","}":"£","~":"·"};Bt.A={"#":"£"};Bt.B=void 0;Bt[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Bt.C=Bt[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Bt.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Bt.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Bt.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Bt.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Bt.E=Bt[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Bt.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Bt.H=Bt[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Bt["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var mS=4294967295,pS=class{constructor(e,t,s){this._hasScrollback=e,this._optionsService=t,this._bufferService=s,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=jt.clone(),this.savedCharset=zn,this.markers=[],this._nullCell=ns.fromCharData([0,l2,1,0]),this._whitespaceCell=ns.fromCharData([0,Jr,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new xh,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new fS(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new vh),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new vh),this._whitespaceCell}getBlankLine(e,t){return new Tl(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>mS?mS:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=jt);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new fS(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let s=this.getNullCell(jt),n=0,a=this._getCorrectBufferLength(t);if(a>this.lines.maxLength&&(this.lines.maxLength=a),this.lines.length>0){if(this._cols<e)for(let u=0;u<this.lines.length;u++)n+=+this.lines.get(u).resize(e,s);let l=0;if(this._rows<t)for(let u=this._rows;u<t;u++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new Tl(e,s)):this.ybase>0&&this.lines.length<=this.ybase+this.y+l+1?(this.ybase--,l++,this.ydisp>0&&this.ydisp--):this.lines.push(new Tl(e,s)));else for(let u=this._rows;u>t;u--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(a<this.lines.maxLength){let u=this.lines.length-a;u>0&&(this.lines.trimStart(u),this.ybase=Math.max(this.ybase-u,0),this.ydisp=Math.max(this.ydisp-u,0),this.savedY=Math.max(this.savedY-u,0)),this.lines.maxLength=a}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),l&&(this.y+=l),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let l=0;l<this.lines.length;l++)n+=+this.lines.get(l).resize(e,s);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),n>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let s=this._optionsService.rawOptions.reflowCursorLine,n=a6(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(jt),s);if(n.length>0){let a=o6(this.lines,n);l6(this.lines,a.layout),this._reflowLargerAdjustViewport(e,t,a.countRemoved)}}_reflowLargerAdjustViewport(e,t,s){let n=this.getNullCell(jt),a=s;for(;a-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Tl(e,n))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-s,0)}_reflowSmaller(e,t){let s=this._optionsService.rawOptions.reflowCursorLine,n=this.getNullCell(jt),a=[],l=0;for(let u=this.lines.length-1;u>=0;u--){let f=this.lines.get(u);if(!f||!f.isWrapped&&f.getTrimmedLength()<=e)continue;let m=[f];for(;f.isWrapped&&u>0;)f=this.lines.get(--u),m.unshift(f);if(!s){let D=this.ybase+this.y;if(D>=u&&D<u+m.length)continue}let d=m[m.length-1].getTrimmedLength(),_=c6(m,this._cols,e),g=_.length-m.length,b;this.ybase===0&&this.y!==this.lines.length-1?b=Math.max(0,this.y-this.lines.maxLength+g):b=Math.max(0,this.lines.length-this.lines.maxLength+g);let y=[];for(let D=0;D<g;D++){let R=this.getBlankLine(jt,!0);y.push(R)}y.length>0&&(a.push({start:u+m.length+l,newLines:y}),l+=y.length),m.push(...y);let x=_.length-1,S=_[x];S===0&&(x--,S=_[x]);let E=m.length-g-1,k=d;for(;E>=0;){let D=Math.min(k,S);if(m[x]===void 0)break;if(m[x].copyCellsFrom(m[E],k-D,S-D,D,!0),S-=D,S===0&&(x--,S=_[x]),k-=D,k===0){E--;let R=Math.max(E,0);k=Vl(m,R,this._cols)}}for(let D=0;D<m.length;D++)_[D]<e&&m[D].setCell(_[D],n);let T=g-b;for(;T-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+l)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+g,this.ybase+t-1)}if(a.length>0){let u=[],f=[];for(let S=0;S<this.lines.length;S++)f.push(this.lines.get(S));let m=this.lines.length,d=m-1,_=0,g=a[_];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+l);let b=0;for(let S=Math.min(this.lines.maxLength-1,m+l-1);S>=0;S--)if(g&&g.start>d+b){for(let E=g.newLines.length-1;E>=0;E--)this.lines.set(S--,g.newLines[E]);S++,u.push({index:d+1,amount:g.newLines.length}),b+=g.newLines.length,g=a[++_]}else this.lines.set(S,f[d--]);let y=0;for(let S=u.length-1;S>=0;S--)u[S].index+=y,this.lines.onInsertEmitter.fire(u[S]),y+=u[S].amount;let x=Math.max(0,m+l-this.lines.maxLength);x>0&&this.lines.onTrimEmitter.fire(x)}}translateBufferLineToString(e,t,s=0,n){let a=this.lines.get(e);return a?a.translateToString(t,s,n):""}getWrappedRangeForLine(e){let t=e,s=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;s+1<this.lines.length&&this.lines.get(s+1).isWrapped;)s++;return{first:t,last:s}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new u6(e);return this.markers.push(t),t.register(this.lines.onTrim(s=>{t.line-=s,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(s=>{t.line>=s.index&&(t.line+=s.amount)})),t.register(this.lines.onDelete(s=>{t.line>=s.index&&t.line<s.index+s.amount&&t.dispose(),t.line>s.index&&(t.line-=s.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},h6=class extends Be{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new ue),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 pS(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new pS(!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(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),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(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},K2=2,q2=1,mg=class extends Be{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new ue),this.onResize=this._onResize.event,this._onScroll=this._register(new ue),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,K2),this.rows=Math.max(e.rawOptions.rows||0,q2),this.buffers=this._register(new h6(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let s=this.cols!==e,n=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:s,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let s=this.buffer,n;n=this._cachedBlankLine,(!n||n.length!==this.cols||n.getFg(0)!==e.fg||n.getBg(0)!==e.bg)&&(n=s.getBlankLine(e,t),this._cachedBlankLine=n),n.isWrapped=t;let a=s.ybase+s.scrollTop,l=s.ybase+s.scrollBottom;if(s.scrollTop===0){let u=s.lines.isFull;l===s.lines.length-1?u?s.lines.recycle().copyFrom(n):s.lines.push(n.clone()):s.lines.splice(l+1,0,n.clone()),u?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{let u=l-a+1;s.lines.shiftElements(a+1,u-1,-1),s.lines.set(l,n.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(e,t){let s=this.buffer;if(e<0){if(s.ydisp===0)return;this.isUserScrolling=!0}else e+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);let n=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+e,s.ybase),0),n!==s.ydisp&&(t||this._onScroll.fire(s.ydisp))}};mg=yt([de(0,fi)],mg);var Wa={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:bh,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},d6=["normal","bold","100","200","300","400","500","600","700","800","900"],f6=class extends Be{constructor(e){super(),this._onOptionChange=this._register(new ue),this.onOptionChange=this._onOptionChange.event;let t={...Wa};for(let s in e)if(s in t)try{let n=e[s];t[s]=this._sanitizeAndValidateOption(s,n)}catch(n){console.error(n)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(ut(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(s=>{s===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(s=>{e.indexOf(s)!==-1&&t()})}_setupOptions(){let e=s=>{if(!(s in Wa))throw new Error(`No option with key "${s}"`);return this.rawOptions[s]},t=(s,n)=>{if(!(s in Wa))throw new Error(`No option with key "${s}"`);n=this._sanitizeAndValidateOption(s,n),this.rawOptions[s]!==n&&(this.rawOptions[s]=n,this._onOptionChange.fire(s))};for(let s in this.rawOptions){let n={get:e.bind(this,s),set:t.bind(this,s)};Object.defineProperty(this.options,s,n)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Wa[e]),!m6(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Wa[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=d6.includes(t)?t:Wa[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function m6(e){return e==="block"||e==="underline"||e==="bar"}function Rl(e,t=5){if(typeof e!="object")return e;let s=Array.isArray(e)?[]:{};for(let n in e)s[n]=t<=1?e[n]:e[n]&&Rl(e[n],t-1);return s}var gS=Object.freeze({insertMode:!1}),vS=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),pg=class extends Be{constructor(e,t,s){super(),this._bufferService=e,this._logService=t,this._optionsService=s,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new ue),this.onData=this._onData.event,this._onUserInput=this._register(new ue),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new ue),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new ue),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Rl(gS),this.decPrivateModes=Rl(vS)}reset(){this.modes=Rl(gS),this.decPrivateModes=Rl(vS)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let s=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&s.ybase!==s.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(n=>n.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};pg=yt([de(0,di),de(1,f2),de(2,fi)],pg);var _S={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function qm(e,t){let s=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(s|=64,s|=e.action):(s|=e.button&3,e.button&4&&(s|=64),e.button&8&&(s|=128),e.action===32?s|=32:e.action===0&&!t&&(s|=3)),s}var Ym=String.fromCharCode,yS={DEFAULT:e=>{let t=[qm(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Ym(t[0])}${Ym(t[1])}${Ym(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${qm(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${qm(e,!0)};${e.x};${e.y}${t}`}},gg=class extends Be{constructor(e,t,s){super(),this._bufferService=e,this._coreService=t,this._optionsService=s,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new ue),this.onProtocolChange=this._onProtocolChange.event;for(let n of Object.keys(_S))this.addProtocol(n,_S[n]);for(let n of Object.keys(yS))this.addEncoding(n,yS[n]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,s){if(e.deltaY===0||e.shiftKey||t===void 0||s===void 0)return 0;let n=t/s,a=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(a/=n+0,Math.abs(e.deltaY)<50&&(a*=.3),this._wheelPartialScroll+=a,a=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._bufferService.rows),a}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,s){if(s){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};gg=yt([de(0,di),de(1,Jn),de(2,fi)],gg);var Gm=[[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]],p6=[[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]],Ot;function g6(e,t){let s=0,n=t.length-1,a;if(e<t[0][0]||e>t[n][1])return!1;for(;n>=s;)if(a=s+n>>1,e>t[a][1])s=a+1;else if(e<t[a][0])n=a-1;else return!0;return!1}var v6=class{constructor(){if(this.version="6",!Ot){Ot=new Uint8Array(65536),Ot.fill(1),Ot[0]=0,Ot.fill(0,1,32),Ot.fill(0,127,160),Ot.fill(2,4352,4448),Ot[9001]=2,Ot[9002]=2,Ot.fill(2,11904,42192),Ot[12351]=1,Ot.fill(2,44032,55204),Ot.fill(2,63744,64256),Ot.fill(2,65040,65050),Ot.fill(2,65072,65136),Ot.fill(2,65280,65377),Ot.fill(2,65504,65511);for(let e=0;e<Gm.length;++e)Ot.fill(0,Gm[e][0],Gm[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Ot[e]:g6(e,p6)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let s=this.wcwidth(e),n=s===0&&t!==0;if(n){let a=Ln.extractWidth(t);a===0?n=!1:a>s&&(s=a)}return Ln.createPropertyValue(0,s,n)}},Ln=class nh{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new ue,this.onChange=this._onChange.event;let t=new v6;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,s,n=!1){return(t&16777215)<<3|(s&3)<<1|(n?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let s=0,n=0,a=t.length;for(let l=0;l<a;++l){let u=t.charCodeAt(l);if(55296<=u&&u<=56319){if(++l>=a)return s+this.wcwidth(u);let d=t.charCodeAt(l);56320<=d&&d<=57343?u=(u-55296)*1024+d-56320+65536:s+=this.wcwidth(d)}let f=this.charProperties(u,n),m=nh.extractWidth(f);nh.extractShouldJoin(f)&&(m-=nh.extractWidth(n)),s+=m,n=f}return s}charProperties(t,s){return this._activeProvider.charProperties(t,s)}},_6=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function bS(e){var n;let t=(n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:n.get(e.cols-1),s=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);s&&t&&(s.isWrapped=t[3]!==0&&t[3]!==32)}var xl=2147483647,y6=256,Y2=class vg{constructor(t=32,s=32){if(this.maxLength=t,this.maxSubParamsLength=s,s>y6)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(s),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let s=new vg;if(!t.length)return s;for(let n=Array.isArray(t[0])?1:0;n<t.length;++n){let a=t[n];if(Array.isArray(a))for(let l=0;l<a.length;++l)s.addSubParam(a[l]);else s.addParam(a)}return s}clone(){let t=new vg(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let s=0;s<this.length;++s){t.push(this.params[s]);let n=this._subParamsIdx[s]>>8,a=this._subParamsIdx[s]&255;a-n>0&&t.push(Array.prototype.slice.call(this._subParams,n,a))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>xl?xl:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>xl?xl:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let s=this._subParamsIdx[t]>>8,n=this._subParamsIdx[t]&255;return n-s>0?this._subParams.subarray(s,n):null}getSubParamsAll(){let t={};for(let s=0;s<this.length;++s){let n=this._subParamsIdx[s]>>8,a=this._subParamsIdx[s]&255;a-n>0&&(t[s]=this._subParams.slice(n,a))}return t}addDigit(t){let s;if(this._rejectDigits||!(s=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,a=n[s-1];n[s-1]=~a?Math.min(a*10+t,xl):t}},Sl=[],b6=class{constructor(){this._state=0,this._active=Sl,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let s=this._handlers[e];return s.push(t),{dispose:()=>{let n=s.indexOf(t);n!==-1&&s.splice(n,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Sl}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=Sl,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Sl,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,s){if(!this._active.length)this._handlerFb(this._id,"PUT",qh(e,t,s));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,s)}start(){this.reset(),this._state=1}put(e,t,s){if(this._state!==3){if(this._state===1)for(;t<s;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+n-48}this._state===2&&s-t>0&&this._put(e,t,s)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let s=!1,n=this._active.length-1,a=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,s=t,a=this._stack.fallThrough,this._stack.paused=!1),!a&&s===!1){for(;n>=0&&(s=this._active[n].end(e),s!==!0);n--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,s;n--}for(;n>=0;n--)if(s=this._active[n].end(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,s}this._active=Sl,this._id=-1,this._state=0}}},Oi=class{constructor(t){this._handler=t,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(t,s,n){this._hitLimit||(this._data+=qh(t,s,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(t){let s=!1;if(this._hitLimit)s=!1;else if(t&&(s=this._handler(this._data),s instanceof Promise))return s.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,s}},wl=[],x6=class{constructor(){this._handlers=Object.create(null),this._active=wl,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=wl}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let s=this._handlers[e];return s.push(t),{dispose:()=>{let n=s.indexOf(t);n!==-1&&s.splice(n,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=wl,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||wl,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let s=this._active.length-1;s>=0;s--)this._active[s].hook(t)}put(e,t,s){if(!this._active.length)this._handlerFb(this._ident,"PUT",qh(e,t,s));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,s)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let s=!1,n=this._active.length-1,a=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,s=t,a=this._stack.fallThrough,this._stack.paused=!1),!a&&s===!1){for(;n>=0&&(s=this._active[n].unhook(e),s!==!0);n--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,s;n--}for(;n>=0;n--)if(s=this._active[n].unhook(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,s}this._active=wl,this._ident=0}},Ml=new Y2;Ml.addParam(0);var xS=class{constructor(e){this._handler=e,this._data="",this._params=Ml,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():Ml,this._data="",this._hitLimit=!1}put(e,t,s){this._hitLimit||(this._data+=qh(e,t,s),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(s=>(this._params=Ml,this._data="",this._hitLimit=!1,s));return this._params=Ml,this._data="",this._hitLimit=!1,t}},S6=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,s,n){this.table[t<<8|e]=s<<4|n}addMany(e,t,s,n){for(let a=0;a<e.length;a++)this.table[t<<8|e[a]]=s<<4|n}},es=160,w6=(function(){let e=new S6(4095),t=Array.apply(null,Array(256)).map((f,m)=>m),s=(f,m)=>t.slice(f,m),n=s(32,127),a=s(0,24);a.push(25),a.push.apply(a,s(28,32));let l=s(0,14),u;e.setDefault(1,0),e.addMany(n,0,2,0);for(u in l)e.addMany([24,26,153,154],u,3,0),e.addMany(s(128,144),u,3,0),e.addMany(s(144,152),u,3,0),e.add(156,u,0,0),e.add(27,u,11,1),e.add(157,u,4,8),e.addMany([152,158,159],u,0,7),e.add(155,u,11,3),e.add(144,u,11,9);return e.addMany(a,0,3,0),e.addMany(a,1,3,1),e.add(127,1,0,1),e.addMany(a,8,0,8),e.addMany(a,3,3,3),e.add(127,3,0,3),e.addMany(a,4,3,4),e.add(127,4,0,4),e.addMany(a,6,3,6),e.addMany(a,5,3,5),e.add(127,5,0,5),e.addMany(a,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(n,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(s(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(n,7,0,7),e.addMany(a,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(s(64,127),3,7,0),e.addMany(s(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(s(48,60),4,8,4),e.addMany(s(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(s(32,64),6,0,6),e.add(127,6,0,6),e.addMany(s(64,127),6,0,0),e.addMany(s(32,48),3,9,5),e.addMany(s(32,48),5,9,5),e.addMany(s(48,64),5,0,6),e.addMany(s(64,127),5,7,0),e.addMany(s(32,48),4,9,5),e.addMany(s(32,48),1,9,2),e.addMany(s(32,48),2,9,2),e.addMany(s(48,127),2,10,0),e.addMany(s(48,80),1,10,0),e.addMany(s(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(s(96,127),1,10,0),e.add(80,1,11,9),e.addMany(a,9,0,9),e.add(127,9,0,9),e.addMany(s(28,32),9,0,9),e.addMany(s(32,48),9,9,12),e.addMany(s(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(a,11,0,11),e.addMany(s(32,128),11,0,11),e.addMany(s(28,32),11,0,11),e.addMany(a,10,0,10),e.add(127,10,0,10),e.addMany(s(28,32),10,0,10),e.addMany(s(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(s(32,48),10,9,12),e.addMany(a,12,0,12),e.add(127,12,0,12),e.addMany(s(28,32),12,0,12),e.addMany(s(32,48),12,9,12),e.addMany(s(48,64),12,0,11),e.addMany(s(64,127),12,12,13),e.addMany(s(64,127),10,12,13),e.addMany(s(64,127),9,12,13),e.addMany(a,13,13,13),e.addMany(n,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(es,0,2,0),e.add(es,8,5,8),e.add(es,6,0,6),e.add(es,11,0,11),e.add(es,13,13,13),e})(),C6=class extends Be{constructor(e=w6){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new Y2,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,s,n)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,s)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(ut(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new b6),this._dcsParser=this._register(new x6),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let s=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(s=e.prefix.charCodeAt(0),s&&60>s||s>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let a=0;a<e.intermediates.length;++a){let l=e.intermediates.charCodeAt(a);if(32>l||l>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=l}}if(e.final.length!==1)throw new Error("final must be a single byte");let n=e.final.charCodeAt(0);if(t[0]>n||n>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return s<<=8,s|=n,s}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let s=this._identifier(e,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);let n=this._escHandlers[s];return n.push(t),{dispose:()=>{let a=n.indexOf(t);a!==-1&&n.splice(a,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let s=this._identifier(e);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);let n=this._csiHandlers[s];return n.push(t),{dispose:()=>{let a=n.indexOf(t);a!==-1&&n.splice(a,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}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(e,t,s,n,a){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=s,this._parseStack.transition=n,this._parseStack.chunkPos=a}parse(e,t,s){let n=0,a=0,l=0,u;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,l=this._parseStack.chunkPos+1;else{if(s===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let f=this._parseStack.handlers,m=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(s===!1&&m>-1){for(;m>=0&&(u=f[m](this._params),u!==!0);m--)if(u instanceof Promise)return this._parseStack.handlerPos=m,u}this._parseStack.handlers=[];break;case 4:if(s===!1&&m>-1){for(;m>=0&&(u=f[m](),u!==!0);m--)if(u instanceof Promise)return this._parseStack.handlerPos=m,u}this._parseStack.handlers=[];break;case 6:if(n=e[this._parseStack.chunkPos],u=this._dcsParser.unhook(n!==24&&n!==26,s),u)return u;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(n=e[this._parseStack.chunkPos],u=this._oscParser.end(n!==24&&n!==26,s),u)return u;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,l=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let f=l;f<t;++f){switch(n=e[f],a=this._transitions.table[this.currentState<<8|(n<160?n:es)],a>>4){case 2:for(let b=f+1;;++b){if(b>=t||(n=e[b])<32||n>126&&n<es){this._printHandler(e,f,b),f=b-1;break}if(++b>=t||(n=e[b])<32||n>126&&n<es){this._printHandler(e,f,b),f=b-1;break}if(++b>=t||(n=e[b])<32||n>126&&n<es){this._printHandler(e,f,b),f=b-1;break}if(++b>=t||(n=e[b])<32||n>126&&n<es){this._printHandler(e,f,b),f=b-1;break}}break;case 3:this._executeHandlers[n]?this._executeHandlers[n]():this._executeHandlerFb(n),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:f,code:n,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let m=this._csiHandlers[this._collect<<8|n],d=m?m.length-1:-1;for(;d>=0&&(u=m[d](this._params),u!==!0);d--)if(u instanceof Promise)return this._preserveStack(3,m,d,a,f),u;d<0&&this._csiHandlerFb(this._collect<<8|n,this._params),this.precedingJoinState=0;break;case 8:do switch(n){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(n-48)}while(++f<t&&(n=e[f])>47&&n<60);f--;break;case 9:this._collect<<=8,this._collect|=n;break;case 10:let _=this._escHandlers[this._collect<<8|n],g=_?_.length-1:-1;for(;g>=0&&(u=_[g](),u!==!0);g--)if(u instanceof Promise)return this._preserveStack(4,_,g,a,f),u;g<0&&this._escHandlerFb(this._collect<<8|n),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|n,this._params);break;case 13:for(let b=f+1;;++b)if(b>=t||(n=e[b])===24||n===26||n===27||n>127&&n<es){this._dcsParser.put(e,f,b),f=b-1;break}break;case 14:if(u=this._dcsParser.unhook(n!==24&&n!==26),u)return this._preserveStack(6,[],0,a,f),u;n===27&&(a|=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=f+1;;b++)if(b>=t||(n=e[b])<32||n>127&&n<es){this._oscParser.put(e,f,b),f=b-1;break}break;case 6:if(u=this._oscParser.end(n!==24&&n!==26),u)return this._preserveStack(5,[],0,a,f),u;n===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=a&15}}},E6=/^([\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})$/,k6=/^[\da-f]+$/;function SS(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let s=E6.exec(t);if(s){let n=s[1]?15:s[4]?255:s[7]?4095:65535;return[Math.round(parseInt(s[1]||s[4]||s[7]||s[10],16)/n*255),Math.round(parseInt(s[2]||s[5]||s[8]||s[11],16)/n*255),Math.round(parseInt(s[3]||s[6]||s[9]||s[12],16)/n*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),k6.exec(t)&&[3,6,9,12].includes(t.length))){let s=t.length/3,n=[0,0,0];for(let a=0;a<3;++a){let l=parseInt(t.slice(s*a,s*a+s),16);n[a]=s===1?l<<4:s===2?l:s===3?l>>4:l>>8}return n}}function Xm(e,t){let s=e.toString(16),n=s.length<2?"0"+s:s;switch(t){case 4:return s[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}function N6(e,t=16){let[s,n,a]=e;return`rgb:${Xm(s,t)}/${Xm(n,t)}/${Xm(a,t)}`}var j6={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Xr=131072,wS=10;function CS(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var ES=5e3,kS=0,D6=class extends Be{constructor(e,t,s,n,a,l,u,f,m=new C6){super(),this._bufferService=e,this._charsetService=t,this._coreService=s,this._logService=n,this._optionsService=a,this._oscLinkService=l,this._coreMouseService=u,this._unicodeService=f,this._parser=m,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new Y4,this._utf8Decoder=new G4,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=jt.clone(),this._eraseAttrDataInternal=jt.clone(),this._onRequestBell=this._register(new ue),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new ue),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new ue),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new ue),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new ue),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new ue),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new ue),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new ue),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new ue),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new ue),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new ue),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new ue),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new ue),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 _g(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(d=>this._activeBuffer=d.activeBuffer)),this._parser.setCsiHandlerFallback((d,_)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(d),params:_.toArray()})}),this._parser.setEscHandlerFallback(d=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(d)})}),this._parser.setExecuteHandlerFallback(d=>{this._logService.debug("Unknown EXECUTE code: ",{code:d})}),this._parser.setOscHandlerFallback((d,_,g)=>{this._logService.debug("Unknown OSC code: ",{identifier:d,action:_,data:g})}),this._parser.setDcsHandlerFallback((d,_,g)=>{_==="HOOK"&&(g=g.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(d),action:_,payload:g})}),this._parser.setPrintHandler((d,_,g)=>this.print(d,_,g)),this._parser.registerCsiHandler({final:"@"},d=>this.insertChars(d)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},d=>this.scrollLeft(d)),this._parser.registerCsiHandler({final:"A"},d=>this.cursorUp(d)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},d=>this.scrollRight(d)),this._parser.registerCsiHandler({final:"B"},d=>this.cursorDown(d)),this._parser.registerCsiHandler({final:"C"},d=>this.cursorForward(d)),this._parser.registerCsiHandler({final:"D"},d=>this.cursorBackward(d)),this._parser.registerCsiHandler({final:"E"},d=>this.cursorNextLine(d)),this._parser.registerCsiHandler({final:"F"},d=>this.cursorPrecedingLine(d)),this._parser.registerCsiHandler({final:"G"},d=>this.cursorCharAbsolute(d)),this._parser.registerCsiHandler({final:"H"},d=>this.cursorPosition(d)),this._parser.registerCsiHandler({final:"I"},d=>this.cursorForwardTab(d)),this._parser.registerCsiHandler({final:"J"},d=>this.eraseInDisplay(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},d=>this.eraseInDisplay(d,!0)),this._parser.registerCsiHandler({final:"K"},d=>this.eraseInLine(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},d=>this.eraseInLine(d,!0)),this._parser.registerCsiHandler({final:"L"},d=>this.insertLines(d)),this._parser.registerCsiHandler({final:"M"},d=>this.deleteLines(d)),this._parser.registerCsiHandler({final:"P"},d=>this.deleteChars(d)),this._parser.registerCsiHandler({final:"S"},d=>this.scrollUp(d)),this._parser.registerCsiHandler({final:"T"},d=>this.scrollDown(d)),this._parser.registerCsiHandler({final:"X"},d=>this.eraseChars(d)),this._parser.registerCsiHandler({final:"Z"},d=>this.cursorBackwardTab(d)),this._parser.registerCsiHandler({final:"`"},d=>this.charPosAbsolute(d)),this._parser.registerCsiHandler({final:"a"},d=>this.hPositionRelative(d)),this._parser.registerCsiHandler({final:"b"},d=>this.repeatPrecedingCharacter(d)),this._parser.registerCsiHandler({final:"c"},d=>this.sendDeviceAttributesPrimary(d)),this._parser.registerCsiHandler({prefix:">",final:"c"},d=>this.sendDeviceAttributesSecondary(d)),this._parser.registerCsiHandler({final:"d"},d=>this.linePosAbsolute(d)),this._parser.registerCsiHandler({final:"e"},d=>this.vPositionRelative(d)),this._parser.registerCsiHandler({final:"f"},d=>this.hVPosition(d)),this._parser.registerCsiHandler({final:"g"},d=>this.tabClear(d)),this._parser.registerCsiHandler({final:"h"},d=>this.setMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"h"},d=>this.setModePrivate(d)),this._parser.registerCsiHandler({final:"l"},d=>this.resetMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"l"},d=>this.resetModePrivate(d)),this._parser.registerCsiHandler({final:"m"},d=>this.charAttributes(d)),this._parser.registerCsiHandler({final:"n"},d=>this.deviceStatus(d)),this._parser.registerCsiHandler({prefix:"?",final:"n"},d=>this.deviceStatusPrivate(d)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},d=>this.softReset(d)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},d=>this.setCursorStyle(d)),this._parser.registerCsiHandler({final:"r"},d=>this.setScrollRegion(d)),this._parser.registerCsiHandler({final:"s"},d=>this.saveCursor(d)),this._parser.registerCsiHandler({final:"t"},d=>this.windowOptions(d)),this._parser.registerCsiHandler({final:"u"},d=>this.restoreCursor(d)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},d=>this.insertColumns(d)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},d=>this.deleteColumns(d)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},d=>this.selectProtected(d)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},d=>this.requestMode(d,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},d=>this.requestMode(d,!1)),this._parser.setExecuteHandler(ne.BEL,()=>this.bell()),this._parser.setExecuteHandler(ne.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(ne.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(ne.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(ne.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(ne.BS,()=>this.backspace()),this._parser.setExecuteHandler(ne.HT,()=>this.tab()),this._parser.setExecuteHandler(ne.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(ne.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(sh.IND,()=>this.index()),this._parser.setExecuteHandler(sh.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(sh.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Oi(d=>(this.setTitle(d),this.setIconName(d),!0))),this._parser.registerOscHandler(1,new Oi(d=>this.setIconName(d))),this._parser.registerOscHandler(2,new Oi(d=>this.setTitle(d))),this._parser.registerOscHandler(4,new Oi(d=>this.setOrReportIndexedColor(d))),this._parser.registerOscHandler(8,new Oi(d=>this.setHyperlink(d))),this._parser.registerOscHandler(10,new Oi(d=>this.setOrReportFgColor(d))),this._parser.registerOscHandler(11,new Oi(d=>this.setOrReportBgColor(d))),this._parser.registerOscHandler(12,new Oi(d=>this.setOrReportCursorColor(d))),this._parser.registerOscHandler(104,new Oi(d=>this.restoreIndexedColor(d))),this._parser.registerOscHandler(110,new Oi(d=>this.restoreFgColor(d))),this._parser.registerOscHandler(111,new Oi(d=>this.restoreBgColor(d))),this._parser.registerOscHandler(112,new Oi(d=>this.restoreCursorColor(d))),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(let d in Bt)this._parser.registerEscHandler({intermediates:"(",final:d},()=>this.selectCharset("("+d)),this._parser.registerEscHandler({intermediates:")",final:d},()=>this.selectCharset(")"+d)),this._parser.registerEscHandler({intermediates:"*",final:d},()=>this.selectCharset("*"+d)),this._parser.registerEscHandler({intermediates:"+",final:d},()=>this.selectCharset("+"+d)),this._parser.registerEscHandler({intermediates:"-",final:d},()=>this.selectCharset("-"+d)),this._parser.registerEscHandler({intermediates:".",final:d},()=>this.selectCharset("."+d)),this._parser.registerEscHandler({intermediates:"/",final:d},()=>this.selectCharset("/"+d));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(d=>(this._logService.error("Parsing error: ",d),d)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new xS((d,_)=>this.requestStatusString(d,_)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,s,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=s,this._parseStack.position=n}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,s)=>setTimeout(()=>s("#SLOW_TIMEOUT"),ES))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${ES} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let s,n=this._activeBuffer.x,a=this._activeBuffer.y,l=0,u=this._parseStack.paused;if(u){if(s=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(s),s;n=this._parseStack.cursorStartX,a=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Xr&&(l=this._parseStack.position+Xr)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,d=>String.fromCharCode(d)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(d=>d.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Xr&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Xr))),u||this._dirtyRowTracker.clearRange(),e.length>Xr)for(let d=l;d<e.length;d+=Xr){let _=d+Xr<e.length?d+Xr:e.length,g=typeof e=="string"?this._stringDecoder.decode(e.substring(d,_),this._parseBuffer):this._utf8Decoder.decode(e.subarray(d,_),this._parseBuffer);if(s=this._parser.parse(this._parseBuffer,g))return this._preserveStack(n,a,g,d),this._logSlowResolvingAsync(s),s}else if(!u){let d=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(s=this._parser.parse(this._parseBuffer,d))return this._preserveStack(n,a,d,0),this._logSlowResolvingAsync(s),s}(this._activeBuffer.x!==n||this._activeBuffer.y!==a)&&this._onCursorMove.fire();let f=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),m=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);m<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(m,this._bufferService.rows-1),end:Math.min(f,this._bufferService.rows-1)})}print(e,t,s){let n,a,l=this._charsetService.charset,u=this._optionsService.rawOptions.screenReaderMode,f=this._bufferService.cols,m=this._coreService.decPrivateModes.wraparound,d=this._coreService.modes.insertMode,_=this._curAttrData,g=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&s-t>0&&g.getWidth(this._activeBuffer.x-1)===2&&g.setCellFromCodepoint(this._activeBuffer.x-1,0,1,_);let b=this._parser.precedingJoinState;for(let y=t;y<s;++y){if(n=e[y],n<127&&l){let k=l[String.fromCharCode(n)];k&&(n=k.charCodeAt(0))}let x=this._unicodeService.charProperties(n,b);a=Ln.extractWidth(x);let S=Ln.extractShouldJoin(x),E=S?Ln.extractWidth(b):0;if(b=x,u&&this._onA11yChar.fire(Qr(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+a-E>f){if(m){let k=g,T=this._activeBuffer.x-E;for(this._activeBuffer.x=E,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),g=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),E>0&&g instanceof Tl&&g.copyCellsFrom(k,T,0,E,!1);T<f;)k.setCellFromCodepoint(T++,0,1,_)}else if(this._activeBuffer.x=f-1,a===2)continue}if(S&&this._activeBuffer.x){let k=g.getWidth(this._activeBuffer.x-1)?1:2;g.addCodepointToCell(this._activeBuffer.x-k,n,a);for(let T=a-E;--T>=0;)g.setCellFromCodepoint(this._activeBuffer.x++,0,0,_);continue}if(d&&(g.insertCells(this._activeBuffer.x,a-E,this._activeBuffer.getNullCell(_)),g.getWidth(f-1)===2&&g.setCellFromCodepoint(f-1,0,1,_)),g.setCellFromCodepoint(this._activeBuffer.x++,n,a,_),a>0)for(;--a;)g.setCellFromCodepoint(this._activeBuffer.x++,0,0,_)}this._parser.precedingJoinState=b,this._activeBuffer.x<f&&s-t>0&&g.getWidth(this._activeBuffer.x)===0&&!g.hasContent(this._activeBuffer.x)&&g.setCellFromCodepoint(this._activeBuffer.x,0,1,_),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,s=>CS(s.params[0],this._optionsService.rawOptions.windowOptions)?t(s):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new xS(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Oi(t))}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(){var e;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&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,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(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,s,n=!1,a=!1){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);l.replaceCells(t,s,this._activeBuffer.getNullCell(this._eraseAttrData()),a),n&&(l.isWrapped=!1)}_resetBufferLine(e,t=!1){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);s&&(s.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),s.isWrapped=!1)}eraseInDisplay(e,t=!1){var n;this._restrictCursor(this._bufferService.cols);let s;switch(e.params[0]){case 0:for(s=this._activeBuffer.y,this._dirtyRowTracker.markDirty(s),this._eraseInBufferLine(s++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);s<this._bufferService.rows;s++)this._resetBufferLine(s,t);this._dirtyRowTracker.markDirty(s);break;case 1:for(s=this._activeBuffer.y,this._dirtyRowTracker.markDirty(s),this._eraseInBufferLine(s,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(s+1).isWrapped=!1);s--;)this._resetBufferLine(s,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(s=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,s-1);s--&&!((n=this._activeBuffer.lines.get(this._activeBuffer.ybase+s))!=null&&n.getTrimmedLength()););for(;s>=0;s--)this._bufferService.scroll(this._eraseAttrData())}else{for(s=this._bufferService.rows,this._dirtyRowTracker.markDirty(s-1);s--;)this._resetBufferLine(s,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let a=this._activeBuffer.lines.length-this._bufferService.rows;a>0&&(this._activeBuffer.lines.trimStart(a),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-a,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-a,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let s=this._activeBuffer.ybase+this._activeBuffer.y,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,a=this._bufferService.rows-1+this._activeBuffer.ybase-n+1;for(;t--;)this._activeBuffer.lines.splice(a-1,1),this._activeBuffer.lines.splice(s,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let s=this._activeBuffer.ybase+this._activeBuffer.y,n;for(n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,n=this._bufferService.rows-1+this._activeBuffer.ybase-n;t--;)this._activeBuffer.lines.splice(s,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}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)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(e){let t=e.params[0]||1;for(;t--;)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(jt));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let s=e.params[0]||1,n=Ln.extractWidth(t),a=this._activeBuffer.x-n,l=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(a),u=new Uint32Array(l.length*s),f=0;for(let d=0;d<l.length;){let _=l.codePointAt(d)||0;u[f++]=_,d+=_>65535?2:1}let m=f;for(let d=1;d<s;++d)u.copyWithin(m,0,f),m+=f;return this.print(u,0,m),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(ne.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(ne.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(ne.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(ne.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(ne.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,zn),this._charsetService.setgCharset(1,zn),this._charsetService.setgCharset(2,zn),this._charsetService.setgCharset(3,zn);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(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){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:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){(S=>(S[S.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",S[S.SET=1]="SET",S[S.RESET=2]="RESET",S[S.PERMANENTLY_SET=3]="PERMANENTLY_SET",S[S.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(s={}));let n=this._coreService.decPrivateModes,{activeProtocol:a,activeEncoding:l}=this._coreMouseService,u=this._coreService,{buffers:f,cols:m}=this._bufferService,{active:d,alt:_}=f,g=this._optionsService.rawOptions,b=(S,E)=>(u.triggerDataEvent(`${ne.ESC}[${t?"":"?"}${S};${E}$y`),!0),y=S=>S?1:2,x=e.params[0];return t?x===2?b(x,4):x===4?b(x,y(u.modes.insertMode)):x===12?b(x,3):x===20?b(x,y(g.convertEol)):b(x,0):x===1?b(x,y(n.applicationCursorKeys)):x===3?b(x,g.windowOptions.setWinLines?m===80?2:m===132?1:0:0):x===6?b(x,y(n.origin)):x===7?b(x,y(n.wraparound)):x===8?b(x,3):x===9?b(x,y(a==="X10")):x===12?b(x,y(g.cursorBlink)):x===25?b(x,y(!u.isCursorHidden)):x===45?b(x,y(n.reverseWraparound)):x===66?b(x,y(n.applicationKeypad)):x===67?b(x,4):x===1e3?b(x,y(a==="VT200")):x===1002?b(x,y(a==="DRAG")):x===1003?b(x,y(a==="ANY")):x===1004?b(x,y(n.sendFocus)):x===1005?b(x,4):x===1006?b(x,y(l==="SGR")):x===1015?b(x,4):x===1016?b(x,y(l==="SGR_PIXELS")):x===1048?b(x,1):x===47||x===1047||x===1049?b(x,y(d===_)):x===2004?b(x,y(n.bracketedPasteMode)):x===2026?b(x,y(n.synchronizedOutput)):b(x,0)}_updateAttrColor(e,t,s,n,a){return t===2?(e|=50331648,e&=-16777216,e|=sc.fromColorRGB([s,n,a])):t===5&&(e&=-50331904,e|=33554432|s&255),e}_extractColor(e,t,s){let n=[0,0,-1,0,0,0],a=0,l=0;do{if(n[l+a]=e.params[t+l],e.hasSubParams(t+l)){let u=e.getSubParams(t+l),f=0;do n[1]===5&&(a=1),n[l+f+1+a]=u[f];while(++f<u.length&&f+l+1+a<n.length);break}if(n[1]===5&&l+a>=2||n[1]===2&&l+a>=5)break;n[1]&&(a=1)}while(++l+t<e.length&&l+a<n.length);for(let u=2;u<n.length;++u)n[u]===-1&&(n[u]=0);switch(n[0]){case 38:s.fg=this._updateAttrColor(s.fg,n[1],n[3],n[4],n[5]);break;case 48:s.bg=this._updateAttrColor(s.bg,n[1],n[3],n[4],n[5]);break;case 58:s.extended=s.extended.clone(),s.extended.underlineColor=this._updateAttrColor(s.extended.underlineColor,n[1],n[3],n[4],n[5])}return l}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=jt.fg,e.bg=jt.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,s,n=this._curAttrData;for(let a=0;a<t;a++)s=e.params[a],s>=30&&s<=37?(n.fg&=-50331904,n.fg|=16777216|s-30):s>=40&&s<=47?(n.bg&=-50331904,n.bg|=16777216|s-40):s>=90&&s<=97?(n.fg&=-50331904,n.fg|=16777216|s-90|8):s>=100&&s<=107?(n.bg&=-50331904,n.bg|=16777216|s-100|8):s===0?this._processSGR0(n):s===1?n.fg|=134217728:s===3?n.bg|=67108864:s===4?(n.fg|=268435456,this._processUnderline(e.hasSubParams(a)?e.getSubParams(a)[0]:1,n)):s===5?n.fg|=536870912:s===7?n.fg|=67108864:s===8?n.fg|=1073741824:s===9?n.fg|=2147483648:s===2?n.bg|=134217728:s===21?this._processUnderline(2,n):s===22?(n.fg&=-134217729,n.bg&=-134217729):s===23?n.bg&=-67108865:s===24?(n.fg&=-268435457,this._processUnderline(0,n)):s===25?n.fg&=-536870913:s===27?n.fg&=-67108865:s===28?n.fg&=-1073741825:s===29?n.fg&=2147483647:s===39?(n.fg&=-67108864,n.fg|=jt.fg&16777215):s===49?(n.bg&=-67108864,n.bg|=jt.bg&16777215):s===38||s===48||s===58?a+=this._extractColor(e,a,n):s===53?n.bg|=1073741824:s===55?n.bg&=-1073741825:s===59?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):s===100?(n.fg&=-67108864,n.fg|=jt.fg&16777215,n.bg&=-67108864,n.bg|=jt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",s);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${ne.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,s=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ne.ESC}[${t};${s}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,s=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ne.ESC}[?${t};${s}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=jt.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(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let s=t%2===1;this._coreService.decPrivateModes.cursorBlink=s}return!0}setScrollRegion(e){let t=e.params[0]||1,s;return(e.length<2||(s=e.params[1])>this._bufferService.rows||s===0)&&(s=this._bufferService.rows),s>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=s-1,this._setCursor(0,0)),!0}windowOptions(e){if(!CS(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${ne.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>wS&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>wS&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){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(e){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(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],s=e.split(";");for(;s.length>1;){let n=s.shift(),a=s.shift();if(/^\d+$/.exec(n)){let l=parseInt(n);if(NS(l))if(a==="?")t.push({type:0,index:l});else{let u=SS(a);u&&t.push({type:1,index:l,color:u})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let s=e.slice(0,t).trim(),n=e.slice(t+1);return n?this._createHyperlink(s,n):s.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let s=e.split(":"),n,a=s.findIndex(l=>l.startsWith("id="));return a!==-1&&(n=s[a].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let s=e.split(";");for(let n=0;n<s.length&&!(t>=this._specialColors.length);++n,++t)if(s[n]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let a=SS(s[n]);a&&this._onColor.fire([{type:1,index:this._specialColors[t],color:a}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],s=e.split(";");for(let n=0;n<s.length;++n)if(/^\d+$/.exec(s[n])){let a=parseInt(s[n]);NS(a)&&t.push({type:2,index:a})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){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,zn),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(j6[e[0]],Bt[e[1]]||zn),!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){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,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=jt.clone(),this._eraseAttrDataInternal=jt.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new ns;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let s=this._activeBuffer.ybase+this._activeBuffer.y+t,n=this._activeBuffer.lines.get(s);n&&(n.fill(e),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let s=u=>(this._coreService.triggerDataEvent(`${ne.ESC}${u}${ne.ESC}\\`),!0),n=this._bufferService.buffer,a=this._optionsService.rawOptions;return s(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[a.cursorStyle]-(a.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},_g=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(kS=e,e=t,t=kS),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};_g=yt([de(0,di)],_g);function NS(e){return 0<=e&&e<256}var T6=5e7,jS=12,R6=50,M6=class extends Be{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new ue),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let s;for(;s=this._writeBuffer.shift();){this._action(s);let n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>T6)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let s=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let n=this._writeBuffer[this._bufferOffset],a=this._action(n,t);if(a){let u=f=>performance.now()-s>=jS?setTimeout(()=>this._innerWrite(0,f)):this._innerWrite(s,f);a.catch(f=>(queueMicrotask(()=>{throw f}),Promise.resolve(!1))).then(u);return}let l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=n.length,performance.now()-s>=jS)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>R6&&(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()}},yg=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let f=t.addMarker(t.ybase+t.y),m={data:e,id:this._nextId++,lines:[f]};return f.onDispose(()=>this._removeMarkerFromLink(m,f)),this._dataByLinkId.set(m.id,m),m.id}let s=e,n=this._getEntryIdKey(s),a=this._entriesWithId.get(n);if(a)return this.addLineToLink(a.id,t.ybase+t.y),a.id;let l=t.addMarker(t.ybase+t.y),u={id:this._nextId++,key:this._getEntryIdKey(s),data:s,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(u,l)),this._entriesWithId.set(u.key,u),this._dataByLinkId.set(u.id,u),u.id}addLineToLink(e,t){let s=this._dataByLinkId.get(e);if(s&&s.lines.every(n=>n.line!==t)){let n=this._bufferService.buffer.addMarker(t);s.lines.push(n),n.onDispose(()=>this._removeMarkerFromLink(s,n))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let s=e.lines.indexOf(t);s!==-1&&(e.lines.splice(s,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};yg=yt([de(0,di)],yg);var DS=!1,A6=class extends Be{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new lo),this._onBinary=this._register(new ue),this.onBinary=this._onBinary.event,this._onData=this._register(new ue),this.onData=this._onData.event,this._onLineFeed=this._register(new ue),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new ue),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new ue),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new ue),this._instantiationService=new s6,this.optionsService=this._register(new f6(e)),this._instantiationService.setService(fi,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(mg)),this._instantiationService.setService(di,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(fg)),this._instantiationService.setService(f2,this._logService),this.coreService=this._register(this._instantiationService.createInstance(pg)),this._instantiationService.setService(Jn,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(gg)),this._instantiationService.setService(d2,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Ln)),this._instantiationService.setService(J4,this.unicodeService),this._charsetService=this._instantiationService.createInstance(_6),this._instantiationService.setService(Q4,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(yg),this._instantiationService.setService(m2,this._oscLinkService),this._inputHandler=this._register(new D6(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(ii.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(ii.forward(this._bufferService.onResize,this._onResize)),this._register(ii.forward(this.coreService.onData,this._onData)),this._register(ii.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new M6((t,s)=>this._inputHandler.parse(t,s))),this._register(ii.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new ue),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.fire(e.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(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!DS&&(this._logService.warn("writeSync is unreliable and will be removed soon."),DS=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,K2),t=Math.max(t,q2),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(bS.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(bS(this._bufferService),!1))),this._windowsWrappingHeuristics.value=ut(()=>{for(let t of e)t.dispose()})}}},O6={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:["'",'"']};function z6(e,t,s,n){var u;let a={type:0,cancel:!1,key:void 0},l=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?a.key=ne.ESC+"OA":a.key=ne.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?a.key=ne.ESC+"OD":a.key=ne.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?a.key=ne.ESC+"OC":a.key=ne.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?a.key=ne.ESC+"OB":a.key=ne.ESC+"[B");break;case 8:a.key=e.ctrlKey?"\b":ne.DEL,e.altKey&&(a.key=ne.ESC+a.key);break;case 9:if(e.shiftKey){a.key=ne.ESC+"[Z";break}a.key=ne.HT,a.cancel=!0;break;case 13:a.key=e.altKey?ne.ESC+ne.CR:ne.CR,a.cancel=!0;break;case 27:a.key=ne.ESC,e.altKey&&(a.key=ne.ESC+ne.ESC),a.cancel=!0;break;case 37:if(e.metaKey)break;l?a.key=ne.ESC+"[1;"+(l+1)+"D":t?a.key=ne.ESC+"OD":a.key=ne.ESC+"[D";break;case 39:if(e.metaKey)break;l?a.key=ne.ESC+"[1;"+(l+1)+"C":t?a.key=ne.ESC+"OC":a.key=ne.ESC+"[C";break;case 38:if(e.metaKey)break;l?a.key=ne.ESC+"[1;"+(l+1)+"A":t?a.key=ne.ESC+"OA":a.key=ne.ESC+"[A";break;case 40:if(e.metaKey)break;l?a.key=ne.ESC+"[1;"+(l+1)+"B":t?a.key=ne.ESC+"OB":a.key=ne.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(a.key=ne.ESC+"[2~");break;case 46:l?a.key=ne.ESC+"[3;"+(l+1)+"~":a.key=ne.ESC+"[3~";break;case 36:l?a.key=ne.ESC+"[1;"+(l+1)+"H":t?a.key=ne.ESC+"OH":a.key=ne.ESC+"[H";break;case 35:l?a.key=ne.ESC+"[1;"+(l+1)+"F":t?a.key=ne.ESC+"OF":a.key=ne.ESC+"[F";break;case 33:e.shiftKey?a.type=2:e.ctrlKey?a.key=ne.ESC+"[5;"+(l+1)+"~":a.key=ne.ESC+"[5~";break;case 34:e.shiftKey?a.type=3:e.ctrlKey?a.key=ne.ESC+"[6;"+(l+1)+"~":a.key=ne.ESC+"[6~";break;case 112:l?a.key=ne.ESC+"[1;"+(l+1)+"P":a.key=ne.ESC+"OP";break;case 113:l?a.key=ne.ESC+"[1;"+(l+1)+"Q":a.key=ne.ESC+"OQ";break;case 114:l?a.key=ne.ESC+"[1;"+(l+1)+"R":a.key=ne.ESC+"OR";break;case 115:l?a.key=ne.ESC+"[1;"+(l+1)+"S":a.key=ne.ESC+"OS";break;case 116:l?a.key=ne.ESC+"[15;"+(l+1)+"~":a.key=ne.ESC+"[15~";break;case 117:l?a.key=ne.ESC+"[17;"+(l+1)+"~":a.key=ne.ESC+"[17~";break;case 118:l?a.key=ne.ESC+"[18;"+(l+1)+"~":a.key=ne.ESC+"[18~";break;case 119:l?a.key=ne.ESC+"[19;"+(l+1)+"~":a.key=ne.ESC+"[19~";break;case 120:l?a.key=ne.ESC+"[20;"+(l+1)+"~":a.key=ne.ESC+"[20~";break;case 121:l?a.key=ne.ESC+"[21;"+(l+1)+"~":a.key=ne.ESC+"[21~";break;case 122:l?a.key=ne.ESC+"[23;"+(l+1)+"~":a.key=ne.ESC+"[23~";break;case 123:l?a.key=ne.ESC+"[24;"+(l+1)+"~":a.key=ne.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?a.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?a.key=ne.NUL:e.keyCode>=51&&e.keyCode<=55?a.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?a.key=ne.DEL:e.keyCode===219?a.key=ne.ESC:e.keyCode===220?a.key=ne.FS:e.keyCode===221&&(a.key=ne.GS);else if((!s||n)&&e.altKey&&!e.metaKey){let f=(u=O6[e.keyCode])==null?void 0:u[e.shiftKey?1:0];if(f)a.key=ne.ESC+f;else if(e.keyCode>=65&&e.keyCode<=90){let m=e.ctrlKey?e.keyCode-64:e.keyCode+32,d=String.fromCharCode(m);e.shiftKey&&(d=d.toUpperCase()),a.key=ne.ESC+d}else if(e.keyCode===32)a.key=ne.ESC+(e.ctrlKey?ne.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let m=e.code.slice(3,4);e.shiftKey||(m=m.toLowerCase()),a.key=ne.ESC+m,a.cancel=!0}}else s&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(a.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?a.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(a.key=ne.US),e.key==="@"&&(a.key=ne.NUL));break}return a}var St=0,L6=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new xh,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new xh,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((a,l)=>this._getKey(a)-this._getKey(l)),t=0,s=0,n=new Array(this._array.length+this._insertedValues.length);for(let a=0;a<n.length;a++)s>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[s])?(n[a]=e[t],t++):n[a]=this._array[s++];this._array=n,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(St=this._search(t),St===-1)||this._getKey(this._array[St])!==t)return!1;do if(this._array[St]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(St),!0;while(++St<this._array.length&&this._getKey(this._array[St])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((a,l)=>a-l),t=0,s=new Array(this._array.length-e.length),n=0;for(let a=0;a<this._array.length;a++)e[t]===a?t++:s[n++]=this._array[a];this._array=s,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(St=this._search(e),!(St<0||St>=this._array.length)&&this._getKey(this._array[St])===e))do yield this._array[St];while(++St<this._array.length&&this._getKey(this._array[St])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(St=this._search(e),!(St<0||St>=this._array.length)&&this._getKey(this._array[St])===e))do t(this._array[St]);while(++St<this._array.length&&this._getKey(this._array[St])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,s=this._array.length-1;for(;s>=t;){let n=t+s>>1,a=this._getKey(this._array[n]);if(a>e)s=n-1;else if(a<e)t=n+1;else{for(;n>0&&this._getKey(this._array[n-1])===e;)n--;return n}}return t}},Zm=0,TS=0,B6=class extends Be{constructor(){super(),this._decorations=new L6(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new ue),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new ue),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(ut(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new P6(e);if(t){let s=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),s.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,s){let n=0,a=0;for(let l of this._decorations.getKeyIterator(t))n=l.options.x??0,a=n+(l.options.width??1),e>=n&&e<a&&(!s||(l.options.layer??"bottom")===s)&&(yield l)}forEachDecorationAtCell(e,t,s,n){this._decorations.forEachByKey(t,a=>{Zm=a.options.x??0,TS=Zm+(a.options.width??1),e>=Zm&&e<TS&&(!s||(a.options.layer??"bottom")===s)&&n(a)})}},P6=class extends tn{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new ue),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new ue),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=ft.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=ft.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},H6=1e3,I6=class{constructor(e,t=H6){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,s){this._rowCount=s,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let n=performance.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){let a=n-this._lastRefreshMs,l=this._debounceThresholdMS-a;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},l)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},RS=20,Sh=class extends Be{constructor(e,t,s,n){super(),this._terminal=e,this._coreBrowserService=s,this._renderService=n,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let a=this._coreBrowserService.mainDocument;this._accessibilityContainer=a.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=a.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._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=a.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new I6(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(`
473
+ `))),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(ke(a,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(ut(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<RS+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
474
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===RS+1&&(this._liveRegion.textContent+=Hp.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let s=this._terminal.buffer,n=s.lines.length.toString();for(let a=e;a<=t;a++){let l=s.lines.get(s.ydisp+a),u=[],f=(l==null?void 0:l.translateToString(!0,void 0,void 0,u))||"",m=(s.ydisp+a+1).toString(),d=this._rowElements[a];d&&(f.length===0?(d.textContent=" ",this._rowColumns.set(d,[0,1])):(d.textContent=f,this._rowColumns.set(d,u)),d.setAttribute("aria-posinset",m),d.setAttribute("aria-setsize",n),this._alignRowWidth(d))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let s=e.target,n=this._rowElements[t===0?1:this._rowElements.length-2],a=s.getAttribute("aria-posinset"),l=t===0?"1":`${this._terminal.buffer.lines.length}`;if(a===l||e.relatedTarget!==n)return;let u,f;if(t===0?(u=s,f=this._rowElements.pop(),this._rowContainer.removeChild(f)):(u=this._rowElements.shift(),f=s,this._rowContainer.removeChild(u)),u.removeEventListener("focus",this._topBoundaryFocusListener),f.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let m=this._createAccessibilityTreeNode();this._rowElements.unshift(m),this._rowContainer.insertAdjacentElement("afterbegin",m)}else{let m=this._createAccessibilityTreeNode();this._rowElements.push(m),this._rowContainer.appendChild(m)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var f;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},s={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(s.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===s.node&&t.offset>s.offset)&&([t,s]=[s,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let n=this._rowElements.slice(-1)[0];if(s.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(s={node:n,offset:((f=n.textContent)==null?void 0:f.length)??0}),!this._rowContainer.contains(s.node))return;let a=({node:m,offset:d})=>{let _=m instanceof Text?m.parentNode:m,g=parseInt(_==null?void 0:_.getAttribute("aria-posinset"),10)-1;if(isNaN(g))return console.warn("row is invalid. Race condition?"),null;let b=this._rowColumns.get(_);if(!b)return console.warn("columns is null. Race condition?"),null;let y=d<b.length?b[d]:b.slice(-1)[0]+1;return y>=this._terminal.cols&&(++g,y=0),{row:g,column:y}},l=a(t),u=a(s);if(!(!l||!u)){if(l.row>u.row||l.row===u.row&&l.column>=u.column)throw new Error("invalid range");this._terminal.select(l.column,l.row,(u.row-l.row)*this._terminal.cols-l.column+u.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var a,l;e.style.transform="";let t=e.getBoundingClientRect().width,s=(l=(a=this._rowColumns.get(e))==null?void 0:a.slice(-1))==null?void 0:l[0];if(!s)return;let n=s*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${n/t})`}};Sh=yt([de(1,av),de(2,_r),de(3,yr)],Sh);var bg=class extends Be{constructor(e,t,s,n,a){super(),this._element=e,this._mouseService=t,this._renderService=s,this._bufferService=n,this._linkProviderService=a,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new ue),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new ue),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(ut(()=>{var l;Wn(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(l=this._activeProviderReplies)==null||l.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(ke(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(ke(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(ke(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(ke(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let s=e.composedPath();for(let n=0;n<s.length;n++){let a=s[n];if(a.classList.contains("xterm"))break;if(a.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var n,a;(!this._activeProviderReplies||!t)&&((n=this._activeProviderReplies)==null||n.forEach(l=>{l==null||l.forEach(u=>{u.link.dispose&&u.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let s=!1;for(let[l,u]of this._linkProviderService.linkProviders.entries())t?(a=this._activeProviderReplies)!=null&&a.get(l)&&(s=this._checkLinkProviderResult(l,e,s)):u.provideLinks(e.y,f=>{var d,_;if(this._isMouseOut)return;let m=f==null?void 0:f.map(g=>({link:g}));(d=this._activeProviderReplies)==null||d.set(l,m),s=this._checkLinkProviderResult(l,e,s),((_=this._activeProviderReplies)==null?void 0:_.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let s=new Set;for(let n=0;n<t.size;n++){let a=t.get(n);if(a)for(let l=0;l<a.length;l++){let u=a[l],f=u.link.range.start.y<e?0:u.link.range.start.x,m=u.link.range.end.y>e?this._bufferService.cols:u.link.range.end.x;for(let d=f;d<=m;d++){if(s.has(d)){a.splice(l--,1);break}s.add(d)}}}}_checkLinkProviderResult(e,t,s){var l;if(!this._activeProviderReplies)return s;let n=this._activeProviderReplies.get(e),a=!1;for(let u=0;u<e;u++)(!this._activeProviderReplies.has(u)||this._activeProviderReplies.get(u))&&(a=!0);if(!a&&n){let u=n.find(f=>this._linkAtPosition(f.link,t));u&&(s=!0,this._handleNewLink(u))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!s)for(let u=0;u<this._activeProviderReplies.size;u++){let f=(l=this._activeProviderReplies.get(u))==null?void 0:l.find(m=>this._linkAtPosition(m.link,t));if(f){s=!0,this._handleNewLink(f);break}}return s}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&$6(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Wn(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var s,n;return(n=(s=this._currentLink)==null?void 0:s.state)==null?void 0:n.decorations.pointerCursor},set:s=>{var n;(n=this._currentLink)!=null&&n.state&&this._currentLink.state.decorations.pointerCursor!==s&&(this._currentLink.state.decorations.pointerCursor=s,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",s))}},underline:{get:()=>{var s,n;return(n=(s=this._currentLink)==null?void 0:s.state)==null?void 0:n.decorations.underline},set:s=>{var n,a,l;(n=this._currentLink)!=null&&n.state&&((l=(a=this._currentLink)==null?void 0:a.state)==null?void 0:l.decorations.underline)!==s&&(this._currentLink.state.decorations.underline=s,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,s))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(s=>{if(!this._currentLink)return;let n=s.start===0?0:s.start+1+this._bufferService.buffer.ydisp,a=this._bufferService.buffer.ydisp+1+s.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=a&&(this._clearCurrentLink(n,a),this._lastMouseEvent)){let l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._askForLink(l,!1)}})))}_linkHover(e,t,s){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(s,t.text)}_fireUnderlineEvent(e,t){let s=e.range,n=this._bufferService.buffer.ydisp,a=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-n-1,s.end.x,s.end.y-n-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(a)}_linkLeave(e,t,s){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(s,t.text)}_linkAtPosition(e,t){let s=e.range.start.y*this._bufferService.cols+e.range.start.x,n=e.range.end.y*this._bufferService.cols+e.range.end.x,a=t.y*this._bufferService.cols+t.x;return s<=a&&a<=n}_positionFromMouseEvent(e,t,s){let n=s.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,s,n,a){return{x1:e,y1:t,x2:s,y2:n,cols:this._bufferService.cols,fg:a}}};bg=yt([de(1,ov),de(2,yr),de(3,di),de(4,g2)],bg);function $6(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var U6=class extends A6{constructor(e={}){super(e),this._linkifier=this._register(new lo),this.browser=z2,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new lo),this._onCursorMove=this._register(new ue),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new ue),this.onKey=this._onKey.event,this._onRender=this._register(new ue),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new ue),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new ue),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new ue),this.onBell=this._onBell.event,this._onFocus=this._register(new ue),this._onBlur=this._register(new ue),this._onA11yCharEmitter=this._register(new ue),this._onA11yTabEmitter=this._register(new ue),this._onWillOpen=this._register(new ue),this._setup(),this._decorationService=this._instantiationService.createInstance(B6),this._instantiationService.setService(rc,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(RL),this._instantiationService.setService(g2,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance($p)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(ii.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(ii.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(ii.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(ii.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(ut(()=>{var t,s;this._customKeyEventHandler=void 0,(s=(t=this.element)==null?void 0:t.parentNode)==null||s.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}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}_handleColorEvent(e){if(this._themeService)for(let t of e){let s,n="";switch(t.index){case 256:s="foreground",n="10";break;case 257:s="background",n="11";break;case 258:s="cursor",n="12";break;default:s="ansi",n="4;"+t.index}switch(t.type){case 0:let a=ot.toColorRGB(s==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[s]);this.coreService.triggerDataEvent(`${ne.ESC}]${n};${N6(a)}${A2.ST}`);break;case 1:if(s==="ansi")this._themeService.modifyColors(l=>l.ansi[t.index]=Dt.toColor(...t.color));else{let l=s;this._themeService.modifyColors(u=>u[l]=Dt.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Sh,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ne.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ne.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let s=Math.min(this.buffer.x,this.cols-1),n=this._renderService.dimensions.css.cell.height,a=t.getWidth(s),l=this._renderService.dimensions.css.cell.width*a,u=this.buffer.y*this._renderService.dimensions.css.cell.height,f=s*this._renderService.dimensions.css.cell.width;this.textarea.style.left=f+"px",this.textarea.style.top=u+"px",this.textarea.style.width=l+"px",this.textarea.style.height=n+"px",this.textarea.style.lineHeight=n+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(ke(this.element,"copy",t=>{this.hasSelection()&&K4(t,this._selectionService)}));let e=t=>q4(t,this.textarea,this.coreService,this.optionsService);this._register(ke(this.textarea,"paste",e)),this._register(ke(this.element,"paste",e)),L2?this._register(ke(this.element,"mousedown",t=>{t.button===2&&$x(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(ke(this.element,"contextmenu",t=>{$x(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),pv&&this._register(ke(this.element,"auxclick",t=>{t.button===1&&o2(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(ke(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(ke(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(ke(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(ke(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(ke(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(ke(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(ke(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var a;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((a=this.element)==null?void 0:a.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.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"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(ke(this.screenElement,"mousemove",l=>this.updateCursorStyle(l))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let s=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Pp.get()),H2||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._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>s.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(DL,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(_r,this._coreBrowserService),this._register(ke(this.textarea,"focus",l=>this._handleTextAreaFocus(l))),this._register(ke(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(lg,this._document,this._helperContainer),this._instantiationService.setService(Yh,this._charSizeService),this._themeService=this._instantiationService.createInstance(dg),this._instantiationService.setService(yo,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(yh),this._instantiationService.setService(p2,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(ug,this.rows,this.screenElement)),this._instantiationService.setService(yr,this._renderService),this._register(this._renderService.onRenderedViewportChange(l=>this._onRender.fire(l))),this.onResize(l=>this._renderService.resize(l.cols,l.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(ng,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(cg),this._instantiationService.setService(ov,this._mouseService);let n=this._linkifier.value=this._register(this._instantiationService.createInstance(bg,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),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._viewport=this._register(this._instantiationService.createInstance(sg,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(l=>{super.scrollLines(l,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(hg,this.element,this.screenElement,n)),this._instantiationService.setService(tz,this._selectionService),this._register(this._selectionService.onRequestScrollLines(l=>this.scrollLines(l.amount,l.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(l=>this._renderService.handleSelectionChanged(l.start,l.end,l.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(l=>{this.textarea.value=l,this.textarea.focus(),this.textarea.select()})),this._register(ii.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var l;this._selectionService.refresh(),(l=this._viewport)==null||l.queueSync()})),this._register(this._instantiationService.createInstance(rg,this.screenElement)),this._register(ke(this.element,"mousedown",l=>this._selectionService.handleMouseDown(l))),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(Sh,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",l=>this._handleScreenReaderModeOptionChange(l))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(_h,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",l=>{!this._overviewRulerRenderer&&l&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(_h,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(og,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function s(l){var d,_,g,b,y;let u=e._mouseService.getMouseReportCoords(l,e.screenElement);if(!u)return!1;let f,m;switch(l.overrideType||l.type){case"mousemove":m=32,l.buttons===void 0?(f=3,l.button!==void 0&&(f=l.button<3?l.button:3)):f=l.buttons&1?0:l.buttons&4?1:l.buttons&2?2:3;break;case"mouseup":m=0,f=l.button<3?l.button:3;break;case"mousedown":m=1,f=l.button<3?l.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(l)===!1)return!1;let x=l.deltaY;if(x===0||e.coreMouseService.consumeWheelEvent(l,(b=(g=(_=(d=e._renderService)==null?void 0:d.dimensions)==null?void 0:_.device)==null?void 0:g.cell)==null?void 0:b.height,(y=e._coreBrowserService)==null?void 0:y.dpr)===0)return!1;m=x<0?0:1,f=4;break;default:return!1}return m===void 0||f===void 0||f>4?!1:e.coreMouseService.triggerMouseEvent({col:u.col,row:u.row,x:u.x,y:u.y,button:f,action:m,ctrl:l.ctrlKey,alt:l.altKey,shift:l.shiftKey})}let n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},a={mouseup:l=>(s(l),l.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.mousedrag)),this.cancel(l)),wheel:l=>(s(l),this.cancel(l,!0)),mousedrag:l=>{l.buttons&&s(l)},mousemove:l=>{l.buttons||s(l)}};this._register(this.coreMouseService.onProtocolChange(l=>{l?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(l)),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()),l&8?n.mousemove||(t.addEventListener("mousemove",a.mousemove),n.mousemove=a.mousemove):(t.removeEventListener("mousemove",n.mousemove),n.mousemove=null),l&16?n.wheel||(t.addEventListener("wheel",a.wheel,{passive:!1}),n.wheel=a.wheel):(t.removeEventListener("wheel",n.wheel),n.wheel=null),l&2?n.mouseup||(n.mouseup=a.mouseup):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),l&4?n.mousedrag||(n.mousedrag=a.mousedrag):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(ke(t,"mousedown",l=>{if(l.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(l)))return s(l),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(l)})),this._register(ke(t,"wheel",l=>{var u,f,m,d,_;if(!n.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(l)===!1)return!1;if(!this.buffer.hasScrollback){if(l.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(l,(d=(m=(f=(u=e._renderService)==null?void 0:u.dimensions)==null?void 0:f.device)==null?void 0:m.cell)==null?void 0:d.height,(_=e._coreBrowserService)==null?void 0:_.dpr)===0)return this.cancel(l,!0);let g=ne.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(l.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(g,!0),this.cancel(l,!0)}}},{passive:!1}))}refresh(e,t){var s;(s=this._renderService)==null||s.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.shouldColumnSelect(e)?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(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){a2(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,s){this._selectionService.setSelection(e,t,s)}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(){var e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var s;(s=this._selectionService)==null||s.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let s=z6(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),s.type===3||s.type===2){let n=this.rows-1;return this.scrollLines(s.type===2?-n:n),this.cancel(e,!0)}if(s.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(s.cancel&&this.cancel(e,!0),!s.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((s.key===ne.ETX||s.key===ne.CR)&&(this.textarea.value=""),this._onKey.fire({key:s.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(s.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let s=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?s:s&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(F6(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var s;(s=this._charSizeService)==null||s.measure()}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 e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(jt));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var t;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(t=this._selectionService)==null||t.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){var e;(e=this.element)!=null&&e.classList.contains("focus")?this.coreService.triggerDataEvent(ne.ESC+"[I"):this.coreService.triggerDataEvent(ne.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),s=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ne.ESC}[4;${s};${t}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),a=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ne.ESC}[6;${a};${n}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function F6(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var V6=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let s={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(s),t.dispose=()=>this._wrappedAddonDispose(s),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let s=0;s<this._addons.length;s++)if(this._addons[s]===e){t=s;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},W6=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new ns)}translateToString(e,t,s){return this._line.translateToString(e,t,s)}},MS=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,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(e){let t=this._buffer.lines.get(e);if(t)return new W6(t)}getNullCell(){return new ns}},K6=class extends Be{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new ue),this.onBufferChange=this._onBufferChange.event,this._normal=new MS(this._core.buffers.normal,"normal"),this._alternate=new MS(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)}},q6=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,s=>t(s.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(s,n)=>t(s,n.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},Y6=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},G6=["cols","rows"],xs=0,G2=class extends Be{constructor(e){super(),this._core=this._register(new U6(e)),this._addonManager=this._register(new V6),this._publicOptions={...this._core.options};let t=n=>this._core.options[n],s=(n,a)=>{this._checkReadonlyOptions(n),this._core.options[n]=a};for(let n in this._core.options){let a={get:t.bind(this,n),set:s.bind(this,n)};Object.defineProperty(this._publicOptions,n,a)}}_checkReadonlyOptions(e){if(G6.includes(e))throw new Error(`Option "${e}" 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 q6(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new Y6(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 K6(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,s){this._verifyIntegers(e,t,s),this._core.select(e,t,s)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
475
+ `,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Pp.get()},set promptLabel(e){Pp.set(e)},get tooMuchOutput(){return Hp.get()},set tooMuchOutput(e){Hp.set(e)}}}_verifyIntegers(...e){for(xs of e)if(xs===1/0||isNaN(xs)||xs%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(xs of e)if(xs&&(xs===1/0||isNaN(xs)||xs%1!==0||xs<0))throw new Error("This API only accepts positive integers")}};/**
476
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
477
+ * @license MIT
478
+ *
479
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
480
+ * @license MIT
481
+ *
482
+ * Originally forked from (with the author's permission):
483
+ * Fabrice Bellard's javascript vt100 for jslinux:
484
+ * http://bellard.org/jslinux/
485
+ * Copyright (c) 2011 Fabrice Bellard
486
+ */var X6=2,Z6=1,X2=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var g;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((g=this._terminal.options.overviewRuler)==null?void 0:g.width)||14,s=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(s.getPropertyValue("height")),a=Math.max(0,parseInt(s.getPropertyValue("width"))),l=window.getComputedStyle(this._terminal.element),u={top:parseInt(l.getPropertyValue("padding-top")),bottom:parseInt(l.getPropertyValue("padding-bottom")),right:parseInt(l.getPropertyValue("padding-right")),left:parseInt(l.getPropertyValue("padding-left"))},f=u.top+u.bottom,m=u.right+u.left,d=n-f,_=a-m-t;return{cols:Math.max(X6,Math.floor(_/e.css.cell.width)),rows:Math.max(Z6,Math.floor(d/e.css.cell.height))}}};const io={light:{background:"#fbfaf9",foreground:"#1c2027",cursor:"#1c2027",cursorAccent:"#fbfaf9",selectionBackground:"#d9dee6",black:"#1c2027",red:"#b32d2d",green:"#1f7a3d",yellow:"#8a6100",blue:"#1f5fa8",magenta:"#8b3a9e",cyan:"#106b74",white:"#5c636e",brightBlack:"#8b93a1",brightRed:"#d13b3b",brightGreen:"#2a9c50",brightYellow:"#a87a00",brightBlue:"#2a76c9",brightMagenta:"#a34bb8",brightCyan:"#158790",brightWhite:"#1c2027"},dark:{background:"#111418",foreground:"#e6e8eb",cursor:"#e6e8eb",cursorAccent:"#111418",selectionBackground:"#2c333d"}};function Q6({server:e,onPick:t,onManage:s}){const[n,a]=w.useState(!1),[l,u]=w.useState(null),[f,m]=w.useState([]),[d,_]=w.useState(!1),g=w.useRef(null);w.useEffect(()=>{n&&Pn.list(e).then(y=>{u(y.commands),m(y.suggestions)}).catch(()=>u([]))},[n,e]),w.useEffect(()=>{if(!n)return;const y=S=>{var E;(E=g.current)!=null&&E.contains(S.target)||a(!1)},x=S=>{S.key==="Escape"&&a(!1)};return document.addEventListener("mousedown",y),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",x)}},[n]);const b=y=>{y.confirmBeforeRun&&!window.confirm(`${y.name}
487
+
488
+ ${y.command}
489
+
490
+ Put this in the terminal on ${e}?`)||(t(y),a(!1))};return h.jsxs("div",{ref:g,className:"relative",children:[h.jsxs(ge,{variant:"ghost",size:"sm",onClick:()=>a(y=>!y),children:[h.jsx(oo,{className:"h-3.5 w-3.5"}),"Commands",h.jsx(Xl,{className:fe("h-3 w-3 transition-transform",n&&"rotate-180")})]}),n&&h.jsx("div",{className:"absolute right-0 z-20 mt-1 w-80 overflow-hidden rounded-lg border border-border bg-popover shadow-card",children:l===null?h.jsx("div",{className:"flex items-center justify-center p-6",children:h.jsx(ss,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"max-h-80 overflow-y-auto",children:[l.map(y=>h.jsxs("button",{onClick:()=>b(y),className:"group flex w-full items-start gap-2 border-b border-border-subtle px-3 py-2 text-left last:border-b-0 hover:bg-card-hover",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"text-xs font-medium",children:y.name}),y.confirmBeforeRun&&h.jsx("span",{className:"rounded bg-destructive/10 px-1 text-[9px] text-destructive",children:"asks first"}),y.serverNames.length>0&&h.jsxs("span",{className:"text-[9px] text-muted-foreground",children:[y.serverNames.length," server",y.serverNames.length>1?"s":""]})]}),h.jsx("code",{className:"mt-0.5 block truncate font-mono text-[11px] text-muted-foreground",children:y.command})]}),h.jsx("span",{role:"button",tabIndex:0,"aria-label":`Delete ${y.name}`,onClick:async x=>{x.stopPropagation(),await Pn.remove(y.id),u(S=>(S==null?void 0:S.filter(E=>E.id!==y.id))??null)},onKeyDown:x=>{x.key==="Enter"&&x.currentTarget.click()},className:"mt-0.5 shrink-0 rounded p-0.5 opacity-0 transition-opacity group-hover:opacity-100 hover:bg-accent/30",children:h.jsx(Vn,{className:"h-3 w-3"})})]},y.id)),l.length===0&&f.length>0&&h.jsxs("div",{className:"p-3",children:[h.jsx("p",{className:"mb-2 text-xs text-muted-foreground",children:"Nothing saved yet. These are the ones people usually keep — pick any to add it."}),h.jsx("div",{className:"grid gap-1",children:f.map(y=>h.jsxs("button",{disabled:d,onClick:async()=>{_(!0);try{const x=await Pn.save(y);u(S=>[...S??[],x])}finally{_(!1)}},className:"flex items-center gap-2 rounded-md px-2 py-1 text-left hover:bg-card-hover",children:[h.jsx(Bi,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),h.jsx("span",{className:"text-xs",children:y.name}),h.jsx("code",{className:"ml-auto truncate font-mono text-[10px] text-muted-foreground",children:y.command})]},y.name))})]})]}),h.jsxs("button",{onClick:()=>{a(!1),s()},className:"flex w-full items-center gap-2 border-t border-border px-3 py-2 text-xs text-muted-foreground hover:bg-card-hover hover:text-foreground",children:[h.jsx(Bi,{className:"h-3.5 w-3.5"}),"Save a new command"]})]})})]})}function ks({className:e,...t}){return h.jsx(BR,{"data-slot":"label",className:fe("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Z2({server:e,existing:t,onClose:s,onSaved:n}){const a=zt(L=>L.servers),[l,u]=w.useState((t==null?void 0:t.name)??""),[f,m]=w.useState((t==null?void 0:t.command)??""),[d,_]=w.useState((t==null?void 0:t.description)??""),[g,b]=w.useState((t==null?void 0:t.workingDirectory)??""),[y,x]=w.useState((t==null?void 0:t.confirmBeforeRun)??!1),[S,E]=w.useState(new Set((t==null?void 0:t.serverNames)??[])),[k,T]=w.useState(!1),[D,R]=w.useState(null),z=L=>E(j=>{const A=new Set(j);return A.has(L)?A.delete(L):A.add(L),A});return h.jsx(Jl,{open:!0,onOpenChange:L=>!L&&s(),children:h.jsxs(ec,{className:"sm:max-w-lg",children:[h.jsxs(rv,{children:[h.jsx(tc,{children:t?"Edit command":"Save a command"}),h.jsx(ic,{children:"It appears in the list next to any terminal it applies to."})]}),h.jsxs("div",{className:"grid gap-3",children:[h.jsxs("div",{className:"grid gap-1.5",children:[h.jsx(ks,{children:"Name"}),h.jsx(lt,{value:l,placeholder:"Reload nginx",onChange:L=>u(L.target.value)})]}),h.jsxs("div",{className:"grid gap-1.5",children:[h.jsx(ks,{children:"Command"}),h.jsx("textarea",{value:f,onChange:L=>m(L.target.value),rows:3,placeholder:"systemctl reload nginx",className:"rounded-md border border-input bg-transparent px-3 py-2 font-mono text-sm focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none"})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[h.jsxs("div",{className:"grid gap-1.5",children:[h.jsxs(ks,{children:["Description ",h.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),h.jsx(lt,{value:d,onChange:L=>_(L.target.value)})]}),h.jsxs("div",{className:"grid gap-1.5",children:[h.jsxs(ks,{children:["Directory ",h.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),h.jsx(lt,{value:g,placeholder:"/var/www",onChange:L=>b(L.target.value)})]})]}),h.jsxs("div",{className:"grid gap-1.5",children:[h.jsxs(ks,{children:["Where it is offered",h.jsx("span",{className:"ml-1.5 font-normal text-muted-foreground",children:S.size===0?"every server":`${S.size} selected`})]}),h.jsxs("div",{className:"flex flex-wrap gap-1.5 rounded-md border border-border p-2",children:[a.map(L=>h.jsx("button",{onClick:()=>z(L.name),className:fe("rounded-md border px-2 py-1 text-xs transition-colors",S.has(L.name)?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground hover:bg-accent/30"),children:L.name},L.name)),a.length===0&&h.jsx("span",{className:"text-xs text-muted-foreground",children:"No server in the vault yet."})]}),S.size===0&&h.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Selecting none offers it everywhere.",e&&h.jsxs("button",{className:"ml-1 underline",onClick:()=>E(new Set([e])),children:["Limit to ",e,"?"]})]})]}),h.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[h.jsx("input",{type:"checkbox",checked:y,onChange:L=>x(L.target.checked),className:"h-3.5 w-3.5"}),"Ask before putting it in the terminal",h.jsx("span",{className:"text-xs text-muted-foreground",children:"— for the ones that delete things"})]}),D&&h.jsx("p",{className:"text-sm text-destructive",children:D})]}),h.jsxs(nv,{children:[h.jsx(ge,{variant:"ghost",onClick:s,children:"Cancel"}),h.jsx(ge,{disabled:k||!l.trim()||!f.trim(),onClick:async()=>{T(!0),R(null);try{const L=await Pn.save({id:t==null?void 0:t.id,name:l,command:f,description:d,workingDirectory:g,confirmBeforeRun:y,serverNames:[...S]});n==null||n(L),s()}catch(L){R(L.message)}finally{T(!1)}},children:k?"Saving…":"Save"})]})]})})}function AS({server:e,local:t=!1,hidden:s=!1}){const n=w.useRef(null),a=Uh(d=>d.resolved),[l,u]=w.useState(!1),f=w.useRef(null);w.useEffect(()=>{const d=n.current;if(!d)return;const _=new G2({fontFamily:"'JetBrains Mono', 'SF Mono', monospace",fontSize:13,cursorBlink:!0,theme:io[a]}),g=new X2;_.loadAddon(g),_.open(d),g.fit(),f.current={term:_,fit:g,handle:null};let b=!1;g3.open(t?{local:!0}:{server:e},_.cols,_.rows).then(x=>{if(b)return void x.close();f.current&&(f.current.handle=x),x.onData(S=>_.write(S)),x.onExit(()=>_.write(`\r
491
+ \x1B[2m— connection closed —\x1B[0m\r
492
+ `)),_.onData(S=>x.write(S))}).catch(x=>_.write(`\r
493
+ \x1B[31m${x.message}\x1B[0m\r
494
+ `));const y=new ResizeObserver(()=>{var x,S;d.offsetParent!==null&&(g.fit(),(S=(x=f.current)==null?void 0:x.handle)==null||S.resize(_.cols,_.rows))});return y.observe(d),()=>{var x,S;b=!0,y.disconnect(),(S=(x=f.current)==null?void 0:x.handle)==null||S.close(),_.dispose(),f.current=null}},[e,t]),w.useEffect(()=>{f.current&&(f.current.term.options.theme=io[a])},[a]),w.useEffect(()=>{if(s||!f.current)return;const{term:d,fit:_,handle:g}=f.current;_.fit(),g==null||g.resize(d.cols,d.rows),d.focus()},[s]);const m=d=>{var b,y;const _=(b=f.current)==null?void 0:b.handle;if(!_)return;const g=d.workingDirectory?`cd ${d.workingDirectory} && ${d.command}`:d.command;_.write(g),(y=f.current)==null||y.term.focus()};return h.jsxs(h.Fragment,{children:[h.jsxs("header",{className:"flex items-center gap-2 border-b border-border px-6 py-3",children:[h.jsx("h1",{className:"text-sm font-medium",children:e}),h.jsx("span",{className:"text-xs text-muted-foreground",children:t?"a shell on this machine":"interactive shell"}),!t&&h.jsx("div",{className:"ml-auto",children:h.jsx(Q6,{server:e,onPick:m,onManage:()=>u(!0)})})]}),l&&!t&&h.jsx(Z2,{server:e,onClose:()=>u(!1)}),h.jsx("div",{ref:n,className:"min-h-0 flex-1 p-2",style:{background:io[a].background}})]})}function so(){return so=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},so.apply(null,arguments)}var Uu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function oc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var OS,zS={exports:{}};/*!
495
+ Copyright (c) 2018 Jed Watson.
496
+ Licensed under the MIT License (MIT), see
497
+ http://jedwatson.github.io/classnames
498
+ */var Qm,LS,BS,J6=(OS||(OS=1,Qm=zS,(function(){var e={}.hasOwnProperty;function t(){for(var a="",l=0;l<arguments.length;l++){var u=arguments[l];u&&(a=n(a,s(u)))}return a}function s(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return t.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var l="";for(var u in a)e.call(a,u)&&a[u]&&(l=n(l,u));return l}function n(a,l){return l?a?a+" "+l:a+l:a}Qm.exports?(t.default=t,Qm.exports=t):window.classNames=t})()),zS.exports),xg=oc(J6),PS,HS,eB=(BS||(BS=1,LS=function e(t,s){if(t===s)return!0;if(t&&s&&typeof t=="object"&&typeof s=="object"){if(t.constructor!==s.constructor)return!1;var n,a,l;if(Array.isArray(t)){if((n=t.length)!=s.length)return!1;for(a=n;a--!==0;)if(!e(t[a],s[a]))return!1;return!0}if(t instanceof Map&&s instanceof Map){if(t.size!==s.size)return!1;for(a of t.entries())if(!s.has(a[0]))return!1;for(a of t.entries())if(!e(a[1],s.get(a[0])))return!1;return!0}if(t instanceof Set&&s instanceof Set){if(t.size!==s.size)return!1;for(a of t.entries())if(!s.has(a[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(s)){if((n=t.length)!=s.length)return!1;for(a=n;a--!==0;)if(t[a]!==s[a])return!1;return!0}if(t.constructor===RegExp)return t.source===s.source&&t.flags===s.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===s.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===s.toString();if((n=(l=Object.keys(t)).length)!==Object.keys(s).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(s,l[a]))return!1;for(a=n;a--!==0;){var u=l[a];if(!e(t[u],s[u]))return!1}return!0}return t!=t&&s!=s}),LS),tB=oc(eB),IS,$S,us=oc((function(){if(HS)return PS;HS=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,n=/^0o[0-7]+$/i,a=parseInt,l=Object.prototype.toString;function u(m){var d=typeof m;return!!m&&(d=="object"||d=="function")}function f(m){if(typeof m=="number")return m;if((function(g){return typeof g=="symbol"||(function(b){return!!b&&typeof b=="object"})(g)&&l.call(g)=="[object Symbol]"})(m))return NaN;if(u(m)){var d=typeof m.valueOf=="function"?m.valueOf():m;m=u(d)?d+"":d}if(typeof m!="string")return m===0?m:+m;m=m.replace(e,"");var _=s.test(m);return _||n.test(m)?a(m.slice(2),_?2:8):t.test(m)?NaN:+m}return PS=function(m,d,_){return _===void 0&&(_=d,d=void 0),_!==void 0&&(_=(_=f(_))==_?_:0),d!==void 0&&(d=(d=f(d))==d?d:0),(function(g,b,y){return g==g&&(y!==void 0&&(g=g<=y?g:y),b!==void 0&&(g=g>=b?g:b)),g})(f(m),d,_)}})()),iB=oc((function(){if($S)return IS;$S=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,n=/^0o[0-7]+$/i,a=parseInt,l=typeof Uu=="object"&&Uu&&Uu.Object===Object&&Uu,u=typeof self=="object"&&self&&self.Object===Object&&self,f=l||u||Function("return this")(),m=Object.prototype.toString,d=Math.max,_=Math.min,g=function(){return f.Date.now()};function b(x){var S=typeof x;return!!x&&(S=="object"||S=="function")}function y(x){if(typeof x=="number")return x;if((function(k){return typeof k=="symbol"||(function(T){return!!T&&typeof T=="object"})(k)&&m.call(k)=="[object Symbol]"})(x))return NaN;if(b(x)){var S=typeof x.valueOf=="function"?x.valueOf():x;x=b(S)?S+"":S}if(typeof x!="string")return x===0?x:+x;x=x.replace(e,"");var E=s.test(x);return E||n.test(x)?a(x.slice(2),E?2:8):t.test(x)?NaN:+x}return IS=function(x,S,E){var k,T,D,R,z,L,j=0,A=!1,V=!1,I=!0;if(typeof x!="function")throw new TypeError("Expected a function");function J(M){var H=k,U=T;return k=T=void 0,j=M,R=x.apply(U,H)}function $(M){var H=M-L;return L===void 0||H>=S||H<0||V&&M-j>=D}function B(){var M=g();if($(M))return K(M);z=setTimeout(B,(function(H){var U=S-(H-L);return V?_(U,D-(H-j)):U})(M))}function K(M){return z=void 0,I&&k?J(M):(k=T=void 0,R)}function q(){var M=g(),H=$(M);if(k=arguments,T=this,L=M,H){if(z===void 0)return(function(U){return j=U,z=setTimeout(B,S),A?J(U):R})(L);if(V)return z=setTimeout(B,S),J(L)}return z===void 0&&(z=setTimeout(B,S)),R}return S=y(S)||0,b(E)&&(A=!!E.leading,D=(V="maxWait"in E)?d(y(E.maxWait)||0,S):D,I="trailing"in E?!!E.trailing:I),q.cancel=function(){z!==void 0&&clearTimeout(z),j=0,k=L=T=z=void 0},q.flush=function(){return z===void 0?R:K(g())},q}})()),US={width:void 0,height:void 0};function sB(e){const{ref:t,box:s="content-box"}=e,[{width:n,height:a},l]=w.useState(US),u=(function(){const d=w.useRef(!1);return w.useEffect(()=>(d.current=!0,()=>{d.current=!1}),[]),w.useCallback(()=>d.current,[])})(),f=w.useRef(so({},US)),m=w.useRef(void 0);return m.current=e.onResize,w.useEffect(()=>{if(!t.current||typeof window>"u"||!("ResizeObserver"in window))return;const d=new ResizeObserver(([_])=>{const g=s==="border-box"?"borderBoxSize":s==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",b=FS(_,g,"inlineSize"),y=FS(_,g,"blockSize");if(f.current.width!==b||f.current.height!==y){const x={width:b,height:y};f.current.width=b,f.current.height=y,m.current?m.current(x):u()&&l(x)}});return d.observe(t.current,{box:s}),()=>{d.disconnect()}},[s,t,u]),{width:n,height:a}}function FS(e,t,s){return e[t]?Array.isArray(e[t])?e[t][0][s]:e[t][s]:t==="contentBoxSize"?e.contentRect[s==="inlineSize"?"width":"height"]:void 0}var rB="allotment-module_splitView__L-yRc",nB="allotment-module_sashContainer__fzwJF",aB="allotment-module_splitViewContainer__rQnVa",Q2="allotment-module_splitViewView__MGZ6O",oB="allotment-module_vertical__WSwwa",lB="allotment-module_horizontal__7doS8",cB="allotment-module_separatorBorder__x-rDS";let Cl,J2=!1,eE=!1;typeof navigator=="object"&&(Cl=navigator.userAgent,eE=Cl.indexOf("Macintosh")>=0,J2=(Cl.indexOf("Macintosh")>=0||Cl.indexOf("iPad")>=0||Cl.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0);const tE=J2,uB=eE,VS=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;class hB{constructor(){this._size=void 0}getSize(){return this._size}setSize(t){this._size=t}}function Fu(e,t){const s=e.length,n=s-t.length;return n>=0&&e.slice(n,s)===t}var WS,KS={exports:{}},dB=(WS||(WS=1,(function(e){var t=Object.prototype.hasOwnProperty,s="~";function n(){}function a(m,d,_){this.fn=m,this.context=d,this.once=_||!1}function l(m,d,_,g,b){if(typeof _!="function")throw new TypeError("The listener must be a function");var y=new a(_,g||m,b),x=s?s+d:d;return m._events[x]?m._events[x].fn?m._events[x]=[m._events[x],y]:m._events[x].push(y):(m._events[x]=y,m._eventsCount++),m}function u(m,d){--m._eventsCount===0?m._events=new n:delete m._events[d]}function f(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(s=!1)),f.prototype.eventNames=function(){var m,d,_=[];if(this._eventsCount===0)return _;for(d in m=this._events)t.call(m,d)&&_.push(s?d.slice(1):d);return Object.getOwnPropertySymbols?_.concat(Object.getOwnPropertySymbols(m)):_},f.prototype.listeners=function(m){var d=s?s+m:m,_=this._events[d];if(!_)return[];if(_.fn)return[_.fn];for(var g=0,b=_.length,y=new Array(b);g<b;g++)y[g]=_[g].fn;return y},f.prototype.listenerCount=function(m){var d=s?s+m:m,_=this._events[d];return _?_.fn?1:_.length:0},f.prototype.emit=function(m,d,_,g,b,y){var x=s?s+m:m;if(!this._events[x])return!1;var S,E,k=this._events[x],T=arguments.length;if(k.fn){switch(k.once&&this.removeListener(m,k.fn,void 0,!0),T){case 1:return k.fn.call(k.context),!0;case 2:return k.fn.call(k.context,d),!0;case 3:return k.fn.call(k.context,d,_),!0;case 4:return k.fn.call(k.context,d,_,g),!0;case 5:return k.fn.call(k.context,d,_,g,b),!0;case 6:return k.fn.call(k.context,d,_,g,b,y),!0}for(E=1,S=new Array(T-1);E<T;E++)S[E-1]=arguments[E];k.fn.apply(k.context,S)}else{var D,R=k.length;for(E=0;E<R;E++)switch(k[E].once&&this.removeListener(m,k[E].fn,void 0,!0),T){case 1:k[E].fn.call(k[E].context);break;case 2:k[E].fn.call(k[E].context,d);break;case 3:k[E].fn.call(k[E].context,d,_);break;case 4:k[E].fn.call(k[E].context,d,_,g);break;default:if(!S)for(D=1,S=new Array(T-1);D<T;D++)S[D-1]=arguments[D];k[E].fn.apply(k[E].context,S)}}return!0},f.prototype.on=function(m,d,_){return l(this,m,d,_,!1)},f.prototype.once=function(m,d,_){return l(this,m,d,_,!0)},f.prototype.removeListener=function(m,d,_,g){var b=s?s+m:m;if(!this._events[b])return this;if(!d)return u(this,b),this;var y=this._events[b];if(y.fn)y.fn!==d||g&&!y.once||_&&y.context!==_||u(this,b);else{for(var x=0,S=[],E=y.length;x<E;x++)(y[x].fn!==d||g&&!y[x].once||_&&y[x].context!==_)&&S.push(y[x]);S.length?this._events[b]=S.length===1?S[0]:S:u(this,b)}return this},f.prototype.removeAllListeners=function(m){var d;return m?(d=s?s+m:m,this._events[d]&&u(this,d)):(this._events=new n,this._eventsCount=0),this},f.prototype.off=f.prototype.removeListener,f.prototype.addListener=f.prototype.on,f.prefixed=s,f.EventEmitter=f,e.exports=f})(KS)),KS.exports),gv=oc(dB);function qS(e,t){const s=e.indexOf(t);s>-1&&(e.splice(s,1),e.unshift(t))}function Jm(e,t){const s=e.indexOf(t);s>-1&&(e.splice(s,1),e.push(t))}function Zi(e,t,s=1){const n=Math.max(0,Math.ceil((t-e)/s)),a=new Array(n);let l=-1;for(;++l<n;)a[l]=e+l*s;return a}var fB="sash-module_sash__K-9lB",mB="sash-module_disabled__Hm-wx",pB="sash-module_mac__Jf6OJ",YS="sash-module_vertical__pB-rs",gB="sash-module_minimum__-UKxp",vB="sash-module_maximum__TCWxD",GS="sash-module_horizontal__kFbiw",ep="sash-module_hover__80W6I",tp="sash-module_active__bJspD";let ts=(function(e){return e.Vertical="VERTICAL",e.Horizontal="HORIZONTAL",e})({}),Li=(function(e){return e.Disabled="DISABLED",e.Minimum="MINIMUM",e.Maximum="MAXIMUM",e.Enabled="ENABLED",e})({}),iE=tE?20:8;const sE=new gv;class XS extends gv{get state(){return this._state}set state(t){this._state!==t&&(this.el.classList.toggle(mB,t===Li.Disabled),this.el.classList.toggle("sash-disabled",t===Li.Disabled),this.el.classList.toggle(gB,t===Li.Minimum),this.el.classList.toggle("sash-minimum",t===Li.Minimum),this.el.classList.toggle(vB,t===Li.Maximum),this.el.classList.toggle("sash-maximum",t===Li.Maximum),this._state=t,this.emit("enablementChange",t))}constructor(t,s,n){var a;super(),this.el=void 0,this.layoutProvider=void 0,this.orientation=void 0,this.size=void 0,this.hoverDelay=300,this.hoverDelayer=iB(l=>l.classList.add("sash-hover",ep),this.hoverDelay),this._state=Li.Enabled,this.onPointerStart=l=>{const u=l.pageX,f=l.pageY,m={startX:u,currentX:u,startY:f,currentY:f};this.el.classList.add("sash-active",tp),this.emit("start",m),this.el.setPointerCapture(l.pointerId);const d=g=>{g.preventDefault();const b={startX:u,currentX:g.pageX,startY:f,currentY:g.pageY};this.emit("change",b)},_=g=>{g.preventDefault(),this.el.classList.remove("sash-active",tp),this.hoverDelayer.cancel(),this.emit("end"),this.el.releasePointerCapture(g.pointerId),window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",_)};window.addEventListener("pointermove",d),window.addEventListener("pointerup",_)},this.onPointerDoublePress=()=>{this.emit("reset")},this.onMouseEnter=()=>{this.el.classList.contains(tp)?(this.hoverDelayer.cancel(),this.el.classList.add("sash-hover",ep)):this.hoverDelayer(this.el)},this.onMouseLeave=()=>{this.hoverDelayer.cancel(),this.el.classList.remove("sash-hover",ep)},this.el=document.createElement("div"),this.el.classList.add("sash",fB),this.el.dataset.testid="sash",t.append(this.el),uB&&this.el.classList.add("sash-mac",pB),this.el.addEventListener("pointerdown",this.onPointerStart),this.el.addEventListener("dblclick",this.onPointerDoublePress),this.el.addEventListener("mouseenter",this.onMouseEnter),this.el.addEventListener("mouseleave",this.onMouseLeave),typeof n.size=="number"?(this.size=n.size,n.orientation===ts.Vertical?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=iE,sE.on("onDidChangeGlobalSize",l=>{this.size=l,this.layout()})),this.layoutProvider=s,this.orientation=(a=n.orientation)!=null?a:ts.Vertical,this.orientation===ts.Horizontal?(this.el.classList.add("sash-horizontal",GS),this.el.classList.remove("sash-vertical",YS)):(this.el.classList.remove("sash-horizontal",GS),this.el.classList.add("sash-vertical",YS)),this.layout()}layout(){if(this.orientation===ts.Vertical){const t=this.layoutProvider;this.el.style.left=t.getVerticalSashLeft(this)-this.size/2+"px",t.getVerticalSashTop&&(this.el.style.top=t.getVerticalSashTop(this)+"px"),t.getVerticalSashHeight&&(this.el.style.height=t.getVerticalSashHeight(this)+"px")}else{const t=this.layoutProvider;this.el.style.top=t.getHorizontalSashTop(this)-this.size/2+"px",t.getHorizontalSashLeft&&(this.el.style.left=t.getHorizontalSashLeft(this)+"px"),t.getHorizontalSashWidth&&(this.el.style.width=t.getHorizontalSashWidth(this)+"px")}}dispose(){this.el.removeEventListener("pointerdown",this.onPointerStart),this.el.removeEventListener("dblclick",this.onPointerDoublePress),this.el.removeEventListener("mouseenter",this.onMouseEnter),this.el.removeEventListener("mouseleave",()=>this.onMouseLeave),this.el.remove()}}let wh;var ip;(ip=wh||(wh={})).Distribute={type:"distribute"},ip.Split=function(e){return{type:"split",index:e}},ip.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}};let Ji=(function(e){return e.Normal="NORMAL",e.Low="LOW",e.High="HIGH",e})({});class rE{constructor(t,s,n){this.container=void 0,this.view=void 0,this._size=void 0,this._cachedVisibleSize=void 0,this.container=t,this.view=s,this.container.classList.add("split-view-view",Q2),this.container.dataset.testid="split-view-view",typeof n=="number"?(this._size=n,this._cachedVisibleSize=void 0,t.classList.add("split-view-view-visible")):(this._size=0,this._cachedVisibleSize=n.cachedVisibleSize)}set size(t){this._size=t}get size(){return this._size}get priority(){return this.view.priority}get snap(){return!!this.view.snap}get cachedVisibleSize(){return this._cachedVisibleSize}get visible(){return this._cachedVisibleSize===void 0}setVisible(t,s){t!==this.visible&&(t?(this.size=us(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof s=="number"?s:this.size,this.size=0),this.container.classList.toggle("split-view-view-visible",t),this.view.setVisible&&this.view.setVisible(t))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}set enabled(t){this.container.style.pointerEvents=t?"":"none"}layout(t){this.layoutContainer(t),this.view.layout(this.size,t)}}class _B extends rE{layoutContainer(t){this.container.style.left=`${t}px`,this.container.style.width=`${this.size}px`}}class yB extends rE{layoutContainer(t){this.container.style.top=`${t}px`,this.container.style.height=`${this.size}px`}}class bB extends gv{get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(t){this._startSnappingEnabled!==t&&(this._startSnappingEnabled=t,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(t){this._endSnappingEnabled!==t&&(this._endSnappingEnabled=t,this.updateSashEnablement())}constructor(t,s={},n,a,l){var u,f;if(super(),this.onDidChange=void 0,this.onDidDragStart=void 0,this.onDidDragEnd=void 0,this.orientation=void 0,this.sashContainer=void 0,this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.sashDragState=void 0,this.proportionalLayout=void 0,this.getSashOrthogonalSize=void 0,this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onSashEnd=m=>{this.emit("sashchange",m),this.saveProportions();for(const d of this.viewItems)d.enabled=!0},this.orientation=(u=s.orientation)!=null?u:ts.Vertical,this.proportionalLayout=(f=s.proportionalLayout)!=null?f:!0,this.getSashOrthogonalSize=s.getSashOrthogonalSize,n&&(this.onDidChange=n),a&&(this.onDidDragStart=a),l&&(this.onDidDragEnd=l),this.sashContainer=document.createElement("div"),this.sashContainer.classList.add("sash-container",nB),t.prepend(this.sashContainer),s.descriptor){this.size=s.descriptor.size;for(const[m,d]of s.descriptor.views.entries()){const _=d.size,g=d.container,b=d.view;this.addView(g,b,_,m,!0)}this.contentSize=this.viewItems.reduce((m,d)=>m+d.size,0),this.saveProportions()}}addView(t,s,n,a=this.viewItems.length,l){let u;u=typeof n=="number"?n:n.type==="split"?this.getViewSize(n.index)/2:n.type==="invisible"?{cachedVisibleSize:n.cachedVisibleSize}:s.minimumSize;const f=this.orientation===ts.Vertical?new yB(t,s,u):new _B(t,s,u);if(this.viewItems.splice(a,0,f),this.viewItems.length>1){const m=this.orientation===ts.Vertical?new XS(this.sashContainer,{getHorizontalSashTop:g=>this.getSashPosition(g),getHorizontalSashWidth:this.getSashOrthogonalSize},{orientation:ts.Horizontal}):new XS(this.sashContainer,{getVerticalSashLeft:g=>this.getSashPosition(g),getVerticalSashHeight:this.getSashOrthogonalSize},{orientation:ts.Vertical}),d=this.orientation===ts.Vertical?g=>({sash:m,start:g.startY,current:g.currentY}):g=>({sash:m,start:g.startX,current:g.currentX});m.on("start",g=>{var b;this.emit("sashDragStart"),this.onSashStart(d(g));const y=this.viewItems.map(x=>x.size);(b=this.onDidDragStart)==null||b.call(this,y)}),m.on("change",g=>this.onSashChange(d(g))),m.on("end",()=>{var g;this.emit("sashDragEnd"),this.onSashEnd(this.sashItems.findIndex(y=>y.sash===m));const b=this.viewItems.map(y=>y.size);(g=this.onDidDragEnd)==null||g.call(this,b)}),m.on("reset",()=>{const g=this.sashItems.findIndex(E=>E.sash===m),b=Zi(g,-1,-1),y=Zi(g+1,this.viewItems.length),x=this.findFirstSnapIndex(b),S=this.findFirstSnapIndex(y);(typeof x!="number"||this.viewItems[x].visible)&&(typeof S!="number"||this.viewItems[S].visible)&&this.emit("sashreset",g)});const _={sash:m};this.sashItems.splice(a-1,0,_)}l||this.relayout(),l||typeof n=="number"||n.type!=="distribute"||this.distributeViewSizes()}removeView(t,s){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");const n=this.viewItems.splice(t,1)[0].view;if(this.viewItems.length>=1){const a=Math.max(t-1,0);this.sashItems.splice(a,1)[0].sash.dispose()}return this.relayout(),s&&s.type==="distribute"&&this.distributeViewSizes(),n}moveView(t,s,n){const a=this.getViewCachedVisibleSize(s),l=a===void 0?this.getViewSize(s):wh.Invisible(a),u=this.removeView(s);this.addView(t,u,l,n)}getViewCachedVisibleSize(t){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[t].cachedVisibleSize}layout(t=this.size){const s=Math.max(this.size,this.contentSize);if(this.size=t,this.proportions)for(let n=0;n<this.viewItems.length;n++){const a=this.viewItems[n];a.size=us(Math.round(this.proportions[n]*t),a.minimumSize,a.maximumSize)}else{const n=Zi(0,this.viewItems.length),a=n.filter(u=>this.viewItems[u].priority===Ji.Low),l=n.filter(u=>this.viewItems[u].priority===Ji.High);this.resize(this.viewItems.length-1,t-s,void 0,a,l)}this.distributeEmptySpace(),this.layoutViews()}resizeView(t,s){if(t<0||t>=this.viewItems.length)return;const n=Zi(0,this.viewItems.length).filter(f=>f!==t),a=[...n.filter(f=>this.viewItems[f].priority===Ji.Low),t],l=n.filter(f=>this.viewItems[f].priority===Ji.High),u=this.viewItems[t];s=Math.round(s),s=us(s,u.minimumSize,Math.min(u.maximumSize,this.size)),u.size=s,this.relayout(a,l)}resizeViews(t){for(let s=0;s<t.length;s++){const n=this.viewItems[s];let a=t[s];a=Math.round(a),a=us(a,n.minimumSize,Math.min(n.maximumSize,this.size)),n.size=a}this.contentSize=this.viewItems.reduce((s,n)=>s+n.size,0),this.saveProportions(),this.layout(this.size)}getViewSize(t){return t<0||t>=this.viewItems.length?-1:this.viewItems[t].size}isViewVisible(t){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[t].visible}setViewVisible(t,s){if(t<0||t>=this.viewItems.length)throw new Error("Index out of bounds");this.viewItems[t].setVisible(s),this.distributeEmptySpace(t),this.layoutViews(),this.saveProportions()}distributeViewSizes(){const t=[];let s=0;for(const f of this.viewItems)f.maximumSize-f.minimumSize>0&&(t.push(f),s+=f.size);const n=Math.floor(s/t.length);for(const f of t)f.size=us(n,f.minimumSize,f.maximumSize);const a=Zi(0,this.viewItems.length),l=a.filter(f=>this.viewItems[f].priority===Ji.Low),u=a.filter(f=>this.viewItems[f].priority===Ji.High);this.relayout(l,u)}dispose(){this.sashItems.forEach(t=>t.sash.dispose()),this.sashItems=[],this.sashContainer.remove()}relayout(t,s){const n=this.viewItems.reduce((a,l)=>a+l.size,0);this.resize(this.viewItems.length-1,this.size-n,void 0,t,s),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}onSashStart({sash:t,start:s}){const n=this.sashItems.findIndex(a=>a.sash===t);(a=>{const l=this.viewItems.map(T=>T.size);let u,f,m=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY;const _=Zi(n,-1,-1),g=Zi(n+1,this.viewItems.length),b=_.reduce((T,D)=>T+(this.viewItems[D].minimumSize-l[D]),0),y=_.reduce((T,D)=>T+(this.viewItems[D].viewMaximumSize-l[D]),0),x=g.length===0?Number.POSITIVE_INFINITY:g.reduce((T,D)=>T+(l[D]-this.viewItems[D].minimumSize),0),S=g.length===0?Number.NEGATIVE_INFINITY:g.reduce((T,D)=>T+(l[D]-this.viewItems[D].viewMaximumSize),0);m=Math.max(b,S),d=Math.min(x,y);const E=this.findFirstSnapIndex(_),k=this.findFirstSnapIndex(g);if(typeof E=="number"){const T=this.viewItems[E],D=Math.floor(T.viewMinimumSize/2);u={index:E,limitDelta:T.visible?m-D:m+D,size:T.size}}if(typeof k=="number"){const T=this.viewItems[k],D=Math.floor(T.viewMinimumSize/2);f={index:k,limitDelta:T.visible?d+D:d-D,size:T.size}}this.sashDragState={start:a,current:a,index:n,sizes:l,minDelta:m,maxDelta:d,snapBefore:u,snapAfter:f}})(s)}onSashChange({current:t}){const{index:s,start:n,sizes:a,minDelta:l,maxDelta:u,snapBefore:f,snapAfter:m}=this.sashDragState;this.sashDragState.current=t;const d=t-n;this.resize(s,d,a,void 0,void 0,l,u,f,m),this.distributeEmptySpace(),this.layoutViews()}getSashPosition(t){let s=0;for(let n=0;n<this.sashItems.length;n++)if(s+=this.viewItems[n].size,this.sashItems[n].sash===t)return s;return 0}resize(t,s,n=this.viewItems.map(_=>_.size),a,l,u=Number.NEGATIVE_INFINITY,f=Number.POSITIVE_INFINITY,m,d){if(t<0||t>=this.viewItems.length)return 0;const _=Zi(t,-1,-1),g=Zi(t+1,this.viewItems.length);if(l)for(const j of l)qS(_,j),qS(g,j);if(a)for(const j of a)Jm(_,j),Jm(g,j);const b=_.map(j=>this.viewItems[j]),y=_.map(j=>n[j]),x=g.map(j=>this.viewItems[j]),S=g.map(j=>n[j]),E=_.reduce((j,A)=>j+(this.viewItems[A].minimumSize-n[A]),0),k=_.reduce((j,A)=>j+(this.viewItems[A].maximumSize-n[A]),0),T=g.length===0?Number.POSITIVE_INFINITY:g.reduce((j,A)=>j+(n[A]-this.viewItems[A].minimumSize),0),D=g.length===0?Number.NEGATIVE_INFINITY:g.reduce((j,A)=>j+(n[A]-this.viewItems[A].maximumSize),0),R=Math.max(E,D,u),z=Math.min(T,k,f);let L=!1;if(m){const j=this.viewItems[m.index],A=s>=m.limitDelta;L=A!==j.visible,j.setVisible(A,m.size)}if(!L&&d){const j=this.viewItems[d.index],A=s<d.limitDelta;L=A!==j.visible,j.setVisible(A,d.size)}if(L)return this.resize(t,s,n,a,l,u,f);for(let j=0,A=s=us(s,R,z);j<b.length;j++){const V=b[j],I=us(y[j]+A,V.minimumSize,V.maximumSize);A-=I-y[j],V.size=I}for(let j=0,A=s;j<x.length;j++){const V=x[j],I=us(S[j]-A,V.minimumSize,V.maximumSize);A+=I-S[j],V.size=I}return s}distributeEmptySpace(t){const s=this.viewItems.reduce((d,_)=>d+_.size,0);let n=this.size-s;const a=Zi(0,this.viewItems.length),l=[],u=a.filter(d=>this.viewItems[d].priority===Ji.Low),f=a.filter(d=>this.viewItems[d].priority===Ji.Normal),m=a.filter(d=>this.viewItems[d].priority===Ji.High);l.push(...m,...f,...u),typeof t=="number"&&Jm(l,t);for(let d=0;n!==0&&d<l.length;d++){const _=this.viewItems[l[d]],g=us(_.size+n,_.minimumSize,_.maximumSize);n-=g-_.size,_.size=g}}layoutViews(){var t;this.contentSize=this.viewItems.reduce((n,a)=>n+a.size,0);let s=0;for(const n of this.viewItems)n.layout(s),s+=n.size;(t=this.onDidChange)!=null&&t.call(this,this.viewItems.map(n=>n.size)),this.sashItems.forEach(n=>n.sash.layout()),this.updateSashEnablement()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(t=>t.size/this.contentSize))}updateSashEnablement(){let t=!1;const s=this.viewItems.map(m=>t=m.size-m.minimumSize>0||t);t=!1;const n=this.viewItems.map(m=>t=m.maximumSize-m.size>0||t),a=[...this.viewItems].reverse();t=!1;const l=a.map(m=>t=m.size-m.minimumSize>0||t).reverse();t=!1;const u=a.map(m=>t=m.maximumSize-m.size>0||t).reverse();let f=0;for(let m=0;m<this.sashItems.length;m++){const{sash:d}=this.sashItems[m];f+=this.viewItems[m].size;const _=!(s[m]&&u[m+1]),g=!(n[m]&&l[m+1]);if(_&&g){const b=Zi(m,-1,-1),y=Zi(m+1,this.viewItems.length),x=this.findFirstSnapIndex(b),S=this.findFirstSnapIndex(y),E=typeof x=="number"&&!this.viewItems[x].visible,k=typeof S=="number"&&!this.viewItems[S].visible;E&&l[m]&&(f>0||this.startSnappingEnabled)?d.state=Li.Minimum:k&&s[m]&&(f<this.contentSize||this.endSnappingEnabled)?d.state=Li.Maximum:d.state=Li.Disabled}else d.state=_&&!g?Li.Minimum:!_&&g?Li.Maximum:Li.Enabled}}findFirstSnapIndex(t){for(const s of t){const n=this.viewItems[s];if(n.visible&&n.snap)return s}for(const s of t){const n=this.viewItems[s];if(n.visible&&n.maximumSize-n.minimumSize>0)return;if(!n.visible&&n.snap)return s}}}class Ka{constructor(t){this.size=void 0,this.size=t}getPreferredSize(){return this.size}}class ZS{constructor(t,s){this.proportion=void 0,this.layoutService=void 0,this.proportion=t,this.layoutService=s}getPreferredSize(){return this.proportion*this.layoutService.getSize()}}class Vu{getPreferredSize(){}}class QS{get preferredSize(){return this.layoutStrategy.getPreferredSize()}set preferredSize(t){if(typeof t=="number")this.layoutStrategy=new Ka(t);else if(typeof t=="string"){const s=t.trim();if(Fu(s,"%")){const n=Number(s.slice(0,-1))/100;this.layoutStrategy=new ZS(n,this.layoutService)}else if(Fu(s,"px")){const n=Number(s.slice(0,-2))/100;this.layoutStrategy=new Ka(n)}else if(typeof Number.parseFloat(s)=="number"){const n=Number.parseFloat(s);this.layoutStrategy=new Ka(n)}else this.layoutStrategy=new Vu}else this.layoutStrategy=new Vu}constructor(t,s){var n;if(this.minimumSize=0,this.maximumSize=Number.POSITIVE_INFINITY,this.element=void 0,this.priority=void 0,this.snap=void 0,this.layoutService=void 0,this.layoutStrategy=void 0,this.layoutService=t,this.element=s.element,this.minimumSize=typeof s.minimumSize=="number"?s.minimumSize:30,this.maximumSize=typeof s.maximumSize=="number"?s.maximumSize:Number.POSITIVE_INFINITY,typeof s.preferredSize=="number")this.layoutStrategy=new Ka(s.preferredSize);else if(typeof s.preferredSize=="string"){const a=s.preferredSize.trim();if(Fu(a,"%")){const l=Number(a.slice(0,-1))/100;this.layoutStrategy=new ZS(l,this.layoutService)}else if(Fu(a,"px")){const l=Number(a.slice(0,-2));this.layoutStrategy=new Ka(l)}else if(typeof Number.parseFloat(a)=="number"){const l=Number.parseFloat(a);this.layoutStrategy=new Ka(l)}else this.layoutStrategy=new Vu}else this.layoutStrategy=new Vu;this.priority=(n=s.priority)!=null?n:Ji.Normal,this.snap=typeof s.snap=="boolean"&&s.snap}layout(t){}}function JS(e){return e.minSize!==void 0||e.maxSize!==void 0||e.preferredSize!==void 0||e.priority!==void 0||e.visible!==void 0}const vv=w.forwardRef(({className:e,children:t},s)=>ci.createElement("div",{ref:s,className:xg("split-view-view",Q2,e)},t));vv.displayName="Allotment.Pane";const nE=w.forwardRef(({children:e,className:t,id:s,maxSize:n=1/0,minSize:a=30,proportionalLayout:l=!0,separator:u=!0,sizes:f,defaultSizes:m=f,snap:d=!1,vertical:_=!1,onChange:g,onReset:b,onVisibleChange:y,onDragStart:x,onDragEnd:S},E)=>{const k=w.useRef(null),T=w.useRef([]),D=w.useRef(new Map),R=w.useRef(null),z=w.useRef(new Map),L=w.useRef(new hB),j=w.useRef([]),[A,V]=w.useState(!1),I=w.useMemo(()=>ci.Children.toArray(e).filter(ci.isValidElement),[e]),J=w.useCallback($=>{var B,K;const q=(B=j.current)==null?void 0:B[$];return typeof(q==null?void 0:q.preferredSize)=="number"&&((K=R.current)!=null&&K.resizeView($,Math.round(q.preferredSize)),!0)},[]);return w.useImperativeHandle(E,()=>({reset:()=>{if(b)b();else{var $;($=R.current)==null||$.distributeViewSizes();for(let B=0;B<j.current.length;B++)J(B)}},resize:$=>{var B;(B=R.current)==null||B.resizeViews($)}})),VS(()=>{let $=!0;m&&z.current.size!==m.length&&($=!1,console.warn(`Expected ${m.length} children based on defaultSizes but found ${z.current.size}`)),$&&m&&(T.current=I.map(q=>q.key));const B=so({orientation:_?ts.Vertical:ts.Horizontal,proportionalLayout:l},$&&m&&{descriptor:{size:m.reduce((q,M)=>q+M,0),views:m.map((q,M)=>{var H,U,ae,Y;const O=D.current.get(T.current[M]),Z=new QS(L.current,so({element:document.createElement("div"),minimumSize:(H=O==null?void 0:O.minSize)!=null?H:a,maximumSize:(U=O==null?void 0:O.maxSize)!=null?U:n,priority:(ae=O==null?void 0:O.priority)!=null?ae:Ji.Normal},(O==null?void 0:O.preferredSize)&&{preferredSize:O==null?void 0:O.preferredSize},{snap:(Y=O==null?void 0:O.snap)!=null?Y:d}));return j.current.push(Z),{container:[...z.current.values()][M],size:q,view:Z}})}});R.current=new bB(k.current,B,g,x,S),R.current.on("sashDragStart",()=>{var q;(q=k.current)==null||q.classList.add("split-view-sash-dragging")}),R.current.on("sashDragEnd",()=>{var q;(q=k.current)==null||q.classList.remove("split-view-sash-dragging")}),R.current.on("sashchange",q=>{if(y&&R.current){const M=I.map(H=>H.key);for(let H=0;H<M.length;H++){const U=D.current.get(M[H]);(U==null?void 0:U.visible)!==void 0&&U.visible!==R.current.isViewVisible(H)&&y(H,R.current.isViewVisible(H))}}}),R.current.on("sashreset",q=>{if(b)b();else{var M;if(J(q)||J(q+1))return;(M=R.current)==null||M.distributeViewSizes()}});const K=R.current;return()=>{K.dispose()}},[]),VS(()=>{if(A){const te=I.map(me=>me.key),oe=[...T.current],ce=te.filter(me=>!T.current.includes(me)),he=te.filter(me=>T.current.includes(me)),Se=T.current.map(me=>!te.includes(me));for(let me=Se.length-1;me>=0;me--){var $;Se[me]&&(($=R.current)!=null&&$.removeView(me),oe.splice(me,1),j.current.splice(me,1))}for(const me of ce){var B,K,q,M,H;const le=D.current.get(me),Ce=new QS(L.current,so({element:document.createElement("div"),minimumSize:(B=le==null?void 0:le.minSize)!=null?B:a,maximumSize:(K=le==null?void 0:le.maxSize)!=null?K:n,priority:(q=le==null?void 0:le.priority)!=null?q:Ji.Normal},(le==null?void 0:le.preferredSize)&&{preferredSize:le==null?void 0:le.preferredSize},{snap:(M=le==null?void 0:le.snap)!=null?M:d}));(H=R.current)!=null&&H.addView(z.current.get(me),Ce,wh.Distribute,te.findIndex(je=>je===me)),oe.splice(te.findIndex(je=>je===me),0,me),j.current.splice(te.findIndex(je=>je===me),0,Ce)}for(;!tB(te,oe);)for(const[me,le]of te.entries()){const Ce=oe.findIndex(je=>je===le);if(Ce!==me){var U;(U=R.current)==null||U.moveView(z.current.get(le),Ce,me);const je=oe[Ce];oe.splice(Ce,1),oe.splice(me,0,je);break}}for(const me of ce){var ae;const le=te.findIndex(je=>je===me),Ce=j.current[le].preferredSize;Ce!==void 0&&((ae=R.current)==null||ae.resizeView(le,Ce))}for(const me of[...ce,...he]){var Y,O;const le=D.current.get(me),Ce=te.findIndex(je=>je===me);le&&JS(le)&&le.visible!==void 0&&((Y=R.current)==null?void 0:Y.isViewVisible(Ce))!==le.visible&&((O=R.current)==null||O.setViewVisible(Ce,le.visible))}for(const me of he){const le=D.current.get(me),Ce=te.findIndex(je=>je===me);if(le&&JS(le)){var Z;le.preferredSize!==void 0&&j.current[Ce].preferredSize!==le.preferredSize&&(j.current[Ce].preferredSize=le.preferredSize);let je=!1;le.minSize!==void 0&&j.current[Ce].minimumSize!==le.minSize&&(j.current[Ce].minimumSize=le.minSize,je=!0),le.maxSize!==void 0&&j.current[Ce].maximumSize!==le.maxSize&&(j.current[Ce].maximumSize=le.maxSize,je=!0),je&&((Z=R.current)==null||Z.layout())}}(ce.length>0||Se.length>0)&&(T.current=te)}},[I,A,n,a,d]),w.useEffect(()=>{R.current&&(R.current.onDidChange=g)},[g]),w.useEffect(()=>{R.current&&(R.current.onDidDragStart=x)},[x]),w.useEffect(()=>{R.current&&(R.current.onDidDragEnd=S)},[S]),sB({ref:k,onResize:({width:$,height:B})=>{var K;$&&B&&((K=R.current)!=null&&K.layout(_?B:$),L.current.setSize(_?B:$),V(!0))}}),w.useEffect(()=>{tE&&xB(20)},[]),ci.createElement("div",{ref:k,className:xg("split-view",_?"split-view-vertical":"split-view-horizontal",{"split-view-separator-border":u},rB,_?oB:lB,{[cB]:u},t),id:s},ci.createElement("div",{className:xg("split-view-container",aB)},ci.Children.toArray(e).map($=>{if(!ci.isValidElement($))return null;const B=$.key;return $.type.displayName==="Allotment.Pane"?(D.current.set(B,$.props),ci.cloneElement($,{key:B,ref:K=>{const q=$.ref;q&&(q.current=K),K?z.current.set(B,K):z.current.delete(B)}})):ci.createElement(vv,{key:B,ref:K=>{K?z.current.set(B,K):z.current.delete(B)}},$)})))});function xB(e){const t=us(e,4,20),s=us(e,1,8);document.documentElement.style.setProperty("--sash-size",t+"px"),document.documentElement.style.setProperty("--sash-hover-size",s+"px"),(function(n){iE=n,sE.emit("onDidChangeGlobalSize",n)})(t)}nE.displayName="Allotment";var sp=Object.assign(nE,{Pane:vv});function SB({path:e,isLocal:t,onNavigate:s}){const n=w.useRef(null);w.useEffect(()=>{n.current&&(n.current.scrollLeft=n.current.scrollWidth)},[e]);const a=e.split("/").filter(Boolean),l=e==="/";return h.jsxs("div",{ref:n,className:"flex items-center gap-0.5 overflow-x-auto scrollbar-none text-xs",children:[h.jsxs("button",{onClick:()=>s("/"),className:fe("flex shrink-0 items-center gap-1 rounded px-1.5 py-0.5 transition-colors","hover:bg-accent/30 text-muted-foreground hover:text-foreground",l&&"text-foreground font-medium"),children:[h.jsx(OC,{className:"h-3 w-3"}),t?"/":"~"]}),a.map((u,f)=>{const m="/"+a.slice(0,f+1).join("/"),d=f===a.length-1;return h.jsxs("div",{className:"flex shrink-0 items-center",children:[h.jsx(Qg,{className:"h-3 w-3 text-muted-foreground/50"}),h.jsx("button",{onClick:()=>s(m),className:fe("rounded px-1.5 py-0.5 transition-colors truncate max-w-[150px]","hover:bg-accent/30",d?"text-foreground font-medium":"text-muted-foreground hover:text-foreground"),children:u})]},m)})]})}function wB({...e}){return h.jsx(jR,{"data-slot":"context-menu",...e})}function CB({...e}){return h.jsx(DR,{"data-slot":"context-menu-trigger",...e})}function EB({className:e,...t}){return h.jsx(TR,{children:h.jsx(RR,{"data-slot":"context-menu-content",className:fe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...t})})}function Jt({className:e,inset:t,variant:s="default",...n}){return h.jsx(MR,{"data-slot":"context-menu-item","data-inset":t,"data-variant":s,className:fe("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n})}function El({className:e,...t}){return h.jsx(AR,{"data-slot":"context-menu-separator",className:fe("bg-border -mx-1 my-1 h-px",e),...t})}function An({className:e,...t}){return h.jsx("span",{"data-slot":"context-menu-shortcut",className:fe("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}const aE=new Set(["png","jpg","jpeg","gif","webp","svg","ico","bmp"]),oE=new Set(["js","ts","tsx","jsx","py","rb","go","rs","java","c","cpp","h","php","swift","kt","dart","vue","svelte","html","css","scss","sh","bash","zsh","sql","graphql"]),lE=new Set(["txt","md","json","xml","yaml","yml","toml","csv","log","conf","cfg","ini","env","gitignore","dockerignore","editorconfig","htaccess","makefile"]),cE=new Set(["md","txt","pdf","doc","docx","rtf","csv","json","xml","yaml","yml","toml"]),kB=new Set(["mp3","wav","flac","ogg","aac","m4a"]),NB=new Set(["mp4","mkv","avi","mov","webm"]),uE=new Set(["zip","tar","gz","bz2","xz","rar","7z"]);function _v(e){var t;return((t=e.split(".").pop())==null?void 0:t.toLowerCase())||""}function jB(e){const t=_v(e);return aE.has(t)?"image":oE.has(t)?"code":lE.has(t)?"text":cE.has(t)?"doc":kB.has(t)?"audio":NB.has(t)?"video":uE.has(t)?"archive":"other"}function DB(e){const t=_v(e);return aE.has(t)||oE.has(t)||lE.has(t)||cE.has(t)&&(t==="pdf"||t==="md"||t==="txt"||t==="json")}function TB(e){const t=_v(e);return uE.has(t)||e.endsWith(".tar.gz")||e.endsWith(".tgz")}function RB({selectedFiles:e,files:t,isLocal:s,rightClickedFile:n,currentPath:a,onOpen:l,onDelete:u,onRename:f,onTransfer:m,onCompress:d,onExtract:_,onPreview:g,onInspect:b,onShowInFinder:y,onCreateFolder:x,onCreateFile:S,onRefresh:E,onOpenTerminal:k,onOpenInEditor:T,onOpenInCode:D,t:R,children:z}){const L=t.filter(j=>e.has(j.path));return h.jsxs(wB,{children:[h.jsx(CB,{asChild:!0,children:z}),h.jsx(EB,{className:"min-w-[200px]",children:n?h.jsxs(h.Fragment,{children:[h.jsxs(Jt,{onClick:()=>l(n),children:[h.jsx(fr,{className:"mr-2 h-3.5 w-3.5"}),R("files.contextOpen")]}),T&&(s||!n.isDirectory)&&h.jsxs(Jt,{onClick:()=>T(n),children:[h.jsx(TC,{className:"mr-2 h-3.5 w-3.5"}),R("files.openInEditor")]}),D&&s&&n.isDirectory&&h.jsxs(Jt,{onClick:()=>D(n),children:[h.jsx(Fn,{className:"mr-2 h-3.5 w-3.5"}),R("files.openInCode")]}),!n.isDirectory&&g&&DB(n.name)&&h.jsxs(Jt,{onClick:()=>g(n),children:[h.jsx(DC,{className:"mr-2 h-3.5 w-3.5"}),R("files.contextQuickLook"),h.jsx(An,{children:"Space"})]}),s&&y&&h.jsxs(Jt,{onClick:()=>y(n.path),children:[h.jsx(jC,{className:"mr-2 h-3.5 w-3.5"}),R("files.contextShowInFinder")]}),h.jsxs(Jt,{onClick:()=>navigator.clipboard.writeText(n.path),children:[h.jsx(Op,{className:"mr-2 h-3.5 w-3.5"}),R("files.contextCopyPath"),h.jsx(An,{children:"⌘C"})]}),b&&h.jsxs(Jt,{onClick:()=>b(n),children:[h.jsx(zC,{className:"mr-2 h-3.5 w-3.5"}),R("files.contextGetInfo"),h.jsx(An,{children:"⌘I"})]}),h.jsx(El,{}),m&&h.jsxs(h.Fragment,{children:[h.jsxs(Jt,{onClick:()=>m(L.length>0?L:[n]),children:[s?h.jsx(Ql,{className:"mr-2 h-3.5 w-3.5"}):h.jsx(Xn,{className:"mr-2 h-3.5 w-3.5"}),`${R(s?"files.contextUpload":"files.contextDownload")}${L.length>1?` (${L.length})`:""}`]}),h.jsx(El,{})]}),h.jsxs(Jt,{onClick:()=>f(n),children:[h.jsx(no,{className:"mr-2 h-3.5 w-3.5"}),R("files.contextRename")]}),!n.isDirectory&&d&&h.jsxs(Jt,{onClick:()=>d(L.length>0?L:[n]),children:[h.jsx(zp,{className:"mr-2 h-3.5 w-3.5"}),R("files.contextCompressZip")]}),!n.isDirectory&&TB(n.name)&&_&&h.jsxs(Jt,{onClick:()=>_(n),children:[h.jsx(zp,{className:"mr-2 h-3.5 w-3.5"}),R("files.contextExtractZip")]}),h.jsx(El,{}),h.jsxs(Jt,{className:"text-destructive focus:text-destructive",onClick:()=>u(L.length>0?L:[n]),children:[h.jsx(Vn,{className:"mr-2 h-3.5 w-3.5"}),`${R("files.contextDelete")}${L.length>1?` (${L.length})`:""}`,h.jsx(An,{children:"⌘⌫"})]})]}):h.jsxs(h.Fragment,{children:[h.jsxs(Jt,{onClick:x,children:[h.jsx(MC,{className:"mr-2 h-3.5 w-3.5"}),R("files.contextNewFolder"),h.jsx(An,{children:"⇧⌘N"})]}),S&&h.jsxs(Jt,{onClick:S,children:[h.jsx(RC,{className:"mr-2 h-3.5 w-3.5"}),R("files.contextNewFile"),h.jsx(An,{children:"⌘N"})]}),h.jsxs(Jt,{onClick:()=>navigator.clipboard.writeText(a),children:[h.jsx(Op,{className:"mr-2 h-3.5 w-3.5"}),R("files.contextCopyPath")]}),h.jsx(El,{}),h.jsxs(Jt,{onClick:E,children:[h.jsx(ao,{className:"mr-2 h-3.5 w-3.5"}),R("files.contextRefresh"),h.jsx(An,{children:"⌘R"})]}),k&&h.jsxs(h.Fragment,{children:[h.jsx(El,{}),h.jsxs(Jt,{onClick:k,children:[h.jsx(oo,{className:"mr-2 h-3.5 w-3.5"}),R("files.contextOpenTerminal")]})]})]})})]})}function MB(e){if(e.isDirectory)return h.jsx(fr,{className:"h-3.5 w-3.5 text-primary shrink-0"});switch(jB(e.name)){case"image":return h.jsx(bA,{className:"h-3.5 w-3.5 text-green-500 shrink-0"});case"code":return h.jsx(TC,{className:"h-3.5 w-3.5 text-blue-400 shrink-0"});case"doc":case"text":return h.jsx(cA,{className:"h-3.5 w-3.5 text-orange-400 shrink-0"});case"audio":return h.jsx(LA,{className:"h-3.5 w-3.5 text-purple-400 shrink-0"});case"video":return h.jsx(mO,{className:"h-3.5 w-3.5 text-red-400 shrink-0"});case"archive":return h.jsx(zp,{className:"h-3.5 w-3.5 text-yellow-500 shrink-0"});default:return h.jsx(RC,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"})}}const AB=w.memo(function({file:t,isSelected:s,isDragTarget:n,onSelect:a,onOpen:l,onContextMenu:u,onDragStart:f,onDragOver:m,onDragLeave:d,onDrop:_,t:g}){const b=y=>{a(t.path,y.metaKey||y.ctrlKey,y.shiftKey)};return h.jsxs("div",{role:"row",tabIndex:0,draggable:!0,className:fe("flex items-center text-xs cursor-pointer transition-colors","border-b border-border-subtle",s?"bg-accent text-foreground":"hover:bg-accent/30",n&&"ring-2 ring-inset ring-primary bg-accent"),onClick:b,onKeyDown:y=>{y.key==="Enter"&&l(t),y.key===" "&&(y.preventDefault(),b(y))},onDoubleClick:()=>l(t),onContextMenu:()=>u(t),onDragStart:y=>f(y,t),onDragOver:y=>t.isDirectory?m(y,t.path):void 0,onDragLeave:d,onDrop:y=>t.isDirectory?_(y,t.path):void 0,children:[h.jsxs("div",{className:"flex flex-1 items-center gap-1.5 px-3 py-1 min-w-0",children:[MB(t),h.jsx("span",{className:"truncate",children:t.name}),t.isSymlink&&h.jsx("span",{className:"text-[9px] text-muted-foreground bg-muted px-1 rounded",children:g("files.statusLink")})]}),h.jsx("div",{className:"w-20 px-3 py-1 text-right text-muted-foreground tabular-nums",children:t.isDirectory?"--":c4(t.size)}),h.jsx("div",{className:"w-36 px-3 py-1 text-muted-foreground",children:u4(t.modifyTime)})]})}),rp="application/x-transhub-files",e1=w.memo(function({title:t,isLocal:s,files:n,currentPath:a,loading:l,selectedFiles:u,onNavigate:f,onRefresh:m,onSelect:d,onOpen:_,onCreateFolder:g,onCreateFile:b,onDelete:y,onRename:x,onTransfer:S,transferLabel:E,onShowInFinder:k,onDropFiles:T,onOpenTerminal:D,onCompress:R,onExtract:z,onPreview:L,onInspect:j,onOpenInEditor:A,onOpenInCode:V,onGoHome:I,onGoRoot:J,onGoDefaultDir:$,defaultDirPath:B,onSetDefaultDir:K,onCopyPath:q,onOpenTerminalHere:M,onNativeFileDrop:H}){const{t:U}=Zg(),[ae,Y]=w.useState(!1),[O,Z]=w.useState("name"),[te,oe]=w.useState("asc"),[ce,he]=w.useState(void 0),[Se,me]=w.useState(null),[le,Ce]=w.useState(!1),je=w.useRef(null);w.useEffect(()=>{const xe=Te=>{var Ye;if(!(!((Ye=je.current)!=null&&Ye.contains(document.activeElement))&&je.current!==document.activeElement)){if(Te.key===" "&&L&&u.size===1){Te.preventDefault();const st=n.find(si=>u.has(si.path));st&&!st.isDirectory&&L(st)}if((Te.metaKey||Te.ctrlKey)&&Te.key==="r"&&(Te.preventDefault(),m()),(Te.metaKey||Te.ctrlKey)&&Te.shiftKey&&Te.key==="N"&&(Te.preventDefault(),g()),(Te.metaKey||Te.ctrlKey)&&!Te.shiftKey&&Te.key==="n"&&b&&(Te.preventDefault(),b()),(Te.metaKey||Te.ctrlKey)&&Te.key==="i"&&j&&u.size===1){Te.preventDefault();const st=n.find(si=>u.has(si.path));st&&j(st)}if((Te.metaKey||Te.ctrlKey)&&Te.key==="Backspace"&&u.size>0){Te.preventDefault();const st=n.filter(si=>u.has(si.path));st.length>0&&y(st)}if((Te.metaKey||Te.ctrlKey)&&Te.key==="c"&&u.size===1){const st=n.find(si=>u.has(si.path));st&&navigator.clipboard.writeText(st.path)}}};return document.addEventListener("keydown",xe),()=>document.removeEventListener("keydown",xe)},[u,n,L,m,g,b,j,y]);const it=w.useMemo(()=>n.filter(xe=>ae||!xe.name.startsWith(".")),[n,ae]),De=w.useMemo(()=>[...it].sort((xe,Te)=>{if(xe.isDirectory!==Te.isDirectory)return xe.isDirectory?-1:1;let Ye=0;switch(O){case"name":Ye=xe.name.localeCompare(Te.name);break;case"size":Ye=xe.size-Te.size;break;case"modified":Ye=xe.modifyTime-Te.modifyTime;break}return te==="asc"?Ye:-Ye}),[it,O,te]),ht=xe=>{O===xe?oe(Te=>Te==="asc"?"desc":"asc"):(Z(xe),oe("asc"))},br=()=>{const xe=a.split("/").slice(0,-1).join("/")||"/";f(xe)},Os=w.useCallback((xe,Te)=>{const Ye=u.has(Te.path)?n.filter(si=>u.has(si.path)):[Te];xe.dataTransfer.setData(rp,JSON.stringify({files:Ye,source:s?"local":"remote",sourcePath:a})),xe.dataTransfer.effectAllowed="copy";const st=document.createElement("div");st.className="fixed bg-card border border-border rounded-lg px-3 py-1.5 text-xs shadow-lg flex items-center gap-2 pointer-events-none",st.innerHTML=`<span>${Ye.length} item${Ye.length>1?"s":""}</span>`,st.style.position="absolute",st.style.top="-1000px",document.body.appendChild(st),xe.dataTransfer.setDragImage(st,0,0),setTimeout(()=>document.body.removeChild(st),0)},[u,n,s,a]),ln=w.useCallback((xe,Te)=>{xe.preventDefault(),xe.stopPropagation(),(xe.dataTransfer.types.includes(rp)||xe.dataTransfer.types.includes("Files"))&&(xe.dataTransfer.dropEffect="copy",Te?me(Te):Ce(!0))},[]),cn=w.useCallback(xe=>{xe.preventDefault(),me(null),Ce(!1)},[]),xr=w.useCallback((xe,Te)=>{xe.preventDefault(),xe.stopPropagation(),me(null),Ce(!1);const Ye=xe.dataTransfer.getData(rp);if(Ye){try{const{files:st,source:si}=JSON.parse(Ye);if(si===(s?"local":"remote"))return;const ea=Te||a;T==null||T(st,ea)}catch{}return}if(xe.dataTransfer.files.length>0){const st=Array.from(xe.dataTransfer.files),si=Te||a;H==null||H(st,si)}},[s,a,T,H]),un=w.useCallback(xe=>{u.has(xe.path)||d(xe.path,!1,!1),he(xe)},[u,d]),zs=w.useMemo(()=>De.filter(xe=>u.has(xe.path)),[De,u]);return h.jsxs("div",{ref:je,tabIndex:0,className:fe("flex h-full flex-col outline-none",le&&"ring-2 ring-inset ring-primary"),onDragOver:xe=>ln(xe),onDragLeave:cn,onDrop:xe=>xr(xe),children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-1",children:[h.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:t}),h.jsxs("div",{className:"flex items-center gap-0.5",children:[h.jsx(ge,{variant:"ghost",size:"icon-sm",onClick:()=>Y(!ae),title:U(ae?"files.hideHidden":"files.showHidden"),children:ae?h.jsx(DC,{className:"h-3.5 w-3.5"}):h.jsx(eA,{className:"h-3.5 w-3.5"})}),h.jsx(ge,{variant:"ghost",size:"icon-sm",onClick:g,title:U("files.newFolder")+" (⇧⌘N)",children:h.jsx(MC,{className:"h-3.5 w-3.5"})}),S&&zs.length>0&&h.jsxs(ge,{variant:"default",size:"sm",className:"h-6 px-2 text-[10px]",onClick:()=>S(zs),children:[s?h.jsx(Ql,{className:"h-3 w-3"}):h.jsx(Xn,{className:"h-3 w-3"}),E||U(s?"files.upload":"files.download")," (",zs.length,")"]})]})]}),h.jsxs("div",{className:"flex items-center gap-0.5 border-b border-border px-3 py-1",children:[h.jsx(ge,{variant:"ghost",size:"icon-sm",onClick:br,title:U("files.goUp"),children:h.jsx(P3,{className:"h-3.5 w-3.5"})}),I&&h.jsx(ge,{variant:"ghost",size:"icon-sm",onClick:I,title:U("files.home"),children:h.jsx(OC,{className:"h-3.5 w-3.5"})}),J&&h.jsx(ge,{variant:"ghost",size:"icon-sm",onClick:J,title:U("files.root"),children:h.jsx(mA,{className:"h-3.5 w-3.5"})}),$&&B&&h.jsx(ge,{variant:"ghost",size:"icon-sm",onClick:$,title:B,children:h.jsx(fr,{className:"h-3.5 w-3.5 text-primary"})}),h.jsx("div",{className:"flex-1 min-w-0",children:h.jsx(SB,{path:a,isLocal:s,onNavigate:f})}),q&&h.jsx(ge,{variant:"ghost",size:"icon-sm",onClick:q,title:U("files.copyPath"),children:h.jsx(Op,{className:"h-3.5 w-3.5"})}),M&&h.jsx(ge,{variant:"ghost",size:"icon-sm",onClick:M,title:U("files.openTerminal"),children:h.jsx(oo,{className:"h-3.5 w-3.5"})}),K&&h.jsx(ge,{variant:"ghost",size:"icon-sm",onClick:K,title:U("files.setDefault"),className:a===B?"text-red-500":"",children:h.jsx(vA,{className:fe("h-3.5 w-3.5",a===B&&"fill-current")})}),h.jsx(ge,{variant:"ghost",size:"icon-sm",onClick:m,disabled:l,title:U("files.refresh")+" (⌘R)",children:h.jsx(ao,{className:fe("h-3.5 w-3.5",l&&"animate-spin")})})]}),h.jsx(RB,{selectedFiles:u,files:De,isLocal:s,rightClickedFile:ce,currentPath:a,onOpen:_,onDelete:y,onRename:x,onTransfer:S,onCompress:R,onExtract:z,onPreview:L,onInspect:j,onShowInFinder:k,onCreateFolder:g,onCreateFile:b,onRefresh:m,onOpenTerminal:D,onOpenInEditor:A,onOpenInCode:V,t:U,children:h.jsxs("div",{className:"flex-1 overflow-auto",onContextMenu:xe=>{xe.target===xe.currentTarget&&he(void 0)},children:[h.jsxs("div",{className:"sticky top-0 z-10 flex items-center border-b border-border bg-muted text-[10px] text-muted-foreground font-medium",children:[h.jsxs("button",{className:"flex-1 px-3 py-1 text-left hover:text-foreground transition-colors",onClick:()=>ht("name"),children:[U("files.columnName")," ",O==="name"&&h.jsx("span",{className:"ml-0.5 text-[9px]",children:te==="asc"?"▲":"▼"})]}),h.jsxs("button",{className:"w-20 px-3 py-1 text-right hover:text-foreground transition-colors",onClick:()=>ht("size"),children:[U("files.columnSize")," ",O==="size"&&h.jsx("span",{className:"ml-0.5 text-[9px]",children:te==="asc"?"▲":"▼"})]}),h.jsxs("button",{className:"w-36 px-3 py-1 text-left hover:text-foreground transition-colors",onClick:()=>ht("modified"),children:[U("files.columnModified")," ",O==="modified"&&h.jsx("span",{className:"ml-0.5 text-[9px]",children:te==="asc"?"▲":"▼"})]})]}),De.map(xe=>h.jsx(AB,{file:xe,isSelected:u.has(xe.path),isDragTarget:Se===xe.path&&xe.isDirectory,onSelect:d,onOpen:_,onContextMenu:un,onDragStart:Os,onDragOver:ln,onDragLeave:cn,onDrop:xr,t:U},xe.path)),De.length===0&&!l&&h.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[h.jsx(fr,{className:"h-10 w-10 mb-2 opacity-20"}),h.jsx("p",{className:"text-xs",children:U("files.emptyDirectory")})]}),l&&h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(ao,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]})}),h.jsxs("div",{className:"flex items-center justify-between border-t border-border px-2 py-0.5 text-[10px] text-muted-foreground",children:[h.jsxs("span",{children:[it.length," ",U("files.statusItems"),!ae&&n.length!==it.length?` (${n.length-it.length} ${U("files.statusHidden")})`:""]}),u.size>0&&h.jsxs("span",{children:[u.size," ",U("files.statusSelected")]})]})]})}),t1={path:"",files:[],loading:!0,selected:new Set};function OB({server:e}){const[t,s]=w.useState({local:t1,remote:t1}),[n,a]=w.useState(null),[l,u]=w.useState(null),f=w.useRef({local:null,remote:null}),m=w.useRef({local:"",remote:""}),d=(j,A)=>s(V=>({...V,[j]:{...V[j],...A}})),_=w.useCallback(async(j,A)=>{d(j,{loading:!0});try{const V=j==="local"?await Fa.list(A):await Ua.list(e,A??".");m.current[j]=V.path,d(j,{path:V.path,files:V.entries,loading:!1,selected:new Set}),f.current[j]=null}catch(V){d(j,{loading:!1}),a(V.message)}},[e]);w.useEffect(()=>{_("local"),_("remote")},[_]),w.useEffect(()=>Tt.subscribe(A=>{if(A.type!=="transfer")return;const V=A;if(u(V.state==="done"||V.state==="failed"?null:V),V.state==="done"){const I=V.direction==="upload"?"remote":"local";_(I,m.current[I])}V.state==="failed"&&a(V.error??"The transfer failed")}),[_]);const g=j=>(A,V,I)=>s(J=>{const $=J[j];let B;if(I&&f.current[j]){const K=$.files.map(ae=>ae.path),q=K.indexOf(f.current[j]),M=K.indexOf(A),[H,U]=q<M?[q,M]:[M,q];B=new Set(K.slice(H,U+1))}else V?(B=new Set($.selected),B.has(A)?B.delete(A):B.add(A),f.current[j]=A):(B=new Set([A]),f.current[j]=A);return{...J,[j]:{...$,selected:B}}}),b=j=>A=>{if(A.isDirectory)return void _(j,A.path);j==="remote"&&window.open(Ua.downloadUrl(e,A.path),"_blank")},y=(j,A)=>j.endsWith("/")?`${j}${A}`:`${j}/${A}`,x=j=>(A,V)=>{const I=V||m.current[j==="local"?"remote":"local"],J=A.filter($=>!$.isDirectory);if(J.length===0){a("Directories cannot be transferred yet — select files.");return}pC.start({server:e,direction:j==="local"?"upload":"download",items:J.map($=>j==="local"?{local:$.path,remote:y(I,$.name)}:{local:y(I,$.name),remote:$.path})}).catch($=>a($.message))},S=j=>async A=>{if(window.confirm(`Delete ${A.length===1?A[0].name:`${A.length} items`}?`))try{for(const V of A)j==="local"?await Fa.remove(V.path,V.isDirectory):await Ua.remove(e,V.path,V.isDirectory);await _(j,m.current[j])}catch(V){a(V.message)}},E=j=>async A=>{const V=window.prompt("New name",A.name);if(!V||V===A.name)return;const I=A.path.slice(0,A.path.lastIndexOf("/"))||"/";try{j==="local"?await Fa.rename(A.path,y(I,V)):await Ua.rename(e,A.path,y(I,V)),await _(j,m.current[j])}catch(J){a(J.message)}},k=j=>async()=>{const A=window.prompt("Name of the new directory");if(!A)return;const V=m.current[j];try{j==="local"?await Fa.mkdir(y(V,A)):await Ua.mkdir(e,y(V,A)),await _(j,V)}catch(I){a(I.message)}},{tabs:T,addTab:D,activateTab:R}=Ie(),z=(j,A)=>j.includes("\\")&&!j.startsWith("/")?`${j.replace(/\\$/,"")}\\${A}`:`${j.replace(/\/$/,"")}/${A}`,L=j=>({isLocal:j==="local",files:t[j].files,currentPath:t[j].path,loading:t[j].loading,selectedFiles:t[j].selected,onNavigate:A=>void _(j,A),onRefresh:()=>void _(j,m.current[j]),onSelect:g(j),onOpen:b(j),onCreateFolder:k(j),onDelete:S(j),onRename:E(j),onTransfer:x(j),transferLabel:j==="local"?"Upload":"Download",onDropFiles:(A,V)=>x(j==="local"?"remote":"local")(A,V),onCopyPath:()=>{var A;return void((A=navigator.clipboard)==null?void 0:A.writeText(m.current[j]))},onCreateFile:()=>{const A=window.prompt("Name for the new file");if(!(A!=null&&A.trim()))return;const V=z(m.current[j],A.trim());(async()=>{try{j==="local"?await Fa.touch(V):await Ua.write(e,V,""),await _(j,m.current[j])}catch(I){a(I.message)}})()},onShowInFinder:j==="local"?A=>void Fa.reveal(A).catch(V=>a(V.message)):void 0,onOpenTerminal:j==="remote"?()=>{const A=T.find(V=>V.type==="ssh-terminal"&&V.title===e);if(A)return R(A.id);D({id:`tab-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,type:"ssh-terminal",title:e,serverId:e})}:void 0});return h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[n&&h.jsxs("div",{className:"flex items-center justify-between border-b border-destructive/30 bg-destructive-light px-4 py-2 text-sm",children:[h.jsx("span",{children:n}),h.jsx("button",{className:"text-xs underline",onClick:()=>a(null),children:"dismiss"})]}),l&&h.jsxs("div",{className:"border-b border-border bg-muted px-4 py-1.5 text-xs text-muted-foreground",children:[l.direction==="upload"?"Uploading":"Downloading"," — ",l.done," of ",l.total,l.file&&h.jsx("span",{className:"ml-2 font-mono",children:l.file})]}),h.jsx("div",{className:"min-h-0 flex-1",children:h.jsxs(sp,{defaultSizes:[1,1],children:[h.jsx(sp.Pane,{minSize:260,children:h.jsx(e1,{title:"This machine",...L("local"),onGoHome:()=>void _("local")})}),h.jsx(sp.Pane,{minSize:260,children:h.jsx(e1,{title:e,...L("remote"),onGoHome:()=>void _("remote","."),onGoRoot:()=>void _("remote","/")})})]})})]})}function qn({icon:e,title:t,hint:s,action:n}){return h.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center",children:[h.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-full bg-primary/10",children:h.jsx(e,{className:"h-7 w-7 text-primary"})}),h.jsx("p",{className:"text-sm font-medium",children:t}),s&&h.jsx("p",{className:"max-w-sm text-xs leading-relaxed text-muted-foreground",children:s}),n&&h.jsx("div",{className:"mt-1",children:n})]})}function zB(e){const t=Math.round(e/1e3);if(t<60)return`${t}s`;const s=Math.floor(t/60);return s<60?`${s}m ${t%60}s`:`${Math.floor(s/60)}h ${s%60}m`}const LB={readonly:"read only",restricted:"restricted",unrestricted:"unrestricted"};function BB(){const e=Ie(d=>d.setView),{pending:t,drop:s}=r2(),[n,a]=w.useState(null),[l,u]=w.useState(null),f=async(d,_)=>{a(d);try{await Tt.decide(d,_),s(d)}finally{a(null)}},m=async(d,_)=>{try{await navigator.clipboard.writeText(_),u(d),setTimeout(()=>u(g=>g===d?null:g),1500)}catch{}};return h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[h.jsx(Qn,{title:"Waiting",count:t.length,hint:"An agent paused on these commands. Nothing runs until you decide."}),t.length===0?h.jsx(qn,{icon:mh,title:"Nothing is waiting",hint:"Nothing pauses here until you ask it to. Open a server, set Approval to destructive or always, and its agent will stop and wait for you before acting.",action:h.jsxs(ge,{size:"sm",onClick:()=>e("servers"),children:[h.jsx(Fh,{className:"h-3.5 w-3.5"}),"Set it up on a server"]})}):h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-8 pb-10 pt-6",children:h.jsx("div",{className:"flex max-w-5xl flex-col gap-4",children:t.map(d=>h.jsxs("article",{className:"overflow-hidden rounded-xl border border-border bg-card",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2 border-b border-border px-5 py-3.5",children:[h.jsx("h2",{className:"text-base font-bold",children:d.server}),h.jsxs("span",{className:"font-mono text-[12.5px] text-muted-foreground",children:[d.user,"@",d.host]}),h.jsx("span",{className:"inline-flex h-6 items-center rounded-md border border-border px-2 font-mono text-xs text-muted-foreground",children:d.tool}),d.mode!=="unrestricted"&&h.jsx("span",{className:"inline-flex h-6 items-center rounded-md bg-secondary px-2 text-xs text-secondary-foreground",children:LB[d.mode]}),h.jsxs("span",{className:"ml-auto inline-flex items-center gap-1.5 text-[13px] text-muted-foreground tabular-nums",children:[h.jsx(mh,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"waiting ",zB(d.waitingMs)]})]}),d.destructive&&h.jsxs("div",{className:"flex items-start gap-2.5 bg-destructive-light px-5 py-3 text-sm text-destructive",children:[h.jsx(ph,{className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),h.jsxs("p",{children:[h.jsx("b",{children:"Destructive."})," This command can delete or overwrite data, and nothing on the server will undo it."]})]}),h.jsx("div",{className:"px-5 py-4",children:h.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-border bg-secondary py-3 pl-4 pr-2",children:[h.jsx("pre",{className:"min-w-0 flex-1 overflow-x-auto whitespace-pre-wrap break-all font-mono text-[14.5px] leading-relaxed",children:d.command||"(no command)"}),d.command&&h.jsx("button",{type:"button","aria-label":l===d.id?"Copied":"Copy the command",title:l===d.id?"Copied":"Copy the command",onClick:()=>void m(d.id,d.command),className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-card hover:text-foreground",children:l===d.id?h.jsx(ro,{className:"h-4 w-4"}):h.jsx(NC,{className:"h-4 w-4"})})]})}),h.jsxs("div",{className:"flex flex-wrap justify-end gap-2.5 px-5 pb-4",children:[h.jsxs(ge,{variant:"outline",className:"h-11 px-5 font-bold",disabled:n===d.id,onClick:()=>void f(d.id,!1),children:[h.jsx(vr,{className:"h-4 w-4"}),"Refuse"]}),h.jsxs(ge,{variant:d.destructive?"destructive":"default",className:fe("h-11 px-5 font-bold"),disabled:n===d.id,onClick:()=>void f(d.id,!0),children:[h.jsx(ro,{className:"h-4 w-4"}),d.destructive?"Approve and run":"Approve"]})]})]},d.id))})})]})}const Wl=new Map;let Ga=typeof Notification>"u"?"unsupported":Notification.permission;async function hE(){if(new URLSearchParams(window.location.search).has("shell")||Ga==="unsupported")return!1;if(Ga==="granted")return!0;if(Ga==="denied")return!1;try{return Ga=await Notification.requestPermission(),Ga==="granted"}catch{return!1}}function PB(e,t){var a;if(Ga!=="granted"||Wl.has(e.id))return;const s=((a=e.command)==null?void 0:a.trim())??"",n=s.length>140?`${s.slice(0,137)}…`:s||e.tool;try{const l=new Notification(e.destructive?`${e.server}: destructive command waiting`:`${e.server}: waiting for you`,{body:n,tag:e.id,requireInteraction:e.destructive,silent:!e.destructive});l.onclick=()=>{window.focus(),t(),l.close()},Wl.set(e.id,l)}catch{}}function dE(e){const t=Wl.get(e);if(t){try{t.close()}catch{}Wl.delete(e)}}function HB(){for(const e of[...Wl.keys()])dE(e)}function IB(e,t){return e>=t+10?"over":e>=t?"near":"ok"}const $B={over:"bg-destructive",near:"bg-warning",ok:"bg-meter"},UB={over:"text-destructive",near:"text-warning",ok:""};function np({label:e,percent:t,detail:s,threshold:n,mono:a}){if(t===void 0)return null;const l=Math.max(0,Math.min(100,Math.round(t))),u=IB(l,n);return h.jsxs("div",{className:"grid gap-1.5",children:[h.jsxs("div",{className:fe("flex items-baseline justify-between gap-3 text-[13px]",UB[u]),children:[h.jsx("span",{className:fe("min-w-0 truncate",a&&"font-mono",u!=="ok"&&"font-bold"),children:e}),h.jsxs("span",{className:"font-bold tabular-nums",children:[l,"%"]})]}),h.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-sunk",children:h.jsx("div",{className:fe("h-full rounded-full transition-[width]",$B[u]),style:{width:`${l}%`}})}),s&&h.jsxs("p",{className:"text-xs text-muted-foreground",children:[s,u!=="ok"&&` · over the ${n}% threshold`]})]})}function FB(){const[e,t]=w.useState(null),[s,n]=w.useState(!1),[a,l]=w.useState({cpu:80,memory:90,disk:85,enabled:!0});w.useEffect(()=>{Rp.get().then(_=>l(_.thresholds)).catch(()=>{})},[]);const u=async _=>{n(!0);try{const g=await v3.check(_);t(y=>_&&y?y.map(x=>g.results.find(S=>S.server===x.server)??x):g.results);const b=g.results.filter(y=>{var x;return(((x=y.alerts)==null?void 0:x.length)??0)>0});if(b.length>0&&await hE())for(const y of b)new Notification(`${y.server}: ${y.alerts[0].type} over threshold`,{body:y.alerts.map(x=>x.message).join(`
499
+ `),tag:`health:${y.server}`})}finally{n(!1)}},f=(e==null?void 0:e.filter(_=>_.reachable).length)??0,m=(e==null?void 0:e.filter(_=>{var g;return _.reachable&&(((g=_.alerts)==null?void 0:g.length)??0)>0}).length)??0,d=((e==null?void 0:e.length)??0)-f;return h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[h.jsx(Qn,{title:"Health",count:e==null?void 0:e.length,hint:"Probed when you ask. Nothing runs in the background.",actions:h.jsxs(ge,{className:"font-bold",disabled:s,onClick:()=>void u(),children:[s?h.jsx(ss,{className:"h-4 w-4 animate-spin"}):h.jsx(ao,{className:"h-4 w-4"}),"Check every server"]})}),h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto px-8 pb-10 pt-5",children:[e!==null&&e.length>0&&h.jsxs("div",{className:"mb-5 flex flex-wrap gap-2","aria-label":"Summary",children:[h.jsxs("span",{className:"inline-flex h-8 items-center gap-2 rounded-full bg-success-light px-3 text-[13px] font-bold text-success",children:[h.jsx("span",{className:"h-2 w-2 rounded-full bg-success","aria-hidden":"true"}),f," reachable"]}),m>0&&h.jsxs("span",{className:"inline-flex h-8 items-center gap-2 rounded-full bg-warning-light px-3 text-[13px] font-bold text-warning",children:[h.jsx(ph,{className:"h-3.5 w-3.5","aria-hidden":"true"}),m," over a threshold"]}),d>0&&h.jsxs("span",{className:"inline-flex h-8 items-center gap-2 rounded-full bg-destructive-light px-3 text-[13px] font-bold text-destructive",children:[h.jsx(gO,{className:"h-3.5 w-3.5","aria-hidden":"true"}),d," unreachable"]})]}),e===null?h.jsx(qn,{icon:AC,title:"Nothing probed yet",hint:"Each check opens one SSH connection and closes it. Press the button when you want to know."}):h.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(300px,1fr))] gap-4",children:e.map(_=>{var g,b,y,x,S;return h.jsxs("article",{className:"flex flex-col rounded-xl border border-border bg-card",children:[h.jsxs("div",{className:"flex items-center gap-2.5 px-4 pb-3 pt-3.5",children:[h.jsx("h2",{className:"min-w-0 truncate text-base font-bold",children:_.server}),h.jsx("span",{className:fe("inline-flex h-6 shrink-0 items-center rounded-md px-2 text-xs font-bold",_.reachable?"bg-success-light text-success":"bg-destructive-light text-destructive"),children:_.reachable?"Reachable":"Unreachable"}),h.jsx("button",{type:"button","aria-label":`Recheck ${_.server}`,title:"Recheck",disabled:s,className:"ml-auto flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground disabled:opacity-50",onClick:()=>void u(_.server),children:h.jsx(ao,{className:"h-4 w-4"})})]}),_.reachable?h.jsxs("div",{className:"grid gap-3.5 px-4 pb-4",children:[(((g=_.alerts)==null?void 0:g.length)??0)>0&&h.jsx("div",{className:"rounded-lg bg-warning-light px-3 py-2 text-warning",children:_.alerts.map(E=>h.jsxs("p",{className:"flex items-start gap-1.5 text-xs font-medium",children:[h.jsx(ph,{className:"mt-0.5 h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),E.message]},E.type))}),h.jsx(np,{label:"CPU",percent:(b=_.cpu)==null?void 0:b.percent,threshold:a.cpu,detail:_.load_average?`load ${_.load_average}`:void 0}),h.jsx(np,{label:"Memory",percent:(y=_.memory)==null?void 0:y.percent,threshold:a.memory,detail:((x=_.memory)==null?void 0:x.used_mb)!==void 0&&_.memory.total_mb!==void 0?`${Math.round(_.memory.used_mb/1024)} of ${Math.round(_.memory.total_mb/1024)} GB`:void 0}),(S=_.disks)==null?void 0:S.map(E=>h.jsx(np,{label:E.mount,mono:!0,percent:E.percent,threshold:a.disk,detail:`${E.used} of ${E.size}, ${E.avail} free`},E.mount))]}):h.jsx("div",{className:"px-4 pb-4",children:h.jsxs("div",{className:"rounded-lg border border-border bg-secondary px-3.5 py-3",children:[h.jsx("p",{className:"text-sm font-bold",children:_.error??"No answer"}),h.jsxs("p",{className:"mt-1 font-mono text-xs text-muted-foreground",children:[_.host," · gave up after ",_.tookMs," ms"]})]})}),h.jsx("p",{className:"mt-auto border-t border-border px-4 py-2.5 text-xs text-muted-foreground",children:_.reachable?h.jsxs(h.Fragment,{children:[_.uptime,` · answered in ${_.tookMs} ms`]}):"Recheck once the host or the network is back."})]},_.server)})})]})]})}function fE({content:e,rows:t}){const s=Math.min(24,Math.max(3,e.split(`
500
+ `).length)),n=w.useRef(null),a=w.useRef(null),l=w.useRef(""),u=Uh(f=>f.resolved);return w.useEffect(()=>{if(!n.current)return;const f=new G2({fontFamily:"'JetBrains Mono', 'SF Mono', monospace",fontSize:12,theme:io[u],disableStdin:!0,cursorStyle:"bar",cursorInactiveStyle:"none",rows:t??3,scrollback:5e3,convertEol:!0}),m=new X2;f.loadAddon(m),f.open(n.current),m.fit(),a.current={term:f,fit:m},l.current="";const d=new ResizeObserver(()=>{var _;((_=n.current)==null?void 0:_.offsetParent)!==null&&m.fit()});return d.observe(n.current),()=>{d.disconnect(),f.dispose(),a.current=null}},[t]),w.useEffect(()=>{var m;const f=(m=a.current)==null?void 0:m.term;!f||t||f.rows!==s&&f.resize(f.cols,s)},[s,t]),w.useEffect(()=>{a.current&&(a.current.term.options.theme=io[u])},[u]),w.useEffect(()=>{var m;const f=(m=a.current)==null?void 0:m.term;f&&(e.startsWith(l.current)?f.write(e.slice(l.current.length)):(f.reset(),f.write(e)),l.current=e)},[e]),h.jsx("div",{ref:n,className:"px-2 py-1",style:{background:io[u].background}})}function VB(){const[e,t]=w.useState([]),[s,n]=w.useState(new Set);w.useEffect(()=>{const f=()=>Tt.streams().then(m=>t(m.streams)).catch(()=>{});return f(),Tt.subscribe(m=>{m.type==="stream"&&f()})},[]);const{running:a,finished:l}=w.useMemo(()=>({running:e.filter(f=>f.code===null),finished:e.filter(f=>f.code!==null)}),[e]),u=f=>n(m=>{const d=new Set(m);return d.has(f)?d.delete(f):d.add(f),d});return h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[h.jsx(Qn,{title:"Live",count:e.length,hint:"What your agents are running, as it happens.",children:a.length>0&&h.jsxs("span",{className:"flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground",children:[h.jsxs("span",{className:"relative flex h-2 w-2",children:[h.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-success opacity-60"}),h.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-success"})]}),a.length," running"]})}),e.length===0?h.jsx(qn,{icon:BC,title:"No command is running",hint:"When an agent runs something on one of your servers it appears here as it happens, output included. Nothing is written to disk."}):h.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto p-6",children:[...a,...l].map(f=>{const m=s.has(f.id);return h.jsxs("article",{className:"overflow-hidden rounded-lg border border-border bg-card",children:[h.jsxs("button",{onClick:()=>u(f.id),className:"flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-card-hover",children:[m?h.jsx(Xl,{className:"h-3.5 w-3.5 shrink-0"}):h.jsx(Qg,{className:"h-3.5 w-3.5 shrink-0"}),h.jsx("span",{className:"shrink-0 text-xs font-medium",children:f.server}),h.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:f.command}),f.code===null?h.jsx(rs,{variant:"secondary",children:"running"}):h.jsxs(rs,{variant:f.code===0?"outline":"destructive",children:["exit ",f.code]})]}),m&&h.jsx("div",{className:"border-t border-border-subtle",children:h.jsx(fE,{content:f.scrollback||`(no output yet)\r
501
+ `})})]},f.id)})})]})}function WB(){const[e,t]=w.useState("commands"),[s,n]=w.useState([]),[a,l]=w.useState([]),[u,f]=w.useState(!1),[m,d]=w.useState(null);w.useEffect(()=>{const g=()=>gx.get().then(b=>{l(b.entries),f(b.recordsOutput)}).catch(()=>{});return g(),Tt.subscribe(b=>{b.type==="stream"&&g()})},[]),w.useEffect(()=>(Tt.get().then(g=>n(g.timeline)).catch(()=>{}),Tt.subscribe(g=>{g.type==="timeline"&&g.entry&&n(b=>[g.entry,...b].slice(0,500))})),[]);const _=h.jsxs(Qn,{title:"Activity",hint:"What your agents ran, and what you decided.",children:[[["commands","Commands",a.length],["decisions","Decisions",s.length]].map(([g,b,y],x)=>h.jsxs("button",{onClick:()=>t(g),style:x>0?{marginLeft:"0.25rem"}:void 0,className:fe("rounded-md px-2 py-1 text-xs transition-colors",e===g?"bg-accent text-primary":"text-muted-foreground hover:text-foreground"),children:[b,y>0&&h.jsx("span",{className:"ml-1 text-[10px] text-muted-foreground",children:y})]},g)),e==="commands"&&a.length>0&&h.jsx("button",{className:"ml-auto text-[10px] text-muted-foreground hover:text-foreground",onClick:async()=>{window.confirm("Clear the command history on this machine?")&&(await gx.clear(),l([]))},children:"clear"})]});return e==="commands"?h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[_,a.length===0?h.jsx(qn,{icon:oo,title:"No command recorded yet",hint:"Everything your agents run is written down here, on this machine — nothing to configure on the servers."+(u?"":" Output is not kept; set SSH_MANAGER_LOG_OUTPUT=1 if you want it.")}):h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:h.jsx("ol",{children:a.map((g,b)=>{const y=`${g.ts}-${b}`,x=m===y;return h.jsxs("li",{className:"border-b border-border-subtle",children:[h.jsxs("button",{onClick:()=>d(x?null:y),disabled:!g.output,className:"flex w-full items-start gap-2 px-6 py-2.5 text-left hover:bg-card-hover disabled:cursor-default",children:[g.output?x?h.jsx(Xl,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}):h.jsx(Qg,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}):h.jsx("span",{className:"w-3.5"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx("span",{className:"text-xs font-medium",children:g.server}),h.jsxs(rs,{variant:g.code===0?"outline":"destructive",children:["exit ",g.code??"—"]}),g.durationMs!==void 0&&h.jsx("span",{className:"text-[10px] text-muted-foreground tabular-nums",children:g.durationMs<1e3?`${g.durationMs} ms`:`${(g.durationMs/1e3).toFixed(1)} s`})]}),h.jsx("code",{className:"mt-0.5 block truncate font-mono text-xs text-muted-foreground",children:g.command})]}),h.jsx("time",{className:"shrink-0 text-[10px] text-muted-foreground tabular-nums",dateTime:g.ts,children:new Date(g.ts).toLocaleString()})]}),x&&g.output&&h.jsx(fE,{content:g.output,rows:12})]},y)})})})]}):s.length===0?h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[_,h.jsx(qn,{icon:EC,title:"Nothing recorded yet",hint:"Every approval you granted or refused appears here. What agents ran is under Commands."})]}):h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[_,h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:h.jsx("ol",{children:s.map((g,b)=>{const y=g.allowed!==void 0,x=y?g.allowed?ro:vr:zC;return h.jsxs("li",{className:"flex gap-3 border-b border-border-subtle px-6 py-2.5 hover:bg-card-hover",children:[h.jsx(x,{className:fe("mt-0.5 h-3.5 w-3.5 shrink-0",y?g.allowed?"text-success":"text-destructive":"text-muted-foreground")}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx("span",{className:"text-xs font-medium",children:g.server??"—"}),g.tool&&h.jsx(rs,{variant:"outline",children:g.tool}),y&&h.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[g.allowed?"approved":"refused",g.source&&` · ${g.source}`]})]}),g.command&&h.jsx("code",{className:"mt-0.5 block truncate font-mono text-xs text-muted-foreground",children:g.command}),g.reason&&!/^approval (allow|deny)$/.test(g.reason)&&h.jsx("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:g.reason})]}),h.jsx("time",{className:"shrink-0 text-[10px] text-muted-foreground tabular-nums",dateTime:g.ts,children:new Date(g.ts).toLocaleTimeString()})]},`${g.ts}-${b}`)})})})]})}function KB({group:e,onClose:t,onSaved:s}){const n=zt(z=>z.servers),[a,l]=w.useState((e==null?void 0:e.name)??""),[u,f]=w.useState((e==null?void 0:e.description)??""),[m,d]=w.useState(new Set((e==null?void 0:e.servers)??[])),[_,g]=w.useState((e==null?void 0:e.strategy)??"parallel"),[b,y]=w.useState(String((e==null?void 0:e.delay)??0)),[x,S]=w.useState(!!(e!=null&&e.stopOnError)),[E,k]=w.useState(!1),[T,D]=w.useState(null),R=z=>d(L=>{const j=new Set(L);return j.has(z)?j.delete(z):j.add(z),j});return h.jsx(Jl,{open:!0,onOpenChange:z=>!z&&t(),children:h.jsxs(ec,{className:"sm:max-w-lg",children:[h.jsxs(rv,{children:[h.jsx(tc,{children:e?`Edit ${e.name}`:"New group"}),h.jsxs(ic,{children:["A group runs one command across several machines. Stored in"," ",h.jsx("code",{className:"font-mono text-xs",children:".server-groups.json"}),"."]})]}),h.jsxs("div",{className:"grid gap-3",children:[h.jsxs("div",{className:"grid gap-1.5",children:[h.jsx(ks,{children:"Name"}),h.jsx(lt,{value:a,disabled:!!e,placeholder:"web-tier",onChange:z=>l(z.target.value.replace(/[^a-zA-Z0-9_-]/g,""))})]}),h.jsxs("div",{className:"grid gap-1.5",children:[h.jsxs(ks,{children:["Description ",h.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),h.jsx(lt,{value:u,onChange:z=>f(z.target.value)})]}),h.jsxs("div",{className:"grid gap-1.5",children:[h.jsxs(ks,{children:["Servers",h.jsxs("span",{className:"ml-1.5 font-normal text-muted-foreground",children:[m.size," of ",n.length]})]}),n.length===0?h.jsx("p",{className:"text-xs text-muted-foreground",children:"No server in the vault yet — add one first."}):h.jsx("div",{className:"flex flex-wrap gap-1.5 rounded-md border border-border p-2",children:n.map(z=>h.jsx("button",{onClick:()=>R(z.name),className:fe("rounded-md border px-2 py-1 text-xs transition-colors",m.has(z.name)?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground hover:bg-accent/30"),children:z.name},z.name))})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[h.jsxs("div",{className:"grid gap-1.5",children:[h.jsx(ks,{children:"Order"}),h.jsxs("select",{value:_,onChange:z=>g(z.target.value),className:"h-9 rounded-md border border-input bg-transparent px-3 text-sm focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none",children:[h.jsx("option",{value:"parallel",children:"all at once"}),h.jsx("option",{value:"sequential",children:"one after another"})]})]}),h.jsxs("div",{className:"grid gap-1.5",children:[h.jsxs(ks,{children:["Delay",h.jsx("span",{className:"ml-1.5 font-normal text-muted-foreground",children:"ms between servers"})]}),h.jsx(lt,{type:"number",value:b,disabled:_==="parallel",onChange:z=>y(z.target.value)})]})]}),h.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[h.jsx("input",{type:"checkbox",checked:x,onChange:z=>S(z.target.checked),className:"h-3.5 w-3.5"}),"Stop at the first failure",h.jsx("span",{className:"text-xs text-muted-foreground",children:"— otherwise every server is attempted"})]}),T&&h.jsx("p",{className:"text-sm text-destructive",children:T})]}),h.jsxs(nv,{children:[h.jsx(ge,{variant:"ghost",onClick:t,children:"Cancel"}),h.jsx(ge,{disabled:E||!a||m.size===0,onClick:async()=>{k(!0),D(null);try{await Mp.save({name:a,description:u,servers:[...m],strategy:_,delay:Number(b)||0,stopOnError:x}),s()}catch(z){D(z.message)}finally{k(!1)}},children:E?"Saving…":"Save"})]})]})})}function mE({className:e,orientation:t="horizontal",...s}){return h.jsx(YR,{"data-slot":"tabs","data-orientation":t,orientation:t,className:fe("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...s})}const qB=sv("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function pE({className:e,variant:t="default",...s}){return h.jsx(GR,{"data-slot":"tabs-list","data-variant":t,className:fe(qB({variant:t}),e),...s})}function ws({className:e,...t}){return h.jsx(XR,{"data-slot":"tabs-trigger",className:fe("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function Cs({className:e,...t}){return h.jsx(ZR,{"data-slot":"tabs-content",className:fe("flex-1 outline-none",e),...t})}function YB(){const[e,t]=w.useState(null),[s,n]=w.useState(""),[a,l]=w.useState(""),[u,f]=w.useState(""),[m,d]=w.useState(""),[_,g]=w.useState(null),[b,y]=w.useState(!1),[x,S]=w.useState(null),[E,k]=w.useState(""),[T,D]=w.useState(0),R=()=>gl.status().then(t);w.useEffect(()=>{let j=!1;const A=()=>{gl.status().then(I=>{j||t(I)}).catch(I=>{j||S(I.message)})};A();const V=Tt.subscribe(I=>{(I.type==="servers"||I.type==="connection"&&I.status==="connected")&&A()});return()=>{j=!0,V()}},[]);const z=async j=>{y(!0),S(null),k("");try{await j()}catch(A){S(A.message)}finally{y(!1)}},L=()=>{g(null),d(""),f(""),D(j=>j+1)};return h.jsxs("div",{className:"max-w-3xl space-y-5",children:[h.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border bg-card p-4",children:[h.jsx(Fh,{"aria-hidden":"true",className:"mt-0.5 h-5 w-5 shrink-0 text-primary"}),h.jsxs("div",{children:[h.jsx("h2",{className:"text-sm font-medium",children:"A recovery copy you can take with you"}),h.jsx("p",{className:"mt-1 text-sm leading-relaxed text-muted-foreground",children:"Your vault is encrypted with a key on this machine. Keep a recovery backup somewhere safe before moving to another computer or reinstalling. You will need its passphrase to restore it."}),e&&h.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:e.readable?`${e.servers} saved server${e.servers===1?"":"s"} · ${e.secrets} encrypted secret${e.secrets===1?"":"s"}`:"The vault cannot be unlocked. Restore a recovery backup to recover access."}),h.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Backups include saved servers and their credentials. Groups, preferences, host keys and original .env / TOML files need a separate backup."})]})]}),h.jsxs("form",{className:"grid gap-3 rounded-lg border border-border bg-card p-4",onSubmit:j=>{j.preventDefault(),z(async()=>{const A=await gl.backup(s),V=URL.createObjectURL(new Blob([A.content],{type:"application/json"})),I=document.createElement("a");I.href=V,I.download=A.filename,document.body.appendChild(I),I.click(),I.remove(),setTimeout(()=>URL.revokeObjectURL(V),1e4),n(""),l(""),k("Recovery backup downloaded. Keep the file and its passphrase safe.")})},children:[h.jsxs("h3",{className:"flex items-center gap-2 text-sm font-medium",children:[h.jsx(Jg,{"aria-hidden":"true",className:"h-4 w-4"})," Create a recovery backup"]}),h.jsx("label",{htmlFor:"backup-passphrase",className:"text-xs font-medium",children:"Backup passphrase"}),h.jsx(lt,{id:"backup-passphrase",type:"password",minLength:8,autoComplete:"new-password",required:!0,value:s,onChange:j=>n(j.target.value),placeholder:"At least 8 characters; a longer phrase is better"}),h.jsx("label",{htmlFor:"backup-confirmation",className:"text-xs font-medium",children:"Confirm backup passphrase"}),h.jsx(lt,{id:"backup-confirmation",type:"password",minLength:8,autoComplete:"new-password",required:!0,value:a,onChange:j=>l(j.target.value)}),a&&a!==s&&h.jsx("p",{className:"text-xs text-destructive",children:"The passphrases do not match."}),h.jsxs(ge,{type:"submit",className:"w-fit",disabled:b||!(e!=null&&e.readable)||e.servers===0||s.length<8||a!==s,children:[h.jsx(Xn,{className:"h-4 w-4"})," Download recovery backup"]})]}),h.jsxs("form",{className:"grid gap-3 rounded-lg border border-border bg-card p-4",onSubmit:j=>{j.preventDefault(),z(async()=>{if(!_){g(await gl.preview(m,u));return}const A=_;g(null),await gl.restore(m,u,A.revision),L(),await R(),k("Recovery complete. Your restored servers are available in Servers.")})},children:[h.jsxs("h3",{className:"flex items-center gap-2 text-sm font-medium",children:[h.jsx(A3,{"aria-hidden":"true",className:"h-4 w-4"})," Restore a recovery backup"]}),h.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"Choose an encrypted SSH Manager recovery file. Review the server names before confirming any changes."}),h.jsx("label",{htmlFor:"recovery-file",className:"text-xs font-medium",children:"Recovery file"}),h.jsx(lt,{id:"recovery-file",type:"file",accept:".json,application/json",disabled:b||!!_,onChange:j=>{var V;const A=(V=j.target.files)==null?void 0:V[0];g(null),d(""),A&&z(async()=>{if(A.size>16*1024*1024)throw new Error("Recovery files must be at most 16 MB. Use ssh-manager vault restore for larger files.");d(await A.text())})}},T),h.jsx("label",{htmlFor:"restore-passphrase",className:"text-xs font-medium",children:"Recovery passphrase"}),h.jsx(lt,{id:"restore-passphrase",type:"password",autoComplete:"off",disabled:b||!!_,required:!0,value:u,onChange:j=>{f(j.target.value),g(null)}}),_&&h.jsxs("div",{className:"space-y-2 rounded-lg border border-primary/30 bg-primary/5 p-3","aria-label":"Recovery preview",children:[h.jsxs("h4",{className:"text-sm font-medium",children:["Ready to restore ",_.servers.length," server",_.servers.length===1?"":"s"]}),h.jsx("ul",{className:"max-h-40 overflow-y-auto text-sm",children:_.servers.map(j=>h.jsxs("li",{children:[j,_.conflicts.includes(j)?" — replaces saved server":" — adds server"]},j))}),_.replacesUnreadable&&h.jsx("p",{className:"text-sm text-destructive",children:"The unreadable vault will be replaced by this backup."}),_.removed.length>0&&h.jsxs("p",{className:"text-sm text-destructive",children:["Servers missing from the backup will be removed: ",_.removed.join(", "),"."]}),h.jsx("p",{className:"text-xs text-muted-foreground",children:_.replacesUnreadable?"Other settings and original configuration files stay unchanged.":"Other saved servers, settings and original configuration files stay unchanged."})]}),h.jsxs("div",{className:"flex flex-wrap gap-2",children:[h.jsx(ge,{type:"submit",disabled:b||!m||!u,children:b?"Working…":_?"Confirm restore":"Preview recovery"}),(m||u||_)&&h.jsx(ge,{type:"button",variant:"ghost",disabled:b,onClick:()=>{L(),S(null)},children:"Cancel recovery"})]})]}),x&&h.jsx("p",{role:"alert",className:"text-sm text-destructive",children:x}),E&&h.jsx("p",{role:"status",className:"text-sm text-primary",children:E})]})}const i1={app:"the desktop app",npm:"npm"};function GB(e){if(!e.installed)return"Not found on this machine";const t=e.version?` ${e.version}`:"";return e.engine==="app"?`Runs the desktop app's engine${t}`:e.engine==="npm"?`Runs the npm engine${t}`:e.engine==="other"?"Runs another ssh-manager (a checkout or a custom command)":"No ssh-manager entry yet"}function XB(e){return e.id==="claude-code"?"Start a new Claude Code session for it to take effect.":`Restart ${e.name} for it to take effect.`}function ZB(){const[e,t]=w.useState(null),[s,n]=w.useState(null),[a,l]=w.useState(null),[u,f]=w.useState(null);if(w.useEffect(()=>{let _=!1;const g=()=>{_x.status().then(y=>{_||(t(y),n(null))}).catch(y=>{_||n(y.message)})};g();const b=Tt.subscribe(y=>{y.type==="agents"&&g()});return()=>{_=!0,b()}},[]),!e)return s?h.jsx("p",{className:"text-sm text-destructive",children:s}):h.jsx(ss,{className:"h-5 w-5 animate-spin text-muted-foreground"});const m=async(_,g)=>{l(`${_.id}:${g}`),n(null),f(null);try{const{client:b}=await _x.use(_.id,g);t(y=>y&&{...y,clients:y.clients.map(x=>x.id===b.id?b:x)}),f({id:_.id,message:`${_.name} now uses ${i1[g]}. ${XB(_)}`})}catch(b){n(`${_.name}: ${b.message}`)}finally{l(null)}},d=[e.engines.app,e.engines.npm];return h.jsxs("div",{className:"max-w-3xl space-y-4",children:[h.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[h.jsxs("h2",{className:"flex items-center gap-2 text-sm font-medium",children:[h.jsx(I3,{"aria-hidden":"true",className:"h-4 w-4 text-primary"}),"Which ssh-manager your AI tools start"]}),h.jsx("p",{className:"mt-1 text-sm leading-relaxed text-muted-foreground",children:"An AI tool starts ssh-manager itself, from the command in its settings. It can be the one installed with npm or the one inside the desktop app — the same engine either way; the app's needs no Node. Changing it rewrites that one entry and nothing else."}),h.jsx("dl",{className:"mt-3 grid gap-2 text-xs sm:grid-cols-2",children:["app","npm"].map((_,g)=>{const b=d[g];return h.jsxs("div",{className:"rounded-md border border-border-subtle px-3 py-2",children:[h.jsx("dt",{className:"font-medium",children:_==="app"?"Desktop app":"npm"}),h.jsx("dd",{className:"mt-0.5 text-muted-foreground",children:b?`${b.version??"unknown version"}`:_==="app"?"Not installed here":"Not installed with npm"}),b&&h.jsx("dd",{className:"mt-0.5 truncate font-mono text-[10px] text-muted-foreground",title:b.args[0],children:b.args[0]})]},_)})})]}),s&&h.jsx("p",{role:"alert",className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:s}),h.jsx("ul",{className:"overflow-hidden rounded-lg border border-border","aria-label":"AI tools",children:e.clients.map(_=>h.jsxs("li",{className:"border-b border-border-subtle px-4 py-3 last:border-b-0",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"text-sm font-medium",children:_.name}),h.jsx("p",{className:"text-xs text-muted-foreground",children:GB(_)}),_.installed&&h.jsx("p",{className:"mt-0.5 truncate font-mono text-[10px] text-muted-foreground",title:_.configPath,children:_.configPath})]}),_.installed&&["app","npm"].map(g=>{if(!(g==="app"?e.engines.app:e.engines.npm))return null;const y=_.engine===g,x=a===`${_.id}:${g}`;return h.jsxs(ge,{size:"sm",variant:y?"secondary":"outline",disabled:y||a!==null,"aria-label":`${_.name}: use ${i1[g]}`,onClick:()=>void m(_,g),children:[x&&h.jsx(ss,{className:"h-3.5 w-3.5 animate-spin"}),y?`Using ${g==="app"?"the app":"npm"}`:`Use ${g==="app"?"the app":"npm"}`]},g)})]}),(u==null?void 0:u.id)===_.id&&h.jsx("p",{role:"status",className:"mt-2 text-xs text-primary",children:u.message})]},_.id))})]})}const QB="https://github.com/bvisible/mcp-ssh-manager/releases";function JB(e){if(!e)return"not yet";const t=new Date(e);return Number.isNaN(t.getTime())?"not yet":t.toLocaleString()}function e8(){const{info:e,busy:t,error:s,check:n,download:a,install:l}=to(),u=Ie(d=>d.pendingCount);if(!e)return null;const f=e.channel==="preview",m=e.status;return h.jsxs("div",{className:"max-w-3xl space-y-4",children:[h.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[h.jsxs("h2",{className:"text-sm font-medium",children:["SSH Manager ",e.currentVersion]}),f&&h.jsx(rs,{variant:"secondary",children:"preview build"})]}),h.jsx("p",{className:"mt-1 text-sm leading-relaxed text-muted-foreground",children:f?"You are on a preview. You will be offered newer previews and the stable release when it comes out.":"You receive stable releases."})]}),h.jsxs("div",{className:"rounded-lg border border-border bg-card p-4","aria-live":"polite",children:[m==="checking"&&h.jsxs("p",{className:"flex items-center gap-2 text-sm",children:[h.jsx(ss,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),"Checking for updates…"]}),(m==="idle"||m==="error")&&h.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[h.jsxs("p",{className:"flex min-w-0 flex-1 items-center gap-2 text-sm",children:[h.jsx(q3,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),e.error?"Could not check for updates.":e.checkedAt?"You are up to date.":"Not checked yet."]}),h.jsxs(ge,{size:"sm",variant:"outline",disabled:t,onClick:()=>void n(),children:[h.jsx(ao,{className:"h-3.5 w-3.5"}),"Check now"]})]}),m==="available"&&h.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("p",{className:"text-sm font-medium",children:["Version ",e.version," is available"]}),h.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"Downloading does not change anything you are running; you choose when to restart."})]}),h.jsxs(ge,{size:"sm",disabled:t,onClick:()=>void a(),children:[h.jsx(Xn,{className:"h-3.5 w-3.5"}),"Download ",e.version]})]}),m==="downloading"&&h.jsxs("div",{children:[h.jsxs("p",{className:"text-sm font-medium",children:["Downloading ",e.version,"… ",e.percent??0,"%"]}),h.jsx("div",{role:"progressbar","aria-label":"Download","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":e.percent??0,className:"mt-2 h-1.5 overflow-hidden rounded-full bg-muted",children:h.jsx("div",{className:"h-full bg-primary transition-[width]",style:{width:`${e.percent??0}%`}})})]}),m==="ready"&&h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("p",{className:"text-sm font-medium",children:["Version ",e.version," is ready to install"]}),h.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"It installs when you restart, or by itself the next time you quit."})]}),h.jsxs(ge,{size:"sm",disabled:t,onClick:()=>void l(),children:[h.jsx(ZA,{className:"h-3.5 w-3.5"}),"Restart to update"]})]}),u>0&&h.jsxs("p",{role:"alert",className:"rounded-md border border-border bg-muted px-3 py-2 text-xs",children:[u," command",u===1?" is":"s are"," waiting for your decision. Restarting drops ",u===1?"it":"them",": the agent",u===1?"":"s"," will be told no."]})]}),h.jsxs("dl",{className:"mt-3 grid gap-x-6 gap-y-1 border-t border-border-subtle pt-3 text-xs text-muted-foreground sm:grid-cols-2",children:[h.jsxs("div",{className:"flex gap-2",children:[h.jsx("dt",{children:"Last checked"}),h.jsx("dd",{className:"text-foreground",children:JB(e.checkedAt)})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("dt",{children:"Release notes"}),h.jsx("dd",{children:h.jsxs("a",{className:"inline-flex items-center gap-1 text-foreground underline underline-offset-2",href:`${QB}${e.version?`/tag/v${e.version}`:""}`,target:"_blank",rel:"noreferrer",children:[e.version?`Version ${e.version}`:"All releases",h.jsx(jC,{className:"h-3 w-3","aria-hidden":"true"})]})})]})]}),(s||e.error)&&h.jsx("p",{role:"alert",className:"mt-3 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:s??e.error})]}),h.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"The application checks when it starts and every six hours, and tells you here, in the sidebar and once per version in a notification. The npm engine, if you use one, is updated with npm and is not part of this."})]})}const Zr="h-7 flex-none",t8=[{id:"system",label:"Match the desktop",hint:"follows your system setting, including when it changes",icon:Zl},{id:"light",label:"Light",hint:"always light, whatever the system does",icon:aO},{id:"dark",label:"Dark",hint:"always dark",icon:OA}];function i8(){const{mode:e,resolved:t,setMode:s}=Uh();return h.jsx("div",{className:"grid gap-2 sm:grid-cols-3",children:t8.map(n=>{const a=n.icon,l=e===n.id;return h.jsxs("button",{onClick:()=>s(n.id),"aria-pressed":l,className:fe("rounded-lg border p-3 text-left transition-colors",l?"border-primary bg-primary/5":"border-border bg-card hover:bg-card-hover"),children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(a,{className:fe("h-4 w-4",l?"text-primary":"text-muted-foreground")}),h.jsx("span",{className:"text-sm font-medium",children:n.label}),n.id==="system"&&h.jsxs("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["currently ",t]})]}),h.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:n.hint})]},n.id)})})}function s8(){const[e,t]=w.useState(null),[s,n]=w.useState(!1);if(w.useEffect(()=>{Rp.get().then(l=>t(l.thresholds)).catch(()=>{})},[]),!e)return null;const a=l=>{const u={...e,...l};t(u),n(!0),Rp.save(u).finally(()=>n(!1))};return h.jsxs("div",{className:"rounded-lg border border-border bg-card p-3",children:[h.jsxs("label",{className:"mb-3 flex items-center gap-2 text-sm",children:[h.jsx("input",{type:"checkbox",checked:e.enabled,onChange:l=>a({enabled:l.target.checked}),className:"h-3.5 w-3.5"}),"Point out machines over these levels",h.jsx("span",{className:"text-xs text-muted-foreground",children:"— checked when you probe, never in the background"}),s&&h.jsx(ss,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),h.jsx("div",{className:"grid grid-cols-3 gap-3",children:[["cpu","CPU"],["memory","Memory"],["disk","Disk"]].map(([l,u])=>h.jsxs("div",{className:"grid gap-1",children:[h.jsx("span",{className:"text-xs text-muted-foreground",children:u}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(lt,{type:"number",min:1,max:100,value:e[l],disabled:!e.enabled,onChange:f=>a({[l]:Number(f.target.value)||e[l]}),className:"h-8"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"%"})]})]},l))})]})}function r8(){const[e,t]=w.useState(null),[s,n]=w.useState(""),[a,l]=w.useState(null),[u,f]=w.useState(null),[m,d]=w.useState(!1),[_,g]=w.useState(null),[b,y]=w.useState([]),x=zt(I=>I.load),S=zt(I=>I.servers),E=Ie(I=>I.setView),k=Ie(I=>I.setServerDraft),T=Ie(I=>I.optionsTab),D=Ie(I=>I.setOptionsTab),R=to(I=>I.info),z=T==="updates"&&!R?"appearance":T,L=R!==null&&["available","downloading","ready"].includes(R.status),j=()=>Tt.options().then(t).catch(()=>{});if(w.useEffect(()=>(j(),x(),Tt.subscribe(I=>{if(I.type==="options"&&j(),I.type!=="group-run")return;const J=I;g(J.state==="done"||J.state==="failed"?null:J),J.state==="progress"&&y($=>[...$,J]),J.state==="started"&&y([])})),[x]),!e)return h.jsx("div",{className:"flex flex-1 items-center justify-center",children:h.jsx(ss,{className:"h-5 w-5 animate-spin text-muted-foreground"})});const A=e.hostKeys.filter(I=>I.host.toLowerCase().includes(s.trim().toLowerCase())),V=new Set(S.map(I=>{var J;return(J=I.host)==null?void 0:J.toLowerCase()}).filter(Boolean));return h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[h.jsx(Qn,{title:"Options",hint:"Settings for this machine only."}),h.jsxs(mE,{value:z,onValueChange:D,className:"flex min-h-0 flex-1 flex-col",children:[h.jsxs(pE,{className:"mx-6 mt-4 w-fit max-w-[calc(100%-3rem)] shrink-0 flex-wrap justify-start group-data-[orientation=horizontal]/tabs:h-auto",children:[h.jsx(ws,{value:"appearance",className:Zr,children:"Appearance"}),h.jsx(ws,{value:"vault",className:Zr,children:"Vault"}),h.jsx(ws,{value:"agents",className:Zr,children:"AI tools"}),R&&h.jsxs(ws,{value:"updates",className:Zr,children:["Updates",L&&h.jsx("span",{role:"img","aria-label":"update available",className:"h-1.5 w-1.5 rounded-full bg-primary"})]}),h.jsx(ws,{value:"alerts",className:Zr,children:"Alerts"}),h.jsx(ws,{value:"groups",className:Zr,children:"Groups"}),h.jsx(ws,{value:"tunnels",className:Zr,children:"Tunnels"}),h.jsx(ws,{value:"hosts",className:Zr,children:"Known hosts"})]}),h.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-6",children:[h.jsxs(Cs,{value:"appearance",className:"mt-0 space-y-4",children:[h.jsxs("h2",{className:"mb-2 flex items-center gap-2 text-xs font-medium tracking-wider uppercase",children:[h.jsx(IA,{className:"h-3.5 w-3.5"}),"Appearance"]}),h.jsx(i8,{})]}),h.jsx(Cs,{value:"vault",className:"mt-0",children:h.jsx(YB,{})}),h.jsx(Cs,{value:"agents",className:"mt-0",children:h.jsx(ZB,{})}),h.jsx(Cs,{value:"updates",className:"mt-0",children:h.jsx(e8,{})}),h.jsxs(Cs,{value:"alerts",className:"mt-0 space-y-4",children:[h.jsxs("h2",{className:"mb-2 flex items-center gap-2 text-xs font-medium tracking-wider uppercase",children:[h.jsx(ph,{className:"h-3.5 w-3.5"}),"Alert thresholds"]}),h.jsx(s8,{})]}),h.jsxs(Cs,{value:"groups",className:"mt-0 space-y-4",children:[h.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[h.jsxs("h2",{className:"flex items-center gap-2 text-xs font-medium tracking-wider uppercase",children:[h.jsx(EA,{className:"h-3.5 w-3.5"}),"Groups",h.jsxs("span",{className:"text-muted-foreground",children:["(",e.groups.length,")"]})]}),h.jsxs(ge,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>d(!0),children:[h.jsx(Bi,{className:"h-3.5 w-3.5"}),"New group"]})]}),_&&h.jsxs("div",{className:"mb-2 rounded-md border border-border bg-muted px-3 py-1.5 text-xs",children:["Running on ",_.group," — ",_.done??0," of ",_.total??0,_.server&&h.jsx("span",{className:"ml-2 font-mono",children:_.server})]}),b.length>0&&h.jsxs("div",{className:"mb-3 overflow-hidden rounded-md border border-border",children:[h.jsxs("div",{className:"flex items-center gap-2 border-b border-border bg-muted px-3 py-1.5",children:[h.jsx("span",{className:"text-xs font-medium",children:"Results"}),h.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[b.filter(I=>I.code===0).length," of ",b.length," succeeded"]}),h.jsx("button",{className:"ml-auto text-[10px] text-muted-foreground hover:text-foreground",onClick:()=>y([]),children:"clear"})]}),h.jsx("div",{className:"max-h-64 overflow-auto",children:b.map((I,J)=>h.jsxs("div",{className:"border-b border-border-subtle p-2 last:border-b-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-xs font-medium",children:I.server}),h.jsxs(rs,{variant:I.code===0?"outline":"destructive",children:["exit ",I.code]})]}),(I.stdout||I.stderr)&&h.jsxs("pre",{className:"mt-1 max-h-32 overflow-auto font-mono text-[11px] whitespace-pre-wrap text-muted-foreground",children:[I.stdout,I.stderr]})]},J))})]}),h.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-2",children:e.groups.map(I=>h.jsxs("div",{className:"group/card rounded-lg border border-border bg-card p-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-sm font-medium",children:I.name}),I.dynamic&&h.jsx(rs,{variant:"secondary",children:"dynamic"}),I.fromConfig&&h.jsx(rs,{variant:"outline",children:"from config"}),h.jsxs("div",{className:"ml-auto flex items-center gap-0.5 opacity-0 transition-opacity group-hover/card:opacity-100",children:[h.jsx(ge,{variant:"ghost",size:"icon","aria-label":`Run a command on ${I.name}`,disabled:I.serverCount===0||!!_,onClick:()=>{const J=window.prompt(`Run on ${I.serverCount} server(s) in "${I.name}"`);J!=null&&J.trim()&&Mp.run(I.name,J)},children:h.jsx(LC,{className:"h-3.5 w-3.5"})}),!I.dynamic&&h.jsxs(h.Fragment,{children:[h.jsx(ge,{variant:"ghost",size:"icon","aria-label":`Edit ${I.name}`,onClick:()=>f(I),children:h.jsx(no,{className:"h-3.5 w-3.5"})}),h.jsx(ge,{variant:"ghost",size:"icon","aria-label":`Delete ${I.name}`,onClick:async()=>{if(window.confirm(`Delete the group "${I.name}"? The servers are untouched.`))try{await Mp.remove(I.name),j()}catch(J){window.alert(J.message)}},children:h.jsx(Vn,{className:"h-3.5 w-3.5"})})]})]}),h.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:I.serverCount})]}),I.description&&h.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:I.description}),I.servers.length>0&&h.jsx("p",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:I.servers.join(", ")})]},I.name))})]}),h.jsxs(Cs,{value:"tunnels",className:"mt-0 space-y-4",children:[h.jsxs("h2",{className:"mb-2 flex items-center gap-2 text-xs font-medium tracking-wider uppercase",children:[h.jsx(PA,{className:"h-3.5 w-3.5"}),"Tunnels"]}),e.tunnels.length===0?h.jsx("p",{className:"text-xs text-muted-foreground",children:e.tunnelsStale?"The published list is stale — the MCP server that opened them is no longer running.":"None open. Tunnels live inside the MCP server’s process; this screen shows what that process publishes."}):h.jsx("ul",{className:"space-y-1",children:e.tunnels.map(I=>h.jsx("li",{className:"rounded-md border border-border bg-card px-3 py-2 font-mono text-xs",children:I.description??I.id},I.id))})]}),h.jsxs(Cs,{value:"hosts",className:"mt-0 space-y-4",children:[h.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[h.jsxs("h2",{className:"flex items-center gap-2 text-xs font-medium tracking-wider uppercase",children:[h.jsx(wA,{className:"h-3.5 w-3.5"}),"Known hosts",h.jsxs("span",{className:"text-muted-foreground",children:["(",e.hostKeys.length,")"]})]}),h.jsx("input",{value:s,onChange:I=>n(I.target.value),placeholder:"Filter",className:"ml-auto h-7 w-48 rounded-md border border-input bg-transparent px-2 text-xs focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none"})]}),h.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[A.slice(0,200).map(I=>{const J=`${I.host}:${I.port}`;return h.jsxs("div",{className:"group flex items-center gap-3 border-b border-border-subtle px-3 py-1.5 last:border-b-0 hover:bg-card-hover",children:[h.jsx("span",{className:"w-56 shrink-0 truncate font-mono text-xs",children:I.host}),I.port!==22&&h.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[":",I.port]}),h.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[10px] text-muted-foreground",children:I.keys.map($=>$.type).join(", ")}),!V.has(I.host.toLowerCase())&&h.jsxs(ge,{variant:"ghost",size:"sm",className:"h-7 shrink-0 px-2 text-xs opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>{k({host:I.host,port:I.port}),E("servers")},children:[h.jsx(Bi,{className:"h-3.5 w-3.5"}),"Add as a server"]}),h.jsx(ge,{variant:"ghost",size:"icon","aria-label":`Forget ${I.host}`,className:"opacity-0 group-hover:opacity-100",disabled:a===J,onClick:async()=>{if(window.confirm(`Forget the host key for ${I.host}?`)){l(J);try{await _3.forget(I.host,I.port),await j()}finally{l(null)}}},children:h.jsx(Vn,{className:"h-3.5 w-3.5"})})]},J)}),A.length>200&&h.jsxs("p",{className:"px-3 py-2 text-[10px] text-muted-foreground",children:[A.length-200," more — narrow the filter to see them."]}),A.length===0&&h.jsx("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No host matches."})]})]})]})]}),(m||u)&&h.jsx(KB,{group:u,onClose:()=>{d(!1),f(null)},onSaved:()=>{d(!1),f(null),j()}})]})}const s1=()=>`tab-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;function n8(){const{servers:e,load:t}=zt(),{tabs:s,addTab:n,activateTab:a}=Ie(),[l,u]=w.useState([]),[f,m]=w.useState([]),[d,_]=w.useState(null),[g,b]=w.useState(!1),[y,x]=w.useState(!1);w.useEffect(()=>{t()},[t]),w.useEffect(()=>{Tt.options().then(D=>x(D.localShell)).catch(()=>{})},[]);const S=async()=>{try{const D=await Pn.list();u(D.commands),m(D.suggestions)}catch{}};w.useEffect(()=>{S()},[]);const E=D=>{const R=s.filter(z=>z.title===D||z.title.startsWith(`${D} `)).length;return R===0?D:`${D} ${R+1}`},k=(D,R,z=!1)=>{const L=s.find(j=>j.type==="ssh-terminal"&&j.serverId===D);if(L&&!z)return a(L.id);n({id:s1(),type:"ssh-terminal",title:E(R),serverId:D})},T=()=>n({id:s1(),type:"local-terminal",title:E("This machine")});return h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[h.jsx(Qn,{title:"Terminal",count:e.length,hint:"A shell on any machine — and the commands you would rather not retype."}),h.jsxs(mE,{defaultValue:"open",className:"flex min-h-0 flex-1 flex-col",children:[h.jsxs(pE,{className:"mx-6 mt-4 w-fit shrink-0",children:[h.jsx(ws,{value:"open",children:"Open a shell"}),h.jsx(ws,{value:"commands",children:"Saved commands"})]}),h.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-6",children:[h.jsxs(Cs,{value:"open",className:"mt-0 space-y-6",children:[y&&h.jsxs("section",{children:[h.jsx("h2",{className:"mb-2 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Here"}),h.jsxs("button",{onClick:T,className:"flex w-full items-center gap-3 rounded-lg border border-border bg-card p-3 text-left transition-colors hover:bg-card-hover sm:w-1/2 lg:w-1/3",children:[h.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-primary/10",children:h.jsx(Zl,{className:"h-4.5 w-4.5 text-primary"})}),h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"block truncate text-sm font-medium",children:"This machine"}),h.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:"Your own shell, as you have it configured"})]}),h.jsx(Bi,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]})]}),h.jsxs("section",{children:[y&&h.jsx("h2",{className:"mb-2 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Somewhere else"}),e.length===0?h.jsx(qn,{icon:Fn,title:"No servers yet",hint:"Add one under Servers, or import what you already have with `ssh-manager import`."}):h.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:e.map(D=>{const R=s.filter(z=>z.type==="ssh-terminal"&&z.serverId===D.id).length;return h.jsxs("div",{className:"group flex items-center gap-3 rounded-lg border border-border bg-card p-3 text-left transition-colors hover:bg-card-hover",children:[h.jsxs("button",{onClick:()=>k(D.id,D.name),className:"flex min-w-0 flex-1 items-center gap-3 text-left",children:[h.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-primary/10",children:h.jsx(Fn,{className:"h-4.5 w-4.5 text-primary"})}),h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"block truncate text-sm font-medium",children:D.name}),h.jsxs("span",{className:"block truncate font-mono text-xs text-muted-foreground",children:[D.username?`${D.username}@`:"",D.host]})]})]}),R>0&&h.jsx(rs,{variant:"secondary",className:"shrink-0",children:R>1?`${R} open`:"open"}),h.jsx(ge,{variant:"ghost",size:"icon","aria-label":`Another shell on ${D.name}`,title:`Another shell on ${D.name}`,className:"shrink-0 opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100",onClick:()=>k(D.id,D.name,!0),children:h.jsx(Bi,{className:"h-3.5 w-3.5"})})]},D.id)})})]})]}),h.jsxs(Cs,{value:"commands",className:"mt-0 space-y-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("p",{className:"text-xs text-muted-foreground",children:"Picked from a list inside any shell, instead of typed again."}),h.jsxs(ge,{size:"sm",className:"ml-auto",onClick:()=>b(!0),children:[h.jsx(Bi,{className:"h-3.5 w-3.5"}),"New command"]})]}),l.length===0?h.jsx(qn,{icon:LC,title:"Nothing saved yet",hint:"Save the ones you type most. They appear in every shell, on the servers you choose.",action:h.jsxs(ge,{size:"sm",onClick:()=>b(!0),children:[h.jsx(Bi,{className:"h-3.5 w-3.5"}),"Save a command"]})}):h.jsx("div",{className:"overflow-hidden rounded-lg border border-border",children:l.map(D=>{var R;return h.jsxs("div",{className:"group flex items-center gap-3 border-b border-border-subtle px-3 py-2 last:border-b-0 hover:bg-card-hover",children:[h.jsx("span",{className:"w-40 shrink-0 truncate text-sm",children:D.name}),h.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:D.command}),D.confirmBeforeRun&&h.jsx(rs,{variant:"outline",className:"shrink-0",children:"asks first"}),h.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:(R=D.serverNames)!=null&&R.length?D.serverNames.join(", "):"every server"}),h.jsxs("span",{className:"flex shrink-0 gap-0.5 opacity-0 transition-opacity group-hover:opacity-100",children:[h.jsx(ge,{variant:"ghost",size:"icon","aria-label":`Edit ${D.name}`,onClick:()=>_(D),children:h.jsx(no,{className:"h-3.5 w-3.5"})}),h.jsx(ge,{variant:"ghost",size:"icon","aria-label":`Delete ${D.name}`,onClick:async()=>{window.confirm(`Delete “${D.name}”?`)&&(await Pn.remove(D.id),S())},children:h.jsx(Vn,{className:"h-3.5 w-3.5"})})]})]},D.id)})}),f.length>0&&h.jsxs("div",{children:[h.jsx("h2",{className:"mb-2 text-xs font-medium tracking-wider uppercase text-muted-foreground",children:"Suggestions"}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:f.map(D=>h.jsxs(ge,{variant:"outline",size:"sm",onClick:async()=>{await Pn.save(D),S()},children:[h.jsx(Bi,{className:"h-3 w-3"}),D.name]},D.name))})]})]})]})]}),(g||d)&&h.jsx(Z2,{existing:d??void 0,onClose:()=>{b(!1),_(null)},onSaved:()=>{b(!1),_(null),S()}})]})}const ap=e=>e.split(/[\\/]/).pop()||e;function a8({paths:e,onClose:t}){const{servers:s,load:n}=zt(),{tabs:a,addTab:l,activateTab:u}=Ie(),[f,m]=w.useState(null),[d,_]=w.useState(null);w.useEffect(()=>{n()},[n]),w.useEffect(()=>{const S=E=>{E.key==="Escape"&&t()};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[t]);const g=new Set(a.filter(S=>S.type==="dual-browser").map(S=>S.serverId)),b=new Set(a.filter(S=>S.type==="ssh-terminal").map(S=>S.serverId)),y=[...s].sort((S,E)=>{const k=T=>g.has(T.id)?0:b.has(T.id)?1:2;return k(S)-k(E)||S.name.localeCompare(E.name)}),x=async S=>{m(S.id),_(null);try{const E=S.defaultDirectory||".";await pC.start({server:S.name,direction:"upload",items:e.map(T=>({local:T,remote:`${E.replace(/\/$/,"")}/${ap(T)}`}))});const k=a.find(T=>T.type==="dual-browser"&&T.serverId===S.id);k?u(k.id):l({id:`tab-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,type:"dual-browser",title:S.name,serverId:S.id}),t()}catch(E){_(E.message),m(null)}};return h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-6",children:h.jsxs("div",{className:"w-full max-w-lg overflow-hidden rounded-xl border border-border bg-card shadow-lg",children:[h.jsxs("div",{className:"flex items-start gap-3 border-b border-border px-5 py-4",children:[h.jsx("span",{className:"mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-primary/10",children:h.jsx(Ql,{className:"h-4.5 w-4.5 text-primary"})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("h2",{className:"text-sm font-medium",children:["Send ",e.length===1?ap(e[0]):`${e.length} files`," where?"]}),e.length>1&&h.jsx("p",{className:"mt-0.5 truncate font-mono text-xs text-muted-foreground",children:e.map(ap).join(", ")})]}),h.jsx(ge,{variant:"ghost",size:"icon","aria-label":"Cancel",onClick:t,children:h.jsx(vr,{className:"h-4 w-4"})})]}),d&&h.jsx("p",{className:"border-b border-destructive/30 bg-destructive-light px-5 py-2 text-xs",children:d}),h.jsxs("div",{className:"max-h-80 overflow-y-auto p-2",children:[y.length===0&&h.jsx("p",{className:"p-4 text-center text-xs text-muted-foreground",children:"No servers configured yet."}),y.map(S=>{const E=g.has(S.id),k=b.has(S.id),T=E?fr:k?Fn:PC;return h.jsxs("button",{disabled:f!==null,onClick:()=>void x(S),className:"flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left transition-colors hover:bg-card-hover disabled:opacity-50",children:[h.jsx(T,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"block truncate text-sm",children:S.name}),h.jsx("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:S.defaultDirectory||"~"})]}),h.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:E?"files open":k?"shell open":""})]},S.id)})]})]})})}const r1="ssh-manager.desktop-offer-dismissed",o8={manifest:"Finding the release…",download:"Downloading…",verify:"Checking the checksum and the signature…",install:"Installing…",open:"Opening the app…"};function l8(){const[e,t]=w.useState(null),[s,n]=w.useState(()=>vo(r1)==="true"),[a,l]=w.useState(null),[u,f]=w.useState(null),[m,d]=w.useState(null),[_,g]=w.useState(!1),b=Ie(T=>T.handedOver),y=Ie(T=>T.setHandedOver);if(w.useEffect(()=>{if(Dx||s)return;let T=!1;return Bm.status().then(D=>{T||!D||(t(D),D.handingOver?y(!0):D.installing&&l(D.phase??"manifest"))}).catch(()=>{}),()=>{T=!0}},[s,y]),w.useEffect(()=>Tt.subscribe(T=>{if(T.type!=="desktop")return;if(T.phase==="handover"){y(!0);return}if(T.phase==="error"){d(typeof T.error=="string"?T.error:"The desktop app was not installed."),l(null);return}typeof T.phase=="string"&&l(T.phase);const D=Number(T.received),R=Number(T.total);f(R>0&&Number.isFinite(D)?Math.min(1,D/R):null)}),[y]),b)return h.jsxs("div",{role:"status",className:"flex shrink-0 items-center gap-3 border-b border-border bg-success-light px-8 py-3 text-sm text-success",children:[h.jsx(ro,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),h.jsxs("span",{children:[h.jsx("b",{children:"Continued in the desktop app."})," You can close this tab."]})]});if(Dx||s||!e||!e.supported&&!e.installed)return null;const x=a!==null,S=()=>{_o(r1,"true"),n(!0)},E=async()=>{d(null),l(e.installed?"open":"manifest");try{e.installed?await Bm.open():await Bm.install()}catch(T){d(T.message),l(null)}},k=async()=>{try{await navigator.clipboard.writeText("ssh-manager app"),g(!0),setTimeout(()=>g(!1),1500)}catch{}};return h.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-x-4 gap-y-2 border-b border-border bg-card px-8 py-3 text-sm",children:[h.jsx(R3,{className:"h-5 w-5 shrink-0 text-primary","aria-hidden":"true"}),h.jsxs("p",{className:"min-w-0 flex-[1_1_320px]",children:[h.jsx("b",{children:"SSH Manager is also a desktop app:"})," menu bar, native notifications, updates itself.",e.installed&&e.version&&h.jsxs("span",{className:"text-muted-foreground",children:[" Version ",e.version," is installed."]})]}),x&&h.jsxs("div",{className:"ml-auto flex min-w-[220px] items-center gap-3",role:"status","aria-live":"polite",children:[h.jsx(ss,{className:"h-4 w-4 animate-spin text-muted-foreground motion-reduce:animate-none","aria-hidden":"true"}),h.jsx("span",{className:"text-muted-foreground",children:o8[a??""]??"Working…"}),a==="download"&&u!==null&&h.jsx("div",{className:"h-1.5 w-28 overflow-hidden rounded-full bg-sunk",role:"progressbar","aria-label":"Download","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(u*100),children:h.jsx("div",{className:"h-full rounded-full bg-primary transition-[width]",style:{width:`${Math.round(u*100)}%`}})})]}),!x&&h.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.method==="terminal"&&!e.installed?h.jsxs(h.Fragment,{children:[h.jsx("code",{className:"rounded-md border border-border bg-secondary px-2.5 py-1.5 font-mono text-[13px]",children:"ssh-manager app"}),h.jsxs(ge,{variant:"outline",size:"sm",onClick:()=>void k(),children:[_?h.jsx(ro,{className:"h-3.5 w-3.5"}):h.jsx(NC,{className:"h-3.5 w-3.5"}),_?"Copied":"Copy"]})]}):h.jsx(ge,{size:"sm",className:"font-bold",onClick:()=>void E(),children:e.installed?"Open the app":"Install the app"}),h.jsxs(ge,{variant:"ghost",size:"sm",onClick:S,children:[h.jsx(vr,{className:"h-3.5 w-3.5"}),"Not now"]})]}),m&&h.jsxs("p",{className:"w-full text-destructive",role:"alert",children:[m," Nothing was installed."]})]})}const gE="ssh-manager.wizard-seen",n1=()=>vo(gE)==="true",Wu=[{eyebrow:"A place for your servers",title:"Your servers. Your workspace.",body:"Open a terminal, move files and see what your agents are doing — all from one place on your machine.",detail:"Already using npm or the CLI? Your setup keeps working. You can explore this interface whenever you want."},{eyebrow:"Start with what you have",title:"Bring your servers along.",body:"Add your first connection or import servers from an SSH config, another SSH client or a spreadsheet.",detail:"You review the servers before importing. Your original files stay in place, so you can keep using your existing tools."},{eyebrow:"You decide how far agents go",title:"Stay in control.",body:"Choose which agent requests need your approval. See the server and the full command before you approve or refuse.",detail:"Approval is off by default. Once enabled on a server, requests that need approval are refused if the control plane is unavailable."}];function c8({step:e}){return h.jsxs("svg",{viewBox:"0 0 360 260",fill:"none","aria-hidden":"true",className:"w-full max-w-sm welcome-illustration",children:[h.jsx("circle",{cx:"180",cy:"130",r:"105",className:"fill-primary/5"}),h.jsx("circle",{cx:"180",cy:"130",r:"84",className:"stroke-primary/15",strokeDasharray:"3 8"}),e===0?h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"43",y:"48",width:"250",height:"167",rx:"14",className:"fill-card stroke-border"}),h.jsx("path",{d:"M43 81h250",className:"stroke-border"}),[60,73,86].map(t=>h.jsx("circle",{cx:t,cy:"65",r:"3",className:"fill-primary/50"},t)),h.jsx("rect",{x:"59",y:"98",width:"95",height:"100",rx:"8",className:"fill-muted"}),[119,147,175].map(t=>h.jsxs("g",{children:[h.jsx("rect",{x:"72",y:t-8,width:"16",height:"13",rx:"3",className:"stroke-muted-foreground"}),h.jsx("path",{d:`M98 ${t-4}h39m-39 8h25`,className:"stroke-muted-foreground/45",strokeLinecap:"round"})]},t)),h.jsx("path",{d:"m173 112 7 6-7 6m17 0h12",className:"stroke-primary",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M173 141h87m-87 12h65m-65 12h77",className:"stroke-muted-foreground/30",strokeWidth:"4",strokeLinecap:"round"}),h.jsx("rect",{x:"230",y:"174",width:"87",height:"42",rx:"10",className:"fill-card stroke-primary/40"}),h.jsx("path",{d:"m246 195 5 5 10-12",className:"stroke-success",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M271 191h30m-30 8h21",className:"stroke-muted-foreground/45",strokeWidth:"3",strokeLinecap:"round"})]}):e===1?h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"39",y:"82",width:"111",height:"129",rx:"12",transform:"rotate(-7 39 82)",className:"fill-card stroke-border"}),h.jsx("path",{d:"M62 111h49m-46 17h63m-60 17h53m-51 17h35",className:"stroke-muted-foreground/40",strokeWidth:"4",strokeLinecap:"round"}),h.jsx("path",{d:"M149 140h54m-9-9 11 9-11 9",className:"stroke-primary",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("rect",{x:"217",y:"56",width:"99",height:"154",rx:"13",className:"fill-card stroke-border"}),[78,116,154].map(t=>h.jsxs("g",{children:[h.jsx("rect",{x:"230",y:t,width:"73",height:"28",rx:"6",className:"fill-muted stroke-border"}),h.jsx("circle",{cx:"245",cy:t+14,r:"3",className:"fill-success"}),h.jsx("path",{d:`M257 ${t+14}h31`,className:"stroke-muted-foreground/40",strokeWidth:"3",strokeLinecap:"round"})]},t)),h.jsx("circle",{cx:"117",cy:"208",r:"21",className:"fill-card stroke-primary/40"}),h.jsx("path",{d:"m109 208 5 5 11-12",className:"stroke-primary",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})]}):h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"40",y:"62",width:"248",height:"140",rx:"14",className:"fill-card stroke-border"}),h.jsx("path",{d:"M40 95h248",className:"stroke-border"}),h.jsx("circle",{cx:"58",cy:"79",r:"4",className:"fill-primary"}),h.jsx("path",{d:"M73 79h78",className:"stroke-muted-foreground/45",strokeWidth:"4",strokeLinecap:"round"}),h.jsx("path",{d:"m59 118 7 6-7 6m17 0h12",className:"stroke-primary",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M100 122h109m-150 28h149",className:"stroke-muted-foreground/35",strokeWidth:"4",strokeLinecap:"round"}),h.jsx("rect",{x:"58",y:"166",width:"59",height:"20",rx:"6",className:"fill-muted"}),h.jsx("rect",{x:"126",y:"166",width:"73",height:"20",rx:"6",className:"fill-primary/25"}),h.jsx("path",{d:"m268 118 40 15v34c0 27-40 48-40 48s-40-21-40-48v-34l40-15Z",className:"fill-card stroke-primary",strokeWidth:"2"}),h.jsx("path",{d:"m252 165 11 11 22-26",className:"stroke-primary",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})]})}function u8({onClose:e}){const[t,s]=w.useState(0),n=Ie(d=>d.setView),a=Ie(d=>d.setWantsImport),l=Ie(d=>d.setWantsAdd),u=Wu[t],f=t===Wu.length-1,m=()=>{_o(gE,"true"),e()};return h.jsx(Jl,{open:!0,onOpenChange:d=>!d&&m(),children:h.jsx(ec,{className:"welcome-dialog gap-0 overflow-hidden p-0 sm:max-w-3xl",onCloseAutoFocus:d=>d.preventDefault(),children:h.jsxs("div",{className:"grid sm:grid-cols-[0.9fr_1.1fr]",children:[h.jsxs("div",{className:"flex flex-col justify-between border-b border-border bg-sidebar px-6 py-5 sm:border-r sm:border-b-0",children:[h.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium",children:[h.jsx(Zl,{className:"h-4 w-4 text-primary"})," SSH Manager"]}),h.jsx("div",{className:"mx-auto w-full max-w-[200px] sm:max-w-none",children:h.jsx(c8,{step:t})},t),h.jsxs("p",{className:"hidden items-center gap-2 text-xs text-muted-foreground sm:flex",children:[h.jsx(Jg,{className:"h-3.5 w-3.5"})," On your machine. In your hands."]})]}),h.jsxs("div",{className:"flex flex-col px-7 py-7 sm:py-10",children:[h.jsx("p",{className:"mb-3 text-xs font-medium uppercase tracking-widest text-muted-foreground",children:u.eyebrow}),h.jsxs("div",{className:"welcome-copy",children:[h.jsx(tc,{className:"max-w-xs font-display text-3xl leading-tight font-normal",children:u.title}),h.jsx(ic,{className:"mt-4 text-sm leading-relaxed",children:u.body}),h.jsx("p",{className:"mt-4 text-xs leading-relaxed text-muted-foreground",children:u.detail})]},t),h.jsxs("div",{className:"mt-7 flex flex-wrap items-center gap-2",children:[t>0&&h.jsxs(ge,{variant:"ghost",size:"sm",onClick:()=>s(t-1),children:[h.jsx(z3,{className:"h-3.5 w-3.5"})," Back"]}),t===1&&h.jsxs(ge,{variant:"outline",size:"sm",onClick:()=>{n("servers"),a(!0),m()},children:[h.jsx(Xn,{className:"h-3.5 w-3.5"})," Import servers"]}),f?h.jsxs(ge,{size:"sm",onClick:()=>{n("servers"),l(!0),m()},children:[h.jsx(Bi,{className:"h-3.5 w-3.5"})," Add a server"]}):h.jsxs(ge,{size:"sm",onClick:()=>s(t+1),children:["Next ",h.jsx(kC,{className:"h-3.5 w-3.5"})]})]}),h.jsxs("div",{className:"mt-auto flex items-center justify-between gap-3 pt-6",children:[h.jsx("span",{"aria-label":`Step ${t+1} of ${Wu.length}`,className:"flex items-center gap-1.5",children:Wu.map((d,_)=>h.jsx("span",{className:`flex h-5 w-5 items-center justify-center rounded-full text-[10px] ${_<=t?"bg-primary/15 text-foreground":"bg-muted text-muted-foreground"}`,children:_<t?h.jsx(ro,{className:"h-3 w-3"}):_+1},_))}),h.jsx("button",{className:"rounded text-xs text-muted-foreground underline-offset-4 hover:text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-ring",onClick:m,children:"I’ll explore first"})]})]})]})})})}const h8={"dual-browser":fr,"ssh-terminal":Fn,"local-terminal":Zl};function d8(){const{tabs:e,activeTabId:t,activateTab:s,removeTab:n,setView:a}=Ie();return e.length===0?null:h.jsxs("div",{className:fe("titlebar-safe flex shrink-0 items-stretch border-b border-border bg-sidebar",i2&&"drag-region h-12"),children:[h.jsx("div",{className:"flex min-w-0 flex-1 items-stretch overflow-x-auto scrollbar-none",children:e.map(l=>h.jsx(f8,{tab:l,active:t===l.id,onActivate:()=>s(l.id),onClose:()=>n(l.id)},l.id))}),h.jsxs(Vh,{children:[h.jsx(Wh,{asChild:!0,children:h.jsx("button",{"aria-label":"Open another session",onClick:()=>a("terminal"),className:"flex w-9 shrink-0 items-center justify-center border-l border-border text-muted-foreground transition-colors hover:bg-accent/30 hover:text-foreground",children:h.jsx(Bi,{className:"h-4 w-4"})})}),h.jsx(Kh,{side:"bottom",children:"Open another session"})]})]})}function f8({tab:e,active:t,onActivate:s,onClose:n}){const a=h8[e.type];return h.jsxs("div",{className:fe("group relative flex min-w-0 max-w-52 shrink-0 items-center gap-2 border-r border-border pl-3 pr-1.5 text-xs transition-colors",t?"bg-background text-foreground":"text-muted-foreground hover:bg-accent/20 hover:text-foreground"),children:[t&&h.jsx("span",{className:"absolute inset-x-0 top-0 h-0.5 bg-primary"}),h.jsxs("button",{onClick:s,className:"flex min-w-0 items-center gap-2 py-2",children:[h.jsx(a,{className:"h-3.5 w-3.5 shrink-0"}),h.jsx("span",{className:"truncate",children:e.title})]}),h.jsx("button",{"aria-label":`Close ${e.title}`,onClick:n,className:"flex h-5 w-5 shrink-0 items-center justify-center rounded opacity-0 transition-opacity hover:bg-accent/40 group-hover:opacity-100 focus-visible:opacity-100",children:h.jsx(vr,{className:"h-3 w-3"})})]})}function m8(){const{view:e,tabs:t,activeTabId:s,setPendingCount:n}=Ie(),a=zt(x=>x.servers),l=zt(x=>x.load),u=zt(x=>x.loading),f=zt(x=>x.error);w.useEffect(()=>{l()},[l]),w.useEffect(()=>{h4()},[]);const m=Ie(x=>x.setView);w.useEffect(()=>{let x=!1;const S=new Set,E=async()=>{try{const T=await Tt.get();if(x)return;n(T.pending.length);const D=new Set(T.pending.map(R=>R.id));for(const R of[...S])D.has(R)||(dE(R),S.delete(R));for(const R of T.pending)S.has(R.id)||(S.add(R.id),await hE()&&PB(R,()=>m("waiting")))}catch{}};E();const k=Tt.subscribe(T=>{(gC.includes(T.type)||T.type==="connection"&&T.status==="connected")&&E(),T.type==="servers"&&l()});return()=>{x=!0,k(),HB()}},[n,m,l]);const[d,_]=w.useState(!1);w.useEffect(()=>{if(n1()||u||f||a.length>0)return;let x=!1;return Tp.state().then(S=>{!x&&S.pending.length===0&&!n1()&&_(!0)}).catch(()=>{}),()=>{x=!0}},[a.length,u,f]);const[g,b]=w.useState(null);w.useEffect(()=>Tt.subscribe(x=>{x.type==="dropped-files"&&Array.isArray(x.paths)&&x.paths.length&&b(x.paths)}),[]);const y=x=>{var S;return((S=a.find(E=>E.id===x))==null?void 0:S.name)??x??""};return h.jsxs("div",{className:"flex h-screen w-screen flex-col overflow-hidden bg-background text-foreground",children:[h.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[h.jsx(v4,{}),h.jsxs("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[h.jsx(f4,{}),h.jsx(l8,{}),h.jsx(d8,{}),h.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[t.map(x=>h.jsx("div",{className:"absolute inset-0 flex flex-col",style:{display:s===x.id?"flex":"none"},inert:s!==x.id,children:x.type==="local-terminal"?h.jsx(AS,{server:x.title,local:!0,hidden:s!==x.id}):x.type==="ssh-terminal"?h.jsx(AS,{server:y(x.serverId),hidden:s!==x.id}):h.jsx(OB,{server:y(x.serverId)})},x.id)),s===null&&h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[e==="servers"&&h.jsx(I4,{}),e==="waiting"&&h.jsx(BB,{}),e==="health"&&h.jsx(FB,{}),e==="live"&&h.jsx(VB,{}),e==="activity"&&h.jsx(WB,{}),e==="terminal"&&h.jsx(n8,{}),e==="options"&&h.jsx(r8,{})]})]})]})]}),d&&!g&&h.jsx(u8,{onClose:()=>_(!1)}),g&&h.jsx(a8,{paths:g,onClose:()=>b(null)})]})}y3().then(()=>{w3(),C3(),E3(),zt.setState({viewMode:$l.getState().serverViewMode}),KN.createRoot(document.getElementById("root")).render(h.jsx(w.StrictMode,{children:h.jsx(fM,{delayDuration:300,children:h.jsx(m8,{})})}))});