@opslane/claude-code-game 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/dist/cli.d.ts +2 -0
  2. package/dist/cli.js +59 -0
  3. package/dist/cli.js.map +1 -0
  4. package/dist/routes/auth.d.ts +1 -0
  5. package/dist/routes/auth.js +123 -0
  6. package/dist/routes/auth.js.map +1 -0
  7. package/dist/routes/levels.d.ts +44 -0
  8. package/dist/routes/levels.js +78 -0
  9. package/dist/routes/levels.js.map +1 -0
  10. package/dist/routes/sessions.d.ts +17 -0
  11. package/dist/routes/sessions.js +303 -0
  12. package/dist/routes/sessions.js.map +1 -0
  13. package/dist/server.d.ts +2 -0
  14. package/dist/server.js +58 -0
  15. package/dist/server.js.map +1 -0
  16. package/dist/terminal.d.ts +6 -0
  17. package/dist/terminal.js +23 -0
  18. package/dist/terminal.js.map +1 -0
  19. package/dist/verification.d.ts +31 -0
  20. package/dist/verification.js +239 -0
  21. package/dist/verification.js.map +1 -0
  22. package/frontend/assets/index-CNVEnbfs.css +1 -0
  23. package/frontend/assets/index-D70xl9zu.js +27 -0
  24. package/frontend/index.html +14 -0
  25. package/frontend/vite.svg +1 -0
  26. package/keys/v1.pem +9 -0
  27. package/levels/01-context-is-everything/exercise/README.md +152 -0
  28. package/levels/01-context-is-everything/exercise/data/expenses.db +0 -0
  29. package/levels/01-context-is-everything/exercise/database.py +171 -0
  30. package/levels/01-context-is-everything/exercise/docs/FIRECRAWL_QUICKSTART.md +212 -0
  31. package/levels/01-context-is-everything/exercise/historical_data/expenses_2024_01.json +2306 -0
  32. package/levels/01-context-is-everything/exercise/historical_data/expenses_2024_02.json +2394 -0
  33. package/levels/01-context-is-everything/exercise/historical_data/expenses_2024_03.json +2251 -0
  34. package/levels/01-context-is-everything/exercise/historical_data/expenses_2024_04.json +1987 -0
  35. package/levels/01-context-is-everything/exercise/historical_data/expenses_2024_05.json +2229 -0
  36. package/levels/01-context-is-everything/exercise/main.py +97 -0
  37. package/levels/01-context-is-everything/exercise/models.py +141 -0
  38. package/levels/01-context-is-everything/exercise/pyproject.toml +52 -0
  39. package/levels/01-context-is-everything/exercise/reports.py +138 -0
  40. package/levels/01-context-is-everything/exercise/seed_data.py +91 -0
  41. package/levels/01-context-is-everything/exercise/tests/__init__.py +1 -0
  42. package/levels/01-context-is-everything/exercise/tests/conftest.py +69 -0
  43. package/levels/01-context-is-everything/exercise/tests/test_database.py +244 -0
  44. package/levels/01-context-is-everything/exercise/tests/test_models.py +240 -0
  45. package/levels/01-context-is-everything/exercise/tests/test_reports.py +190 -0
  46. package/levels/01-context-is-everything/exercise/utils.py +163 -0
  47. package/levels/01-context-is-everything/lesson.yaml +82 -0
  48. package/levels/02-claude-md/exercise/README.md +152 -0
  49. package/levels/02-claude-md/exercise/data/expenses.db +0 -0
  50. package/levels/02-claude-md/exercise/database.py +171 -0
  51. package/levels/02-claude-md/exercise/main.py +97 -0
  52. package/levels/02-claude-md/exercise/models.py +141 -0
  53. package/levels/02-claude-md/exercise/pyproject.toml +52 -0
  54. package/levels/02-claude-md/exercise/reports.py +138 -0
  55. package/levels/02-claude-md/exercise/seed_data.py +91 -0
  56. package/levels/02-claude-md/exercise/tests/__init__.py +1 -0
  57. package/levels/02-claude-md/exercise/tests/conftest.py +69 -0
  58. package/levels/02-claude-md/exercise/tests/test_database.py +244 -0
  59. package/levels/02-claude-md/exercise/tests/test_models.py +240 -0
  60. package/levels/02-claude-md/exercise/tests/test_reports.py +190 -0
  61. package/levels/02-claude-md/exercise/utils.py +163 -0
  62. package/levels/02-claude-md/lesson.yaml +60 -0
  63. package/levels/03-read-edit-verify/exercise/CLAUDE.md +15 -0
  64. package/levels/03-read-edit-verify/exercise/README.md +152 -0
  65. package/levels/03-read-edit-verify/exercise/data/expenses.db +0 -0
  66. package/levels/03-read-edit-verify/exercise/database.py +171 -0
  67. package/levels/03-read-edit-verify/exercise/main.py +97 -0
  68. package/levels/03-read-edit-verify/exercise/models.py +141 -0
  69. package/levels/03-read-edit-verify/exercise/pyproject.toml +52 -0
  70. package/levels/03-read-edit-verify/exercise/reports.py +138 -0
  71. package/levels/03-read-edit-verify/exercise/seed_data.py +91 -0
  72. package/levels/03-read-edit-verify/exercise/tests/__init__.py +1 -0
  73. package/levels/03-read-edit-verify/exercise/tests/conftest.py +69 -0
  74. package/levels/03-read-edit-verify/exercise/tests/test_database.py +244 -0
  75. package/levels/03-read-edit-verify/exercise/tests/test_models.py +240 -0
  76. package/levels/03-read-edit-verify/exercise/tests/test_reports.py +190 -0
  77. package/levels/03-read-edit-verify/exercise/utils.py +163 -0
  78. package/levels/03-read-edit-verify/lesson.yaml +60 -0
  79. package/levels/04-planning-mode/exercise/README.md +152 -0
  80. package/levels/04-planning-mode/exercise/data/expenses.db +0 -0
  81. package/levels/04-planning-mode/exercise/database.py +171 -0
  82. package/levels/04-planning-mode/exercise/main.py +97 -0
  83. package/levels/04-planning-mode/exercise/models.py +116 -0
  84. package/levels/04-planning-mode/exercise/pyproject.toml +52 -0
  85. package/levels/04-planning-mode/exercise/reports.py +138 -0
  86. package/levels/04-planning-mode/exercise/seed_data.py +91 -0
  87. package/levels/04-planning-mode/exercise/tests/__init__.py +1 -0
  88. package/levels/04-planning-mode/exercise/tests/conftest.py +69 -0
  89. package/levels/04-planning-mode/exercise/tests/test_database.py +244 -0
  90. package/levels/04-planning-mode/exercise/tests/test_expenses.db +0 -0
  91. package/levels/04-planning-mode/exercise/tests/test_models.py +240 -0
  92. package/levels/04-planning-mode/exercise/tests/test_reports.py +190 -0
  93. package/levels/04-planning-mode/exercise/utils.py +163 -0
  94. package/levels/04-planning-mode/lesson.yaml +53 -0
  95. package/levels/05-spec-driven/exercise/README.md +152 -0
  96. package/levels/05-spec-driven/exercise/data/expenses.db +0 -0
  97. package/levels/05-spec-driven/exercise/database.py +171 -0
  98. package/levels/05-spec-driven/exercise/main.py +97 -0
  99. package/levels/05-spec-driven/exercise/models.py +116 -0
  100. package/levels/05-spec-driven/exercise/pyproject.toml +52 -0
  101. package/levels/05-spec-driven/exercise/reports.py +138 -0
  102. package/levels/05-spec-driven/exercise/seed_data.py +91 -0
  103. package/levels/05-spec-driven/exercise/tests/__init__.py +1 -0
  104. package/levels/05-spec-driven/exercise/tests/conftest.py +69 -0
  105. package/levels/05-spec-driven/exercise/tests/test_database.py +244 -0
  106. package/levels/05-spec-driven/exercise/tests/test_expenses.db +0 -0
  107. package/levels/05-spec-driven/exercise/tests/test_models.py +240 -0
  108. package/levels/05-spec-driven/exercise/tests/test_reports.py +190 -0
  109. package/levels/05-spec-driven/exercise/utils.py +163 -0
  110. package/levels/05-spec-driven/lesson.yaml +53 -0
  111. package/levels/06-sub-agents/exercise/README.md +152 -0
  112. package/levels/06-sub-agents/exercise/data/expenses.db +0 -0
  113. package/levels/06-sub-agents/exercise/database.py +171 -0
  114. package/levels/06-sub-agents/exercise/main.py +97 -0
  115. package/levels/06-sub-agents/exercise/models.py +116 -0
  116. package/levels/06-sub-agents/exercise/pyproject.toml +52 -0
  117. package/levels/06-sub-agents/exercise/reports.py +63 -0
  118. package/levels/06-sub-agents/exercise/seed_data.py +91 -0
  119. package/levels/06-sub-agents/exercise/tests/__init__.py +1 -0
  120. package/levels/06-sub-agents/exercise/tests/conftest.py +69 -0
  121. package/levels/06-sub-agents/exercise/tests/test_database.py +244 -0
  122. package/levels/06-sub-agents/exercise/tests/test_models.py +240 -0
  123. package/levels/06-sub-agents/exercise/tests/test_reports.py +190 -0
  124. package/levels/06-sub-agents/exercise/utils.py +163 -0
  125. package/levels/06-sub-agents/lesson.yaml +49 -0
  126. package/levels/07-skills/exercise/README.md +152 -0
  127. package/levels/07-skills/exercise/data/expenses.db +0 -0
  128. package/levels/07-skills/exercise/database.py +171 -0
  129. package/levels/07-skills/exercise/main.py +97 -0
  130. package/levels/07-skills/exercise/models.py +116 -0
  131. package/levels/07-skills/exercise/pyproject.toml +52 -0
  132. package/levels/07-skills/exercise/reports.py +63 -0
  133. package/levels/07-skills/exercise/seed_data.py +91 -0
  134. package/levels/07-skills/exercise/tests/__init__.py +1 -0
  135. package/levels/07-skills/exercise/tests/conftest.py +69 -0
  136. package/levels/07-skills/exercise/tests/test_database.py +244 -0
  137. package/levels/07-skills/exercise/tests/test_models.py +240 -0
  138. package/levels/07-skills/exercise/tests/test_reports.py +190 -0
  139. package/levels/07-skills/exercise/utils.py +163 -0
  140. package/levels/07-skills/lesson.yaml +49 -0
  141. package/levels/08-mcp-servers/exercise/README.md +152 -0
  142. package/levels/08-mcp-servers/exercise/data/expenses.db +0 -0
  143. package/levels/08-mcp-servers/exercise/database.py +171 -0
  144. package/levels/08-mcp-servers/exercise/main.py +97 -0
  145. package/levels/08-mcp-servers/exercise/models.py +116 -0
  146. package/levels/08-mcp-servers/exercise/pyproject.toml +52 -0
  147. package/levels/08-mcp-servers/exercise/reports.py +63 -0
  148. package/levels/08-mcp-servers/exercise/seed_data.py +91 -0
  149. package/levels/08-mcp-servers/exercise/tests/__init__.py +1 -0
  150. package/levels/08-mcp-servers/exercise/tests/conftest.py +69 -0
  151. package/levels/08-mcp-servers/exercise/tests/test_database.py +244 -0
  152. package/levels/08-mcp-servers/exercise/tests/test_models.py +240 -0
  153. package/levels/08-mcp-servers/exercise/tests/test_reports.py +190 -0
  154. package/levels/08-mcp-servers/exercise/utils.py +163 -0
  155. package/levels/08-mcp-servers/lesson.yaml +59 -0
  156. package/levels/09-plugins/exercise/README.md +152 -0
  157. package/levels/09-plugins/exercise/data/expenses.db +0 -0
  158. package/levels/09-plugins/exercise/database.py +171 -0
  159. package/levels/09-plugins/exercise/main.py +97 -0
  160. package/levels/09-plugins/exercise/models.py +116 -0
  161. package/levels/09-plugins/exercise/pyproject.toml +52 -0
  162. package/levels/09-plugins/exercise/reports.py +63 -0
  163. package/levels/09-plugins/exercise/seed_data.py +91 -0
  164. package/levels/09-plugins/exercise/tests/__init__.py +1 -0
  165. package/levels/09-plugins/exercise/tests/conftest.py +69 -0
  166. package/levels/09-plugins/exercise/tests/test_database.py +244 -0
  167. package/levels/09-plugins/exercise/tests/test_models.py +240 -0
  168. package/levels/09-plugins/exercise/tests/test_reports.py +190 -0
  169. package/levels/09-plugins/exercise/utils.py +163 -0
  170. package/levels/09-plugins/lesson.yaml +51 -0
  171. package/levels/10-hooks/exercise/README.md +152 -0
  172. package/levels/10-hooks/exercise/data/expenses.db +0 -0
  173. package/levels/10-hooks/exercise/database.py +171 -0
  174. package/levels/10-hooks/exercise/main.py +97 -0
  175. package/levels/10-hooks/exercise/models.py +116 -0
  176. package/levels/10-hooks/exercise/pyproject.toml +52 -0
  177. package/levels/10-hooks/exercise/reports.py +63 -0
  178. package/levels/10-hooks/exercise/seed_data.py +91 -0
  179. package/levels/10-hooks/exercise/tests/__init__.py +1 -0
  180. package/levels/10-hooks/exercise/tests/conftest.py +69 -0
  181. package/levels/10-hooks/exercise/tests/test_database.py +244 -0
  182. package/levels/10-hooks/exercise/tests/test_models.py +240 -0
  183. package/levels/10-hooks/exercise/tests/test_reports.py +190 -0
  184. package/levels/10-hooks/exercise/utils.py +163 -0
  185. package/levels/10-hooks/lesson.yaml +58 -0
  186. package/levels/11-worktrees/exercise/README.md +152 -0
  187. package/levels/11-worktrees/exercise/data/expenses.db +0 -0
  188. package/levels/11-worktrees/exercise/database.py +171 -0
  189. package/levels/11-worktrees/exercise/main.py +97 -0
  190. package/levels/11-worktrees/exercise/models.py +116 -0
  191. package/levels/11-worktrees/exercise/pyproject.toml +52 -0
  192. package/levels/11-worktrees/exercise/reports.py +63 -0
  193. package/levels/11-worktrees/exercise/seed_data.py +91 -0
  194. package/levels/11-worktrees/exercise/tests/__init__.py +1 -0
  195. package/levels/11-worktrees/exercise/tests/conftest.py +69 -0
  196. package/levels/11-worktrees/exercise/tests/test_database.py +244 -0
  197. package/levels/11-worktrees/exercise/tests/test_models.py +240 -0
  198. package/levels/11-worktrees/exercise/tests/test_reports.py +190 -0
  199. package/levels/11-worktrees/exercise/utils.py +163 -0
  200. package/levels/11-worktrees/lesson.yaml +68 -0
  201. package/package.json +38 -0
@@ -0,0 +1,27 @@
1
+ (function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const h of document.querySelectorAll('link[rel="modulepreload"]'))a(h);new MutationObserver(h=>{for(const u of h)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&a(f)}).observe(document,{childList:!0,subtree:!0});function n(h){const u={};return h.integrity&&(u.integrity=h.integrity),h.referrerPolicy&&(u.referrerPolicy=h.referrerPolicy),h.crossOrigin==="use-credentials"?u.credentials="include":h.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(h){if(h.ep)return;h.ep=!0;const u=n(h);fetch(h.href,u)}})();var hc={exports:{}},Un={};var wv;function YS(){if(wv)return Un;wv=1;var t=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function n(a,h,u){var f=null;if(u!==void 0&&(f=""+u),h.key!==void 0&&(f=""+h.key),"key"in h){u={};for(var v in h)v!=="key"&&(u[v]=h[v])}else u=h;return h=u.ref,{$$typeof:t,type:a,key:f,ref:h!==void 0?h:null,props:u}}return Un.Fragment=s,Un.jsx=n,Un.jsxs=n,Un}var Ev;function KS(){return Ev||(Ev=1,hc.exports=YS()),hc.exports}var K=KS(),cc={exports:{}},ue={};var xv;function WS(){if(xv)return ue;xv=1;var t=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),_=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),x=Symbol.iterator;function A(p){return p===null||typeof p!="object"?null:(p=x&&p[x]||p["@@iterator"],typeof p=="function"?p:null)}var D={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,G={};function Q(p,R,Y){this.props=p,this.context=R,this.refs=G,this.updater=Y||D}Q.prototype.isReactComponent={},Q.prototype.setState=function(p,R){if(typeof p!="object"&&typeof p!="function"&&p!=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,p,R,"setState")},Q.prototype.forceUpdate=function(p){this.updater.enqueueForceUpdate(this,p,"forceUpdate")};function ve(){}ve.prototype=Q.prototype;function J(p,R,Y){this.props=p,this.context=R,this.refs=G,this.updater=Y||D}var Z=J.prototype=new ve;Z.constructor=J,k(Z,Q.prototype),Z.isPureReactComponent=!0;var ee=Array.isArray;function se(){}var ie={H:null,A:null,T:null,S:null},Ae=Object.prototype.hasOwnProperty;function Ye(p,R,Y){var V=Y.ref;return{$$typeof:t,type:p,key:R,ref:V!==void 0?V:null,props:Y}}function mt(p,R){return Ye(p.type,R,p.props)}function de(p){return typeof p=="object"&&p!==null&&p.$$typeof===t}function P(p){var R={"=":"=0",":":"=2"};return"$"+p.replace(/[=:]/g,function(Y){return R[Y]})}var j=/\/+/g;function F(p,R){return typeof p=="object"&&p!==null&&p.key!=null?P(""+p.key):R.toString(36)}function W(p){switch(p.status){case"fulfilled":return p.value;case"rejected":throw p.reason;default:switch(typeof p.status=="string"?p.then(se,se):(p.status="pending",p.then(function(R){p.status==="pending"&&(p.status="fulfilled",p.value=R)},function(R){p.status==="pending"&&(p.status="rejected",p.reason=R)})),p.status){case"fulfilled":return p.value;case"rejected":throw p.reason}}throw p}function w(p,R,Y,V,le){var oe=typeof p;(oe==="undefined"||oe==="boolean")&&(p=null);var Se=!1;if(p===null)Se=!0;else switch(oe){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(p.$$typeof){case t:case s:Se=!0;break;case C:return Se=p._init,w(Se(p._payload),R,Y,V,le)}}if(Se)return le=le(p),Se=V===""?"."+F(p,0):V,ee(le)?(Y="",Se!=null&&(Y=Se.replace(j,"$&/")+"/"),w(le,R,Y,"",function(mi){return mi})):le!=null&&(de(le)&&(le=mt(le,Y+(le.key==null||p&&p.key===le.key?"":(""+le.key).replace(j,"$&/")+"/")+Se)),R.push(le)),1;Se=0;var nt=V===""?".":V+":";if(ee(p))for(var Be=0;Be<p.length;Be++)V=p[Be],oe=nt+F(V,Be),Se+=w(V,R,Y,oe,le);else if(Be=A(p),typeof Be=="function")for(p=Be.call(p),Be=0;!(V=p.next()).done;)V=V.value,oe=nt+F(V,Be++),Se+=w(V,R,Y,oe,le);else if(oe==="object"){if(typeof p.then=="function")return w(W(p),R,Y,V,le);throw R=String(p),Error("Objects are not valid as a React child (found: "+(R==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.")}return Se}function z(p,R,Y){if(p==null)return p;var V=[],le=0;return w(p,V,"","",function(oe){return R.call(Y,oe,le++)}),V}function N(p){if(p._status===-1){var R=p._result;R=R(),R.then(function(Y){(p._status===0||p._status===-1)&&(p._status=1,p._result=Y)},function(Y){(p._status===0||p._status===-1)&&(p._status=2,p._result=Y)}),p._status===-1&&(p._status=0,p._result=R)}if(p._status===1)return p._result.default;throw p._result}var re=typeof reportError=="function"?reportError:function(p){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var R=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof p=="object"&&p!==null&&typeof p.message=="string"?String(p.message):String(p),error:p});if(!window.dispatchEvent(R))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",p);return}console.error(p)},he={map:z,forEach:function(p,R,Y){z(p,function(){R.apply(this,arguments)},Y)},count:function(p){var R=0;return z(p,function(){R++}),R},toArray:function(p){return z(p,function(R){return R})||[]},only:function(p){if(!de(p))throw Error("React.Children.only expected to receive a single React element child.");return p}};return ue.Activity=y,ue.Children=he,ue.Component=Q,ue.Fragment=n,ue.Profiler=h,ue.PureComponent=J,ue.StrictMode=a,ue.Suspense=g,ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ie,ue.__COMPILER_RUNTIME={__proto__:null,c:function(p){return ie.H.useMemoCache(p)}},ue.cache=function(p){return function(){return p.apply(null,arguments)}},ue.cacheSignal=function(){return null},ue.cloneElement=function(p,R,Y){if(p==null)throw Error("The argument must be a React element, but you passed "+p+".");var V=k({},p.props),le=p.key;if(R!=null)for(oe in R.key!==void 0&&(le=""+R.key),R)!Ae.call(R,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&R.ref===void 0||(V[oe]=R[oe]);var oe=arguments.length-2;if(oe===1)V.children=Y;else if(1<oe){for(var Se=Array(oe),nt=0;nt<oe;nt++)Se[nt]=arguments[nt+2];V.children=Se}return Ye(p.type,le,V)},ue.createContext=function(p){return p={$$typeof:f,_currentValue:p,_currentValue2:p,_threadCount:0,Provider:null,Consumer:null},p.Provider=p,p.Consumer={$$typeof:u,_context:p},p},ue.createElement=function(p,R,Y){var V,le={},oe=null;if(R!=null)for(V in R.key!==void 0&&(oe=""+R.key),R)Ae.call(R,V)&&V!=="key"&&V!=="__self"&&V!=="__source"&&(le[V]=R[V]);var Se=arguments.length-2;if(Se===1)le.children=Y;else if(1<Se){for(var nt=Array(Se),Be=0;Be<Se;Be++)nt[Be]=arguments[Be+2];le.children=nt}if(p&&p.defaultProps)for(V in Se=p.defaultProps,Se)le[V]===void 0&&(le[V]=Se[V]);return Ye(p,oe,le)},ue.createRef=function(){return{current:null}},ue.forwardRef=function(p){return{$$typeof:v,render:p}},ue.isValidElement=de,ue.lazy=function(p){return{$$typeof:C,_payload:{_status:-1,_result:p},_init:N}},ue.memo=function(p,R){return{$$typeof:_,type:p,compare:R===void 0?null:R}},ue.startTransition=function(p){var R=ie.T,Y={};ie.T=Y;try{var V=p(),le=ie.S;le!==null&&le(Y,V),typeof V=="object"&&V!==null&&typeof V.then=="function"&&V.then(se,re)}catch(oe){re(oe)}finally{R!==null&&Y.types!==null&&(R.types=Y.types),ie.T=R}},ue.unstable_useCacheRefresh=function(){return ie.H.useCacheRefresh()},ue.use=function(p){return ie.H.use(p)},ue.useActionState=function(p,R,Y){return ie.H.useActionState(p,R,Y)},ue.useCallback=function(p,R){return ie.H.useCallback(p,R)},ue.useContext=function(p){return ie.H.useContext(p)},ue.useDebugValue=function(){},ue.useDeferredValue=function(p,R){return ie.H.useDeferredValue(p,R)},ue.useEffect=function(p,R){return ie.H.useEffect(p,R)},ue.useEffectEvent=function(p){return ie.H.useEffectEvent(p)},ue.useId=function(){return ie.H.useId()},ue.useImperativeHandle=function(p,R,Y){return ie.H.useImperativeHandle(p,R,Y)},ue.useInsertionEffect=function(p,R){return ie.H.useInsertionEffect(p,R)},ue.useLayoutEffect=function(p,R){return ie.H.useLayoutEffect(p,R)},ue.useMemo=function(p,R){return ie.H.useMemo(p,R)},ue.useOptimistic=function(p,R){return ie.H.useOptimistic(p,R)},ue.useReducer=function(p,R,Y){return ie.H.useReducer(p,R,Y)},ue.useRef=function(p){return ie.H.useRef(p)},ue.useState=function(p){return ie.H.useState(p)},ue.useSyncExternalStore=function(p,R,Y){return ie.H.useSyncExternalStore(p,R,Y)},ue.useTransition=function(){return ie.H.useTransition()},ue.version="19.2.4",ue}var Dv;function uu(){return Dv||(Dv=1,cc.exports=WS()),cc.exports}var me=uu(),uc={exports:{}},qn={},fc={exports:{}},dc={};var Tv;function VS(){return Tv||(Tv=1,(function(t){function s(w,z){var N=w.length;w.push(z);e:for(;0<N;){var re=N-1>>>1,he=w[re];if(0<h(he,z))w[re]=z,w[N]=he,N=re;else break e}}function n(w){return w.length===0?null:w[0]}function a(w){if(w.length===0)return null;var z=w[0],N=w.pop();if(N!==z){w[0]=N;e:for(var re=0,he=w.length,p=he>>>1;re<p;){var R=2*(re+1)-1,Y=w[R],V=R+1,le=w[V];if(0>h(Y,N))V<he&&0>h(le,Y)?(w[re]=le,w[V]=N,re=V):(w[re]=Y,w[R]=N,re=R);else if(V<he&&0>h(le,N))w[re]=le,w[V]=N,re=V;else break e}}return z}function h(w,z){var N=w.sortIndex-z.sortIndex;return N!==0?N:w.id-z.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var f=Date,v=f.now();t.unstable_now=function(){return f.now()-v}}var g=[],_=[],C=1,y=null,x=3,A=!1,D=!1,k=!1,G=!1,Q=typeof setTimeout=="function"?setTimeout:null,ve=typeof clearTimeout=="function"?clearTimeout:null,J=typeof setImmediate<"u"?setImmediate:null;function Z(w){for(var z=n(_);z!==null;){if(z.callback===null)a(_);else if(z.startTime<=w)a(_),z.sortIndex=z.expirationTime,s(g,z);else break;z=n(_)}}function ee(w){if(k=!1,Z(w),!D)if(n(g)!==null)D=!0,se||(se=!0,P());else{var z=n(_);z!==null&&W(ee,z.startTime-w)}}var se=!1,ie=-1,Ae=5,Ye=-1;function mt(){return G?!0:!(t.unstable_now()-Ye<Ae)}function de(){if(G=!1,se){var w=t.unstable_now();Ye=w;var z=!0;try{e:{D=!1,k&&(k=!1,ve(ie),ie=-1),A=!0;var N=x;try{t:{for(Z(w),y=n(g);y!==null&&!(y.expirationTime>w&&mt());){var re=y.callback;if(typeof re=="function"){y.callback=null,x=y.priorityLevel;var he=re(y.expirationTime<=w);if(w=t.unstable_now(),typeof he=="function"){y.callback=he,Z(w),z=!0;break t}y===n(g)&&a(g),Z(w)}else a(g);y=n(g)}if(y!==null)z=!0;else{var p=n(_);p!==null&&W(ee,p.startTime-w),z=!1}}break e}finally{y=null,x=N,A=!1}z=void 0}}finally{z?P():se=!1}}}var P;if(typeof J=="function")P=function(){J(de)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,F=j.port2;j.port1.onmessage=de,P=function(){F.postMessage(null)}}else P=function(){Q(de,0)};function W(w,z){ie=Q(function(){w(t.unstable_now())},z)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(w){w.callback=null},t.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Ae=0<w?Math.floor(1e3/w):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_next=function(w){switch(x){case 1:case 2:case 3:var z=3;break;default:z=x}var N=x;x=z;try{return w()}finally{x=N}},t.unstable_requestPaint=function(){G=!0},t.unstable_runWithPriority=function(w,z){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var N=x;x=w;try{return z()}finally{x=N}},t.unstable_scheduleCallback=function(w,z,N){var re=t.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?re+N:re):N=re,w){case 1:var he=-1;break;case 2:he=250;break;case 5:he=1073741823;break;case 4:he=1e4;break;default:he=5e3}return he=N+he,w={id:C++,callback:z,priorityLevel:w,startTime:N,expirationTime:he,sortIndex:-1},N>re?(w.sortIndex=N,s(_,w),n(g)===null&&w===n(_)&&(k?(ve(ie),ie=-1):k=!0,W(ee,N-re))):(w.sortIndex=he,s(g,w),D||A||(D=!0,se||(se=!0,P()))),w},t.unstable_shouldYield=mt,t.unstable_wrapCallback=function(w){var z=x;return function(){var N=x;x=z;try{return w.apply(this,arguments)}finally{x=N}}}})(dc)),dc}var Mv;function XS(){return Mv||(Mv=1,fc.exports=VS()),fc.exports}var _c={exports:{}},Et={};var Bv;function GS(){if(Bv)return Et;Bv=1;var t=uu();function s(g){var _="https://react.dev/errors/"+g;if(1<arguments.length){_+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)_+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+g+"; visit "+_+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(s(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},h=Symbol.for("react.portal");function u(g,_,C){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:y==null?null:""+y,children:g,containerInfo:_,implementation:C}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(g,_){if(g==="font")return"";if(typeof _=="string")return _==="use-credentials"?_:""}return Et.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Et.createPortal=function(g,_){var C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_||_.nodeType!==1&&_.nodeType!==9&&_.nodeType!==11)throw Error(s(299));return u(g,_,null,C)},Et.flushSync=function(g){var _=f.T,C=a.p;try{if(f.T=null,a.p=2,g)return g()}finally{f.T=_,a.p=C,a.d.f()}},Et.preconnect=function(g,_){typeof g=="string"&&(_?(_=_.crossOrigin,_=typeof _=="string"?_==="use-credentials"?_:"":void 0):_=null,a.d.C(g,_))},Et.prefetchDNS=function(g){typeof g=="string"&&a.d.D(g)},Et.preinit=function(g,_){if(typeof g=="string"&&_&&typeof _.as=="string"){var C=_.as,y=v(C,_.crossOrigin),x=typeof _.integrity=="string"?_.integrity:void 0,A=typeof _.fetchPriority=="string"?_.fetchPriority:void 0;C==="style"?a.d.S(g,typeof _.precedence=="string"?_.precedence:void 0,{crossOrigin:y,integrity:x,fetchPriority:A}):C==="script"&&a.d.X(g,{crossOrigin:y,integrity:x,fetchPriority:A,nonce:typeof _.nonce=="string"?_.nonce:void 0})}},Et.preinitModule=function(g,_){if(typeof g=="string")if(typeof _=="object"&&_!==null){if(_.as==null||_.as==="script"){var C=v(_.as,_.crossOrigin);a.d.M(g,{crossOrigin:C,integrity:typeof _.integrity=="string"?_.integrity:void 0,nonce:typeof _.nonce=="string"?_.nonce:void 0})}}else _==null&&a.d.M(g)},Et.preload=function(g,_){if(typeof g=="string"&&typeof _=="object"&&_!==null&&typeof _.as=="string"){var C=_.as,y=v(C,_.crossOrigin);a.d.L(g,C,{crossOrigin:y,integrity:typeof _.integrity=="string"?_.integrity:void 0,nonce:typeof _.nonce=="string"?_.nonce:void 0,type:typeof _.type=="string"?_.type:void 0,fetchPriority:typeof _.fetchPriority=="string"?_.fetchPriority:void 0,referrerPolicy:typeof _.referrerPolicy=="string"?_.referrerPolicy:void 0,imageSrcSet:typeof _.imageSrcSet=="string"?_.imageSrcSet:void 0,imageSizes:typeof _.imageSizes=="string"?_.imageSizes:void 0,media:typeof _.media=="string"?_.media:void 0})}},Et.preloadModule=function(g,_){if(typeof g=="string")if(_){var C=v(_.as,_.crossOrigin);a.d.m(g,{as:typeof _.as=="string"&&_.as!=="script"?_.as:void 0,crossOrigin:C,integrity:typeof _.integrity=="string"?_.integrity:void 0})}else a.d.m(g)},Et.requestFormReset=function(g){a.d.r(g)},Et.unstable_batchedUpdates=function(g,_){return g(_)},Et.useFormState=function(g,_,C){return f.H.useFormState(g,_,C)},Et.useFormStatus=function(){return f.H.useHostTransitionStatus()},Et.version="19.2.4",Et}var Av;function PS(){if(Av)return _c.exports;Av=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(s){console.error(s)}}return t(),_c.exports=GS(),_c.exports}var Rv;function FS(){if(Rv)return qn;Rv=1;var t=XS(),s=uu(),n=PS();function a(e){var i="https://react.dev/errors/"+e;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)i+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function h(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var i=e,r=e;if(e.alternate)for(;i.return;)i=i.return;else{e=i;do i=e,(i.flags&4098)!==0&&(r=i.return),e=i.return;while(e)}return i.tag===3?r:null}function f(e){if(e.tag===13){var i=e.memoizedState;if(i===null&&(e=e.alternate,e!==null&&(i=e.memoizedState)),i!==null)return i.dehydrated}return null}function v(e){if(e.tag===31){var i=e.memoizedState;if(i===null&&(e=e.alternate,e!==null&&(i=e.memoizedState)),i!==null)return i.dehydrated}return null}function g(e){if(u(e)!==e)throw Error(a(188))}function _(e){var i=e.alternate;if(!i){if(i=u(e),i===null)throw Error(a(188));return i!==e?null:e}for(var r=e,l=i;;){var o=r.return;if(o===null)break;var c=o.alternate;if(c===null){if(l=o.return,l!==null){r=l;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===r)return g(o),e;if(c===l)return g(o),i;c=c.sibling}throw Error(a(188))}if(r.return!==l.return)r=o,l=c;else{for(var d=!1,m=o.child;m;){if(m===r){d=!0,r=o,l=c;break}if(m===l){d=!0,l=o,r=c;break}m=m.sibling}if(!d){for(m=c.child;m;){if(m===r){d=!0,r=c,l=o;break}if(m===l){d=!0,l=c,r=o;break}m=m.sibling}if(!d)throw Error(a(189))}}if(r.alternate!==l)throw Error(a(190))}if(r.tag!==3)throw Error(a(188));return r.stateNode.current===r?e:i}function C(e){var i=e.tag;if(i===5||i===26||i===27||i===6)return e;for(e=e.child;e!==null;){if(i=C(e),i!==null)return i;e=e.sibling}return null}var y=Object.assign,x=Symbol.for("react.element"),A=Symbol.for("react.transitional.element"),D=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),ve=Symbol.for("react.consumer"),J=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),se=Symbol.for("react.suspense_list"),ie=Symbol.for("react.memo"),Ae=Symbol.for("react.lazy"),Ye=Symbol.for("react.activity"),mt=Symbol.for("react.memo_cache_sentinel"),de=Symbol.iterator;function P(e){return e===null||typeof e!="object"?null:(e=de&&e[de]||e["@@iterator"],typeof e=="function"?e:null)}var j=Symbol.for("react.client.reference");function F(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case k:return"Fragment";case Q:return"Profiler";case G:return"StrictMode";case ee:return"Suspense";case se:return"SuspenseList";case Ye:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case D:return"Portal";case J:return e.displayName||"Context";case ve:return(e._context.displayName||"Context")+".Consumer";case Z:var i=e.render;return e=e.displayName,e||(e=i.displayName||i.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ie:return i=e.displayName||null,i!==null?i:F(e.type)||"Memo";case Ae:i=e._payload,e=e._init;try{return F(e(i))}catch{}}return null}var W=Array.isArray,w=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N={pending:!1,data:null,method:null,action:null},re=[],he=-1;function p(e){return{current:e}}function R(e){0>he||(e.current=re[he],re[he]=null,he--)}function Y(e,i){he++,re[he]=e.current,e.current=i}var V=p(null),le=p(null),oe=p(null),Se=p(null);function nt(e,i){switch(Y(oe,i),Y(le,e),Y(V,null),i.nodeType){case 9:case 11:e=(e=i.documentElement)&&(e=e.namespaceURI)?G_(e):0;break;default:if(e=i.tagName,i=i.namespaceURI)i=G_(i),e=P_(i,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}R(V),Y(V,e)}function Be(){R(V),R(le),R(oe)}function mi(e){e.memoizedState!==null&&Y(Se,e);var i=V.current,r=P_(i,e.type);i!==r&&(Y(le,e),Y(V,r))}function pi(e){le.current===e&&(R(V),R(le)),Se.current===e&&(R(Se),Ln._currentValue=N)}var It,xe;function fi(e){if(It===void 0)try{throw Error()}catch(r){var i=r.stack.trim().match(/\n( *(at )?)/);It=i&&i[1]||"",xe=-1<r.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+It+e+xe}var Xa=!1;function Ga(e,i){if(!e||Xa)return"";Xa=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(i){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(O){var B=O}Reflect.construct(e,[],U)}else{try{U.call()}catch(O){B=O}e.call(U.prototype)}}else{try{throw Error()}catch(O){B=O}(U=e())&&typeof U.catch=="function"&&U.catch(function(){})}}catch(O){if(O&&B&&typeof O.stack=="string")return[O.stack,B.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=l.DetermineComponentFrameRoot(),d=c[0],m=c[1];if(d&&m){var S=d.split(`
4
+ `),M=m.split(`
5
+ `);for(o=l=0;l<S.length&&!S[l].includes("DetermineComponentFrameRoot");)l++;for(;o<M.length&&!M[o].includes("DetermineComponentFrameRoot");)o++;if(l===S.length||o===M.length)for(l=S.length-1,o=M.length-1;1<=l&&0<=o&&S[l]!==M[o];)o--;for(;1<=l&&0<=o;l--,o--)if(S[l]!==M[o]){if(l!==1||o!==1)do if(l--,o--,0>o||S[l]!==M[o]){var L=`
6
+ `+S[l].replace(" at new "," at ");return e.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",e.displayName)),L}while(1<=l&&0<=o);break}}}finally{Xa=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?fi(r):""}function pm(e,i){switch(e.tag){case 26:case 27:case 5:return fi(e.type);case 16:return fi("Lazy");case 13:return e.child!==i&&i!==null?fi("Suspense Fallback"):fi("Suspense");case 19:return fi("SuspenseList");case 0:case 15:return Ga(e.type,!1);case 11:return Ga(e.type.render,!1);case 1:return Ga(e.type,!0);case 31:return fi("Activity");default:return""}}function Cu(e){try{var i="",r=null;do i+=pm(e,r),r=e,e=e.return;while(e);return i}catch(l){return`
7
+ Error generating stack: `+l.message+`
8
+ `+l.stack}}var Pa=Object.prototype.hasOwnProperty,Fa=t.unstable_scheduleCallback,Za=t.unstable_cancelCallback,Sm=t.unstable_shouldYield,ym=t.unstable_requestPaint,Ut=t.unstable_now,bm=t.unstable_getCurrentPriorityLevel,wu=t.unstable_ImmediatePriority,Eu=t.unstable_UserBlockingPriority,ll=t.unstable_NormalPriority,Cm=t.unstable_LowPriority,xu=t.unstable_IdlePriority,wm=t.log,Em=t.unstable_setDisableYieldValue,Xr=null,qt=null;function $i(e){if(typeof wm=="function"&&Em(e),qt&&typeof qt.setStrictMode=="function")try{qt.setStrictMode(Xr,e)}catch{}}var jt=Math.clz32?Math.clz32:Tm,xm=Math.log,Dm=Math.LN2;function Tm(e){return e>>>=0,e===0?32:31-(xm(e)/Dm|0)|0}var al=256,ol=262144,hl=4194304;function Bs(e){var i=e&42;if(i!==0)return i;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function cl(e,i,r){var l=e.pendingLanes;if(l===0)return 0;var o=0,c=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var m=l&134217727;return m!==0?(l=m&~c,l!==0?o=Bs(l):(d&=m,d!==0?o=Bs(d):r||(r=m&~e,r!==0&&(o=Bs(r))))):(m=l&~c,m!==0?o=Bs(m):d!==0?o=Bs(d):r||(r=l&~e,r!==0&&(o=Bs(r)))),o===0?0:i!==0&&i!==o&&(i&c)===0&&(c=o&-o,r=i&-i,c>=r||c===32&&(r&4194048)!==0)?i:o}function Gr(e,i){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&i)===0}function Mm(e,i){switch(e){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Du(){var e=hl;return hl<<=1,(hl&62914560)===0&&(hl=4194304),e}function Qa(e){for(var i=[],r=0;31>r;r++)i.push(e);return i}function Pr(e,i){e.pendingLanes|=i,i!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Bm(e,i,r,l,o,c){var d=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var m=e.entanglements,S=e.expirationTimes,M=e.hiddenUpdates;for(r=d&~r;0<r;){var L=31-jt(r),U=1<<L;m[L]=0,S[L]=-1;var B=M[L];if(B!==null)for(M[L]=null,L=0;L<B.length;L++){var O=B[L];O!==null&&(O.lane&=-536870913)}r&=~U}l!==0&&Tu(e,l,0),c!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=c&~(d&~i))}function Tu(e,i,r){e.pendingLanes|=i,e.suspendedLanes&=~i;var l=31-jt(i);e.entangledLanes|=i,e.entanglements[l]=e.entanglements[l]|1073741824|r&261930}function Mu(e,i){var r=e.entangledLanes|=i;for(e=e.entanglements;r;){var l=31-jt(r),o=1<<l;o&i|e[l]&i&&(e[l]|=i),r&=~o}}function Bu(e,i){var r=i&-i;return r=(r&42)!==0?1:Ia(r),(r&(e.suspendedLanes|i))!==0?0:r}function Ia(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function $a(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Au(){var e=z.p;return e!==0?e:(e=window.event,e===void 0?32:gv(e.type))}function Ru(e,i){var r=z.p;try{return z.p=e,i()}finally{z.p=r}}var Ji=Math.random().toString(36).slice(2),pt="__reactFiber$"+Ji,At="__reactProps$"+Ji,tr="__reactContainer$"+Ji,Ja="__reactEvents$"+Ji,Am="__reactListeners$"+Ji,Rm="__reactHandles$"+Ji,ku="__reactResources$"+Ji,Fr="__reactMarker$"+Ji;function eo(e){delete e[pt],delete e[At],delete e[Ja],delete e[Am],delete e[Rm]}function ir(e){var i=e[pt];if(i)return i;for(var r=e.parentNode;r;){if(i=r[tr]||r[pt]){if(r=i.alternate,i.child!==null||r!==null&&r.child!==null)for(e=ev(e);e!==null;){if(r=e[pt])return r;e=ev(e)}return i}e=r,r=e.parentNode}return null}function sr(e){if(e=e[pt]||e[tr]){var i=e.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return e}return null}function Zr(e){var i=e.tag;if(i===5||i===26||i===27||i===6)return e.stateNode;throw Error(a(33))}function rr(e){var i=e[ku];return i||(i=e[ku]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function ct(e){e[Fr]=!0}var Ou=new Set,Lu={};function As(e,i){nr(e,i),nr(e+"Capture",i)}function nr(e,i){for(Lu[e]=i,e=0;e<i.length;e++)Ou.add(i[e])}var km=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]*$"),zu={},Nu={};function Om(e){return Pa.call(Nu,e)?!0:Pa.call(zu,e)?!1:km.test(e)?Nu[e]=!0:(zu[e]=!0,!1)}function ul(e,i,r){if(Om(i))if(r===null)e.removeAttribute(i);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(i);return;case"boolean":var l=i.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(i);return}}e.setAttribute(i,""+r)}}function fl(e,i,r){if(r===null)e.removeAttribute(i);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttribute(i,""+r)}}function Bi(e,i,r,l){if(l===null)e.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(i,r,""+l)}}function $t(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Hu(e){var i=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Lm(e,i,r){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,i);if(!e.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var o=l.get,c=l.set;return Object.defineProperty(e,i,{configurable:!0,get:function(){return o.call(this)},set:function(d){r=""+d,c.call(this,d)}}),Object.defineProperty(e,i,{enumerable:l.enumerable}),{getValue:function(){return r},setValue:function(d){r=""+d},stopTracking:function(){e._valueTracker=null,delete e[i]}}}}function to(e){if(!e._valueTracker){var i=Hu(e)?"checked":"value";e._valueTracker=Lm(e,i,""+e[i])}}function Uu(e){if(!e)return!1;var i=e._valueTracker;if(!i)return!0;var r=i.getValue(),l="";return e&&(l=Hu(e)?e.checked?"true":"false":e.value),e=l,e!==r?(i.setValue(e),!0):!1}function dl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var zm=/[\n"\\]/g;function Jt(e){return e.replace(zm,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function io(e,i,r,l,o,c,d,m){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),i!=null?d==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+$t(i)):e.value!==""+$t(i)&&(e.value=""+$t(i)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),i!=null?so(e,d,$t(i)):r!=null?so(e,d,$t(r)):l!=null&&e.removeAttribute("value"),o==null&&c!=null&&(e.defaultChecked=!!c),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.name=""+$t(m):e.removeAttribute("name")}function qu(e,i,r,l,o,c,d,m){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),i!=null||r!=null){if(!(c!=="submit"&&c!=="reset"||i!=null)){to(e);return}r=r!=null?""+$t(r):"",i=i!=null?""+$t(i):r,m||i===e.value||(e.value=i),e.defaultValue=i}l=l??o,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=m?e.checked:!!l,e.defaultChecked=!!l,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),to(e)}function so(e,i,r){i==="number"&&dl(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function lr(e,i,r,l){if(e=e.options,i){i={};for(var o=0;o<r.length;o++)i["$"+r[o]]=!0;for(r=0;r<e.length;r++)o=i.hasOwnProperty("$"+e[r].value),e[r].selected!==o&&(e[r].selected=o),o&&l&&(e[r].defaultSelected=!0)}else{for(r=""+$t(r),i=null,o=0;o<e.length;o++){if(e[o].value===r){e[o].selected=!0,l&&(e[o].defaultSelected=!0);return}i!==null||e[o].disabled||(i=e[o])}i!==null&&(i.selected=!0)}}function ju(e,i,r){if(i!=null&&(i=""+$t(i),i!==e.value&&(e.value=i),r==null)){e.defaultValue!==i&&(e.defaultValue=i);return}e.defaultValue=r!=null?""+$t(r):""}function Yu(e,i,r,l){if(i==null){if(l!=null){if(r!=null)throw Error(a(92));if(W(l)){if(1<l.length)throw Error(a(93));l=l[0]}r=l}r==null&&(r=""),i=r}r=$t(i),e.defaultValue=r,l=e.textContent,l===r&&l!==""&&l!==null&&(e.value=l),to(e)}function ar(e,i){if(i){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=i;return}}e.textContent=i}var Nm=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 Ku(e,i,r){var l=i.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?l?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="":l?e.setProperty(i,r):typeof r!="number"||r===0||Nm.has(i)?i==="float"?e.cssFloat=r:e[i]=(""+r).trim():e[i]=r+"px"}function Wu(e,i,r){if(i!=null&&typeof i!="object")throw Error(a(62));if(e=e.style,r!=null){for(var l in r)!r.hasOwnProperty(l)||i!=null&&i.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var o in i)l=i[o],i.hasOwnProperty(o)&&r[o]!==l&&Ku(e,o,l)}else for(var c in i)i.hasOwnProperty(c)&&Ku(e,c,i[c])}function ro(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Hm=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"]]),Um=/^[\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 _l(e){return Um.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ai(){}var no=null;function lo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var or=null,hr=null;function Vu(e){var i=sr(e);if(i&&(e=i.stateNode)){var r=e[At]||null;e:switch(e=i.stateNode,i.type){case"input":if(io(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),i=r.name,r.type==="radio"&&i!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+Jt(""+i)+'"][type="radio"]'),i=0;i<r.length;i++){var l=r[i];if(l!==e&&l.form===e.form){var o=l[At]||null;if(!o)throw Error(a(90));io(l,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(i=0;i<r.length;i++)l=r[i],l.form===e.form&&Uu(l)}break e;case"textarea":ju(e,r.value,r.defaultValue);break e;case"select":i=r.value,i!=null&&lr(e,!!r.multiple,i,!1)}}}var ao=!1;function Xu(e,i,r){if(ao)return e(i,r);ao=!0;try{var l=e(i);return l}finally{if(ao=!1,(or!==null||hr!==null)&&(ta(),or&&(i=or,e=hr,hr=or=null,Vu(i),e)))for(i=0;i<e.length;i++)Vu(e[i])}}function Qr(e,i){var r=e.stateNode;if(r===null)return null;var l=r[At]||null;if(l===null)return null;r=l[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(a(231,i,typeof r));return r}var Ri=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),oo=!1;if(Ri)try{var Ir={};Object.defineProperty(Ir,"passive",{get:function(){oo=!0}}),window.addEventListener("test",Ir,Ir),window.removeEventListener("test",Ir,Ir)}catch{oo=!1}var es=null,ho=null,vl=null;function Gu(){if(vl)return vl;var e,i=ho,r=i.length,l,o="value"in es?es.value:es.textContent,c=o.length;for(e=0;e<r&&i[e]===o[e];e++);var d=r-e;for(l=1;l<=d&&i[r-l]===o[c-l];l++);return vl=o.slice(e,1<l?1-l:void 0)}function gl(e){var i=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&i===13&&(e=13)):e=i,e===10&&(e=13),32<=e||e===13?e:0}function ml(){return!0}function Pu(){return!1}function Rt(e){function i(r,l,o,c,d){this._reactName=r,this._targetInst=o,this.type=l,this.nativeEvent=c,this.target=d,this.currentTarget=null;for(var m in e)e.hasOwnProperty(m)&&(r=e[m],this[m]=r?r(c):c[m]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?ml:Pu,this.isPropagationStopped=Pu,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=ml)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=ml)},persist:function(){},isPersistent:ml}),i}var Rs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pl=Rt(Rs),$r=y({},Rs,{view:0,detail:0}),qm=Rt($r),co,uo,Jr,Sl=y({},$r,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_o,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Jr&&(Jr&&e.type==="mousemove"?(co=e.screenX-Jr.screenX,uo=e.screenY-Jr.screenY):uo=co=0,Jr=e),co)},movementY:function(e){return"movementY"in e?e.movementY:uo}}),Fu=Rt(Sl),jm=y({},Sl,{dataTransfer:0}),Ym=Rt(jm),Km=y({},$r,{relatedTarget:0}),fo=Rt(Km),Wm=y({},Rs,{animationName:0,elapsedTime:0,pseudoElement:0}),Vm=Rt(Wm),Xm=y({},Rs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Gm=Rt(Xm),Pm=y({},Rs,{data:0}),Zu=Rt(Pm),Fm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zm={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"},Qm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Im(e){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(e):(e=Qm[e])?!!i[e]:!1}function _o(){return Im}var $m=y({},$r,{key:function(e){if(e.key){var i=Fm[e.key]||e.key;if(i!=="Unidentified")return i}return e.type==="keypress"?(e=gl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Zm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_o,charCode:function(e){return e.type==="keypress"?gl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?gl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Jm=Rt($m),ep=y({},Sl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qu=Rt(ep),tp=y({},$r,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_o}),ip=Rt(tp),sp=y({},Rs,{propertyName:0,elapsedTime:0,pseudoElement:0}),rp=Rt(sp),np=y({},Sl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),lp=Rt(np),ap=y({},Rs,{newState:0,oldState:0}),op=Rt(ap),hp=[9,13,27,32],vo=Ri&&"CompositionEvent"in window,en=null;Ri&&"documentMode"in document&&(en=document.documentMode);var cp=Ri&&"TextEvent"in window&&!en,Iu=Ri&&(!vo||en&&8<en&&11>=en),$u=" ",Ju=!1;function ef(e,i){switch(e){case"keyup":return hp.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var cr=!1;function up(e,i){switch(e){case"compositionend":return tf(i);case"keypress":return i.which!==32?null:(Ju=!0,$u);case"textInput":return e=i.data,e===$u&&Ju?null:e;default:return null}}function fp(e,i){if(cr)return e==="compositionend"||!vo&&ef(e,i)?(e=Gu(),vl=ho=es=null,cr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Iu&&i.locale!=="ko"?null:i.data;default:return null}}var dp={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 sf(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i==="input"?!!dp[e.type]:i==="textarea"}function rf(e,i,r,l){or?hr?hr.push(l):hr=[l]:or=l,i=oa(i,"onChange"),0<i.length&&(r=new pl("onChange","change",null,r,l),e.push({event:r,listeners:i}))}var tn=null,sn=null;function _p(e){j_(e,0)}function yl(e){var i=Zr(e);if(Uu(i))return e}function nf(e,i){if(e==="change")return i}var lf=!1;if(Ri){var go;if(Ri){var mo="oninput"in document;if(!mo){var af=document.createElement("div");af.setAttribute("oninput","return;"),mo=typeof af.oninput=="function"}go=mo}else go=!1;lf=go&&(!document.documentMode||9<document.documentMode)}function of(){tn&&(tn.detachEvent("onpropertychange",hf),sn=tn=null)}function hf(e){if(e.propertyName==="value"&&yl(sn)){var i=[];rf(i,sn,e,lo(e)),Xu(_p,i)}}function vp(e,i,r){e==="focusin"?(of(),tn=i,sn=r,tn.attachEvent("onpropertychange",hf)):e==="focusout"&&of()}function gp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return yl(sn)}function mp(e,i){if(e==="click")return yl(i)}function pp(e,i){if(e==="input"||e==="change")return yl(i)}function Sp(e,i){return e===i&&(e!==0||1/e===1/i)||e!==e&&i!==i}var Yt=typeof Object.is=="function"?Object.is:Sp;function rn(e,i){if(Yt(e,i))return!0;if(typeof e!="object"||e===null||typeof i!="object"||i===null)return!1;var r=Object.keys(e),l=Object.keys(i);if(r.length!==l.length)return!1;for(l=0;l<r.length;l++){var o=r[l];if(!Pa.call(i,o)||!Yt(e[o],i[o]))return!1}return!0}function cf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function uf(e,i){var r=cf(e);e=0;for(var l;r;){if(r.nodeType===3){if(l=e+r.textContent.length,e<=i&&l>=i)return{node:r,offset:i-e};e=l}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=cf(r)}}function ff(e,i){return e&&i?e===i?!0:e&&e.nodeType===3?!1:i&&i.nodeType===3?ff(e,i.parentNode):"contains"in e?e.contains(i):e.compareDocumentPosition?!!(e.compareDocumentPosition(i)&16):!1:!1}function df(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var i=dl(e.document);i instanceof e.HTMLIFrameElement;){try{var r=typeof i.contentWindow.location.href=="string"}catch{r=!1}if(r)e=i.contentWindow;else break;i=dl(e.document)}return i}function po(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i&&(i==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||i==="textarea"||e.contentEditable==="true")}var yp=Ri&&"documentMode"in document&&11>=document.documentMode,ur=null,So=null,nn=null,yo=!1;function _f(e,i,r){var l=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;yo||ur==null||ur!==dl(l)||(l=ur,"selectionStart"in l&&po(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),nn&&rn(nn,l)||(nn=l,l=oa(So,"onSelect"),0<l.length&&(i=new pl("onSelect","select",null,i,r),e.push({event:i,listeners:l}),i.target=ur)))}function ks(e,i){var r={};return r[e.toLowerCase()]=i.toLowerCase(),r["Webkit"+e]="webkit"+i,r["Moz"+e]="moz"+i,r}var fr={animationend:ks("Animation","AnimationEnd"),animationiteration:ks("Animation","AnimationIteration"),animationstart:ks("Animation","AnimationStart"),transitionrun:ks("Transition","TransitionRun"),transitionstart:ks("Transition","TransitionStart"),transitioncancel:ks("Transition","TransitionCancel"),transitionend:ks("Transition","TransitionEnd")},bo={},vf={};Ri&&(vf=document.createElement("div").style,"AnimationEvent"in window||(delete fr.animationend.animation,delete fr.animationiteration.animation,delete fr.animationstart.animation),"TransitionEvent"in window||delete fr.transitionend.transition);function Os(e){if(bo[e])return bo[e];if(!fr[e])return e;var i=fr[e],r;for(r in i)if(i.hasOwnProperty(r)&&r in vf)return bo[e]=i[r];return e}var gf=Os("animationend"),mf=Os("animationiteration"),pf=Os("animationstart"),bp=Os("transitionrun"),Cp=Os("transitionstart"),wp=Os("transitioncancel"),Sf=Os("transitionend"),yf=new Map,Co="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(" ");Co.push("scrollEnd");function di(e,i){yf.set(e,i),As(i,[e])}var bl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ei=[],dr=0,wo=0;function Cl(){for(var e=dr,i=wo=dr=0;i<e;){var r=ei[i];ei[i++]=null;var l=ei[i];ei[i++]=null;var o=ei[i];ei[i++]=null;var c=ei[i];if(ei[i++]=null,l!==null&&o!==null){var d=l.pending;d===null?o.next=o:(o.next=d.next,d.next=o),l.pending=o}c!==0&&bf(r,o,c)}}function wl(e,i,r,l){ei[dr++]=e,ei[dr++]=i,ei[dr++]=r,ei[dr++]=l,wo|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Eo(e,i,r,l){return wl(e,i,r,l),El(e)}function Ls(e,i){return wl(e,null,null,i),El(e)}function bf(e,i,r){e.lanes|=r;var l=e.alternate;l!==null&&(l.lanes|=r);for(var o=!1,c=e.return;c!==null;)c.childLanes|=r,l=c.alternate,l!==null&&(l.childLanes|=r),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(o=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,o&&i!==null&&(o=31-jt(r),e=c.hiddenUpdates,l=e[o],l===null?e[o]=[i]:l.push(i),i.lane=r|536870912),c):null}function El(e){if(50<Tn)throw Tn=0,Oh=null,Error(a(185));for(var i=e.return;i!==null;)e=i,i=e.return;return e.tag===3?e.stateNode:null}var _r={};function Ep(e,i,r,l){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kt(e,i,r,l){return new Ep(e,i,r,l)}function xo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ki(e,i){var r=e.alternate;return r===null?(r=Kt(e.tag,i,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=i,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,i=e.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function Cf(e,i){e.flags&=65011714;var r=e.alternate;return r===null?(e.childLanes=0,e.lanes=i,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,i=r.dependencies,e.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),e}function xl(e,i,r,l,o,c){var d=0;if(l=e,typeof e=="function")xo(e)&&(d=1);else if(typeof e=="string")d=BS(e,r,V.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Ye:return e=Kt(31,r,i,o),e.elementType=Ye,e.lanes=c,e;case k:return zs(r.children,o,c,i);case G:d=8,o|=24;break;case Q:return e=Kt(12,r,i,o|2),e.elementType=Q,e.lanes=c,e;case ee:return e=Kt(13,r,i,o),e.elementType=ee,e.lanes=c,e;case se:return e=Kt(19,r,i,o),e.elementType=se,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case J:d=10;break e;case ve:d=9;break e;case Z:d=11;break e;case ie:d=14;break e;case Ae:d=16,l=null;break e}d=29,r=Error(a(130,e===null?"null":typeof e,"")),l=null}return i=Kt(d,r,i,o),i.elementType=e,i.type=l,i.lanes=c,i}function zs(e,i,r,l){return e=Kt(7,e,l,i),e.lanes=r,e}function Do(e,i,r){return e=Kt(6,e,null,i),e.lanes=r,e}function wf(e){var i=Kt(18,null,null,0);return i.stateNode=e,i}function To(e,i,r){return i=Kt(4,e.children!==null?e.children:[],e.key,i),i.lanes=r,i.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},i}var Ef=new WeakMap;function ti(e,i){if(typeof e=="object"&&e!==null){var r=Ef.get(e);return r!==void 0?r:(i={value:e,source:i,stack:Cu(i)},Ef.set(e,i),i)}return{value:e,source:i,stack:Cu(i)}}var vr=[],gr=0,Dl=null,ln=0,ii=[],si=0,ts=null,Si=1,yi="";function Oi(e,i){vr[gr++]=ln,vr[gr++]=Dl,Dl=e,ln=i}function xf(e,i,r){ii[si++]=Si,ii[si++]=yi,ii[si++]=ts,ts=e;var l=Si;e=yi;var o=32-jt(l)-1;l&=~(1<<o),r+=1;var c=32-jt(i)+o;if(30<c){var d=o-o%5;c=(l&(1<<d)-1).toString(32),l>>=d,o-=d,Si=1<<32-jt(i)+o|r<<o|l,yi=c+e}else Si=1<<c|r<<o|l,yi=e}function Mo(e){e.return!==null&&(Oi(e,1),xf(e,1,0))}function Bo(e){for(;e===Dl;)Dl=vr[--gr],vr[gr]=null,ln=vr[--gr],vr[gr]=null;for(;e===ts;)ts=ii[--si],ii[si]=null,yi=ii[--si],ii[si]=null,Si=ii[--si],ii[si]=null}function Df(e,i){ii[si++]=Si,ii[si++]=yi,ii[si++]=ts,Si=i.id,yi=i.overflow,ts=e}var St=null,Ue=null,Ee=!1,is=null,ri=!1,Ao=Error(a(519));function ss(e){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw an(ti(i,e)),Ao}function Tf(e){var i=e.stateNode,r=e.type,l=e.memoizedProps;switch(i[pt]=e,i[At]=l,r){case"dialog":be("cancel",i),be("close",i);break;case"iframe":case"object":case"embed":be("load",i);break;case"video":case"audio":for(r=0;r<Bn.length;r++)be(Bn[r],i);break;case"source":be("error",i);break;case"img":case"image":case"link":be("error",i),be("load",i);break;case"details":be("toggle",i);break;case"input":be("invalid",i),qu(i,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":be("invalid",i);break;case"textarea":be("invalid",i),Yu(i,l.value,l.defaultValue,l.children)}r=l.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||i.textContent===""+r||l.suppressHydrationWarning===!0||V_(i.textContent,r)?(l.popover!=null&&(be("beforetoggle",i),be("toggle",i)),l.onScroll!=null&&be("scroll",i),l.onScrollEnd!=null&&be("scrollend",i),l.onClick!=null&&(i.onclick=Ai),i=!0):i=!1,i||ss(e,!0)}function Mf(e){for(St=e.return;St;)switch(St.tag){case 5:case 31:case 13:ri=!1;return;case 27:case 3:ri=!0;return;default:St=St.return}}function mr(e){if(e!==St)return!1;if(!Ee)return Mf(e),Ee=!0,!1;var i=e.tag,r;if((r=i!==3&&i!==27)&&((r=i===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Fh(e.type,e.memoizedProps)),r=!r),r&&Ue&&ss(e),Mf(e),i===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Ue=J_(e)}else if(i===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Ue=J_(e)}else i===27?(i=Ue,ms(e.type)?(e=Jh,Jh=null,Ue=e):Ue=i):Ue=St?li(e.stateNode.nextSibling):null;return!0}function Ns(){Ue=St=null,Ee=!1}function Ro(){var e=is;return e!==null&&(zt===null?zt=e:zt.push.apply(zt,e),is=null),e}function an(e){is===null?is=[e]:is.push(e)}var ko=p(null),Hs=null,Li=null;function rs(e,i,r){Y(ko,i._currentValue),i._currentValue=r}function zi(e){e._currentValue=ko.current,R(ko)}function Oo(e,i,r){for(;e!==null;){var l=e.alternate;if((e.childLanes&i)!==i?(e.childLanes|=i,l!==null&&(l.childLanes|=i)):l!==null&&(l.childLanes&i)!==i&&(l.childLanes|=i),e===r)break;e=e.return}}function Lo(e,i,r,l){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var c=o.dependencies;if(c!==null){var d=o.child;c=c.firstContext;e:for(;c!==null;){var m=c;c=o;for(var S=0;S<i.length;S++)if(m.context===i[S]){c.lanes|=r,m=c.alternate,m!==null&&(m.lanes|=r),Oo(c.return,r,e),l||(d=null);break e}c=m.next}}else if(o.tag===18){if(d=o.return,d===null)throw Error(a(341));d.lanes|=r,c=d.alternate,c!==null&&(c.lanes|=r),Oo(d,r,e),d=null}else d=o.child;if(d!==null)d.return=o;else for(d=o;d!==null;){if(d===e){d=null;break}if(o=d.sibling,o!==null){o.return=d.return,d=o;break}d=d.return}o=d}}function pr(e,i,r,l){e=null;for(var o=i,c=!1;o!==null;){if(!c){if((o.flags&524288)!==0)c=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var d=o.alternate;if(d===null)throw Error(a(387));if(d=d.memoizedProps,d!==null){var m=o.type;Yt(o.pendingProps.value,d.value)||(e!==null?e.push(m):e=[m])}}else if(o===Se.current){if(d=o.alternate,d===null)throw Error(a(387));d.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(Ln):e=[Ln])}o=o.return}e!==null&&Lo(i,e,r,l),i.flags|=262144}function Tl(e){for(e=e.firstContext;e!==null;){if(!Yt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Us(e){Hs=e,Li=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function yt(e){return Bf(Hs,e)}function Ml(e,i){return Hs===null&&Us(e),Bf(e,i)}function Bf(e,i){var r=i._currentValue;if(i={context:i,memoizedValue:r,next:null},Li===null){if(e===null)throw Error(a(308));Li=i,e.dependencies={lanes:0,firstContext:i},e.flags|=524288}else Li=Li.next=i;return r}var xp=typeof AbortController<"u"?AbortController:function(){var e=[],i=this.signal={aborted:!1,addEventListener:function(r,l){e.push(l)}};this.abort=function(){i.aborted=!0,e.forEach(function(r){return r()})}},Dp=t.unstable_scheduleCallback,Tp=t.unstable_NormalPriority,Je={$$typeof:J,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zo(){return{controller:new xp,data:new Map,refCount:0}}function on(e){e.refCount--,e.refCount===0&&Dp(Tp,function(){e.controller.abort()})}var hn=null,No=0,Sr=0,yr=null;function Mp(e,i){if(hn===null){var r=hn=[];No=0,Sr=qh(),yr={status:"pending",value:void 0,then:function(l){r.push(l)}}}return No++,i.then(Af,Af),i}function Af(){if(--No===0&&hn!==null){yr!==null&&(yr.status="fulfilled");var e=hn;hn=null,Sr=0,yr=null;for(var i=0;i<e.length;i++)(0,e[i])()}}function Bp(e,i){var r=[],l={status:"pending",value:null,reason:null,then:function(o){r.push(o)}};return e.then(function(){l.status="fulfilled",l.value=i;for(var o=0;o<r.length;o++)(0,r[o])(i)},function(o){for(l.status="rejected",l.reason=o,o=0;o<r.length;o++)(0,r[o])(void 0)}),l}var Rf=w.S;w.S=function(e,i){__=Ut(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&Mp(e,i),Rf!==null&&Rf(e,i)};var qs=p(null);function Ho(){var e=qs.current;return e!==null?e:He.pooledCache}function Bl(e,i){i===null?Y(qs,qs.current):Y(qs,i.pool)}function kf(){var e=Ho();return e===null?null:{parent:Je._currentValue,pool:e}}var br=Error(a(460)),Uo=Error(a(474)),Al=Error(a(542)),Rl={then:function(){}};function Of(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Lf(e,i,r){switch(r=e[r],r===void 0?e.push(i):r!==i&&(i.then(Ai,Ai),i=r),i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,Nf(e),e;default:if(typeof i.status=="string")i.then(Ai,Ai);else{if(e=He,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=i,e.status="pending",e.then(function(l){if(i.status==="pending"){var o=i;o.status="fulfilled",o.value=l}},function(l){if(i.status==="pending"){var o=i;o.status="rejected",o.reason=l}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,Nf(e),e}throw Ys=i,br}}function js(e){try{var i=e._init;return i(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(Ys=r,br):r}}var Ys=null;function zf(){if(Ys===null)throw Error(a(459));var e=Ys;return Ys=null,e}function Nf(e){if(e===br||e===Al)throw Error(a(483))}var Cr=null,cn=0;function kl(e){var i=cn;return cn+=1,Cr===null&&(Cr=[]),Lf(Cr,e,i)}function un(e,i){i=i.props.ref,e.ref=i!==void 0?i:null}function Ol(e,i){throw i.$$typeof===x?Error(a(525)):(e=Object.prototype.toString.call(i),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":e)))}function Hf(e){function i(E,b){if(e){var T=E.deletions;T===null?(E.deletions=[b],E.flags|=16):T.push(b)}}function r(E,b){if(!e)return null;for(;b!==null;)i(E,b),b=b.sibling;return null}function l(E){for(var b=new Map;E!==null;)E.key!==null?b.set(E.key,E):b.set(E.index,E),E=E.sibling;return b}function o(E,b){return E=ki(E,b),E.index=0,E.sibling=null,E}function c(E,b,T){return E.index=T,e?(T=E.alternate,T!==null?(T=T.index,T<b?(E.flags|=67108866,b):T):(E.flags|=67108866,b)):(E.flags|=1048576,b)}function d(E){return e&&E.alternate===null&&(E.flags|=67108866),E}function m(E,b,T,H){return b===null||b.tag!==6?(b=Do(T,E.mode,H),b.return=E,b):(b=o(b,T),b.return=E,b)}function S(E,b,T,H){var ne=T.type;return ne===k?L(E,b,T.props.children,H,T.key):b!==null&&(b.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===Ae&&js(ne)===b.type)?(b=o(b,T.props),un(b,T),b.return=E,b):(b=xl(T.type,T.key,T.props,null,E.mode,H),un(b,T),b.return=E,b)}function M(E,b,T,H){return b===null||b.tag!==4||b.stateNode.containerInfo!==T.containerInfo||b.stateNode.implementation!==T.implementation?(b=To(T,E.mode,H),b.return=E,b):(b=o(b,T.children||[]),b.return=E,b)}function L(E,b,T,H,ne){return b===null||b.tag!==7?(b=zs(T,E.mode,H,ne),b.return=E,b):(b=o(b,T),b.return=E,b)}function U(E,b,T){if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return b=Do(""+b,E.mode,T),b.return=E,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case A:return T=xl(b.type,b.key,b.props,null,E.mode,T),un(T,b),T.return=E,T;case D:return b=To(b,E.mode,T),b.return=E,b;case Ae:return b=js(b),U(E,b,T)}if(W(b)||P(b))return b=zs(b,E.mode,T,null),b.return=E,b;if(typeof b.then=="function")return U(E,kl(b),T);if(b.$$typeof===J)return U(E,Ml(E,b),T);Ol(E,b)}return null}function B(E,b,T,H){var ne=b!==null?b.key:null;if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return ne!==null?null:m(E,b,""+T,H);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case A:return T.key===ne?S(E,b,T,H):null;case D:return T.key===ne?M(E,b,T,H):null;case Ae:return T=js(T),B(E,b,T,H)}if(W(T)||P(T))return ne!==null?null:L(E,b,T,H,null);if(typeof T.then=="function")return B(E,b,kl(T),H);if(T.$$typeof===J)return B(E,b,Ml(E,T),H);Ol(E,T)}return null}function O(E,b,T,H,ne){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return E=E.get(T)||null,m(b,E,""+H,ne);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case A:return E=E.get(H.key===null?T:H.key)||null,S(b,E,H,ne);case D:return E=E.get(H.key===null?T:H.key)||null,M(b,E,H,ne);case Ae:return H=js(H),O(E,b,T,H,ne)}if(W(H)||P(H))return E=E.get(T)||null,L(b,E,H,ne,null);if(typeof H.then=="function")return O(E,b,T,kl(H),ne);if(H.$$typeof===J)return O(E,b,T,Ml(b,H),ne);Ol(b,H)}return null}function $(E,b,T,H){for(var ne=null,De=null,te=b,_e=b=0,we=null;te!==null&&_e<T.length;_e++){te.index>_e?(we=te,te=null):we=te.sibling;var Te=B(E,te,T[_e],H);if(Te===null){te===null&&(te=we);break}e&&te&&Te.alternate===null&&i(E,te),b=c(Te,b,_e),De===null?ne=Te:De.sibling=Te,De=Te,te=we}if(_e===T.length)return r(E,te),Ee&&Oi(E,_e),ne;if(te===null){for(;_e<T.length;_e++)te=U(E,T[_e],H),te!==null&&(b=c(te,b,_e),De===null?ne=te:De.sibling=te,De=te);return Ee&&Oi(E,_e),ne}for(te=l(te);_e<T.length;_e++)we=O(te,E,_e,T[_e],H),we!==null&&(e&&we.alternate!==null&&te.delete(we.key===null?_e:we.key),b=c(we,b,_e),De===null?ne=we:De.sibling=we,De=we);return e&&te.forEach(function(Cs){return i(E,Cs)}),Ee&&Oi(E,_e),ne}function ae(E,b,T,H){if(T==null)throw Error(a(151));for(var ne=null,De=null,te=b,_e=b=0,we=null,Te=T.next();te!==null&&!Te.done;_e++,Te=T.next()){te.index>_e?(we=te,te=null):we=te.sibling;var Cs=B(E,te,Te.value,H);if(Cs===null){te===null&&(te=we);break}e&&te&&Cs.alternate===null&&i(E,te),b=c(Cs,b,_e),De===null?ne=Cs:De.sibling=Cs,De=Cs,te=we}if(Te.done)return r(E,te),Ee&&Oi(E,_e),ne;if(te===null){for(;!Te.done;_e++,Te=T.next())Te=U(E,Te.value,H),Te!==null&&(b=c(Te,b,_e),De===null?ne=Te:De.sibling=Te,De=Te);return Ee&&Oi(E,_e),ne}for(te=l(te);!Te.done;_e++,Te=T.next())Te=O(te,E,_e,Te.value,H),Te!==null&&(e&&Te.alternate!==null&&te.delete(Te.key===null?_e:Te.key),b=c(Te,b,_e),De===null?ne=Te:De.sibling=Te,De=Te);return e&&te.forEach(function(jS){return i(E,jS)}),Ee&&Oi(E,_e),ne}function ze(E,b,T,H){if(typeof T=="object"&&T!==null&&T.type===k&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case A:e:{for(var ne=T.key;b!==null;){if(b.key===ne){if(ne=T.type,ne===k){if(b.tag===7){r(E,b.sibling),H=o(b,T.props.children),H.return=E,E=H;break e}}else if(b.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===Ae&&js(ne)===b.type){r(E,b.sibling),H=o(b,T.props),un(H,T),H.return=E,E=H;break e}r(E,b);break}else i(E,b);b=b.sibling}T.type===k?(H=zs(T.props.children,E.mode,H,T.key),H.return=E,E=H):(H=xl(T.type,T.key,T.props,null,E.mode,H),un(H,T),H.return=E,E=H)}return d(E);case D:e:{for(ne=T.key;b!==null;){if(b.key===ne)if(b.tag===4&&b.stateNode.containerInfo===T.containerInfo&&b.stateNode.implementation===T.implementation){r(E,b.sibling),H=o(b,T.children||[]),H.return=E,E=H;break e}else{r(E,b);break}else i(E,b);b=b.sibling}H=To(T,E.mode,H),H.return=E,E=H}return d(E);case Ae:return T=js(T),ze(E,b,T,H)}if(W(T))return $(E,b,T,H);if(P(T)){if(ne=P(T),typeof ne!="function")throw Error(a(150));return T=ne.call(T),ae(E,b,T,H)}if(typeof T.then=="function")return ze(E,b,kl(T),H);if(T.$$typeof===J)return ze(E,b,Ml(E,T),H);Ol(E,T)}return typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint"?(T=""+T,b!==null&&b.tag===6?(r(E,b.sibling),H=o(b,T),H.return=E,E=H):(r(E,b),H=Do(T,E.mode,H),H.return=E,E=H),d(E)):r(E,b)}return function(E,b,T,H){try{cn=0;var ne=ze(E,b,T,H);return Cr=null,ne}catch(te){if(te===br||te===Al)throw te;var De=Kt(29,te,null,E.mode);return De.lanes=H,De.return=E,De}}}var Ks=Hf(!0),Uf=Hf(!1),ns=!1;function qo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function jo(e,i){e=e.updateQueue,i.updateQueue===e&&(i.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ls(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function as(e,i,r){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Me&2)!==0){var o=l.pending;return o===null?i.next=i:(i.next=o.next,o.next=i),l.pending=i,i=El(e),bf(e,null,r),i}return wl(e,l,i,r),El(e)}function fn(e,i,r){if(i=i.updateQueue,i!==null&&(i=i.shared,(r&4194048)!==0)){var l=i.lanes;l&=e.pendingLanes,r|=l,i.lanes=r,Mu(e,r)}}function Yo(e,i){var r=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,r===l)){var o=null,c=null;if(r=r.firstBaseUpdate,r!==null){do{var d={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};c===null?o=c=d:c=c.next=d,r=r.next}while(r!==null);c===null?o=c=i:c=c.next=i}else o=c=i;r={baseState:l.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:l.shared,callbacks:l.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=i:e.next=i,r.lastBaseUpdate=i}var Ko=!1;function dn(){if(Ko){var e=yr;if(e!==null)throw e}}function _n(e,i,r,l){Ko=!1;var o=e.updateQueue;ns=!1;var c=o.firstBaseUpdate,d=o.lastBaseUpdate,m=o.shared.pending;if(m!==null){o.shared.pending=null;var S=m,M=S.next;S.next=null,d===null?c=M:d.next=M,d=S;var L=e.alternate;L!==null&&(L=L.updateQueue,m=L.lastBaseUpdate,m!==d&&(m===null?L.firstBaseUpdate=M:m.next=M,L.lastBaseUpdate=S))}if(c!==null){var U=o.baseState;d=0,L=M=S=null,m=c;do{var B=m.lane&-536870913,O=B!==m.lane;if(O?(Ce&B)===B:(l&B)===B){B!==0&&B===Sr&&(Ko=!0),L!==null&&(L=L.next={lane:0,tag:m.tag,payload:m.payload,callback:null,next:null});e:{var $=e,ae=m;B=i;var ze=r;switch(ae.tag){case 1:if($=ae.payload,typeof $=="function"){U=$.call(ze,U,B);break e}U=$;break e;case 3:$.flags=$.flags&-65537|128;case 0:if($=ae.payload,B=typeof $=="function"?$.call(ze,U,B):$,B==null)break e;U=y({},U,B);break e;case 2:ns=!0}}B=m.callback,B!==null&&(e.flags|=64,O&&(e.flags|=8192),O=o.callbacks,O===null?o.callbacks=[B]:O.push(B))}else O={lane:B,tag:m.tag,payload:m.payload,callback:m.callback,next:null},L===null?(M=L=O,S=U):L=L.next=O,d|=B;if(m=m.next,m===null){if(m=o.shared.pending,m===null)break;O=m,m=O.next,O.next=null,o.lastBaseUpdate=O,o.shared.pending=null}}while(!0);L===null&&(S=U),o.baseState=S,o.firstBaseUpdate=M,o.lastBaseUpdate=L,c===null&&(o.shared.lanes=0),fs|=d,e.lanes=d,e.memoizedState=U}}function qf(e,i){if(typeof e!="function")throw Error(a(191,e));e.call(i)}function jf(e,i){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)qf(r[e],i)}var wr=p(null),Ll=p(0);function Yf(e,i){e=Vi,Y(Ll,e),Y(wr,i),Vi=e|i.baseLanes}function Wo(){Y(Ll,Vi),Y(wr,wr.current)}function Vo(){Vi=Ll.current,R(wr),R(Ll)}var Wt=p(null),ni=null;function os(e){var i=e.alternate;Y(Qe,Qe.current&1),Y(Wt,e),ni===null&&(i===null||wr.current!==null||i.memoizedState!==null)&&(ni=e)}function Xo(e){Y(Qe,Qe.current),Y(Wt,e),ni===null&&(ni=e)}function Kf(e){e.tag===22?(Y(Qe,Qe.current),Y(Wt,e),ni===null&&(ni=e)):hs()}function hs(){Y(Qe,Qe.current),Y(Wt,Wt.current)}function Vt(e){R(Wt),ni===e&&(ni=null),R(Qe)}var Qe=p(0);function zl(e){for(var i=e;i!==null;){if(i.tag===13){var r=i.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Ih(r)||$h(r)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break;for(;i.sibling===null;){if(i.return===null||i.return===e)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Ni=0,fe=null,Oe=null,et=null,Nl=!1,Er=!1,Ws=!1,Hl=0,vn=0,xr=null,Ap=0;function Ge(){throw Error(a(321))}function Go(e,i){if(i===null)return!1;for(var r=0;r<i.length&&r<e.length;r++)if(!Yt(e[r],i[r]))return!1;return!0}function Po(e,i,r,l,o,c){return Ni=c,fe=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,w.H=e===null||e.memoizedState===null?xd:oh,Ws=!1,c=r(l,o),Ws=!1,Er&&(c=Vf(i,r,l,o)),Wf(e),c}function Wf(e){w.H=pn;var i=Oe!==null&&Oe.next!==null;if(Ni=0,et=Oe=fe=null,Nl=!1,vn=0,xr=null,i)throw Error(a(300));e===null||tt||(e=e.dependencies,e!==null&&Tl(e)&&(tt=!0))}function Vf(e,i,r,l){fe=e;var o=0;do{if(Er&&(xr=null),vn=0,Er=!1,25<=o)throw Error(a(301));if(o+=1,et=Oe=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}w.H=Dd,c=i(r,l)}while(Er);return c}function Rp(){var e=w.H,i=e.useState()[0];return i=typeof i.then=="function"?gn(i):i,e=e.useState()[0],(Oe!==null?Oe.memoizedState:null)!==e&&(fe.flags|=1024),i}function Fo(){var e=Hl!==0;return Hl=0,e}function Zo(e,i,r){i.updateQueue=e.updateQueue,i.flags&=-2053,e.lanes&=~r}function Qo(e){if(Nl){for(e=e.memoizedState;e!==null;){var i=e.queue;i!==null&&(i.pending=null),e=e.next}Nl=!1}Ni=0,et=Oe=fe=null,Er=!1,vn=Hl=0,xr=null}function Dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?fe.memoizedState=et=e:et=et.next=e,et}function Ie(){if(Oe===null){var e=fe.alternate;e=e!==null?e.memoizedState:null}else e=Oe.next;var i=et===null?fe.memoizedState:et.next;if(i!==null)et=i,Oe=e;else{if(e===null)throw fe.alternate===null?Error(a(467)):Error(a(310));Oe=e,e={memoizedState:Oe.memoizedState,baseState:Oe.baseState,baseQueue:Oe.baseQueue,queue:Oe.queue,next:null},et===null?fe.memoizedState=et=e:et=et.next=e}return et}function Ul(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function gn(e){var i=vn;return vn+=1,xr===null&&(xr=[]),e=Lf(xr,e,i),i=fe,(et===null?i.memoizedState:et.next)===null&&(i=i.alternate,w.H=i===null||i.memoizedState===null?xd:oh),e}function ql(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return gn(e);if(e.$$typeof===J)return yt(e)}throw Error(a(438,String(e)))}function Io(e){var i=null,r=fe.updateQueue;if(r!==null&&(i=r.memoCache),i==null){var l=fe.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(i={data:l.data.map(function(o){return o.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),r===null&&(r=Ul(),fe.updateQueue=r),r.memoCache=i,r=i.data[i.index],r===void 0)for(r=i.data[i.index]=Array(e),l=0;l<e;l++)r[l]=mt;return i.index++,r}function Hi(e,i){return typeof i=="function"?i(e):i}function jl(e){var i=Ie();return $o(i,Oe,e)}function $o(e,i,r){var l=e.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=r;var o=e.baseQueue,c=l.pending;if(c!==null){if(o!==null){var d=o.next;o.next=c.next,c.next=d}i.baseQueue=o=c,l.pending=null}if(c=e.baseState,o===null)e.memoizedState=c;else{i=o.next;var m=d=null,S=null,M=i,L=!1;do{var U=M.lane&-536870913;if(U!==M.lane?(Ce&U)===U:(Ni&U)===U){var B=M.revertLane;if(B===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null}),U===Sr&&(L=!0);else if((Ni&B)===B){M=M.next,B===Sr&&(L=!0);continue}else U={lane:0,revertLane:M.revertLane,gesture:null,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null},S===null?(m=S=U,d=c):S=S.next=U,fe.lanes|=B,fs|=B;U=M.action,Ws&&r(c,U),c=M.hasEagerState?M.eagerState:r(c,U)}else B={lane:U,revertLane:M.revertLane,gesture:M.gesture,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null},S===null?(m=S=B,d=c):S=S.next=B,fe.lanes|=U,fs|=U;M=M.next}while(M!==null&&M!==i);if(S===null?d=c:S.next=m,!Yt(c,e.memoizedState)&&(tt=!0,L&&(r=yr,r!==null)))throw r;e.memoizedState=c,e.baseState=d,e.baseQueue=S,l.lastRenderedState=c}return o===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Jo(e){var i=Ie(),r=i.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=e;var l=r.dispatch,o=r.pending,c=i.memoizedState;if(o!==null){r.pending=null;var d=o=o.next;do c=e(c,d.action),d=d.next;while(d!==o);Yt(c,i.memoizedState)||(tt=!0),i.memoizedState=c,i.baseQueue===null&&(i.baseState=c),r.lastRenderedState=c}return[c,l]}function Xf(e,i,r){var l=fe,o=Ie(),c=Ee;if(c){if(r===void 0)throw Error(a(407));r=r()}else r=i();var d=!Yt((Oe||o).memoizedState,r);if(d&&(o.memoizedState=r,tt=!0),o=o.queue,ih(Ff.bind(null,l,o,e),[e]),o.getSnapshot!==i||d||et!==null&&et.memoizedState.tag&1){if(l.flags|=2048,Dr(9,{destroy:void 0},Pf.bind(null,l,o,r,i),null),He===null)throw Error(a(349));c||(Ni&127)!==0||Gf(l,i,r)}return r}function Gf(e,i,r){e.flags|=16384,e={getSnapshot:i,value:r},i=fe.updateQueue,i===null?(i=Ul(),fe.updateQueue=i,i.stores=[e]):(r=i.stores,r===null?i.stores=[e]:r.push(e))}function Pf(e,i,r,l){i.value=r,i.getSnapshot=l,Zf(i)&&Qf(e)}function Ff(e,i,r){return r(function(){Zf(i)&&Qf(e)})}function Zf(e){var i=e.getSnapshot;e=e.value;try{var r=i();return!Yt(e,r)}catch{return!0}}function Qf(e){var i=Ls(e,2);i!==null&&Nt(i,e,2)}function eh(e){var i=Dt();if(typeof e=="function"){var r=e;if(e=r(),Ws){$i(!0);try{r()}finally{$i(!1)}}}return i.memoizedState=i.baseState=e,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hi,lastRenderedState:e},i}function If(e,i,r,l){return e.baseState=r,$o(e,Oe,typeof l=="function"?l:Hi)}function kp(e,i,r,l,o){if(Wl(e))throw Error(a(485));if(e=i.action,e!==null){var c={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){c.listeners.push(d)}};w.T!==null?r(!0):c.isTransition=!1,l(c),r=i.pending,r===null?(c.next=i.pending=c,$f(i,c)):(c.next=r.next,i.pending=r.next=c)}}function $f(e,i){var r=i.action,l=i.payload,o=e.state;if(i.isTransition){var c=w.T,d={};w.T=d;try{var m=r(o,l),S=w.S;S!==null&&S(d,m),Jf(e,i,m)}catch(M){th(e,i,M)}finally{c!==null&&d.types!==null&&(c.types=d.types),w.T=c}}else try{c=r(o,l),Jf(e,i,c)}catch(M){th(e,i,M)}}function Jf(e,i,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(l){ed(e,i,l)},function(l){return th(e,i,l)}):ed(e,i,r)}function ed(e,i,r){i.status="fulfilled",i.value=r,td(i),e.state=r,i=e.pending,i!==null&&(r=i.next,r===i?e.pending=null:(r=r.next,i.next=r,$f(e,r)))}function th(e,i,r){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do i.status="rejected",i.reason=r,td(i),i=i.next;while(i!==l)}e.action=null}function td(e){e=e.listeners;for(var i=0;i<e.length;i++)(0,e[i])()}function id(e,i){return i}function sd(e,i){if(Ee){var r=He.formState;if(r!==null){e:{var l=fe;if(Ee){if(Ue){t:{for(var o=Ue,c=ri;o.nodeType!==8;){if(!c){o=null;break t}if(o=li(o.nextSibling),o===null){o=null;break t}}c=o.data,o=c==="F!"||c==="F"?o:null}if(o){Ue=li(o.nextSibling),l=o.data==="F!";break e}}ss(l)}l=!1}l&&(i=r[0])}}return r=Dt(),r.memoizedState=r.baseState=i,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:id,lastRenderedState:i},r.queue=l,r=Cd.bind(null,fe,l),l.dispatch=r,l=eh(!1),c=ah.bind(null,fe,!1,l.queue),l=Dt(),o={state:i,dispatch:null,action:e,pending:null},l.queue=o,r=kp.bind(null,fe,o,c,r),o.dispatch=r,l.memoizedState=e,[i,r,!1]}function rd(e){var i=Ie();return nd(i,Oe,e)}function nd(e,i,r){if(i=$o(e,i,id)[0],e=jl(Hi)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var l=gn(i)}catch(d){throw d===br?Al:d}else l=i;i=Ie();var o=i.queue,c=o.dispatch;return r!==i.memoizedState&&(fe.flags|=2048,Dr(9,{destroy:void 0},Op.bind(null,o,r),null)),[l,c,e]}function Op(e,i){e.action=i}function ld(e){var i=Ie(),r=Oe;if(r!==null)return nd(i,r,e);Ie(),i=i.memoizedState,r=Ie();var l=r.queue.dispatch;return r.memoizedState=e,[i,l,!1]}function Dr(e,i,r,l){return e={tag:e,create:r,deps:l,inst:i,next:null},i=fe.updateQueue,i===null&&(i=Ul(),fe.updateQueue=i),r=i.lastEffect,r===null?i.lastEffect=e.next=e:(l=r.next,r.next=e,e.next=l,i.lastEffect=e),e}function ad(){return Ie().memoizedState}function Yl(e,i,r,l){var o=Dt();fe.flags|=e,o.memoizedState=Dr(1|i,{destroy:void 0},r,l===void 0?null:l)}function Kl(e,i,r,l){var o=Ie();l=l===void 0?null:l;var c=o.memoizedState.inst;Oe!==null&&l!==null&&Go(l,Oe.memoizedState.deps)?o.memoizedState=Dr(i,c,r,l):(fe.flags|=e,o.memoizedState=Dr(1|i,c,r,l))}function od(e,i){Yl(8390656,8,e,i)}function ih(e,i){Kl(2048,8,e,i)}function Lp(e){fe.flags|=4;var i=fe.updateQueue;if(i===null)i=Ul(),fe.updateQueue=i,i.events=[e];else{var r=i.events;r===null?i.events=[e]:r.push(e)}}function hd(e){var i=Ie().memoizedState;return Lp({ref:i,nextImpl:e}),function(){if((Me&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function cd(e,i){return Kl(4,2,e,i)}function ud(e,i){return Kl(4,4,e,i)}function fd(e,i){if(typeof i=="function"){e=e();var r=i(e);return function(){typeof r=="function"?r():i(null)}}if(i!=null)return e=e(),i.current=e,function(){i.current=null}}function dd(e,i,r){r=r!=null?r.concat([e]):null,Kl(4,4,fd.bind(null,i,e),r)}function sh(){}function _d(e,i){var r=Ie();i=i===void 0?null:i;var l=r.memoizedState;return i!==null&&Go(i,l[1])?l[0]:(r.memoizedState=[e,i],e)}function vd(e,i){var r=Ie();i=i===void 0?null:i;var l=r.memoizedState;if(i!==null&&Go(i,l[1]))return l[0];if(l=e(),Ws){$i(!0);try{e()}finally{$i(!1)}}return r.memoizedState=[l,i],l}function rh(e,i,r){return r===void 0||(Ni&1073741824)!==0&&(Ce&261930)===0?e.memoizedState=i:(e.memoizedState=r,e=g_(),fe.lanes|=e,fs|=e,r)}function gd(e,i,r,l){return Yt(r,i)?r:wr.current!==null?(e=rh(e,r,l),Yt(e,i)||(tt=!0),e):(Ni&42)===0||(Ni&1073741824)!==0&&(Ce&261930)===0?(tt=!0,e.memoizedState=r):(e=g_(),fe.lanes|=e,fs|=e,i)}function md(e,i,r,l,o){var c=z.p;z.p=c!==0&&8>c?c:8;var d=w.T,m={};w.T=m,ah(e,!1,i,r);try{var S=o(),M=w.S;if(M!==null&&M(m,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var L=Bp(S,l);mn(e,i,L,Pt(e))}else mn(e,i,l,Pt(e))}catch(U){mn(e,i,{then:function(){},status:"rejected",reason:U},Pt())}finally{z.p=c,d!==null&&m.types!==null&&(d.types=m.types),w.T=d}}function zp(){}function nh(e,i,r,l){if(e.tag!==5)throw Error(a(476));var o=pd(e).queue;md(e,o,i,N,r===null?zp:function(){return Sd(e),r(l)})}function pd(e){var i=e.memoizedState;if(i!==null)return i;i={memoizedState:N,baseState:N,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hi,lastRenderedState:N},next:null};var r={};return i.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hi,lastRenderedState:r},next:null},e.memoizedState=i,e=e.alternate,e!==null&&(e.memoizedState=i),i}function Sd(e){var i=pd(e);i.next===null&&(i=e.alternate.memoizedState),mn(e,i.next.queue,{},Pt())}function lh(){return yt(Ln)}function yd(){return Ie().memoizedState}function bd(){return Ie().memoizedState}function Np(e){for(var i=e.return;i!==null;){switch(i.tag){case 24:case 3:var r=Pt();e=ls(r);var l=as(i,e,r);l!==null&&(Nt(l,i,r),fn(l,i,r)),i={cache:zo()},e.payload=i;return}i=i.return}}function Hp(e,i,r){var l=Pt();r={lane:l,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Wl(e)?wd(i,r):(r=Eo(e,i,r,l),r!==null&&(Nt(r,e,l),Ed(r,i,l)))}function Cd(e,i,r){var l=Pt();mn(e,i,r,l)}function mn(e,i,r,l){var o={lane:l,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Wl(e))wd(i,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=i.lastRenderedReducer,c!==null))try{var d=i.lastRenderedState,m=c(d,r);if(o.hasEagerState=!0,o.eagerState=m,Yt(m,d))return wl(e,i,o,0),He===null&&Cl(),!1}catch{}if(r=Eo(e,i,o,l),r!==null)return Nt(r,e,l),Ed(r,i,l),!0}return!1}function ah(e,i,r,l){if(l={lane:2,revertLane:qh(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Wl(e)){if(i)throw Error(a(479))}else i=Eo(e,r,l,2),i!==null&&Nt(i,e,2)}function Wl(e){var i=e.alternate;return e===fe||i!==null&&i===fe}function wd(e,i){Er=Nl=!0;var r=e.pending;r===null?i.next=i:(i.next=r.next,r.next=i),e.pending=i}function Ed(e,i,r){if((r&4194048)!==0){var l=i.lanes;l&=e.pendingLanes,r|=l,i.lanes=r,Mu(e,r)}}var pn={readContext:yt,use:ql,useCallback:Ge,useContext:Ge,useEffect:Ge,useImperativeHandle:Ge,useLayoutEffect:Ge,useInsertionEffect:Ge,useMemo:Ge,useReducer:Ge,useRef:Ge,useState:Ge,useDebugValue:Ge,useDeferredValue:Ge,useTransition:Ge,useSyncExternalStore:Ge,useId:Ge,useHostTransitionStatus:Ge,useFormState:Ge,useActionState:Ge,useOptimistic:Ge,useMemoCache:Ge,useCacheRefresh:Ge};pn.useEffectEvent=Ge;var xd={readContext:yt,use:ql,useCallback:function(e,i){return Dt().memoizedState=[e,i===void 0?null:i],e},useContext:yt,useEffect:od,useImperativeHandle:function(e,i,r){r=r!=null?r.concat([e]):null,Yl(4194308,4,fd.bind(null,i,e),r)},useLayoutEffect:function(e,i){return Yl(4194308,4,e,i)},useInsertionEffect:function(e,i){Yl(4,2,e,i)},useMemo:function(e,i){var r=Dt();i=i===void 0?null:i;var l=e();if(Ws){$i(!0);try{e()}finally{$i(!1)}}return r.memoizedState=[l,i],l},useReducer:function(e,i,r){var l=Dt();if(r!==void 0){var o=r(i);if(Ws){$i(!0);try{r(i)}finally{$i(!1)}}}else o=i;return l.memoizedState=l.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},l.queue=e,e=e.dispatch=Hp.bind(null,fe,e),[l.memoizedState,e]},useRef:function(e){var i=Dt();return e={current:e},i.memoizedState=e},useState:function(e){e=eh(e);var i=e.queue,r=Cd.bind(null,fe,i);return i.dispatch=r,[e.memoizedState,r]},useDebugValue:sh,useDeferredValue:function(e,i){var r=Dt();return rh(r,e,i)},useTransition:function(){var e=eh(!1);return e=md.bind(null,fe,e.queue,!0,!1),Dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,i,r){var l=fe,o=Dt();if(Ee){if(r===void 0)throw Error(a(407));r=r()}else{if(r=i(),He===null)throw Error(a(349));(Ce&127)!==0||Gf(l,i,r)}o.memoizedState=r;var c={value:r,getSnapshot:i};return o.queue=c,od(Ff.bind(null,l,c,e),[e]),l.flags|=2048,Dr(9,{destroy:void 0},Pf.bind(null,l,c,r,i),null),r},useId:function(){var e=Dt(),i=He.identifierPrefix;if(Ee){var r=yi,l=Si;r=(l&~(1<<32-jt(l)-1)).toString(32)+r,i="_"+i+"R_"+r,r=Hl++,0<r&&(i+="H"+r.toString(32)),i+="_"}else r=Ap++,i="_"+i+"r_"+r.toString(32)+"_";return e.memoizedState=i},useHostTransitionStatus:lh,useFormState:sd,useActionState:sd,useOptimistic:function(e){var i=Dt();i.memoizedState=i.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=r,i=ah.bind(null,fe,!0,r),r.dispatch=i,[e,i]},useMemoCache:Io,useCacheRefresh:function(){return Dt().memoizedState=Np.bind(null,fe)},useEffectEvent:function(e){var i=Dt(),r={impl:e};return i.memoizedState=r,function(){if((Me&2)!==0)throw Error(a(440));return r.impl.apply(void 0,arguments)}}},oh={readContext:yt,use:ql,useCallback:_d,useContext:yt,useEffect:ih,useImperativeHandle:dd,useInsertionEffect:cd,useLayoutEffect:ud,useMemo:vd,useReducer:jl,useRef:ad,useState:function(){return jl(Hi)},useDebugValue:sh,useDeferredValue:function(e,i){var r=Ie();return gd(r,Oe.memoizedState,e,i)},useTransition:function(){var e=jl(Hi)[0],i=Ie().memoizedState;return[typeof e=="boolean"?e:gn(e),i]},useSyncExternalStore:Xf,useId:yd,useHostTransitionStatus:lh,useFormState:rd,useActionState:rd,useOptimistic:function(e,i){var r=Ie();return If(r,Oe,e,i)},useMemoCache:Io,useCacheRefresh:bd};oh.useEffectEvent=hd;var Dd={readContext:yt,use:ql,useCallback:_d,useContext:yt,useEffect:ih,useImperativeHandle:dd,useInsertionEffect:cd,useLayoutEffect:ud,useMemo:vd,useReducer:Jo,useRef:ad,useState:function(){return Jo(Hi)},useDebugValue:sh,useDeferredValue:function(e,i){var r=Ie();return Oe===null?rh(r,e,i):gd(r,Oe.memoizedState,e,i)},useTransition:function(){var e=Jo(Hi)[0],i=Ie().memoizedState;return[typeof e=="boolean"?e:gn(e),i]},useSyncExternalStore:Xf,useId:yd,useHostTransitionStatus:lh,useFormState:ld,useActionState:ld,useOptimistic:function(e,i){var r=Ie();return Oe!==null?If(r,Oe,e,i):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:Io,useCacheRefresh:bd};Dd.useEffectEvent=hd;function hh(e,i,r,l){i=e.memoizedState,r=r(l,i),r=r==null?i:y({},i,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var ch={enqueueSetState:function(e,i,r){e=e._reactInternals;var l=Pt(),o=ls(l);o.payload=i,r!=null&&(o.callback=r),i=as(e,o,l),i!==null&&(Nt(i,e,l),fn(i,e,l))},enqueueReplaceState:function(e,i,r){e=e._reactInternals;var l=Pt(),o=ls(l);o.tag=1,o.payload=i,r!=null&&(o.callback=r),i=as(e,o,l),i!==null&&(Nt(i,e,l),fn(i,e,l))},enqueueForceUpdate:function(e,i){e=e._reactInternals;var r=Pt(),l=ls(r);l.tag=2,i!=null&&(l.callback=i),i=as(e,l,r),i!==null&&(Nt(i,e,r),fn(i,e,r))}};function Td(e,i,r,l,o,c,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,c,d):i.prototype&&i.prototype.isPureReactComponent?!rn(r,l)||!rn(o,c):!0}function Md(e,i,r,l){e=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(r,l),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(r,l),i.state!==e&&ch.enqueueReplaceState(i,i.state,null)}function Vs(e,i){var r=i;if("ref"in i){r={};for(var l in i)l!=="ref"&&(r[l]=i[l])}if(e=e.defaultProps){r===i&&(r=y({},r));for(var o in e)r[o]===void 0&&(r[o]=e[o])}return r}function Bd(e){bl(e)}function Ad(e){console.error(e)}function Rd(e){bl(e)}function Vl(e,i){try{var r=e.onUncaughtError;r(i.value,{componentStack:i.stack})}catch(l){setTimeout(function(){throw l})}}function kd(e,i,r){try{var l=e.onCaughtError;l(r.value,{componentStack:r.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function uh(e,i,r){return r=ls(r),r.tag=3,r.payload={element:null},r.callback=function(){Vl(e,i)},r}function Od(e){return e=ls(e),e.tag=3,e}function Ld(e,i,r,l){var o=r.type.getDerivedStateFromError;if(typeof o=="function"){var c=l.value;e.payload=function(){return o(c)},e.callback=function(){kd(i,r,l)}}var d=r.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){kd(i,r,l),typeof o!="function"&&(ds===null?ds=new Set([this]):ds.add(this));var m=l.stack;this.componentDidCatch(l.value,{componentStack:m!==null?m:""})})}function Up(e,i,r,l,o){if(r.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(i=r.alternate,i!==null&&pr(i,r,o,!0),r=Wt.current,r!==null){switch(r.tag){case 31:case 13:return ni===null?ia():r.alternate===null&&Pe===0&&(Pe=3),r.flags&=-257,r.flags|=65536,r.lanes=o,l===Rl?r.flags|=16384:(i=r.updateQueue,i===null?r.updateQueue=new Set([l]):i.add(l),Nh(e,l,o)),!1;case 22:return r.flags|=65536,l===Rl?r.flags|=16384:(i=r.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([l])},r.updateQueue=i):(r=i.retryQueue,r===null?i.retryQueue=new Set([l]):r.add(l)),Nh(e,l,o)),!1}throw Error(a(435,r.tag))}return Nh(e,l,o),ia(),!1}if(Ee)return i=Wt.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=o,l!==Ao&&(e=Error(a(422),{cause:l}),an(ti(e,r)))):(l!==Ao&&(i=Error(a(423),{cause:l}),an(ti(i,r))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,l=ti(l,r),o=uh(e.stateNode,l,o),Yo(e,o),Pe!==4&&(Pe=2)),!1;var c=Error(a(520),{cause:l});if(c=ti(c,r),Dn===null?Dn=[c]:Dn.push(c),Pe!==4&&(Pe=2),i===null)return!0;l=ti(l,r),r=i;do{switch(r.tag){case 3:return r.flags|=65536,e=o&-o,r.lanes|=e,e=uh(r.stateNode,l,e),Yo(r,e),!1;case 1:if(i=r.type,c=r.stateNode,(r.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(ds===null||!ds.has(c))))return r.flags|=65536,o&=-o,r.lanes|=o,o=Od(o),Ld(o,e,r,l),Yo(r,o),!1}r=r.return}while(r!==null);return!1}var fh=Error(a(461)),tt=!1;function bt(e,i,r,l){i.child=e===null?Uf(i,null,r,l):Ks(i,e.child,r,l)}function zd(e,i,r,l,o){r=r.render;var c=i.ref;if("ref"in l){var d={};for(var m in l)m!=="ref"&&(d[m]=l[m])}else d=l;return Us(i),l=Po(e,i,r,d,c,o),m=Fo(),e!==null&&!tt?(Zo(e,i,o),Ui(e,i,o)):(Ee&&m&&Mo(i),i.flags|=1,bt(e,i,l,o),i.child)}function Nd(e,i,r,l,o){if(e===null){var c=r.type;return typeof c=="function"&&!xo(c)&&c.defaultProps===void 0&&r.compare===null?(i.tag=15,i.type=c,Hd(e,i,c,l,o)):(e=xl(r.type,null,l,i,i.mode,o),e.ref=i.ref,e.return=i,i.child=e)}if(c=e.child,!yh(e,o)){var d=c.memoizedProps;if(r=r.compare,r=r!==null?r:rn,r(d,l)&&e.ref===i.ref)return Ui(e,i,o)}return i.flags|=1,e=ki(c,l),e.ref=i.ref,e.return=i,i.child=e}function Hd(e,i,r,l,o){if(e!==null){var c=e.memoizedProps;if(rn(c,l)&&e.ref===i.ref)if(tt=!1,i.pendingProps=l=c,yh(e,o))(e.flags&131072)!==0&&(tt=!0);else return i.lanes=e.lanes,Ui(e,i,o)}return dh(e,i,r,l,o)}function Ud(e,i,r,l){var o=l.children,c=e!==null?e.memoizedState:null;if(e===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((i.flags&128)!==0){if(c=c!==null?c.baseLanes|r:r,e!==null){for(l=i.child=e.child,o=0;l!==null;)o=o|l.lanes|l.childLanes,l=l.sibling;l=o&~c}else l=0,i.child=null;return qd(e,i,c,r,l)}if((r&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},e!==null&&Bl(i,c!==null?c.cachePool:null),c!==null?Yf(i,c):Wo(),Kf(i);else return l=i.lanes=536870912,qd(e,i,c!==null?c.baseLanes|r:r,r,l)}else c!==null?(Bl(i,c.cachePool),Yf(i,c),hs(),i.memoizedState=null):(e!==null&&Bl(i,null),Wo(),hs());return bt(e,i,o,r),i.child}function Sn(e,i){return e!==null&&e.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function qd(e,i,r,l,o){var c=Ho();return c=c===null?null:{parent:Je._currentValue,pool:c},i.memoizedState={baseLanes:r,cachePool:c},e!==null&&Bl(i,null),Wo(),Kf(i),e!==null&&pr(e,i,l,!0),i.childLanes=o,null}function Xl(e,i){return i=Pl({mode:i.mode,children:i.children},e.mode),i.ref=e.ref,e.child=i,i.return=e,i}function jd(e,i,r){return Ks(i,e.child,null,r),e=Xl(i,i.pendingProps),e.flags|=2,Vt(i),i.memoizedState=null,e}function qp(e,i,r){var l=i.pendingProps,o=(i.flags&128)!==0;if(i.flags&=-129,e===null){if(Ee){if(l.mode==="hidden")return e=Xl(i,l),i.lanes=536870912,Sn(null,e);if(Xo(i),(e=Ue)?(e=$_(e,ri),e=e!==null&&e.data==="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:ts!==null?{id:Si,overflow:yi}:null,retryLane:536870912,hydrationErrors:null},r=wf(e),r.return=i,i.child=r,St=i,Ue=null)):e=null,e===null)throw ss(i);return i.lanes=536870912,null}return Xl(i,l)}var c=e.memoizedState;if(c!==null){var d=c.dehydrated;if(Xo(i),o)if(i.flags&256)i.flags&=-257,i=jd(e,i,r);else if(i.memoizedState!==null)i.child=e.child,i.flags|=128,i=null;else throw Error(a(558));else if(tt||pr(e,i,r,!1),o=(r&e.childLanes)!==0,tt||o){if(l=He,l!==null&&(d=Bu(l,r),d!==0&&d!==c.retryLane))throw c.retryLane=d,Ls(e,d),Nt(l,e,d),fh;ia(),i=jd(e,i,r)}else e=c.treeContext,Ue=li(d.nextSibling),St=i,Ee=!0,is=null,ri=!1,e!==null&&Df(i,e),i=Xl(i,l),i.flags|=4096;return i}return e=ki(e.child,{mode:l.mode,children:l.children}),e.ref=i.ref,i.child=e,e.return=i,e}function Gl(e,i){var r=i.ref;if(r===null)e!==null&&e.ref!==null&&(i.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(a(284));(e===null||e.ref!==r)&&(i.flags|=4194816)}}function dh(e,i,r,l,o){return Us(i),r=Po(e,i,r,l,void 0,o),l=Fo(),e!==null&&!tt?(Zo(e,i,o),Ui(e,i,o)):(Ee&&l&&Mo(i),i.flags|=1,bt(e,i,r,o),i.child)}function Yd(e,i,r,l,o,c){return Us(i),i.updateQueue=null,r=Vf(i,l,r,o),Wf(e),l=Fo(),e!==null&&!tt?(Zo(e,i,c),Ui(e,i,c)):(Ee&&l&&Mo(i),i.flags|=1,bt(e,i,r,c),i.child)}function Kd(e,i,r,l,o){if(Us(i),i.stateNode===null){var c=_r,d=r.contextType;typeof d=="object"&&d!==null&&(c=yt(d)),c=new r(l,c),i.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=ch,i.stateNode=c,c._reactInternals=i,c=i.stateNode,c.props=l,c.state=i.memoizedState,c.refs={},qo(i),d=r.contextType,c.context=typeof d=="object"&&d!==null?yt(d):_r,c.state=i.memoizedState,d=r.getDerivedStateFromProps,typeof d=="function"&&(hh(i,r,d,l),c.state=i.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(d=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),d!==c.state&&ch.enqueueReplaceState(c,c.state,null),_n(i,l,c,o),dn(),c.state=i.memoizedState),typeof c.componentDidMount=="function"&&(i.flags|=4194308),l=!0}else if(e===null){c=i.stateNode;var m=i.memoizedProps,S=Vs(r,m);c.props=S;var M=c.context,L=r.contextType;d=_r,typeof L=="object"&&L!==null&&(d=yt(L));var U=r.getDerivedStateFromProps;L=typeof U=="function"||typeof c.getSnapshotBeforeUpdate=="function",m=i.pendingProps!==m,L||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(m||M!==d)&&Md(i,c,l,d),ns=!1;var B=i.memoizedState;c.state=B,_n(i,l,c,o),dn(),M=i.memoizedState,m||B!==M||ns?(typeof U=="function"&&(hh(i,r,U,l),M=i.memoizedState),(S=ns||Td(i,r,S,l,B,M,d))?(L||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(i.flags|=4194308)):(typeof c.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=l,i.memoizedState=M),c.props=l,c.state=M,c.context=d,l=S):(typeof c.componentDidMount=="function"&&(i.flags|=4194308),l=!1)}else{c=i.stateNode,jo(e,i),d=i.memoizedProps,L=Vs(r,d),c.props=L,U=i.pendingProps,B=c.context,M=r.contextType,S=_r,typeof M=="object"&&M!==null&&(S=yt(M)),m=r.getDerivedStateFromProps,(M=typeof m=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(d!==U||B!==S)&&Md(i,c,l,S),ns=!1,B=i.memoizedState,c.state=B,_n(i,l,c,o),dn();var O=i.memoizedState;d!==U||B!==O||ns||e!==null&&e.dependencies!==null&&Tl(e.dependencies)?(typeof m=="function"&&(hh(i,r,m,l),O=i.memoizedState),(L=ns||Td(i,r,L,l,B,O,S)||e!==null&&e.dependencies!==null&&Tl(e.dependencies))?(M||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(l,O,S),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(l,O,S)),typeof c.componentDidUpdate=="function"&&(i.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof c.componentDidUpdate!="function"||d===e.memoizedProps&&B===e.memoizedState||(i.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&B===e.memoizedState||(i.flags|=1024),i.memoizedProps=l,i.memoizedState=O),c.props=l,c.state=O,c.context=S,l=L):(typeof c.componentDidUpdate!="function"||d===e.memoizedProps&&B===e.memoizedState||(i.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&B===e.memoizedState||(i.flags|=1024),l=!1)}return c=l,Gl(e,i),l=(i.flags&128)!==0,c||l?(c=i.stateNode,r=l&&typeof r.getDerivedStateFromError!="function"?null:c.render(),i.flags|=1,e!==null&&l?(i.child=Ks(i,e.child,null,o),i.child=Ks(i,null,r,o)):bt(e,i,r,o),i.memoizedState=c.state,e=i.child):e=Ui(e,i,o),e}function Wd(e,i,r,l){return Ns(),i.flags|=256,bt(e,i,r,l),i.child}var _h={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vh(e){return{baseLanes:e,cachePool:kf()}}function gh(e,i,r){return e=e!==null?e.childLanes&~r:0,i&&(e|=Gt),e}function Vd(e,i,r){var l=i.pendingProps,o=!1,c=(i.flags&128)!==0,d;if((d=c)||(d=e!==null&&e.memoizedState===null?!1:(Qe.current&2)!==0),d&&(o=!0,i.flags&=-129),d=(i.flags&32)!==0,i.flags&=-33,e===null){if(Ee){if(o?os(i):hs(),(e=Ue)?(e=$_(e,ri),e=e!==null&&e.data!=="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:ts!==null?{id:Si,overflow:yi}:null,retryLane:536870912,hydrationErrors:null},r=wf(e),r.return=i,i.child=r,St=i,Ue=null)):e=null,e===null)throw ss(i);return $h(e)?i.lanes=32:i.lanes=536870912,null}var m=l.children;return l=l.fallback,o?(hs(),o=i.mode,m=Pl({mode:"hidden",children:m},o),l=zs(l,o,r,null),m.return=i,l.return=i,m.sibling=l,i.child=m,l=i.child,l.memoizedState=vh(r),l.childLanes=gh(e,d,r),i.memoizedState=_h,Sn(null,l)):(os(i),mh(i,m))}var S=e.memoizedState;if(S!==null&&(m=S.dehydrated,m!==null)){if(c)i.flags&256?(os(i),i.flags&=-257,i=ph(e,i,r)):i.memoizedState!==null?(hs(),i.child=e.child,i.flags|=128,i=null):(hs(),m=l.fallback,o=i.mode,l=Pl({mode:"visible",children:l.children},o),m=zs(m,o,r,null),m.flags|=2,l.return=i,m.return=i,l.sibling=m,i.child=l,Ks(i,e.child,null,r),l=i.child,l.memoizedState=vh(r),l.childLanes=gh(e,d,r),i.memoizedState=_h,i=Sn(null,l));else if(os(i),$h(m)){if(d=m.nextSibling&&m.nextSibling.dataset,d)var M=d.dgst;d=M,l=Error(a(419)),l.stack="",l.digest=d,an({value:l,source:null,stack:null}),i=ph(e,i,r)}else if(tt||pr(e,i,r,!1),d=(r&e.childLanes)!==0,tt||d){if(d=He,d!==null&&(l=Bu(d,r),l!==0&&l!==S.retryLane))throw S.retryLane=l,Ls(e,l),Nt(d,e,l),fh;Ih(m)||ia(),i=ph(e,i,r)}else Ih(m)?(i.flags|=192,i.child=e.child,i=null):(e=S.treeContext,Ue=li(m.nextSibling),St=i,Ee=!0,is=null,ri=!1,e!==null&&Df(i,e),i=mh(i,l.children),i.flags|=4096);return i}return o?(hs(),m=l.fallback,o=i.mode,S=e.child,M=S.sibling,l=ki(S,{mode:"hidden",children:l.children}),l.subtreeFlags=S.subtreeFlags&65011712,M!==null?m=ki(M,m):(m=zs(m,o,r,null),m.flags|=2),m.return=i,l.return=i,l.sibling=m,i.child=l,Sn(null,l),l=i.child,m=e.child.memoizedState,m===null?m=vh(r):(o=m.cachePool,o!==null?(S=Je._currentValue,o=o.parent!==S?{parent:S,pool:S}:o):o=kf(),m={baseLanes:m.baseLanes|r,cachePool:o}),l.memoizedState=m,l.childLanes=gh(e,d,r),i.memoizedState=_h,Sn(e.child,l)):(os(i),r=e.child,e=r.sibling,r=ki(r,{mode:"visible",children:l.children}),r.return=i,r.sibling=null,e!==null&&(d=i.deletions,d===null?(i.deletions=[e],i.flags|=16):d.push(e)),i.child=r,i.memoizedState=null,r)}function mh(e,i){return i=Pl({mode:"visible",children:i},e.mode),i.return=e,e.child=i}function Pl(e,i){return e=Kt(22,e,null,i),e.lanes=0,e}function ph(e,i,r){return Ks(i,e.child,null,r),e=mh(i,i.pendingProps.children),e.flags|=2,i.memoizedState=null,e}function Xd(e,i,r){e.lanes|=i;var l=e.alternate;l!==null&&(l.lanes|=i),Oo(e.return,i,r)}function Sh(e,i,r,l,o,c){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:l,tail:r,tailMode:o,treeForkCount:c}:(d.isBackwards=i,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=r,d.tailMode=o,d.treeForkCount=c)}function Gd(e,i,r){var l=i.pendingProps,o=l.revealOrder,c=l.tail;l=l.children;var d=Qe.current,m=(d&2)!==0;if(m?(d=d&1|2,i.flags|=128):d&=1,Y(Qe,d),bt(e,i,l,r),l=Ee?ln:0,!m&&e!==null&&(e.flags&128)!==0)e:for(e=i.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xd(e,r,i);else if(e.tag===19)Xd(e,r,i);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break e;for(;e.sibling===null;){if(e.return===null||e.return===i)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"forwards":for(r=i.child,o=null;r!==null;)e=r.alternate,e!==null&&zl(e)===null&&(o=r),r=r.sibling;r=o,r===null?(o=i.child,i.child=null):(o=r.sibling,r.sibling=null),Sh(i,!1,o,r,c,l);break;case"backwards":case"unstable_legacy-backwards":for(r=null,o=i.child,i.child=null;o!==null;){if(e=o.alternate,e!==null&&zl(e)===null){i.child=o;break}e=o.sibling,o.sibling=r,r=o,o=e}Sh(i,!0,r,null,c,l);break;case"together":Sh(i,!1,null,null,void 0,l);break;default:i.memoizedState=null}return i.child}function Ui(e,i,r){if(e!==null&&(i.dependencies=e.dependencies),fs|=i.lanes,(r&i.childLanes)===0)if(e!==null){if(pr(e,i,r,!1),(r&i.childLanes)===0)return null}else return null;if(e!==null&&i.child!==e.child)throw Error(a(153));if(i.child!==null){for(e=i.child,r=ki(e,e.pendingProps),i.child=r,r.return=i;e.sibling!==null;)e=e.sibling,r=r.sibling=ki(e,e.pendingProps),r.return=i;r.sibling=null}return i.child}function yh(e,i){return(e.lanes&i)!==0?!0:(e=e.dependencies,!!(e!==null&&Tl(e)))}function jp(e,i,r){switch(i.tag){case 3:nt(i,i.stateNode.containerInfo),rs(i,Je,e.memoizedState.cache),Ns();break;case 27:case 5:mi(i);break;case 4:nt(i,i.stateNode.containerInfo);break;case 10:rs(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Xo(i),null;break;case 13:var l=i.memoizedState;if(l!==null)return l.dehydrated!==null?(os(i),i.flags|=128,null):(r&i.child.childLanes)!==0?Vd(e,i,r):(os(i),e=Ui(e,i,r),e!==null?e.sibling:null);os(i);break;case 19:var o=(e.flags&128)!==0;if(l=(r&i.childLanes)!==0,l||(pr(e,i,r,!1),l=(r&i.childLanes)!==0),o){if(l)return Gd(e,i,r);i.flags|=128}if(o=i.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Y(Qe,Qe.current),l)break;return null;case 22:return i.lanes=0,Ud(e,i,r,i.pendingProps);case 24:rs(i,Je,e.memoizedState.cache)}return Ui(e,i,r)}function Pd(e,i,r){if(e!==null)if(e.memoizedProps!==i.pendingProps)tt=!0;else{if(!yh(e,r)&&(i.flags&128)===0)return tt=!1,jp(e,i,r);tt=(e.flags&131072)!==0}else tt=!1,Ee&&(i.flags&1048576)!==0&&xf(i,ln,i.index);switch(i.lanes=0,i.tag){case 16:e:{var l=i.pendingProps;if(e=js(i.elementType),i.type=e,typeof e=="function")xo(e)?(l=Vs(e,l),i.tag=1,i=Kd(null,i,e,l,r)):(i.tag=0,i=dh(null,i,e,l,r));else{if(e!=null){var o=e.$$typeof;if(o===Z){i.tag=11,i=zd(null,i,e,l,r);break e}else if(o===ie){i.tag=14,i=Nd(null,i,e,l,r);break e}}throw i=F(e)||e,Error(a(306,i,""))}}return i;case 0:return dh(e,i,i.type,i.pendingProps,r);case 1:return l=i.type,o=Vs(l,i.pendingProps),Kd(e,i,l,o,r);case 3:e:{if(nt(i,i.stateNode.containerInfo),e===null)throw Error(a(387));l=i.pendingProps;var c=i.memoizedState;o=c.element,jo(e,i),_n(i,l,null,r);var d=i.memoizedState;if(l=d.cache,rs(i,Je,l),l!==c.cache&&Lo(i,[Je],r,!0),dn(),l=d.element,c.isDehydrated)if(c={element:l,isDehydrated:!1,cache:d.cache},i.updateQueue.baseState=c,i.memoizedState=c,i.flags&256){i=Wd(e,i,l,r);break e}else if(l!==o){o=ti(Error(a(424)),i),an(o),i=Wd(e,i,l,r);break e}else for(e=i.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ue=li(e.firstChild),St=i,Ee=!0,is=null,ri=!0,r=Uf(i,null,l,r),i.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ns(),l===o){i=Ui(e,i,r);break e}bt(e,i,l,r)}i=i.child}return i;case 26:return Gl(e,i),e===null?(r=rv(i.type,null,i.pendingProps,null))?i.memoizedState=r:Ee||(r=i.type,e=i.pendingProps,l=ha(oe.current).createElement(r),l[pt]=i,l[At]=e,Ct(l,r,e),ct(l),i.stateNode=l):i.memoizedState=rv(i.type,e.memoizedProps,i.pendingProps,e.memoizedState),null;case 27:return mi(i),e===null&&Ee&&(l=i.stateNode=tv(i.type,i.pendingProps,oe.current),St=i,ri=!0,o=Ue,ms(i.type)?(Jh=o,Ue=li(l.firstChild)):Ue=o),bt(e,i,i.pendingProps.children,r),Gl(e,i),e===null&&(i.flags|=4194304),i.child;case 5:return e===null&&Ee&&((o=l=Ue)&&(l=gS(l,i.type,i.pendingProps,ri),l!==null?(i.stateNode=l,St=i,Ue=li(l.firstChild),ri=!1,o=!0):o=!1),o||ss(i)),mi(i),o=i.type,c=i.pendingProps,d=e!==null?e.memoizedProps:null,l=c.children,Fh(o,c)?l=null:d!==null&&Fh(o,d)&&(i.flags|=32),i.memoizedState!==null&&(o=Po(e,i,Rp,null,null,r),Ln._currentValue=o),Gl(e,i),bt(e,i,l,r),i.child;case 6:return e===null&&Ee&&((e=r=Ue)&&(r=mS(r,i.pendingProps,ri),r!==null?(i.stateNode=r,St=i,Ue=null,e=!0):e=!1),e||ss(i)),null;case 13:return Vd(e,i,r);case 4:return nt(i,i.stateNode.containerInfo),l=i.pendingProps,e===null?i.child=Ks(i,null,l,r):bt(e,i,l,r),i.child;case 11:return zd(e,i,i.type,i.pendingProps,r);case 7:return bt(e,i,i.pendingProps,r),i.child;case 8:return bt(e,i,i.pendingProps.children,r),i.child;case 12:return bt(e,i,i.pendingProps.children,r),i.child;case 10:return l=i.pendingProps,rs(i,i.type,l.value),bt(e,i,l.children,r),i.child;case 9:return o=i.type._context,l=i.pendingProps.children,Us(i),o=yt(o),l=l(o),i.flags|=1,bt(e,i,l,r),i.child;case 14:return Nd(e,i,i.type,i.pendingProps,r);case 15:return Hd(e,i,i.type,i.pendingProps,r);case 19:return Gd(e,i,r);case 31:return qp(e,i,r);case 22:return Ud(e,i,r,i.pendingProps);case 24:return Us(i),l=yt(Je),e===null?(o=Ho(),o===null&&(o=He,c=zo(),o.pooledCache=c,c.refCount++,c!==null&&(o.pooledCacheLanes|=r),o=c),i.memoizedState={parent:l,cache:o},qo(i),rs(i,Je,o)):((e.lanes&r)!==0&&(jo(e,i),_n(i,null,null,r),dn()),o=e.memoizedState,c=i.memoizedState,o.parent!==l?(o={parent:l,cache:l},i.memoizedState=o,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=o),rs(i,Je,l)):(l=c.cache,rs(i,Je,l),l!==o.cache&&Lo(i,[Je],r,!0))),bt(e,i,i.pendingProps.children,r),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function qi(e){e.flags|=4}function bh(e,i,r,l,o){if((i=(e.mode&32)!==0)&&(i=!1),i){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(y_())e.flags|=8192;else throw Ys=Rl,Uo}else e.flags&=-16777217}function Fd(e,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!hv(i))if(y_())e.flags|=8192;else throw Ys=Rl,Uo}function Fl(e,i){i!==null&&(e.flags|=4),e.flags&16384&&(i=e.tag!==22?Du():536870912,e.lanes|=i,Ar|=i)}function yn(e,i){if(!Ee)switch(e.tailMode){case"hidden":i=e.tail;for(var r=null;i!==null;)i.alternate!==null&&(r=i),i=i.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?i||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function qe(e){var i=e.alternate!==null&&e.alternate.child===e.child,r=0,l=0;if(i)for(var o=e.child;o!==null;)r|=o.lanes|o.childLanes,l|=o.subtreeFlags&65011712,l|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)r|=o.lanes|o.childLanes,l|=o.subtreeFlags,l|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=l,e.childLanes=r,i}function Yp(e,i,r){var l=i.pendingProps;switch(Bo(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qe(i),null;case 1:return qe(i),null;case 3:return r=i.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),zi(Je),Be(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(mr(i)?qi(i):e===null||e.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Ro())),qe(i),null;case 26:var o=i.type,c=i.memoizedState;return e===null?(qi(i),c!==null?(qe(i),Fd(i,c)):(qe(i),bh(i,o,null,l,r))):c?c!==e.memoizedState?(qi(i),qe(i),Fd(i,c)):(qe(i),i.flags&=-16777217):(e=e.memoizedProps,e!==l&&qi(i),qe(i),bh(i,o,e,l,r)),null;case 27:if(pi(i),r=oe.current,o=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==l&&qi(i);else{if(!l){if(i.stateNode===null)throw Error(a(166));return qe(i),null}e=V.current,mr(i)?Tf(i):(e=tv(o,l,r),i.stateNode=e,qi(i))}return qe(i),null;case 5:if(pi(i),o=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==l&&qi(i);else{if(!l){if(i.stateNode===null)throw Error(a(166));return qe(i),null}if(c=V.current,mr(i))Tf(i);else{var d=ha(oe.current);switch(c){case 1:c=d.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:c=d.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":c=d.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":c=d.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":c=d.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof l.is=="string"?d.createElement("select",{is:l.is}):d.createElement("select"),l.multiple?c.multiple=!0:l.size&&(c.size=l.size);break;default:c=typeof l.is=="string"?d.createElement(o,{is:l.is}):d.createElement(o)}}c[pt]=i,c[At]=l;e:for(d=i.child;d!==null;){if(d.tag===5||d.tag===6)c.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===i)break e;for(;d.sibling===null;){if(d.return===null||d.return===i)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}i.stateNode=c;e:switch(Ct(c,o,l),o){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&qi(i)}}return qe(i),bh(i,i.type,e===null?null:e.memoizedProps,i.pendingProps,r),null;case 6:if(e&&i.stateNode!=null)e.memoizedProps!==l&&qi(i);else{if(typeof l!="string"&&i.stateNode===null)throw Error(a(166));if(e=oe.current,mr(i)){if(e=i.stateNode,r=i.memoizedProps,l=null,o=St,o!==null)switch(o.tag){case 27:case 5:l=o.memoizedProps}e[pt]=i,e=!!(e.nodeValue===r||l!==null&&l.suppressHydrationWarning===!0||V_(e.nodeValue,r)),e||ss(i,!0)}else e=ha(e).createTextNode(l),e[pt]=i,i.stateNode=e}return qe(i),null;case 31:if(r=i.memoizedState,e===null||e.memoizedState!==null){if(l=mr(i),r!==null){if(e===null){if(!l)throw Error(a(318));if(e=i.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(557));e[pt]=i}else Ns(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;qe(i),e=!1}else r=Ro(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return i.flags&256?(Vt(i),i):(Vt(i),null);if((i.flags&128)!==0)throw Error(a(558))}return qe(i),null;case 13:if(l=i.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=mr(i),l!==null&&l.dehydrated!==null){if(e===null){if(!o)throw Error(a(318));if(o=i.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(a(317));o[pt]=i}else Ns(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;qe(i),o=!1}else o=Ro(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return i.flags&256?(Vt(i),i):(Vt(i),null)}return Vt(i),(i.flags&128)!==0?(i.lanes=r,i):(r=l!==null,e=e!==null&&e.memoizedState!==null,r&&(l=i.child,o=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(o=l.alternate.memoizedState.cachePool.pool),c=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(c=l.memoizedState.cachePool.pool),c!==o&&(l.flags|=2048)),r!==e&&r&&(i.child.flags|=8192),Fl(i,i.updateQueue),qe(i),null);case 4:return Be(),e===null&&Wh(i.stateNode.containerInfo),qe(i),null;case 10:return zi(i.type),qe(i),null;case 19:if(R(Qe),l=i.memoizedState,l===null)return qe(i),null;if(o=(i.flags&128)!==0,c=l.rendering,c===null)if(o)yn(l,!1);else{if(Pe!==0||e!==null&&(e.flags&128)!==0)for(e=i.child;e!==null;){if(c=zl(e),c!==null){for(i.flags|=128,yn(l,!1),e=c.updateQueue,i.updateQueue=e,Fl(i,e),i.subtreeFlags=0,e=r,r=i.child;r!==null;)Cf(r,e),r=r.sibling;return Y(Qe,Qe.current&1|2),Ee&&Oi(i,l.treeForkCount),i.child}e=e.sibling}l.tail!==null&&Ut()>Jl&&(i.flags|=128,o=!0,yn(l,!1),i.lanes=4194304)}else{if(!o)if(e=zl(c),e!==null){if(i.flags|=128,o=!0,e=e.updateQueue,i.updateQueue=e,Fl(i,e),yn(l,!0),l.tail===null&&l.tailMode==="hidden"&&!c.alternate&&!Ee)return qe(i),null}else 2*Ut()-l.renderingStartTime>Jl&&r!==536870912&&(i.flags|=128,o=!0,yn(l,!1),i.lanes=4194304);l.isBackwards?(c.sibling=i.child,i.child=c):(e=l.last,e!==null?e.sibling=c:i.child=c,l.last=c)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Ut(),e.sibling=null,r=Qe.current,Y(Qe,o?r&1|2:r&1),Ee&&Oi(i,l.treeForkCount),e):(qe(i),null);case 22:case 23:return Vt(i),Vo(),l=i.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(i.flags|=8192):l&&(i.flags|=8192),l?(r&536870912)!==0&&(i.flags&128)===0&&(qe(i),i.subtreeFlags&6&&(i.flags|=8192)):qe(i),r=i.updateQueue,r!==null&&Fl(i,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),l=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),l!==r&&(i.flags|=2048),e!==null&&R(qs),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),i.memoizedState.cache!==r&&(i.flags|=2048),zi(Je),qe(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function Kp(e,i){switch(Bo(i),i.tag){case 1:return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 3:return zi(Je),Be(),e=i.flags,(e&65536)!==0&&(e&128)===0?(i.flags=e&-65537|128,i):null;case 26:case 27:case 5:return pi(i),null;case 31:if(i.memoizedState!==null){if(Vt(i),i.alternate===null)throw Error(a(340));Ns()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 13:if(Vt(i),e=i.memoizedState,e!==null&&e.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Ns()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 19:return R(Qe),null;case 4:return Be(),null;case 10:return zi(i.type),null;case 22:case 23:return Vt(i),Vo(),e!==null&&R(qs),e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 24:return zi(Je),null;case 25:return null;default:return null}}function Zd(e,i){switch(Bo(i),i.tag){case 3:zi(Je),Be();break;case 26:case 27:case 5:pi(i);break;case 4:Be();break;case 31:i.memoizedState!==null&&Vt(i);break;case 13:Vt(i);break;case 19:R(Qe);break;case 10:zi(i.type);break;case 22:case 23:Vt(i),Vo(),e!==null&&R(qs);break;case 24:zi(Je)}}function bn(e,i){try{var r=i.updateQueue,l=r!==null?r.lastEffect:null;if(l!==null){var o=l.next;r=o;do{if((r.tag&e)===e){l=void 0;var c=r.create,d=r.inst;l=c(),d.destroy=l}r=r.next}while(r!==o)}}catch(m){ke(i,i.return,m)}}function cs(e,i,r){try{var l=i.updateQueue,o=l!==null?l.lastEffect:null;if(o!==null){var c=o.next;l=c;do{if((l.tag&e)===e){var d=l.inst,m=d.destroy;if(m!==void 0){d.destroy=void 0,o=i;var S=r,M=m;try{M()}catch(L){ke(o,S,L)}}}l=l.next}while(l!==c)}}catch(L){ke(i,i.return,L)}}function Qd(e){var i=e.updateQueue;if(i!==null){var r=e.stateNode;try{jf(i,r)}catch(l){ke(e,e.return,l)}}}function Id(e,i,r){r.props=Vs(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(l){ke(e,i,l)}}function Cn(e,i){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof r=="function"?e.refCleanup=r(l):r.current=l}}catch(o){ke(e,i,o)}}function bi(e,i){var r=e.ref,l=e.refCleanup;if(r!==null)if(typeof l=="function")try{l()}catch(o){ke(e,i,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(o){ke(e,i,o)}else r.current=null}function $d(e){var i=e.type,r=e.memoizedProps,l=e.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":r.autoFocus&&l.focus();break e;case"img":r.src?l.src=r.src:r.srcSet&&(l.srcset=r.srcSet)}}catch(o){ke(e,e.return,o)}}function Ch(e,i,r){try{var l=e.stateNode;cS(l,e.type,r,i),l[At]=i}catch(o){ke(e,e.return,o)}}function Jd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ms(e.type)||e.tag===4}function wh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Jd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ms(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Eh(e,i,r){var l=e.tag;if(l===5||l===6)e=e.stateNode,i?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,i):(i=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,i.appendChild(e),r=r._reactRootContainer,r!=null||i.onclick!==null||(i.onclick=Ai));else if(l!==4&&(l===27&&ms(e.type)&&(r=e.stateNode,i=null),e=e.child,e!==null))for(Eh(e,i,r),e=e.sibling;e!==null;)Eh(e,i,r),e=e.sibling}function Zl(e,i,r){var l=e.tag;if(l===5||l===6)e=e.stateNode,i?r.insertBefore(e,i):r.appendChild(e);else if(l!==4&&(l===27&&ms(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(Zl(e,i,r),e=e.sibling;e!==null;)Zl(e,i,r),e=e.sibling}function e_(e){var i=e.stateNode,r=e.memoizedProps;try{for(var l=e.type,o=i.attributes;o.length;)i.removeAttributeNode(o[0]);Ct(i,l,r),i[pt]=e,i[At]=r}catch(c){ke(e,e.return,c)}}var ji=!1,it=!1,xh=!1,t_=typeof WeakSet=="function"?WeakSet:Set,ut=null;function Wp(e,i){if(e=e.containerInfo,Gh=ga,e=df(e),po(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var l=r.getSelection&&r.getSelection();if(l&&l.rangeCount!==0){r=l.anchorNode;var o=l.anchorOffset,c=l.focusNode;l=l.focusOffset;try{r.nodeType,c.nodeType}catch{r=null;break e}var d=0,m=-1,S=-1,M=0,L=0,U=e,B=null;t:for(;;){for(var O;U!==r||o!==0&&U.nodeType!==3||(m=d+o),U!==c||l!==0&&U.nodeType!==3||(S=d+l),U.nodeType===3&&(d+=U.nodeValue.length),(O=U.firstChild)!==null;)B=U,U=O;for(;;){if(U===e)break t;if(B===r&&++M===o&&(m=d),B===c&&++L===l&&(S=d),(O=U.nextSibling)!==null)break;U=B,B=U.parentNode}U=O}r=m===-1||S===-1?null:{start:m,end:S}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ph={focusedElem:e,selectionRange:r},ga=!1,ut=i;ut!==null;)if(i=ut,e=i.child,(i.subtreeFlags&1028)!==0&&e!==null)e.return=i,ut=e;else for(;ut!==null;){switch(i=ut,c=i.alternate,e=i.flags,i.tag){case 0:if((e&4)!==0&&(e=i.updateQueue,e=e!==null?e.events:null,e!==null))for(r=0;r<e.length;r++)o=e[r],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,r=i,o=c.memoizedProps,c=c.memoizedState,l=r.stateNode;try{var $=Vs(r.type,o);e=l.getSnapshotBeforeUpdate($,c),l.__reactInternalSnapshotBeforeUpdate=e}catch(ae){ke(r,r.return,ae)}}break;case 3:if((e&1024)!==0){if(e=i.stateNode.containerInfo,r=e.nodeType,r===9)Qh(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Qh(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(a(163))}if(e=i.sibling,e!==null){e.return=i.return,ut=e;break}ut=i.return}}function i_(e,i,r){var l=r.flags;switch(r.tag){case 0:case 11:case 15:Ki(e,r),l&4&&bn(5,r);break;case 1:if(Ki(e,r),l&4)if(e=r.stateNode,i===null)try{e.componentDidMount()}catch(d){ke(r,r.return,d)}else{var o=Vs(r.type,i.memoizedProps);i=i.memoizedState;try{e.componentDidUpdate(o,i,e.__reactInternalSnapshotBeforeUpdate)}catch(d){ke(r,r.return,d)}}l&64&&Qd(r),l&512&&Cn(r,r.return);break;case 3:if(Ki(e,r),l&64&&(e=r.updateQueue,e!==null)){if(i=null,r.child!==null)switch(r.child.tag){case 27:case 5:i=r.child.stateNode;break;case 1:i=r.child.stateNode}try{jf(e,i)}catch(d){ke(r,r.return,d)}}break;case 27:i===null&&l&4&&e_(r);case 26:case 5:Ki(e,r),i===null&&l&4&&$d(r),l&512&&Cn(r,r.return);break;case 12:Ki(e,r);break;case 31:Ki(e,r),l&4&&n_(e,r);break;case 13:Ki(e,r),l&4&&l_(e,r),l&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=$p.bind(null,r),pS(e,r))));break;case 22:if(l=r.memoizedState!==null||ji,!l){i=i!==null&&i.memoizedState!==null||it,o=ji;var c=it;ji=l,(it=i)&&!c?Wi(e,r,(r.subtreeFlags&8772)!==0):Ki(e,r),ji=o,it=c}break;case 30:break;default:Ki(e,r)}}function s_(e){var i=e.alternate;i!==null&&(e.alternate=null,s_(i)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(i=e.stateNode,i!==null&&eo(i)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ke=null,kt=!1;function Yi(e,i,r){for(r=r.child;r!==null;)r_(e,i,r),r=r.sibling}function r_(e,i,r){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(Xr,r)}catch{}switch(r.tag){case 26:it||bi(r,i),Yi(e,i,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:it||bi(r,i);var l=Ke,o=kt;ms(r.type)&&(Ke=r.stateNode,kt=!1),Yi(e,i,r),Rn(r.stateNode),Ke=l,kt=o;break;case 5:it||bi(r,i);case 6:if(l=Ke,o=kt,Ke=null,Yi(e,i,r),Ke=l,kt=o,Ke!==null)if(kt)try{(Ke.nodeType===9?Ke.body:Ke.nodeName==="HTML"?Ke.ownerDocument.body:Ke).removeChild(r.stateNode)}catch(c){ke(r,i,c)}else try{Ke.removeChild(r.stateNode)}catch(c){ke(r,i,c)}break;case 18:Ke!==null&&(kt?(e=Ke,Q_(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Ur(e)):Q_(Ke,r.stateNode));break;case 4:l=Ke,o=kt,Ke=r.stateNode.containerInfo,kt=!0,Yi(e,i,r),Ke=l,kt=o;break;case 0:case 11:case 14:case 15:cs(2,r,i),it||cs(4,r,i),Yi(e,i,r);break;case 1:it||(bi(r,i),l=r.stateNode,typeof l.componentWillUnmount=="function"&&Id(r,i,l)),Yi(e,i,r);break;case 21:Yi(e,i,r);break;case 22:it=(l=it)||r.memoizedState!==null,Yi(e,i,r),it=l;break;default:Yi(e,i,r)}}function n_(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ur(e)}catch(r){ke(i,i.return,r)}}}function l_(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ur(e)}catch(r){ke(i,i.return,r)}}function Vp(e){switch(e.tag){case 31:case 13:case 19:var i=e.stateNode;return i===null&&(i=e.stateNode=new t_),i;case 22:return e=e.stateNode,i=e._retryCache,i===null&&(i=e._retryCache=new t_),i;default:throw Error(a(435,e.tag))}}function Ql(e,i){var r=Vp(e);i.forEach(function(l){if(!r.has(l)){r.add(l);var o=Jp.bind(null,e,l);l.then(o,o)}})}function Ot(e,i){var r=i.deletions;if(r!==null)for(var l=0;l<r.length;l++){var o=r[l],c=e,d=i,m=d;e:for(;m!==null;){switch(m.tag){case 27:if(ms(m.type)){Ke=m.stateNode,kt=!1;break e}break;case 5:Ke=m.stateNode,kt=!1;break e;case 3:case 4:Ke=m.stateNode.containerInfo,kt=!0;break e}m=m.return}if(Ke===null)throw Error(a(160));r_(c,d,o),Ke=null,kt=!1,c=o.alternate,c!==null&&(c.return=null),o.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)a_(i,e),i=i.sibling}var _i=null;function a_(e,i){var r=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ot(i,e),Lt(e),l&4&&(cs(3,e,e.return),bn(3,e),cs(5,e,e.return));break;case 1:Ot(i,e),Lt(e),l&512&&(it||r===null||bi(r,r.return)),l&64&&ji&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?l:r.concat(l))));break;case 26:var o=_i;if(Ot(i,e),Lt(e),l&512&&(it||r===null||bi(r,r.return)),l&4){var c=r!==null?r.memoizedState:null;if(l=e.memoizedState,r===null)if(l===null)if(e.stateNode===null){e:{l=e.type,r=e.memoizedProps,o=o.ownerDocument||o;t:switch(l){case"title":c=o.getElementsByTagName("title")[0],(!c||c[Fr]||c[pt]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=o.createElement(l),o.head.insertBefore(c,o.querySelector("head > title"))),Ct(c,l,r),c[pt]=e,ct(c),l=c;break e;case"link":var d=av("link","href",o).get(l+(r.href||""));if(d){for(var m=0;m<d.length;m++)if(c=d[m],c.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&c.getAttribute("rel")===(r.rel==null?null:r.rel)&&c.getAttribute("title")===(r.title==null?null:r.title)&&c.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){d.splice(m,1);break t}}c=o.createElement(l),Ct(c,l,r),o.head.appendChild(c);break;case"meta":if(d=av("meta","content",o).get(l+(r.content||""))){for(m=0;m<d.length;m++)if(c=d[m],c.getAttribute("content")===(r.content==null?null:""+r.content)&&c.getAttribute("name")===(r.name==null?null:r.name)&&c.getAttribute("property")===(r.property==null?null:r.property)&&c.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&c.getAttribute("charset")===(r.charSet==null?null:r.charSet)){d.splice(m,1);break t}}c=o.createElement(l),Ct(c,l,r),o.head.appendChild(c);break;default:throw Error(a(468,l))}c[pt]=e,ct(c),l=c}e.stateNode=l}else ov(o,e.type,e.stateNode);else e.stateNode=lv(o,l,e.memoizedProps);else c!==l?(c===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):c.count--,l===null?ov(o,e.type,e.stateNode):lv(o,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Ch(e,e.memoizedProps,r.memoizedProps)}break;case 27:Ot(i,e),Lt(e),l&512&&(it||r===null||bi(r,r.return)),r!==null&&l&4&&Ch(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Ot(i,e),Lt(e),l&512&&(it||r===null||bi(r,r.return)),e.flags&32){o=e.stateNode;try{ar(o,"")}catch($){ke(e,e.return,$)}}l&4&&e.stateNode!=null&&(o=e.memoizedProps,Ch(e,o,r!==null?r.memoizedProps:o)),l&1024&&(xh=!0);break;case 6:if(Ot(i,e),Lt(e),l&4){if(e.stateNode===null)throw Error(a(162));l=e.memoizedProps,r=e.stateNode;try{r.nodeValue=l}catch($){ke(e,e.return,$)}}break;case 3:if(fa=null,o=_i,_i=ca(i.containerInfo),Ot(i,e),_i=o,Lt(e),l&4&&r!==null&&r.memoizedState.isDehydrated)try{Ur(i.containerInfo)}catch($){ke(e,e.return,$)}xh&&(xh=!1,o_(e));break;case 4:l=_i,_i=ca(e.stateNode.containerInfo),Ot(i,e),Lt(e),_i=l;break;case 12:Ot(i,e),Lt(e);break;case 31:Ot(i,e),Lt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ql(e,l)));break;case 13:Ot(i,e),Lt(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&($l=Ut()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ql(e,l)));break;case 22:o=e.memoizedState!==null;var S=r!==null&&r.memoizedState!==null,M=ji,L=it;if(ji=M||o,it=L||S,Ot(i,e),it=L,ji=M,Lt(e),l&8192)e:for(i=e.stateNode,i._visibility=o?i._visibility&-2:i._visibility|1,o&&(r===null||S||ji||it||Xs(e)),r=null,i=e;;){if(i.tag===5||i.tag===26){if(r===null){S=r=i;try{if(c=S.stateNode,o)d=c.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{m=S.stateNode;var U=S.memoizedProps.style,B=U!=null&&U.hasOwnProperty("display")?U.display:null;m.style.display=B==null||typeof B=="boolean"?"":(""+B).trim()}}catch($){ke(S,S.return,$)}}}else if(i.tag===6){if(r===null){S=i;try{S.stateNode.nodeValue=o?"":S.memoizedProps}catch($){ke(S,S.return,$)}}}else if(i.tag===18){if(r===null){S=i;try{var O=S.stateNode;o?I_(O,!0):I_(S.stateNode,!1)}catch($){ke(S,S.return,$)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===e)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break e;for(;i.sibling===null;){if(i.return===null||i.return===e)break e;r===i&&(r=null),i=i.return}r===i&&(r=null),i.sibling.return=i.return,i=i.sibling}l&4&&(l=e.updateQueue,l!==null&&(r=l.retryQueue,r!==null&&(l.retryQueue=null,Ql(e,r))));break;case 19:Ot(i,e),Lt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ql(e,l)));break;case 30:break;case 21:break;default:Ot(i,e),Lt(e)}}function Lt(e){var i=e.flags;if(i&2){try{for(var r,l=e.return;l!==null;){if(Jd(l)){r=l;break}l=l.return}if(r==null)throw Error(a(160));switch(r.tag){case 27:var o=r.stateNode,c=wh(e);Zl(e,c,o);break;case 5:var d=r.stateNode;r.flags&32&&(ar(d,""),r.flags&=-33);var m=wh(e);Zl(e,m,d);break;case 3:case 4:var S=r.stateNode.containerInfo,M=wh(e);Eh(e,M,S);break;default:throw Error(a(161))}}catch(L){ke(e,e.return,L)}e.flags&=-3}i&4096&&(e.flags&=-4097)}function o_(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var i=e;o_(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),e=e.sibling}}function Ki(e,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)i_(e,i.alternate,i),i=i.sibling}function Xs(e){for(e=e.child;e!==null;){var i=e;switch(i.tag){case 0:case 11:case 14:case 15:cs(4,i,i.return),Xs(i);break;case 1:bi(i,i.return);var r=i.stateNode;typeof r.componentWillUnmount=="function"&&Id(i,i.return,r),Xs(i);break;case 27:Rn(i.stateNode);case 26:case 5:bi(i,i.return),Xs(i);break;case 22:i.memoizedState===null&&Xs(i);break;case 30:Xs(i);break;default:Xs(i)}e=e.sibling}}function Wi(e,i,r){for(r=r&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var l=i.alternate,o=e,c=i,d=c.flags;switch(c.tag){case 0:case 11:case 15:Wi(o,c,r),bn(4,c);break;case 1:if(Wi(o,c,r),l=c,o=l.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(M){ke(l,l.return,M)}if(l=c,o=l.updateQueue,o!==null){var m=l.stateNode;try{var S=o.shared.hiddenCallbacks;if(S!==null)for(o.shared.hiddenCallbacks=null,o=0;o<S.length;o++)qf(S[o],m)}catch(M){ke(l,l.return,M)}}r&&d&64&&Qd(c),Cn(c,c.return);break;case 27:e_(c);case 26:case 5:Wi(o,c,r),r&&l===null&&d&4&&$d(c),Cn(c,c.return);break;case 12:Wi(o,c,r);break;case 31:Wi(o,c,r),r&&d&4&&n_(o,c);break;case 13:Wi(o,c,r),r&&d&4&&l_(o,c);break;case 22:c.memoizedState===null&&Wi(o,c,r),Cn(c,c.return);break;case 30:break;default:Wi(o,c,r)}i=i.sibling}}function Dh(e,i){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(e=i.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&on(r))}function Th(e,i){e=null,i.alternate!==null&&(e=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==e&&(i.refCount++,e!=null&&on(e))}function vi(e,i,r,l){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)h_(e,i,r,l),i=i.sibling}function h_(e,i,r,l){var o=i.flags;switch(i.tag){case 0:case 11:case 15:vi(e,i,r,l),o&2048&&bn(9,i);break;case 1:vi(e,i,r,l);break;case 3:vi(e,i,r,l),o&2048&&(e=null,i.alternate!==null&&(e=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==e&&(i.refCount++,e!=null&&on(e)));break;case 12:if(o&2048){vi(e,i,r,l),e=i.stateNode;try{var c=i.memoizedProps,d=c.id,m=c.onPostCommit;typeof m=="function"&&m(d,i.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){ke(i,i.return,S)}}else vi(e,i,r,l);break;case 31:vi(e,i,r,l);break;case 13:vi(e,i,r,l);break;case 23:break;case 22:c=i.stateNode,d=i.alternate,i.memoizedState!==null?c._visibility&2?vi(e,i,r,l):wn(e,i):c._visibility&2?vi(e,i,r,l):(c._visibility|=2,Tr(e,i,r,l,(i.subtreeFlags&10256)!==0||!1)),o&2048&&Dh(d,i);break;case 24:vi(e,i,r,l),o&2048&&Th(i.alternate,i);break;default:vi(e,i,r,l)}}function Tr(e,i,r,l,o){for(o=o&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var c=e,d=i,m=r,S=l,M=d.flags;switch(d.tag){case 0:case 11:case 15:Tr(c,d,m,S,o),bn(8,d);break;case 23:break;case 22:var L=d.stateNode;d.memoizedState!==null?L._visibility&2?Tr(c,d,m,S,o):wn(c,d):(L._visibility|=2,Tr(c,d,m,S,o)),o&&M&2048&&Dh(d.alternate,d);break;case 24:Tr(c,d,m,S,o),o&&M&2048&&Th(d.alternate,d);break;default:Tr(c,d,m,S,o)}i=i.sibling}}function wn(e,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var r=e,l=i,o=l.flags;switch(l.tag){case 22:wn(r,l),o&2048&&Dh(l.alternate,l);break;case 24:wn(r,l),o&2048&&Th(l.alternate,l);break;default:wn(r,l)}i=i.sibling}}var En=8192;function Mr(e,i,r){if(e.subtreeFlags&En)for(e=e.child;e!==null;)c_(e,i,r),e=e.sibling}function c_(e,i,r){switch(e.tag){case 26:Mr(e,i,r),e.flags&En&&e.memoizedState!==null&&AS(r,_i,e.memoizedState,e.memoizedProps);break;case 5:Mr(e,i,r);break;case 3:case 4:var l=_i;_i=ca(e.stateNode.containerInfo),Mr(e,i,r),_i=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=En,En=16777216,Mr(e,i,r),En=l):Mr(e,i,r));break;default:Mr(e,i,r)}}function u_(e){var i=e.alternate;if(i!==null&&(e=i.child,e!==null)){i.child=null;do i=e.sibling,e.sibling=null,e=i;while(e!==null)}}function xn(e){var i=e.deletions;if((e.flags&16)!==0){if(i!==null)for(var r=0;r<i.length;r++){var l=i[r];ut=l,d_(l,e)}u_(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)f_(e),e=e.sibling}function f_(e){switch(e.tag){case 0:case 11:case 15:xn(e),e.flags&2048&&cs(9,e,e.return);break;case 3:xn(e);break;case 12:xn(e);break;case 22:var i=e.stateNode;e.memoizedState!==null&&i._visibility&2&&(e.return===null||e.return.tag!==13)?(i._visibility&=-3,Il(e)):xn(e);break;default:xn(e)}}function Il(e){var i=e.deletions;if((e.flags&16)!==0){if(i!==null)for(var r=0;r<i.length;r++){var l=i[r];ut=l,d_(l,e)}u_(e)}for(e=e.child;e!==null;){switch(i=e,i.tag){case 0:case 11:case 15:cs(8,i,i.return),Il(i);break;case 22:r=i.stateNode,r._visibility&2&&(r._visibility&=-3,Il(i));break;default:Il(i)}e=e.sibling}}function d_(e,i){for(;ut!==null;){var r=ut;switch(r.tag){case 0:case 11:case 15:cs(8,r,i);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var l=r.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:on(r.memoizedState.cache)}if(l=r.child,l!==null)l.return=r,ut=l;else e:for(r=e;ut!==null;){l=ut;var o=l.sibling,c=l.return;if(s_(l),l===r){ut=null;break e}if(o!==null){o.return=c,ut=o;break e}ut=c}}}var Xp={getCacheForType:function(e){var i=yt(Je),r=i.data.get(e);return r===void 0&&(r=e(),i.data.set(e,r)),r},cacheSignal:function(){return yt(Je).controller.signal}},Gp=typeof WeakMap=="function"?WeakMap:Map,Me=0,He=null,ye=null,Ce=0,Re=0,Xt=null,us=!1,Br=!1,Mh=!1,Vi=0,Pe=0,fs=0,Gs=0,Bh=0,Gt=0,Ar=0,Dn=null,zt=null,Ah=!1,$l=0,__=0,Jl=1/0,ea=null,ds=null,lt=0,_s=null,Rr=null,Xi=0,Rh=0,kh=null,v_=null,Tn=0,Oh=null;function Pt(){return(Me&2)!==0&&Ce!==0?Ce&-Ce:w.T!==null?qh():Au()}function g_(){if(Gt===0)if((Ce&536870912)===0||Ee){var e=ol;ol<<=1,(ol&3932160)===0&&(ol=262144),Gt=e}else Gt=536870912;return e=Wt.current,e!==null&&(e.flags|=32),Gt}function Nt(e,i,r){(e===He&&(Re===2||Re===9)||e.cancelPendingCommit!==null)&&(kr(e,0),vs(e,Ce,Gt,!1)),Pr(e,r),((Me&2)===0||e!==He)&&(e===He&&((Me&2)===0&&(Gs|=r),Pe===4&&vs(e,Ce,Gt,!1)),Ci(e))}function m_(e,i,r){if((Me&6)!==0)throw Error(a(327));var l=!r&&(i&127)===0&&(i&e.expiredLanes)===0||Gr(e,i),o=l?Zp(e,i):zh(e,i,!0),c=l;do{if(o===0){Br&&!l&&vs(e,i,0,!1);break}else{if(r=e.current.alternate,c&&!Pp(r)){o=zh(e,i,!1),c=!1;continue}if(o===2){if(c=i,e.errorRecoveryDisabledLanes&c)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){i=d;e:{var m=e;o=Dn;var S=m.current.memoizedState.isDehydrated;if(S&&(kr(m,d).flags|=256),d=zh(m,d,!1),d!==2){if(Mh&&!S){m.errorRecoveryDisabledLanes|=c,Gs|=c,o=4;break e}c=zt,zt=o,c!==null&&(zt===null?zt=c:zt.push.apply(zt,c))}o=d}if(c=!1,o!==2)continue}}if(o===1){kr(e,0),vs(e,i,0,!0);break}e:{switch(l=e,c=o,c){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:vs(l,i,Gt,!us);break e;case 2:zt=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(o=$l+300-Ut(),10<o)){if(vs(l,i,Gt,!us),cl(l,0,!0)!==0)break e;Xi=i,l.timeoutHandle=F_(p_.bind(null,l,r,zt,ea,Ah,i,Gt,Gs,Ar,us,c,"Throttled",-0,0),o);break e}p_(l,r,zt,ea,Ah,i,Gt,Gs,Ar,us,c,null,-0,0)}}break}while(!0);Ci(e)}function p_(e,i,r,l,o,c,d,m,S,M,L,U,B,O){if(e.timeoutHandle=-1,U=i.subtreeFlags,U&8192||(U&16785408)===16785408){U={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ai},c_(i,c,U);var $=(c&62914560)===c?$l-Ut():(c&4194048)===c?__-Ut():0;if($=RS(U,$),$!==null){Xi=c,e.cancelPendingCommit=$(D_.bind(null,e,i,c,r,l,o,d,m,S,L,U,null,B,O)),vs(e,c,d,!M);return}}D_(e,i,c,r,l,o,d,m,S)}function Pp(e){for(var i=e;;){var r=i.tag;if((r===0||r===11||r===15)&&i.flags&16384&&(r=i.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var l=0;l<r.length;l++){var o=r[l],c=o.getSnapshot;o=o.value;try{if(!Yt(c(),o))return!1}catch{return!1}}if(r=i.child,i.subtreeFlags&16384&&r!==null)r.return=i,i=r;else{if(i===e)break;for(;i.sibling===null;){if(i.return===null||i.return===e)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function vs(e,i,r,l){i&=~Bh,i&=~Gs,e.suspendedLanes|=i,e.pingedLanes&=~i,l&&(e.warmLanes|=i),l=e.expirationTimes;for(var o=i;0<o;){var c=31-jt(o),d=1<<c;l[c]=-1,o&=~d}r!==0&&Tu(e,r,i)}function ta(){return(Me&6)===0?(Mn(0),!1):!0}function Lh(){if(ye!==null){if(Re===0)var e=ye.return;else e=ye,Li=Hs=null,Qo(e),Cr=null,cn=0,e=ye;for(;e!==null;)Zd(e.alternate,e),e=e.return;ye=null}}function kr(e,i){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,dS(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),Xi=0,Lh(),He=e,ye=r=ki(e.current,null),Ce=i,Re=0,Xt=null,us=!1,Br=Gr(e,i),Mh=!1,Ar=Gt=Bh=Gs=fs=Pe=0,zt=Dn=null,Ah=!1,(i&8)!==0&&(i|=i&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=i;0<l;){var o=31-jt(l),c=1<<o;i|=e[o],l&=~c}return Vi=i,Cl(),r}function S_(e,i){fe=null,w.H=pn,i===br||i===Al?(i=zf(),Re=3):i===Uo?(i=zf(),Re=4):Re=i===fh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Xt=i,ye===null&&(Pe=1,Vl(e,ti(i,e.current)))}function y_(){var e=Wt.current;return e===null?!0:(Ce&4194048)===Ce?ni===null:(Ce&62914560)===Ce||(Ce&536870912)!==0?e===ni:!1}function b_(){var e=w.H;return w.H=pn,e===null?pn:e}function C_(){var e=w.A;return w.A=Xp,e}function ia(){Pe=4,us||(Ce&4194048)!==Ce&&Wt.current!==null||(Br=!0),(fs&134217727)===0&&(Gs&134217727)===0||He===null||vs(He,Ce,Gt,!1)}function zh(e,i,r){var l=Me;Me|=2;var o=b_(),c=C_();(He!==e||Ce!==i)&&(ea=null,kr(e,i)),i=!1;var d=Pe;e:do try{if(Re!==0&&ye!==null){var m=ye,S=Xt;switch(Re){case 8:Lh(),d=6;break e;case 3:case 2:case 9:case 6:Wt.current===null&&(i=!0);var M=Re;if(Re=0,Xt=null,Or(e,m,S,M),r&&Br){d=0;break e}break;default:M=Re,Re=0,Xt=null,Or(e,m,S,M)}}Fp(),d=Pe;break}catch(L){S_(e,L)}while(!0);return i&&e.shellSuspendCounter++,Li=Hs=null,Me=l,w.H=o,w.A=c,ye===null&&(He=null,Ce=0,Cl()),d}function Fp(){for(;ye!==null;)w_(ye)}function Zp(e,i){var r=Me;Me|=2;var l=b_(),o=C_();He!==e||Ce!==i?(ea=null,Jl=Ut()+500,kr(e,i)):Br=Gr(e,i);e:do try{if(Re!==0&&ye!==null){i=ye;var c=Xt;t:switch(Re){case 1:Re=0,Xt=null,Or(e,i,c,1);break;case 2:case 9:if(Of(c)){Re=0,Xt=null,E_(i);break}i=function(){Re!==2&&Re!==9||He!==e||(Re=7),Ci(e)},c.then(i,i);break e;case 3:Re=7;break e;case 4:Re=5;break e;case 7:Of(c)?(Re=0,Xt=null,E_(i)):(Re=0,Xt=null,Or(e,i,c,7));break;case 5:var d=null;switch(ye.tag){case 26:d=ye.memoizedState;case 5:case 27:var m=ye;if(d?hv(d):m.stateNode.complete){Re=0,Xt=null;var S=m.sibling;if(S!==null)ye=S;else{var M=m.return;M!==null?(ye=M,sa(M)):ye=null}break t}}Re=0,Xt=null,Or(e,i,c,5);break;case 6:Re=0,Xt=null,Or(e,i,c,6);break;case 8:Lh(),Pe=6;break e;default:throw Error(a(462))}}Qp();break}catch(L){S_(e,L)}while(!0);return Li=Hs=null,w.H=l,w.A=o,Me=r,ye!==null?0:(He=null,Ce=0,Cl(),Pe)}function Qp(){for(;ye!==null&&!Sm();)w_(ye)}function w_(e){var i=Pd(e.alternate,e,Vi);e.memoizedProps=e.pendingProps,i===null?sa(e):ye=i}function E_(e){var i=e,r=i.alternate;switch(i.tag){case 15:case 0:i=Yd(r,i,i.pendingProps,i.type,void 0,Ce);break;case 11:i=Yd(r,i,i.pendingProps,i.type.render,i.ref,Ce);break;case 5:Qo(i);default:Zd(r,i),i=ye=Cf(i,Vi),i=Pd(r,i,Vi)}e.memoizedProps=e.pendingProps,i===null?sa(e):ye=i}function Or(e,i,r,l){Li=Hs=null,Qo(i),Cr=null,cn=0;var o=i.return;try{if(Up(e,o,i,r,Ce)){Pe=1,Vl(e,ti(r,e.current)),ye=null;return}}catch(c){if(o!==null)throw ye=o,c;Pe=1,Vl(e,ti(r,e.current)),ye=null;return}i.flags&32768?(Ee||l===1?e=!0:Br||(Ce&536870912)!==0?e=!1:(us=e=!0,(l===2||l===9||l===3||l===6)&&(l=Wt.current,l!==null&&l.tag===13&&(l.flags|=16384))),x_(i,e)):sa(i)}function sa(e){var i=e;do{if((i.flags&32768)!==0){x_(i,us);return}e=i.return;var r=Yp(i.alternate,i,Vi);if(r!==null){ye=r;return}if(i=i.sibling,i!==null){ye=i;return}ye=i=e}while(i!==null);Pe===0&&(Pe=5)}function x_(e,i){do{var r=Kp(e.alternate,e);if(r!==null){r.flags&=32767,ye=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!i&&(e=e.sibling,e!==null)){ye=e;return}ye=e=r}while(e!==null);Pe=6,ye=null}function D_(e,i,r,l,o,c,d,m,S){e.cancelPendingCommit=null;do ra();while(lt!==0);if((Me&6)!==0)throw Error(a(327));if(i!==null){if(i===e.current)throw Error(a(177));if(c=i.lanes|i.childLanes,c|=wo,Bm(e,r,c,d,m,S),e===He&&(ye=He=null,Ce=0),Rr=i,_s=e,Xi=r,Rh=c,kh=o,v_=l,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,eS(ll,function(){return R_(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||l){l=w.T,w.T=null,o=z.p,z.p=2,d=Me,Me|=4;try{Wp(e,i,r)}finally{Me=d,z.p=o,w.T=l}}lt=1,T_(),M_(),B_()}}function T_(){if(lt===1){lt=0;var e=_s,i=Rr,r=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||r){r=w.T,w.T=null;var l=z.p;z.p=2;var o=Me;Me|=4;try{a_(i,e);var c=Ph,d=df(e.containerInfo),m=c.focusedElem,S=c.selectionRange;if(d!==m&&m&&m.ownerDocument&&ff(m.ownerDocument.documentElement,m)){if(S!==null&&po(m)){var M=S.start,L=S.end;if(L===void 0&&(L=M),"selectionStart"in m)m.selectionStart=M,m.selectionEnd=Math.min(L,m.value.length);else{var U=m.ownerDocument||document,B=U&&U.defaultView||window;if(B.getSelection){var O=B.getSelection(),$=m.textContent.length,ae=Math.min(S.start,$),ze=S.end===void 0?ae:Math.min(S.end,$);!O.extend&&ae>ze&&(d=ze,ze=ae,ae=d);var E=uf(m,ae),b=uf(m,ze);if(E&&b&&(O.rangeCount!==1||O.anchorNode!==E.node||O.anchorOffset!==E.offset||O.focusNode!==b.node||O.focusOffset!==b.offset)){var T=U.createRange();T.setStart(E.node,E.offset),O.removeAllRanges(),ae>ze?(O.addRange(T),O.extend(b.node,b.offset)):(T.setEnd(b.node,b.offset),O.addRange(T))}}}}for(U=[],O=m;O=O.parentNode;)O.nodeType===1&&U.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<U.length;m++){var H=U[m];H.element.scrollLeft=H.left,H.element.scrollTop=H.top}}ga=!!Gh,Ph=Gh=null}finally{Me=o,z.p=l,w.T=r}}e.current=i,lt=2}}function M_(){if(lt===2){lt=0;var e=_s,i=Rr,r=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||r){r=w.T,w.T=null;var l=z.p;z.p=2;var o=Me;Me|=4;try{i_(e,i.alternate,i)}finally{Me=o,z.p=l,w.T=r}}lt=3}}function B_(){if(lt===4||lt===3){lt=0,ym();var e=_s,i=Rr,r=Xi,l=v_;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?lt=5:(lt=0,Rr=_s=null,A_(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(ds=null),$a(r),i=i.stateNode,qt&&typeof qt.onCommitFiberRoot=="function")try{qt.onCommitFiberRoot(Xr,i,void 0,(i.current.flags&128)===128)}catch{}if(l!==null){i=w.T,o=z.p,z.p=2,w.T=null;try{for(var c=e.onRecoverableError,d=0;d<l.length;d++){var m=l[d];c(m.value,{componentStack:m.stack})}}finally{w.T=i,z.p=o}}(Xi&3)!==0&&ra(),Ci(e),o=e.pendingLanes,(r&261930)!==0&&(o&42)!==0?e===Oh?Tn++:(Tn=0,Oh=e):Tn=0,Mn(0)}}function A_(e,i){(e.pooledCacheLanes&=i)===0&&(i=e.pooledCache,i!=null&&(e.pooledCache=null,on(i)))}function ra(){return T_(),M_(),B_(),R_()}function R_(){if(lt!==5)return!1;var e=_s,i=Rh;Rh=0;var r=$a(Xi),l=w.T,o=z.p;try{z.p=32>r?32:r,w.T=null,r=kh,kh=null;var c=_s,d=Xi;if(lt=0,Rr=_s=null,Xi=0,(Me&6)!==0)throw Error(a(331));var m=Me;if(Me|=4,f_(c.current),h_(c,c.current,d,r),Me=m,Mn(0,!1),qt&&typeof qt.onPostCommitFiberRoot=="function")try{qt.onPostCommitFiberRoot(Xr,c)}catch{}return!0}finally{z.p=o,w.T=l,A_(e,i)}}function k_(e,i,r){i=ti(r,i),i=uh(e.stateNode,i,2),e=as(e,i,2),e!==null&&(Pr(e,2),Ci(e))}function ke(e,i,r){if(e.tag===3)k_(e,e,r);else for(;i!==null;){if(i.tag===3){k_(i,e,r);break}else if(i.tag===1){var l=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ds===null||!ds.has(l))){e=ti(r,e),r=Od(2),l=as(i,r,2),l!==null&&(Ld(r,l,i,e),Pr(l,2),Ci(l));break}}i=i.return}}function Nh(e,i,r){var l=e.pingCache;if(l===null){l=e.pingCache=new Gp;var o=new Set;l.set(i,o)}else o=l.get(i),o===void 0&&(o=new Set,l.set(i,o));o.has(r)||(Mh=!0,o.add(r),e=Ip.bind(null,e,i,r),i.then(e,e))}function Ip(e,i,r){var l=e.pingCache;l!==null&&l.delete(i),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,He===e&&(Ce&r)===r&&(Pe===4||Pe===3&&(Ce&62914560)===Ce&&300>Ut()-$l?(Me&2)===0&&kr(e,0):Bh|=r,Ar===Ce&&(Ar=0)),Ci(e)}function O_(e,i){i===0&&(i=Du()),e=Ls(e,i),e!==null&&(Pr(e,i),Ci(e))}function $p(e){var i=e.memoizedState,r=0;i!==null&&(r=i.retryLane),O_(e,r)}function Jp(e,i){var r=0;switch(e.tag){case 31:case 13:var l=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(a(314))}l!==null&&l.delete(i),O_(e,r)}function eS(e,i){return Fa(e,i)}var na=null,Lr=null,Hh=!1,la=!1,Uh=!1,gs=0;function Ci(e){e!==Lr&&e.next===null&&(Lr===null?na=Lr=e:Lr=Lr.next=e),la=!0,Hh||(Hh=!0,iS())}function Mn(e,i){if(!Uh&&la){Uh=!0;do for(var r=!1,l=na;l!==null;){if(e!==0){var o=l.pendingLanes;if(o===0)var c=0;else{var d=l.suspendedLanes,m=l.pingedLanes;c=(1<<31-jt(42|e)+1)-1,c&=o&~(d&~m),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(r=!0,H_(l,c))}else c=Ce,c=cl(l,l===He?c:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(c&3)===0||Gr(l,c)||(r=!0,H_(l,c));l=l.next}while(r);Uh=!1}}function tS(){L_()}function L_(){la=Hh=!1;var e=0;gs!==0&&fS()&&(e=gs);for(var i=Ut(),r=null,l=na;l!==null;){var o=l.next,c=z_(l,i);c===0?(l.next=null,r===null?na=o:r.next=o,o===null&&(Lr=r)):(r=l,(e!==0||(c&3)!==0)&&(la=!0)),l=o}lt!==0&&lt!==5||Mn(e),gs!==0&&(gs=0)}function z_(e,i){for(var r=e.suspendedLanes,l=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var d=31-jt(c),m=1<<d,S=o[d];S===-1?((m&r)===0||(m&l)!==0)&&(o[d]=Mm(m,i)):S<=i&&(e.expiredLanes|=m),c&=~m}if(i=He,r=Ce,r=cl(e,e===i?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,r===0||e===i&&(Re===2||Re===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Za(l),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||Gr(e,r)){if(i=r&-r,i===e.callbackPriority)return i;switch(l!==null&&Za(l),$a(r)){case 2:case 8:r=Eu;break;case 32:r=ll;break;case 268435456:r=xu;break;default:r=ll}return l=N_.bind(null,e),r=Fa(r,l),e.callbackPriority=i,e.callbackNode=r,i}return l!==null&&l!==null&&Za(l),e.callbackPriority=2,e.callbackNode=null,2}function N_(e,i){if(lt!==0&&lt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(ra()&&e.callbackNode!==r)return null;var l=Ce;return l=cl(e,e===He?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(m_(e,l,i),z_(e,Ut()),e.callbackNode!=null&&e.callbackNode===r?N_.bind(null,e):null)}function H_(e,i){if(ra())return null;m_(e,i,!0)}function iS(){_S(function(){(Me&6)!==0?Fa(wu,tS):L_()})}function qh(){if(gs===0){var e=Sr;e===0&&(e=al,al<<=1,(al&261888)===0&&(al=256)),gs=e}return gs}function U_(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:_l(""+e)}function q_(e,i){var r=i.ownerDocument.createElement("input");return r.name=i.name,r.value=i.value,e.id&&r.setAttribute("form",e.id),i.parentNode.insertBefore(r,i),e=new FormData(e),r.parentNode.removeChild(r),e}function sS(e,i,r,l,o){if(i==="submit"&&r&&r.stateNode===o){var c=U_((o[At]||null).action),d=l.submitter;d&&(i=(i=d[At]||null)?U_(i.formAction):d.getAttribute("formAction"),i!==null&&(c=i,d=null));var m=new pl("action","action",null,l,o);e.push({event:m,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(gs!==0){var S=d?q_(o,d):new FormData(o);nh(r,{pending:!0,data:S,method:o.method,action:c},null,S)}}else typeof c=="function"&&(m.preventDefault(),S=d?q_(o,d):new FormData(o),nh(r,{pending:!0,data:S,method:o.method,action:c},c,S))},currentTarget:o}]})}}for(var jh=0;jh<Co.length;jh++){var Yh=Co[jh],rS=Yh.toLowerCase(),nS=Yh[0].toUpperCase()+Yh.slice(1);di(rS,"on"+nS)}di(gf,"onAnimationEnd"),di(mf,"onAnimationIteration"),di(pf,"onAnimationStart"),di("dblclick","onDoubleClick"),di("focusin","onFocus"),di("focusout","onBlur"),di(bp,"onTransitionRun"),di(Cp,"onTransitionStart"),di(wp,"onTransitionCancel"),di(Sf,"onTransitionEnd"),nr("onMouseEnter",["mouseout","mouseover"]),nr("onMouseLeave",["mouseout","mouseover"]),nr("onPointerEnter",["pointerout","pointerover"]),nr("onPointerLeave",["pointerout","pointerover"]),As("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),As("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),As("onBeforeInput",["compositionend","keypress","textInput","paste"]),As("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),As("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),As("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bn="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(" "),lS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Bn));function j_(e,i){i=(i&4)!==0;for(var r=0;r<e.length;r++){var l=e[r],o=l.event;l=l.listeners;e:{var c=void 0;if(i)for(var d=l.length-1;0<=d;d--){var m=l[d],S=m.instance,M=m.currentTarget;if(m=m.listener,S!==c&&o.isPropagationStopped())break e;c=m,o.currentTarget=M;try{c(o)}catch(L){bl(L)}o.currentTarget=null,c=S}else for(d=0;d<l.length;d++){if(m=l[d],S=m.instance,M=m.currentTarget,m=m.listener,S!==c&&o.isPropagationStopped())break e;c=m,o.currentTarget=M;try{c(o)}catch(L){bl(L)}o.currentTarget=null,c=S}}}}function be(e,i){var r=i[Ja];r===void 0&&(r=i[Ja]=new Set);var l=e+"__bubble";r.has(l)||(Y_(i,e,2,!1),r.add(l))}function Kh(e,i,r){var l=0;i&&(l|=4),Y_(r,e,l,i)}var aa="_reactListening"+Math.random().toString(36).slice(2);function Wh(e){if(!e[aa]){e[aa]=!0,Ou.forEach(function(r){r!=="selectionchange"&&(lS.has(r)||Kh(r,!1,e),Kh(r,!0,e))});var i=e.nodeType===9?e:e.ownerDocument;i===null||i[aa]||(i[aa]=!0,Kh("selectionchange",!1,i))}}function Y_(e,i,r,l){switch(gv(i)){case 2:var o=LS;break;case 8:o=zS;break;default:o=rc}r=o.bind(null,i,r,e),o=void 0,!oo||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(o=!0),l?o!==void 0?e.addEventListener(i,r,{capture:!0,passive:o}):e.addEventListener(i,r,!0):o!==void 0?e.addEventListener(i,r,{passive:o}):e.addEventListener(i,r,!1)}function Vh(e,i,r,l,o){var c=l;if((i&1)===0&&(i&2)===0&&l!==null)e:for(;;){if(l===null)return;var d=l.tag;if(d===3||d===4){var m=l.stateNode.containerInfo;if(m===o)break;if(d===4)for(d=l.return;d!==null;){var S=d.tag;if((S===3||S===4)&&d.stateNode.containerInfo===o)return;d=d.return}for(;m!==null;){if(d=ir(m),d===null)return;if(S=d.tag,S===5||S===6||S===26||S===27){l=c=d;continue e}m=m.parentNode}}l=l.return}Xu(function(){var M=c,L=lo(r),U=[];e:{var B=yf.get(e);if(B!==void 0){var O=pl,$=e;switch(e){case"keypress":if(gl(r)===0)break e;case"keydown":case"keyup":O=Jm;break;case"focusin":$="focus",O=fo;break;case"focusout":$="blur",O=fo;break;case"beforeblur":case"afterblur":O=fo;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":O=Fu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":O=Ym;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":O=ip;break;case gf:case mf:case pf:O=Vm;break;case Sf:O=rp;break;case"scroll":case"scrollend":O=qm;break;case"wheel":O=lp;break;case"copy":case"cut":case"paste":O=Gm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":O=Qu;break;case"toggle":case"beforetoggle":O=op}var ae=(i&4)!==0,ze=!ae&&(e==="scroll"||e==="scrollend"),E=ae?B!==null?B+"Capture":null:B;ae=[];for(var b=M,T;b!==null;){var H=b;if(T=H.stateNode,H=H.tag,H!==5&&H!==26&&H!==27||T===null||E===null||(H=Qr(b,E),H!=null&&ae.push(An(b,H,T))),ze)break;b=b.return}0<ae.length&&(B=new O(B,$,null,r,L),U.push({event:B,listeners:ae}))}}if((i&7)===0){e:{if(B=e==="mouseover"||e==="pointerover",O=e==="mouseout"||e==="pointerout",B&&r!==no&&($=r.relatedTarget||r.fromElement)&&(ir($)||$[tr]))break e;if((O||B)&&(B=L.window===L?L:(B=L.ownerDocument)?B.defaultView||B.parentWindow:window,O?($=r.relatedTarget||r.toElement,O=M,$=$?ir($):null,$!==null&&(ze=u($),ae=$.tag,$!==ze||ae!==5&&ae!==27&&ae!==6)&&($=null)):(O=null,$=M),O!==$)){if(ae=Fu,H="onMouseLeave",E="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(ae=Qu,H="onPointerLeave",E="onPointerEnter",b="pointer"),ze=O==null?B:Zr(O),T=$==null?B:Zr($),B=new ae(H,b+"leave",O,r,L),B.target=ze,B.relatedTarget=T,H=null,ir(L)===M&&(ae=new ae(E,b+"enter",$,r,L),ae.target=T,ae.relatedTarget=ze,H=ae),ze=H,O&&$)t:{for(ae=aS,E=O,b=$,T=0,H=E;H;H=ae(H))T++;H=0;for(var ne=b;ne;ne=ae(ne))H++;for(;0<T-H;)E=ae(E),T--;for(;0<H-T;)b=ae(b),H--;for(;T--;){if(E===b||b!==null&&E===b.alternate){ae=E;break t}E=ae(E),b=ae(b)}ae=null}else ae=null;O!==null&&K_(U,B,O,ae,!1),$!==null&&ze!==null&&K_(U,ze,$,ae,!0)}}e:{if(B=M?Zr(M):window,O=B.nodeName&&B.nodeName.toLowerCase(),O==="select"||O==="input"&&B.type==="file")var De=nf;else if(sf(B))if(lf)De=pp;else{De=gp;var te=vp}else O=B.nodeName,!O||O.toLowerCase()!=="input"||B.type!=="checkbox"&&B.type!=="radio"?M&&ro(M.elementType)&&(De=nf):De=mp;if(De&&(De=De(e,M))){rf(U,De,r,L);break e}te&&te(e,B,M),e==="focusout"&&M&&B.type==="number"&&M.memoizedProps.value!=null&&so(B,"number",B.value)}switch(te=M?Zr(M):window,e){case"focusin":(sf(te)||te.contentEditable==="true")&&(ur=te,So=M,nn=null);break;case"focusout":nn=So=ur=null;break;case"mousedown":yo=!0;break;case"contextmenu":case"mouseup":case"dragend":yo=!1,_f(U,r,L);break;case"selectionchange":if(yp)break;case"keydown":case"keyup":_f(U,r,L)}var _e;if(vo)e:{switch(e){case"compositionstart":var we="onCompositionStart";break e;case"compositionend":we="onCompositionEnd";break e;case"compositionupdate":we="onCompositionUpdate";break e}we=void 0}else cr?ef(e,r)&&(we="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(we="onCompositionStart");we&&(Iu&&r.locale!=="ko"&&(cr||we!=="onCompositionStart"?we==="onCompositionEnd"&&cr&&(_e=Gu()):(es=L,ho="value"in es?es.value:es.textContent,cr=!0)),te=oa(M,we),0<te.length&&(we=new Zu(we,e,null,r,L),U.push({event:we,listeners:te}),_e?we.data=_e:(_e=tf(r),_e!==null&&(we.data=_e)))),(_e=cp?up(e,r):fp(e,r))&&(we=oa(M,"onBeforeInput"),0<we.length&&(te=new Zu("onBeforeInput","beforeinput",null,r,L),U.push({event:te,listeners:we}),te.data=_e)),sS(U,e,M,r,L)}j_(U,i)})}function An(e,i,r){return{instance:e,listener:i,currentTarget:r}}function oa(e,i){for(var r=i+"Capture",l=[];e!==null;){var o=e,c=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||c===null||(o=Qr(e,r),o!=null&&l.unshift(An(e,o,c)),o=Qr(e,i),o!=null&&l.push(An(e,o,c))),e.tag===3)return l;e=e.return}return[]}function aS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function K_(e,i,r,l,o){for(var c=i._reactName,d=[];r!==null&&r!==l;){var m=r,S=m.alternate,M=m.stateNode;if(m=m.tag,S!==null&&S===l)break;m!==5&&m!==26&&m!==27||M===null||(S=M,o?(M=Qr(r,c),M!=null&&d.unshift(An(r,M,S))):o||(M=Qr(r,c),M!=null&&d.push(An(r,M,S)))),r=r.return}d.length!==0&&e.push({event:i,listeners:d})}var oS=/\r\n?/g,hS=/\u0000|\uFFFD/g;function W_(e){return(typeof e=="string"?e:""+e).replace(oS,`
9
+ `).replace(hS,"")}function V_(e,i){return i=W_(i),W_(e)===i}function Le(e,i,r,l,o,c){switch(r){case"children":typeof l=="string"?i==="body"||i==="textarea"&&l===""||ar(e,l):(typeof l=="number"||typeof l=="bigint")&&i!=="body"&&ar(e,""+l);break;case"className":fl(e,"class",l);break;case"tabIndex":fl(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":fl(e,r,l);break;case"style":Wu(e,l,c);break;case"data":if(i!=="object"){fl(e,"data",l);break}case"src":case"href":if(l===""&&(i!=="a"||r!=="href")){e.removeAttribute(r);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(r);break}l=_l(""+l),e.setAttribute(r,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(r,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof c=="function"&&(r==="formAction"?(i!=="input"&&Le(e,i,"name",o.name,o,null),Le(e,i,"formEncType",o.formEncType,o,null),Le(e,i,"formMethod",o.formMethod,o,null),Le(e,i,"formTarget",o.formTarget,o,null)):(Le(e,i,"encType",o.encType,o,null),Le(e,i,"method",o.method,o,null),Le(e,i,"target",o.target,o,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(r);break}l=_l(""+l),e.setAttribute(r,l);break;case"onClick":l!=null&&(e.onclick=Ai);break;case"onScroll":l!=null&&be("scroll",e);break;case"onScrollEnd":l!=null&&be("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(r=l.__html,r!=null){if(o.children!=null)throw Error(a(60));e.innerHTML=r}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}r=_l(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(r,""+l):e.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":l===!0?e.setAttribute(r,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(r,l):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(r,l):e.removeAttribute(r);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(r):e.setAttribute(r,l);break;case"popover":be("beforetoggle",e),be("toggle",e),ul(e,"popover",l);break;case"xlinkActuate":Bi(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Bi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Bi(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Bi(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Bi(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Bi(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Bi(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Bi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Bi(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":ul(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=Hm.get(r)||r,ul(e,r,l))}}function Xh(e,i,r,l,o,c){switch(r){case"style":Wu(e,l,c);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(r=l.__html,r!=null){if(o.children!=null)throw Error(a(60));e.innerHTML=r}}break;case"children":typeof l=="string"?ar(e,l):(typeof l=="number"||typeof l=="bigint")&&ar(e,""+l);break;case"onScroll":l!=null&&be("scroll",e);break;case"onScrollEnd":l!=null&&be("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Ai);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Lu.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(o=r.endsWith("Capture"),i=r.slice(2,o?r.length-7:void 0),c=e[At]||null,c=c!=null?c[r]:null,typeof c=="function"&&e.removeEventListener(i,c,o),typeof l=="function")){typeof c!="function"&&c!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(i,l,o);break e}r in e?e[r]=l:l===!0?e.setAttribute(r,""):ul(e,r,l)}}}function Ct(e,i,r){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":be("error",e),be("load",e);var l=!1,o=!1,c;for(c in r)if(r.hasOwnProperty(c)){var d=r[c];if(d!=null)switch(c){case"src":l=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Le(e,i,c,d,r,null)}}o&&Le(e,i,"srcSet",r.srcSet,r,null),l&&Le(e,i,"src",r.src,r,null);return;case"input":be("invalid",e);var m=c=d=o=null,S=null,M=null;for(l in r)if(r.hasOwnProperty(l)){var L=r[l];if(L!=null)switch(l){case"name":o=L;break;case"type":d=L;break;case"checked":S=L;break;case"defaultChecked":M=L;break;case"value":c=L;break;case"defaultValue":m=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(a(137,i));break;default:Le(e,i,l,L,r,null)}}qu(e,c,m,S,M,d,o,!1);return;case"select":be("invalid",e),l=d=c=null;for(o in r)if(r.hasOwnProperty(o)&&(m=r[o],m!=null))switch(o){case"value":c=m;break;case"defaultValue":d=m;break;case"multiple":l=m;default:Le(e,i,o,m,r,null)}i=c,r=d,e.multiple=!!l,i!=null?lr(e,!!l,i,!1):r!=null&&lr(e,!!l,r,!0);return;case"textarea":be("invalid",e),c=o=l=null;for(d in r)if(r.hasOwnProperty(d)&&(m=r[d],m!=null))switch(d){case"value":l=m;break;case"defaultValue":o=m;break;case"children":c=m;break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(a(91));break;default:Le(e,i,d,m,r,null)}Yu(e,l,o,c);return;case"option":for(S in r)r.hasOwnProperty(S)&&(l=r[S],l!=null)&&(S==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":Le(e,i,S,l,r,null));return;case"dialog":be("beforetoggle",e),be("toggle",e),be("cancel",e),be("close",e);break;case"iframe":case"object":be("load",e);break;case"video":case"audio":for(l=0;l<Bn.length;l++)be(Bn[l],e);break;case"image":be("error",e),be("load",e);break;case"details":be("toggle",e);break;case"embed":case"source":case"link":be("error",e),be("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(M in r)if(r.hasOwnProperty(M)&&(l=r[M],l!=null))switch(M){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Le(e,i,M,l,r,null)}return;default:if(ro(i)){for(L in r)r.hasOwnProperty(L)&&(l=r[L],l!==void 0&&Xh(e,i,L,l,r,void 0));return}}for(m in r)r.hasOwnProperty(m)&&(l=r[m],l!=null&&Le(e,i,m,l,r,null))}function cS(e,i,r,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,c=null,d=null,m=null,S=null,M=null,L=null;for(O in r){var U=r[O];if(r.hasOwnProperty(O)&&U!=null)switch(O){case"checked":break;case"value":break;case"defaultValue":S=U;default:l.hasOwnProperty(O)||Le(e,i,O,null,l,U)}}for(var B in l){var O=l[B];if(U=r[B],l.hasOwnProperty(B)&&(O!=null||U!=null))switch(B){case"type":c=O;break;case"name":o=O;break;case"checked":M=O;break;case"defaultChecked":L=O;break;case"value":d=O;break;case"defaultValue":m=O;break;case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(a(137,i));break;default:O!==U&&Le(e,i,B,O,l,U)}}io(e,d,m,S,M,L,c,o);return;case"select":O=d=m=B=null;for(c in r)if(S=r[c],r.hasOwnProperty(c)&&S!=null)switch(c){case"value":break;case"multiple":O=S;default:l.hasOwnProperty(c)||Le(e,i,c,null,l,S)}for(o in l)if(c=l[o],S=r[o],l.hasOwnProperty(o)&&(c!=null||S!=null))switch(o){case"value":B=c;break;case"defaultValue":m=c;break;case"multiple":d=c;default:c!==S&&Le(e,i,o,c,l,S)}i=m,r=d,l=O,B!=null?lr(e,!!r,B,!1):!!l!=!!r&&(i!=null?lr(e,!!r,i,!0):lr(e,!!r,r?[]:"",!1));return;case"textarea":O=B=null;for(m in r)if(o=r[m],r.hasOwnProperty(m)&&o!=null&&!l.hasOwnProperty(m))switch(m){case"value":break;case"children":break;default:Le(e,i,m,null,l,o)}for(d in l)if(o=l[d],c=r[d],l.hasOwnProperty(d)&&(o!=null||c!=null))switch(d){case"value":B=o;break;case"defaultValue":O=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(a(91));break;default:o!==c&&Le(e,i,d,o,l,c)}ju(e,B,O);return;case"option":for(var $ in r)B=r[$],r.hasOwnProperty($)&&B!=null&&!l.hasOwnProperty($)&&($==="selected"?e.selected=!1:Le(e,i,$,null,l,B));for(S in l)B=l[S],O=r[S],l.hasOwnProperty(S)&&B!==O&&(B!=null||O!=null)&&(S==="selected"?e.selected=B&&typeof B!="function"&&typeof B!="symbol":Le(e,i,S,B,l,O));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 ae in r)B=r[ae],r.hasOwnProperty(ae)&&B!=null&&!l.hasOwnProperty(ae)&&Le(e,i,ae,null,l,B);for(M in l)if(B=l[M],O=r[M],l.hasOwnProperty(M)&&B!==O&&(B!=null||O!=null))switch(M){case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(a(137,i));break;default:Le(e,i,M,B,l,O)}return;default:if(ro(i)){for(var ze in r)B=r[ze],r.hasOwnProperty(ze)&&B!==void 0&&!l.hasOwnProperty(ze)&&Xh(e,i,ze,void 0,l,B);for(L in l)B=l[L],O=r[L],!l.hasOwnProperty(L)||B===O||B===void 0&&O===void 0||Xh(e,i,L,B,l,O);return}}for(var E in r)B=r[E],r.hasOwnProperty(E)&&B!=null&&!l.hasOwnProperty(E)&&Le(e,i,E,null,l,B);for(U in l)B=l[U],O=r[U],!l.hasOwnProperty(U)||B===O||B==null&&O==null||Le(e,i,U,B,l,O)}function X_(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function uS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,i=0,r=performance.getEntriesByType("resource"),l=0;l<r.length;l++){var o=r[l],c=o.transferSize,d=o.initiatorType,m=o.duration;if(c&&m&&X_(d)){for(d=0,m=o.responseEnd,l+=1;l<r.length;l++){var S=r[l],M=S.startTime;if(M>m)break;var L=S.transferSize,U=S.initiatorType;L&&X_(U)&&(S=S.responseEnd,d+=L*(S<m?1:(m-M)/(S-M)))}if(--l,i+=8*(c+d)/(o.duration/1e3),e++,10<e)break}}if(0<e)return i/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Gh=null,Ph=null;function ha(e){return e.nodeType===9?e:e.ownerDocument}function G_(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function P_(e,i){if(e===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&i==="foreignObject"?0:e}function Fh(e,i){return e==="textarea"||e==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Zh=null;function fS(){var e=window.event;return e&&e.type==="popstate"?e===Zh?!1:(Zh=e,!0):(Zh=null,!1)}var F_=typeof setTimeout=="function"?setTimeout:void 0,dS=typeof clearTimeout=="function"?clearTimeout:void 0,Z_=typeof Promise=="function"?Promise:void 0,_S=typeof queueMicrotask=="function"?queueMicrotask:typeof Z_<"u"?function(e){return Z_.resolve(null).then(e).catch(vS)}:F_;function vS(e){setTimeout(function(){throw e})}function ms(e){return e==="head"}function Q_(e,i){var r=i,l=0;do{var o=r.nextSibling;if(e.removeChild(r),o&&o.nodeType===8)if(r=o.data,r==="/$"||r==="/&"){if(l===0){e.removeChild(o),Ur(i);return}l--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")l++;else if(r==="html")Rn(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,Rn(r);for(var c=r.firstChild;c;){var d=c.nextSibling,m=c.nodeName;c[Fr]||m==="SCRIPT"||m==="STYLE"||m==="LINK"&&c.rel.toLowerCase()==="stylesheet"||r.removeChild(c),c=d}}else r==="body"&&Rn(e.ownerDocument.body);r=o}while(r);Ur(i)}function I_(e,i){var r=e;e=0;do{var l=r.nextSibling;if(r.nodeType===1?i?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(i?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),l&&l.nodeType===8)if(r=l.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=l}while(r)}function Qh(e){var i=e.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var r=i;switch(i=i.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":Qh(r),eo(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function gS(e,i,r,l){for(;e.nodeType===1;){var o=r;if(e.nodeName.toLowerCase()!==i.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Fr])switch(i){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(i==="input"&&e.type==="hidden"){var c=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=li(e.nextSibling),e===null)break}return null}function mS(e,i,r){if(i==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=li(e.nextSibling),e===null))return null;return e}function $_(e,i){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=li(e.nextSibling),e===null))return null;return e}function Ih(e){return e.data==="$?"||e.data==="$~"}function $h(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function pS(e,i){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=i;else if(e.data!=="$?"||r.readyState!=="loading")i();else{var l=function(){i(),r.removeEventListener("DOMContentLoaded",l)};r.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function li(e){for(;e!=null;e=e.nextSibling){var i=e.nodeType;if(i===1||i===3)break;if(i===8){if(i=e.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return e}var Jh=null;function J_(e){e=e.nextSibling;for(var i=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(i===0)return li(e.nextSibling);i--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||i++}e=e.nextSibling}return null}function ev(e){e=e.previousSibling;for(var i=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(i===0)return e;i--}else r!=="/$"&&r!=="/&"||i++}e=e.previousSibling}return null}function tv(e,i,r){switch(i=ha(r),e){case"html":if(e=i.documentElement,!e)throw Error(a(452));return e;case"head":if(e=i.head,!e)throw Error(a(453));return e;case"body":if(e=i.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Rn(e){for(var i=e.attributes;i.length;)e.removeAttributeNode(i[0]);eo(e)}var ai=new Map,iv=new Set;function ca(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Gi=z.d;z.d={f:SS,r:yS,D:bS,C:CS,L:wS,m:ES,X:DS,S:xS,M:TS};function SS(){var e=Gi.f(),i=ta();return e||i}function yS(e){var i=sr(e);i!==null&&i.tag===5&&i.type==="form"?Sd(i):Gi.r(e)}var zr=typeof document>"u"?null:document;function sv(e,i,r){var l=zr;if(l&&typeof i=="string"&&i){var o=Jt(i);o='link[rel="'+e+'"][href="'+o+'"]',typeof r=="string"&&(o+='[crossorigin="'+r+'"]'),iv.has(o)||(iv.add(o),e={rel:e,crossOrigin:r,href:i},l.querySelector(o)===null&&(i=l.createElement("link"),Ct(i,"link",e),ct(i),l.head.appendChild(i)))}}function bS(e){Gi.D(e),sv("dns-prefetch",e,null)}function CS(e,i){Gi.C(e,i),sv("preconnect",e,i)}function wS(e,i,r){Gi.L(e,i,r);var l=zr;if(l&&e&&i){var o='link[rel="preload"][as="'+Jt(i)+'"]';i==="image"&&r&&r.imageSrcSet?(o+='[imagesrcset="'+Jt(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(o+='[imagesizes="'+Jt(r.imageSizes)+'"]')):o+='[href="'+Jt(e)+'"]';var c=o;switch(i){case"style":c=Nr(e);break;case"script":c=Hr(e)}ai.has(c)||(e=y({rel:"preload",href:i==="image"&&r&&r.imageSrcSet?void 0:e,as:i},r),ai.set(c,e),l.querySelector(o)!==null||i==="style"&&l.querySelector(kn(c))||i==="script"&&l.querySelector(On(c))||(i=l.createElement("link"),Ct(i,"link",e),ct(i),l.head.appendChild(i)))}}function ES(e,i){Gi.m(e,i);var r=zr;if(r&&e){var l=i&&typeof i.as=="string"?i.as:"script",o='link[rel="modulepreload"][as="'+Jt(l)+'"][href="'+Jt(e)+'"]',c=o;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Hr(e)}if(!ai.has(c)&&(e=y({rel:"modulepreload",href:e},i),ai.set(c,e),r.querySelector(o)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(On(c)))return}l=r.createElement("link"),Ct(l,"link",e),ct(l),r.head.appendChild(l)}}}function xS(e,i,r){Gi.S(e,i,r);var l=zr;if(l&&e){var o=rr(l).hoistableStyles,c=Nr(e);i=i||"default";var d=o.get(c);if(!d){var m={loading:0,preload:null};if(d=l.querySelector(kn(c)))m.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":i},r),(r=ai.get(c))&&ec(e,r);var S=d=l.createElement("link");ct(S),Ct(S,"link",e),S._p=new Promise(function(M,L){S.onload=M,S.onerror=L}),S.addEventListener("load",function(){m.loading|=1}),S.addEventListener("error",function(){m.loading|=2}),m.loading|=4,ua(d,i,l)}d={type:"stylesheet",instance:d,count:1,state:m},o.set(c,d)}}}function DS(e,i){Gi.X(e,i);var r=zr;if(r&&e){var l=rr(r).hoistableScripts,o=Hr(e),c=l.get(o);c||(c=r.querySelector(On(o)),c||(e=y({src:e,async:!0},i),(i=ai.get(o))&&tc(e,i),c=r.createElement("script"),ct(c),Ct(c,"link",e),r.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(o,c))}}function TS(e,i){Gi.M(e,i);var r=zr;if(r&&e){var l=rr(r).hoistableScripts,o=Hr(e),c=l.get(o);c||(c=r.querySelector(On(o)),c||(e=y({src:e,async:!0,type:"module"},i),(i=ai.get(o))&&tc(e,i),c=r.createElement("script"),ct(c),Ct(c,"link",e),r.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(o,c))}}function rv(e,i,r,l){var o=(o=oe.current)?ca(o):null;if(!o)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(i=Nr(r.href),r=rr(o).hoistableStyles,l=r.get(i),l||(l={type:"style",instance:null,count:0,state:null},r.set(i,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=Nr(r.href);var c=rr(o).hoistableStyles,d=c.get(e);if(d||(o=o.ownerDocument||o,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,d),(c=o.querySelector(kn(e)))&&!c._p&&(d.instance=c,d.state.loading=5),ai.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},ai.set(e,r),c||MS(o,e,r,d.state))),i&&l===null)throw Error(a(528,""));return d}if(i&&l!==null)throw Error(a(529,""));return null;case"script":return i=r.async,r=r.src,typeof r=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Hr(r),r=rr(o).hoistableScripts,l=r.get(i),l||(l={type:"script",instance:null,count:0,state:null},r.set(i,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Nr(e){return'href="'+Jt(e)+'"'}function kn(e){return'link[rel="stylesheet"]['+e+"]"}function nv(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function MS(e,i,r,l){e.querySelector('link[rel="preload"][as="style"]['+i+"]")?l.loading=1:(i=e.createElement("link"),l.preload=i,i.addEventListener("load",function(){return l.loading|=1}),i.addEventListener("error",function(){return l.loading|=2}),Ct(i,"link",r),ct(i),e.head.appendChild(i))}function Hr(e){return'[src="'+Jt(e)+'"]'}function On(e){return"script[async]"+e}function lv(e,i,r){if(i.count++,i.instance===null)switch(i.type){case"style":var l=e.querySelector('style[data-href~="'+Jt(r.href)+'"]');if(l)return i.instance=l,ct(l),l;var o=y({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),ct(l),Ct(l,"style",o),ua(l,r.precedence,e),i.instance=l;case"stylesheet":o=Nr(r.href);var c=e.querySelector(kn(o));if(c)return i.state.loading|=4,i.instance=c,ct(c),c;l=nv(r),(o=ai.get(o))&&ec(l,o),c=(e.ownerDocument||e).createElement("link"),ct(c);var d=c;return d._p=new Promise(function(m,S){d.onload=m,d.onerror=S}),Ct(c,"link",l),i.state.loading|=4,ua(c,r.precedence,e),i.instance=c;case"script":return c=Hr(r.src),(o=e.querySelector(On(c)))?(i.instance=o,ct(o),o):(l=r,(o=ai.get(c))&&(l=y({},r),tc(l,o)),e=e.ownerDocument||e,o=e.createElement("script"),ct(o),Ct(o,"link",l),e.head.appendChild(o),i.instance=o);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(l=i.instance,i.state.loading|=4,ua(l,r.precedence,e));return i.instance}function ua(e,i,r){for(var l=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=l.length?l[l.length-1]:null,c=o,d=0;d<l.length;d++){var m=l[d];if(m.dataset.precedence===i)c=m;else if(c!==o)break}c?c.parentNode.insertBefore(e,c.nextSibling):(i=r.nodeType===9?r.head:r,i.insertBefore(e,i.firstChild))}function ec(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.title==null&&(e.title=i.title)}function tc(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.integrity==null&&(e.integrity=i.integrity)}var fa=null;function av(e,i,r){if(fa===null){var l=new Map,o=fa=new Map;o.set(r,l)}else o=fa,l=o.get(r),l||(l=new Map,o.set(r,l));if(l.has(e))return l;for(l.set(e,null),r=r.getElementsByTagName(e),o=0;o<r.length;o++){var c=r[o];if(!(c[Fr]||c[pt]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var d=c.getAttribute(i)||"";d=e+d;var m=l.get(d);m?m.push(c):l.set(d,[c])}}return l}function ov(e,i,r){e=e.ownerDocument||e,e.head.insertBefore(r,i==="title"?e.querySelector("head > title"):null)}function BS(e,i,r){if(r===1||i.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(e=i.disabled,typeof i.precedence=="string"&&e==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function hv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function AS(e,i,r,l){if(r.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var o=Nr(l.href),c=i.querySelector(kn(o));if(c){i=c._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(e.count++,e=da.bind(e),i.then(e,e)),r.state.loading|=4,r.instance=c,ct(c);return}c=i.ownerDocument||i,l=nv(l),(o=ai.get(o))&&ec(l,o),c=c.createElement("link"),ct(c);var d=c;d._p=new Promise(function(m,S){d.onload=m,d.onerror=S}),Ct(c,"link",l),r.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,i),(i=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=da.bind(e),i.addEventListener("load",r),i.addEventListener("error",r))}}var ic=0;function RS(e,i){return e.stylesheets&&e.count===0&&va(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var l=setTimeout(function(){if(e.stylesheets&&va(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+i);0<e.imgBytes&&ic===0&&(ic=62500*uS());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&va(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>ic?50:800)+i);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(o)}}:null}function da(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)va(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var _a=null;function va(e,i){e.stylesheets=null,e.unsuspend!==null&&(e.count++,_a=new Map,i.forEach(kS,e),_a=null,da.call(e))}function kS(e,i){if(!(i.state.loading&4)){var r=_a.get(e);if(r)var l=r.get(null);else{r=new Map,_a.set(e,r);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<o.length;c++){var d=o[c];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(r.set(d.dataset.precedence,d),l=d)}l&&r.set(null,l)}o=i.instance,d=o.getAttribute("data-precedence"),c=r.get(d)||l,c===l&&r.set(null,o),r.set(d,o),this.count++,l=da.bind(this),o.addEventListener("load",l),o.addEventListener("error",l),c?c.parentNode.insertBefore(o,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),i.state.loading|=4}}var Ln={$$typeof:J,Provider:null,Consumer:null,_currentValue:N,_currentValue2:N,_threadCount:0};function OS(e,i,r,l,o,c,d,m,S){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Qa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qa(0),this.hiddenUpdates=Qa(null),this.identifierPrefix=l,this.onUncaughtError=o,this.onCaughtError=c,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function cv(e,i,r,l,o,c,d,m,S,M,L,U){return e=new OS(e,i,r,d,S,M,L,U,m),i=1,c===!0&&(i|=24),c=Kt(3,null,null,i),e.current=c,c.stateNode=e,i=zo(),i.refCount++,e.pooledCache=i,i.refCount++,c.memoizedState={element:l,isDehydrated:r,cache:i},qo(c),e}function uv(e){return e?(e=_r,e):_r}function fv(e,i,r,l,o,c){o=uv(o),l.context===null?l.context=o:l.pendingContext=o,l=ls(i),l.payload={element:r},c=c===void 0?null:c,c!==null&&(l.callback=c),r=as(e,l,i),r!==null&&(Nt(r,e,i),fn(r,e,i))}function dv(e,i){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<i?r:i}}function sc(e,i){dv(e,i),(e=e.alternate)&&dv(e,i)}function _v(e){if(e.tag===13||e.tag===31){var i=Ls(e,67108864);i!==null&&Nt(i,e,67108864),sc(e,67108864)}}function vv(e){if(e.tag===13||e.tag===31){var i=Pt();i=Ia(i);var r=Ls(e,i);r!==null&&Nt(r,e,i),sc(e,i)}}var ga=!0;function LS(e,i,r,l){var o=w.T;w.T=null;var c=z.p;try{z.p=2,rc(e,i,r,l)}finally{z.p=c,w.T=o}}function zS(e,i,r,l){var o=w.T;w.T=null;var c=z.p;try{z.p=8,rc(e,i,r,l)}finally{z.p=c,w.T=o}}function rc(e,i,r,l){if(ga){var o=nc(l);if(o===null)Vh(e,i,l,ma,r),mv(e,l);else if(HS(o,e,i,r,l))l.stopPropagation();else if(mv(e,l),i&4&&-1<NS.indexOf(e)){for(;o!==null;){var c=sr(o);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var d=Bs(c.pendingLanes);if(d!==0){var m=c;for(m.pendingLanes|=2,m.entangledLanes|=2;d;){var S=1<<31-jt(d);m.entanglements[1]|=S,d&=~S}Ci(c),(Me&6)===0&&(Jl=Ut()+500,Mn(0))}}break;case 31:case 13:m=Ls(c,2),m!==null&&Nt(m,c,2),ta(),sc(c,2)}if(c=nc(l),c===null&&Vh(e,i,l,ma,r),c===o)break;o=c}o!==null&&l.stopPropagation()}else Vh(e,i,l,null,r)}}function nc(e){return e=lo(e),lc(e)}var ma=null;function lc(e){if(ma=null,e=ir(e),e!==null){var i=u(e);if(i===null)e=null;else{var r=i.tag;if(r===13){if(e=f(i),e!==null)return e;e=null}else if(r===31){if(e=v(i),e!==null)return e;e=null}else if(r===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;e=null}else i!==e&&(e=null)}}return ma=e,null}function gv(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(bm()){case wu:return 2;case Eu:return 8;case ll:case Cm:return 32;case xu:return 268435456;default:return 32}default:return 32}}var ac=!1,ps=null,Ss=null,ys=null,zn=new Map,Nn=new Map,bs=[],NS="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 mv(e,i){switch(e){case"focusin":case"focusout":ps=null;break;case"dragenter":case"dragleave":Ss=null;break;case"mouseover":case"mouseout":ys=null;break;case"pointerover":case"pointerout":zn.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nn.delete(i.pointerId)}}function Hn(e,i,r,l,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:i,domEventName:r,eventSystemFlags:l,nativeEvent:c,targetContainers:[o]},i!==null&&(i=sr(i),i!==null&&_v(i)),e):(e.eventSystemFlags|=l,i=e.targetContainers,o!==null&&i.indexOf(o)===-1&&i.push(o),e)}function HS(e,i,r,l,o){switch(i){case"focusin":return ps=Hn(ps,e,i,r,l,o),!0;case"dragenter":return Ss=Hn(Ss,e,i,r,l,o),!0;case"mouseover":return ys=Hn(ys,e,i,r,l,o),!0;case"pointerover":var c=o.pointerId;return zn.set(c,Hn(zn.get(c)||null,e,i,r,l,o)),!0;case"gotpointercapture":return c=o.pointerId,Nn.set(c,Hn(Nn.get(c)||null,e,i,r,l,o)),!0}return!1}function pv(e){var i=ir(e.target);if(i!==null){var r=u(i);if(r!==null){if(i=r.tag,i===13){if(i=f(r),i!==null){e.blockedOn=i,Ru(e.priority,function(){vv(r)});return}}else if(i===31){if(i=v(r),i!==null){e.blockedOn=i,Ru(e.priority,function(){vv(r)});return}}else if(i===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function pa(e){if(e.blockedOn!==null)return!1;for(var i=e.targetContainers;0<i.length;){var r=nc(e.nativeEvent);if(r===null){r=e.nativeEvent;var l=new r.constructor(r.type,r);no=l,r.target.dispatchEvent(l),no=null}else return i=sr(r),i!==null&&_v(i),e.blockedOn=r,!1;i.shift()}return!0}function Sv(e,i,r){pa(e)&&r.delete(i)}function US(){ac=!1,ps!==null&&pa(ps)&&(ps=null),Ss!==null&&pa(Ss)&&(Ss=null),ys!==null&&pa(ys)&&(ys=null),zn.forEach(Sv),Nn.forEach(Sv)}function Sa(e,i){e.blockedOn===i&&(e.blockedOn=null,ac||(ac=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,US)))}var ya=null;function yv(e){ya!==e&&(ya=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){ya===e&&(ya=null);for(var i=0;i<e.length;i+=3){var r=e[i],l=e[i+1],o=e[i+2];if(typeof l!="function"){if(lc(l||r)===null)continue;break}var c=sr(r);c!==null&&(e.splice(i,3),i-=3,nh(c,{pending:!0,data:o,method:r.method,action:l},l,o))}}))}function Ur(e){function i(S){return Sa(S,e)}ps!==null&&Sa(ps,e),Ss!==null&&Sa(Ss,e),ys!==null&&Sa(ys,e),zn.forEach(i),Nn.forEach(i);for(var r=0;r<bs.length;r++){var l=bs[r];l.blockedOn===e&&(l.blockedOn=null)}for(;0<bs.length&&(r=bs[0],r.blockedOn===null);)pv(r),r.blockedOn===null&&bs.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(l=0;l<r.length;l+=3){var o=r[l],c=r[l+1],d=o[At]||null;if(typeof c=="function")d||yv(r);else if(d){var m=null;if(c&&c.hasAttribute("formAction")){if(o=c,d=c[At]||null)m=d.formAction;else if(lc(o)!==null)continue}else m=d.action;typeof m=="function"?r[l+1]=m:(r.splice(l,3),l-=3),yv(r)}}}function bv(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(d){return o=d})},focusReset:"manual",scroll:"manual"})}function i(){o!==null&&(o(),o=null),l||setTimeout(r,20)}function r(){if(!l&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(r,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),o!==null&&(o(),o=null)}}}function oc(e){this._internalRoot=e}ba.prototype.render=oc.prototype.render=function(e){var i=this._internalRoot;if(i===null)throw Error(a(409));var r=i.current,l=Pt();fv(r,l,e,i,null,null)},ba.prototype.unmount=oc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var i=e.containerInfo;fv(e.current,2,null,e,null,null),ta(),i[tr]=null}};function ba(e){this._internalRoot=e}ba.prototype.unstable_scheduleHydration=function(e){if(e){var i=Au();e={blockedOn:null,target:e,priority:i};for(var r=0;r<bs.length&&i!==0&&i<bs[r].priority;r++);bs.splice(r,0,e),r===0&&pv(e)}};var Cv=s.version;if(Cv!=="19.2.4")throw Error(a(527,Cv,"19.2.4"));z.findDOMNode=function(e){var i=e._reactInternals;if(i===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=_(i),e=e!==null?C(e):null,e=e===null?null:e.stateNode,e};var qS={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:w,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ca=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ca.isDisabled&&Ca.supportsFiber)try{Xr=Ca.inject(qS),qt=Ca}catch{}}return qn.createRoot=function(e,i){if(!h(e))throw Error(a(299));var r=!1,l="",o=Bd,c=Ad,d=Rd;return i!=null&&(i.unstable_strictMode===!0&&(r=!0),i.identifierPrefix!==void 0&&(l=i.identifierPrefix),i.onUncaughtError!==void 0&&(o=i.onUncaughtError),i.onCaughtError!==void 0&&(c=i.onCaughtError),i.onRecoverableError!==void 0&&(d=i.onRecoverableError)),i=cv(e,1,!1,null,null,r,l,null,o,c,d,bv),e[tr]=i.current,Wh(e),new oc(i)},qn.hydrateRoot=function(e,i,r){if(!h(e))throw Error(a(299));var l=!1,o="",c=Bd,d=Ad,m=Rd,S=null;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(o=r.identifierPrefix),r.onUncaughtError!==void 0&&(c=r.onUncaughtError),r.onCaughtError!==void 0&&(d=r.onCaughtError),r.onRecoverableError!==void 0&&(m=r.onRecoverableError),r.formState!==void 0&&(S=r.formState)),i=cv(e,1,!0,i,r??null,l,o,S,c,d,m,bv),i.context=uv(null),r=i.current,l=Pt(),l=Ia(l),o=ls(l),o.callback=null,as(r,o,l),r=l,i.current.lanes=r,Pr(i,r),Ci(i),e[tr]=i.current,Wh(e),new ba(i)},qn.version="19.2.4",qn}var kv;function ZS(){if(kv)return uc.exports;kv=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(s){console.error(s)}}return t(),uc.exports=FS(),uc.exports}var QS=ZS();var IS=2,$S=1,JS=class{activate(t){this._terminal=t}dispose(){}fit(){let t=this.proposeDimensions();if(!t||!this._terminal||isNaN(t.cols)||isNaN(t.rows))return;let s=this._terminal._core;(this._terminal.rows!==t.rows||this._terminal.cols!==t.cols)&&(s._renderService.clear(),this._terminal.resize(t.cols,t.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let t=this._terminal._core._renderService.dimensions;if(t.css.cell.width===0||t.css.cell.height===0)return;let s=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(n.getPropertyValue("height")),h=Math.max(0,parseInt(n.getPropertyValue("width"))),u=window.getComputedStyle(this._terminal.element),f={top:parseInt(u.getPropertyValue("padding-top")),bottom:parseInt(u.getPropertyValue("padding-bottom")),right:parseInt(u.getPropertyValue("padding-right")),left:parseInt(u.getPropertyValue("padding-left"))},v=f.top+f.bottom,g=f.right+f.left,_=a-v,C=h-g-s;return{cols:Math.max(IS,Math.floor(C/t.css.cell.width)),rows:Math.max($S,Math.floor(_/t.css.cell.height))}}};var Mg=Object.defineProperty,e0=Object.getOwnPropertyDescriptor,t0=(t,s)=>{for(var n in s)Mg(t,n,{get:s[n],enumerable:!0})},Ze=(t,s,n,a)=>{for(var h=a>1?void 0:a?e0(s,n):s,u=t.length-1,f;u>=0;u--)(f=t[u])&&(h=(a?f(s,n,h):f(h))||h);return a&&h&&Mg(s,n,h),h},I=(t,s)=>(n,a)=>s(n,a,t),Ov="Terminal input",Mc={get:()=>Ov,set:t=>Ov=t},Lv="Too much output to announce, navigate to rows manually to read",Bc={get:()=>Lv,set:t=>Lv=t};function i0(t){return t.replace(/\r?\n/g,"\r")}function s0(t,s){return s?"\x1B[200~"+t+"\x1B[201~":t}function r0(t,s){t.clipboardData&&t.clipboardData.setData("text/plain",s.selectionText),t.preventDefault()}function n0(t,s,n,a){if(t.stopPropagation(),t.clipboardData){let h=t.clipboardData.getData("text/plain");Bg(h,s,n,a)}}function Bg(t,s,n,a){t=i0(t),t=s0(t,n.decPrivateModes.bracketedPasteMode&&a.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(t,!0),s.value=""}function Ag(t,s,n){let a=n.getBoundingClientRect(),h=t.clientX-a.left-10,u=t.clientY-a.top-10;s.style.width="20px",s.style.height="20px",s.style.left=`${h}px`,s.style.top=`${u}px`,s.style.zIndex="1000",s.focus()}function zv(t,s,n,a,h){Ag(t,s,n),h&&a.rightClickSelect(t),s.value=a.selectionText,s.select()}function Ds(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}function Ya(t,s=0,n=t.length){let a="";for(let h=s;h<n;++h){let u=t[h];u>65535?(u-=65536,a+=String.fromCharCode((u>>10)+55296)+String.fromCharCode(u%1024+56320)):a+=String.fromCharCode(u)}return a}var l0=class{constructor(){this._interim=0}clear(){this._interim=0}decode(t,s){let n=t.length;if(!n)return 0;let a=0,h=0;if(this._interim){let u=t.charCodeAt(h++);56320<=u&&u<=57343?s[a++]=(this._interim-55296)*1024+u-56320+65536:(s[a++]=this._interim,s[a++]=u),this._interim=0}for(let u=h;u<n;++u){let f=t.charCodeAt(u);if(55296<=f&&f<=56319){if(++u>=n)return this._interim=f,a;let v=t.charCodeAt(u);56320<=v&&v<=57343?s[a++]=(f-55296)*1024+v-56320+65536:(s[a++]=f,s[a++]=v);continue}f!==65279&&(s[a++]=f)}return a}},a0=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(t,s){let n=t.length;if(!n)return 0;let a=0,h,u,f,v,g=0,_=0;if(this.interim[0]){let x=!1,A=this.interim[0];A&=(A&224)===192?31:(A&240)===224?15:7;let D=0,k;for(;(k=this.interim[++D]&63)&&D<4;)A<<=6,A|=k;let G=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,Q=G-D;for(;_<Q;){if(_>=n)return 0;if(k=t[_++],(k&192)!==128){_--,x=!0;break}else this.interim[D++]=k,A<<=6,A|=k&63}x||(G===2?A<128?_--:s[a++]=A:G===3?A<2048||A>=55296&&A<=57343||A===65279||(s[a++]=A):A<65536||A>1114111||(s[a++]=A)),this.interim.fill(0)}let C=n-4,y=_;for(;y<n;){for(;y<C&&!((h=t[y])&128)&&!((u=t[y+1])&128)&&!((f=t[y+2])&128)&&!((v=t[y+3])&128);)s[a++]=h,s[a++]=u,s[a++]=f,s[a++]=v,y+=4;if(h=t[y++],h<128)s[a++]=h;else if((h&224)===192){if(y>=n)return this.interim[0]=h,a;if(u=t[y++],(u&192)!==128){y--;continue}if(g=(h&31)<<6|u&63,g<128){y--;continue}s[a++]=g}else if((h&240)===224){if(y>=n)return this.interim[0]=h,a;if(u=t[y++],(u&192)!==128){y--;continue}if(y>=n)return this.interim[0]=h,this.interim[1]=u,a;if(f=t[y++],(f&192)!==128){y--;continue}if(g=(h&15)<<12|(u&63)<<6|f&63,g<2048||g>=55296&&g<=57343||g===65279)continue;s[a++]=g}else if((h&248)===240){if(y>=n)return this.interim[0]=h,a;if(u=t[y++],(u&192)!==128){y--;continue}if(y>=n)return this.interim[0]=h,this.interim[1]=u,a;if(f=t[y++],(f&192)!==128){y--;continue}if(y>=n)return this.interim[0]=h,this.interim[1]=u,this.interim[2]=f,a;if(v=t[y++],(v&192)!==128){y--;continue}if(g=(h&7)<<18|(u&63)<<12|(f&63)<<6|v&63,g<65536||g>1114111)continue;s[a++]=g}}return a}},Rg="",Ts=" ",il=class kg{constructor(){this.fg=0,this.bg=0,this.extended=new za}static toColorRGB(s){return[s>>>16&255,s>>>8&255,s&255]}static fromColorRGB(s){return(s[0]&255)<<16|(s[1]&255)<<8|s[2]&255}clone(){let s=new kg;return s.fg=this.fg,s.bg=this.bg,s.extended=this.extended.clone(),s}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}},za=class Og{constructor(s=0,n=0){this._ext=0,this._urlId=0,this._ext=s,this._urlId=n}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(s){this._ext=s}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(s){this._ext&=-469762049,this._ext|=s<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(s){this._ext&=-67108864,this._ext|=s&67108863}get urlId(){return this._urlId}set urlId(s){this._urlId=s}get underlineVariantOffset(){let s=(this._ext&3758096384)>>29;return s<0?s^4294967288:s}set underlineVariantOffset(s){this._ext&=536870911,this._ext|=s<<29&3758096384}clone(){return new Og(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},ui=class Lg extends il{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new za,this.combinedData=""}static fromCharData(s){let n=new Lg;return n.setFromCharData(s),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Ds(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(s){this.fg=s[0],this.bg=0;let n=!1;if(s[1].length>2)n=!0;else if(s[1].length===2){let a=s[1].charCodeAt(0);if(55296<=a&&a<=56319){let h=s[1].charCodeAt(1);56320<=h&&h<=57343?this.content=(a-55296)*1024+h-56320+65536|s[2]<<22:n=!0}else n=!0}else this.content=s[1].charCodeAt(0)|s[2]<<22;n&&(this.combinedData=s[1],this.content=2097152|s[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Nv="di$target",Ac="di$dependencies",vc=new Map;function o0(t){return t[Ac]||[]}function gt(t){if(vc.has(t))return vc.get(t);let s=function(n,a,h){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");h0(s,n,h)};return s._id=t,vc.set(t,s),s}function h0(t,s,n){s[Nv]===s?s[Ac].push({id:t,index:n}):(s[Ac]=[{id:t,index:n}],s[Nv]=s)}var Mt=gt("BufferService"),zg=gt("CoreMouseService"),er=gt("CoreService"),c0=gt("CharsetService"),fu=gt("InstantiationService"),Ng=gt("LogService"),Bt=gt("OptionsService"),Hg=gt("OscLinkService"),u0=gt("UnicodeService"),sl=gt("DecorationService"),Rc=class{constructor(t,s,n){this._bufferService=t,this._optionsService=s,this._oscLinkService=n}provideLinks(t,s){let n=this._bufferService.buffer.lines.get(t-1);if(!n){s(void 0);return}let a=[],h=this._optionsService.rawOptions.linkHandler,u=new ui,f=n.getTrimmedLength(),v=-1,g=-1,_=!1;for(let C=0;C<f;C++)if(!(g===-1&&!n.hasContent(C))){if(n.loadCell(C,u),u.hasExtendedAttrs()&&u.extended.urlId)if(g===-1){g=C,v=u.extended.urlId;continue}else _=u.extended.urlId!==v;else g!==-1&&(_=!0);if(_||g!==-1&&C===f-1){let y=this._oscLinkService.getLinkData(v)?.uri;if(y){let x={start:{x:g+1,y:t},end:{x:C+(!_&&C===f-1?1:0),y:t}},A=!1;if(!h?.allowNonHttpProtocols)try{let D=new URL(y);["http:","https:"].includes(D.protocol)||(A=!0)}catch{A=!0}A||a.push({text:y,range:x,activate:(D,k)=>h?h.activate(D,k,x):f0(D,k),hover:(D,k)=>h?.hover?.(D,k,x),leave:(D,k)=>h?.leave?.(D,k,x)})}_=!1,u.hasExtendedAttrs()&&u.extended.urlId?(g=C,v=u.extended.urlId):(g=-1,v=-1)}}s(a)}};Rc=Ze([I(0,Mt),I(1,Bt),I(2,Hg)],Rc);function f0(t,s){if(confirm(`Do you want to navigate to ${s}?
10
+
11
+ WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=s}else console.warn("Opening link blocked as opener could not be cleared")}}var Ka=gt("CharSizeService"),Qi=gt("CoreBrowserService"),du=gt("MouseService"),Ii=gt("RenderService"),d0=gt("SelectionService"),Ug=gt("CharacterJoinerService"),Wr=gt("ThemeService"),qg=gt("LinkProviderService"),_0=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?Hv.isErrorNoTelemetry(t)?new Hv(t.message+`
12
+
13
+ `+t.stack):new Error(t.message+`
14
+
15
+ `+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(s=>{s(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},v0=new _0;function Ba(t){g0(t)||v0.onUnexpectedError(t)}var kc="Canceled";function g0(t){return t instanceof m0?!0:t instanceof Error&&t.name===kc&&t.message===kc}var m0=class extends Error{constructor(){super(kc),this.name=this.message}};function p0(t){return new Error(`Illegal argument: ${t}`)}var Hv=class Oc extends Error{constructor(s){super(s),this.name="CodeExpectedError"}static fromError(s){if(s instanceof Oc)return s;let n=new Oc;return n.message=s.message,n.stack=s.stack,n}static isErrorNoTelemetry(s){return s.name==="CodeExpectedError"}},Lc=class jg extends Error{constructor(s){super(s||"An unexpected bug occurred."),Object.setPrototypeOf(this,jg.prototype)}};function Ft(t,s=0){return t[t.length-(1+s)]}var S0;(t=>{function s(u){return u<0}t.isLessThan=s;function n(u){return u<=0}t.isLessThanOrEqual=n;function a(u){return u>0}t.isGreaterThan=a;function h(u){return u===0}t.isNeitherLessOrGreaterThan=h,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(S0||={});function y0(t,s){let n=this,a=!1,h;return function(){return a||(a=!0,s||(h=t.apply(n,arguments))),h}}var Yg;(t=>{function s(Z){return Z&&typeof Z=="object"&&typeof Z[Symbol.iterator]=="function"}t.is=s;let n=Object.freeze([]);function a(){return n}t.empty=a;function*h(Z){yield Z}t.single=h;function u(Z){return s(Z)?Z:h(Z)}t.wrap=u;function f(Z){return Z||n}t.from=f;function*v(Z){for(let ee=Z.length-1;ee>=0;ee--)yield Z[ee]}t.reverse=v;function g(Z){return!Z||Z[Symbol.iterator]().next().done===!0}t.isEmpty=g;function _(Z){return Z[Symbol.iterator]().next().value}t.first=_;function C(Z,ee){let se=0;for(let ie of Z)if(ee(ie,se++))return!0;return!1}t.some=C;function y(Z,ee){for(let se of Z)if(ee(se))return se}t.find=y;function*x(Z,ee){for(let se of Z)ee(se)&&(yield se)}t.filter=x;function*A(Z,ee){let se=0;for(let ie of Z)yield ee(ie,se++)}t.map=A;function*D(Z,ee){let se=0;for(let ie of Z)yield*ee(ie,se++)}t.flatMap=D;function*k(...Z){for(let ee of Z)yield*ee}t.concat=k;function G(Z,ee,se){let ie=se;for(let Ae of Z)ie=ee(ie,Ae);return ie}t.reduce=G;function*Q(Z,ee,se=Z.length){for(ee<0&&(ee+=Z.length),se<0?se+=Z.length:se>Z.length&&(se=Z.length);ee<se;ee++)yield Z[ee]}t.slice=Q;function ve(Z,ee=Number.POSITIVE_INFINITY){let se=[];if(ee===0)return[se,Z];let ie=Z[Symbol.iterator]();for(let Ae=0;Ae<ee;Ae++){let Ye=ie.next();if(Ye.done)return[se,t.empty()];se.push(Ye.value)}return[se,{[Symbol.iterator](){return ie}}]}t.consume=ve;async function J(Z){let ee=[];for await(let se of Z)ee.push(se);return Promise.resolve(ee)}t.asyncToArray=J})(Yg||={});function $s(t){if(Yg.is(t)){let s=[];for(let n of t)if(n)try{n.dispose()}catch(a){s.push(a)}if(s.length===1)throw s[0];if(s.length>1)throw new AggregateError(s,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function b0(...t){return We(()=>$s(t))}function We(t){return{dispose:y0(()=>{t()})}}var Kg=class Wg{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{$s(this._toDispose)}finally{this._toDispose.clear()}}add(s){if(!s)return s;if(s===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Wg.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(s),s}delete(s){if(s){if(s===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(s),s.dispose()}}deleteAndLeak(s){s&&this._toDispose.has(s)&&(this._toDispose.delete(s),void 0)}};Kg.DISABLE_DISPOSED_WARNING=!1;var Ms=Kg,pe=class{constructor(){this._store=new Ms,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)}};pe.None=Object.freeze({dispose(){}});var Kr=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){this._isDisposed||t===this._value||(this._value?.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t}},Zi=typeof window=="object"?window:globalThis,zc=class Nc{constructor(s){this.element=s,this.next=Nc.Undefined,this.prev=Nc.Undefined}};zc.Undefined=new zc(void 0);var Ve=zc,Uv=class{constructor(){this._first=Ve.Undefined,this._last=Ve.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Ve.Undefined}clear(){let t=this._first;for(;t!==Ve.Undefined;){let s=t.next;t.prev=Ve.Undefined,t.next=Ve.Undefined,t=s}this._first=Ve.Undefined,this._last=Ve.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}_insert(t,s){let n=new Ve(t);if(this._first===Ve.Undefined)this._first=n,this._last=n;else if(s){let h=this._last;this._last=n,n.prev=h,h.next=n}else{let h=this._first;this._first=n,n.next=h,h.prev=n}this._size+=1;let a=!1;return()=>{a||(a=!0,this._remove(n))}}shift(){if(this._first!==Ve.Undefined){let t=this._first.element;return this._remove(this._first),t}}pop(){if(this._last!==Ve.Undefined){let t=this._last.element;return this._remove(this._last),t}}_remove(t){if(t.prev!==Ve.Undefined&&t.next!==Ve.Undefined){let s=t.prev;s.next=t.next,t.next.prev=s}else t.prev===Ve.Undefined&&t.next===Ve.Undefined?(this._first=Ve.Undefined,this._last=Ve.Undefined):t.next===Ve.Undefined?(this._last=this._last.prev,this._last.next=Ve.Undefined):t.prev===Ve.Undefined&&(this._first=this._first.next,this._first.prev=Ve.Undefined);this._size-=1}*[Symbol.iterator](){let t=this._first;for(;t!==Ve.Undefined;)yield t.element,t=t.next}},C0=globalThis.performance&&typeof globalThis.performance.now=="function",w0=class Vg{static create(s){return new Vg(s)}constructor(s){this._now=C0&&s===!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}},wt;(t=>{t.None=()=>pe.None;function s(P,j){return y(P,()=>{},0,void 0,!0,void 0,j)}t.defer=s;function n(P){return(j,F=null,W)=>{let w=!1,z;return z=P(N=>{if(!w)return z?z.dispose():w=!0,j.call(F,N)},null,W),w&&z.dispose(),z}}t.once=n;function a(P,j,F){return _((W,w=null,z)=>P(N=>W.call(w,j(N)),null,z),F)}t.map=a;function h(P,j,F){return _((W,w=null,z)=>P(N=>{j(N),W.call(w,N)},null,z),F)}t.forEach=h;function u(P,j,F){return _((W,w=null,z)=>P(N=>j(N)&&W.call(w,N),null,z),F)}t.filter=u;function f(P){return P}t.signal=f;function v(...P){return(j,F=null,W)=>{let w=b0(...P.map(z=>z(N=>j.call(F,N))));return C(w,W)}}t.any=v;function g(P,j,F,W){let w=F;return a(P,z=>(w=j(w,z),w),W)}t.reduce=g;function _(P,j){let F,W={onWillAddFirstListener(){F=P(w.fire,w)},onDidRemoveLastListener(){F?.dispose()}},w=new X(W);return j?.add(w),w.event}function C(P,j){return j instanceof Array?j.push(P):j&&j.add(P),P}function y(P,j,F=100,W=!1,w=!1,z,N){let re,he,p,R=0,Y,V={leakWarningThreshold:z,onWillAddFirstListener(){re=P(oe=>{R++,he=j(he,oe),W&&!p&&(le.fire(he),he=void 0),Y=()=>{let Se=he;he=void 0,p=void 0,(!W||R>1)&&le.fire(Se),R=0},typeof F=="number"?(clearTimeout(p),p=setTimeout(Y,F)):p===void 0&&(p=0,queueMicrotask(Y))})},onWillRemoveListener(){w&&R>0&&Y?.()},onDidRemoveLastListener(){Y=void 0,re.dispose()}},le=new X(V);return N?.add(le),le.event}t.debounce=y;function x(P,j=0,F){return t.debounce(P,(W,w)=>W?(W.push(w),W):[w],j,void 0,!0,void 0,F)}t.accumulate=x;function A(P,j=(W,w)=>W===w,F){let W=!0,w;return u(P,z=>{let N=W||!j(z,w);return W=!1,w=z,N},F)}t.latch=A;function D(P,j,F){return[t.filter(P,j,F),t.filter(P,W=>!j(W),F)]}t.split=D;function k(P,j=!1,F=[],W){let w=F.slice(),z=P(he=>{w?w.push(he):re.fire(he)});W&&W.add(z);let N=()=>{w?.forEach(he=>re.fire(he)),w=null},re=new X({onWillAddFirstListener(){z||(z=P(he=>re.fire(he)),W&&W.add(z))},onDidAddFirstListener(){w&&(j?setTimeout(N):N())},onDidRemoveLastListener(){z&&z.dispose(),z=null}});return W&&W.add(re),re.event}t.buffer=k;function G(P,j){return(F,W,w)=>{let z=j(new ve);return P(function(N){let re=z.evaluate(N);re!==Q&&F.call(W,re)},void 0,w)}}t.chain=G;let Q=Symbol("HaltChainable");class ve{constructor(){this.steps=[]}map(j){return this.steps.push(j),this}forEach(j){return this.steps.push(F=>(j(F),F)),this}filter(j){return this.steps.push(F=>j(F)?F:Q),this}reduce(j,F){let W=F;return this.steps.push(w=>(W=j(W,w),W)),this}latch(j=(F,W)=>F===W){let F=!0,W;return this.steps.push(w=>{let z=F||!j(w,W);return F=!1,W=w,z?w:Q}),this}evaluate(j){for(let F of this.steps)if(j=F(j),j===Q)break;return j}}function J(P,j,F=W=>W){let W=(...re)=>N.fire(F(...re)),w=()=>P.on(j,W),z=()=>P.removeListener(j,W),N=new X({onWillAddFirstListener:w,onDidRemoveLastListener:z});return N.event}t.fromNodeEventEmitter=J;function Z(P,j,F=W=>W){let W=(...re)=>N.fire(F(...re)),w=()=>P.addEventListener(j,W),z=()=>P.removeEventListener(j,W),N=new X({onWillAddFirstListener:w,onDidRemoveLastListener:z});return N.event}t.fromDOMEventEmitter=Z;function ee(P){return new Promise(j=>n(P)(j))}t.toPromise=ee;function se(P){let j=new X;return P.then(F=>{j.fire(F)},()=>{j.fire(void 0)}).finally(()=>{j.dispose()}),j.event}t.fromPromise=se;function ie(P,j){return P(F=>j.fire(F))}t.forward=ie;function Ae(P,j,F){return j(F),P(W=>j(W))}t.runAndSubscribe=Ae;class Ye{constructor(j,F){this._observable=j,this._counter=0,this._hasChanged=!1;let W={onWillAddFirstListener:()=>{j.addObserver(this)},onDidRemoveLastListener:()=>{j.removeObserver(this)}};this.emitter=new X(W),F&&F.add(this.emitter)}beginUpdate(j){this._counter++}handlePossibleChange(j){}handleChange(j,F){this._hasChanged=!0}endUpdate(j){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function mt(P,j){return new Ye(P,j).emitter.event}t.fromObservable=mt;function de(P){return(j,F,W)=>{let w=0,z=!1,N={beginUpdate(){w++},endUpdate(){w--,w===0&&(P.reportChanges(),z&&(z=!1,j.call(F)))},handlePossibleChange(){},handleChange(){z=!0}};P.addObserver(N),P.reportChanges();let re={dispose(){P.removeObserver(N)}};return W instanceof Ms?W.add(re):Array.isArray(W)&&W.push(re),re}}t.fromObservableLight=de})(wt||={});var Hc=class Uc{constructor(s){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${s}_${Uc._idPool++}`,Uc.all.add(this)}start(s){this._stopWatch=new w0,this.listenerCount=s}stop(){if(this._stopWatch){let s=this._stopWatch.elapsed();this.durations.push(s),this.elapsedOverall+=s,this.invocationCount+=1,this._stopWatch=void 0}}};Hc.all=new Set,Hc._idPool=0;var E0=Hc,x0=-1,Xg=class Gg{constructor(s,n,a=(Gg._idPool++).toString(16).padStart(3,"0")){this._errorHandler=s,this.threshold=n,this.name=a,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(s,n){let a=this.threshold;if(a<=0||n<a)return;this._stacks||(this._stacks=new Map);let h=this._stacks.get(s.value)||0;if(this._stacks.set(s.value,h+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let[u,f]=this.getMostFrequentStack(),v=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${f}):`;console.warn(v),console.warn(u);let g=new M0(v,u);this._errorHandler(g)}return()=>{let u=this._stacks.get(s.value)||0;this._stacks.set(s.value,u-1)}}getMostFrequentStack(){if(!this._stacks)return;let s,n=0;for(let[a,h]of this._stacks)(!s||n<h)&&(s=[a,h],n=h);return s}};Xg._idPool=1;var D0=Xg,T0=class Pg{constructor(s){this.value=s}static create(){let s=new Error;return new Pg(s.stack??"")}print(){console.warn(this.value.split(`
16
+ `).slice(2).join(`
17
+ `))}},M0=class extends Error{constructor(t,s){super(t),this.name="ListenerLeakError",this.stack=s}},B0=class extends Error{constructor(t,s){super(t),this.name="ListenerRefusalError",this.stack=s}},A0=0,gc=class{constructor(t){this.value=t,this.id=A0++}},R0=2,k0,X=class{constructor(t){this._size=0,this._options=t,this._leakageMon=this._options?.leakWarningThreshold?new D0(t?.onListenerError??Ba,this._options?.leakWarningThreshold??x0):void 0,this._perfMon=this._options?._profName?new E0(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(t,s,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let f=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(f);let v=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],g=new B0(`${f}. HINT: Stack shows most frequent listener (${v[1]}-times)`,v[0]);return(this._options?.onListenerError||Ba)(g),pe.None}if(this._disposed)return pe.None;s&&(t=t.bind(s));let a=new gc(t),h;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(a.stack=T0.create(),h=this._leakageMon.check(a.stack,this._size+1)),this._listeners?this._listeners instanceof gc?(this._deliveryQueue??=new O0,this._listeners=[this._listeners,a]):this._listeners.push(a):(this._options?.onWillAddFirstListener?.(this),this._listeners=a,this._options?.onDidAddFirstListener?.(this)),this._size++;let u=We(()=>{h?.(),this._removeListener(a)});return n instanceof Ms?n.add(u):Array.isArray(n)&&n.push(u),u},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let s=this._listeners,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*R0<=s.length){let h=0;for(let u=0;u<s.length;u++)s[u]?s[h++]=s[u]:a&&(this._deliveryQueue.end--,h<this._deliveryQueue.i&&this._deliveryQueue.i--);s.length=h}}_deliver(t,s){if(!t)return;let n=this._options?.onListenerError||Ba;if(!n){t.value(s);return}try{t.value(s)}catch(a){n(a)}}_deliverQueue(t){let s=t.current._listeners;for(;t.i<t.end;)this._deliver(s[t.i++],t.value);t.reset()}fire(t){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof gc)this._deliver(this._listeners,t);else{let s=this._deliveryQueue;s.enqueue(this,t,this._listeners.length),this._deliverQueue(s)}this._perfMon?.stop()}hasListeners(){return this._size>0}},O0=class{constructor(){this.i=-1,this.end=0}enqueue(t,s,n){this.i=0,this.end=n,this.current=t,this.value=s}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},qc=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new X,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new X,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(s){return this.mapWindowIdToZoomLevel.get(this.getWindowId(s))??0}setZoomLevel(s,n){if(this.getZoomLevel(n)===s)return;let a=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(a,s),this._onDidChangeZoomLevel.fire(a)}getZoomFactor(s){return this.mapWindowIdToZoomFactor.get(this.getWindowId(s))??1}setZoomFactor(s,n){this.mapWindowIdToZoomFactor.set(this.getWindowId(n),s)}setFullscreen(s,n){if(this.isFullscreen(n)===s)return;let a=this.getWindowId(n);this.mapWindowIdToFullScreen.set(a,s),this._onDidChangeFullscreen.fire(a)}isFullscreen(s){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(s))}getWindowId(s){return s.vscodeWindowId}};qc.INSTANCE=new qc;var _u=qc;function L0(t,s,n){typeof s=="string"&&(s=t.matchMedia(s)),s.addEventListener("change",n)}_u.INSTANCE.onDidChangeZoomLevel;function z0(t){return _u.INSTANCE.getZoomFactor(t)}_u.INSTANCE.onDidChangeFullscreen;var Vr=typeof navigator=="object"?navigator.userAgent:"",jc=Vr.indexOf("Firefox")>=0,N0=Vr.indexOf("AppleWebKit")>=0,vu=Vr.indexOf("Chrome")>=0,H0=!vu&&Vr.indexOf("Safari")>=0;Vr.indexOf("Electron/")>=0;Vr.indexOf("Android")>=0;var mc=!1;if(typeof Zi.matchMedia=="function"){let t=Zi.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),s=Zi.matchMedia("(display-mode: fullscreen)");mc=t.matches,L0(Zi,t,({matches:n})=>{mc&&s.matches||(mc=n)})}var Yr="en",Yc=!1,Kc=!1,Aa=!1,Fg=!1,wa,Ra=Yr,qv=Yr,U0,Fi,Is=globalThis,Qt;typeof Is.vscode<"u"&&typeof Is.vscode.process<"u"?Qt=Is.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Qt=process);var q0=typeof Qt?.versions?.electron=="string",j0=q0&&Qt?.type==="renderer";if(typeof Qt=="object"){Yc=Qt.platform==="win32",Kc=Qt.platform==="darwin",Aa=Qt.platform==="linux",Aa&&Qt.env.SNAP&&Qt.env.SNAP_REVISION,Qt.env.CI||Qt.env.BUILD_ARTIFACTSTAGINGDIRECTORY,wa=Yr,Ra=Yr;let t=Qt.env.VSCODE_NLS_CONFIG;if(t)try{let s=JSON.parse(t);wa=s.userLocale,qv=s.osLocale,Ra=s.resolvedLanguage||Yr,U0=s.languagePack?.translationsConfigFile}catch{}Fg=!0}else typeof navigator=="object"&&!j0?(Fi=navigator.userAgent,Yc=Fi.indexOf("Windows")>=0,Kc=Fi.indexOf("Macintosh")>=0,(Fi.indexOf("Macintosh")>=0||Fi.indexOf("iPad")>=0||Fi.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Aa=Fi.indexOf("Linux")>=0,Fi?.indexOf("Mobi")>=0,Ra=globalThis._VSCODE_NLS_LANGUAGE||Yr,wa=navigator.language.toLowerCase(),qv=wa):console.error("Unable to resolve platform.");var Zg=Yc,Ti=Kc,Y0=Aa,jv=Fg,Mi=Fi,ws=Ra,K0;(t=>{function s(){return ws}t.value=s;function n(){return ws.length===2?ws==="en":ws.length>=3?ws[0]==="e"&&ws[1]==="n"&&ws[2]==="-":!1}t.isDefaultVariant=n;function a(){return ws==="en"}t.isDefault=a})(K0||={});var W0=typeof Is.postMessage=="function"&&!Is.importScripts;(()=>{if(W0){let t=[];Is.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let a=0,h=t.length;a<h;a++){let u=t[a];if(u.id===n.data.vscodeScheduleAsyncWork){t.splice(a,1),u.callback();return}}});let s=0;return n=>{let a=++s;t.push({id:a,callback:n}),Is.postMessage({vscodeScheduleAsyncWork:a},"*")}}return t=>setTimeout(t)})();var V0=!!(Mi&&Mi.indexOf("Chrome")>=0);Mi&&Mi.indexOf("Firefox")>=0;!V0&&Mi&&Mi.indexOf("Safari")>=0;Mi&&Mi.indexOf("Edg/")>=0;Mi&&Mi.indexOf("Android")>=0;var qr=typeof navigator=="object"?navigator:{};jv||document.queryCommandSupported&&document.queryCommandSupported("copy")||qr&&qr.clipboard&&qr.clipboard.writeText,jv||qr&&qr.clipboard&&qr.clipboard.readText;var gu=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(t,s){this._keyCodeToStr[t]=s,this._strToKeyCode[s.toLowerCase()]=t}keyCodeToStr(t){return this._keyCodeToStr[t]}strToKeyCode(t){return this._strToKeyCode[t.toLowerCase()]||0}},pc=new gu,Yv=new gu,Kv=new gu,X0=new Array(230),Qg;(t=>{function s(v){return pc.keyCodeToStr(v)}t.toString=s;function n(v){return pc.strToKeyCode(v)}t.fromString=n;function a(v){return Yv.keyCodeToStr(v)}t.toUserSettingsUS=a;function h(v){return Kv.keyCodeToStr(v)}t.toUserSettingsGeneral=h;function u(v){return Yv.strToKeyCode(v)||Kv.strToKeyCode(v)}t.fromUserSettings=u;function f(v){if(v>=98&&v<=113)return null;switch(v){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return pc.keyCodeToStr(v)}t.toElectronAccelerator=f})(Qg||={});var G0=class Ig{constructor(s,n,a,h,u){this.ctrlKey=s,this.shiftKey=n,this.altKey=a,this.metaKey=h,this.keyCode=u}equals(s){return s instanceof Ig&&this.ctrlKey===s.ctrlKey&&this.shiftKey===s.shiftKey&&this.altKey===s.altKey&&this.metaKey===s.metaKey&&this.keyCode===s.keyCode}getHashCode(){let s=this.ctrlKey?"1":"0",n=this.shiftKey?"1":"0",a=this.altKey?"1":"0",h=this.metaKey?"1":"0";return`K${s}${n}${a}${h}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new P0([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},P0=class{constructor(t){if(t.length===0)throw p0("chords");this.chords=t}getHashCode(){let t="";for(let s=0,n=this.chords.length;s<n;s++)s!==0&&(t+=";"),t+=this.chords[s].getHashCode();return t}equals(t){if(t===null||this.chords.length!==t.chords.length)return!1;for(let s=0;s<this.chords.length;s++)if(!this.chords[s].equals(t.chords[s]))return!1;return!0}};function F0(t){if(t.charCode){let n=String.fromCharCode(t.charCode).toUpperCase();return Qg.fromString(n)}let s=t.keyCode;if(s===3)return 7;if(jc)switch(s){case 59:return 85;case 60:if(Y0)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Ti)return 57;break}else if(N0&&(Ti&&s===93||!Ti&&s===92))return 57;return X0[s]||0}var Z0=Ti?256:2048,Q0=512,I0=1024,$0=Ti?2048:256,Wv=class{constructor(t){this._standardKeyboardEventBrand=!0;let s=t;this.browserEvent=s,this.target=s.target,this.ctrlKey=s.ctrlKey,this.shiftKey=s.shiftKey,this.altKey=s.altKey,this.metaKey=s.metaKey,this.altGraphKey=s.getModifierState?.("AltGraph"),this.keyCode=F0(s),this.code=s.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(t){return this._asKeybinding===t}_computeKeybinding(){let t=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(t=this.keyCode);let s=0;return this.ctrlKey&&(s|=Z0),this.altKey&&(s|=Q0),this.shiftKey&&(s|=I0),this.metaKey&&(s|=$0),s|=t,s}_computeKeyCodeChord(){let t=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(t=this.keyCode),new G0(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,t)}},Vv=new WeakMap;function J0(t){if(!t.parent||t.parent===t)return null;try{let s=t.location,n=t.parent.location;if(s.origin!=="null"&&n.origin!=="null"&&s.origin!==n.origin)return null}catch{return null}return t.parent}var ey=class{static getSameOriginWindowChain(t){let s=Vv.get(t);if(!s){s=[],Vv.set(t,s);let n=t,a;do a=J0(n),a?s.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):s.push({window:new WeakRef(n),iframeElement:null}),n=a;while(n)}return s.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(t,s){if(!s||t===s)return{top:0,left:0};let n=0,a=0,h=this.getSameOriginWindowChain(t);for(let u of h){let f=u.window.deref();if(n+=f?.scrollY??0,a+=f?.scrollX??0,f===s||!u.iframeElement)break;let v=u.iframeElement.getBoundingClientRect();n+=v.top,a+=v.left}return{top:n,left:a}}},Ea=class{constructor(t,s){this.timestamp=Date.now(),this.browserEvent=s,this.leftButton=s.button===0,this.middleButton=s.button===1,this.rightButton=s.button===2,this.buttons=s.buttons,this.target=s.target,this.detail=s.detail||1,s.type==="dblclick"&&(this.detail=2),this.ctrlKey=s.ctrlKey,this.shiftKey=s.shiftKey,this.altKey=s.altKey,this.metaKey=s.metaKey,typeof s.pageX=="number"?(this.posx=s.pageX,this.posy=s.pageY):(this.posx=s.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=s.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=ey.getPositionOfChildWindowRelativeToAncestorWindow(t,s.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Xv=class{constructor(t,s=0,n=0){this.browserEvent=t||null,this.target=t?t.target||t.targetNode||t.srcElement:null,this.deltaY=n,this.deltaX=s;let a=!1;if(vu){let h=navigator.userAgent.match(/Chrome\/(\d+)/);a=(h?parseInt(h[1]):123)<=122}if(t){let h=t,u=t,f=t.view?.devicePixelRatio||1;if(typeof h.wheelDeltaY<"u")a?this.deltaY=h.wheelDeltaY/(120*f):this.deltaY=h.wheelDeltaY/120;else if(typeof u.VERTICAL_AXIS<"u"&&u.axis===u.VERTICAL_AXIS)this.deltaY=-u.detail/3;else if(t.type==="wheel"){let v=t;v.deltaMode===v.DOM_DELTA_LINE?jc&&!Ti?this.deltaY=-t.deltaY/3:this.deltaY=-t.deltaY:this.deltaY=-t.deltaY/40}if(typeof h.wheelDeltaX<"u")H0&&Zg?this.deltaX=-(h.wheelDeltaX/120):a?this.deltaX=h.wheelDeltaX/(120*f):this.deltaX=h.wheelDeltaX/120;else if(typeof u.HORIZONTAL_AXIS<"u"&&u.axis===u.HORIZONTAL_AXIS)this.deltaX=-t.detail/3;else if(t.type==="wheel"){let v=t;v.deltaMode===v.DOM_DELTA_LINE?jc&&!Ti?this.deltaX=-t.deltaX/3:this.deltaX=-t.deltaX:this.deltaX=-t.deltaX/40}this.deltaY===0&&this.deltaX===0&&t.wheelDelta&&(a?this.deltaY=t.wheelDelta/(120*f):this.deltaY=t.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},$g=Object.freeze(function(t,s){let n=setTimeout(t.bind(s),0);return{dispose(){clearTimeout(n)}}}),ty;(t=>{function s(n){return n===t.None||n===t.Cancelled||n instanceof iy?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}t.isCancellationToken=s,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:wt.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:$g})})(ty||={});var iy=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?$g:(this._emitter||(this._emitter=new X),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},mu=class{constructor(t,s){this._isDisposed=!1,this._token=-1,typeof t=="function"&&typeof s=="number"&&this.setIfNotSet(t,s)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(t,s){if(this._isDisposed)throw new Lc("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,t()},s)}setIfNotSet(t,s){if(this._isDisposed)throw new Lc("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,t()},s))}},sy=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(t,s,n=globalThis){if(this.isDisposed)throw new Lc("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let a=n.setInterval(()=>{t()},s);this.disposable=We(()=>{n.clearInterval(a),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},ry;(t=>{async function s(a){let h,u=await Promise.all(a.map(f=>f.then(v=>v,v=>{h||(h=v)})));if(typeof h<"u")throw h;return u}t.settled=s;function n(a){return new Promise(async(h,u)=>{try{await a(h,u)}catch(f){u(f)}})}t.withAsyncBody=n})(ry||={});var Gv=class hi{static fromArray(s){return new hi(n=>{n.emitMany(s)})}static fromPromise(s){return new hi(async n=>{n.emitMany(await s)})}static fromPromises(s){return new hi(async n=>{await Promise.all(s.map(async a=>n.emitOne(await a)))})}static merge(s){return new hi(async n=>{await Promise.all(s.map(async a=>{for await(let h of a)n.emitOne(h)}))})}constructor(s,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new X,queueMicrotask(async()=>{let a={emitOne:h=>this.emitOne(h),emitMany:h=>this.emitMany(h),reject:h=>this.reject(h)};try{await Promise.resolve(s(a)),this.resolve()}catch(h){this.reject(h)}finally{a.emitOne=void 0,a.emitMany=void 0,a.reject=void 0}})}[Symbol.asyncIterator](){let s=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(s<this._results.length)return{done:!1,value:this._results[s++]};if(this._state===1)return{done:!0,value:void 0};await wt.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(s,n){return new hi(async a=>{for await(let h of s)a.emitOne(n(h))})}map(s){return hi.map(this,s)}static filter(s,n){return new hi(async a=>{for await(let h of s)n(h)&&a.emitOne(h)})}filter(s){return hi.filter(this,s)}static coalesce(s){return hi.filter(s,n=>!!n)}coalesce(){return hi.coalesce(this)}static async toPromise(s){let n=[];for await(let a of s)n.push(a);return n}toPromise(){return hi.toPromise(this)}emitOne(s){this._state===0&&(this._results.push(s),this._onStateChanged.fire())}emitMany(s){this._state===0&&(this._results=this._results.concat(s),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(s){this._state===0&&(this._state=2,this._error=s,this._onStateChanged.fire())}};Gv.EMPTY=Gv.fromArray([]);var{getWindow:Di,getWindowId:ny,onDidRegisterWindow:ly}=(function(){let t=new Map,s={window:Zi,disposables:new Ms};t.set(Zi.vscodeWindowId,s);let n=new X,a=new X,h=new X;function u(f,v){return(typeof f=="number"?t.get(f):void 0)??(v?s:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:h.event,onDidUnregisterWindow:a.event,registerWindow(f){if(t.has(f.vscodeWindowId))return pe.None;let v=new Ms,g={window:f,disposables:v.add(new Ms)};return t.set(f.vscodeWindowId,g),v.add(We(()=>{t.delete(f.vscodeWindowId),a.fire(f)})),v.add(ce(f,ft.BEFORE_UNLOAD,()=>{h.fire(f)})),n.fire(g),v},getWindows(){return t.values()},getWindowsCount(){return t.size},getWindowId(f){return f.vscodeWindowId},hasWindow(f){return t.has(f)},getWindowById:u,getWindow(f){let v=f;if(v?.ownerDocument?.defaultView)return v.ownerDocument.defaultView.window;let g=f;return g?.view?g.view.window:Zi},getDocument(f){return Di(f).document}}})(),ay=class{constructor(t,s,n,a){this._node=t,this._type=s,this._handler=n,this._options=a||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function ce(t,s,n,a){return new ay(t,s,n,a)}var Pv=function(t,s,n,a){return ce(t,s,n,a)},pu,oy=class extends sy{constructor(t){super(),this.defaultTarget=t&&Di(t)}cancelAndSet(t,s,n){return super.cancelAndSet(t,s,n??this.defaultTarget)}},Fv=class{constructor(t,s=0){this._runner=t,this.priority=s,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(t){Ba(t)}}static sort(t,s){return s.priority-t.priority}};(function(){let t=new Map,s=new Map,n=new Map,a=new Map,h=u=>{n.set(u,!1);let f=t.get(u)??[];for(s.set(u,f),t.set(u,[]),a.set(u,!0);f.length>0;)f.sort(Fv.sort),f.shift().execute();a.set(u,!1)};pu=(u,f,v=0)=>{let g=ny(u),_=new Fv(f,v),C=t.get(g);return C||(C=[],t.set(g,C)),C.push(_),n.get(g)||(n.set(g,!0),u.requestAnimationFrame(()=>h(g))),_}})();function hy(t){let s=t.getBoundingClientRect(),n=Di(t);return{left:s.left+n.scrollX,top:s.top+n.scrollY,width:s.width,height:s.height}}var ft={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"},cy=class{constructor(t){this.domNode=t,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(t){let s=Ht(t);this._maxWidth!==s&&(this._maxWidth=s,this.domNode.style.maxWidth=this._maxWidth)}setWidth(t){let s=Ht(t);this._width!==s&&(this._width=s,this.domNode.style.width=this._width)}setHeight(t){let s=Ht(t);this._height!==s&&(this._height=s,this.domNode.style.height=this._height)}setTop(t){let s=Ht(t);this._top!==s&&(this._top=s,this.domNode.style.top=this._top)}setLeft(t){let s=Ht(t);this._left!==s&&(this._left=s,this.domNode.style.left=this._left)}setBottom(t){let s=Ht(t);this._bottom!==s&&(this._bottom=s,this.domNode.style.bottom=this._bottom)}setRight(t){let s=Ht(t);this._right!==s&&(this._right=s,this.domNode.style.right=this._right)}setPaddingTop(t){let s=Ht(t);this._paddingTop!==s&&(this._paddingTop=s,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(t){let s=Ht(t);this._paddingLeft!==s&&(this._paddingLeft=s,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(t){let s=Ht(t);this._paddingBottom!==s&&(this._paddingBottom=s,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(t){let s=Ht(t);this._paddingRight!==s&&(this._paddingRight=s,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(t){this._fontFamily!==t&&(this._fontFamily=t,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(t){let s=Ht(t);this._fontSize!==s&&(this._fontSize=s,this.domNode.style.fontSize=this._fontSize)}setFontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(t){this._fontFeatureSettings!==t&&(this._fontFeatureSettings=t,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(t){this._fontVariationSettings!==t&&(this._fontVariationSettings=t,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(t){this._textDecoration!==t&&(this._textDecoration=t,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(t){let s=Ht(t);this._lineHeight!==s&&(this._lineHeight=s,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(t){let s=Ht(t);this._letterSpacing!==s&&(this._letterSpacing=s,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(t){this._className!==t&&(this._className=t,this.domNode.className=this._className)}toggleClassName(t,s){this.domNode.classList.toggle(t,s),this._className=this.domNode.className}setDisplay(t){this._display!==t&&(this._display=t,this.domNode.style.display=this._display)}setPosition(t){this._position!==t&&(this._position=t,this.domNode.style.position=this._position)}setVisibility(t){this._visibility!==t&&(this._visibility=t,this.domNode.style.visibility=this._visibility)}setColor(t){this._color!==t&&(this._color=t,this.domNode.style.color=this._color)}setBackgroundColor(t){this._backgroundColor!==t&&(this._backgroundColor=t,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(t){this._layerHint!==t&&(this._layerHint=t,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(t){this._boxShadow!==t&&(this._boxShadow=t,this.domNode.style.boxShadow=t)}setContain(t){this._contain!==t&&(this._contain=t,this.domNode.style.contain=this._contain)}setAttribute(t,s){this.domNode.setAttribute(t,s)}removeAttribute(t){this.domNode.removeAttribute(t)}appendChild(t){this.domNode.appendChild(t.domNode)}removeChild(t){this.domNode.removeChild(t.domNode)}};function Ht(t){return typeof t=="number"?`${t}px`:t}function $n(t){return new cy(t)}var Jg=class{constructor(){this._hooks=new Ms,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(t,s){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,t&&n&&n(s)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(t,s,n,a,h){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=a,this._onStopCallback=h;let u=t;try{t.setPointerCapture(s),this._hooks.add(We(()=>{try{t.releasePointerCapture(s)}catch{}}))}catch{u=Di(t)}this._hooks.add(ce(u,ft.POINTER_MOVE,f=>{if(f.buttons!==n){this.stopMonitoring(!0);return}f.preventDefault(),this._pointerMoveCallback(f)})),this._hooks.add(ce(u,ft.POINTER_UP,f=>this.stopMonitoring(!0)))}};function uy(t,s,n){let a=null,h=null;if(typeof n.value=="function"?(a="value",h=n.value,h.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(a="get",h=n.get),!h)throw new Error("not supported");let u=`$memoize$${s}`;n[a]=function(...f){return this.hasOwnProperty(u)||Object.defineProperty(this,u,{configurable:!1,enumerable:!1,writable:!1,value:h.apply(this,f)}),this[u]}}var xi;(t=>(t.Tap="-xterm-gesturetap",t.Change="-xterm-gesturechange",t.Start="-xterm-gesturestart",t.End="-xterm-gesturesend",t.Contextmenu="-xterm-gesturecontextmenu"))(xi||={});var Pn=class xt extends pe{constructor(){super(),this.dispatched=!1,this.targets=new Uv,this.ignoreTargets=new Uv,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(wt.runAndSubscribe(ly,({window:s,disposables:n})=>{n.add(ce(s.document,"touchstart",a=>this.onTouchStart(a),{passive:!1})),n.add(ce(s.document,"touchend",a=>this.onTouchEnd(s,a))),n.add(ce(s.document,"touchmove",a=>this.onTouchMove(a),{passive:!1}))},{window:Zi,disposables:this._store}))}static addTarget(s){if(!xt.isTouchDevice())return pe.None;xt.INSTANCE||(xt.INSTANCE=new xt);let n=xt.INSTANCE.targets.push(s);return We(n)}static ignoreTarget(s){if(!xt.isTouchDevice())return pe.None;xt.INSTANCE||(xt.INSTANCE=new xt);let n=xt.INSTANCE.ignoreTargets.push(s);return We(n)}static isTouchDevice(){return"ontouchstart"in Zi||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(s){let n=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let a=0,h=s.targetTouches.length;a<h;a++){let u=s.targetTouches.item(a);this.activeTouches[u.identifier]={id:u.identifier,initialTarget:u.target,initialTimeStamp:n,initialPageX:u.pageX,initialPageY:u.pageY,rollingTimestamps:[n],rollingPageX:[u.pageX],rollingPageY:[u.pageY]};let f=this.newGestureEvent(xi.Start,u.target);f.pageX=u.pageX,f.pageY=u.pageY,this.dispatchEvent(f)}this.dispatched&&(s.preventDefault(),s.stopPropagation(),this.dispatched=!1)}onTouchEnd(s,n){let a=Date.now(),h=Object.keys(this.activeTouches).length;for(let u=0,f=n.changedTouches.length;u<f;u++){let v=n.changedTouches.item(u);if(!this.activeTouches.hasOwnProperty(String(v.identifier))){console.warn("move of an UNKNOWN touch",v);continue}let g=this.activeTouches[v.identifier],_=Date.now()-g.initialTimeStamp;if(_<xt.HOLD_DELAY&&Math.abs(g.initialPageX-Ft(g.rollingPageX))<30&&Math.abs(g.initialPageY-Ft(g.rollingPageY))<30){let C=this.newGestureEvent(xi.Tap,g.initialTarget);C.pageX=Ft(g.rollingPageX),C.pageY=Ft(g.rollingPageY),this.dispatchEvent(C)}else if(_>=xt.HOLD_DELAY&&Math.abs(g.initialPageX-Ft(g.rollingPageX))<30&&Math.abs(g.initialPageY-Ft(g.rollingPageY))<30){let C=this.newGestureEvent(xi.Contextmenu,g.initialTarget);C.pageX=Ft(g.rollingPageX),C.pageY=Ft(g.rollingPageY),this.dispatchEvent(C)}else if(h===1){let C=Ft(g.rollingPageX),y=Ft(g.rollingPageY),x=Ft(g.rollingTimestamps)-g.rollingTimestamps[0],A=C-g.rollingPageX[0],D=y-g.rollingPageY[0],k=[...this.targets].filter(G=>g.initialTarget instanceof Node&&G.contains(g.initialTarget));this.inertia(s,k,a,Math.abs(A)/x,A>0?1:-1,C,Math.abs(D)/x,D>0?1:-1,y)}this.dispatchEvent(this.newGestureEvent(xi.End,g.initialTarget)),delete this.activeTouches[v.identifier]}this.dispatched&&(n.preventDefault(),n.stopPropagation(),this.dispatched=!1)}newGestureEvent(s,n){let a=document.createEvent("CustomEvent");return a.initEvent(s,!1,!0),a.initialTarget=n,a.tapCount=0,a}dispatchEvent(s){if(s.type===xi.Tap){let n=new Date().getTime(),a=0;n-this._lastSetTapCountTime>xt.CLEAR_TAP_COUNT_TIME?a=1:a=2,this._lastSetTapCountTime=n,s.tapCount=a}else(s.type===xi.Change||s.type===xi.Contextmenu)&&(this._lastSetTapCountTime=0);if(s.initialTarget instanceof Node){for(let a of this.ignoreTargets)if(a.contains(s.initialTarget))return;let n=[];for(let a of this.targets)if(a.contains(s.initialTarget)){let h=0,u=s.initialTarget;for(;u&&u!==a;)h++,u=u.parentElement;n.push([h,a])}n.sort((a,h)=>a[0]-h[0]);for(let[a,h]of n)h.dispatchEvent(s),this.dispatched=!0}}inertia(s,n,a,h,u,f,v,g,_){this.handle=pu(s,()=>{let C=Date.now(),y=C-a,x=0,A=0,D=!0;h+=xt.SCROLL_FRICTION*y,v+=xt.SCROLL_FRICTION*y,h>0&&(D=!1,x=u*h*y),v>0&&(D=!1,A=g*v*y);let k=this.newGestureEvent(xi.Change);k.translationX=x,k.translationY=A,n.forEach(G=>G.dispatchEvent(k)),D||this.inertia(s,n,C,h,u,f+x,v,g,_+A)})}onTouchMove(s){let n=Date.now();for(let a=0,h=s.changedTouches.length;a<h;a++){let u=s.changedTouches.item(a);if(!this.activeTouches.hasOwnProperty(String(u.identifier))){console.warn("end of an UNKNOWN touch",u);continue}let f=this.activeTouches[u.identifier],v=this.newGestureEvent(xi.Change,f.initialTarget);v.translationX=u.pageX-Ft(f.rollingPageX),v.translationY=u.pageY-Ft(f.rollingPageY),v.pageX=u.pageX,v.pageY=u.pageY,this.dispatchEvent(v),f.rollingPageX.length>3&&(f.rollingPageX.shift(),f.rollingPageY.shift(),f.rollingTimestamps.shift()),f.rollingPageX.push(u.pageX),f.rollingPageY.push(u.pageY),f.rollingTimestamps.push(n)}this.dispatched&&(s.preventDefault(),s.stopPropagation(),this.dispatched=!1)}};Pn.SCROLL_FRICTION=-.005,Pn.HOLD_DELAY=700,Pn.CLEAR_TAP_COUNT_TIME=400,Ze([uy],Pn,"isTouchDevice",1);var fy=Pn,Su=class extends pe{onclick(t,s){this._register(ce(t,ft.CLICK,n=>s(new Ea(Di(t),n))))}onmousedown(t,s){this._register(ce(t,ft.MOUSE_DOWN,n=>s(new Ea(Di(t),n))))}onmouseover(t,s){this._register(ce(t,ft.MOUSE_OVER,n=>s(new Ea(Di(t),n))))}onmouseleave(t,s){this._register(ce(t,ft.MOUSE_LEAVE,n=>s(new Ea(Di(t),n))))}onkeydown(t,s){this._register(ce(t,ft.KEY_DOWN,n=>s(new Wv(n))))}onkeyup(t,s){this._register(ce(t,ft.KEY_UP,n=>s(new Wv(n))))}oninput(t,s){this._register(ce(t,ft.INPUT,s))}onblur(t,s){this._register(ce(t,ft.BLUR,s))}onfocus(t,s){this._register(ce(t,ft.FOCUS,s))}onchange(t,s){this._register(ce(t,ft.CHANGE,s))}ignoreGesture(t){return fy.ignoreTarget(t)}},Zv=11,dy=class extends Su{constructor(t){super(),this._onActivate=t.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=t.bgWidth+"px",this.bgDomNode.style.height=t.bgHeight+"px",typeof t.top<"u"&&(this.bgDomNode.style.top="0px"),typeof t.left<"u"&&(this.bgDomNode.style.left="0px"),typeof t.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof t.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=t.className,this.domNode.style.position="absolute",this.domNode.style.width=Zv+"px",this.domNode.style.height=Zv+"px",typeof t.top<"u"&&(this.domNode.style.top=t.top+"px"),typeof t.left<"u"&&(this.domNode.style.left=t.left+"px"),typeof t.bottom<"u"&&(this.domNode.style.bottom=t.bottom+"px"),typeof t.right<"u"&&(this.domNode.style.right=t.right+"px"),this._pointerMoveMonitor=this._register(new Jg),this._register(Pv(this.bgDomNode,ft.POINTER_DOWN,s=>this._arrowPointerDown(s))),this._register(Pv(this.domNode,ft.POINTER_DOWN,s=>this._arrowPointerDown(s))),this._pointerdownRepeatTimer=this._register(new oy),this._pointerdownScheduleRepeatTimer=this._register(new mu)}_arrowPointerDown(t){if(!t.target||!(t.target instanceof Element))return;let s=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Di(t))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(s,200),this._pointerMoveMonitor.startMonitoring(t.target,t.pointerId,t.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),t.preventDefault()}},_y=class Wc{constructor(s,n,a,h,u,f,v){this._forceIntegerValues=s,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,a=a|0,h=h|0,u=u|0,f=f|0,v=v|0),this.rawScrollLeft=h,this.rawScrollTop=v,n<0&&(n=0),h+n>a&&(h=a-n),h<0&&(h=0),u<0&&(u=0),v+u>f&&(v=f-u),v<0&&(v=0),this.width=n,this.scrollWidth=a,this.scrollLeft=h,this.height=u,this.scrollHeight=f,this.scrollTop=v}equals(s){return this.rawScrollLeft===s.rawScrollLeft&&this.rawScrollTop===s.rawScrollTop&&this.width===s.width&&this.scrollWidth===s.scrollWidth&&this.scrollLeft===s.scrollLeft&&this.height===s.height&&this.scrollHeight===s.scrollHeight&&this.scrollTop===s.scrollTop}withScrollDimensions(s,n){return new Wc(this._forceIntegerValues,typeof s.width<"u"?s.width:this.width,typeof s.scrollWidth<"u"?s.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof s.height<"u"?s.height:this.height,typeof s.scrollHeight<"u"?s.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(s){return new Wc(this._forceIntegerValues,this.width,this.scrollWidth,typeof s.scrollLeft<"u"?s.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof s.scrollTop<"u"?s.scrollTop:this.rawScrollTop)}createScrollEvent(s,n){let a=this.width!==s.width,h=this.scrollWidth!==s.scrollWidth,u=this.scrollLeft!==s.scrollLeft,f=this.height!==s.height,v=this.scrollHeight!==s.scrollHeight,g=this.scrollTop!==s.scrollTop;return{inSmoothScrolling:n,oldWidth:s.width,oldScrollWidth:s.scrollWidth,oldScrollLeft:s.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:s.height,oldScrollHeight:s.scrollHeight,oldScrollTop:s.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:a,scrollWidthChanged:h,scrollLeftChanged:u,heightChanged:f,scrollHeightChanged:v,scrollTopChanged:g}}},vy=class extends pe{constructor(t){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new X),this.onScroll=this._onScroll.event,this._smoothScrollDuration=t.smoothScrollDuration,this._scheduleAtNextAnimationFrame=t.scheduleAtNextAnimationFrame,this._state=new _y(t.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(t){this._smoothScrollDuration=t}validateScrollPosition(t){return this._state.withScrollPosition(t)}getScrollDimensions(){return this._state}setScrollDimensions(t,s){let n=this._state.withScrollDimensions(t,s);this._setState(n,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(t){let s=this._state.withScrollPosition(t);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(s,!1)}setScrollPositionSmooth(t,s){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(t);if(this._smoothScrolling){t={scrollLeft:typeof t.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:t.scrollLeft,scrollTop:typeof t.scrollTop>"u"?this._smoothScrolling.to.scrollTop:t.scrollTop};let n=this._state.withScrollPosition(t);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let a;s?a=new Iv(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):a=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=a}else{let n=this._state.withScrollPosition(t);this._smoothScrolling=Iv.start(this._state,n,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 t=this._smoothScrolling.tick(),s=this._state.withScrollPosition(t);if(this._setState(s,!0),!!this._smoothScrolling){if(t.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(t,s){let n=this._state;n.equals(t)||(this._state=t,this._onScroll.fire(this._state.createScrollEvent(n,s)))}},Qv=class{constructor(t,s,n){this.scrollLeft=t,this.scrollTop=s,this.isDone=n}};function Sc(t,s){let n=s-t;return function(a){return t+n*py(a)}}function gy(t,s,n){return function(a){return a<n?t(a/n):s((a-n)/(1-n))}}var Iv=class Vc{constructor(s,n,a,h){this.from=s,this.to=n,this.duration=h,this.startTime=a,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(s,n,a){if(Math.abs(s-n)>2.5*a){let h,u;return s<n?(h=s+.75*a,u=n-.75*a):(h=s-.75*a,u=n+.75*a),gy(Sc(s,h),Sc(u,n),.33)}return Sc(s,n)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(s){this.to=s.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(s){let n=(s-this.startTime)/this.duration;if(n<1){let a=this.scrollLeft(n),h=this.scrollTop(n);return new Qv(a,h,!1)}return new Qv(this.to.scrollLeft,this.to.scrollTop,!0)}combine(s,n,a){return Vc.start(s,n,a)}static start(s,n,a){a=a+10;let h=Date.now()-10;return new Vc(s,n,h,a)}};function my(t){return Math.pow(t,3)}function py(t){return 1-my(1-t)}var Sy=class extends pe{constructor(t,s,n){super(),this._visibility=t,this._visibleClassName=s,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new mu)}setVisibility(t){this._visibility!==t&&(this._visibility=t,this._updateShouldBeVisible())}setShouldBeVisible(t){this._rawShouldBeVisible=t,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let t=this._applyVisibilitySetting();this._shouldBeVisible!==t&&(this._shouldBeVisible=t,this.ensureVisibility())}setIsNeeded(t){this._isNeeded!==t&&(this._isNeeded=t,this.ensureVisibility())}setDomNode(t){this._domNode=t,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(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(t){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(t?" fade":"")))}},yy=140,em=class extends Su{constructor(t){super(),this._lazyRender=t.lazyRender,this._host=t.host,this._scrollable=t.scrollable,this._scrollByPage=t.scrollByPage,this._scrollbarState=t.scrollbarState,this._visibilityController=this._register(new Sy(t.visibility,"visible scrollbar "+t.extraScrollbarClassName,"invisible scrollbar "+t.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Jg),this._shouldRender=!0,this.domNode=$n(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(ce(this.domNode.domNode,ft.POINTER_DOWN,s=>this._domNodePointerDown(s)))}_createArrow(t){let s=this._register(new dy(t));this.domNode.domNode.appendChild(s.bgDomNode),this.domNode.domNode.appendChild(s.domNode)}_createSlider(t,s,n,a){this.slider=$n(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(t),this.slider.setLeft(s),typeof n=="number"&&this.slider.setWidth(n),typeof a=="number"&&this.slider.setHeight(a),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(ce(this.slider.domNode,ft.POINTER_DOWN,h=>{h.button===0&&(h.preventDefault(),this._sliderPointerDown(h))})),this.onclick(this.slider.domNode,h=>{h.leftButton&&h.stopPropagation()})}_onElementSize(t){return this._scrollbarState.setVisibleSize(t)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(t){return this._scrollbarState.setScrollSize(t)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(t){return this._scrollbarState.setScrollPosition(t)&&(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(t){t.target===this.domNode.domNode&&this._onPointerDown(t)}delegatePointerDown(t){let s=this.domNode.domNode.getClientRects()[0].top,n=s+this._scrollbarState.getSliderPosition(),a=s+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),h=this._sliderPointerPosition(t);n<=h&&h<=a?t.button===0&&(t.preventDefault(),this._sliderPointerDown(t)):this._onPointerDown(t)}_onPointerDown(t){let s,n;if(t.target===this.domNode.domNode&&typeof t.offsetX=="number"&&typeof t.offsetY=="number")s=t.offsetX,n=t.offsetY;else{let h=hy(this.domNode.domNode);s=t.pageX-h.left,n=t.pageY-h.top}let a=this._pointerDownRelativePosition(s,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(a):this._scrollbarState.getDesiredScrollPositionFromOffset(a)),t.button===0&&(t.preventDefault(),this._sliderPointerDown(t))}_sliderPointerDown(t){if(!t.target||!(t.target instanceof Element))return;let s=this._sliderPointerPosition(t),n=this._sliderOrthogonalPointerPosition(t),a=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(t.target,t.pointerId,t.buttons,h=>{let u=this._sliderOrthogonalPointerPosition(h),f=Math.abs(u-n);if(Zg&&f>yy){this._setDesiredScrollPositionNow(a.getScrollPosition());return}let v=this._sliderPointerPosition(h)-s;this._setDesiredScrollPositionNow(a.getDesiredScrollPositionFromDelta(v))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(t){let s={};this.writeScrollPosition(s,t),this._scrollable.setScrollPositionNow(s)}updateScrollbarSize(t){this._updateScrollbarSize(t),this._scrollbarState.setScrollbarSize(t),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},tm=class Xc{constructor(s,n,a,h,u,f){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(a),this._arrowSize=Math.round(s),this._visibleSize=h,this._scrollSize=u,this._scrollPosition=f,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Xc(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(s){let n=Math.round(s);return this._visibleSize!==n?(this._visibleSize=n,this._refreshComputedValues(),!0):!1}setScrollSize(s){let n=Math.round(s);return this._scrollSize!==n?(this._scrollSize=n,this._refreshComputedValues(),!0):!1}setScrollPosition(s){let n=Math.round(s);return this._scrollPosition!==n?(this._scrollPosition=n,this._refreshComputedValues(),!0):!1}setScrollbarSize(s){this._scrollbarSize=Math.round(s)}setOppositeScrollbarSize(s){this._oppositeScrollbarSize=Math.round(s)}static _computeValues(s,n,a,h,u){let f=Math.max(0,a-s),v=Math.max(0,f-2*n),g=h>0&&h>a;if(!g)return{computedAvailableSize:Math.round(f),computedIsNeeded:g,computedSliderSize:Math.round(v),computedSliderRatio:0,computedSliderPosition:0};let _=Math.round(Math.max(20,Math.floor(a*v/h))),C=(v-_)/(h-a),y=u*C;return{computedAvailableSize:Math.round(f),computedIsNeeded:g,computedSliderSize:Math.round(_),computedSliderRatio:C,computedSliderPosition:Math.round(y)}}_refreshComputedValues(){let s=Xc._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=s.computedAvailableSize,this._computedIsNeeded=s.computedIsNeeded,this._computedSliderSize=s.computedSliderSize,this._computedSliderRatio=s.computedSliderRatio,this._computedSliderPosition=s.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(s){if(!this._computedIsNeeded)return 0;let n=s-this._arrowSize-this._computedSliderSize/2;return Math.round(n/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(s){if(!this._computedIsNeeded)return 0;let n=s-this._arrowSize,a=this._scrollPosition;return n<this._computedSliderPosition?a-=this._visibleSize:a+=this._visibleSize,a}getDesiredScrollPositionFromDelta(s){if(!this._computedIsNeeded)return 0;let n=this._computedSliderPosition+s;return Math.round(n/this._computedSliderRatio)}},by=class extends em{constructor(t,s,n){let a=t.getScrollDimensions(),h=t.getCurrentScrollPosition();if(super({lazyRender:s.lazyRender,host:n,scrollbarState:new tm(s.horizontalHasArrows?s.arrowSize:0,s.horizontal===2?0:s.horizontalScrollbarSize,s.vertical===2?0:s.verticalScrollbarSize,a.width,a.scrollWidth,h.scrollLeft),visibility:s.horizontal,extraScrollbarClassName:"horizontal",scrollable:t,scrollByPage:s.scrollByPage}),s.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((s.horizontalScrollbarSize-s.horizontalSliderSize)/2),0,void 0,s.horizontalSliderSize)}_updateSlider(t,s){this.slider.setWidth(t),this.slider.setLeft(s)}_renderDomNode(t,s){this.domNode.setWidth(t),this.domNode.setHeight(s),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(t){return this._shouldRender=this._onElementScrollSize(t.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(t.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(t.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(t,s){return t}_sliderPointerPosition(t){return t.pageX}_sliderOrthogonalPointerPosition(t){return t.pageY}_updateScrollbarSize(t){this.slider.setHeight(t)}writeScrollPosition(t,s){t.scrollLeft=s}updateOptions(t){this.updateScrollbarSize(t.horizontal===2?0:t.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(t.vertical===2?0:t.verticalScrollbarSize),this._visibilityController.setVisibility(t.horizontal),this._scrollByPage=t.scrollByPage}},Cy=class extends em{constructor(t,s,n){let a=t.getScrollDimensions(),h=t.getCurrentScrollPosition();if(super({lazyRender:s.lazyRender,host:n,scrollbarState:new tm(s.verticalHasArrows?s.arrowSize:0,s.vertical===2?0:s.verticalScrollbarSize,0,a.height,a.scrollHeight,h.scrollTop),visibility:s.vertical,extraScrollbarClassName:"vertical",scrollable:t,scrollByPage:s.scrollByPage}),s.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((s.verticalScrollbarSize-s.verticalSliderSize)/2),s.verticalSliderSize,void 0)}_updateSlider(t,s){this.slider.setHeight(t),this.slider.setTop(s)}_renderDomNode(t,s){this.domNode.setWidth(s),this.domNode.setHeight(t),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(t){return this._shouldRender=this._onElementScrollSize(t.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(t.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(t.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(t,s){return s}_sliderPointerPosition(t){return t.pageY}_sliderOrthogonalPointerPosition(t){return t.pageX}_updateScrollbarSize(t){this.slider.setWidth(t)}writeScrollPosition(t,s){t.scrollTop=s}updateOptions(t){this.updateScrollbarSize(t.vertical===2?0:t.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(t.vertical),this._scrollByPage=t.scrollByPage}},wy=500,$v=50,Ey=class{constructor(t,s,n){this.timestamp=t,this.deltaX=s,this.deltaY=n,this.score=0}},Gc=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let s=1,n=0,a=1,h=this._rear;do{let u=h===this._front?s:Math.pow(2,-a);if(s-=u,n+=this._memory[h].score*u,h===this._front)break;h=(this._capacity+h-1)%this._capacity,a++}while(!0);return n<=.5}acceptStandardWheelEvent(s){if(vu){let n=Di(s.browserEvent),a=z0(n);this.accept(Date.now(),s.deltaX*a,s.deltaY*a)}else this.accept(Date.now(),s.deltaX,s.deltaY)}accept(s,n,a){let h=null,u=new Ey(s,n,a);this._front===-1&&this._rear===-1?(this._memory[0]=u,this._front=0,this._rear=0):(h=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]=u),u.score=this._computeScore(u,h)}_computeScore(s,n){if(Math.abs(s.deltaX)>0&&Math.abs(s.deltaY)>0)return 1;let a=.5;if((!this._isAlmostInt(s.deltaX)||!this._isAlmostInt(s.deltaY))&&(a+=.25),n){let h=Math.abs(s.deltaX),u=Math.abs(s.deltaY),f=Math.abs(n.deltaX),v=Math.abs(n.deltaY),g=Math.max(Math.min(h,f),1),_=Math.max(Math.min(u,v),1),C=Math.max(h,f),y=Math.max(u,v);C%g===0&&y%_===0&&(a-=.5)}return Math.min(Math.max(a,0),1)}_isAlmostInt(s){return Math.abs(Math.round(s)-s)<.01}};Gc.INSTANCE=new Gc;var xy=Gc,Dy=class extends Su{constructor(t,s,n){super(),this._onScroll=this._register(new X),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new X),this.onWillScroll=this._onWillScroll.event,this._options=My(s),this._scrollable=n,this._register(this._scrollable.onScroll(h=>{this._onWillScroll.fire(h),this._onDidScroll(h),this._onScroll.fire(h)}));let a={onMouseWheel:h=>this._onMouseWheel(h),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Cy(this._scrollable,this._options,a)),this._horizontalScrollbar=this._register(new by(this._scrollable,this._options,a)),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(t),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=$n(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=$n(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=$n(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,h=>this._onMouseOver(h)),this.onmouseleave(this._listenOnDomNode,h=>this._onMouseLeave(h)),this._hideTimeout=this._register(new mu),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=$s(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(t){this._verticalScrollbar.delegatePointerDown(t)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(t){this._scrollable.setScrollDimensions(t,!1)}updateClassName(t){this._options.className=t,Ti&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(t){typeof t.handleMouseWheel<"u"&&(this._options.handleMouseWheel=t.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof t.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=t.mouseWheelScrollSensitivity),typeof t.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=t.fastScrollSensitivity),typeof t.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=t.scrollPredominantAxis),typeof t.horizontal<"u"&&(this._options.horizontal=t.horizontal),typeof t.vertical<"u"&&(this._options.vertical=t.vertical),typeof t.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=t.horizontalScrollbarSize),typeof t.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=t.verticalScrollbarSize),typeof t.scrollByPage<"u"&&(this._options.scrollByPage=t.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(t){this._revealOnScroll=t}delegateScrollFromMouseWheelEvent(t){this._onMouseWheel(new Xv(t))}_setListeningToMouseWheel(t){if(this._mouseWheelToDispose.length>0!==t&&(this._mouseWheelToDispose=$s(this._mouseWheelToDispose),t)){let s=n=>{this._onMouseWheel(new Xv(n))};this._mouseWheelToDispose.push(ce(this._listenOnDomNode,ft.MOUSE_WHEEL,s,{passive:!1}))}}_onMouseWheel(t){if(t.browserEvent?.defaultPrevented)return;let s=xy.INSTANCE;s.acceptStandardWheelEvent(t);let n=!1;if(t.deltaY||t.deltaX){let h=t.deltaY*this._options.mouseWheelScrollSensitivity,u=t.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&u+h===0?u=h=0:Math.abs(h)>=Math.abs(u)?u=0:h=0),this._options.flipAxes&&([h,u]=[u,h]);let f=!Ti&&t.browserEvent&&t.browserEvent.shiftKey;(this._options.scrollYToX||f)&&!u&&(u=h,h=0),t.browserEvent&&t.browserEvent.altKey&&(u=u*this._options.fastScrollSensitivity,h=h*this._options.fastScrollSensitivity);let v=this._scrollable.getFutureScrollPosition(),g={};if(h){let _=$v*h,C=v.scrollTop-(_<0?Math.floor(_):Math.ceil(_));this._verticalScrollbar.writeScrollPosition(g,C)}if(u){let _=$v*u,C=v.scrollLeft-(_<0?Math.floor(_):Math.ceil(_));this._horizontalScrollbar.writeScrollPosition(g,C)}g=this._scrollable.validateScrollPosition(g),(v.scrollLeft!==g.scrollLeft||v.scrollTop!==g.scrollTop)&&(this._options.mouseWheelSmoothScroll&&s.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(g):this._scrollable.setScrollPositionNow(g),n=!0)}let a=n;!a&&this._options.alwaysConsumeMouseWheel&&(a=!0),!a&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(a=!0),a&&(t.preventDefault(),t.stopPropagation())}_onDidScroll(t){this._shouldRender=this._horizontalScrollbar.onDidScroll(t)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(t)||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 t=this._scrollable.getCurrentScrollPosition(),s=t.scrollTop>0,n=t.scrollLeft>0,a=n?" left":"",h=s?" top":"",u=n||s?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${a}`),this._topShadowDomNode.setClassName(`shadow${h}`),this._topLeftShadowDomNode.setClassName(`shadow${u}${h}${a}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(t){this._mouseIsOver=!1,this._hide()}_onMouseOver(t){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(),wy)}},Ty=class extends Dy{constructor(t,s,n){super(t,s,n)}setScrollPosition(t){t.reuseAnimation?this._scrollable.setScrollPositionSmooth(t,t.reuseAnimation):this._scrollable.setScrollPositionNow(t)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function My(t){let s={lazyRender:typeof t.lazyRender<"u"?t.lazyRender:!1,className:typeof t.className<"u"?t.className:"",useShadows:typeof t.useShadows<"u"?t.useShadows:!0,handleMouseWheel:typeof t.handleMouseWheel<"u"?t.handleMouseWheel:!0,flipAxes:typeof t.flipAxes<"u"?t.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof t.consumeMouseWheelIfScrollbarIsNeeded<"u"?t.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof t.alwaysConsumeMouseWheel<"u"?t.alwaysConsumeMouseWheel:!1,scrollYToX:typeof t.scrollYToX<"u"?t.scrollYToX:!1,mouseWheelScrollSensitivity:typeof t.mouseWheelScrollSensitivity<"u"?t.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof t.fastScrollSensitivity<"u"?t.fastScrollSensitivity:5,scrollPredominantAxis:typeof t.scrollPredominantAxis<"u"?t.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof t.mouseWheelSmoothScroll<"u"?t.mouseWheelSmoothScroll:!0,arrowSize:typeof t.arrowSize<"u"?t.arrowSize:11,listenOnDomNode:typeof t.listenOnDomNode<"u"?t.listenOnDomNode:null,horizontal:typeof t.horizontal<"u"?t.horizontal:1,horizontalScrollbarSize:typeof t.horizontalScrollbarSize<"u"?t.horizontalScrollbarSize:10,horizontalSliderSize:typeof t.horizontalSliderSize<"u"?t.horizontalSliderSize:0,horizontalHasArrows:typeof t.horizontalHasArrows<"u"?t.horizontalHasArrows:!1,vertical:typeof t.vertical<"u"?t.vertical:1,verticalScrollbarSize:typeof t.verticalScrollbarSize<"u"?t.verticalScrollbarSize:10,verticalHasArrows:typeof t.verticalHasArrows<"u"?t.verticalHasArrows:!1,verticalSliderSize:typeof t.verticalSliderSize<"u"?t.verticalSliderSize:0,scrollByPage:typeof t.scrollByPage<"u"?t.scrollByPage:!1};return s.horizontalSliderSize=typeof t.horizontalSliderSize<"u"?t.horizontalSliderSize:s.horizontalScrollbarSize,s.verticalSliderSize=typeof t.verticalSliderSize<"u"?t.verticalSliderSize:s.verticalScrollbarSize,Ti&&(s.className+=" mac"),s}var Pc=class extends pe{constructor(t,s,n,a,h,u,f,v){super(),this._bufferService=n,this._optionsService=f,this._renderService=v,this._onRequestScrollLines=this._register(new X),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let g=this._register(new vy({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:_=>pu(a.window,_)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{g.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new Ty(s,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},g)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(h.onProtocolChange(_=>{this._scrollableElement.updateOptions({handleMouseWheel:!(_&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(wt.runAndSubscribe(u.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=u.colors.background.css})),t.appendChild(this._scrollableElement.getDomNode()),this._register(We(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=a.mainDocument.createElement("style"),s.appendChild(this._styleElement),this._register(We(()=>this._styleElement.remove())),this._register(wt.runAndSubscribe(u.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${u.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${u.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${u.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
18
+ `)})),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(_=>this._handleScroll(_)))}scrollLines(t){let s=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:s.scrollTop+t*this._renderService.dimensions.css.cell.height})}scrollToLine(t,s){s&&(this._latestYDisp=t),this._scrollableElement.setScrollPosition({reuseAnimation:!s,scrollTop:t*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(t){t!==void 0&&(this._latestYDisp=t),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(t=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,t!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:t*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(t){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let s=Math.round(t.scrollTop/this._renderService.dimensions.css.cell.height),n=s-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=s,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};Pc=Ze([I(2,Mt),I(3,Qi),I(4,zg),I(5,Wr),I(6,Bt),I(7,Ii)],Pc);var Fc=class extends pe{constructor(t,s,n,a,h){super(),this._screenElement=t,this._bufferService=s,this._coreBrowserService=n,this._decorationService=a,this._renderService=h,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(u=>this._removeDecoration(u))),this._register(We(()=>{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 t of this._decorationService.decorations)this._renderDecoration(t);this._dimensionsChanged=!1}_renderDecoration(t){this._refreshStyle(t),this._dimensionsChanged&&this._refreshXPosition(t)}_createElement(t){let s=this._coreBrowserService.mainDocument.createElement("div");s.classList.add("xterm-decoration"),s.classList.toggle("xterm-decoration-top-layer",t?.options?.layer==="top"),s.style.width=`${Math.round((t.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,s.style.height=`${(t.options.height||1)*this._renderService.dimensions.css.cell.height}px`,s.style.top=`${(t.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,s.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=t.options.x??0;return n&&n>this._bufferService.cols&&(s.style.display="none"),this._refreshXPosition(t,s),s}_refreshStyle(t){let s=t.marker.line-this._bufferService.buffers.active.ydisp;if(s<0||s>=this._bufferService.rows)t.element&&(t.element.style.display="none",t.onRenderEmitter.fire(t.element));else{let n=this._decorationElements.get(t);n||(n=this._createElement(t),t.element=n,this._decorationElements.set(t,n),this._container.appendChild(n),t.onDispose(()=>{this._decorationElements.delete(t),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((t.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(t.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${s*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),t.onRenderEmitter.fire(n)}}_refreshXPosition(t,s=t.element){if(!s)return;let n=t.options.x??0;(t.options.anchor||"left")==="right"?s.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":s.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(t){this._decorationElements.get(t)?.remove(),this._decorationElements.delete(t),t.dispose()}};Fc=Ze([I(1,Mt),I(2,Qi),I(3,sl),I(4,Ii)],Fc);var By=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(t){if(t.options.overviewRulerOptions){for(let s of this._zones)if(s.color===t.options.overviewRulerOptions.color&&s.position===t.options.overviewRulerOptions.position){if(this._lineIntersectsZone(s,t.marker.line))return;if(this._lineAdjacentToZone(s,t.marker.line,t.options.overviewRulerOptions.position)){this._addLineToZone(s,t.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=t.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=t.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=t.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=t.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:t.options.overviewRulerOptions.color,position:t.options.overviewRulerOptions.position,startBufferLine:t.marker.line,endBufferLine:t.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(t){this._linePadding=t}_lineIntersectsZone(t,s){return s>=t.startBufferLine&&s<=t.endBufferLine}_lineAdjacentToZone(t,s,n){return s>=t.startBufferLine-this._linePadding[n||"full"]&&s<=t.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(t,s){t.startBufferLine=Math.min(t.startBufferLine,s),t.endBufferLine=Math.max(t.endBufferLine,s)}},wi={full:0,left:0,center:0,right:0},Es={full:0,left:0,center:0,right:0},jn={full:0,left:0,center:0,right:0},Na=class extends pe{constructor(t,s,n,a,h,u,f,v){super(),this._viewportElement=t,this._screenElement=s,this._bufferService=n,this._decorationService=a,this._renderService=h,this._optionsService=u,this._themeService=f,this._coreBrowserService=v,this._colorZoneStore=new By,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(We(()=>this._canvas?.remove()));let g=this._canvas.getContext("2d");if(g)this._ctx=g;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(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let t=Math.floor((this._canvas.width-1)/3),s=Math.ceil((this._canvas.width-1)/3);Es.full=this._canvas.width,Es.left=t,Es.center=s,Es.right=t,this._refreshDrawHeightConstants(),jn.full=1,jn.left=1,jn.center=1+Es.left,jn.right=1+Es.left+Es.center}_refreshDrawHeightConstants(){wi.full=Math.round(2*this._coreBrowserService.dpr);let t=this._canvas.height/this._bufferService.buffer.lines.length,s=Math.round(Math.max(Math.min(t,12),6)*this._coreBrowserService.dpr);wi.left=s,wi.center=s,wi.right=s}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*wi.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*wi.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*wi.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*wi.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 s of this._decorationService.decorations)this._colorZoneStore.addDecoration(s);this._ctx.lineWidth=1,this._renderRulerOutline();let t=this._colorZoneStore.zones;for(let s of t)s.position!=="full"&&this._renderColorZone(s);for(let s of t)s.position==="full"&&this._renderColorZone(s);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(t){this._ctx.fillStyle=t.color,this._ctx.fillRect(jn[t.position||"full"],Math.round((this._canvas.height-1)*(t.startBufferLine/this._bufferService.buffers.active.lines.length)-wi[t.position||"full"]/2),Es[t.position||"full"],Math.round((this._canvas.height-1)*((t.endBufferLine-t.startBufferLine)/this._bufferService.buffers.active.lines.length)+wi[t.position||"full"]))}_queueRefresh(t,s){this._shouldUpdateDimensions=t||this._shouldUpdateDimensions,this._shouldUpdateAnchor=s||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Na=Ze([I(2,Mt),I(3,sl),I(4,Ii),I(5,Bt),I(6,Wr),I(7,Qi)],Na);var q;(t=>(t.NUL="\0",t.SOH="",t.STX="",t.ETX="",t.EOT="",t.ENQ="",t.ACK="",t.BEL="\x07",t.BS="\b",t.HT=" ",t.LF=`
19
+ `,t.VT="\v",t.FF="\f",t.CR="\r",t.SO="",t.SI="",t.DLE="",t.DC1="",t.DC2="",t.DC3="",t.DC4="",t.NAK="",t.SYN="",t.ETB="",t.CAN="",t.EM="",t.SUB="",t.ESC="\x1B",t.FS="",t.GS="",t.RS="",t.US="",t.SP=" ",t.DEL=""))(q||={});var ka;(t=>(t.PAD="€",t.HOP="",t.BPH="‚",t.NBH="ƒ",t.IND="„",t.NEL="…",t.SSA="†",t.ESA="‡",t.HTS="ˆ",t.HTJ="‰",t.VTS="Š",t.PLD="‹",t.PLU="Œ",t.RI="",t.SS2="Ž",t.SS3="",t.DCS="",t.PU1="‘",t.PU2="’",t.STS="“",t.CCH="”",t.MW="•",t.SPA="–",t.EPA="—",t.SOS="˜",t.SGCI="™",t.SCI="š",t.CSI="›",t.ST="œ",t.OSC="",t.PM="ž",t.APC="Ÿ"))(ka||={});var im;(t=>t.ST=`${q.ESC}\\`)(im||={});var Zc=class{constructor(t,s,n,a,h,u){this._textarea=t,this._compositionView=s,this._bufferService=n,this._optionsService=a,this._coreService=h,this._renderService=u,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(t){this._compositionView.textContent=t.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(t){if(this._isComposing||this._isSendingComposition){if(t.keyCode===20||t.keyCode===229||t.keyCode===16||t.keyCode===17||t.keyCode===18)return!1;this._finalizeComposition(!1)}return t.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(t){if(this._compositionView.classList.remove("active"),this._isComposing=!1,t){let s={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;s.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(s.start,this._compositionPosition.start):n=this._textarea.value.substring(s.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let s=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(s,!0)}}_handleAnyTextareaChanges(){let t=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let s=this._textarea.value,n=s.replace(t,"");this._dataAlreadySent=n,s.length>t.length?this._coreService.triggerDataEvent(n,!0):s.length<t.length?this._coreService.triggerDataEvent(`${q.DEL}`,!0):s.length===t.length&&s!==t&&this._coreService.triggerDataEvent(s,!0)}},0)}updateCompositionElements(t){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let s=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,a=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,h=s*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=h+"px",this._compositionView.style.top=a+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let u=this._compositionView.getBoundingClientRect();this._textarea.style.left=h+"px",this._textarea.style.top=a+"px",this._textarea.style.width=Math.max(u.width,1)+"px",this._textarea.style.height=Math.max(u.height,1)+"px",this._textarea.style.lineHeight=u.height+"px"}t||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Zc=Ze([I(2,Mt),I(3,Bt),I(4,er),I(5,Ii)],Zc);var dt=0,_t=0,vt=0,Fe=0,Jv={css:"#00000000",rgba:0},rt;(t=>{function s(h,u,f,v){return v!==void 0?`#${Ps(h)}${Ps(u)}${Ps(f)}${Ps(v)}`:`#${Ps(h)}${Ps(u)}${Ps(f)}`}t.toCss=s;function n(h,u,f,v=255){return(h<<24|u<<16|f<<8|v)>>>0}t.toRgba=n;function a(h,u,f,v){return{css:t.toCss(h,u,f,v),rgba:t.toRgba(h,u,f,v)}}t.toColor=a})(rt||={});var je;(t=>{function s(g,_){if(Fe=(_.rgba&255)/255,Fe===1)return{css:_.css,rgba:_.rgba};let C=_.rgba>>24&255,y=_.rgba>>16&255,x=_.rgba>>8&255,A=g.rgba>>24&255,D=g.rgba>>16&255,k=g.rgba>>8&255;dt=A+Math.round((C-A)*Fe),_t=D+Math.round((y-D)*Fe),vt=k+Math.round((x-k)*Fe);let G=rt.toCss(dt,_t,vt),Q=rt.toRgba(dt,_t,vt);return{css:G,rgba:Q}}t.blend=s;function n(g){return(g.rgba&255)===255}t.isOpaque=n;function a(g,_,C){let y=Oa.ensureContrastRatio(g.rgba,_.rgba,C);if(y)return rt.toColor(y>>24&255,y>>16&255,y>>8&255)}t.ensureContrastRatio=a;function h(g){let _=(g.rgba|255)>>>0;return[dt,_t,vt]=Oa.toChannels(_),{css:rt.toCss(dt,_t,vt),rgba:_}}t.opaque=h;function u(g,_){return Fe=Math.round(_*255),[dt,_t,vt]=Oa.toChannels(g.rgba),{css:rt.toCss(dt,_t,vt,Fe),rgba:rt.toRgba(dt,_t,vt,Fe)}}t.opacity=u;function f(g,_){return Fe=g.rgba&255,u(g,Fe*_/255)}t.multiplyOpacity=f;function v(g){return[g.rgba>>24&255,g.rgba>>16&255,g.rgba>>8&255]}t.toColorRGB=v})(je||={});var Xe;(t=>{let s,n;try{let h=document.createElement("canvas");h.width=1,h.height=1;let u=h.getContext("2d",{willReadFrequently:!0});u&&(s=u,s.globalCompositeOperation="copy",n=s.createLinearGradient(0,0,1,1))}catch{}function a(h){if(h.match(/#[\da-f]{3,8}/i))switch(h.length){case 4:return dt=parseInt(h.slice(1,2).repeat(2),16),_t=parseInt(h.slice(2,3).repeat(2),16),vt=parseInt(h.slice(3,4).repeat(2),16),rt.toColor(dt,_t,vt);case 5:return dt=parseInt(h.slice(1,2).repeat(2),16),_t=parseInt(h.slice(2,3).repeat(2),16),vt=parseInt(h.slice(3,4).repeat(2),16),Fe=parseInt(h.slice(4,5).repeat(2),16),rt.toColor(dt,_t,vt,Fe);case 7:return{css:h,rgba:(parseInt(h.slice(1),16)<<8|255)>>>0};case 9:return{css:h,rgba:parseInt(h.slice(1),16)>>>0}}let u=h.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(u)return dt=parseInt(u[1]),_t=parseInt(u[2]),vt=parseInt(u[3]),Fe=Math.round((u[5]===void 0?1:parseFloat(u[5]))*255),rt.toColor(dt,_t,vt,Fe);if(!s||!n)throw new Error("css.toColor: Unsupported css format");if(s.fillStyle=n,s.fillStyle=h,typeof s.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(s.fillRect(0,0,1,1),[dt,_t,vt,Fe]=s.getImageData(0,0,1,1).data,Fe!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:rt.toRgba(dt,_t,vt,Fe),css:h}}t.toColor=a})(Xe||={});var Tt;(t=>{function s(a){return n(a>>16&255,a>>8&255,a&255)}t.relativeLuminance=s;function n(a,h,u){let f=a/255,v=h/255,g=u/255,_=f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4),C=v<=.03928?v/12.92:Math.pow((v+.055)/1.055,2.4),y=g<=.03928?g/12.92:Math.pow((g+.055)/1.055,2.4);return _*.2126+C*.7152+y*.0722}t.relativeLuminance2=n})(Tt||={});var Oa;(t=>{function s(f,v){if(Fe=(v&255)/255,Fe===1)return v;let g=v>>24&255,_=v>>16&255,C=v>>8&255,y=f>>24&255,x=f>>16&255,A=f>>8&255;return dt=y+Math.round((g-y)*Fe),_t=x+Math.round((_-x)*Fe),vt=A+Math.round((C-A)*Fe),rt.toRgba(dt,_t,vt)}t.blend=s;function n(f,v,g){let _=Tt.relativeLuminance(f>>8),C=Tt.relativeLuminance(v>>8);if(Pi(_,C)<g){if(C<_){let A=a(f,v,g),D=Pi(_,Tt.relativeLuminance(A>>8));if(D<g){let k=h(f,v,g),G=Pi(_,Tt.relativeLuminance(k>>8));return D>G?A:k}return A}let y=h(f,v,g),x=Pi(_,Tt.relativeLuminance(y>>8));if(x<g){let A=a(f,v,g),D=Pi(_,Tt.relativeLuminance(A>>8));return x>D?y:A}return y}}t.ensureContrastRatio=n;function a(f,v,g){let _=f>>24&255,C=f>>16&255,y=f>>8&255,x=v>>24&255,A=v>>16&255,D=v>>8&255,k=Pi(Tt.relativeLuminance2(x,A,D),Tt.relativeLuminance2(_,C,y));for(;k<g&&(x>0||A>0||D>0);)x-=Math.max(0,Math.ceil(x*.1)),A-=Math.max(0,Math.ceil(A*.1)),D-=Math.max(0,Math.ceil(D*.1)),k=Pi(Tt.relativeLuminance2(x,A,D),Tt.relativeLuminance2(_,C,y));return(x<<24|A<<16|D<<8|255)>>>0}t.reduceLuminance=a;function h(f,v,g){let _=f>>24&255,C=f>>16&255,y=f>>8&255,x=v>>24&255,A=v>>16&255,D=v>>8&255,k=Pi(Tt.relativeLuminance2(x,A,D),Tt.relativeLuminance2(_,C,y));for(;k<g&&(x<255||A<255||D<255);)x=Math.min(255,x+Math.ceil((255-x)*.1)),A=Math.min(255,A+Math.ceil((255-A)*.1)),D=Math.min(255,D+Math.ceil((255-D)*.1)),k=Pi(Tt.relativeLuminance2(x,A,D),Tt.relativeLuminance2(_,C,y));return(x<<24|A<<16|D<<8|255)>>>0}t.increaseLuminance=h;function u(f){return[f>>24&255,f>>16&255,f>>8&255,f&255]}t.toChannels=u})(Oa||={});function Ps(t){let s=t.toString(16);return s.length<2?"0"+s:s}function Pi(t,s){return t<s?(s+.05)/(t+.05):(t+.05)/(s+.05)}var Ay=class extends il{constructor(t,s,n){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=s,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Ha=class{constructor(t){this._bufferService=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new ui}register(t){let s={id:this._nextCharacterJoinerId++,handler:t};return this._characterJoiners.push(s),s.id}deregister(t){for(let s=0;s<this._characterJoiners.length;s++)if(this._characterJoiners[s].id===t)return this._characterJoiners.splice(s,1),!0;return!1}getJoinedCharacters(t){if(this._characterJoiners.length===0)return[];let s=this._bufferService.buffer.lines.get(t);if(!s||s.length===0)return[];let n=[],a=s.translateToString(!0),h=0,u=0,f=0,v=s.getFg(0),g=s.getBg(0);for(let _=0;_<s.getTrimmedLength();_++)if(s.loadCell(_,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==v||this._workCell.bg!==g){if(_-h>1){let C=this._getJoinedRanges(a,f,u,s,h);for(let y=0;y<C.length;y++)n.push(C[y])}h=_,f=u,v=this._workCell.fg,g=this._workCell.bg}u+=this._workCell.getChars().length||Ts.length}if(this._bufferService.cols-h>1){let _=this._getJoinedRanges(a,f,u,s,h);for(let C=0;C<_.length;C++)n.push(_[C])}return n}_getJoinedRanges(t,s,n,a,h){let u=t.substring(s,n),f=[];try{f=this._characterJoiners[0].handler(u)}catch(v){console.error(v)}for(let v=1;v<this._characterJoiners.length;v++)try{let g=this._characterJoiners[v].handler(u);for(let _=0;_<g.length;_++)Ha._mergeRanges(f,g[_])}catch(g){console.error(g)}return this._stringRangesToCellRanges(f,a,h),f}_stringRangesToCellRanges(t,s,n){let a=0,h=!1,u=0,f=t[a];if(f){for(let v=n;v<this._bufferService.cols;v++){let g=s.getWidth(v),_=s.getString(v).length||Ts.length;if(g!==0){if(!h&&f[0]<=u&&(f[0]=v,h=!0),f[1]<=u){if(f[1]=v,f=t[++a],!f)break;f[0]<=u?(f[0]=v,h=!0):h=!1}u+=_}}f&&(f[1]=this._bufferService.cols)}}static _mergeRanges(t,s){let n=!1;for(let a=0;a<t.length;a++){let h=t[a];if(n){if(s[1]<=h[0])return t[a-1][1]=s[1],t;if(s[1]<=h[1])return t[a-1][1]=Math.max(s[1],h[1]),t.splice(a,1),t;t.splice(a,1),a--}else{if(s[1]<=h[0])return t.splice(a,0,s),t;if(s[1]<=h[1])return h[0]=Math.min(s[0],h[0]),t;s[0]<h[1]&&(h[0]=Math.min(s[0],h[0]),n=!0);continue}}return n?t[t.length-1][1]=s[1]:t.push(s),t}};Ha=Ze([I(0,Mt)],Ha);function Ry(t){return 57508<=t&&t<=57558}function ky(t){return 9472<=t&&t<=9631}function Oy(t){return Ry(t)||ky(t)}function Ly(){return{css:{canvas:xa(),cell:xa()},device:{canvas:xa(),cell:xa(),char:{width:0,height:0,left:0,top:0}}}}function xa(){return{width:0,height:0}}var Qc=class{constructor(t,s,n,a,h,u,f){this._document=t,this._characterJoinerService=s,this._optionsService=n,this._coreBrowserService=a,this._coreService=h,this._decorationService=u,this._themeService=f,this._workCell=new ui,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(t,s,n){this._selectionStart=t,this._selectionEnd=s,this._columnSelectMode=n}createRow(t,s,n,a,h,u,f,v,g,_,C){let y=[],x=this._characterJoinerService.getJoinedCharacters(s),A=this._themeService.colors,D=t.getNoBgTrimmedLength();n&&D<u+1&&(D=u+1);let k,G=0,Q="",ve=0,J=0,Z=0,ee=0,se=!1,ie=0,Ae=!1,Ye=0,mt=0,de=[],P=_!==-1&&C!==-1;for(let j=0;j<D;j++){t.loadCell(j,this._workCell);let F=this._workCell.getWidth();if(F===0)continue;let W=!1,w=j>=mt,z=j,N=this._workCell;if(x.length>0&&j===x[0][0]&&w){let xe=x.shift(),fi=this._isCellInSelection(xe[0],s);for(ve=xe[0]+1;ve<xe[1];ve++)w&&=fi===this._isCellInSelection(ve,s);w&&=!n||u<xe[0]||u>=xe[1],w?(W=!0,N=new Ay(this._workCell,t.translateToString(!0,xe[0],xe[1]),xe[1]-xe[0]),z=xe[1]-1,F=N.getWidth()):mt=xe[1]}let re=this._isCellInSelection(j,s),he=n&&j===u,p=P&&j>=_&&j<=C,R=!1;this._decorationService.forEachDecorationAtCell(j,s,void 0,xe=>{R=!0});let Y=N.getChars()||Ts;if(Y===" "&&(N.isUnderline()||N.isOverline())&&(Y=" "),Ye=F*v-g.get(Y,N.isBold(),N.isItalic()),!k)k=this._document.createElement("span");else if(G&&(re&&Ae||!re&&!Ae&&N.bg===J)&&(re&&Ae&&A.selectionForeground||N.fg===Z)&&N.extended.ext===ee&&p===se&&Ye===ie&&!he&&!W&&!R&&w){N.isInvisible()?Q+=Ts:Q+=Y,G++;continue}else G&&(k.textContent=Q),k=this._document.createElement("span"),G=0,Q="";if(J=N.bg,Z=N.fg,ee=N.extended.ext,se=p,ie=Ye,Ae=re,W&&u>=j&&u<=z&&(u=j),!this._coreService.isCursorHidden&&he&&this._coreService.isCursorInitialized){if(de.push("xterm-cursor"),this._coreBrowserService.isFocused)f&&de.push("xterm-cursor-blink"),de.push(a==="bar"?"xterm-cursor-bar":a==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(h)switch(h){case"outline":de.push("xterm-cursor-outline");break;case"block":de.push("xterm-cursor-block");break;case"bar":de.push("xterm-cursor-bar");break;case"underline":de.push("xterm-cursor-underline");break}}if(N.isBold()&&de.push("xterm-bold"),N.isItalic()&&de.push("xterm-italic"),N.isDim()&&de.push("xterm-dim"),N.isInvisible()?Q=Ts:Q=N.getChars()||Ts,N.isUnderline()&&(de.push(`xterm-underline-${N.extended.underlineStyle}`),Q===" "&&(Q=" "),!N.isUnderlineColorDefault()))if(N.isUnderlineColorRGB())k.style.textDecorationColor=`rgb(${il.toColorRGB(N.getUnderlineColor()).join(",")})`;else{let xe=N.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&N.isBold()&&xe<8&&(xe+=8),k.style.textDecorationColor=A.ansi[xe].css}N.isOverline()&&(de.push("xterm-overline"),Q===" "&&(Q=" ")),N.isStrikethrough()&&de.push("xterm-strikethrough"),p&&(k.style.textDecoration="underline");let V=N.getFgColor(),le=N.getFgColorMode(),oe=N.getBgColor(),Se=N.getBgColorMode(),nt=!!N.isInverse();if(nt){let xe=V;V=oe,oe=xe;let fi=le;le=Se,Se=fi}let Be,mi,pi=!1;this._decorationService.forEachDecorationAtCell(j,s,void 0,xe=>{xe.options.layer!=="top"&&pi||(xe.backgroundColorRGB&&(Se=50331648,oe=xe.backgroundColorRGB.rgba>>8&16777215,Be=xe.backgroundColorRGB),xe.foregroundColorRGB&&(le=50331648,V=xe.foregroundColorRGB.rgba>>8&16777215,mi=xe.foregroundColorRGB),pi=xe.options.layer==="top")}),!pi&&re&&(Be=this._coreBrowserService.isFocused?A.selectionBackgroundOpaque:A.selectionInactiveBackgroundOpaque,oe=Be.rgba>>8&16777215,Se=50331648,pi=!0,A.selectionForeground&&(le=50331648,V=A.selectionForeground.rgba>>8&16777215,mi=A.selectionForeground)),pi&&de.push("xterm-decoration-top");let It;switch(Se){case 16777216:case 33554432:It=A.ansi[oe],de.push(`xterm-bg-${oe}`);break;case 50331648:It=rt.toColor(oe>>16,oe>>8&255,oe&255),this._addStyle(k,`background-color:#${eg((oe>>>0).toString(16),"0",6)}`);break;default:nt?(It=A.foreground,de.push("xterm-bg-257")):It=A.background}switch(Be||N.isDim()&&(Be=je.multiplyOpacity(It,.5)),le){case 16777216:case 33554432:N.isBold()&&V<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(V+=8),this._applyMinimumContrast(k,It,A.ansi[V],N,Be,void 0)||de.push(`xterm-fg-${V}`);break;case 50331648:let xe=rt.toColor(V>>16&255,V>>8&255,V&255);this._applyMinimumContrast(k,It,xe,N,Be,mi)||this._addStyle(k,`color:#${eg(V.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(k,It,A.foreground,N,Be,mi)||nt&&de.push("xterm-fg-257")}de.length&&(k.className=de.join(" "),de.length=0),!he&&!W&&!R&&w?G++:k.textContent=Q,Ye!==this.defaultSpacing&&(k.style.letterSpacing=`${Ye}px`),y.push(k),j=z}return k&&G&&(k.textContent=Q),y}_applyMinimumContrast(t,s,n,a,h,u){if(this._optionsService.rawOptions.minimumContrastRatio===1||Oy(a.getCode()))return!1;let f=this._getContrastCache(a),v;if(!h&&!u&&(v=f.getColor(s.rgba,n.rgba)),v===void 0){let g=this._optionsService.rawOptions.minimumContrastRatio/(a.isDim()?2:1);v=je.ensureContrastRatio(h||s,u||n,g),f.setColor((h||s).rgba,(u||n).rgba,v??null)}return v?(this._addStyle(t,`color:${v.css}`),!0):!1}_getContrastCache(t){return t.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(t,s){t.setAttribute("style",`${t.getAttribute("style")||""}${s};`)}_isCellInSelection(t,s){let n=this._selectionStart,a=this._selectionEnd;return!n||!a?!1:this._columnSelectMode?n[0]<=a[0]?t>=n[0]&&s>=n[1]&&t<a[0]&&s<=a[1]:t<n[0]&&s>=n[1]&&t>=a[0]&&s<=a[1]:s>n[1]&&s<a[1]||n[1]===a[1]&&s===n[1]&&t>=n[0]&&t<a[0]||n[1]<a[1]&&s===a[1]&&t<a[0]||n[1]<a[1]&&s===n[1]&&t>=n[0]}};Qc=Ze([I(1,Ug),I(2,Bt),I(3,Qi),I(4,er),I(5,sl),I(6,Wr)],Qc);function eg(t,s,n){for(;t.length<n;)t=s+t;return t}var zy=class{constructor(t,s){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=t.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 n=t.createElement("span");n.classList.add("xterm-char-measure-element");let a=t.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontWeight="bold";let h=t.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontStyle="italic";let u=t.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold",u.style.fontStyle="italic",this._measureElements=[n,a,h,u],this._container.appendChild(n),this._container.appendChild(a),this._container.appendChild(h),this._container.appendChild(u),s.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(t,s,n,a){t===this._font&&s===this._fontSize&&n===this._weight&&a===this._weightBold||(this._font=t,this._fontSize=s,this._weight=n,this._weightBold=a,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${a}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${a}`,this.clear())}get(t,s,n){let a=0;if(!s&&!n&&t.length===1&&(a=t.charCodeAt(0))<256){if(this._flat[a]!==-9999)return this._flat[a];let f=this._measure(t,0);return f>0&&(this._flat[a]=f),f}let h=t;s&&(h+="B"),n&&(h+="I");let u=this._holey.get(h);if(u===void 0){let f=0;s&&(f|=1),n&&(f|=2),u=this._measure(t,f),u>0&&this._holey.set(h,u)}return u}_measure(t,s){let n=this._measureElements[s];return n.textContent=t.repeat(32),n.offsetWidth/32}},Ny=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(t,s,n,a=!1){if(this.selectionStart=s,this.selectionEnd=n,!s||!n||s[0]===n[0]&&s[1]===n[1]){this.clear();return}let h=t.buffers.active.ydisp,u=s[1]-h,f=n[1]-h,v=Math.max(u,0),g=Math.min(f,t.rows-1);if(v>=t.rows||g<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=a,this.viewportStartRow=u,this.viewportEndRow=f,this.viewportCappedStartRow=v,this.viewportCappedEndRow=g,this.startCol=s[0],this.endCol=n[0]}isCellSelected(t,s,n){return this.hasSelection?(n-=t.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?s>=this.startCol&&n>=this.viewportCappedStartRow&&s<this.endCol&&n<=this.viewportCappedEndRow:s<this.startCol&&n>=this.viewportCappedStartRow&&s>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&s>=this.startCol&&s<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&s<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&s>=this.startCol):!1}};function Hy(){return new Ny}var yc="xterm-dom-renderer-owner-",oi="xterm-rows",Da="xterm-fg-",tg="xterm-bg-",Yn="xterm-focus",Ta="xterm-selection",Uy=1,Ic=class extends pe{constructor(t,s,n,a,h,u,f,v,g,_,C,y,x,A){super(),this._terminal=t,this._document=s,this._element=n,this._screenElement=a,this._viewportElement=h,this._helperContainer=u,this._linkifier2=f,this._charSizeService=g,this._optionsService=_,this._bufferService=C,this._coreService=y,this._coreBrowserService=x,this._themeService=A,this._terminalClass=Uy++,this._rowElements=[],this._selectionRenderModel=Hy(),this.onRequestRedraw=this._register(new X).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(oi),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(Ta),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=Ly(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(D=>this._injectCss(D))),this._injectCss(this._themeService.colors),this._rowFactory=v.createInstance(Qc,document),this._element.classList.add(yc+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(D=>this._handleLinkHover(D))),this._register(this._linkifier2.onHideLinkUnderline(D=>this._handleLinkLeave(D))),this._register(We(()=>{this._element.classList.remove(yc+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new zy(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 t=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*t,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*t),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/t),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/t),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 n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let s=`${this._terminalSelector} .${oi} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=s,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(t){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let s=`${this._terminalSelector} .${oi} { pointer-events: none; color: ${t.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;s+=`${this._terminalSelector} .${oi} .xterm-dim { color: ${je.multiplyOpacity(t.foreground,.5).css};}`,s+=`${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 n=`blink_underline_${this._terminalClass}`,a=`blink_bar_${this._terminalClass}`,h=`blink_block_${this._terminalClass}`;s+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,s+=`@keyframes ${a} { 50% { box-shadow: none; }}`,s+=`@keyframes ${h} { 0% { background-color: ${t.cursor.css}; color: ${t.cursorAccent.css}; } 50% { background-color: inherit; color: ${t.cursor.css}; }}`,s+=`${this._terminalSelector} .${oi}.${Yn} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${oi}.${Yn} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${a} 1s step-end infinite;}${this._terminalSelector} .${oi}.${Yn} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${h} 1s step-end infinite;}${this._terminalSelector} .${oi} .xterm-cursor.xterm-cursor-block { background-color: ${t.cursor.css}; color: ${t.cursorAccent.css};}${this._terminalSelector} .${oi} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${t.cursor.css} !important; color: ${t.cursorAccent.css} !important;}${this._terminalSelector} .${oi} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${t.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${oi} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${t.cursor.css} inset;}${this._terminalSelector} .${oi} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${t.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,s+=`${this._terminalSelector} .${Ta} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Ta} div { position: absolute; background-color: ${t.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Ta} div { position: absolute; background-color: ${t.selectionInactiveBackgroundOpaque.css};}`;for(let[u,f]of t.ansi.entries())s+=`${this._terminalSelector} .${Da}${u} { color: ${f.css}; }${this._terminalSelector} .${Da}${u}.xterm-dim { color: ${je.multiplyOpacity(f,.5).css}; }${this._terminalSelector} .${tg}${u} { background-color: ${f.css}; }`;s+=`${this._terminalSelector} .${Da}257 { color: ${je.opaque(t.background).css}; }${this._terminalSelector} .${Da}257.xterm-dim { color: ${je.multiplyOpacity(je.opaque(t.background),.5).css}; }${this._terminalSelector} .${tg}257 { background-color: ${t.foreground.css}; }`,this._themeStyleElement.textContent=s}_setDefaultSpacing(){let t=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${t}px`,this._rowFactory.defaultSpacing=t}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(t,s){for(let n=this._rowElements.length;n<=s;n++){let a=this._document.createElement("div");this._rowContainer.appendChild(a),this._rowElements.push(a)}for(;this._rowElements.length>s;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(t,s){this._refreshRowElements(t,s),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(Yn),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Yn),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(t,s,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(t,s,n),this.renderRows(0,this._bufferService.rows-1),!t||!s||(this._selectionRenderModel.update(this._terminal,t,s,n),!this._selectionRenderModel.hasSelection))return;let a=this._selectionRenderModel.viewportStartRow,h=this._selectionRenderModel.viewportEndRow,u=this._selectionRenderModel.viewportCappedStartRow,f=this._selectionRenderModel.viewportCappedEndRow,v=this._document.createDocumentFragment();if(n){let g=t[0]>s[0];v.appendChild(this._createSelectionElement(u,g?s[0]:t[0],g?t[0]:s[0],f-u+1))}else{let g=a===u?t[0]:0,_=u===h?s[0]:this._bufferService.cols;v.appendChild(this._createSelectionElement(u,g,_));let C=f-u-1;if(v.appendChild(this._createSelectionElement(u+1,0,this._bufferService.cols,C)),u!==f){let y=h===f?s[0]:this._bufferService.cols;v.appendChild(this._createSelectionElement(f,0,y))}}this._selectionContainer.appendChild(v)}_createSelectionElement(t,s,n,a=1){let h=this._document.createElement("div"),u=s*this.dimensions.css.cell.width,f=this.dimensions.css.cell.width*(n-s);return u+f>this.dimensions.css.canvas.width&&(f=this.dimensions.css.canvas.width-u),h.style.height=`${a*this.dimensions.css.cell.height}px`,h.style.top=`${t*this.dimensions.css.cell.height}px`,h.style.left=`${u}px`,h.style.width=`${f}px`,h}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 t of this._rowElements)t.replaceChildren()}renderRows(t,s){let n=this._bufferService.buffer,a=n.ybase+n.y,h=Math.min(n.x,this._bufferService.cols-1),u=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,f=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,v=this._optionsService.rawOptions.cursorInactiveStyle;for(let g=t;g<=s;g++){let _=g+n.ydisp,C=this._rowElements[g],y=n.lines.get(_);if(!C||!y)break;C.replaceChildren(...this._rowFactory.createRow(y,_,_===a,f,v,h,u,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${yc}${this._terminalClass}`}_handleLinkHover(t){this._setCellUnderline(t.x1,t.x2,t.y1,t.y2,t.cols,!0)}_handleLinkLeave(t){this._setCellUnderline(t.x1,t.x2,t.y1,t.y2,t.cols,!1)}_setCellUnderline(t,s,n,a,h,u){n<0&&(t=0),a<0&&(s=0);let f=this._bufferService.rows-1;n=Math.max(Math.min(n,f),0),a=Math.max(Math.min(a,f),0),h=Math.min(h,this._bufferService.cols);let v=this._bufferService.buffer,g=v.ybase+v.y,_=Math.min(v.x,h-1),C=this._optionsService.rawOptions.cursorBlink,y=this._optionsService.rawOptions.cursorStyle,x=this._optionsService.rawOptions.cursorInactiveStyle;for(let A=n;A<=a;++A){let D=A+v.ydisp,k=this._rowElements[A],G=v.lines.get(D);if(!k||!G)break;k.replaceChildren(...this._rowFactory.createRow(G,D,D===g,y,x,_,C,this.dimensions.css.cell.width,this._widthCache,u?A===n?t:0:-1,u?(A===a?s:h)-1:-1))}}};Ic=Ze([I(7,fu),I(8,Ka),I(9,Bt),I(10,Mt),I(11,er),I(12,Qi),I(13,Wr)],Ic);var $c=class extends pe{constructor(t,s,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new X),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new jy(this._optionsService))}catch{this._measureStrategy=this._register(new qy(t,s,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let t=this._measureStrategy.measure();(t.width!==this.width||t.height!==this.height)&&(this.width=t.width,this.height=t.height,this._onCharSizeChange.fire())}};$c=Ze([I(2,Bt)],$c);var sm=class extends pe{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(t,s){t!==void 0&&t>0&&s!==void 0&&s>0&&(this._result.width=t,this._result.height=s)}},qy=class extends sm{constructor(t,s,n){super(),this._document=t,this._parentElement=s,this._optionsService=n,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}},jy=class extends sm{constructor(t){super(),this._optionsService=t,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let s=this._ctx.measureText("W");if(!("width"in s&&"fontBoundingBoxAscent"in s&&"fontBoundingBoxDescent"in s))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let t=this._ctx.measureText("W");return this._validateAndSet(t.width,t.fontBoundingBoxAscent+t.fontBoundingBoxDescent),this._result}},Yy=class extends pe{constructor(t,s,n){super(),this._textarea=t,this._window=s,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new Ky(this._window)),this._onDprChange=this._register(new X),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new X),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(a=>this._screenDprMonitor.setWindow(a))),this._register(wt.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(ce(this._textarea,"focus",()=>this._isFocused=!0)),this._register(ce(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(t){this._window!==t&&(this._window=t,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}},Ky=class extends pe{constructor(t){super(),this._parentWindow=t,this._windowResizeListener=this._register(new Kr),this._onDprChange=this._register(new X),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(We(()=>this.clearListener()))}setWindow(t){this._parentWindow=t,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=ce(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},Wy=class extends pe{constructor(){super(),this.linkProviders=[],this._register(We(()=>this.linkProviders.length=0))}registerLinkProvider(t){return this.linkProviders.push(t),{dispose:()=>{let s=this.linkProviders.indexOf(t);s!==-1&&this.linkProviders.splice(s,1)}}}};function yu(t,s,n){let a=n.getBoundingClientRect(),h=t.getComputedStyle(n),u=parseInt(h.getPropertyValue("padding-left")),f=parseInt(h.getPropertyValue("padding-top"));return[s.clientX-a.left-u,s.clientY-a.top-f]}function Vy(t,s,n,a,h,u,f,v,g){if(!u)return;let _=yu(t,s,n);if(_)return _[0]=Math.ceil((_[0]+(g?f/2:0))/f),_[1]=Math.ceil(_[1]/v),_[0]=Math.min(Math.max(_[0],1),a+(g?1:0)),_[1]=Math.min(Math.max(_[1],1),h),_}var Jc=class{constructor(t,s){this._renderService=t,this._charSizeService=s}getCoords(t,s,n,a,h){return Vy(window,t,s,n,a,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,h)}getMouseReportCoords(t,s){let n=yu(window,t,s);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};Jc=Ze([I(0,Ii),I(1,Ka)],Jc);var Xy=class{constructor(t,s){this._renderCallback=t,this._coreBrowserService=s,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(t){return this._refreshCallbacks.push(t),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(t,s,n){this._rowCount=n,t=t!==void 0?t:0,s=s!==void 0?s:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,t):t,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,s):s,!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 t=Math.max(this._rowStart,0),s=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(t,s),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let t of this._refreshCallbacks)t(0);this._refreshCallbacks=[]}},rm={};t0(rm,{getSafariVersion:()=>Py,isChromeOS:()=>om,isFirefox:()=>nm,isIpad:()=>Fy,isIphone:()=>Zy,isLegacyEdge:()=>Gy,isLinux:()=>bu,isMac:()=>Ua,isNode:()=>Wa,isSafari:()=>lm,isWindows:()=>am});var Wa=typeof process<"u"&&"title"in process,rl=Wa?"node":navigator.userAgent,nl=Wa?"node":navigator.platform,nm=rl.includes("Firefox"),Gy=rl.includes("Edge"),lm=/^((?!chrome|android).)*safari/i.test(rl);function Py(){if(!lm)return 0;let t=rl.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}var Ua=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(nl),Fy=nl==="iPad",Zy=nl==="iPhone",am=["Windows","Win16","Win32","WinCE"].includes(nl),bu=nl.indexOf("Linux")>=0,om=/\bCrOS\b/.test(rl),hm=class{constructor(){this._tasks=[],this._i=0}enqueue(t){this._tasks.push(t),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(t){this._idleCallback=void 0;let s=0,n=0,a=t.timeRemaining(),h=0;for(;this._i<this._tasks.length;){if(s=performance.now(),this._tasks[this._i]()||this._i++,s=Math.max(1,performance.now()-s),n=Math.max(s,n),h=t.timeRemaining(),n*1.5>h){a-s<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-s))}ms`),this._start();return}a=h}this.clear()}},Qy=class extends hm{_requestCallback(t){return setTimeout(()=>t(this._createDeadline(16)))}_cancelCallback(t){clearTimeout(t)}_createDeadline(t){let s=performance.now()+t;return{timeRemaining:()=>Math.max(0,s-performance.now())}}},Iy=class extends hm{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},qa=!Wa&&"requestIdleCallback"in window?Iy:Qy,$y=class{constructor(){this._queue=new qa}set(t){this._queue.clear(),this._queue.enqueue(t)}flush(){this._queue.flush()}},eu=class extends pe{constructor(t,s,n,a,h,u,f,v,g){super(),this._rowCount=t,this._optionsService=n,this._charSizeService=a,this._coreService=h,this._coreBrowserService=v,this._renderer=this._register(new Kr),this._pausedResizeTask=new $y,this._observerDisposable=this._register(new Kr),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new X),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new X),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new X),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new X),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new Xy((_,C)=>this._renderRows(_,C),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new Jy(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(We(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(f.onResize(()=>this._fullRefresh())),this._register(f.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(u.onDecorationRegistered(()=>this._fullRefresh())),this._register(u.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(f.cols,f.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(f.buffer.y,f.buffer.y,!0))),this._register(g.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,s),this._register(this._coreBrowserService.onWindowChange(_=>this._registerIntersectionObserver(_,s)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(t,s){if("IntersectionObserver"in t){let n=new t.IntersectionObserver(a=>this._handleIntersectionChange(a[a.length-1]),{threshold:0});n.observe(s),this._observerDisposable.value=We(()=>n.disconnect())}}_handleIntersectionChange(t){this._isPaused=t.isIntersecting===void 0?t.intersectionRatio===0:!t.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(t,s,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(t,s);return}let a=this._syncOutputHandler.flush();a&&(t=Math.min(t,a.start),s=Math.max(s,a.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(t,s,this._rowCount)}_renderRows(t,s){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(t,s);return}t=Math.min(t,this._rowCount-1),s=Math.min(s,this._rowCount-1),this._renderer.value.renderRows(t,s),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:t,end:s}),this._onRender.fire({start:t,end:s}),this._isNextRenderRedrawOnly=!0}}resize(t,s){this._rowCount=s,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(t){this._renderer.value=t,this._renderer.value&&(this._renderer.value.onRequestRedraw(s=>this.refreshRows(s.start,s.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(t){return this._renderDebouncer.addRefreshCallback(t)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(t,s){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(t,s)):this._renderer.value.handleResize(t,s),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(t,s,n){this._selectionState.start=t,this._selectionState.end=s,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(t,s,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};eu=Ze([I(2,Bt),I(3,Ka),I(4,er),I(5,sl),I(6,Mt),I(7,Qi),I(8,Wr)],eu);var Jy=class{constructor(t,s,n){this._coreBrowserService=t,this._coreService=s,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(t,s){this._isBuffering?(this._start=Math.min(this._start,t),this._end=Math.max(this._end,s)):(this._start=t,this._end=s,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 t={start:this._start,end:this._end};return this._isBuffering=!1,t}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function e1(t,s,n,a){let h=n.buffer.x,u=n.buffer.y;if(!n.buffer.hasScrollback)return s1(h,u,t,s,n,a)+Va(u,s,n,a)+r1(h,u,t,s,n,a);let f;if(u===s)return f=h>t?"D":"C",el(Math.abs(h-t),Jn(f,a));f=u>s?"D":"C";let v=Math.abs(u-s),g=i1(u>s?t:h,n)+(v-1)*n.cols+1+t1(u>s?h:t);return el(g,Jn(f,a))}function t1(t,s){return t-1}function i1(t,s){return s.cols-t}function s1(t,s,n,a,h,u){return Va(s,a,h,u).length===0?"":el(um(t,s,t,s-Js(s,h),!1,h).length,Jn("D",u))}function Va(t,s,n,a){let h=t-Js(t,n),u=s-Js(s,n),f=Math.abs(h-u)-n1(t,s,n);return el(f,Jn(cm(t,s),a))}function r1(t,s,n,a,h,u){let f;Va(s,a,h,u).length>0?f=a-Js(a,h):f=s;let v=a,g=l1(t,s,n,a,h,u);return el(um(t,f,n,v,g==="C",h).length,Jn(g,u))}function n1(t,s,n){let a=0,h=t-Js(t,n),u=s-Js(s,n);for(let f=0;f<Math.abs(h-u);f++){let v=cm(t,s)==="A"?-1:1;n.buffer.lines.get(h+v*f)?.isWrapped&&a++}return a}function Js(t,s){let n=0,a=s.buffer.lines.get(t),h=a?.isWrapped;for(;h&&t>=0&&t<s.rows;)n++,a=s.buffer.lines.get(--t),h=a?.isWrapped;return n}function l1(t,s,n,a,h,u){let f;return Va(n,a,h,u).length>0?f=a-Js(a,h):f=s,t<n&&f<=a||t>=n&&f<a?"C":"D"}function cm(t,s){return t>s?"A":"B"}function um(t,s,n,a,h,u){let f=t,v=s,g="";for(;(f!==n||v!==a)&&v>=0&&v<u.buffer.lines.length;)f+=h?1:-1,h&&f>u.cols-1?(g+=u.buffer.translateBufferLineToString(v,!1,t,f),f=0,t=0,v++):!h&&f<0&&(g+=u.buffer.translateBufferLineToString(v,!1,0,t+1),f=u.cols-1,t=f,v--);return g+u.buffer.translateBufferLineToString(v,!1,t,f)}function Jn(t,s){let n=s?"O":"[";return q.ESC+n+t}function el(t,s){t=Math.floor(t);let n="";for(let a=0;a<t;a++)n+=s;return n}var a1=class{constructor(t){this._bufferService=t,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 t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?t%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)-1]:[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[t,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[Math.max(t,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let t=this.selectionStart,s=this.selectionEnd;return!t||!s?!1:t[1]>s[1]||t[1]===s[1]&&t[0]>s[0]}handleTrim(t){return this.selectionStart&&(this.selectionStart[1]-=t),this.selectionEnd&&(this.selectionEnd[1]-=t),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function ig(t,s){if(t.start.y>t.end.y)throw new Error(`Buffer range end (${t.end.x}, ${t.end.y}) cannot be before start (${t.start.x}, ${t.start.y})`);return s*(t.end.y-t.start.y)+(t.end.x-t.start.x+1)}var bc=50,o1=15,h1=50,c1=500,u1=" ",f1=new RegExp(u1,"g"),tu=class extends pe{constructor(t,s,n,a,h,u,f,v,g){super(),this._element=t,this._screenElement=s,this._linkifier=n,this._bufferService=a,this._coreService=h,this._mouseService=u,this._optionsService=f,this._renderService=v,this._coreBrowserService=g,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new ui,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new X),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new X),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new X),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new X),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=_=>this._handleMouseMove(_),this._mouseUpListener=_=>this._handleMouseUp(_),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(_=>this._handleTrim(_)),this._register(this._bufferService.buffers.onBufferActivate(_=>this._handleBufferActivate(_))),this.enable(),this._model=new a1(this._bufferService),this._activeSelectionMode=0,this._register(We(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(_=>{_.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 t=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!t||!s?!1:t[0]!==s[0]||t[1]!==s[1]}get selectionText(){let t=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;if(!t||!s)return"";let n=this._bufferService.buffer,a=[];if(this._activeSelectionMode===3){if(t[0]===s[0])return"";let h=t[0]<s[0]?t[0]:s[0],u=t[0]<s[0]?s[0]:t[0];for(let f=t[1];f<=s[1];f++){let v=n.translateBufferLineToString(f,!0,h,u);a.push(v)}}else{let h=t[1]===s[1]?s[0]:void 0;a.push(n.translateBufferLineToString(t[1],!0,t[0],h));for(let u=t[1]+1;u<=s[1]-1;u++){let f=n.lines.get(u),v=n.translateBufferLineToString(u,!0);f?.isWrapped?a[a.length-1]+=v:a.push(v)}if(t[1]!==s[1]){let u=n.lines.get(s[1]),f=n.translateBufferLineToString(s[1],!0,0,s[0]);u&&u.isWrapped?a[a.length-1]+=f:a.push(f)}}return a.map(h=>h.replace(f1," ")).join(am?`\r
20
+ `:`
21
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(t){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),bu&&t&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(t){let s=this._getMouseBufferCoords(t),n=this._model.finalSelectionStart,a=this._model.finalSelectionEnd;return!n||!a||!s?!1:this._areCoordsInSelection(s,n,a)}isCellInSelection(t,s){let n=this._model.finalSelectionStart,a=this._model.finalSelectionEnd;return!n||!a?!1:this._areCoordsInSelection([t,s],n,a)}_areCoordsInSelection(t,s,n){return t[1]>s[1]&&t[1]<n[1]||s[1]===n[1]&&t[1]===s[1]&&t[0]>=s[0]&&t[0]<n[0]||s[1]<n[1]&&t[1]===n[1]&&t[0]<n[0]||s[1]<n[1]&&t[1]===s[1]&&t[0]>=s[0]}_selectWordAtCursor(t,s){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=ig(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let a=this._getMouseBufferCoords(t);return a?(this._selectWordAt(a,s),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(t,s){this._model.clearSelection(),t=Math.max(t,0),s=Math.min(s,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,t],this._model.selectionEnd=[this._bufferService.cols,s],this.refresh(),this._onSelectionChange.fire()}_handleTrim(t){this._model.handleTrim(t)&&this.refresh()}_getMouseBufferCoords(t){let s=this._mouseService.getCoords(t,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(s)return s[0]--,s[1]--,s[1]+=this._bufferService.buffer.ydisp,s}_getMouseEventScrollAmount(t){let s=yu(this._coreBrowserService.window,t,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return s>=0&&s<=n?0:(s>n&&(s-=n),s=Math.min(Math.max(s,-bc),bc),s/=bc,s/Math.abs(s)+Math.round(s*(o1-1)))}shouldForceSelection(t){return Ua?t.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:t.shiftKey}handleMouseDown(t){if(this._mouseDownTimeStamp=t.timeStamp,!(t.button===2&&this.hasSelection)&&t.button===0){if(!this._enabled){if(!this.shouldForceSelection(t))return;t.stopPropagation()}t.preventDefault(),this._dragScrollAmount=0,this._enabled&&t.shiftKey?this._handleIncrementalClick(t):t.detail===1?this._handleSingleClick(t):t.detail===2?this._handleDoubleClick(t):t.detail===3&&this._handleTripleClick(t),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),h1)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(t){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(t))}_handleSingleClick(t){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(t)?3:0,this._model.selectionStart=this._getMouseBufferCoords(t),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let s=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);s&&s.length!==this._model.selectionStart[0]&&s.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(t){this._selectWordAtCursor(t,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(t){let s=this._getMouseBufferCoords(t);s&&(this._activeSelectionMode=2,this._selectLineAt(s[1]))}shouldColumnSelect(t){return t.altKey&&!(Ua&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(t){if(t.stopImmediatePropagation(),!this._model.selectionStart)return;let s=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(t),!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(t),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let a=n.lines.get(this._model.selectionEnd[1]);a&&a.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!s||s[0]!==this._model.selectionEnd[0]||s[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 t=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(t.ydisp+this._bufferService.rows,t.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=t.ydisp),this.refresh()}}_handleMouseUp(t){let s=t.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&s<c1&&t.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(t,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let a=e1(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(a,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let t=this._model.finalSelectionStart,s=this._model.finalSelectionEnd,n=!!t&&!!s&&(t[0]!==s[0]||t[1]!==s[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(t,s,n);return}!t||!s||(!this._oldSelectionStart||!this._oldSelectionEnd||t[0]!==this._oldSelectionStart[0]||t[1]!==this._oldSelectionStart[1]||s[0]!==this._oldSelectionEnd[0]||s[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(t,s,n)}_fireOnSelectionChange(t,s,n){this._oldSelectionStart=t,this._oldSelectionEnd=s,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(t){this.clearSelection(),this._trimListener.dispose(),this._trimListener=t.activeBuffer.lines.onTrim(s=>this._handleTrim(s))}_convertViewportColToCharacterIndex(t,s){let n=s;for(let a=0;s>=a;a++){let h=t.loadCell(a,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:h>1&&s!==a&&(n+=h-1)}return n}setSelection(t,s,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[t,s],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(t){this._isClickInSelection(t)||(this._selectWordAtCursor(t,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(t,s,n=!0,a=!0){if(t[0]>=this._bufferService.cols)return;let h=this._bufferService.buffer,u=h.lines.get(t[1]);if(!u)return;let f=h.translateBufferLineToString(t[1],!1),v=this._convertViewportColToCharacterIndex(u,t[0]),g=v,_=t[0]-v,C=0,y=0,x=0,A=0;if(f.charAt(v)===" "){for(;v>0&&f.charAt(v-1)===" ";)v--;for(;g<f.length&&f.charAt(g+1)===" ";)g++}else{let G=t[0],Q=t[0];u.getWidth(G)===0&&(C++,G--),u.getWidth(Q)===2&&(y++,Q++);let ve=u.getString(Q).length;for(ve>1&&(A+=ve-1,g+=ve-1);G>0&&v>0&&!this._isCharWordSeparator(u.loadCell(G-1,this._workCell));){u.loadCell(G-1,this._workCell);let J=this._workCell.getChars().length;this._workCell.getWidth()===0?(C++,G--):J>1&&(x+=J-1,v-=J-1),v--,G--}for(;Q<u.length&&g+1<f.length&&!this._isCharWordSeparator(u.loadCell(Q+1,this._workCell));){u.loadCell(Q+1,this._workCell);let J=this._workCell.getChars().length;this._workCell.getWidth()===2?(y++,Q++):J>1&&(A+=J-1,g+=J-1),g++,Q++}}g++;let D=v+_-C+x,k=Math.min(this._bufferService.cols,g-v+C+y-x-A);if(!(!s&&f.slice(v,g).trim()==="")){if(n&&D===0&&u.getCodePoint(0)!==32){let G=h.lines.get(t[1]-1);if(G&&u.isWrapped&&G.getCodePoint(this._bufferService.cols-1)!==32){let Q=this._getWordAt([this._bufferService.cols-1,t[1]-1],!1,!0,!1);if(Q){let ve=this._bufferService.cols-Q.start;D-=ve,k+=ve}}}if(a&&D+k===this._bufferService.cols&&u.getCodePoint(this._bufferService.cols-1)!==32){let G=h.lines.get(t[1]+1);if(G?.isWrapped&&G.getCodePoint(0)!==32){let Q=this._getWordAt([0,t[1]+1],!1,!1,!0);Q&&(k+=Q.length)}}return{start:D,length:k}}}_selectWordAt(t,s){let n=this._getWordAt(t,s);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,t[1]--;this._model.selectionStart=[n.start,t[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(t){let s=this._getWordAt(t,!0);if(s){let n=t[1];for(;s.start<0;)s.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;s.start+s.length>this._bufferService.cols;)s.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?s.start:s.start+s.length,n]}}_isCharWordSeparator(t){return t.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(t.getChars())>=0}_selectLineAt(t){let s=this._bufferService.buffer.getWrappedRangeForLine(t),n={start:{x:0,y:s.first},end:{x:this._bufferService.cols-1,y:s.last}};this._model.selectionStart=[0,s.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=ig(n,this._bufferService.cols)}};tu=Ze([I(3,Mt),I(4,er),I(5,du),I(6,Bt),I(7,Ii),I(8,Qi)],tu);var sg=class{constructor(){this._data={}}set(t,s,n){this._data[t]||(this._data[t]={}),this._data[t][s]=n}get(t,s){return this._data[t]?this._data[t][s]:void 0}clear(){this._data={}}},rg=class{constructor(){this._color=new sg,this._css=new sg}setCss(t,s,n){this._css.set(t,s,n)}getCss(t,s){return this._css.get(t,s)}setColor(t,s,n){this._color.set(t,s,n)}getColor(t,s){return this._color.get(t,s)}clear(){this._color.clear(),this._css.clear()}},at=Object.freeze((()=>{let t=[Xe.toColor("#2e3436"),Xe.toColor("#cc0000"),Xe.toColor("#4e9a06"),Xe.toColor("#c4a000"),Xe.toColor("#3465a4"),Xe.toColor("#75507b"),Xe.toColor("#06989a"),Xe.toColor("#d3d7cf"),Xe.toColor("#555753"),Xe.toColor("#ef2929"),Xe.toColor("#8ae234"),Xe.toColor("#fce94f"),Xe.toColor("#729fcf"),Xe.toColor("#ad7fa8"),Xe.toColor("#34e2e2"),Xe.toColor("#eeeeec")],s=[0,95,135,175,215,255];for(let n=0;n<216;n++){let a=s[n/36%6|0],h=s[n/6%6|0],u=s[n%6];t.push({css:rt.toCss(a,h,u),rgba:rt.toRgba(a,h,u)})}for(let n=0;n<24;n++){let a=8+n*10;t.push({css:rt.toCss(a,a,a),rgba:rt.toRgba(a,a,a)})}return t})()),Fs=Xe.toColor("#ffffff"),Fn=Xe.toColor("#000000"),ng=Xe.toColor("#ffffff"),lg=Fn,Kn={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},d1=Fs,iu=class extends pe{constructor(t){super(),this._optionsService=t,this._contrastCache=new rg,this._halfContrastCache=new rg,this._onChangeColors=this._register(new X),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Fs,background:Fn,cursor:ng,cursorAccent:lg,selectionForeground:void 0,selectionBackgroundTransparent:Kn,selectionBackgroundOpaque:je.blend(Fn,Kn),selectionInactiveBackgroundTransparent:Kn,selectionInactiveBackgroundOpaque:je.blend(Fn,Kn),scrollbarSliderBackground:je.opacity(Fs,.2),scrollbarSliderHoverBackground:je.opacity(Fs,.4),scrollbarSliderActiveBackground:je.opacity(Fs,.5),overviewRulerBorder:Fs,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(t={}){let s=this._colors;if(s.foreground=Ne(t.foreground,Fs),s.background=Ne(t.background,Fn),s.cursor=je.blend(s.background,Ne(t.cursor,ng)),s.cursorAccent=je.blend(s.background,Ne(t.cursorAccent,lg)),s.selectionBackgroundTransparent=Ne(t.selectionBackground,Kn),s.selectionBackgroundOpaque=je.blend(s.background,s.selectionBackgroundTransparent),s.selectionInactiveBackgroundTransparent=Ne(t.selectionInactiveBackground,s.selectionBackgroundTransparent),s.selectionInactiveBackgroundOpaque=je.blend(s.background,s.selectionInactiveBackgroundTransparent),s.selectionForeground=t.selectionForeground?Ne(t.selectionForeground,Jv):void 0,s.selectionForeground===Jv&&(s.selectionForeground=void 0),je.isOpaque(s.selectionBackgroundTransparent)&&(s.selectionBackgroundTransparent=je.opacity(s.selectionBackgroundTransparent,.3)),je.isOpaque(s.selectionInactiveBackgroundTransparent)&&(s.selectionInactiveBackgroundTransparent=je.opacity(s.selectionInactiveBackgroundTransparent,.3)),s.scrollbarSliderBackground=Ne(t.scrollbarSliderBackground,je.opacity(s.foreground,.2)),s.scrollbarSliderHoverBackground=Ne(t.scrollbarSliderHoverBackground,je.opacity(s.foreground,.4)),s.scrollbarSliderActiveBackground=Ne(t.scrollbarSliderActiveBackground,je.opacity(s.foreground,.5)),s.overviewRulerBorder=Ne(t.overviewRulerBorder,d1),s.ansi=at.slice(),s.ansi[0]=Ne(t.black,at[0]),s.ansi[1]=Ne(t.red,at[1]),s.ansi[2]=Ne(t.green,at[2]),s.ansi[3]=Ne(t.yellow,at[3]),s.ansi[4]=Ne(t.blue,at[4]),s.ansi[5]=Ne(t.magenta,at[5]),s.ansi[6]=Ne(t.cyan,at[6]),s.ansi[7]=Ne(t.white,at[7]),s.ansi[8]=Ne(t.brightBlack,at[8]),s.ansi[9]=Ne(t.brightRed,at[9]),s.ansi[10]=Ne(t.brightGreen,at[10]),s.ansi[11]=Ne(t.brightYellow,at[11]),s.ansi[12]=Ne(t.brightBlue,at[12]),s.ansi[13]=Ne(t.brightMagenta,at[13]),s.ansi[14]=Ne(t.brightCyan,at[14]),s.ansi[15]=Ne(t.brightWhite,at[15]),t.extendedAnsi){let n=Math.min(s.ansi.length-16,t.extendedAnsi.length);for(let a=0;a<n;a++)s.ansi[a+16]=Ne(t.extendedAnsi[a],at[a+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(t){this._restoreColor(t),this._onChangeColors.fire(this.colors)}_restoreColor(t){if(t===void 0){for(let s=0;s<this._restoreColors.ansi.length;++s)this._colors.ansi[s]=this._restoreColors.ansi[s];return}switch(t){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[t]=this._restoreColors.ansi[t]}}modifyColors(t){t(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()}}};iu=Ze([I(0,Bt)],iu);function Ne(t,s){if(t!==void 0)try{return Xe.toColor(t)}catch{}return s}var _1=class{constructor(...t){this._entries=new Map;for(let[s,n]of t)this.set(s,n)}set(t,s){let n=this._entries.get(t);return this._entries.set(t,s),n}forEach(t){for(let[s,n]of this._entries.entries())t(s,n)}has(t){return this._entries.has(t)}get(t){return this._entries.get(t)}},v1=class{constructor(){this._services=new _1,this._services.set(fu,this)}setService(t,s){this._services.set(t,s)}getService(t){return this._services.get(t)}createInstance(t,...s){let n=o0(t).sort((u,f)=>u.index-f.index),a=[];for(let u of n){let f=this._services.get(u.id);if(!f)throw new Error(`[createInstance] ${t.name} depends on UNKNOWN service ${u.id._id}.`);a.push(f)}let h=n.length>0?n[0].index:s.length;if(s.length!==h)throw new Error(`[createInstance] First service dependency of ${t.name} at position ${h+1} conflicts with ${s.length} static arguments`);return new t(...s,...a)}},g1={trace:0,debug:1,info:2,warn:3,error:4,off:5},m1="xterm.js: ",su=class extends pe{constructor(t){super(),this._optionsService=t,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=g1[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let s=0;s<t.length;s++)typeof t[s]=="function"&&(t[s]=t[s]())}_log(t,s,n){this._evalLazyOptionalParams(n),t.call(console,(this._optionsService.options.logger?"":m1)+s,...n)}trace(t,...s){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,t,s)}debug(t,...s){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,t,s)}info(t,...s){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,t,s)}warn(t,...s){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,t,s)}error(t,...s){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,t,s)}};su=Ze([I(0,Bt)],su);var ag=class extends pe{constructor(t){super(),this._maxLength=t,this.onDeleteEmitter=this._register(new X),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new X),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new X),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(t){if(this._maxLength===t)return;let s=new Array(t);for(let n=0;n<Math.min(t,this.length);n++)s[n]=this._array[this._getCyclicIndex(n)];this._array=s,this._maxLength=t,this._startIndex=0}get length(){return this._length}set length(t){if(t>this._length)for(let s=this._length;s<t;s++)this._array[s]=void 0;this._length=t}get(t){return this._array[this._getCyclicIndex(t)]}set(t,s){this._array[this._getCyclicIndex(t)]=s}push(t){this._array[this._getCyclicIndex(this._length)]=t,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(t,s,...n){if(s){for(let a=t;a<this._length-s;a++)this._array[this._getCyclicIndex(a)]=this._array[this._getCyclicIndex(a+s)];this._length-=s,this.onDeleteEmitter.fire({index:t,amount:s})}for(let a=this._length-1;a>=t;a--)this._array[this._getCyclicIndex(a+n.length)]=this._array[this._getCyclicIndex(a)];for(let a=0;a<n.length;a++)this._array[this._getCyclicIndex(t+a)]=n[a];if(n.length&&this.onInsertEmitter.fire({index:t,amount:n.length}),this._length+n.length>this._maxLength){let a=this._length+n.length-this._maxLength;this._startIndex+=a,this._length=this._maxLength,this.onTrimEmitter.fire(a)}else this._length+=n.length}trimStart(t){t>this._length&&(t=this._length),this._startIndex+=t,this._length-=t,this.onTrimEmitter.fire(t)}shiftElements(t,s,n){if(!(s<=0)){if(t<0||t>=this._length)throw new Error("start argument out of range");if(t+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let h=s-1;h>=0;h--)this.set(t+h+n,this.get(t+h));let a=t+s+n-this._length;if(a>0)for(this._length+=a;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let a=0;a<s;a++)this.set(t+a+n,this.get(t+a))}}_getCyclicIndex(t){return(this._startIndex+t)%this._maxLength}},ge=3,st=Object.freeze(new il),Ma=0,Cc=2,Zn=class fm{constructor(s,n,a=!1){this.isWrapped=a,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(s*ge);let h=n||ui.fromCharData([0,Rg,1,0]);for(let u=0;u<s;++u)this.setCell(u,h);this.length=s}get(s){let n=this._data[s*ge+0],a=n&2097151;return[this._data[s*ge+1],n&2097152?this._combined[s]:a?Ds(a):"",n>>22,n&2097152?this._combined[s].charCodeAt(this._combined[s].length-1):a]}set(s,n){this._data[s*ge+1]=n[0],n[1].length>1?(this._combined[s]=n[1],this._data[s*ge+0]=s|2097152|n[2]<<22):this._data[s*ge+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(s){return this._data[s*ge+0]>>22}hasWidth(s){return this._data[s*ge+0]&12582912}getFg(s){return this._data[s*ge+1]}getBg(s){return this._data[s*ge+2]}hasContent(s){return this._data[s*ge+0]&4194303}getCodePoint(s){let n=this._data[s*ge+0];return n&2097152?this._combined[s].charCodeAt(this._combined[s].length-1):n&2097151}isCombined(s){return this._data[s*ge+0]&2097152}getString(s){let n=this._data[s*ge+0];return n&2097152?this._combined[s]:n&2097151?Ds(n&2097151):""}isProtected(s){return this._data[s*ge+2]&536870912}loadCell(s,n){return Ma=s*ge,n.content=this._data[Ma+0],n.fg=this._data[Ma+1],n.bg=this._data[Ma+2],n.content&2097152&&(n.combinedData=this._combined[s]),n.bg&268435456&&(n.extended=this._extendedAttrs[s]),n}setCell(s,n){n.content&2097152&&(this._combined[s]=n.combinedData),n.bg&268435456&&(this._extendedAttrs[s]=n.extended),this._data[s*ge+0]=n.content,this._data[s*ge+1]=n.fg,this._data[s*ge+2]=n.bg}setCellFromCodepoint(s,n,a,h){h.bg&268435456&&(this._extendedAttrs[s]=h.extended),this._data[s*ge+0]=n|a<<22,this._data[s*ge+1]=h.fg,this._data[s*ge+2]=h.bg}addCodepointToCell(s,n,a){let h=this._data[s*ge+0];h&2097152?this._combined[s]+=Ds(n):h&2097151?(this._combined[s]=Ds(h&2097151)+Ds(n),h&=-2097152,h|=2097152):h=n|1<<22,a&&(h&=-12582913,h|=a<<22),this._data[s*ge+0]=h}insertCells(s,n,a){if(s%=this.length,s&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s-1,0,1,a),n<this.length-s){let h=new ui;for(let u=this.length-s-n-1;u>=0;--u)this.setCell(s+n+u,this.loadCell(s+u,h));for(let u=0;u<n;++u)this.setCell(s+u,a)}else for(let h=s;h<this.length;++h)this.setCell(h,a);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,a)}deleteCells(s,n,a){if(s%=this.length,n<this.length-s){let h=new ui;for(let u=0;u<this.length-s-n;++u)this.setCell(s+u,this.loadCell(s+n+u,h));for(let u=this.length-n;u<this.length;++u)this.setCell(u,a)}else for(let h=s;h<this.length;++h)this.setCell(h,a);s&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s-1,0,1,a),this.getWidth(s)===0&&!this.hasContent(s)&&this.setCellFromCodepoint(s,0,1,a)}replaceCells(s,n,a,h=!1){if(h){for(s&&this.getWidth(s-1)===2&&!this.isProtected(s-1)&&this.setCellFromCodepoint(s-1,0,1,a),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,a);s<n&&s<this.length;)this.isProtected(s)||this.setCell(s,a),s++;return}for(s&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s-1,0,1,a),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,a);s<n&&s<this.length;)this.setCell(s++,a)}resize(s,n){if(s===this.length)return this._data.length*4*Cc<this._data.buffer.byteLength;let a=s*ge;if(s>this.length){if(this._data.buffer.byteLength>=a*4)this._data=new Uint32Array(this._data.buffer,0,a);else{let h=new Uint32Array(a);h.set(this._data),this._data=h}for(let h=this.length;h<s;++h)this.setCell(h,n)}else{this._data=this._data.subarray(0,a);let h=Object.keys(this._combined);for(let f=0;f<h.length;f++){let v=parseInt(h[f],10);v>=s&&delete this._combined[v]}let u=Object.keys(this._extendedAttrs);for(let f=0;f<u.length;f++){let v=parseInt(u[f],10);v>=s&&delete this._extendedAttrs[v]}}return this.length=s,a*4*Cc<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Cc<this._data.buffer.byteLength){let s=new Uint32Array(this._data.length);return s.set(this._data),this._data=s,1}return 0}fill(s,n=!1){if(n){for(let a=0;a<this.length;++a)this.isProtected(a)||this.setCell(a,s);return}this._combined={},this._extendedAttrs={};for(let a=0;a<this.length;++a)this.setCell(a,s)}copyFrom(s){this.length!==s.length?this._data=new Uint32Array(s._data):this._data.set(s._data),this.length=s.length,this._combined={};for(let n in s._combined)this._combined[n]=s._combined[n];this._extendedAttrs={};for(let n in s._extendedAttrs)this._extendedAttrs[n]=s._extendedAttrs[n];this.isWrapped=s.isWrapped}clone(){let s=new fm(0);s._data=new Uint32Array(this._data),s.length=this.length;for(let n in this._combined)s._combined[n]=this._combined[n];for(let n in this._extendedAttrs)s._extendedAttrs[n]=this._extendedAttrs[n];return s.isWrapped=this.isWrapped,s}getTrimmedLength(){for(let s=this.length-1;s>=0;--s)if(this._data[s*ge+0]&4194303)return s+(this._data[s*ge+0]>>22);return 0}getNoBgTrimmedLength(){for(let s=this.length-1;s>=0;--s)if(this._data[s*ge+0]&4194303||this._data[s*ge+2]&50331648)return s+(this._data[s*ge+0]>>22);return 0}copyCellsFrom(s,n,a,h,u){let f=s._data;if(u)for(let g=h-1;g>=0;g--){for(let _=0;_<ge;_++)this._data[(a+g)*ge+_]=f[(n+g)*ge+_];f[(n+g)*ge+2]&268435456&&(this._extendedAttrs[a+g]=s._extendedAttrs[n+g])}else for(let g=0;g<h;g++){for(let _=0;_<ge;_++)this._data[(a+g)*ge+_]=f[(n+g)*ge+_];f[(n+g)*ge+2]&268435456&&(this._extendedAttrs[a+g]=s._extendedAttrs[n+g])}let v=Object.keys(s._combined);for(let g=0;g<v.length;g++){let _=parseInt(v[g],10);_>=n&&(this._combined[_-n+a]=s._combined[_])}}translateToString(s,n,a,h){n=n??0,a=a??this.length,s&&(a=Math.min(a,this.getTrimmedLength())),h&&(h.length=0);let u="";for(;n<a;){let f=this._data[n*ge+0],v=f&2097151,g=f&2097152?this._combined[n]:v?Ds(v):Ts;if(u+=g,h)for(let _=0;_<g.length;++_)h.push(n);n+=f>>22||1}return h&&h.push(n),u}};function p1(t,s,n,a,h,u){let f=[];for(let v=0;v<t.length-1;v++){let g=v,_=t.get(++g);if(!_.isWrapped)continue;let C=[t.get(v)];for(;g<t.length&&_.isWrapped;)C.push(_),_=t.get(++g);if(!u&&a>=v&&a<g){v+=C.length-1;continue}let y=0,x=tl(C,y,s),A=1,D=0;for(;A<C.length;){let G=tl(C,A,s),Q=G-D,ve=n-x,J=Math.min(Q,ve);C[y].copyCellsFrom(C[A],D,x,J,!1),x+=J,x===n&&(y++,x=0),D+=J,D===G&&(A++,D=0),x===0&&y!==0&&C[y-1].getWidth(n-1)===2&&(C[y].copyCellsFrom(C[y-1],n-1,x++,1,!1),C[y-1].setCell(n-1,h))}C[y].replaceCells(x,n,h);let k=0;for(let G=C.length-1;G>0&&(G>y||C[G].getTrimmedLength()===0);G--)k++;k>0&&(f.push(v+C.length-k),f.push(k)),v+=C.length-1}return f}function S1(t,s){let n=[],a=0,h=s[a],u=0;for(let f=0;f<t.length;f++)if(h===f){let v=s[++a];t.onDeleteEmitter.fire({index:f-u,amount:v}),f+=v-1,u+=v,h=s[++a]}else n.push(f);return{layout:n,countRemoved:u}}function y1(t,s){let n=[];for(let a=0;a<s.length;a++)n.push(t.get(s[a]));for(let a=0;a<n.length;a++)t.set(a,n[a]);t.length=s.length}function b1(t,s,n){let a=[],h=t.map((g,_)=>tl(t,_,s)).reduce((g,_)=>g+_),u=0,f=0,v=0;for(;v<h;){if(h-v<n){a.push(h-v);break}u+=n;let g=tl(t,f,s);u>g&&(u-=g,f++);let _=t[f].getWidth(u-1)===2;_&&u--;let C=_?n-1:n;a.push(C),v+=C}return a}function tl(t,s,n){if(s===t.length-1)return t[s].getTrimmedLength();let a=!t[s].hasContent(n-1)&&t[s].getWidth(n-1)===1,h=t[s+1].getWidth(0)===2;return a&&h?n-1:n}var dm=class _m{constructor(s){this.line=s,this.isDisposed=!1,this._disposables=[],this._id=_m._nextId++,this._onDispose=this.register(new X),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),$s(this._disposables),this._disposables.length=0)}register(s){return this._disposables.push(s),s}};dm._nextId=1;var C1=dm,ht={},Zs=ht.B;ht[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:"≥","{":"π","|":"≠","}":"£","~":"·"};ht.A={"#":"£"};ht.B=void 0;ht[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};ht.C=ht[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ht.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};ht.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};ht.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};ht.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};ht.E=ht[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};ht.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};ht.H=ht[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ht["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var og=4294967295,hg=class{constructor(t,s,n){this._hasScrollback=t,this._optionsService=s,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=st.clone(),this.savedCharset=Zs,this.markers=[],this._nullCell=ui.fromCharData([0,Rg,1,0]),this._whitespaceCell=ui.fromCharData([0,Ts,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new qa,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new ag(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new za),this._nullCell}getWhitespaceCell(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new za),this._whitespaceCell}getBlankLine(t,s){return new Zn(this._bufferService.cols,this.getNullCell(t),s)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let t=this.ybase+this.y-this.ydisp;return t>=0&&t<this._rows}_getCorrectBufferLength(t){if(!this._hasScrollback)return t;let s=t+this._optionsService.rawOptions.scrollback;return s>og?og:s}fillViewportRows(t){if(this.lines.length===0){t===void 0&&(t=st);let s=this._rows;for(;s--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new ag(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(t,s){let n=this.getNullCell(st),a=0,h=this._getCorrectBufferLength(s);if(h>this.lines.maxLength&&(this.lines.maxLength=h),this.lines.length>0){if(this._cols<t)for(let f=0;f<this.lines.length;f++)a+=+this.lines.get(f).resize(t,n);let u=0;if(this._rows<s)for(let f=this._rows;f<s;f++)this.lines.length<s+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new Zn(t,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+u+1?(this.ybase--,u++,this.ydisp>0&&this.ydisp--):this.lines.push(new Zn(t,n)));else for(let f=this._rows;f>s;f--)this.lines.length>s+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(h<this.lines.maxLength){let f=this.lines.length-h;f>0&&(this.lines.trimStart(f),this.ybase=Math.max(this.ybase-f,0),this.ydisp=Math.max(this.ydisp-f,0),this.savedY=Math.max(this.savedY-f,0)),this.lines.maxLength=h}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,s-1),u&&(this.y+=u),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=s-1,this._isReflowEnabled&&(this._reflow(t,s),this._cols>t))for(let u=0;u<this.lines.length;u++)a+=+this.lines.get(u).resize(t,n);this._cols=t,this._rows=s,this._memoryCleanupQueue.clear(),a>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let t=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,t=!1);let s=0;for(;this._memoryCleanupPosition<this.lines.length;)if(s+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),s>100)return!0;return t}get _isReflowEnabled(){let t=this._optionsService.rawOptions.windowsPty;return t&&t.buildNumber?this._hasScrollback&&t.backend==="conpty"&&t.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(t,s){this._cols!==t&&(t>this._cols?this._reflowLarger(t,s):this._reflowSmaller(t,s))}_reflowLarger(t,s){let n=this._optionsService.rawOptions.reflowCursorLine,a=p1(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(st),n);if(a.length>0){let h=S1(this.lines,a);y1(this.lines,h.layout),this._reflowLargerAdjustViewport(t,s,h.countRemoved)}}_reflowLargerAdjustViewport(t,s,n){let a=this.getNullCell(st),h=n;for(;h-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<s&&this.lines.push(new Zn(t,a))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(t,s){let n=this._optionsService.rawOptions.reflowCursorLine,a=this.getNullCell(st),h=[],u=0;for(let f=this.lines.length-1;f>=0;f--){let v=this.lines.get(f);if(!v||!v.isWrapped&&v.getTrimmedLength()<=t)continue;let g=[v];for(;v.isWrapped&&f>0;)v=this.lines.get(--f),g.unshift(v);if(!n){let J=this.ybase+this.y;if(J>=f&&J<f+g.length)continue}let _=g[g.length-1].getTrimmedLength(),C=b1(g,this._cols,t),y=C.length-g.length,x;this.ybase===0&&this.y!==this.lines.length-1?x=Math.max(0,this.y-this.lines.maxLength+y):x=Math.max(0,this.lines.length-this.lines.maxLength+y);let A=[];for(let J=0;J<y;J++){let Z=this.getBlankLine(st,!0);A.push(Z)}A.length>0&&(h.push({start:f+g.length+u,newLines:A}),u+=A.length),g.push(...A);let D=C.length-1,k=C[D];k===0&&(D--,k=C[D]);let G=g.length-y-1,Q=_;for(;G>=0;){let J=Math.min(Q,k);if(g[D]===void 0)break;if(g[D].copyCellsFrom(g[G],Q-J,k-J,J,!0),k-=J,k===0&&(D--,k=C[D]),Q-=J,Q===0){G--;let Z=Math.max(G,0);Q=tl(g,Z,this._cols)}}for(let J=0;J<g.length;J++)C[J]<t&&g[J].setCell(C[J],a);let ve=y-x;for(;ve-- >0;)this.ybase===0?this.y<s-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+u)-s&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+y,this.ybase+s-1)}if(h.length>0){let f=[],v=[];for(let k=0;k<this.lines.length;k++)v.push(this.lines.get(k));let g=this.lines.length,_=g-1,C=0,y=h[C];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+u);let x=0;for(let k=Math.min(this.lines.maxLength-1,g+u-1);k>=0;k--)if(y&&y.start>_+x){for(let G=y.newLines.length-1;G>=0;G--)this.lines.set(k--,y.newLines[G]);k++,f.push({index:_+1,amount:y.newLines.length}),x+=y.newLines.length,y=h[++C]}else this.lines.set(k,v[_--]);let A=0;for(let k=f.length-1;k>=0;k--)f[k].index+=A,this.lines.onInsertEmitter.fire(f[k]),A+=f[k].amount;let D=Math.max(0,g+u-this.lines.maxLength);D>0&&this.lines.onTrimEmitter.fire(D)}}translateBufferLineToString(t,s,n=0,a){let h=this.lines.get(t);return h?h.translateToString(s,n,a):""}getWrappedRangeForLine(t){let s=t,n=t;for(;s>0&&this.lines.get(s).isWrapped;)s--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:s,last:n}}setupTabStops(t){for(t!=null?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t<this._cols;t+=this._optionsService.rawOptions.tabStopWidth)this.tabs[t]=!0}prevStop(t){for(t==null&&(t=this.x);!this.tabs[--t]&&t>0;);return t>=this._cols?this._cols-1:t<0?0:t}nextStop(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t<this._cols;);return t>=this._cols?this._cols-1:t<0?0:t}clearMarkers(t){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].line===t&&(this.markers[s].dispose(),this.markers.splice(s--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].dispose();this.markers.length=0,this._isClearing=!1}addMarker(t){let s=new C1(t);return this.markers.push(s),s.register(this.lines.onTrim(n=>{s.line-=n,s.line<0&&s.dispose()})),s.register(this.lines.onInsert(n=>{s.line>=n.index&&(s.line+=n.amount)})),s.register(this.lines.onDelete(n=>{s.line>=n.index&&s.line<n.index+n.amount&&s.dispose(),s.line>n.index&&(s.line-=n.amount)})),s.register(s.onDispose(()=>this._removeMarker(s))),s}_removeMarker(t){this._isClearing||this.markers.splice(this.markers.indexOf(t),1)}},w1=class extends pe{constructor(t,s){super(),this._optionsService=t,this._bufferService=s,this._onBufferActivate=this._register(new X),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 hg(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new hg(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(t){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(t),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(t,s){this._normal.resize(t,s),this._alt.resize(t,s),this.setupTabStops(t)}setupTabStops(t){this._normal.setupTabStops(t),this._alt.setupTabStops(t)}},vm=2,gm=1,ru=class extends pe{constructor(t){super(),this.isUserScrolling=!1,this._onResize=this._register(new X),this.onResize=this._onResize.event,this._onScroll=this._register(new X),this.onScroll=this._onScroll.event,this.cols=Math.max(t.rawOptions.cols||0,vm),this.rows=Math.max(t.rawOptions.rows||0,gm),this.buffers=this._register(new w1(t,this)),this._register(this.buffers.onBufferActivate(s=>{this._onScroll.fire(s.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(t,s){let n=this.cols!==t,a=this.rows!==s;this.cols=t,this.rows=s,this.buffers.resize(t,s),this._onResize.fire({cols:t,rows:s,colsChanged:n,rowsChanged:a})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(t,s=!1){let n=this.buffer,a;a=this._cachedBlankLine,(!a||a.length!==this.cols||a.getFg(0)!==t.fg||a.getBg(0)!==t.bg)&&(a=n.getBlankLine(t,s),this._cachedBlankLine=a),a.isWrapped=s;let h=n.ybase+n.scrollTop,u=n.ybase+n.scrollBottom;if(n.scrollTop===0){let f=n.lines.isFull;u===n.lines.length-1?f?n.lines.recycle().copyFrom(a):n.lines.push(a.clone()):n.lines.splice(u+1,0,a.clone()),f?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let f=u-h+1;n.lines.shiftElements(h+1,f-1,-1),n.lines.set(u,a.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(t,s){let n=this.buffer;if(t<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else t+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let a=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+t,n.ybase),0),a!==n.ydisp&&(s||this._onScroll.fire(n.ydisp))}};ru=Ze([I(0,Bt)],ru);var jr={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:Ua,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},E1=["normal","bold","100","200","300","400","500","600","700","800","900"],x1=class extends pe{constructor(t){super(),this._onOptionChange=this._register(new X),this.onOptionChange=this._onOptionChange.event;let s={...jr};for(let n in t)if(n in s)try{let a=t[n];s[n]=this._sanitizeAndValidateOption(n,a)}catch(a){console.error(a)}this.rawOptions=s,this.options={...s},this._setupOptions(),this._register(We(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(t,s){return this.onOptionChange(n=>{n===t&&s(this.rawOptions[t])})}onMultipleOptionChange(t,s){return this.onOptionChange(n=>{t.indexOf(n)!==-1&&s()})}_setupOptions(){let t=n=>{if(!(n in jr))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},s=(n,a)=>{if(!(n in jr))throw new Error(`No option with key "${n}"`);a=this._sanitizeAndValidateOption(n,a),this.rawOptions[n]!==a&&(this.rawOptions[n]=a,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let a={get:t.bind(this,n),set:s.bind(this,n)};Object.defineProperty(this.options,n,a)}}_sanitizeAndValidateOption(t,s){switch(t){case"cursorStyle":if(s||(s=jr[t]),!D1(s))throw new Error(`"${s}" is not a valid value for ${t}`);break;case"wordSeparator":s||(s=jr[t]);break;case"fontWeight":case"fontWeightBold":if(typeof s=="number"&&1<=s&&s<=1e3)break;s=E1.includes(s)?s:jr[t];break;case"cursorWidth":s=Math.floor(s);case"lineHeight":case"tabStopWidth":if(s<1)throw new Error(`${t} cannot be less than 1, value: ${s}`);break;case"minimumContrastRatio":s=Math.max(1,Math.min(21,Math.round(s*10)/10));break;case"scrollback":if(s=Math.min(s,4294967295),s<0)throw new Error(`${t} cannot be less than 0, value: ${s}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(s<=0)throw new Error(`${t} cannot be less than or equal to 0, value: ${s}`);break;case"rows":case"cols":if(!s&&s!==0)throw new Error(`${t} must be numeric, value: ${s}`);break;case"windowsPty":s=s??{};break}return s}};function D1(t){return t==="block"||t==="underline"||t==="bar"}function Qn(t,s=5){if(typeof t!="object")return t;let n=Array.isArray(t)?[]:{};for(let a in t)n[a]=s<=1?t[a]:t[a]&&Qn(t[a],s-1);return n}var cg=Object.freeze({insertMode:!1}),ug=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),nu=class extends pe{constructor(t,s,n){super(),this._bufferService=t,this._logService=s,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new X),this.onData=this._onData.event,this._onUserInput=this._register(new X),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new X),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new X),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Qn(cg),this.decPrivateModes=Qn(ug)}reset(){this.modes=Qn(cg),this.decPrivateModes=Qn(ug)}triggerDataEvent(t,s=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;s&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),s&&this._onUserInput.fire(),this._logService.debug(`sending data "${t}"`),this._logService.trace("sending data (codes)",()=>t.split("").map(a=>a.charCodeAt(0))),this._onData.fire(t)}triggerBinaryEvent(t){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${t}"`),this._logService.trace("sending binary (codes)",()=>t.split("").map(s=>s.charCodeAt(0))),this._onBinary.fire(t))}};nu=Ze([I(0,Mt),I(1,Ng),I(2,Bt)],nu);var fg={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button===4||t.action!==1?!1:(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>!(t.action===32&&t.button===3)},ANY:{events:31,restrict:t=>!0}};function wc(t,s){let n=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(n|=64,n|=t.action):(n|=t.button&3,t.button&4&&(n|=64),t.button&8&&(n|=128),t.action===32?n|=32:t.action===0&&!s&&(n|=3)),n}var Ec=String.fromCharCode,dg={DEFAULT:t=>{let s=[wc(t,!1)+32,t.col+32,t.row+32];return s[0]>255||s[1]>255||s[2]>255?"":`\x1B[M${Ec(s[0])}${Ec(s[1])}${Ec(s[2])}`},SGR:t=>{let s=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${wc(t,!0)};${t.col};${t.row}${s}`},SGR_PIXELS:t=>{let s=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${wc(t,!0)};${t.x};${t.y}${s}`}},lu=class extends pe{constructor(t,s,n){super(),this._bufferService=t,this._coreService=s,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new X),this.onProtocolChange=this._onProtocolChange.event;for(let a of Object.keys(fg))this.addProtocol(a,fg[a]);for(let a of Object.keys(dg))this.addEncoding(a,dg[a]);this.reset()}addProtocol(t,s){this._protocols[t]=s}addEncoding(t,s){this._encodings[t]=s}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(t,s,n){if(t.deltaY===0||t.shiftKey||s===void 0||n===void 0)return 0;let a=s/n,h=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(h/=a+0,Math.abs(t.deltaY)<50&&(h*=.3),this._wheelPartialScroll+=h,h=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(h*=this._bufferService.rows),h}_applyScrollModifier(t,s){return s.altKey||s.ctrlKey||s.shiftKey?t*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:t*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;let s=this._encodings[this._activeEncoding](t);return s&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(s):this._coreService.triggerDataEvent(s,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(t&1),up:!!(t&2),drag:!!(t&4),move:!!(t&8),wheel:!!(t&16)}}_equalEvents(t,s,n){if(n){if(t.x!==s.x||t.y!==s.y)return!1}else if(t.col!==s.col||t.row!==s.row)return!1;return!(t.button!==s.button||t.action!==s.action||t.ctrl!==s.ctrl||t.alt!==s.alt||t.shift!==s.shift)}};lu=Ze([I(0,Mt),I(1,er),I(2,Bt)],lu);var xc=[[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]],T1=[[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 M1(t,s){let n=0,a=s.length-1,h;if(t<s[0][0]||t>s[a][1])return!1;for(;a>=n;)if(h=n+a>>1,t>s[h][1])n=h+1;else if(t<s[h][0])a=h-1;else return!0;return!1}var B1=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 t=0;t<xc.length;++t)ot.fill(0,xc[t][0],xc[t][1]+1)}}wcwidth(t){return t<32?0:t<127?1:t<65536?ot[t]:M1(t,T1)?0:t>=131072&&t<=196605||t>=196608&&t<=262141?2:1}charProperties(t,s){let n=this.wcwidth(t),a=n===0&&s!==0;if(a){let h=Qs.extractWidth(s);h===0?a=!1:h>n&&(n=h)}return Qs.createPropertyValue(0,n,a)}},Qs=class La{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new X,this.onChange=this._onChange.event;let s=new B1;this.register(s),this._active=s.version,this._activeProvider=s}static extractShouldJoin(s){return(s&1)!==0}static extractWidth(s){return s>>1&3}static extractCharKind(s){return s>>3}static createPropertyValue(s,n,a=!1){return(s&16777215)<<3|(n&3)<<1|(a?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(s){if(!this._providers[s])throw new Error(`unknown Unicode version "${s}"`);this._active=s,this._activeProvider=this._providers[s],this._onChange.fire(s)}register(s){this._providers[s.version]=s}wcwidth(s){return this._activeProvider.wcwidth(s)}getStringCellWidth(s){let n=0,a=0,h=s.length;for(let u=0;u<h;++u){let f=s.charCodeAt(u);if(55296<=f&&f<=56319){if(++u>=h)return n+this.wcwidth(f);let _=s.charCodeAt(u);56320<=_&&_<=57343?f=(f-55296)*1024+_-56320+65536:n+=this.wcwidth(_)}let v=this.charProperties(f,a),g=La.extractWidth(v);La.extractShouldJoin(v)&&(g-=La.extractWidth(a)),n+=g,a=v}return n}charProperties(s,n){return this._activeProvider.charProperties(s,n)}},A1=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(t){this.glevel=t,this.charset=this._charsets[t]}setgCharset(t,s){this._charsets[t]=s,this.glevel===t&&(this.charset=s)}};function _g(t){let s=t.buffer.lines.get(t.buffer.ybase+t.buffer.y-1)?.get(t.cols-1),n=t.buffer.lines.get(t.buffer.ybase+t.buffer.y);n&&s&&(n.isWrapped=s[3]!==0&&s[3]!==32)}var Wn=2147483647,R1=256,mm=class au{constructor(s=32,n=32){if(this.maxLength=s,this.maxSubParamsLength=n,n>R1)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(s),this.length=0,this._subParams=new Int32Array(n),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(s),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(s){let n=new au;if(!s.length)return n;for(let a=Array.isArray(s[0])?1:0;a<s.length;++a){let h=s[a];if(Array.isArray(h))for(let u=0;u<h.length;++u)n.addSubParam(h[u]);else n.addParam(h)}return n}clone(){let s=new au(this.maxLength,this.maxSubParamsLength);return s.params.set(this.params),s.length=this.length,s._subParams.set(this._subParams),s._subParamsLength=this._subParamsLength,s._subParamsIdx.set(this._subParamsIdx),s._rejectDigits=this._rejectDigits,s._rejectSubDigits=this._rejectSubDigits,s._digitIsSub=this._digitIsSub,s}toArray(){let s=[];for(let n=0;n<this.length;++n){s.push(this.params[n]);let a=this._subParamsIdx[n]>>8,h=this._subParamsIdx[n]&255;h-a>0&&s.push(Array.prototype.slice.call(this._subParams,a,h))}return s}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(s){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(s<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=s>Wn?Wn:s}addSubParam(s){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(s<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=s>Wn?Wn:s,this._subParamsIdx[this.length-1]++}}hasSubParams(s){return(this._subParamsIdx[s]&255)-(this._subParamsIdx[s]>>8)>0}getSubParams(s){let n=this._subParamsIdx[s]>>8,a=this._subParamsIdx[s]&255;return a-n>0?this._subParams.subarray(n,a):null}getSubParamsAll(){let s={};for(let n=0;n<this.length;++n){let a=this._subParamsIdx[n]>>8,h=this._subParamsIdx[n]&255;h-a>0&&(s[n]=this._subParams.slice(a,h))}return s}addDigit(s){let n;if(this._rejectDigits||!(n=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let a=this._digitIsSub?this._subParams:this.params,h=a[n-1];a[n-1]=~h?Math.min(h*10+s,Wn):s}},Vn=[],k1=class{constructor(){this._state=0,this._active=Vn,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(t,s){this._handlers[t]===void 0&&(this._handlers[t]=[]);let n=this._handlers[t];return n.push(s),{dispose:()=>{let a=n.indexOf(s);a!==-1&&n.splice(a,1)}}}clearHandler(t){this._handlers[t]&&delete this._handlers[t]}setHandlerFallback(t){this._handlerFb=t}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Vn}reset(){if(this._state===2)for(let t=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;t>=0;--t)this._active[t].end(!1);this._stack.paused=!1,this._active=Vn,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Vn,!this._active.length)this._handlerFb(this._id,"START");else for(let t=this._active.length-1;t>=0;t--)this._active[t].start()}_put(t,s,n){if(!this._active.length)this._handlerFb(this._id,"PUT",Ya(t,s,n));else for(let a=this._active.length-1;a>=0;a--)this._active[a].put(t,s,n)}start(){this.reset(),this._state=1}put(t,s,n){if(this._state!==3){if(this._state===1)for(;s<n;){let a=t[s++];if(a===59){this._state=2,this._start();break}if(a<48||57<a){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+a-48}this._state===2&&n-s>0&&this._put(t,s,n)}}end(t,s=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",t);else{let n=!1,a=this._active.length-1,h=!1;if(this._stack.paused&&(a=this._stack.loopPosition-1,n=s,h=this._stack.fallThrough,this._stack.paused=!1),!h&&n===!1){for(;a>=0&&(n=this._active[a].end(t),n!==!0);a--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!1,n;a--}for(;a>=0;a--)if(n=this._active[a].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!0,n}this._active=Vn,this._id=-1,this._state=0}}},Zt=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+=Ya(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}},Xn=[],O1=class{constructor(){this._handlers=Object.create(null),this._active=Xn,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Xn}registerHandler(t,s){this._handlers[t]===void 0&&(this._handlers[t]=[]);let n=this._handlers[t];return n.push(s),{dispose:()=>{let a=n.indexOf(s);a!==-1&&n.splice(a,1)}}}clearHandler(t){this._handlers[t]&&delete this._handlers[t]}setHandlerFallback(t){this._handlerFb=t}reset(){if(this._active.length)for(let t=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;t>=0;--t)this._active[t].unhook(!1);this._stack.paused=!1,this._active=Xn,this._ident=0}hook(t,s){if(this.reset(),this._ident=t,this._active=this._handlers[t]||Xn,!this._active.length)this._handlerFb(this._ident,"HOOK",s);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(s)}put(t,s,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",Ya(t,s,n));else for(let a=this._active.length-1;a>=0;a--)this._active[a].put(t,s,n)}unhook(t,s=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",t);else{let n=!1,a=this._active.length-1,h=!1;if(this._stack.paused&&(a=this._stack.loopPosition-1,n=s,h=this._stack.fallThrough,this._stack.paused=!1),!h&&n===!1){for(;a>=0&&(n=this._active[a].unhook(t),n!==!0);a--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!1,n;a--}for(;a>=0;a--)if(n=this._active[a].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!0,n}this._active=Xn,this._ident=0}},In=new mm;In.addParam(0);var vg=class{constructor(t){this._handler=t,this._data="",this._params=In,this._hitLimit=!1}hook(t){this._params=t.length>1||t.params[0]?t.clone():In,this._data="",this._hitLimit=!1}put(t,s,n){this._hitLimit||(this._data+=Ya(t,s,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(t){let s=!1;if(this._hitLimit)s=!1;else if(t&&(s=this._handler(this._data,this._params),s instanceof Promise))return s.then(n=>(this._params=In,this._data="",this._hitLimit=!1,n));return this._params=In,this._data="",this._hitLimit=!1,s}},L1=class{constructor(t){this.table=new Uint8Array(t)}setDefault(t,s){this.table.fill(t<<4|s)}add(t,s,n,a){this.table[s<<8|t]=n<<4|a}addMany(t,s,n,a){for(let h=0;h<t.length;h++)this.table[s<<8|t[h]]=n<<4|a}},ci=160,z1=(function(){let t=new L1(4095),s=Array.apply(null,Array(256)).map((v,g)=>g),n=(v,g)=>s.slice(v,g),a=n(32,127),h=n(0,24);h.push(25),h.push.apply(h,n(28,32));let u=n(0,14),f;t.setDefault(1,0),t.addMany(a,0,2,0);for(f in u)t.addMany([24,26,153,154],f,3,0),t.addMany(n(128,144),f,3,0),t.addMany(n(144,152),f,3,0),t.add(156,f,0,0),t.add(27,f,11,1),t.add(157,f,4,8),t.addMany([152,158,159],f,0,7),t.add(155,f,11,3),t.add(144,f,11,9);return t.addMany(h,0,3,0),t.addMany(h,1,3,1),t.add(127,1,0,1),t.addMany(h,8,0,8),t.addMany(h,3,3,3),t.add(127,3,0,3),t.addMany(h,4,3,4),t.add(127,4,0,4),t.addMany(h,6,3,6),t.addMany(h,5,3,5),t.add(127,5,0,5),t.addMany(h,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(a,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(n(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(a,7,0,7),t.addMany(h,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(n(64,127),3,7,0),t.addMany(n(48,60),3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(n(48,60),4,8,4),t.addMany(n(64,127),4,7,0),t.addMany([60,61,62,63],4,0,6),t.addMany(n(32,64),6,0,6),t.add(127,6,0,6),t.addMany(n(64,127),6,0,0),t.addMany(n(32,48),3,9,5),t.addMany(n(32,48),5,9,5),t.addMany(n(48,64),5,0,6),t.addMany(n(64,127),5,7,0),t.addMany(n(32,48),4,9,5),t.addMany(n(32,48),1,9,2),t.addMany(n(32,48),2,9,2),t.addMany(n(48,127),2,10,0),t.addMany(n(48,80),1,10,0),t.addMany(n(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(n(96,127),1,10,0),t.add(80,1,11,9),t.addMany(h,9,0,9),t.add(127,9,0,9),t.addMany(n(28,32),9,0,9),t.addMany(n(32,48),9,9,12),t.addMany(n(48,60),9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(h,11,0,11),t.addMany(n(32,128),11,0,11),t.addMany(n(28,32),11,0,11),t.addMany(h,10,0,10),t.add(127,10,0,10),t.addMany(n(28,32),10,0,10),t.addMany(n(48,60),10,8,10),t.addMany([60,61,62,63],10,0,11),t.addMany(n(32,48),10,9,12),t.addMany(h,12,0,12),t.add(127,12,0,12),t.addMany(n(28,32),12,0,12),t.addMany(n(32,48),12,9,12),t.addMany(n(48,64),12,0,11),t.addMany(n(64,127),12,12,13),t.addMany(n(64,127),10,12,13),t.addMany(n(64,127),9,12,13),t.addMany(h,13,13,13),t.addMany(a,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(ci,0,2,0),t.add(ci,8,5,8),t.add(ci,6,0,6),t.add(ci,11,0,11),t.add(ci,13,13,13),t})(),N1=class extends pe{constructor(t=z1){super(),this._transitions=t,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new mm,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(s,n,a)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,n)=>{},this._escHandlerFb=s=>{},this._errorHandlerFb=s=>s,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(We(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new k1),this._dcsParser=this._register(new O1),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(t,s=[64,126]){let n=0;if(t.prefix){if(t.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=t.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(t.intermediates){if(t.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let h=0;h<t.intermediates.length;++h){let u=t.intermediates.charCodeAt(h);if(32>u||u>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=u}}if(t.final.length!==1)throw new Error("final must be a single byte");let a=t.final.charCodeAt(0);if(s[0]>a||a>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return n<<=8,n|=a,n}identToString(t){let s=[];for(;t;)s.push(String.fromCharCode(t&255)),t>>=8;return s.reverse().join("")}setPrintHandler(t){this._printHandler=t}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(t,s){let n=this._identifier(t,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let a=this._escHandlers[n];return a.push(s),{dispose:()=>{let h=a.indexOf(s);h!==-1&&a.splice(h,1)}}}clearEscHandler(t){this._escHandlers[this._identifier(t,[48,126])]&&delete this._escHandlers[this._identifier(t,[48,126])]}setEscHandlerFallback(t){this._escHandlerFb=t}setExecuteHandler(t,s){this._executeHandlers[t.charCodeAt(0)]=s}clearExecuteHandler(t){this._executeHandlers[t.charCodeAt(0)]&&delete this._executeHandlers[t.charCodeAt(0)]}setExecuteHandlerFallback(t){this._executeHandlerFb=t}registerCsiHandler(t,s){let n=this._identifier(t);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let a=this._csiHandlers[n];return a.push(s),{dispose:()=>{let h=a.indexOf(s);h!==-1&&a.splice(h,1)}}}clearCsiHandler(t){this._csiHandlers[this._identifier(t)]&&delete this._csiHandlers[this._identifier(t)]}setCsiHandlerFallback(t){this._csiHandlerFb=t}registerDcsHandler(t,s){return this._dcsParser.registerHandler(this._identifier(t),s)}clearDcsHandler(t){this._dcsParser.clearHandler(this._identifier(t))}setDcsHandlerFallback(t){this._dcsParser.setHandlerFallback(t)}registerOscHandler(t,s){return this._oscParser.registerHandler(t,s)}clearOscHandler(t){this._oscParser.clearHandler(t)}setOscHandlerFallback(t){this._oscParser.setHandlerFallback(t)}setErrorHandler(t){this._errorHandler=t}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(t,s,n,a,h){this._parseStack.state=t,this._parseStack.handlers=s,this._parseStack.handlerPos=n,this._parseStack.transition=a,this._parseStack.chunkPos=h}parse(t,s,n){let a=0,h=0,u=0,f;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,u=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let v=this._parseStack.handlers,g=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&g>-1){for(;g>=0&&(f=v[g](this._params),f!==!0);g--)if(f instanceof Promise)return this._parseStack.handlerPos=g,f}this._parseStack.handlers=[];break;case 4:if(n===!1&&g>-1){for(;g>=0&&(f=v[g](),f!==!0);g--)if(f instanceof Promise)return this._parseStack.handlerPos=g,f}this._parseStack.handlers=[];break;case 6:if(a=t[this._parseStack.chunkPos],f=this._dcsParser.unhook(a!==24&&a!==26,n),f)return f;a===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(a=t[this._parseStack.chunkPos],f=this._oscParser.end(a!==24&&a!==26,n),f)return f;a===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,u=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let v=u;v<s;++v){switch(a=t[v],h=this._transitions.table[this.currentState<<8|(a<160?a:ci)],h>>4){case 2:for(let x=v+1;;++x){if(x>=s||(a=t[x])<32||a>126&&a<ci){this._printHandler(t,v,x),v=x-1;break}if(++x>=s||(a=t[x])<32||a>126&&a<ci){this._printHandler(t,v,x),v=x-1;break}if(++x>=s||(a=t[x])<32||a>126&&a<ci){this._printHandler(t,v,x),v=x-1;break}if(++x>=s||(a=t[x])<32||a>126&&a<ci){this._printHandler(t,v,x),v=x-1;break}}break;case 3:this._executeHandlers[a]?this._executeHandlers[a]():this._executeHandlerFb(a),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:v,code:a,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let g=this._csiHandlers[this._collect<<8|a],_=g?g.length-1:-1;for(;_>=0&&(f=g[_](this._params),f!==!0);_--)if(f instanceof Promise)return this._preserveStack(3,g,_,h,v),f;_<0&&this._csiHandlerFb(this._collect<<8|a,this._params),this.precedingJoinState=0;break;case 8:do switch(a){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(a-48)}while(++v<s&&(a=t[v])>47&&a<60);v--;break;case 9:this._collect<<=8,this._collect|=a;break;case 10:let C=this._escHandlers[this._collect<<8|a],y=C?C.length-1:-1;for(;y>=0&&(f=C[y](),f!==!0);y--)if(f instanceof Promise)return this._preserveStack(4,C,y,h,v),f;y<0&&this._escHandlerFb(this._collect<<8|a),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|a,this._params);break;case 13:for(let x=v+1;;++x)if(x>=s||(a=t[x])===24||a===26||a===27||a>127&&a<ci){this._dcsParser.put(t,v,x),v=x-1;break}break;case 14:if(f=this._dcsParser.unhook(a!==24&&a!==26),f)return this._preserveStack(6,[],0,h,v),f;a===27&&(h|=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 x=v+1;;x++)if(x>=s||(a=t[x])<32||a>127&&a<ci){this._oscParser.put(t,v,x),v=x-1;break}break;case 6:if(f=this._oscParser.end(a!==24&&a!==26),f)return this._preserveStack(5,[],0,h,v),f;a===27&&(h|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=h&15}}},H1=/^([\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})$/,U1=/^[\da-f]+$/;function gg(t){if(!t)return;let s=t.toLowerCase();if(s.indexOf("rgb:")===0){s=s.slice(4);let n=H1.exec(s);if(n){let a=n[1]?15:n[4]?255:n[7]?4095:65535;return[Math.round(parseInt(n[1]||n[4]||n[7]||n[10],16)/a*255),Math.round(parseInt(n[2]||n[5]||n[8]||n[11],16)/a*255),Math.round(parseInt(n[3]||n[6]||n[9]||n[12],16)/a*255)]}}else if(s.indexOf("#")===0&&(s=s.slice(1),U1.exec(s)&&[3,6,9,12].includes(s.length))){let n=s.length/3,a=[0,0,0];for(let h=0;h<3;++h){let u=parseInt(s.slice(n*h,n*h+n),16);a[h]=n===1?u<<4:n===2?u:n===3?u>>4:u>>8}return a}}function Dc(t,s){let n=t.toString(16),a=n.length<2?"0"+n:n;switch(s){case 4:return n[0];case 8:return a;case 12:return(a+a).slice(0,3);default:return a+a}}function q1(t,s=16){let[n,a,h]=t;return`rgb:${Dc(n,s)}/${Dc(a,s)}/${Dc(h,s)}`}var j1={"(":0,")":1,"*":2,"+":3,"-":1,".":2},xs=131072,mg=10;function pg(t,s){if(t>24)return s.setWinLines||!1;switch(t){case 1:return!!s.restoreWin;case 2:return!!s.minimizeWin;case 3:return!!s.setWinPosition;case 4:return!!s.setWinSizePixels;case 5:return!!s.raiseWin;case 6:return!!s.lowerWin;case 7:return!!s.refreshWin;case 8:return!!s.setWinSizeChars;case 9:return!!s.maximizeWin;case 10:return!!s.fullscreenWin;case 11:return!!s.getWinState;case 13:return!!s.getWinPosition;case 14:return!!s.getWinSizePixels;case 15:return!!s.getScreenSizePixels;case 16:return!!s.getCellSizePixels;case 18:return!!s.getWinSizeChars;case 19:return!!s.getScreenSizeChars;case 20:return!!s.getIconTitle;case 21:return!!s.getWinTitle;case 22:return!!s.pushTitle;case 23:return!!s.popTitle;case 24:return!!s.setWinLines}return!1}var Sg=5e3,yg=0,Y1=class extends pe{constructor(t,s,n,a,h,u,f,v,g=new N1){super(),this._bufferService=t,this._charsetService=s,this._coreService=n,this._logService=a,this._optionsService=h,this._oscLinkService=u,this._coreMouseService=f,this._unicodeService=v,this._parser=g,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new l0,this._utf8Decoder=new a0,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=st.clone(),this._eraseAttrDataInternal=st.clone(),this._onRequestBell=this._register(new X),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new X),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new X),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new X),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new X),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new X),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new X),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new X),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new X),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new X),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new X),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new X),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new X),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 ou(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(_=>this._activeBuffer=_.activeBuffer)),this._parser.setCsiHandlerFallback((_,C)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(_),params:C.toArray()})}),this._parser.setEscHandlerFallback(_=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(_)})}),this._parser.setExecuteHandlerFallback(_=>{this._logService.debug("Unknown EXECUTE code: ",{code:_})}),this._parser.setOscHandlerFallback((_,C,y)=>{this._logService.debug("Unknown OSC code: ",{identifier:_,action:C,data:y})}),this._parser.setDcsHandlerFallback((_,C,y)=>{C==="HOOK"&&(y=y.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(_),action:C,payload:y})}),this._parser.setPrintHandler((_,C,y)=>this.print(_,C,y)),this._parser.registerCsiHandler({final:"@"},_=>this.insertChars(_)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},_=>this.scrollLeft(_)),this._parser.registerCsiHandler({final:"A"},_=>this.cursorUp(_)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},_=>this.scrollRight(_)),this._parser.registerCsiHandler({final:"B"},_=>this.cursorDown(_)),this._parser.registerCsiHandler({final:"C"},_=>this.cursorForward(_)),this._parser.registerCsiHandler({final:"D"},_=>this.cursorBackward(_)),this._parser.registerCsiHandler({final:"E"},_=>this.cursorNextLine(_)),this._parser.registerCsiHandler({final:"F"},_=>this.cursorPrecedingLine(_)),this._parser.registerCsiHandler({final:"G"},_=>this.cursorCharAbsolute(_)),this._parser.registerCsiHandler({final:"H"},_=>this.cursorPosition(_)),this._parser.registerCsiHandler({final:"I"},_=>this.cursorForwardTab(_)),this._parser.registerCsiHandler({final:"J"},_=>this.eraseInDisplay(_,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},_=>this.eraseInDisplay(_,!0)),this._parser.registerCsiHandler({final:"K"},_=>this.eraseInLine(_,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},_=>this.eraseInLine(_,!0)),this._parser.registerCsiHandler({final:"L"},_=>this.insertLines(_)),this._parser.registerCsiHandler({final:"M"},_=>this.deleteLines(_)),this._parser.registerCsiHandler({final:"P"},_=>this.deleteChars(_)),this._parser.registerCsiHandler({final:"S"},_=>this.scrollUp(_)),this._parser.registerCsiHandler({final:"T"},_=>this.scrollDown(_)),this._parser.registerCsiHandler({final:"X"},_=>this.eraseChars(_)),this._parser.registerCsiHandler({final:"Z"},_=>this.cursorBackwardTab(_)),this._parser.registerCsiHandler({final:"`"},_=>this.charPosAbsolute(_)),this._parser.registerCsiHandler({final:"a"},_=>this.hPositionRelative(_)),this._parser.registerCsiHandler({final:"b"},_=>this.repeatPrecedingCharacter(_)),this._parser.registerCsiHandler({final:"c"},_=>this.sendDeviceAttributesPrimary(_)),this._parser.registerCsiHandler({prefix:">",final:"c"},_=>this.sendDeviceAttributesSecondary(_)),this._parser.registerCsiHandler({final:"d"},_=>this.linePosAbsolute(_)),this._parser.registerCsiHandler({final:"e"},_=>this.vPositionRelative(_)),this._parser.registerCsiHandler({final:"f"},_=>this.hVPosition(_)),this._parser.registerCsiHandler({final:"g"},_=>this.tabClear(_)),this._parser.registerCsiHandler({final:"h"},_=>this.setMode(_)),this._parser.registerCsiHandler({prefix:"?",final:"h"},_=>this.setModePrivate(_)),this._parser.registerCsiHandler({final:"l"},_=>this.resetMode(_)),this._parser.registerCsiHandler({prefix:"?",final:"l"},_=>this.resetModePrivate(_)),this._parser.registerCsiHandler({final:"m"},_=>this.charAttributes(_)),this._parser.registerCsiHandler({final:"n"},_=>this.deviceStatus(_)),this._parser.registerCsiHandler({prefix:"?",final:"n"},_=>this.deviceStatusPrivate(_)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},_=>this.softReset(_)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},_=>this.setCursorStyle(_)),this._parser.registerCsiHandler({final:"r"},_=>this.setScrollRegion(_)),this._parser.registerCsiHandler({final:"s"},_=>this.saveCursor(_)),this._parser.registerCsiHandler({final:"t"},_=>this.windowOptions(_)),this._parser.registerCsiHandler({final:"u"},_=>this.restoreCursor(_)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},_=>this.insertColumns(_)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},_=>this.deleteColumns(_)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},_=>this.selectProtected(_)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},_=>this.requestMode(_,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},_=>this.requestMode(_,!1)),this._parser.setExecuteHandler(q.BEL,()=>this.bell()),this._parser.setExecuteHandler(q.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(q.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(q.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(q.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(q.BS,()=>this.backspace()),this._parser.setExecuteHandler(q.HT,()=>this.tab()),this._parser.setExecuteHandler(q.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(q.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(ka.IND,()=>this.index()),this._parser.setExecuteHandler(ka.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(ka.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Zt(_=>(this.setTitle(_),this.setIconName(_),!0))),this._parser.registerOscHandler(1,new Zt(_=>this.setIconName(_))),this._parser.registerOscHandler(2,new Zt(_=>this.setTitle(_))),this._parser.registerOscHandler(4,new Zt(_=>this.setOrReportIndexedColor(_))),this._parser.registerOscHandler(8,new Zt(_=>this.setHyperlink(_))),this._parser.registerOscHandler(10,new Zt(_=>this.setOrReportFgColor(_))),this._parser.registerOscHandler(11,new Zt(_=>this.setOrReportBgColor(_))),this._parser.registerOscHandler(12,new Zt(_=>this.setOrReportCursorColor(_))),this._parser.registerOscHandler(104,new Zt(_=>this.restoreIndexedColor(_))),this._parser.registerOscHandler(110,new Zt(_=>this.restoreFgColor(_))),this._parser.registerOscHandler(111,new Zt(_=>this.restoreBgColor(_))),this._parser.registerOscHandler(112,new Zt(_=>this.restoreCursorColor(_))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let _ in ht)this._parser.registerEscHandler({intermediates:"(",final:_},()=>this.selectCharset("("+_)),this._parser.registerEscHandler({intermediates:")",final:_},()=>this.selectCharset(")"+_)),this._parser.registerEscHandler({intermediates:"*",final:_},()=>this.selectCharset("*"+_)),this._parser.registerEscHandler({intermediates:"+",final:_},()=>this.selectCharset("+"+_)),this._parser.registerEscHandler({intermediates:"-",final:_},()=>this.selectCharset("-"+_)),this._parser.registerEscHandler({intermediates:".",final:_},()=>this.selectCharset("."+_)),this._parser.registerEscHandler({intermediates:"/",final:_},()=>this.selectCharset("/"+_));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(_=>(this._logService.error("Parsing error: ",_),_)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new vg((_,C)=>this.requestStatusString(_,C)))}getAttrData(){return this._curAttrData}_preserveStack(t,s,n,a){this._parseStack.paused=!0,this._parseStack.cursorStartX=t,this._parseStack.cursorStartY=s,this._parseStack.decodedLength=n,this._parseStack.position=a}_logSlowResolvingAsync(t){this._logService.logLevel<=3&&Promise.race([t,new Promise((s,n)=>setTimeout(()=>n("#SLOW_TIMEOUT"),Sg))]).catch(s=>{if(s!=="#SLOW_TIMEOUT")throw s;console.warn(`async parser handler taking longer than ${Sg} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(t,s){let n,a=this._activeBuffer.x,h=this._activeBuffer.y,u=0,f=this._parseStack.paused;if(f){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,s))return this._logSlowResolvingAsync(n),n;a=this._parseStack.cursorStartX,h=this._parseStack.cursorStartY,this._parseStack.paused=!1,t.length>xs&&(u=this._parseStack.position+xs)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof t=="string"?` "${t}"`:` "${Array.prototype.map.call(t,_=>String.fromCharCode(_)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof t=="string"?t.split("").map(_=>_.charCodeAt(0)):t),this._parseBuffer.length<t.length&&this._parseBuffer.length<xs&&(this._parseBuffer=new Uint32Array(Math.min(t.length,xs))),f||this._dirtyRowTracker.clearRange(),t.length>xs)for(let _=u;_<t.length;_+=xs){let C=_+xs<t.length?_+xs:t.length,y=typeof t=="string"?this._stringDecoder.decode(t.substring(_,C),this._parseBuffer):this._utf8Decoder.decode(t.subarray(_,C),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,y))return this._preserveStack(a,h,y,_),this._logSlowResolvingAsync(n),n}else if(!f){let _=typeof t=="string"?this._stringDecoder.decode(t,this._parseBuffer):this._utf8Decoder.decode(t,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,_))return this._preserveStack(a,h,_,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==a||this._activeBuffer.y!==h)&&this._onCursorMove.fire();let v=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),g=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);g<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(g,this._bufferService.rows-1),end:Math.min(v,this._bufferService.rows-1)})}print(t,s,n){let a,h,u=this._charsetService.charset,f=this._optionsService.rawOptions.screenReaderMode,v=this._bufferService.cols,g=this._coreService.decPrivateModes.wraparound,_=this._coreService.modes.insertMode,C=this._curAttrData,y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-s>0&&y.getWidth(this._activeBuffer.x-1)===2&&y.setCellFromCodepoint(this._activeBuffer.x-1,0,1,C);let x=this._parser.precedingJoinState;for(let A=s;A<n;++A){if(a=t[A],a<127&&u){let Q=u[String.fromCharCode(a)];Q&&(a=Q.charCodeAt(0))}let D=this._unicodeService.charProperties(a,x);h=Qs.extractWidth(D);let k=Qs.extractShouldJoin(D),G=k?Qs.extractWidth(x):0;if(x=D,f&&this._onA11yChar.fire(Ds(a)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+h-G>v){if(g){let Q=y,ve=this._activeBuffer.x-G;for(this._activeBuffer.x=G,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),y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),G>0&&y instanceof Zn&&y.copyCellsFrom(Q,ve,0,G,!1);ve<v;)Q.setCellFromCodepoint(ve++,0,1,C)}else if(this._activeBuffer.x=v-1,h===2)continue}if(k&&this._activeBuffer.x){let Q=y.getWidth(this._activeBuffer.x-1)?1:2;y.addCodepointToCell(this._activeBuffer.x-Q,a,h);for(let ve=h-G;--ve>=0;)y.setCellFromCodepoint(this._activeBuffer.x++,0,0,C);continue}if(_&&(y.insertCells(this._activeBuffer.x,h-G,this._activeBuffer.getNullCell(C)),y.getWidth(v-1)===2&&y.setCellFromCodepoint(v-1,0,1,C)),y.setCellFromCodepoint(this._activeBuffer.x++,a,h,C),h>0)for(;--h;)y.setCellFromCodepoint(this._activeBuffer.x++,0,0,C)}this._parser.precedingJoinState=x,this._activeBuffer.x<v&&n-s>0&&y.getWidth(this._activeBuffer.x)===0&&!y.hasContent(this._activeBuffer.x)&&y.setCellFromCodepoint(this._activeBuffer.x,0,1,C),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(t,s){return t.final==="t"&&!t.prefix&&!t.intermediates?this._parser.registerCsiHandler(t,n=>pg(n.params[0],this._optionsService.rawOptions.windowOptions)?s(n):!0):this._parser.registerCsiHandler(t,s)}registerDcsHandler(t,s){return this._parser.registerDcsHandler(t,new vg(s))}registerEscHandler(t,s){return this._parser.registerEscHandler(t,s)}registerOscHandler(t,s){return this._parser.registerOscHandler(t,new Zt(s))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;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 t=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-t),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(t=this._bufferService.cols-1){this._activeBuffer.x=Math.min(t,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(t,s){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=t,this._activeBuffer.y=this._activeBuffer.scrollTop+s):(this._activeBuffer.x=t,this._activeBuffer.y=s),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(t,s){this._restrictCursor(),this._setCursor(this._activeBuffer.x+t,this._activeBuffer.y+s)}cursorUp(t){let s=this._activeBuffer.y-this._activeBuffer.scrollTop;return s>=0?this._moveCursor(0,-Math.min(s,t.params[0]||1)):this._moveCursor(0,-(t.params[0]||1)),!0}cursorDown(t){let s=this._activeBuffer.scrollBottom-this._activeBuffer.y;return s>=0?this._moveCursor(0,Math.min(s,t.params[0]||1)):this._moveCursor(0,t.params[0]||1),!0}cursorForward(t){return this._moveCursor(t.params[0]||1,0),!0}cursorBackward(t){return this._moveCursor(-(t.params[0]||1),0),!0}cursorNextLine(t){return this.cursorDown(t),this._activeBuffer.x=0,!0}cursorPrecedingLine(t){return this.cursorUp(t),this._activeBuffer.x=0,!0}cursorCharAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(t){return this._setCursor(t.length>=2?(t.params[1]||1)-1:0,(t.params[0]||1)-1),!0}charPosAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(t){return this._moveCursor(t.params[0]||1,0),!0}linePosAbsolute(t){return this._setCursor(this._activeBuffer.x,(t.params[0]||1)-1),!0}vPositionRelative(t){return this._moveCursor(0,t.params[0]||1),!0}hVPosition(t){return this.cursorPosition(t),!0}tabClear(t){let s=t.params[0];return s===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:s===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let s=t.params[0]||1;for(;s--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let s=t.params[0]||1;for(;s--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(t){let s=t.params[0];return s===1&&(this._curAttrData.bg|=536870912),(s===2||s===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(t,s,n,a=!1,h=!1){let u=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);u.replaceCells(s,n,this._activeBuffer.getNullCell(this._eraseAttrData()),h),a&&(u.isWrapped=!1)}_resetBufferLine(t,s=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),s),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+t),n.isWrapped=!1)}eraseInDisplay(t,s=!1){this._restrictCursor(this._bufferService.cols);let n;switch(t.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,s);n<this._bufferService.rows;n++)this._resetBufferLine(n,s);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,s),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,s);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+n)?.getTrimmedLength(););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,s);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(t,s=!1){switch(this._restrictCursor(this._bufferService.cols),t.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,s);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,s);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,s);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(t){this._restrictCursor();let s=t.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,a=this._bufferService.rows-1-this._activeBuffer.scrollBottom,h=this._bufferService.rows-1+this._activeBuffer.ybase-a+1;for(;s--;)this._activeBuffer.lines.splice(h-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(t){this._restrictCursor();let s=t.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,a;for(a=this._bufferService.rows-1-this._activeBuffer.scrollBottom,a=this._bufferService.rows-1+this._activeBuffer.ybase-a;s--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(a,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(t){this._restrictCursor();let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return s&&(s.insertCells(this._activeBuffer.x,t.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(t){this._restrictCursor();let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return s&&(s.deleteCells(this._activeBuffer.x,t.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(t){let s=t.params[0]||1;for(;s--;)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(t){let s=t.params[0]||1;for(;s--;)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(st));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let s=t.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);a.deleteCells(0,s,this._activeBuffer.getNullCell(this._eraseAttrData())),a.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let s=t.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);a.insertCells(0,s,this._activeBuffer.getNullCell(this._eraseAttrData())),a.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let s=t.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);a.insertCells(this._activeBuffer.x,s,this._activeBuffer.getNullCell(this._eraseAttrData())),a.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let s=t.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);a.deleteCells(this._activeBuffer.x,s,this._activeBuffer.getNullCell(this._eraseAttrData())),a.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(t){this._restrictCursor();let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return s&&(s.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(t.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(t){let s=this._parser.precedingJoinState;if(!s)return!0;let n=t.params[0]||1,a=Qs.extractWidth(s),h=this._activeBuffer.x-a,u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(h),f=new Uint32Array(u.length*n),v=0;for(let _=0;_<u.length;){let C=u.codePointAt(_)||0;f[v++]=C,_+=C>65535?2:1}let g=v;for(let _=1;_<n;++_)f.copyWithin(g,0,v),g+=v;return this.print(f,0,g),!0}sendDeviceAttributesPrimary(t){return t.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(q.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(q.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(t){return t.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(q.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(q.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(t.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(q.ESC+"[>83;40003;0c")),!0}_is(t){return(this._optionsService.rawOptions.termName+"").indexOf(t)===0}setMode(t){for(let s=0;s<t.length;s++)switch(t.params[s]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(t){for(let s=0;s<t.length;s++)switch(t.params[s]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Zs),this._charsetService.setgCharset(1,Zs),this._charsetService.setgCharset(2,Zs),this._charsetService.setgCharset(3,Zs);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(t){for(let s=0;s<t.length;s++)switch(t.params[s]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(t){for(let s=0;s<t.length;s++)switch(t.params[s]){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(),t.params[s]===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(t,s){let n;(k=>(k[k.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",k[k.SET=1]="SET",k[k.RESET=2]="RESET",k[k.PERMANENTLY_SET=3]="PERMANENTLY_SET",k[k.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(n||={});let a=this._coreService.decPrivateModes,{activeProtocol:h,activeEncoding:u}=this._coreMouseService,f=this._coreService,{buffers:v,cols:g}=this._bufferService,{active:_,alt:C}=v,y=this._optionsService.rawOptions,x=(k,G)=>(f.triggerDataEvent(`${q.ESC}[${s?"":"?"}${k};${G}$y`),!0),A=k=>k?1:2,D=t.params[0];return s?D===2?x(D,4):D===4?x(D,A(f.modes.insertMode)):D===12?x(D,3):D===20?x(D,A(y.convertEol)):x(D,0):D===1?x(D,A(a.applicationCursorKeys)):D===3?x(D,y.windowOptions.setWinLines?g===80?2:g===132?1:0:0):D===6?x(D,A(a.origin)):D===7?x(D,A(a.wraparound)):D===8?x(D,3):D===9?x(D,A(h==="X10")):D===12?x(D,A(y.cursorBlink)):D===25?x(D,A(!f.isCursorHidden)):D===45?x(D,A(a.reverseWraparound)):D===66?x(D,A(a.applicationKeypad)):D===67?x(D,4):D===1e3?x(D,A(h==="VT200")):D===1002?x(D,A(h==="DRAG")):D===1003?x(D,A(h==="ANY")):D===1004?x(D,A(a.sendFocus)):D===1005?x(D,4):D===1006?x(D,A(u==="SGR")):D===1015?x(D,4):D===1016?x(D,A(u==="SGR_PIXELS")):D===1048?x(D,1):D===47||D===1047||D===1049?x(D,A(_===C)):D===2004?x(D,A(a.bracketedPasteMode)):D===2026?x(D,A(a.synchronizedOutput)):x(D,0)}_updateAttrColor(t,s,n,a,h){return s===2?(t|=50331648,t&=-16777216,t|=il.fromColorRGB([n,a,h])):s===5&&(t&=-50331904,t|=33554432|n&255),t}_extractColor(t,s,n){let a=[0,0,-1,0,0,0],h=0,u=0;do{if(a[u+h]=t.params[s+u],t.hasSubParams(s+u)){let f=t.getSubParams(s+u),v=0;do a[1]===5&&(h=1),a[u+v+1+h]=f[v];while(++v<f.length&&v+u+1+h<a.length);break}if(a[1]===5&&u+h>=2||a[1]===2&&u+h>=5)break;a[1]&&(h=1)}while(++u+s<t.length&&u+h<a.length);for(let f=2;f<a.length;++f)a[f]===-1&&(a[f]=0);switch(a[0]){case 38:n.fg=this._updateAttrColor(n.fg,a[1],a[3],a[4],a[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,a[1],a[3],a[4],a[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,a[1],a[3],a[4],a[5])}return u}_processUnderline(t,s){s.extended=s.extended.clone(),(!~t||t>5)&&(t=1),s.extended.underlineStyle=t,s.fg|=268435456,t===0&&(s.fg&=-268435457),s.updateExtended()}_processSGR0(t){t.fg=st.fg,t.bg=st.bg,t.extended=t.extended.clone(),t.extended.underlineStyle=0,t.extended.underlineColor&=-67108864,t.updateExtended()}charAttributes(t){if(t.length===1&&t.params[0]===0)return this._processSGR0(this._curAttrData),!0;let s=t.length,n,a=this._curAttrData;for(let h=0;h<s;h++)n=t.params[h],n>=30&&n<=37?(a.fg&=-50331904,a.fg|=16777216|n-30):n>=40&&n<=47?(a.bg&=-50331904,a.bg|=16777216|n-40):n>=90&&n<=97?(a.fg&=-50331904,a.fg|=16777216|n-90|8):n>=100&&n<=107?(a.bg&=-50331904,a.bg|=16777216|n-100|8):n===0?this._processSGR0(a):n===1?a.fg|=134217728:n===3?a.bg|=67108864:n===4?(a.fg|=268435456,this._processUnderline(t.hasSubParams(h)?t.getSubParams(h)[0]:1,a)):n===5?a.fg|=536870912:n===7?a.fg|=67108864:n===8?a.fg|=1073741824:n===9?a.fg|=2147483648:n===2?a.bg|=134217728:n===21?this._processUnderline(2,a):n===22?(a.fg&=-134217729,a.bg&=-134217729):n===23?a.bg&=-67108865:n===24?(a.fg&=-268435457,this._processUnderline(0,a)):n===25?a.fg&=-536870913:n===27?a.fg&=-67108865:n===28?a.fg&=-1073741825:n===29?a.fg&=2147483647:n===39?(a.fg&=-67108864,a.fg|=st.fg&16777215):n===49?(a.bg&=-67108864,a.bg|=st.bg&16777215):n===38||n===48||n===58?h+=this._extractColor(t,h,a):n===53?a.bg|=1073741824:n===55?a.bg&=-1073741825:n===59?(a.extended=a.extended.clone(),a.extended.underlineColor=-1,a.updateExtended()):n===100?(a.fg&=-67108864,a.fg|=st.fg&16777215,a.bg&=-67108864,a.bg|=st.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(t){switch(t.params[0]){case 5:this._coreService.triggerDataEvent(`${q.ESC}[0n`);break;case 6:let s=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${q.ESC}[${s};${n}R`);break}return!0}deviceStatusPrivate(t){if(t.params[0]===6){let s=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${q.ESC}[?${s};${n}R`)}return!0}softReset(t){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=st.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(t){let s=t.length===0?1:t.params[0];if(s===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(s){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 n=s%2===1;this._coreService.decPrivateModes.cursorBlink=n}return!0}setScrollRegion(t){let s=t.params[0]||1,n;return(t.length<2||(n=t.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>s&&(this._activeBuffer.scrollTop=s-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(t){if(!pg(t.params[0],this._optionsService.rawOptions.windowOptions))return!0;let s=t.length>1?t.params[1]:0;switch(t.params[0]){case 14:s!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${q.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(s===0||s===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>mg&&this._windowTitleStack.shift()),(s===0||s===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>mg&&this._iconNameStack.shift());break;case 23:(s===0||s===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(s===0||s===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(t){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(t){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(t){return this._windowTitle=t,this._onTitleChange.fire(t),!0}setIconName(t){return this._iconName=t,!0}setOrReportIndexedColor(t){let s=[],n=t.split(";");for(;n.length>1;){let a=n.shift(),h=n.shift();if(/^\d+$/.exec(a)){let u=parseInt(a);if(bg(u))if(h==="?")s.push({type:0,index:u});else{let f=gg(h);f&&s.push({type:1,index:u,color:f})}}}return s.length&&this._onColor.fire(s),!0}setHyperlink(t){let s=t.indexOf(";");if(s===-1)return!0;let n=t.slice(0,s).trim(),a=t.slice(s+1);return a?this._createHyperlink(n,a):n.trim()?!1:this._finishHyperlink()}_createHyperlink(t,s){this._getCurrentLinkId()&&this._finishHyperlink();let n=t.split(":"),a,h=n.findIndex(u=>u.startsWith("id="));return h!==-1&&(a=n[h].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:a,uri:s}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(t,s){let n=t.split(";");for(let a=0;a<n.length&&!(s>=this._specialColors.length);++a,++s)if(n[a]==="?")this._onColor.fire([{type:0,index:this._specialColors[s]}]);else{let h=gg(n[a]);h&&this._onColor.fire([{type:1,index:this._specialColors[s],color:h}])}return!0}setOrReportFgColor(t){return this._setOrReportSpecialColor(t,0)}setOrReportBgColor(t){return this._setOrReportSpecialColor(t,1)}setOrReportCursorColor(t){return this._setOrReportSpecialColor(t,2)}restoreIndexedColor(t){if(!t)return this._onColor.fire([{type:2}]),!0;let s=[],n=t.split(";");for(let a=0;a<n.length;++a)if(/^\d+$/.exec(n[a])){let h=parseInt(n[a]);bg(h)&&s.push({type:2,index:h})}return s.length&&this._onColor.fire(s),!0}restoreFgColor(t){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(t){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(t){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,Zs),!0}selectCharset(t){return t.length!==2?(this.selectDefaultCharset(),!0):(t[0]==="/"||this._charsetService.setgCharset(j1[t[0]],ht[t[1]]||Zs),!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 t=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,t,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=st.clone(),this._eraseAttrDataInternal=st.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(t){return this._charsetService.setgLevel(t),!0}screenAlignmentPattern(){let t=new ui;t.content=1<<22|69,t.fg=this._curAttrData.fg,t.bg=this._curAttrData.bg,this._setCursor(0,0);for(let s=0;s<this._bufferService.rows;++s){let n=this._activeBuffer.ybase+this._activeBuffer.y+s,a=this._activeBuffer.lines.get(n);a&&(a.fill(t),a.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(t,s){let n=f=>(this._coreService.triggerDataEvent(`${q.ESC}${f}${q.ESC}\\`),!0),a=this._bufferService.buffer,h=this._optionsService.rawOptions;return n(t==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:t==='"p'?'P1$r61;1"p':t==="r"?`P1$r${a.scrollTop+1};${a.scrollBottom+1}r`:t==="m"?"P1$r0m":t===" q"?`P1$r${{block:2,underline:4,bar:6}[h.cursorStyle]-(h.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(t,s){this._dirtyRowTracker.markRangeDirty(t,s)}},ou=class{constructor(t){this._bufferService=t,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(t){t<this.start?this.start=t:t>this.end&&(this.end=t)}markRangeDirty(t,s){t>s&&(yg=t,t=s,s=yg),t<this.start&&(this.start=t),s>this.end&&(this.end=s)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};ou=Ze([I(0,Mt)],ou);function bg(t){return 0<=t&&t<256}var K1=5e7,Cg=12,W1=50,V1=class extends pe{constructor(t){super(),this._action=t,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new X),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(t,s){if(s!==void 0&&this._syncCalls>s){this._syncCalls=0;return}if(this._pendingData+=t.length,this._writeBuffer.push(t),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let a=this._callbacks.shift();a&&a()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(t,s){if(this._pendingData>K1)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+=t.length,this._writeBuffer.push(t),this._callbacks.push(s),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=t.length,this._writeBuffer.push(t),this._callbacks.push(s)}_innerWrite(t=0,s=!0){let n=t||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let a=this._writeBuffer[this._bufferOffset],h=this._action(a,s);if(h){let f=v=>performance.now()-n>=Cg?setTimeout(()=>this._innerWrite(0,v)):this._innerWrite(n,v);h.catch(v=>(queueMicrotask(()=>{throw v}),Promise.resolve(!1))).then(f);return}let u=this._callbacks[this._bufferOffset];if(u&&u(),this._bufferOffset++,this._pendingData-=a.length,performance.now()-n>=Cg)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>W1&&(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()}},hu=class{constructor(t){this._bufferService=t,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(t){let s=this._bufferService.buffer;if(t.id===void 0){let v=s.addMarker(s.ybase+s.y),g={data:t,id:this._nextId++,lines:[v]};return v.onDispose(()=>this._removeMarkerFromLink(g,v)),this._dataByLinkId.set(g.id,g),g.id}let n=t,a=this._getEntryIdKey(n),h=this._entriesWithId.get(a);if(h)return this.addLineToLink(h.id,s.ybase+s.y),h.id;let u=s.addMarker(s.ybase+s.y),f={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[u]};return u.onDispose(()=>this._removeMarkerFromLink(f,u)),this._entriesWithId.set(f.key,f),this._dataByLinkId.set(f.id,f),f.id}addLineToLink(t,s){let n=this._dataByLinkId.get(t);if(n&&n.lines.every(a=>a.line!==s)){let a=this._bufferService.buffer.addMarker(s);n.lines.push(a),a.onDispose(()=>this._removeMarkerFromLink(n,a))}}getLinkData(t){return this._dataByLinkId.get(t)?.data}_getEntryIdKey(t){return`${t.id};;${t.uri}`}_removeMarkerFromLink(t,s){let n=t.lines.indexOf(s);n!==-1&&(t.lines.splice(n,1),t.lines.length===0&&(t.data.id!==void 0&&this._entriesWithId.delete(t.key),this._dataByLinkId.delete(t.id)))}};hu=Ze([I(0,Mt)],hu);var wg=!1,X1=class extends pe{constructor(t){super(),this._windowsWrappingHeuristics=this._register(new Kr),this._onBinary=this._register(new X),this.onBinary=this._onBinary.event,this._onData=this._register(new X),this.onData=this._onData.event,this._onLineFeed=this._register(new X),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new X),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new X),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new X),this._instantiationService=new v1,this.optionsService=this._register(new x1(t)),this._instantiationService.setService(Bt,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(ru)),this._instantiationService.setService(Mt,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(su)),this._instantiationService.setService(Ng,this._logService),this.coreService=this._register(this._instantiationService.createInstance(nu)),this._instantiationService.setService(er,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(lu)),this._instantiationService.setService(zg,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Qs)),this._instantiationService.setService(u0,this.unicodeService),this._charsetService=this._instantiationService.createInstance(A1),this._instantiationService.setService(c0,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(hu),this._instantiationService.setService(Hg,this._oscLinkService),this._inputHandler=this._register(new Y1(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(wt.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(wt.forward(this._bufferService.onResize,this._onResize)),this._register(wt.forward(this.coreService.onData,this._onData)),this._register(wt.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 V1((s,n)=>this._inputHandler.parse(s,n))),this._register(wt.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new X),this._onScroll.event(t=>{this._onScrollApi?.fire(t.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(t){for(let s in t)this.optionsService.options[s]=t[s]}write(t,s){this._writeBuffer.write(t,s)}writeSync(t,s){this._logService.logLevel<=3&&!wg&&(this._logService.warn("writeSync is unreliable and will be removed soon."),wg=!0),this._writeBuffer.writeSync(t,s)}input(t,s=!0){this.coreService.triggerDataEvent(t,s)}resize(t,s){isNaN(t)||isNaN(s)||(t=Math.max(t,vm),s=Math.max(s,gm),this._bufferService.resize(t,s))}scroll(t,s=!1){this._bufferService.scroll(t,s)}scrollLines(t,s){this._bufferService.scrollLines(t,s)}scrollPages(t){this.scrollLines(t*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(t){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(t){let s=t-this._bufferService.buffer.ydisp;s!==0&&this.scrollLines(s)}registerEscHandler(t,s){return this._inputHandler.registerEscHandler(t,s)}registerDcsHandler(t,s){return this._inputHandler.registerDcsHandler(t,s)}registerCsiHandler(t,s){return this._inputHandler.registerCsiHandler(t,s)}registerOscHandler(t,s){return this._inputHandler.registerOscHandler(t,s)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let t=!1,s=this.optionsService.rawOptions.windowsPty;s&&s.buildNumber!==void 0&&s.buildNumber!==void 0?t=s.backend==="conpty"&&s.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(t=!0),t?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let t=[];t.push(this.onLineFeed(_g.bind(null,this._bufferService))),t.push(this.registerCsiHandler({final:"H"},()=>(_g(this._bufferService),!1))),this._windowsWrappingHeuristics.value=We(()=>{for(let s of t)s.dispose()})}}},G1={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 P1(t,s,n,a){let h={type:0,cancel:!1,key:void 0},u=(t.shiftKey?1:0)|(t.altKey?2:0)|(t.ctrlKey?4:0)|(t.metaKey?8:0);switch(t.keyCode){case 0:t.key==="UIKeyInputUpArrow"?s?h.key=q.ESC+"OA":h.key=q.ESC+"[A":t.key==="UIKeyInputLeftArrow"?s?h.key=q.ESC+"OD":h.key=q.ESC+"[D":t.key==="UIKeyInputRightArrow"?s?h.key=q.ESC+"OC":h.key=q.ESC+"[C":t.key==="UIKeyInputDownArrow"&&(s?h.key=q.ESC+"OB":h.key=q.ESC+"[B");break;case 8:h.key=t.ctrlKey?"\b":q.DEL,t.altKey&&(h.key=q.ESC+h.key);break;case 9:if(t.shiftKey){h.key=q.ESC+"[Z";break}h.key=q.HT,h.cancel=!0;break;case 13:h.key=t.altKey?q.ESC+q.CR:q.CR,h.cancel=!0;break;case 27:h.key=q.ESC,t.altKey&&(h.key=q.ESC+q.ESC),h.cancel=!0;break;case 37:if(t.metaKey)break;u?h.key=q.ESC+"[1;"+(u+1)+"D":s?h.key=q.ESC+"OD":h.key=q.ESC+"[D";break;case 39:if(t.metaKey)break;u?h.key=q.ESC+"[1;"+(u+1)+"C":s?h.key=q.ESC+"OC":h.key=q.ESC+"[C";break;case 38:if(t.metaKey)break;u?h.key=q.ESC+"[1;"+(u+1)+"A":s?h.key=q.ESC+"OA":h.key=q.ESC+"[A";break;case 40:if(t.metaKey)break;u?h.key=q.ESC+"[1;"+(u+1)+"B":s?h.key=q.ESC+"OB":h.key=q.ESC+"[B";break;case 45:!t.shiftKey&&!t.ctrlKey&&(h.key=q.ESC+"[2~");break;case 46:u?h.key=q.ESC+"[3;"+(u+1)+"~":h.key=q.ESC+"[3~";break;case 36:u?h.key=q.ESC+"[1;"+(u+1)+"H":s?h.key=q.ESC+"OH":h.key=q.ESC+"[H";break;case 35:u?h.key=q.ESC+"[1;"+(u+1)+"F":s?h.key=q.ESC+"OF":h.key=q.ESC+"[F";break;case 33:t.shiftKey?h.type=2:t.ctrlKey?h.key=q.ESC+"[5;"+(u+1)+"~":h.key=q.ESC+"[5~";break;case 34:t.shiftKey?h.type=3:t.ctrlKey?h.key=q.ESC+"[6;"+(u+1)+"~":h.key=q.ESC+"[6~";break;case 112:u?h.key=q.ESC+"[1;"+(u+1)+"P":h.key=q.ESC+"OP";break;case 113:u?h.key=q.ESC+"[1;"+(u+1)+"Q":h.key=q.ESC+"OQ";break;case 114:u?h.key=q.ESC+"[1;"+(u+1)+"R":h.key=q.ESC+"OR";break;case 115:u?h.key=q.ESC+"[1;"+(u+1)+"S":h.key=q.ESC+"OS";break;case 116:u?h.key=q.ESC+"[15;"+(u+1)+"~":h.key=q.ESC+"[15~";break;case 117:u?h.key=q.ESC+"[17;"+(u+1)+"~":h.key=q.ESC+"[17~";break;case 118:u?h.key=q.ESC+"[18;"+(u+1)+"~":h.key=q.ESC+"[18~";break;case 119:u?h.key=q.ESC+"[19;"+(u+1)+"~":h.key=q.ESC+"[19~";break;case 120:u?h.key=q.ESC+"[20;"+(u+1)+"~":h.key=q.ESC+"[20~";break;case 121:u?h.key=q.ESC+"[21;"+(u+1)+"~":h.key=q.ESC+"[21~";break;case 122:u?h.key=q.ESC+"[23;"+(u+1)+"~":h.key=q.ESC+"[23~";break;case 123:u?h.key=q.ESC+"[24;"+(u+1)+"~":h.key=q.ESC+"[24~";break;default:if(t.ctrlKey&&!t.shiftKey&&!t.altKey&&!t.metaKey)t.keyCode>=65&&t.keyCode<=90?h.key=String.fromCharCode(t.keyCode-64):t.keyCode===32?h.key=q.NUL:t.keyCode>=51&&t.keyCode<=55?h.key=String.fromCharCode(t.keyCode-51+27):t.keyCode===56?h.key=q.DEL:t.keyCode===219?h.key=q.ESC:t.keyCode===220?h.key=q.FS:t.keyCode===221&&(h.key=q.GS);else if((!n||a)&&t.altKey&&!t.metaKey){let f=G1[t.keyCode]?.[t.shiftKey?1:0];if(f)h.key=q.ESC+f;else if(t.keyCode>=65&&t.keyCode<=90){let v=t.ctrlKey?t.keyCode-64:t.keyCode+32,g=String.fromCharCode(v);t.shiftKey&&(g=g.toUpperCase()),h.key=q.ESC+g}else if(t.keyCode===32)h.key=q.ESC+(t.ctrlKey?q.NUL:" ");else if(t.key==="Dead"&&t.code.startsWith("Key")){let v=t.code.slice(3,4);t.shiftKey||(v=v.toLowerCase()),h.key=q.ESC+v,h.cancel=!0}}else n&&!t.altKey&&!t.ctrlKey&&!t.shiftKey&&t.metaKey?t.keyCode===65&&(h.type=1):t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&t.keyCode>=48&&t.key.length===1?h.key=t.key:t.key&&t.ctrlKey&&(t.key==="_"&&(h.key=q.US),t.key==="@"&&(h.key=q.NUL));break}return h}var $e=0,F1=class{constructor(t){this._getKey=t,this._array=[],this._insertedValues=[],this._flushInsertedTask=new qa,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new qa,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(t){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(t)}_flushInserted(){let t=this._insertedValues.sort((h,u)=>this._getKey(h)-this._getKey(u)),s=0,n=0,a=new Array(this._array.length+this._insertedValues.length);for(let h=0;h<a.length;h++)n>=this._array.length||this._getKey(t[s])<=this._getKey(this._array[n])?(a[h]=t[s],s++):a[h]=this._array[n++];this._array=a,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(t){if(this._flushCleanupInserted(),this._array.length===0)return!1;let s=this._getKey(t);if(s===void 0||($e=this._search(s),$e===-1)||this._getKey(this._array[$e])!==s)return!1;do if(this._array[$e]===t)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push($e),!0;while(++$e<this._array.length&&this._getKey(this._array[$e])===s);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let t=this._deletedIndices.sort((h,u)=>h-u),s=0,n=new Array(this._array.length-t.length),a=0;for(let h=0;h<this._array.length;h++)t[s]===h?s++:n[a++]=this._array[h];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&($e=this._search(t),!($e<0||$e>=this._array.length)&&this._getKey(this._array[$e])===t))do yield this._array[$e];while(++$e<this._array.length&&this._getKey(this._array[$e])===t)}forEachByKey(t,s){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&($e=this._search(t),!($e<0||$e>=this._array.length)&&this._getKey(this._array[$e])===t))do s(this._array[$e]);while(++$e<this._array.length&&this._getKey(this._array[$e])===t)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(t){let s=0,n=this._array.length-1;for(;n>=s;){let a=s+n>>1,h=this._getKey(this._array[a]);if(h>t)n=a-1;else if(h<t)s=a+1;else{for(;a>0&&this._getKey(this._array[a-1])===t;)a--;return a}}return s}},Tc=0,Eg=0,Z1=class extends pe{constructor(){super(),this._decorations=new F1(t=>t?.marker.line),this._onDecorationRegistered=this._register(new X),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new X),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(We(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(t){if(t.marker.isDisposed)return;let s=new Q1(t);if(s){let n=s.marker.onDispose(()=>s.dispose()),a=s.onDispose(()=>{a.dispose(),s&&(this._decorations.delete(s)&&this._onDecorationRemoved.fire(s),n.dispose())});this._decorations.insert(s),this._onDecorationRegistered.fire(s)}return s}reset(){for(let t of this._decorations.values())t.dispose();this._decorations.clear()}*getDecorationsAtCell(t,s,n){let a=0,h=0;for(let u of this._decorations.getKeyIterator(s))a=u.options.x??0,h=a+(u.options.width??1),t>=a&&t<h&&(!n||(u.options.layer??"bottom")===n)&&(yield u)}forEachDecorationAtCell(t,s,n,a){this._decorations.forEachByKey(s,h=>{Tc=h.options.x??0,Eg=Tc+(h.options.width??1),t>=Tc&&t<Eg&&(!n||(h.options.layer??"bottom")===n)&&a(h)})}},Q1=class extends Ms{constructor(t){super(),this.options=t,this.onRenderEmitter=this.add(new X),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new X),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=t.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=Xe.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Xe.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},I1=1e3,$1=class{constructor(t,s=I1){this._renderCallback=t,this._debounceThresholdMS=s,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(t,s,n){this._rowCount=n,t=t!==void 0?t:0,s=s!==void 0?s:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,t):t,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,s):s;let a=performance.now();if(a-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=a,this._innerRefresh();else if(!this._additionalRefreshRequested){let h=a-this._lastRefreshMs,u=this._debounceThresholdMS-h;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},u)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let t=Math.max(this._rowStart,0),s=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(t,s)}},xg=20,ja=class extends pe{constructor(t,s,n,a){super(),this._terminal=t,this._coreBrowserService=n,this._renderService=a,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let h=this._coreBrowserService.mainDocument;this._accessibilityContainer=h.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=h.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let u=0;u<this._terminal.rows;u++)this._rowElements[u]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[u]);if(this._topBoundaryFocusListener=u=>this._handleBoundaryFocus(u,0),this._bottomBoundaryFocusListener=u=>this._handleBoundaryFocus(u,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=h.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new $1(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(u=>this._handleResize(u.rows))),this._register(this._terminal.onRender(u=>this._refreshRows(u.start,u.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(u=>this._handleChar(u))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
22
+ `))),this._register(this._terminal.onA11yTab(u=>this._handleTab(u))),this._register(this._terminal.onKey(u=>this._handleKey(u.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(ce(h,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(We(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(t){for(let s=0;s<t;s++)this._handleChar(" ")}_handleChar(t){this._liveRegionLineCount<xg+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,t===`
23
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===xg+1&&(this._liveRegion.textContent+=Bc.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(t){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(t)||this._charsToConsume.push(t)}_refreshRows(t,s){this._liveRegionDebouncer.refresh(t,s,this._terminal.rows)}_renderRows(t,s){let n=this._terminal.buffer,a=n.lines.length.toString();for(let h=t;h<=s;h++){let u=n.lines.get(n.ydisp+h),f=[],v=u?.translateToString(!0,void 0,void 0,f)||"",g=(n.ydisp+h+1).toString(),_=this._rowElements[h];_&&(v.length===0?(_.textContent=" ",this._rowColumns.set(_,[0,1])):(_.textContent=v,this._rowColumns.set(_,f)),_.setAttribute("aria-posinset",g),_.setAttribute("aria-setsize",a),this._alignRowWidth(_))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(t,s){let n=t.target,a=this._rowElements[s===0?1:this._rowElements.length-2],h=n.getAttribute("aria-posinset"),u=s===0?"1":`${this._terminal.buffer.lines.length}`;if(h===u||t.relatedTarget!==a)return;let f,v;if(s===0?(f=n,v=this._rowElements.pop(),this._rowContainer.removeChild(v)):(f=this._rowElements.shift(),v=n,this._rowContainer.removeChild(f)),f.removeEventListener("focus",this._topBoundaryFocusListener),v.removeEventListener("focus",this._bottomBoundaryFocusListener),s===0){let g=this._createAccessibilityTreeNode();this._rowElements.unshift(g),this._rowContainer.insertAdjacentElement("afterbegin",g)}else{let g=this._createAccessibilityTreeNode();this._rowElements.push(g),this._rowContainer.appendChild(g)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(s===0?-1:1),this._rowElements[s===0?1:this._rowElements.length-2].focus(),t.preventDefault(),t.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let t=this._coreBrowserService.mainDocument.getSelection();if(!t)return;if(t.isCollapsed){this._rowContainer.contains(t.anchorNode)&&this._terminal.clearSelection();return}if(!t.anchorNode||!t.focusNode){console.error("anchorNode and/or focusNode are null");return}let s={node:t.anchorNode,offset:t.anchorOffset},n={node:t.focusNode,offset:t.focusOffset};if((s.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||s.node===n.node&&s.offset>n.offset)&&([s,n]=[n,s]),s.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(s={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(s.node))return;let a=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(a)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:a,offset:a.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let h=({node:v,offset:g})=>{let _=v instanceof Text?v.parentNode:v,C=parseInt(_?.getAttribute("aria-posinset"),10)-1;if(isNaN(C))return console.warn("row is invalid. Race condition?"),null;let y=this._rowColumns.get(_);if(!y)return console.warn("columns is null. Race condition?"),null;let x=g<y.length?y[g]:y.slice(-1)[0]+1;return x>=this._terminal.cols&&(++C,x=0),{row:C,column:x}},u=h(s),f=h(n);if(!(!u||!f)){if(u.row>f.row||u.row===f.row&&u.column>=f.column)throw new Error("invalid range");this._terminal.select(u.column,u.row,(f.row-u.row)*this._terminal.cols-u.column+f.column)}}_handleResize(t){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let s=this._rowContainer.children.length;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let t=this._coreBrowserService.mainDocument.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t}_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 t=0;t<this._terminal.rows;t++)this._refreshRowDimensions(this._rowElements[t]),this._alignRowWidth(this._rowElements[t])}}_refreshRowDimensions(t){t.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(t){t.style.transform="";let s=t.getBoundingClientRect().width,n=this._rowColumns.get(t)?.slice(-1)?.[0];if(!n)return;let a=n*this._renderService.dimensions.css.cell.width;t.style.transform=`scaleX(${a/s})`}};ja=Ze([I(1,fu),I(2,Qi),I(3,Ii)],ja);var cu=class extends pe{constructor(t,s,n,a,h){super(),this._element=t,this._mouseService=s,this._renderService=n,this._bufferService=a,this._linkProviderService=h,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new X),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new X),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(We(()=>{$s(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(ce(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(ce(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(ce(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(ce(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(t){this._lastMouseEvent=t;let s=this._positionFromMouseEvent(t,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;let n=t.composedPath();for(let a=0;a<n.length;a++){let h=n[a];if(h.classList.contains("xterm"))break;if(h.classList.contains("xterm-hover"))return}(!this._lastBufferCell||s.x!==this._lastBufferCell.x||s.y!==this._lastBufferCell.y)&&(this._handleHover(s),this._lastBufferCell=s)}_handleHover(t){if(this._activeLine!==t.y||this._wasResized){this._clearCurrentLink(),this._askForLink(t,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,t)||(this._clearCurrentLink(),this._askForLink(t,!0))}_askForLink(t,s){(!this._activeProviderReplies||!s)&&(this._activeProviderReplies?.forEach(a=>{a?.forEach(h=>{h.link.dispose&&h.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=t.y);let n=!1;for(let[a,h]of this._linkProviderService.linkProviders.entries())s?this._activeProviderReplies?.get(a)&&(n=this._checkLinkProviderResult(a,t,n)):h.provideLinks(t.y,u=>{if(this._isMouseOut)return;let f=u?.map(v=>({link:v}));this._activeProviderReplies?.set(a,f),n=this._checkLinkProviderResult(a,t,n),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(t.y,this._activeProviderReplies)})}_removeIntersectingLinks(t,s){let n=new Set;for(let a=0;a<s.size;a++){let h=s.get(a);if(h)for(let u=0;u<h.length;u++){let f=h[u],v=f.link.range.start.y<t?0:f.link.range.start.x,g=f.link.range.end.y>t?this._bufferService.cols:f.link.range.end.x;for(let _=v;_<=g;_++){if(n.has(_)){h.splice(u--,1);break}n.add(_)}}}}_checkLinkProviderResult(t,s,n){if(!this._activeProviderReplies)return n;let a=this._activeProviderReplies.get(t),h=!1;for(let u=0;u<t;u++)(!this._activeProviderReplies.has(u)||this._activeProviderReplies.get(u))&&(h=!0);if(!h&&a){let u=a.find(f=>this._linkAtPosition(f.link,s));u&&(n=!0,this._handleNewLink(u))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let u=0;u<this._activeProviderReplies.size;u++){let f=this._activeProviderReplies.get(u)?.find(v=>this._linkAtPosition(v.link,s));if(f){n=!0,this._handleNewLink(f);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(t){if(!this._currentLink)return;let s=this._positionFromMouseEvent(t,this._element,this._mouseService);s&&this._mouseDownLink&&J1(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(t,this._currentLink.link.text)}_clearCurrentLink(t,s){!this._currentLink||!this._lastMouseEvent||(!t||!s||this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,$s(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(t){if(!this._lastMouseEvent)return;let s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(t.link,s)&&(this._currentLink=t,this._currentLink.state={decorations:{underline:t.link.decorations===void 0?!0:t.link.decorations.underline,pointerCursor:t.link.decorations===void 0?!0:t.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,t.link,this._lastMouseEvent),t.link.decorations={},Object.defineProperties(t.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:n=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:n=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(t.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(n=>{if(!this._currentLink)return;let a=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,h=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=h&&(this._clearCurrentLink(a,h),this._lastMouseEvent)){let u=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);u&&this._askForLink(u,!1)}})))}_linkHover(t,s,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&t.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(n,s.text)}_fireUnderlineEvent(t,s){let n=t.range,a=this._bufferService.buffer.ydisp,h=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-a-1,n.end.x,n.end.y-a-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(h)}_linkLeave(t,s,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&t.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(n,s.text)}_linkAtPosition(t,s){let n=t.range.start.y*this._bufferService.cols+t.range.start.x,a=t.range.end.y*this._bufferService.cols+t.range.end.x,h=s.y*this._bufferService.cols+s.x;return n<=h&&h<=a}_positionFromMouseEvent(t,s,n){let a=n.getCoords(t,s,this._bufferService.cols,this._bufferService.rows);if(a)return{x:a[0],y:a[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(t,s,n,a,h){return{x1:t,y1:s,x2:n,y2:a,cols:this._bufferService.cols,fg:h}}};cu=Ze([I(1,du),I(2,Ii),I(3,Mt),I(4,qg)],cu);function J1(t,s){return t.text===s.text&&t.range.start.x===s.range.start.x&&t.range.start.y===s.range.start.y&&t.range.end.x===s.range.end.x&&t.range.end.y===s.range.end.y}var eb=class extends X1{constructor(t={}){super(t),this._linkifier=this._register(new Kr),this.browser=rm,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Kr),this._onCursorMove=this._register(new X),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new X),this.onKey=this._onKey.event,this._onRender=this._register(new X),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new X),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new X),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new X),this.onBell=this._onBell.event,this._onFocus=this._register(new X),this._onBlur=this._register(new X),this._onA11yCharEmitter=this._register(new X),this._onA11yTabEmitter=this._register(new X),this._onWillOpen=this._register(new X),this._setup(),this._decorationService=this._instantiationService.createInstance(Z1),this._instantiationService.setService(sl,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Wy),this._instantiationService.setService(qg,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Rc)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(s=>this.refresh(s?.start??0,s?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(s=>this._reportWindowsOptions(s))),this._register(this._inputHandler.onColor(s=>this._handleColorEvent(s))),this._register(wt.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(wt.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(wt.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(wt.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(s=>this._afterResize(s.cols,s.rows))),this._register(We(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.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(t){if(this._themeService)for(let s of t){let n,a="";switch(s.index){case 256:n="foreground",a="10";break;case 257:n="background",a="11";break;case 258:n="cursor",a="12";break;default:n="ansi",a="4;"+s.index}switch(s.type){case 0:let h=je.toColorRGB(n==="ansi"?this._themeService.colors.ansi[s.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${q.ESC}]${a};${q1(h)}${im.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(u=>u.ansi[s.index]=rt.toColor(...s.color));else{let u=n;this._themeService.modifyColors(f=>f[u]=rt.toColor(...s.color))}break;case 2:this._themeService.restoreColor(s.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(t){t?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(ja,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(t){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(q.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(q.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let t=this.buffer.ybase+this.buffer.y,s=this.buffer.lines.get(t);if(!s)return;let n=Math.min(this.buffer.x,this.cols-1),a=this._renderService.dimensions.css.cell.height,h=s.getWidth(n),u=this._renderService.dimensions.css.cell.width*h,f=this.buffer.y*this._renderService.dimensions.css.cell.height,v=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=v+"px",this.textarea.style.top=f+"px",this.textarea.style.width=u+"px",this.textarea.style.height=a+"px",this.textarea.style.lineHeight=a+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(ce(this.element,"copy",s=>{this.hasSelection()&&r0(s,this._selectionService)}));let t=s=>n0(s,this.textarea,this.coreService,this.optionsService);this._register(ce(this.textarea,"paste",t)),this._register(ce(this.element,"paste",t)),nm?this._register(ce(this.element,"mousedown",s=>{s.button===2&&zv(s,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(ce(this.element,"contextmenu",s=>{zv(s,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),bu&&this._register(ce(this.element,"auxclick",s=>{s.button===1&&Ag(s,this.textarea,this.screenElement)}))}_bindKeys(){this._register(ce(this.textarea,"keyup",t=>this._keyUp(t),!0)),this._register(ce(this.textarea,"keydown",t=>this._keyDown(t),!0)),this._register(ce(this.textarea,"keypress",t=>this._keyPress(t),!0)),this._register(ce(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(ce(this.textarea,"compositionupdate",t=>this._compositionHelper.compositionupdate(t))),this._register(ce(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(ce(this.textarea,"input",t=>this._inputEvent(t),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(t){if(!t)throw new Error("Terminal requires a parent element.");if(t.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=t.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"),t.appendChild(this.element);let s=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),s.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(ce(this.screenElement,"mousemove",h=>this.updateCursorStyle(h))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),s.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Mc.get()),om||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",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(Yy,this.textarea,t.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Qi,this._coreBrowserService),this._register(ce(this.textarea,"focus",h=>this._handleTextAreaFocus(h))),this._register(ce(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance($c,this._document,this._helperContainer),this._instantiationService.setService(Ka,this._charSizeService),this._themeService=this._instantiationService.createInstance(iu),this._instantiationService.setService(Wr,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Ha),this._instantiationService.setService(Ug,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(eu,this.rows,this.screenElement)),this._instantiationService.setService(Ii,this._renderService),this._register(this._renderService.onRenderedViewportChange(h=>this._onRender.fire(h))),this.onResize(h=>this._renderService.resize(h.cols,h.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Zc,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Jc),this._instantiationService.setService(du,this._mouseService);let a=this._linkifier.value=this._register(this._instantiationService.createInstance(cu,this.screenElement));this.element.appendChild(s);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(Pc,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(h=>{super.scrollLines(h,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(tu,this.element,this.screenElement,a)),this._instantiationService.setService(d0,this._selectionService),this._register(this._selectionService.onRequestScrollLines(h=>this.scrollLines(h.amount,h.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(h=>this._renderService.handleSelectionChanged(h.start,h.end,h.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(h=>{this.textarea.value=h,this.textarea.focus(),this.textarea.select()})),this._register(wt.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(Fc,this.screenElement)),this._register(ce(this.element,"mousedown",h=>this._selectionService.handleMouseDown(h))),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(ja,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",h=>this._handleScreenReaderModeOptionChange(h))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Na,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",h=>{!this._overviewRulerRenderer&&h&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Na,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Ic,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let t=this,s=this.element;function n(u){let f=t._mouseService.getMouseReportCoords(u,t.screenElement);if(!f)return!1;let v,g;switch(u.overrideType||u.type){case"mousemove":g=32,u.buttons===void 0?(v=3,u.button!==void 0&&(v=u.button<3?u.button:3)):v=u.buttons&1?0:u.buttons&4?1:u.buttons&2?2:3;break;case"mouseup":g=0,v=u.button<3?u.button:3;break;case"mousedown":g=1,v=u.button<3?u.button:3;break;case"wheel":if(t._customWheelEventHandler&&t._customWheelEventHandler(u)===!1)return!1;let _=u.deltaY;if(_===0||t.coreMouseService.consumeWheelEvent(u,t._renderService?.dimensions?.device?.cell?.height,t._coreBrowserService?.dpr)===0)return!1;g=_<0?0:1,v=4;break;default:return!1}return g===void 0||v===void 0||v>4?!1:t.coreMouseService.triggerMouseEvent({col:f.col,row:f.row,x:f.x,y:f.y,button:v,action:g,ctrl:u.ctrlKey,alt:u.altKey,shift:u.shiftKey})}let a={mouseup:null,wheel:null,mousedrag:null,mousemove:null},h={mouseup:u=>(n(u),u.buttons||(this._document.removeEventListener("mouseup",a.mouseup),a.mousedrag&&this._document.removeEventListener("mousemove",a.mousedrag)),this.cancel(u)),wheel:u=>(n(u),this.cancel(u,!0)),mousedrag:u=>{u.buttons&&n(u)},mousemove:u=>{u.buttons||n(u)}};this._register(this.coreMouseService.onProtocolChange(u=>{u?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(u)),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()),u&8?a.mousemove||(s.addEventListener("mousemove",h.mousemove),a.mousemove=h.mousemove):(s.removeEventListener("mousemove",a.mousemove),a.mousemove=null),u&16?a.wheel||(s.addEventListener("wheel",h.wheel,{passive:!1}),a.wheel=h.wheel):(s.removeEventListener("wheel",a.wheel),a.wheel=null),u&2?a.mouseup||(a.mouseup=h.mouseup):(this._document.removeEventListener("mouseup",a.mouseup),a.mouseup=null),u&4?a.mousedrag||(a.mousedrag=h.mousedrag):(this._document.removeEventListener("mousemove",a.mousedrag),a.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(ce(s,"mousedown",u=>{if(u.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(u)))return n(u),a.mouseup&&this._document.addEventListener("mouseup",a.mouseup),a.mousedrag&&this._document.addEventListener("mousemove",a.mousedrag),this.cancel(u)})),this._register(ce(s,"wheel",u=>{if(!a.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(u)===!1)return!1;if(!this.buffer.hasScrollback){if(u.deltaY===0)return!1;if(t.coreMouseService.consumeWheelEvent(u,t._renderService?.dimensions?.device?.cell?.height,t._coreBrowserService?.dpr)===0)return this.cancel(u,!0);let f=q.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(u.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(f,!0),this.cancel(u,!0)}}},{passive:!1}))}refresh(t,s){this._renderService?.refreshRows(t,s)}updateCursorStyle(t){this._selectionService?.shouldColumnSelect(t)?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(t,s){this._viewport?this._viewport.scrollLines(t):super.scrollLines(t,s),this.refresh(0,this.rows-1)}scrollPages(t){this.scrollLines(t*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(t){t&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(t){let s=t-this._bufferService.buffer.ydisp;s!==0&&this.scrollLines(s)}paste(t){Bg(t,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(t){this._customKeyEventHandler=t}attachCustomWheelEventHandler(t){this._customWheelEventHandler=t}registerLinkProvider(t){return this._linkProviderService.registerLinkProvider(t)}registerCharacterJoiner(t){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let s=this._characterJoinerService.register(t);return this.refresh(0,this.rows-1),s}deregisterCharacterJoiner(t){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(t)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(t){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+t)}registerDecoration(t){return this._decorationService.registerDecoration(t)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(t,s,n){this._selectionService.setSelection(t,s,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(t,s){this._selectionService?.selectLines(t,s)}_keyDown(t){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(t)===!1)return!1;let s=this.browser.isMac&&this.options.macOptionIsMeta&&t.altKey;if(!s&&!this._compositionHelper.keydown(t))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!s&&(t.key==="Dead"||t.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=P1(t,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(t),n.type===3||n.type===2){let a=this.rows-1;return this.scrollLines(n.type===2?-a:a),this.cancel(t,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,t)||(n.cancel&&this.cancel(t,!0),!n.key)||t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&t.key.length===1&&t.key.charCodeAt(0)>=65&&t.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===q.ETX||n.key===q.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:t}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||t.altKey||t.ctrlKey)return this.cancel(t,!0);this._keyDownHandled=!0}_isThirdLevelShift(t,s){let n=t.isMac&&!this.options.macOptionIsMeta&&s.altKey&&!s.ctrlKey&&!s.metaKey||t.isWindows&&s.altKey&&s.ctrlKey&&!s.metaKey||t.isWindows&&s.getModifierState("AltGraph");return s.type==="keypress"?n:n&&(!s.keyCode||s.keyCode>47)}_keyUp(t){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(t)===!1)&&(tb(t)||this.focus(),this.updateCursorStyle(t),this._keyPressHandled=!1)}_keyPress(t){let s;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(t)===!1)return!1;if(this.cancel(t),t.charCode)s=t.charCode;else if(t.which===null||t.which===void 0)s=t.keyCode;else if(t.which!==0&&t.charCode!==0)s=t.which;else return!1;return!s||(t.altKey||t.ctrlKey||t.metaKey)&&!this._isThirdLevelShift(this.browser,t)?!1:(s=String.fromCharCode(s),this._onKey.fire({key:s,domEvent:t}),this._showCursor(),this.coreService.triggerDataEvent(s,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(t){if(t.data&&t.inputType==="insertText"&&(!t.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let s=t.data;return this.coreService.triggerDataEvent(s,!0),this.cancel(t),!0}return!1}resize(t,s){if(t===this.cols&&s===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(t,s)}_afterResize(t,s){this._charSizeService?.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 t=1;t<this.rows;t++)this.buffer.lines.push(this.buffer.getBlankLine(st));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let t=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=t,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(q.ESC+"[I"):this.coreService.triggerDataEvent(q.ESC+"[O")}_reportWindowsOptions(t){if(this._renderService)switch(t){case 0:let s=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${q.ESC}[4;${n};${s}t`);break;case 1:let a=this._renderService.dimensions.css.cell.width.toFixed(0),h=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${q.ESC}[6;${h};${a}t`);break}}cancel(t,s){if(!(!this.options.cancelEvents&&!s))return t.preventDefault(),t.stopPropagation(),!1}};function tb(t){return t.keyCode===16||t.keyCode===17||t.keyCode===18}var ib=class{constructor(){this._addons=[]}dispose(){for(let t=this._addons.length-1;t>=0;t--)this._addons[t].instance.dispose()}loadAddon(t,s){let n={instance:s,dispose:s.dispose,isDisposed:!1};this._addons.push(n),s.dispose=()=>this._wrappedAddonDispose(n),s.activate(t)}_wrappedAddonDispose(t){if(t.isDisposed)return;let s=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===t){s=n;break}if(s===-1)throw new Error("Could not dispose an addon that has not been loaded");t.isDisposed=!0,t.dispose.apply(t.instance),this._addons.splice(s,1)}},sb=class{constructor(t){this._line=t}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(t,s){if(!(t<0||t>=this._line.length))return s?(this._line.loadCell(t,s),s):this._line.loadCell(t,new ui)}translateToString(t,s,n){return this._line.translateToString(t,s,n)}},Dg=class{constructor(t,s){this._buffer=t,this.type=s}init(t){return this._buffer=t,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(t){let s=this._buffer.lines.get(t);if(s)return new sb(s)}getNullCell(){return new ui}},rb=class extends pe{constructor(t){super(),this._core=t,this._onBufferChange=this._register(new X),this.onBufferChange=this._onBufferChange.event,this._normal=new Dg(this._core.buffers.normal,"normal"),this._alternate=new Dg(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)}},nb=class{constructor(t){this._core=t}registerCsiHandler(t,s){return this._core.registerCsiHandler(t,n=>s(n.toArray()))}addCsiHandler(t,s){return this.registerCsiHandler(t,s)}registerDcsHandler(t,s){return this._core.registerDcsHandler(t,(n,a)=>s(n,a.toArray()))}addDcsHandler(t,s){return this.registerDcsHandler(t,s)}registerEscHandler(t,s){return this._core.registerEscHandler(t,s)}addEscHandler(t,s){return this.registerEscHandler(t,s)}registerOscHandler(t,s){return this._core.registerOscHandler(t,s)}addOscHandler(t,s){return this.registerOscHandler(t,s)}},lb=class{constructor(t){this._core=t}register(t){this._core.unicodeService.register(t)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(t){this._core.unicodeService.activeVersion=t}},ab=["cols","rows"],Ei=0,ob=class extends pe{constructor(t){super(),this._core=this._register(new eb(t)),this._addonManager=this._register(new ib),this._publicOptions={...this._core.options};let s=a=>this._core.options[a],n=(a,h)=>{this._checkReadonlyOptions(a),this._core.options[a]=h};for(let a in this._core.options){let h={get:s.bind(this,a),set:n.bind(this,a)};Object.defineProperty(this._publicOptions,a,h)}}_checkReadonlyOptions(t){if(ab.includes(t))throw new Error(`Option "${t}" 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 nb(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new lb(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 rb(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let t=this._core.coreService.decPrivateModes,s="none";switch(this._core.coreMouseService.activeProtocol){case"X10":s="x10";break;case"VT200":s="vt200";break;case"DRAG":s="drag";break;case"ANY":s="any";break}return{applicationCursorKeysMode:t.applicationCursorKeys,applicationKeypadMode:t.applicationKeypad,bracketedPasteMode:t.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:s,originMode:t.origin,reverseWraparoundMode:t.reverseWraparound,sendFocusMode:t.sendFocus,synchronizedOutputMode:t.synchronizedOutput,wraparoundMode:t.wraparound}}get options(){return this._publicOptions}set options(t){for(let s in t)this._publicOptions[s]=t[s]}blur(){this._core.blur()}focus(){this._core.focus()}input(t,s=!0){this._core.input(t,s)}resize(t,s){this._verifyIntegers(t,s),this._core.resize(t,s)}open(t){this._core.open(t)}attachCustomKeyEventHandler(t){this._core.attachCustomKeyEventHandler(t)}attachCustomWheelEventHandler(t){this._core.attachCustomWheelEventHandler(t)}registerLinkProvider(t){return this._core.registerLinkProvider(t)}registerCharacterJoiner(t){return this._checkProposedApi(),this._core.registerCharacterJoiner(t)}deregisterCharacterJoiner(t){this._checkProposedApi(),this._core.deregisterCharacterJoiner(t)}registerMarker(t=0){return this._verifyIntegers(t),this._core.registerMarker(t)}registerDecoration(t){return this._checkProposedApi(),this._verifyPositiveIntegers(t.x??0,t.width??0,t.height??0),this._core.registerDecoration(t)}hasSelection(){return this._core.hasSelection()}select(t,s,n){this._verifyIntegers(t,s,n),this._core.select(t,s,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(t,s){this._verifyIntegers(t,s),this._core.selectLines(t,s)}dispose(){super.dispose()}scrollLines(t){this._verifyIntegers(t),this._core.scrollLines(t)}scrollPages(t){this._verifyIntegers(t),this._core.scrollPages(t)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(t){this._verifyIntegers(t),this._core.scrollToLine(t)}clear(){this._core.clear()}write(t,s){this._core.write(t,s)}writeln(t,s){this._core.write(t),this._core.write(`\r
24
+ `,s)}paste(t){this._core.paste(t)}refresh(t,s){this._verifyIntegers(t,s),this._core.refresh(t,s)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(t){this._addonManager.loadAddon(this,t)}static get strings(){return{get promptLabel(){return Mc.get()},set promptLabel(t){Mc.set(t)},get tooMuchOutput(){return Bc.get()},set tooMuchOutput(t){Bc.set(t)}}}_verifyIntegers(...t){for(Ei of t)if(Ei===1/0||isNaN(Ei)||Ei%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...t){for(Ei of t)if(Ei&&(Ei===1/0||isNaN(Ei)||Ei%1!==0||Ei<0))throw new Error("This API only accepts positive integers")}};const gi={apiUrl:""};function hb({sessionId:t,wsToken:s,onReady:n,onLevelComplete:a}){const h=me.useRef(null),u=me.useRef(null),f=me.useRef(null),v=me.useRef(null),g=me.useRef(null),_=me.useRef(0),C=me.useRef(n),y=me.useRef(a);return C.current=n,y.current=a,me.useEffect(()=>{if(!h.current)return;let x=!0;const A=5,D=2e3,k=new ob({cursorBlink:!0,fontSize:14,fontFamily:'Menlo, Monaco, "Courier New", monospace',theme:{background:"#1a1a2e",foreground:"#eee",cursor:"#f0f0f0",cursorAccent:"#1a1a2e",selectionBackground:"#6366f1"}}),G=new JS;v.current=G,k.loadAddon(G),k.open(h.current),G.fit(),k.focus(),u.current=k;const Q=()=>{if(!x)return;const Z=`${gi.apiUrl.replace("http","ws")}/ws/terminal/${t}?token=${s}`,ee=new WebSocket(Z);f.current=ee,ee.onopen=()=>{x&&(_.current=0,C.current?.())},ee.onmessage=se=>{if(!x)return;const ie=se.data;if(typeof ie=="string"){if(ie.includes("__LEVEL_COMPLETE__")){k.write(ie.replace("__LEVEL_COMPLETE__","")),y.current?.();return}k.write(ie)}},ee.onerror=()=>{},ee.onclose=se=>{if(x){if(se.code===1e3||se.code===1008){k.writeln(`\r
25
+ \x1B[33mDisconnected\x1B[0m`);return}_.current<A?(_.current++,k.writeln(`\r
26
+ \x1B[33mConnection lost. Reconnecting (${_.current}/${A})...\x1B[0m`),g.current=window.setTimeout(Q,D)):k.writeln(`\r
27
+ \x1B[31mConnection lost. Please refresh the page.\x1B[0m`)}},k.onData(se=>{ee.readyState===WebSocket.OPEN&&ee.send(se)})},ve=setTimeout(Q,100),J=()=>{G.fit();const Z=f.current;if(Z&&Z.readyState===WebSocket.OPEN){const ee=G.proposeDimensions();ee&&Z.send(JSON.stringify({cols:ee.cols,rows:ee.rows}))}};return window.addEventListener("resize",J),()=>{x=!1,clearTimeout(ve),g.current&&clearTimeout(g.current),window.removeEventListener("resize",J),f.current&&f.current.close(1e3),k.dispose()}},[t,s]),K.jsx("div",{ref:h,style:{width:"100%",height:"100%",padding:"10px",backgroundColor:"#1a1a2e"}})}function cb({url:t,onEnded:s,onReady:n}){const h=(u=>{const f=u.match(/(?:youtu\.be\/|youtube\.com\/watch\?v=|youtube\.com\/embed\/)([^&?/]+)/);return f?f[1]:null})(t);return h?K.jsx("div",{className:"video-player-container",children:K.jsx("iframe",{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${h}`,title:"Lesson video",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}):K.jsx("div",{className:"video-player-container",children:"Invalid video URL"})}function ub(){const[t,s]=me.useState([]),[n,a]=me.useState(!0);return me.useEffect(()=>{fetch(`${gi.apiUrl}/api/leaderboard`).then(h=>h.json()).then(h=>s(h)).catch(()=>{}).finally(()=>a(!1))},[]),n?K.jsx("div",{className:"leaderboard",children:"Loading leaderboard..."}):t.length===0?null:K.jsxs("div",{className:"leaderboard",children:[K.jsx("h3",{children:"Leaderboard"}),K.jsxs("table",{children:[K.jsx("thead",{children:K.jsxs("tr",{children:[K.jsx("th",{children:"#"}),K.jsx("th",{children:"Name"}),K.jsx("th",{children:"Completed"})]})}),K.jsx("tbody",{children:t.map((h,u)=>K.jsxs("tr",{children:[K.jsx("td",{children:u+1}),K.jsx("td",{children:h.name}),K.jsxs("td",{children:[h.completed," / 11"]})]},u))})]})]})}function fb(){const[t,s]=me.useState({token:null,email:null,name:null}),[n,a]=me.useState(!0);me.useEffect(()=>{fetch(`${gi.apiUrl}/api/auth/status`).then(v=>v.json()).then(v=>{v.authenticated&&s({token:v.token,email:v.email,name:v.name})}).catch(()=>{}).finally(()=>a(!1))},[]);async function h(v){const g=await fetch(`${gi.apiUrl}/api/auth/request`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:v})});if(!g.ok){const _=await g.json();throw new Error(_.error||"Failed to send code")}}async function u(v,g){const _=await fetch(`${gi.apiUrl}/api/auth/confirm`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:v,code:g})});if(!_.ok){const y=await _.json();throw new Error(y.error||"Invalid code")}const C=await _.json();s({token:C.token,email:C.email,name:C.name})}function f(){fetch(`${gi.apiUrl}/api/auth/logout`,{method:"POST"}).catch(()=>{}),s({token:null,email:null,name:null})}return{auth:t,loading:n,requestCode:h,confirmCode:u,logout:f}}const Tg="claude-course-progress";function db(){const[t,s]=me.useState(()=>{const h=localStorage.getItem(Tg);if(h)try{return JSON.parse(h)}catch{return{completedLessons:[],currentLesson:1}}return{completedLessons:[],currentLesson:1}});return me.useEffect(()=>{localStorage.setItem(Tg,JSON.stringify(t))},[t]),{progress:t,markComplete:h=>{s(u=>({completedLessons:[...new Set([...u.completedLessons,h])],currentLesson:Math.max(u.currentLesson,h+1)}))},resetProgress:()=>{s({completedLessons:[],currentLesson:1})}}}const _b=3e3;function vb(t){const[s,n]=me.useState(null),[a,h]=me.useState(!1),[u,f]=me.useState(null),v=me.useRef(null),g=me.useCallback(async()=>{if(t)try{const _=`${gi.apiUrl}/api/sessions/${t}/progress`,C=await fetch(_);if(C.ok){const y=await C.json();n(y.progress),f(null)}else f("Failed to fetch progress")}catch(_){f(_ instanceof Error?_.message:"Unknown error")}finally{h(!1)}},[t]);return me.useEffect(()=>{if(!t){n(null);return}return h(!0),g(),v.current=window.setInterval(g,_b),()=>{v.current&&clearInterval(v.current)}},[t,g]),{progress:s,loading:a,error:u,refetch:g}}function gb(t,s){if(s.description)return s.description;switch(t){case"file_contains":return`Edit ${s.path||"file"}`;case"file_exists":return`Create ${s.path||"file"}`;case"min_user_messages":return"Send messages to Claude";case"tool_called":return`Use ${s.tool_name||"tool"}`;case"commit_exists":return"Make a git commit";case"command_output":return"Run command successfully";case"file_changed":return`Modify ${s.path||"file"}`;case"glob_exists":return"Create required files";case"home_glob_exists":return"Configure Claude settings";case"tool_called_with_path":return`Use ${s.tool_name||"tool"} on specific file`;default:return t.replace(/_/g," ")}}const Gn=11,mb=5e3;function pb(){const{auth:t,loading:s,requestCode:n,confirmCode:a,logout:h}=fb(),[u,f]=me.useState(null),[v,g]=me.useState(!1),[_,C]=me.useState(""),[y,x]=me.useState(!1),[A,D]=me.useState("watch"),[k,G]=me.useState(1),{progress:Q,markComplete:ve}=db(),[J,Z]=me.useState(""),[ee,se]=me.useState(""),[ie,Ae]=me.useState("email"),[Ye,mt]=me.useState(""),[de,P]=me.useState(!1),{progress:j}=vb(A==="exercise"?u?.session_id??null:null),F=me.useRef(null),W=me.useCallback(()=>{F.current&&(clearInterval(F.current),F.current=null)},[]),w=me.useCallback((p,R)=>{W();const Y=async()=>{try{const V=await fetch(`${gi.apiUrl}/api/sessions/${p}/status`);V.ok&&(await V.json()).completed&&(x(!0),ve(R),W())}catch(V){console.error("Status poll error:",V)}};Y(),F.current=window.setInterval(Y,mb)},[W,ve]);me.useEffect(()=>()=>W(),[W]);const z=async(p=1)=>{g(!0),C(""),x(!1),D("watch"),W();try{const R=await fetch(`${gi.apiUrl}/api/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({level_number:p})});if(!R.ok){const V=await R.json();throw new Error(V.detail||"Failed to start session")}const Y=await R.json();f(Y)}catch(R){C(R instanceof Error?R.message:"Unknown error")}finally{g(!1)}},N=()=>{D("exercise"),u&&w(u.session_id,u.level.number)},re=async()=>{if(!u)return;const p=u.level.number+1;if(p>Gn){f(null),x(!1);return}g(!0),x(!1),D("watch"),W();try{const R=await fetch(`${gi.apiUrl}/api/sessions/${u.session_id}/level`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({level_number:p})});if(!R.ok){const V=await R.json();throw new Error(V.detail||"Failed to update level")}const Y=await R.json();f({...u,level:Y.level})}catch(R){C(R instanceof Error?R.message:"Unknown error")}finally{g(!1)}},he=async()=>{if(u){W();try{await fetch(`${gi.apiUrl}/api/sessions/${u.session_id}`,{method:"DELETE"})}catch(p){console.error("Error ending session:",p)}f(null),x(!1)}};if(s)return K.jsx("div",{className:"start-screen",children:K.jsxs("div",{className:"start-content",children:[K.jsx("h1",{children:"Claude Code Game"}),K.jsx("p",{className:"subtitle",children:"Loading..."})]})});if(!t.token){const p=async()=>{mt(""),P(!0);try{await n(J),Ae("code")}catch(Y){mt(Y instanceof Error?Y.message:"Failed to send code")}finally{P(!1)}},R=async()=>{mt(""),P(!0);try{await a(J,ee)}catch(Y){mt(Y instanceof Error?Y.message:"Invalid code")}finally{P(!1)}};return K.jsx("div",{className:"start-screen",children:K.jsxs("div",{className:"start-content",children:[K.jsx("h1",{children:"Claude Code Game"}),K.jsx("p",{className:"subtitle",children:"Sign in to track your progress on the leaderboard"}),K.jsx("div",{className:"input-group",children:ie==="email"?K.jsxs(K.Fragment,{children:[K.jsx("input",{type:"email",placeholder:"Enter your email",value:J,onChange:Y=>Z(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&!de&&p()}),K.jsx("button",{onClick:p,disabled:de||!J,children:de?"Sending...":"Send Code"})]}):K.jsxs(K.Fragment,{children:[K.jsxs("p",{style:{color:"#888",fontSize:"0.875rem",margin:0},children:["Code sent to ",J]}),K.jsx("input",{type:"text",placeholder:"Enter verification code",value:ee,onChange:Y=>se(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&!de&&R()}),K.jsx("button",{onClick:R,disabled:de||!ee,children:de?"Verifying...":"Verify"}),K.jsx("button",{onClick:()=>{Ae("email"),se(""),mt("")},style:{background:"transparent",border:"1px solid #444",color:"#888"},children:"Back"})]})}),Ye&&K.jsx("p",{className:"error",children:Ye})]})})}if(!u)return K.jsx("div",{className:"start-screen",children:K.jsxs("div",{className:"start-content",children:[K.jsx("h1",{children:"Claude Code Game"}),K.jsx("p",{className:"subtitle",children:"Learn Claude Code through interactive challenges"}),K.jsx("div",{className:"input-group",children:K.jsxs("div",{className:"lesson-select-row",children:[K.jsx("select",{value:k,onChange:p=>G(Number(p.target.value)),className:"lesson-select",children:Array.from({length:Gn},(p,R)=>R+1).map(p=>K.jsxs("option",{value:p,children:["Lesson ",p]},p))}),K.jsx("button",{onClick:()=>z(k),disabled:v,children:v?"Starting...":"Start"})]})}),_&&K.jsx("p",{className:"error",children:_}),K.jsxs("div",{className:"progress-indicator",children:[K.jsxs("span",{children:[Q.completedLessons.length," of ",Gn," lessons complete"]}),K.jsx("div",{className:"progress-bar",children:K.jsx("div",{className:"progress-fill",style:{width:`${Q.completedLessons.length/Gn*100}%`}})})]}),t.token&&K.jsxs("p",{className:"hint",children:["Signed in as ",t.email," ",K.jsx("a",{href:"#",onClick:p=>{p.preventDefault(),h()},children:"Sign out"})]}),t.token&&K.jsx(ub,{})]})});if(A==="watch"){const p=u.level.video?.url;return K.jsxs("div",{className:"lesson-screen",children:[K.jsxs("div",{className:"lesson-header",children:[K.jsx("span",{className:"module-badge",children:u.level.module}),K.jsxs("h1",{children:["Lesson ",u.level.number,": ",u.level.title]})]}),K.jsx("div",{className:"lesson-content",children:p?K.jsxs(K.Fragment,{children:[K.jsx(cb,{url:u.level.video.url,onEnded:()=>{}}),K.jsx("button",{className:"start-exercise-btn",onClick:N,children:"Start Exercise →"})]}):K.jsxs(K.Fragment,{children:[K.jsxs("div",{className:"no-video-message",children:[K.jsx("p",{children:"This lesson doesn't have a video yet."}),K.jsx("p",{children:"Proceed directly to the exercise."})]}),K.jsx("button",{className:"start-exercise-btn",onClick:N,children:"Start Exercise →"})]})})]})}return K.jsxs("div",{className:"game-screen",children:[K.jsxs("div",{className:"sidebar",children:[K.jsxs("div",{className:"level-info",children:[K.jsx("span",{className:"module-badge",children:u.level.module}),K.jsxs("span",{className:"level-badge",children:["Lesson ",u.level.number]}),K.jsx("h2",{children:u.level.title})]}),K.jsxs("div",{className:"instructions",children:[u.level.intro&&K.jsx("div",{className:"intro",style:{whiteSpace:"pre-line",marginBottom:"1rem"},children:u.level.intro}),u.level.exercise&&K.jsxs("p",{className:"objective",children:[K.jsx("strong",{children:"Objective:"})," ",u.level.exercise.objective]}),j&&j.rules.length>0&&K.jsxs("div",{className:"verification-progress",children:[K.jsx("h4",{children:"Progress"}),K.jsx("ul",{className:"verification-checklist",children:j.rules.map((p,R)=>K.jsxs("li",{className:p.passed?"passed":"pending",children:[K.jsx("span",{className:"check-icon",children:p.passed?"✓":"○"}),K.jsx("span",{className:"check-label",children:gb(p.type,p)})]},R))}),K.jsxs("div",{className:"progress-summary",children:[j.passed_count," of ",j.total_count," complete"]})]}),y&&K.jsx("div",{className:"completion-message",children:K.jsx("p",{children:"Nice work! You've completed this lesson's objective."})})]}),u.level.video&&K.jsx("button",{className:"rewatch-btn",onClick:()=>D("watch"),children:"↺ Rewatch Video"}),K.jsx("button",{className:"end-session-btn",onClick:he,children:"End Session"}),y&&K.jsxs("div",{className:"level-complete",children:[K.jsx("p",{children:"Lesson Complete!"}),K.jsxs("p",{className:"exit-hint",children:["Press ",K.jsx("code",{children:"Ctrl+C"})," twice to exit Claude"]}),u.level.number<Gn?K.jsx("button",{onClick:re,children:"Next Lesson →"}):K.jsx("button",{onClick:()=>f(null),children:"Course Complete!"})]})]}),K.jsx("div",{className:"terminal-container",children:K.jsx(hb,{sessionId:u.session_id,wsToken:u.ws_token,onReady:()=>console.log("Terminal ready"),onLevelComplete:()=>{x(!0),ve(u.level.number)}})})]})}QS.createRoot(document.getElementById("root")).render(K.jsx(me.StrictMode,{children:K.jsx(pb,{})}));