@launchsecure/launch-kit 0.0.17 → 0.0.19

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 (78) hide show
  1. package/dist/chart-client/assets/index--120d9P9.css +1 -0
  2. package/dist/chart-client/assets/index-C8ANseEa.js +441 -0
  3. package/dist/chart-client/index.html +2 -2
  4. package/dist/client/assets/index-Bf8zdL3x.css +32 -0
  5. package/dist/client/assets/index-Ds9UP_cj.js +291 -0
  6. package/dist/client/index.html +2 -2
  7. package/dist/council-client/assets/index-CofZh7pS.css +1 -0
  8. package/dist/council-client/assets/index-Dc41S-R2.js +198 -0
  9. package/dist/council-client/index.html +21 -0
  10. package/dist/deck-client/assets/{_baseUniq-BbqvoK-V.js → _baseUniq-DsfOm3t_.js} +1 -1
  11. package/dist/deck-client/assets/{arc-CMtYsIZt.js → arc-NJuvkBv1.js} +1 -1
  12. package/dist/deck-client/assets/{architectureDiagram-Q4EWVU46-BEN5hESa.js → architectureDiagram-Q4EWVU46-BgrcgZs0.js} +1 -1
  13. package/dist/deck-client/assets/{blockDiagram-DXYQGD6D-BV4CZ6k8.js → blockDiagram-DXYQGD6D-C3XoLi15.js} +1 -1
  14. package/dist/deck-client/assets/{c4Diagram-AHTNJAMY-fLcBXqdD.js → c4Diagram-AHTNJAMY-FX2PjLfb.js} +1 -1
  15. package/dist/deck-client/assets/channel-ChQjD1T1.js +1 -0
  16. package/dist/deck-client/assets/{chunk-4BX2VUAB-BO_19zwB.js → chunk-4BX2VUAB-D0aqsJV0.js} +1 -1
  17. package/dist/deck-client/assets/{chunk-4TB4RGXK-iYegd5fu.js → chunk-4TB4RGXK-7qRCCAgK.js} +1 -1
  18. package/dist/deck-client/assets/{chunk-55IACEB6-DM3QwYFL.js → chunk-55IACEB6-DfHG-iqb.js} +1 -1
  19. package/dist/deck-client/assets/{chunk-EDXVE4YY-DGznOul1.js → chunk-EDXVE4YY-DrR52j3B.js} +1 -1
  20. package/dist/deck-client/assets/{chunk-FMBD7UC4-DsANJqYW.js → chunk-FMBD7UC4-D5KSGATB.js} +1 -1
  21. package/dist/deck-client/assets/{chunk-OYMX7WX6-6PGH1F7d.js → chunk-OYMX7WX6-M7hsLRNU.js} +1 -1
  22. package/dist/deck-client/assets/{chunk-QZHKN3VN-Dihf0Uq7.js → chunk-QZHKN3VN-1ynAWO2m.js} +1 -1
  23. package/dist/deck-client/assets/{chunk-YZCP3GAM-Cali2wW5.js → chunk-YZCP3GAM-S2-nGw3D.js} +1 -1
  24. package/dist/deck-client/assets/classDiagram-6PBFFD2Q-B_9iqK1S.js +1 -0
  25. package/dist/deck-client/assets/classDiagram-v2-HSJHXN6E-B_9iqK1S.js +1 -0
  26. package/dist/deck-client/assets/clone-BYt1AMfz.js +1 -0
  27. package/dist/deck-client/assets/{cose-bilkent-S5V4N54A-DsRY4vbI.js → cose-bilkent-S5V4N54A-BcMwozS2.js} +1 -1
  28. package/dist/deck-client/assets/cytoscape.esm-BQk4lpUV.js +331 -0
  29. package/dist/deck-client/assets/{dagre-KV5264BT-DJIKE_pI.js → dagre-KV5264BT-DtKMhl_1.js} +1 -1
  30. package/dist/deck-client/assets/{diagram-5BDNPKRD-Ckgli1SP.js → diagram-5BDNPKRD-1plH69us.js} +1 -1
  31. package/dist/deck-client/assets/{diagram-G4DWMVQ6-CozcDzae.js → diagram-G4DWMVQ6-D_o-BHO3.js} +1 -1
  32. package/dist/deck-client/assets/{diagram-MMDJMWI5-xVSwW3f_.js → diagram-MMDJMWI5-ClZ1LIx6.js} +1 -1
  33. package/dist/deck-client/assets/{diagram-TYMM5635-CJeZVY-P.js → diagram-TYMM5635-B8dKHfRh.js} +1 -1
  34. package/dist/deck-client/assets/{erDiagram-SMLLAGMA-j4wjAERH.js → erDiagram-SMLLAGMA-CY2aCH7-.js} +1 -1
  35. package/dist/deck-client/assets/{flowDiagram-DWJPFMVM-CVLZ1efi.js → flowDiagram-DWJPFMVM-DZZWHti8.js} +1 -1
  36. package/dist/deck-client/assets/{ganttDiagram-T4ZO3ILL-CcIJ7pkP.js → ganttDiagram-T4ZO3ILL-OwGGa6Lu.js} +1 -1
  37. package/dist/deck-client/assets/{gitGraphDiagram-UUTBAWPF-BZRhQX-a.js → gitGraphDiagram-UUTBAWPF-GKyWD4Qt.js} +1 -1
  38. package/dist/deck-client/assets/{graph-D0l25xfo.js → graph-CORzYQdB.js} +1 -1
  39. package/dist/deck-client/assets/index-765AIQ9z.css +1 -0
  40. package/dist/deck-client/assets/{index-BXcoHWVM.js → index-hiIpM7EP.js} +93 -93
  41. package/dist/deck-client/assets/{infoDiagram-42DDH7IO-BLwgxnYT.js → infoDiagram-42DDH7IO-DmgqJCcF.js} +1 -1
  42. package/dist/deck-client/assets/{ishikawaDiagram-UXIWVN3A-BfOLoWv3.js → ishikawaDiagram-UXIWVN3A-D-1v7knu.js} +1 -1
  43. package/dist/deck-client/assets/{journeyDiagram-VCZTEJTY-CPuL6C9h.js → journeyDiagram-VCZTEJTY-CYrGQE7b.js} +1 -1
  44. package/dist/deck-client/assets/{kanban-definition-6JOO6SKY-D3uf7_tx.js → kanban-definition-6JOO6SKY-BJFDWiH-.js} +1 -1
  45. package/dist/deck-client/assets/{layout-CzToiXdK.js → layout-BTFFcaxF.js} +1 -1
  46. package/dist/deck-client/assets/{linear-BU36t460.js → linear-DAbl6COS.js} +1 -1
  47. package/dist/deck-client/assets/{min-DX_q-lqP.js → min-oWHBrFBm.js} +1 -1
  48. package/dist/deck-client/assets/{mindmap-definition-QFDTVHPH-Ccty4O16.js → mindmap-definition-QFDTVHPH-BTCB0VLO.js} +1 -1
  49. package/dist/deck-client/assets/{pieDiagram-DEJITSTG-DVjsvH19.js → pieDiagram-DEJITSTG-CUZChWNA.js} +1 -1
  50. package/dist/deck-client/assets/{quadrantDiagram-34T5L4WZ-DtOXFVW9.js → quadrantDiagram-34T5L4WZ-4M1Um_e4.js} +1 -1
  51. package/dist/deck-client/assets/{requirementDiagram-MS252O5E-BbO_kKg6.js → requirementDiagram-MS252O5E-DLzQZ0B3.js} +1 -1
  52. package/dist/deck-client/assets/{sankeyDiagram-XADWPNL6-qbbj-CmC.js → sankeyDiagram-XADWPNL6-DcNgzV3E.js} +1 -1
  53. package/dist/deck-client/assets/{sequenceDiagram-FGHM5R23-JNKZAgfQ.js → sequenceDiagram-FGHM5R23-CAcI2vC9.js} +1 -1
  54. package/dist/deck-client/assets/{stateDiagram-FHFEXIEX-dtFalcNx.js → stateDiagram-FHFEXIEX-CntjTTm5.js} +1 -1
  55. package/dist/deck-client/assets/stateDiagram-v2-QKLJ7IA2-YiaphOU_.js +1 -0
  56. package/dist/deck-client/assets/{timeline-definition-GMOUNBTQ-Dpp5nqSJ.js → timeline-definition-GMOUNBTQ-D8zrit4U.js} +1 -1
  57. package/dist/deck-client/assets/{vennDiagram-DHZGUBPP-D8qEutX7.js → vennDiagram-DHZGUBPP-C4SuFPgo.js} +1 -1
  58. package/dist/deck-client/assets/{wardley-RL74JXVD-BwMqiNcL.js → wardley-RL74JXVD-B3F-Olcq.js} +58 -58
  59. package/dist/deck-client/assets/{wardleyDiagram-NUSXRM2D-Bxl9X3CK.js → wardleyDiagram-NUSXRM2D-kj73r6f-.js} +1 -1
  60. package/dist/deck-client/assets/{xychartDiagram-5P7HB3ND-DYcvxLhi.js → xychartDiagram-5P7HB3ND-CC_d_Ey3.js} +1 -1
  61. package/dist/deck-client/index.html +2 -2
  62. package/dist/server/chart-serve.js +452 -244
  63. package/dist/server/cli.js +558 -750
  64. package/dist/server/council-entry.js +1418 -0
  65. package/dist/server/council-serve.js +1039 -0
  66. package/dist/server/graph-mcp-entry.js +486 -695
  67. package/package.json +10 -9
  68. package/dist/chart-client/assets/index-BUhuLBaw.js +0 -441
  69. package/dist/chart-client/assets/index-CWRZxjqR.css +0 -1
  70. package/dist/client/assets/index-CAAipH3V.js +0 -291
  71. package/dist/client/assets/index-DtbN793z.css +0 -32
  72. package/dist/deck-client/assets/channel-Nf-B3Qor.js +0 -1
  73. package/dist/deck-client/assets/classDiagram-6PBFFD2Q-3i3-miMR.js +0 -1
  74. package/dist/deck-client/assets/classDiagram-v2-HSJHXN6E-3i3-miMR.js +0 -1
  75. package/dist/deck-client/assets/clone-DXBuQlG8.js +0 -1
  76. package/dist/deck-client/assets/cytoscape.esm-BiciSPf8.js +0 -331
  77. package/dist/deck-client/assets/index-Cdh-f3-c.css +0 -1
  78. package/dist/deck-client/assets/stateDiagram-v2-QKLJ7IA2-CviYYulW.js +0 -1
@@ -1,291 +0,0 @@
1
- function sS(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(n,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function r(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=r(s);fetch(s.href,o)}})();function Gf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qf={exports:{}},Xo={},Xf={exports:{}},ae={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var ti=Symbol.for("react.element"),iS=Symbol.for("react.portal"),oS=Symbol.for("react.fragment"),aS=Symbol.for("react.strict_mode"),lS=Symbol.for("react.profiler"),cS=Symbol.for("react.provider"),uS=Symbol.for("react.context"),dS=Symbol.for("react.forward_ref"),hS=Symbol.for("react.suspense"),fS=Symbol.for("react.memo"),pS=Symbol.for("react.lazy"),Ad=Symbol.iterator;function mS(e){return e===null||typeof e!="object"?null:(e=Ad&&e[Ad]||e["@@iterator"],typeof e=="function"?e:null)}var Yf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Qf=Object.assign,Jf={};function qn(e,t,r){this.props=e,this.context=t,this.refs=Jf,this.updater=r||Yf}qn.prototype.isReactComponent={};qn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};qn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Zf(){}Zf.prototype=qn.prototype;function zc(e,t,r){this.props=e,this.context=t,this.refs=Jf,this.updater=r||Yf}var Uc=zc.prototype=new Zf;Uc.constructor=zc;Qf(Uc,qn.prototype);Uc.isPureReactComponent=!0;var Dd=Array.isArray,ep=Object.prototype.hasOwnProperty,Vc={current:null},tp={key:!0,ref:!0,__self:!0,__source:!0};function rp(e,t,r){var n,s={},o=null,l=null;if(t!=null)for(n in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(o=""+t.key),t)ep.call(t,n)&&!tp.hasOwnProperty(n)&&(s[n]=t[n]);var i=arguments.length-2;if(i===1)s.children=r;else if(1<i){for(var a=Array(i),c=0;c<i;c++)a[c]=arguments[c+2];s.children=a}if(e&&e.defaultProps)for(n in i=e.defaultProps,i)s[n]===void 0&&(s[n]=i[n]);return{$$typeof:ti,type:e,key:o,ref:l,props:s,_owner:Vc.current}}function vS(e,t){return{$$typeof:ti,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Kc(e){return typeof e=="object"&&e!==null&&e.$$typeof===ti}function gS(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Md=/\/+/g;function Fa(e,t){return typeof e=="object"&&e!==null&&e.key!=null?gS(""+e.key):t.toString(36)}function Qi(e,t,r,n,s){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(o){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case ti:case iS:l=!0}}if(l)return l=e,s=s(l),e=n===""?"."+Fa(l,0):n,Dd(s)?(r="",e!=null&&(r=e.replace(Md,"$&/")+"/"),Qi(s,t,r,"",function(c){return c})):s!=null&&(Kc(s)&&(s=vS(s,r+(!s.key||l&&l.key===s.key?"":(""+s.key).replace(Md,"$&/")+"/")+e)),t.push(s)),1;if(l=0,n=n===""?".":n+":",Dd(e))for(var i=0;i<e.length;i++){o=e[i];var a=n+Fa(o,i);l+=Qi(o,t,r,a,s)}else if(a=mS(e),typeof a=="function")for(e=a.call(e),i=0;!(o=e.next()).done;)o=o.value,a=n+Fa(o,i++),l+=Qi(o,t,r,a,s);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function Ci(e,t,r){if(e==null)return e;var n=[],s=0;return Qi(e,n,"","",function(o){return t.call(r,o,s++)}),n}function _S(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var We={current:null},Ji={transition:null},yS={ReactCurrentDispatcher:We,ReactCurrentBatchConfig:Ji,ReactCurrentOwner:Vc};function np(){throw Error("act(...) is not supported in production builds of React.")}ae.Children={map:Ci,forEach:function(e,t,r){Ci(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Ci(e,function(){t++}),t},toArray:function(e){return Ci(e,function(t){return t})||[]},only:function(e){if(!Kc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ae.Component=qn;ae.Fragment=oS;ae.Profiler=lS;ae.PureComponent=zc;ae.StrictMode=aS;ae.Suspense=hS;ae.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=yS;ae.act=np;ae.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=Qf({},e.props),s=e.key,o=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,l=Vc.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(a in t)ep.call(t,a)&&!tp.hasOwnProperty(a)&&(n[a]=t[a]===void 0&&i!==void 0?i[a]:t[a])}var a=arguments.length-2;if(a===1)n.children=r;else if(1<a){i=Array(a);for(var c=0;c<a;c++)i[c]=arguments[c+2];n.children=i}return{$$typeof:ti,type:e.type,key:s,ref:o,props:n,_owner:l}};ae.createContext=function(e){return e={$$typeof:uS,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:cS,_context:e},e.Consumer=e};ae.createElement=rp;ae.createFactory=function(e){var t=rp.bind(null,e);return t.type=e,t};ae.createRef=function(){return{current:null}};ae.forwardRef=function(e){return{$$typeof:dS,render:e}};ae.isValidElement=Kc;ae.lazy=function(e){return{$$typeof:pS,_payload:{_status:-1,_result:e},_init:_S}};ae.memo=function(e,t){return{$$typeof:fS,type:e,compare:t===void 0?null:t}};ae.startTransition=function(e){var t=Ji.transition;Ji.transition={};try{e()}finally{Ji.transition=t}};ae.unstable_act=np;ae.useCallback=function(e,t){return We.current.useCallback(e,t)};ae.useContext=function(e){return We.current.useContext(e)};ae.useDebugValue=function(){};ae.useDeferredValue=function(e){return We.current.useDeferredValue(e)};ae.useEffect=function(e,t){return We.current.useEffect(e,t)};ae.useId=function(){return We.current.useId()};ae.useImperativeHandle=function(e,t,r){return We.current.useImperativeHandle(e,t,r)};ae.useInsertionEffect=function(e,t){return We.current.useInsertionEffect(e,t)};ae.useLayoutEffect=function(e,t){return We.current.useLayoutEffect(e,t)};ae.useMemo=function(e,t){return We.current.useMemo(e,t)};ae.useReducer=function(e,t,r){return We.current.useReducer(e,t,r)};ae.useRef=function(e){return We.current.useRef(e)};ae.useState=function(e){return We.current.useState(e)};ae.useSyncExternalStore=function(e,t,r){return We.current.useSyncExternalStore(e,t,r)};ae.useTransition=function(){return We.current.useTransition()};ae.version="18.3.1";Xf.exports=ae;var g=Xf.exports;const Ve=Gf(g),Yo=sS({__proto__:null,default:Ve},[g]);/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var SS=g,wS=Symbol.for("react.element"),xS=Symbol.for("react.fragment"),CS=Object.prototype.hasOwnProperty,bS=SS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ES={key:!0,ref:!0,__self:!0,__source:!0};function sp(e,t,r){var n,s={},o=null,l=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(l=t.ref);for(n in t)CS.call(t,n)&&!ES.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:wS,type:e,key:o,ref:l,props:s,_owner:bS.current}}Xo.Fragment=xS;Xo.jsx=sp;Xo.jsxs=sp;qf.exports=Xo;var x=qf.exports,Ll={},ip={exports:{}},at={},op={exports:{}},ap={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(B,R){var L=B.length;B.push(R);e:for(;0<L;){var I=L-1>>>1,D=B[I];if(0<s(D,R))B[I]=R,B[L]=D,L=I;else break e}}function r(B){return B.length===0?null:B[0]}function n(B){if(B.length===0)return null;var R=B[0],L=B.pop();if(L!==R){B[0]=L;e:for(var I=0,D=B.length,z=D>>>1;I<z;){var F=2*(I+1)-1,U=B[F],G=F+1,O=B[G];if(0>s(U,L))G<D&&0>s(O,U)?(B[I]=O,B[G]=L,I=G):(B[I]=U,B[F]=L,I=F);else if(G<D&&0>s(O,L))B[I]=O,B[G]=L,I=G;else break e}}return R}function s(B,R){var L=B.sortIndex-R.sortIndex;return L!==0?L:B.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,i=l.now();e.unstable_now=function(){return l.now()-i}}var a=[],c=[],p=1,u=null,v=3,y=!1,w=!1,_=!1,m=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function f(B){for(var R=r(c);R!==null;){if(R.callback===null)n(c);else if(R.startTime<=B)n(c),R.sortIndex=R.expirationTime,t(a,R);else break;R=r(c)}}function S(B){if(_=!1,f(B),!w)if(r(a)!==null)w=!0,K(E);else{var R=r(c);R!==null&&q(S,R.startTime-B)}}function E(B,R){w=!1,_&&(_=!1,h(C),C=-1),y=!0;var L=v;try{for(f(R),u=r(a);u!==null&&(!(u.expirationTime>R)||B&&!M());){var I=u.callback;if(typeof I=="function"){u.callback=null,v=u.priorityLevel;var D=I(u.expirationTime<=R);R=e.unstable_now(),typeof D=="function"?u.callback=D:u===r(a)&&n(a),f(R)}else n(a);u=r(a)}if(u!==null)var z=!0;else{var F=r(c);F!==null&&q(S,F.startTime-R),z=!1}return z}finally{u=null,v=L,y=!1}}var k=!1,b=null,C=-1,P=5,T=-1;function M(){return!(e.unstable_now()-T<P)}function j(){if(b!==null){var B=e.unstable_now();T=B;var R=!0;try{R=b(!0,B)}finally{R?N():(k=!1,b=null)}}else k=!1}var N;if(typeof d=="function")N=function(){d(j)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,V=$.port2;$.port1.onmessage=j,N=function(){V.postMessage(null)}}else N=function(){m(j,0)};function K(B){b=B,k||(k=!0,N())}function q(B,R){C=m(function(){B(e.unstable_now())},R)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_continueExecution=function(){w||y||(w=!0,K(E))},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return r(a)},e.unstable_next=function(B){switch(v){case 1:case 2:case 3:var R=3;break;default:R=v}var L=v;v=R;try{return B()}finally{v=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(B,R){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var L=v;v=B;try{return R()}finally{v=L}},e.unstable_scheduleCallback=function(B,R,L){var I=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?I+L:I):L=I,B){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=L+D,B={id:p++,callback:R,priorityLevel:B,startTime:L,expirationTime:D,sortIndex:-1},L>I?(B.sortIndex=L,t(c,B),r(a)===null&&B===r(c)&&(_?(h(C),C=-1):_=!0,q(S,L-I))):(B.sortIndex=D,t(a,B),w||y||(w=!0,K(E))),B},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(B){var R=v;return function(){var L=v;v=R;try{return B.apply(this,arguments)}finally{v=L}}}})(ap);op.exports=ap;var kS=op.exports;/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var RS=g,ot=kS;function Q(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var lp=new Set,Ms={};function nn(e,t){jn(e,t),jn(e+"Capture",t)}function jn(e,t){for(Ms[e]=t,e=0;e<t.length;e++)lp.add(t[e])}var Gt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Al=Object.prototype.hasOwnProperty,PS=/^[: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]*$/,Nd={},Id={};function TS(e){return Al.call(Id,e)?!0:Al.call(Nd,e)?!1:PS.test(e)?Id[e]=!0:(Nd[e]=!0,!1)}function LS(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function AS(e,t,r,n){if(t===null||typeof t>"u"||LS(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ze(e,t,r,n,s,o,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=l}var Ie={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ie[e]=new ze(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ie[t]=new ze(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ie[e]=new ze(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ie[e]=new ze(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ie[e]=new ze(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ie[e]=new ze(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ie[e]=new ze(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ie[e]=new ze(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ie[e]=new ze(e,5,!1,e.toLowerCase(),null,!1,!1)});var Gc=/[\-:]([a-z])/g;function qc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Gc,qc);Ie[t]=new ze(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Gc,qc);Ie[t]=new ze(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Gc,qc);Ie[t]=new ze(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ie[e]=new ze(e,1,!1,e.toLowerCase(),null,!1,!1)});Ie.xlinkHref=new ze("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ie[e]=new ze(e,1,!1,e.toLowerCase(),null,!0,!0)});function Xc(e,t,r,n){var s=Ie.hasOwnProperty(t)?Ie[t]:null;(s!==null?s.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(AS(t,r,s,n)&&(r=null),n||s===null?TS(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,n=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var Zt=RS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,bi=Symbol.for("react.element"),gn=Symbol.for("react.portal"),_n=Symbol.for("react.fragment"),Yc=Symbol.for("react.strict_mode"),Dl=Symbol.for("react.profiler"),cp=Symbol.for("react.provider"),up=Symbol.for("react.context"),Qc=Symbol.for("react.forward_ref"),Ml=Symbol.for("react.suspense"),Nl=Symbol.for("react.suspense_list"),Jc=Symbol.for("react.memo"),lr=Symbol.for("react.lazy"),dp=Symbol.for("react.offscreen"),Od=Symbol.iterator;function os(e){return e===null||typeof e!="object"?null:(e=Od&&e[Od]||e["@@iterator"],typeof e=="function"?e:null)}var Se=Object.assign,Ha;function gs(e){if(Ha===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Ha=t&&t[1]||""}return`
34
- `+Ha+e}var Wa=!1;function za(e,t){if(!e||Wa)return"";Wa=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var n=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){n=c}e.call(t.prototype)}else{try{throw Error()}catch(c){n=c}e()}}catch(c){if(c&&n&&typeof c.stack=="string"){for(var s=c.stack.split(`
35
- `),o=n.stack.split(`
36
- `),l=s.length-1,i=o.length-1;1<=l&&0<=i&&s[l]!==o[i];)i--;for(;1<=l&&0<=i;l--,i--)if(s[l]!==o[i]){if(l!==1||i!==1)do if(l--,i--,0>i||s[l]!==o[i]){var a=`
37
- `+s[l].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=l&&0<=i);break}}}finally{Wa=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?gs(e):""}function DS(e){switch(e.tag){case 5:return gs(e.type);case 16:return gs("Lazy");case 13:return gs("Suspense");case 19:return gs("SuspenseList");case 0:case 2:case 15:return e=za(e.type,!1),e;case 11:return e=za(e.type.render,!1),e;case 1:return e=za(e.type,!0),e;default:return""}}function Il(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case _n:return"Fragment";case gn:return"Portal";case Dl:return"Profiler";case Yc:return"StrictMode";case Ml:return"Suspense";case Nl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case up:return(e.displayName||"Context")+".Consumer";case cp:return(e._context.displayName||"Context")+".Provider";case Qc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jc:return t=e.displayName||null,t!==null?t:Il(e.type)||"Memo";case lr:t=e._payload,e=e._init;try{return Il(e(t))}catch{}}return null}function MS(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Il(t);case 8:return t===Yc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function br(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function hp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function NS(e){var t=hp(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(l){n=""+l,o.call(this,l)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(l){n=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ei(e){e._valueTracker||(e._valueTracker=NS(e))}function fp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=hp(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function fo(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}}function Ol(e,t){var r=t.checked;return Se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function jd(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=br(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function pp(e,t){t=t.checked,t!=null&&Xc(e,"checked",t,!1)}function jl(e,t){pp(e,t);var r=br(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Bl(e,t.type,r):t.hasOwnProperty("defaultValue")&&Bl(e,t.type,br(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Bd(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Bl(e,t,r){(t!=="number"||fo(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var _s=Array.isArray;function Tn(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&n&&(e[r].defaultSelected=!0)}else{for(r=""+br(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function $l(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Q(91));return Se({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function $d(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(Q(92));if(_s(r)){if(1<r.length)throw Error(Q(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:br(r)}}function mp(e,t){var r=br(t.value),n=br(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Fd(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function vp(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Fl(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?vp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ki,gp=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ki=ki||document.createElement("div"),ki.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ki.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ns(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Cs={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},IS=["Webkit","ms","Moz","O"];Object.keys(Cs).forEach(function(e){IS.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Cs[t]=Cs[e]})});function _p(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Cs.hasOwnProperty(e)&&Cs[e]?(""+t).trim():t+"px"}function yp(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=_p(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var OS=Se({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Hl(e,t){if(t){if(OS[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Q(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Q(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Q(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Q(62))}}function Wl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 zl=null;function Zc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ul=null,Ln=null,An=null;function Hd(e){if(e=si(e)){if(typeof Ul!="function")throw Error(Q(280));var t=e.stateNode;t&&(t=ta(t),Ul(e.stateNode,e.type,t))}}function Sp(e){Ln?An?An.push(e):An=[e]:Ln=e}function wp(){if(Ln){var e=Ln,t=An;if(An=Ln=null,Hd(e),t)for(e=0;e<t.length;e++)Hd(t[e])}}function xp(e,t){return e(t)}function Cp(){}var Ua=!1;function bp(e,t,r){if(Ua)return e(t,r);Ua=!0;try{return xp(e,t,r)}finally{Ua=!1,(Ln!==null||An!==null)&&(Cp(),wp())}}function Is(e,t){var r=e.stateNode;if(r===null)return null;var n=ta(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(Q(231,t,typeof r));return r}var Vl=!1;if(Gt)try{var as={};Object.defineProperty(as,"passive",{get:function(){Vl=!0}}),window.addEventListener("test",as,as),window.removeEventListener("test",as,as)}catch{Vl=!1}function jS(e,t,r,n,s,o,l,i,a){var c=Array.prototype.slice.call(arguments,3);try{t.apply(r,c)}catch(p){this.onError(p)}}var bs=!1,po=null,mo=!1,Kl=null,BS={onError:function(e){bs=!0,po=e}};function $S(e,t,r,n,s,o,l,i,a){bs=!1,po=null,jS.apply(BS,arguments)}function FS(e,t,r,n,s,o,l,i,a){if($S.apply(this,arguments),bs){if(bs){var c=po;bs=!1,po=null}else throw Error(Q(198));mo||(mo=!0,Kl=c)}}function sn(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Ep(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Wd(e){if(sn(e)!==e)throw Error(Q(188))}function HS(e){var t=e.alternate;if(!t){if(t=sn(e),t===null)throw Error(Q(188));return t!==e?null:e}for(var r=e,n=t;;){var s=r.return;if(s===null)break;var o=s.alternate;if(o===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===r)return Wd(s),e;if(o===n)return Wd(s),t;o=o.sibling}throw Error(Q(188))}if(r.return!==n.return)r=s,n=o;else{for(var l=!1,i=s.child;i;){if(i===r){l=!0,r=s,n=o;break}if(i===n){l=!0,n=s,r=o;break}i=i.sibling}if(!l){for(i=o.child;i;){if(i===r){l=!0,r=o,n=s;break}if(i===n){l=!0,n=o,r=s;break}i=i.sibling}if(!l)throw Error(Q(189))}}if(r.alternate!==n)throw Error(Q(190))}if(r.tag!==3)throw Error(Q(188));return r.stateNode.current===r?e:t}function kp(e){return e=HS(e),e!==null?Rp(e):null}function Rp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Rp(e);if(t!==null)return t;e=e.sibling}return null}var Pp=ot.unstable_scheduleCallback,zd=ot.unstable_cancelCallback,WS=ot.unstable_shouldYield,zS=ot.unstable_requestPaint,xe=ot.unstable_now,US=ot.unstable_getCurrentPriorityLevel,eu=ot.unstable_ImmediatePriority,Tp=ot.unstable_UserBlockingPriority,vo=ot.unstable_NormalPriority,VS=ot.unstable_LowPriority,Lp=ot.unstable_IdlePriority,Qo=null,Ot=null;function KS(e){if(Ot&&typeof Ot.onCommitFiberRoot=="function")try{Ot.onCommitFiberRoot(Qo,e,void 0,(e.current.flags&128)===128)}catch{}}var bt=Math.clz32?Math.clz32:XS,GS=Math.log,qS=Math.LN2;function XS(e){return e>>>=0,e===0?32:31-(GS(e)/qS|0)|0}var Ri=64,Pi=4194304;function ys(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function go(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,o=e.pingedLanes,l=r&268435455;if(l!==0){var i=l&~s;i!==0?n=ys(i):(o&=l,o!==0&&(n=ys(o)))}else l=r&~s,l!==0?n=ys(l):o!==0&&(n=ys(o));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-bt(t),s=1<<r,n|=e[r],t&=~s;return n}function YS(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function QS(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var l=31-bt(o),i=1<<l,a=s[l];a===-1?(!(i&r)||i&n)&&(s[l]=YS(i,t)):a<=t&&(e.expiredLanes|=i),o&=~i}}function Gl(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ap(){var e=Ri;return Ri<<=1,!(Ri&4194240)&&(Ri=64),e}function Va(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function ri(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-bt(t),e[t]=r}function JS(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-bt(r),o=1<<s;t[s]=0,n[s]=-1,e[s]=-1,r&=~o}}function tu(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-bt(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}var ue=0;function Dp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Mp,ru,Np,Ip,Op,ql=!1,Ti=[],mr=null,vr=null,gr=null,Os=new Map,js=new Map,ur=[],ZS="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 submit".split(" ");function Ud(e,t){switch(e){case"focusin":case"focusout":mr=null;break;case"dragenter":case"dragleave":vr=null;break;case"mouseover":case"mouseout":gr=null;break;case"pointerover":case"pointerout":Os.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":js.delete(t.pointerId)}}function ls(e,t,r,n,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:o,targetContainers:[s]},t!==null&&(t=si(t),t!==null&&ru(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function ew(e,t,r,n,s){switch(t){case"focusin":return mr=ls(mr,e,t,r,n,s),!0;case"dragenter":return vr=ls(vr,e,t,r,n,s),!0;case"mouseover":return gr=ls(gr,e,t,r,n,s),!0;case"pointerover":var o=s.pointerId;return Os.set(o,ls(Os.get(o)||null,e,t,r,n,s)),!0;case"gotpointercapture":return o=s.pointerId,js.set(o,ls(js.get(o)||null,e,t,r,n,s)),!0}return!1}function jp(e){var t=Wr(e.target);if(t!==null){var r=sn(t);if(r!==null){if(t=r.tag,t===13){if(t=Ep(r),t!==null){e.blockedOn=t,Op(e.priority,function(){Np(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Zi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Xl(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);zl=n,r.target.dispatchEvent(n),zl=null}else return t=si(r),t!==null&&ru(t),e.blockedOn=r,!1;t.shift()}return!0}function Vd(e,t,r){Zi(e)&&r.delete(t)}function tw(){ql=!1,mr!==null&&Zi(mr)&&(mr=null),vr!==null&&Zi(vr)&&(vr=null),gr!==null&&Zi(gr)&&(gr=null),Os.forEach(Vd),js.forEach(Vd)}function cs(e,t){e.blockedOn===t&&(e.blockedOn=null,ql||(ql=!0,ot.unstable_scheduleCallback(ot.unstable_NormalPriority,tw)))}function Bs(e){function t(s){return cs(s,e)}if(0<Ti.length){cs(Ti[0],e);for(var r=1;r<Ti.length;r++){var n=Ti[r];n.blockedOn===e&&(n.blockedOn=null)}}for(mr!==null&&cs(mr,e),vr!==null&&cs(vr,e),gr!==null&&cs(gr,e),Os.forEach(t),js.forEach(t),r=0;r<ur.length;r++)n=ur[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<ur.length&&(r=ur[0],r.blockedOn===null);)jp(r),r.blockedOn===null&&ur.shift()}var Dn=Zt.ReactCurrentBatchConfig,_o=!0;function rw(e,t,r,n){var s=ue,o=Dn.transition;Dn.transition=null;try{ue=1,nu(e,t,r,n)}finally{ue=s,Dn.transition=o}}function nw(e,t,r,n){var s=ue,o=Dn.transition;Dn.transition=null;try{ue=4,nu(e,t,r,n)}finally{ue=s,Dn.transition=o}}function nu(e,t,r,n){if(_o){var s=Xl(e,t,r,n);if(s===null)tl(e,t,n,yo,r),Ud(e,n);else if(ew(s,e,t,r,n))n.stopPropagation();else if(Ud(e,n),t&4&&-1<ZS.indexOf(e)){for(;s!==null;){var o=si(s);if(o!==null&&Mp(o),o=Xl(e,t,r,n),o===null&&tl(e,t,n,yo,r),o===s)break;s=o}s!==null&&n.stopPropagation()}else tl(e,t,n,null,r)}}var yo=null;function Xl(e,t,r,n){if(yo=null,e=Zc(n),e=Wr(e),e!==null)if(t=sn(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Ep(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return yo=e,null}function Bp(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(US()){case eu:return 1;case Tp:return 4;case vo:case VS:return 16;case Lp:return 536870912;default:return 16}default:return 16}}var hr=null,su=null,eo=null;function $p(){if(eo)return eo;var e,t=su,r=t.length,n,s="value"in hr?hr.value:hr.textContent,o=s.length;for(e=0;e<r&&t[e]===s[e];e++);var l=r-e;for(n=1;n<=l&&t[r-n]===s[o-n];n++);return eo=s.slice(e,1<n?1-n:void 0)}function to(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Li(){return!0}function Kd(){return!1}function lt(e){function t(r,n,s,o,l){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=o,this.target=l,this.currentTarget=null;for(var i in e)e.hasOwnProperty(i)&&(r=e[i],this[i]=r?r(o):o[i]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Li:Kd,this.isPropagationStopped=Kd,this}return Se(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Li)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Li)},persist:function(){},isPersistent:Li}),t}var Xn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},iu=lt(Xn),ni=Se({},Xn,{view:0,detail:0}),sw=lt(ni),Ka,Ga,us,Jo=Se({},ni,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ou,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!==us&&(us&&e.type==="mousemove"?(Ka=e.screenX-us.screenX,Ga=e.screenY-us.screenY):Ga=Ka=0,us=e),Ka)},movementY:function(e){return"movementY"in e?e.movementY:Ga}}),Gd=lt(Jo),iw=Se({},Jo,{dataTransfer:0}),ow=lt(iw),aw=Se({},ni,{relatedTarget:0}),qa=lt(aw),lw=Se({},Xn,{animationName:0,elapsedTime:0,pseudoElement:0}),cw=lt(lw),uw=Se({},Xn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),dw=lt(uw),hw=Se({},Xn,{data:0}),qd=lt(hw),fw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pw={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"},mw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function vw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=mw[e])?!!t[e]:!1}function ou(){return vw}var gw=Se({},ni,{key:function(e){if(e.key){var t=fw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=to(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?pw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ou,charCode:function(e){return e.type==="keypress"?to(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?to(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_w=lt(gw),yw=Se({},Jo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xd=lt(yw),Sw=Se({},ni,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ou}),ww=lt(Sw),xw=Se({},Xn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Cw=lt(xw),bw=Se({},Jo,{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}),Ew=lt(bw),kw=[9,13,27,32],au=Gt&&"CompositionEvent"in window,Es=null;Gt&&"documentMode"in document&&(Es=document.documentMode);var Rw=Gt&&"TextEvent"in window&&!Es,Fp=Gt&&(!au||Es&&8<Es&&11>=Es),Yd=" ",Qd=!1;function Hp(e,t){switch(e){case"keyup":return kw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var yn=!1;function Pw(e,t){switch(e){case"compositionend":return Wp(t);case"keypress":return t.which!==32?null:(Qd=!0,Yd);case"textInput":return e=t.data,e===Yd&&Qd?null:e;default:return null}}function Tw(e,t){if(yn)return e==="compositionend"||!au&&Hp(e,t)?(e=$p(),eo=su=hr=null,yn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Fp&&t.locale!=="ko"?null:t.data;default:return null}}var Lw={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 Jd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Lw[e.type]:t==="textarea"}function zp(e,t,r,n){Sp(n),t=So(t,"onChange"),0<t.length&&(r=new iu("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var ks=null,$s=null;function Aw(e){em(e,0)}function Zo(e){var t=xn(e);if(fp(t))return e}function Dw(e,t){if(e==="change")return t}var Up=!1;if(Gt){var Xa;if(Gt){var Ya="oninput"in document;if(!Ya){var Zd=document.createElement("div");Zd.setAttribute("oninput","return;"),Ya=typeof Zd.oninput=="function"}Xa=Ya}else Xa=!1;Up=Xa&&(!document.documentMode||9<document.documentMode)}function eh(){ks&&(ks.detachEvent("onpropertychange",Vp),$s=ks=null)}function Vp(e){if(e.propertyName==="value"&&Zo($s)){var t=[];zp(t,$s,e,Zc(e)),bp(Aw,t)}}function Mw(e,t,r){e==="focusin"?(eh(),ks=t,$s=r,ks.attachEvent("onpropertychange",Vp)):e==="focusout"&&eh()}function Nw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zo($s)}function Iw(e,t){if(e==="click")return Zo(t)}function Ow(e,t){if(e==="input"||e==="change")return Zo(t)}function jw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:jw;function Fs(e,t){if(kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!Al.call(t,s)||!kt(e[s],t[s]))return!1}return!0}function th(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function rh(e,t){var r=th(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=th(r)}}function Kp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Kp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Gp(){for(var e=window,t=fo();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=fo(e.document)}return t}function lu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Bw(e){var t=Gp(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Kp(r.ownerDocument.documentElement,r)){if(n!==null&&lu(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,o=Math.min(n.start,s);n=n.end===void 0?o:Math.min(n.end,s),!e.extend&&o>n&&(s=n,n=o,o=s),s=rh(r,o);var l=rh(r,n);s&&l&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>n?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var $w=Gt&&"documentMode"in document&&11>=document.documentMode,Sn=null,Yl=null,Rs=null,Ql=!1;function nh(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ql||Sn==null||Sn!==fo(n)||(n=Sn,"selectionStart"in n&&lu(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Rs&&Fs(Rs,n)||(Rs=n,n=So(Yl,"onSelect"),0<n.length&&(t=new iu("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Sn)))}function Ai(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var wn={animationend:Ai("Animation","AnimationEnd"),animationiteration:Ai("Animation","AnimationIteration"),animationstart:Ai("Animation","AnimationStart"),transitionend:Ai("Transition","TransitionEnd")},Qa={},qp={};Gt&&(qp=document.createElement("div").style,"AnimationEvent"in window||(delete wn.animationend.animation,delete wn.animationiteration.animation,delete wn.animationstart.animation),"TransitionEvent"in window||delete wn.transitionend.transition);function ea(e){if(Qa[e])return Qa[e];if(!wn[e])return e;var t=wn[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in qp)return Qa[e]=t[r];return e}var Xp=ea("animationend"),Yp=ea("animationiteration"),Qp=ea("animationstart"),Jp=ea("transitionend"),Zp=new Map,sh="abort auxClick 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(" ");function Tr(e,t){Zp.set(e,t),nn(t,[e])}for(var Ja=0;Ja<sh.length;Ja++){var Za=sh[Ja],Fw=Za.toLowerCase(),Hw=Za[0].toUpperCase()+Za.slice(1);Tr(Fw,"on"+Hw)}Tr(Xp,"onAnimationEnd");Tr(Yp,"onAnimationIteration");Tr(Qp,"onAnimationStart");Tr("dblclick","onDoubleClick");Tr("focusin","onFocus");Tr("focusout","onBlur");Tr(Jp,"onTransitionEnd");jn("onMouseEnter",["mouseout","mouseover"]);jn("onMouseLeave",["mouseout","mouseover"]);jn("onPointerEnter",["pointerout","pointerover"]);jn("onPointerLeave",["pointerout","pointerover"]);nn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));nn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));nn("onBeforeInput",["compositionend","keypress","textInput","paste"]);nn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));nn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));nn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ss="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(" "),Ww=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ss));function ih(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,FS(n,t,void 0,e),e.currentTarget=null}function em(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],s=n.event;n=n.listeners;e:{var o=void 0;if(t)for(var l=n.length-1;0<=l;l--){var i=n[l],a=i.instance,c=i.currentTarget;if(i=i.listener,a!==o&&s.isPropagationStopped())break e;ih(s,i,c),o=a}else for(l=0;l<n.length;l++){if(i=n[l],a=i.instance,c=i.currentTarget,i=i.listener,a!==o&&s.isPropagationStopped())break e;ih(s,i,c),o=a}}}if(mo)throw e=Kl,mo=!1,Kl=null,e}function pe(e,t){var r=t[rc];r===void 0&&(r=t[rc]=new Set);var n=e+"__bubble";r.has(n)||(tm(t,e,2,!1),r.add(n))}function el(e,t,r){var n=0;t&&(n|=4),tm(r,e,n,t)}var Di="_reactListening"+Math.random().toString(36).slice(2);function Hs(e){if(!e[Di]){e[Di]=!0,lp.forEach(function(r){r!=="selectionchange"&&(Ww.has(r)||el(r,!1,e),el(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Di]||(t[Di]=!0,el("selectionchange",!1,t))}}function tm(e,t,r,n){switch(Bp(t)){case 1:var s=rw;break;case 4:s=nw;break;default:s=nu}r=s.bind(null,t,r,e),s=void 0,!Vl||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function tl(e,t,r,n,s){var o=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var l=n.tag;if(l===3||l===4){var i=n.stateNode.containerInfo;if(i===s||i.nodeType===8&&i.parentNode===s)break;if(l===4)for(l=n.return;l!==null;){var a=l.tag;if((a===3||a===4)&&(a=l.stateNode.containerInfo,a===s||a.nodeType===8&&a.parentNode===s))return;l=l.return}for(;i!==null;){if(l=Wr(i),l===null)return;if(a=l.tag,a===5||a===6){n=o=l;continue e}i=i.parentNode}}n=n.return}bp(function(){var c=o,p=Zc(r),u=[];e:{var v=Zp.get(e);if(v!==void 0){var y=iu,w=e;switch(e){case"keypress":if(to(r)===0)break e;case"keydown":case"keyup":y=_w;break;case"focusin":w="focus",y=qa;break;case"focusout":w="blur",y=qa;break;case"beforeblur":case"afterblur":y=qa;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":y=Gd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=ow;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=ww;break;case Xp:case Yp:case Qp:y=cw;break;case Jp:y=Cw;break;case"scroll":y=sw;break;case"wheel":y=Ew;break;case"copy":case"cut":case"paste":y=dw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=Xd}var _=(t&4)!==0,m=!_&&e==="scroll",h=_?v!==null?v+"Capture":null:v;_=[];for(var d=c,f;d!==null;){f=d;var S=f.stateNode;if(f.tag===5&&S!==null&&(f=S,h!==null&&(S=Is(d,h),S!=null&&_.push(Ws(d,S,f)))),m)break;d=d.return}0<_.length&&(v=new y(v,w,null,r,p),u.push({event:v,listeners:_}))}}if(!(t&7)){e:{if(v=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",v&&r!==zl&&(w=r.relatedTarget||r.fromElement)&&(Wr(w)||w[qt]))break e;if((y||v)&&(v=p.window===p?p:(v=p.ownerDocument)?v.defaultView||v.parentWindow:window,y?(w=r.relatedTarget||r.toElement,y=c,w=w?Wr(w):null,w!==null&&(m=sn(w),w!==m||w.tag!==5&&w.tag!==6)&&(w=null)):(y=null,w=c),y!==w)){if(_=Gd,S="onMouseLeave",h="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(_=Xd,S="onPointerLeave",h="onPointerEnter",d="pointer"),m=y==null?v:xn(y),f=w==null?v:xn(w),v=new _(S,d+"leave",y,r,p),v.target=m,v.relatedTarget=f,S=null,Wr(p)===c&&(_=new _(h,d+"enter",w,r,p),_.target=f,_.relatedTarget=m,S=_),m=S,y&&w)t:{for(_=y,h=w,d=0,f=_;f;f=dn(f))d++;for(f=0,S=h;S;S=dn(S))f++;for(;0<d-f;)_=dn(_),d--;for(;0<f-d;)h=dn(h),f--;for(;d--;){if(_===h||h!==null&&_===h.alternate)break t;_=dn(_),h=dn(h)}_=null}else _=null;y!==null&&oh(u,v,y,_,!1),w!==null&&m!==null&&oh(u,m,w,_,!0)}}e:{if(v=c?xn(c):window,y=v.nodeName&&v.nodeName.toLowerCase(),y==="select"||y==="input"&&v.type==="file")var E=Dw;else if(Jd(v))if(Up)E=Ow;else{E=Nw;var k=Mw}else(y=v.nodeName)&&y.toLowerCase()==="input"&&(v.type==="checkbox"||v.type==="radio")&&(E=Iw);if(E&&(E=E(e,c))){zp(u,E,r,p);break e}k&&k(e,v,c),e==="focusout"&&(k=v._wrapperState)&&k.controlled&&v.type==="number"&&Bl(v,"number",v.value)}switch(k=c?xn(c):window,e){case"focusin":(Jd(k)||k.contentEditable==="true")&&(Sn=k,Yl=c,Rs=null);break;case"focusout":Rs=Yl=Sn=null;break;case"mousedown":Ql=!0;break;case"contextmenu":case"mouseup":case"dragend":Ql=!1,nh(u,r,p);break;case"selectionchange":if($w)break;case"keydown":case"keyup":nh(u,r,p)}var b;if(au)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else yn?Hp(e,r)&&(C="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(C="onCompositionStart");C&&(Fp&&r.locale!=="ko"&&(yn||C!=="onCompositionStart"?C==="onCompositionEnd"&&yn&&(b=$p()):(hr=p,su="value"in hr?hr.value:hr.textContent,yn=!0)),k=So(c,C),0<k.length&&(C=new qd(C,e,null,r,p),u.push({event:C,listeners:k}),b?C.data=b:(b=Wp(r),b!==null&&(C.data=b)))),(b=Rw?Pw(e,r):Tw(e,r))&&(c=So(c,"onBeforeInput"),0<c.length&&(p=new qd("onBeforeInput","beforeinput",null,r,p),u.push({event:p,listeners:c}),p.data=b))}em(u,t)})}function Ws(e,t,r){return{instance:e,listener:t,currentTarget:r}}function So(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=Is(e,r),o!=null&&n.unshift(Ws(e,o,s)),o=Is(e,t),o!=null&&n.push(Ws(e,o,s))),e=e.return}return n}function dn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function oh(e,t,r,n,s){for(var o=t._reactName,l=[];r!==null&&r!==n;){var i=r,a=i.alternate,c=i.stateNode;if(a!==null&&a===n)break;i.tag===5&&c!==null&&(i=c,s?(a=Is(r,o),a!=null&&l.unshift(Ws(r,a,i))):s||(a=Is(r,o),a!=null&&l.push(Ws(r,a,i)))),r=r.return}l.length!==0&&e.push({event:t,listeners:l})}var zw=/\r\n?/g,Uw=/\u0000|\uFFFD/g;function ah(e){return(typeof e=="string"?e:""+e).replace(zw,`
38
- `).replace(Uw,"")}function Mi(e,t,r){if(t=ah(t),ah(e)!==t&&r)throw Error(Q(425))}function wo(){}var Jl=null,Zl=null;function ec(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var tc=typeof setTimeout=="function"?setTimeout:void 0,Vw=typeof clearTimeout=="function"?clearTimeout:void 0,lh=typeof Promise=="function"?Promise:void 0,Kw=typeof queueMicrotask=="function"?queueMicrotask:typeof lh<"u"?function(e){return lh.resolve(null).then(e).catch(Gw)}:tc;function Gw(e){setTimeout(function(){throw e})}function rl(e,t){var r=t,n=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){e.removeChild(s),Bs(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);Bs(t)}function _r(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function ch(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Yn=Math.random().toString(36).slice(2),Mt="__reactFiber$"+Yn,zs="__reactProps$"+Yn,qt="__reactContainer$"+Yn,rc="__reactEvents$"+Yn,qw="__reactListeners$"+Yn,Xw="__reactHandles$"+Yn;function Wr(e){var t=e[Mt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[qt]||r[Mt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=ch(e);e!==null;){if(r=e[Mt])return r;e=ch(e)}return t}e=r,r=e.parentNode}return null}function si(e){return e=e[Mt]||e[qt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function xn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Q(33))}function ta(e){return e[zs]||null}var nc=[],Cn=-1;function Lr(e){return{current:e}}function me(e){0>Cn||(e.current=nc[Cn],nc[Cn]=null,Cn--)}function he(e,t){Cn++,nc[Cn]=e.current,e.current=t}var Er={},$e=Lr(Er),qe=Lr(!1),qr=Er;function Bn(e,t){var r=e.type.contextTypes;if(!r)return Er;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in r)s[o]=t[o];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Xe(e){return e=e.childContextTypes,e!=null}function xo(){me(qe),me($e)}function uh(e,t,r){if($e.current!==Er)throw Error(Q(168));he($e,t),he(qe,r)}function rm(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(Q(108,MS(e)||"Unknown",s));return Se({},r,n)}function Co(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Er,qr=$e.current,he($e,e),he(qe,qe.current),!0}function dh(e,t,r){var n=e.stateNode;if(!n)throw Error(Q(169));r?(e=rm(e,t,qr),n.__reactInternalMemoizedMergedChildContext=e,me(qe),me($e),he($e,e)):me(qe),he(qe,r)}var zt=null,ra=!1,nl=!1;function nm(e){zt===null?zt=[e]:zt.push(e)}function Yw(e){ra=!0,nm(e)}function Ar(){if(!nl&&zt!==null){nl=!0;var e=0,t=ue;try{var r=zt;for(ue=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}zt=null,ra=!1}catch(s){throw zt!==null&&(zt=zt.slice(e+1)),Pp(eu,Ar),s}finally{ue=t,nl=!1}}return null}var bn=[],En=0,bo=null,Eo=0,ht=[],ft=0,Xr=null,Ut=1,Vt="";function Fr(e,t){bn[En++]=Eo,bn[En++]=bo,bo=e,Eo=t}function sm(e,t,r){ht[ft++]=Ut,ht[ft++]=Vt,ht[ft++]=Xr,Xr=e;var n=Ut;e=Vt;var s=32-bt(n)-1;n&=~(1<<s),r+=1;var o=32-bt(t)+s;if(30<o){var l=s-s%5;o=(n&(1<<l)-1).toString(32),n>>=l,s-=l,Ut=1<<32-bt(t)+s|r<<s|n,Vt=o+e}else Ut=1<<o|r<<s|n,Vt=e}function cu(e){e.return!==null&&(Fr(e,1),sm(e,1,0))}function uu(e){for(;e===bo;)bo=bn[--En],bn[En]=null,Eo=bn[--En],bn[En]=null;for(;e===Xr;)Xr=ht[--ft],ht[ft]=null,Vt=ht[--ft],ht[ft]=null,Ut=ht[--ft],ht[ft]=null}var nt=null,rt=null,ve=!1,Ct=null;function im(e,t){var r=pt(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function hh(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,nt=e,rt=_r(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,nt=e,rt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Xr!==null?{id:Ut,overflow:Vt}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=pt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,nt=e,rt=null,!0):!1;default:return!1}}function sc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ic(e){if(ve){var t=rt;if(t){var r=t;if(!hh(e,t)){if(sc(e))throw Error(Q(418));t=_r(r.nextSibling);var n=nt;t&&hh(e,t)?im(n,r):(e.flags=e.flags&-4097|2,ve=!1,nt=e)}}else{if(sc(e))throw Error(Q(418));e.flags=e.flags&-4097|2,ve=!1,nt=e}}}function fh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;nt=e}function Ni(e){if(e!==nt)return!1;if(!ve)return fh(e),ve=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ec(e.type,e.memoizedProps)),t&&(t=rt)){if(sc(e))throw om(),Error(Q(418));for(;t;)im(e,t),t=_r(t.nextSibling)}if(fh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Q(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){rt=_r(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}rt=null}}else rt=nt?_r(e.stateNode.nextSibling):null;return!0}function om(){for(var e=rt;e;)e=_r(e.nextSibling)}function $n(){rt=nt=null,ve=!1}function du(e){Ct===null?Ct=[e]:Ct.push(e)}var Qw=Zt.ReactCurrentBatchConfig;function ds(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(Q(309));var n=r.stateNode}if(!n)throw Error(Q(147,e));var s=n,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(l){var i=s.refs;l===null?delete i[o]:i[o]=l},t._stringRef=o,t)}if(typeof e!="string")throw Error(Q(284));if(!r._owner)throw Error(Q(290,e))}return e}function Ii(e,t){throw e=Object.prototype.toString.call(t),Error(Q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ph(e){var t=e._init;return t(e._payload)}function am(e){function t(h,d){if(e){var f=h.deletions;f===null?(h.deletions=[d],h.flags|=16):f.push(d)}}function r(h,d){if(!e)return null;for(;d!==null;)t(h,d),d=d.sibling;return null}function n(h,d){for(h=new Map;d!==null;)d.key!==null?h.set(d.key,d):h.set(d.index,d),d=d.sibling;return h}function s(h,d){return h=xr(h,d),h.index=0,h.sibling=null,h}function o(h,d,f){return h.index=f,e?(f=h.alternate,f!==null?(f=f.index,f<d?(h.flags|=2,d):f):(h.flags|=2,d)):(h.flags|=1048576,d)}function l(h){return e&&h.alternate===null&&(h.flags|=2),h}function i(h,d,f,S){return d===null||d.tag!==6?(d=ul(f,h.mode,S),d.return=h,d):(d=s(d,f),d.return=h,d)}function a(h,d,f,S){var E=f.type;return E===_n?p(h,d,f.props.children,S,f.key):d!==null&&(d.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===lr&&ph(E)===d.type)?(S=s(d,f.props),S.ref=ds(h,d,f),S.return=h,S):(S=lo(f.type,f.key,f.props,null,h.mode,S),S.ref=ds(h,d,f),S.return=h,S)}function c(h,d,f,S){return d===null||d.tag!==4||d.stateNode.containerInfo!==f.containerInfo||d.stateNode.implementation!==f.implementation?(d=dl(f,h.mode,S),d.return=h,d):(d=s(d,f.children||[]),d.return=h,d)}function p(h,d,f,S,E){return d===null||d.tag!==7?(d=Kr(f,h.mode,S,E),d.return=h,d):(d=s(d,f),d.return=h,d)}function u(h,d,f){if(typeof d=="string"&&d!==""||typeof d=="number")return d=ul(""+d,h.mode,f),d.return=h,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case bi:return f=lo(d.type,d.key,d.props,null,h.mode,f),f.ref=ds(h,null,d),f.return=h,f;case gn:return d=dl(d,h.mode,f),d.return=h,d;case lr:var S=d._init;return u(h,S(d._payload),f)}if(_s(d)||os(d))return d=Kr(d,h.mode,f,null),d.return=h,d;Ii(h,d)}return null}function v(h,d,f,S){var E=d!==null?d.key:null;if(typeof f=="string"&&f!==""||typeof f=="number")return E!==null?null:i(h,d,""+f,S);if(typeof f=="object"&&f!==null){switch(f.$$typeof){case bi:return f.key===E?a(h,d,f,S):null;case gn:return f.key===E?c(h,d,f,S):null;case lr:return E=f._init,v(h,d,E(f._payload),S)}if(_s(f)||os(f))return E!==null?null:p(h,d,f,S,null);Ii(h,f)}return null}function y(h,d,f,S,E){if(typeof S=="string"&&S!==""||typeof S=="number")return h=h.get(f)||null,i(d,h,""+S,E);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case bi:return h=h.get(S.key===null?f:S.key)||null,a(d,h,S,E);case gn:return h=h.get(S.key===null?f:S.key)||null,c(d,h,S,E);case lr:var k=S._init;return y(h,d,f,k(S._payload),E)}if(_s(S)||os(S))return h=h.get(f)||null,p(d,h,S,E,null);Ii(d,S)}return null}function w(h,d,f,S){for(var E=null,k=null,b=d,C=d=0,P=null;b!==null&&C<f.length;C++){b.index>C?(P=b,b=null):P=b.sibling;var T=v(h,b,f[C],S);if(T===null){b===null&&(b=P);break}e&&b&&T.alternate===null&&t(h,b),d=o(T,d,C),k===null?E=T:k.sibling=T,k=T,b=P}if(C===f.length)return r(h,b),ve&&Fr(h,C),E;if(b===null){for(;C<f.length;C++)b=u(h,f[C],S),b!==null&&(d=o(b,d,C),k===null?E=b:k.sibling=b,k=b);return ve&&Fr(h,C),E}for(b=n(h,b);C<f.length;C++)P=y(b,h,C,f[C],S),P!==null&&(e&&P.alternate!==null&&b.delete(P.key===null?C:P.key),d=o(P,d,C),k===null?E=P:k.sibling=P,k=P);return e&&b.forEach(function(M){return t(h,M)}),ve&&Fr(h,C),E}function _(h,d,f,S){var E=os(f);if(typeof E!="function")throw Error(Q(150));if(f=E.call(f),f==null)throw Error(Q(151));for(var k=E=null,b=d,C=d=0,P=null,T=f.next();b!==null&&!T.done;C++,T=f.next()){b.index>C?(P=b,b=null):P=b.sibling;var M=v(h,b,T.value,S);if(M===null){b===null&&(b=P);break}e&&b&&M.alternate===null&&t(h,b),d=o(M,d,C),k===null?E=M:k.sibling=M,k=M,b=P}if(T.done)return r(h,b),ve&&Fr(h,C),E;if(b===null){for(;!T.done;C++,T=f.next())T=u(h,T.value,S),T!==null&&(d=o(T,d,C),k===null?E=T:k.sibling=T,k=T);return ve&&Fr(h,C),E}for(b=n(h,b);!T.done;C++,T=f.next())T=y(b,h,C,T.value,S),T!==null&&(e&&T.alternate!==null&&b.delete(T.key===null?C:T.key),d=o(T,d,C),k===null?E=T:k.sibling=T,k=T);return e&&b.forEach(function(j){return t(h,j)}),ve&&Fr(h,C),E}function m(h,d,f,S){if(typeof f=="object"&&f!==null&&f.type===_n&&f.key===null&&(f=f.props.children),typeof f=="object"&&f!==null){switch(f.$$typeof){case bi:e:{for(var E=f.key,k=d;k!==null;){if(k.key===E){if(E=f.type,E===_n){if(k.tag===7){r(h,k.sibling),d=s(k,f.props.children),d.return=h,h=d;break e}}else if(k.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===lr&&ph(E)===k.type){r(h,k.sibling),d=s(k,f.props),d.ref=ds(h,k,f),d.return=h,h=d;break e}r(h,k);break}else t(h,k);k=k.sibling}f.type===_n?(d=Kr(f.props.children,h.mode,S,f.key),d.return=h,h=d):(S=lo(f.type,f.key,f.props,null,h.mode,S),S.ref=ds(h,d,f),S.return=h,h=S)}return l(h);case gn:e:{for(k=f.key;d!==null;){if(d.key===k)if(d.tag===4&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){r(h,d.sibling),d=s(d,f.children||[]),d.return=h,h=d;break e}else{r(h,d);break}else t(h,d);d=d.sibling}d=dl(f,h.mode,S),d.return=h,h=d}return l(h);case lr:return k=f._init,m(h,d,k(f._payload),S)}if(_s(f))return w(h,d,f,S);if(os(f))return _(h,d,f,S);Ii(h,f)}return typeof f=="string"&&f!==""||typeof f=="number"?(f=""+f,d!==null&&d.tag===6?(r(h,d.sibling),d=s(d,f),d.return=h,h=d):(r(h,d),d=ul(f,h.mode,S),d.return=h,h=d),l(h)):r(h,d)}return m}var Fn=am(!0),lm=am(!1),ko=Lr(null),Ro=null,kn=null,hu=null;function fu(){hu=kn=Ro=null}function pu(e){var t=ko.current;me(ko),e._currentValue=t}function oc(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Mn(e,t){Ro=e,hu=kn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ge=!0),e.firstContext=null)}function gt(e){var t=e._currentValue;if(hu!==e)if(e={context:e,memoizedValue:t,next:null},kn===null){if(Ro===null)throw Error(Q(308));kn=e,Ro.dependencies={lanes:0,firstContext:e}}else kn=kn.next=e;return t}var zr=null;function mu(e){zr===null?zr=[e]:zr.push(e)}function cm(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,mu(t)):(r.next=s.next,s.next=r),t.interleaved=r,Xt(e,n)}function Xt(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var cr=!1;function vu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function um(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Kt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function yr(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ce&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,Xt(e,r)}return s=n.interleaved,s===null?(t.next=t,mu(n)):(t.next=s.next,s.next=t),n.interleaved=t,Xt(e,r)}function ro(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,tu(e,r)}}function mh(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var l={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};o===null?s=o=l:o=o.next=l,r=r.next}while(r!==null);o===null?s=o=t:o=o.next=t}else s=o=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Po(e,t,r,n){var s=e.updateQueue;cr=!1;var o=s.firstBaseUpdate,l=s.lastBaseUpdate,i=s.shared.pending;if(i!==null){s.shared.pending=null;var a=i,c=a.next;a.next=null,l===null?o=c:l.next=c,l=a;var p=e.alternate;p!==null&&(p=p.updateQueue,i=p.lastBaseUpdate,i!==l&&(i===null?p.firstBaseUpdate=c:i.next=c,p.lastBaseUpdate=a))}if(o!==null){var u=s.baseState;l=0,p=c=a=null,i=o;do{var v=i.lane,y=i.eventTime;if((n&v)===v){p!==null&&(p=p.next={eventTime:y,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var w=e,_=i;switch(v=t,y=r,_.tag){case 1:if(w=_.payload,typeof w=="function"){u=w.call(y,u,v);break e}u=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=_.payload,v=typeof w=="function"?w.call(y,u,v):w,v==null)break e;u=Se({},u,v);break e;case 2:cr=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,v=s.effects,v===null?s.effects=[i]:v.push(i))}else y={eventTime:y,lane:v,tag:i.tag,payload:i.payload,callback:i.callback,next:null},p===null?(c=p=y,a=u):p=p.next=y,l|=v;if(i=i.next,i===null){if(i=s.shared.pending,i===null)break;v=i,i=v.next,v.next=null,s.lastBaseUpdate=v,s.shared.pending=null}}while(!0);if(p===null&&(a=u),s.baseState=a,s.firstBaseUpdate=c,s.lastBaseUpdate=p,t=s.shared.interleaved,t!==null){s=t;do l|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);Qr|=l,e.lanes=l,e.memoizedState=u}}function vh(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(Q(191,s));s.call(n)}}}var ii={},jt=Lr(ii),Us=Lr(ii),Vs=Lr(ii);function Ur(e){if(e===ii)throw Error(Q(174));return e}function gu(e,t){switch(he(Vs,t),he(Us,e),he(jt,ii),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Fl(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Fl(t,e)}me(jt),he(jt,t)}function Hn(){me(jt),me(Us),me(Vs)}function dm(e){Ur(Vs.current);var t=Ur(jt.current),r=Fl(t,e.type);t!==r&&(he(Us,e),he(jt,r))}function _u(e){Us.current===e&&(me(jt),me(Us))}var _e=Lr(0);function To(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var sl=[];function yu(){for(var e=0;e<sl.length;e++)sl[e]._workInProgressVersionPrimary=null;sl.length=0}var no=Zt.ReactCurrentDispatcher,il=Zt.ReactCurrentBatchConfig,Yr=0,ye=null,Pe=null,Ae=null,Lo=!1,Ps=!1,Ks=0,Jw=0;function Oe(){throw Error(Q(321))}function Su(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!kt(e[r],t[r]))return!1;return!0}function wu(e,t,r,n,s,o){if(Yr=o,ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,no.current=e===null||e.memoizedState===null?rx:nx,e=r(n,s),Ps){o=0;do{if(Ps=!1,Ks=0,25<=o)throw Error(Q(301));o+=1,Ae=Pe=null,t.updateQueue=null,no.current=sx,e=r(n,s)}while(Ps)}if(no.current=Ao,t=Pe!==null&&Pe.next!==null,Yr=0,Ae=Pe=ye=null,Lo=!1,t)throw Error(Q(300));return e}function xu(){var e=Ks!==0;return Ks=0,e}function Dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ae===null?ye.memoizedState=Ae=e:Ae=Ae.next=e,Ae}function _t(){if(Pe===null){var e=ye.alternate;e=e!==null?e.memoizedState:null}else e=Pe.next;var t=Ae===null?ye.memoizedState:Ae.next;if(t!==null)Ae=t,Pe=e;else{if(e===null)throw Error(Q(310));Pe=e,e={memoizedState:Pe.memoizedState,baseState:Pe.baseState,baseQueue:Pe.baseQueue,queue:Pe.queue,next:null},Ae===null?ye.memoizedState=Ae=e:Ae=Ae.next=e}return Ae}function Gs(e,t){return typeof t=="function"?t(e):t}function ol(e){var t=_t(),r=t.queue;if(r===null)throw Error(Q(311));r.lastRenderedReducer=e;var n=Pe,s=n.baseQueue,o=r.pending;if(o!==null){if(s!==null){var l=s.next;s.next=o.next,o.next=l}n.baseQueue=s=o,r.pending=null}if(s!==null){o=s.next,n=n.baseState;var i=l=null,a=null,c=o;do{var p=c.lane;if((Yr&p)===p)a!==null&&(a=a.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),n=c.hasEagerState?c.eagerState:e(n,c.action);else{var u={lane:p,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};a===null?(i=a=u,l=n):a=a.next=u,ye.lanes|=p,Qr|=p}c=c.next}while(c!==null&&c!==o);a===null?l=n:a.next=i,kt(n,t.memoizedState)||(Ge=!0),t.memoizedState=n,t.baseState=l,t.baseQueue=a,r.lastRenderedState=n}if(e=r.interleaved,e!==null){s=e;do o=s.lane,ye.lanes|=o,Qr|=o,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function al(e){var t=_t(),r=t.queue;if(r===null)throw Error(Q(311));r.lastRenderedReducer=e;var n=r.dispatch,s=r.pending,o=t.memoizedState;if(s!==null){r.pending=null;var l=s=s.next;do o=e(o,l.action),l=l.next;while(l!==s);kt(o,t.memoizedState)||(Ge=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),r.lastRenderedState=o}return[o,n]}function hm(){}function fm(e,t){var r=ye,n=_t(),s=t(),o=!kt(n.memoizedState,s);if(o&&(n.memoizedState=s,Ge=!0),n=n.queue,Cu(vm.bind(null,r,n,e),[e]),n.getSnapshot!==t||o||Ae!==null&&Ae.memoizedState.tag&1){if(r.flags|=2048,qs(9,mm.bind(null,r,n,s,t),void 0,null),De===null)throw Error(Q(349));Yr&30||pm(r,t,s)}return s}function pm(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ye.updateQueue,t===null?(t={lastEffect:null,stores:null},ye.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function mm(e,t,r,n){t.value=r,t.getSnapshot=n,gm(t)&&_m(e)}function vm(e,t,r){return r(function(){gm(t)&&_m(e)})}function gm(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!kt(e,r)}catch{return!0}}function _m(e){var t=Xt(e,1);t!==null&&Et(t,e,1,-1)}function gh(e){var t=Dt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Gs,lastRenderedState:e},t.queue=e,e=e.dispatch=tx.bind(null,ye,e),[t.memoizedState,e]}function qs(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=ye.updateQueue,t===null?(t={lastEffect:null,stores:null},ye.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function ym(){return _t().memoizedState}function so(e,t,r,n){var s=Dt();ye.flags|=e,s.memoizedState=qs(1|t,r,void 0,n===void 0?null:n)}function na(e,t,r,n){var s=_t();n=n===void 0?null:n;var o=void 0;if(Pe!==null){var l=Pe.memoizedState;if(o=l.destroy,n!==null&&Su(n,l.deps)){s.memoizedState=qs(t,r,o,n);return}}ye.flags|=e,s.memoizedState=qs(1|t,r,o,n)}function _h(e,t){return so(8390656,8,e,t)}function Cu(e,t){return na(2048,8,e,t)}function Sm(e,t){return na(4,2,e,t)}function wm(e,t){return na(4,4,e,t)}function xm(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Cm(e,t,r){return r=r!=null?r.concat([e]):null,na(4,4,xm.bind(null,t,e),r)}function bu(){}function bm(e,t){var r=_t();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Su(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Em(e,t){var r=_t();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Su(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function km(e,t,r){return Yr&21?(kt(r,t)||(r=Ap(),ye.lanes|=r,Qr|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ge=!0),e.memoizedState=r)}function Zw(e,t){var r=ue;ue=r!==0&&4>r?r:4,e(!0);var n=il.transition;il.transition={};try{e(!1),t()}finally{ue=r,il.transition=n}}function Rm(){return _t().memoizedState}function ex(e,t,r){var n=wr(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Pm(e))Tm(t,r);else if(r=cm(e,t,r,n),r!==null){var s=He();Et(r,e,n,s),Lm(r,t,n)}}function tx(e,t,r){var n=wr(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Pm(e))Tm(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var l=t.lastRenderedState,i=o(l,r);if(s.hasEagerState=!0,s.eagerState=i,kt(i,l)){var a=t.interleaved;a===null?(s.next=s,mu(t)):(s.next=a.next,a.next=s),t.interleaved=s;return}}catch{}finally{}r=cm(e,t,s,n),r!==null&&(s=He(),Et(r,e,n,s),Lm(r,t,n))}}function Pm(e){var t=e.alternate;return e===ye||t!==null&&t===ye}function Tm(e,t){Ps=Lo=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Lm(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,tu(e,r)}}var Ao={readContext:gt,useCallback:Oe,useContext:Oe,useEffect:Oe,useImperativeHandle:Oe,useInsertionEffect:Oe,useLayoutEffect:Oe,useMemo:Oe,useReducer:Oe,useRef:Oe,useState:Oe,useDebugValue:Oe,useDeferredValue:Oe,useTransition:Oe,useMutableSource:Oe,useSyncExternalStore:Oe,useId:Oe,unstable_isNewReconciler:!1},rx={readContext:gt,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:gt,useEffect:_h,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,so(4194308,4,xm.bind(null,t,e),r)},useLayoutEffect:function(e,t){return so(4194308,4,e,t)},useInsertionEffect:function(e,t){return so(4,2,e,t)},useMemo:function(e,t){var r=Dt();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Dt();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=ex.bind(null,ye,e),[n.memoizedState,e]},useRef:function(e){var t=Dt();return e={current:e},t.memoizedState=e},useState:gh,useDebugValue:bu,useDeferredValue:function(e){return Dt().memoizedState=e},useTransition:function(){var e=gh(!1),t=e[0];return e=Zw.bind(null,e[1]),Dt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=ye,s=Dt();if(ve){if(r===void 0)throw Error(Q(407));r=r()}else{if(r=t(),De===null)throw Error(Q(349));Yr&30||pm(n,t,r)}s.memoizedState=r;var o={value:r,getSnapshot:t};return s.queue=o,_h(vm.bind(null,n,o,e),[e]),n.flags|=2048,qs(9,mm.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=Dt(),t=De.identifierPrefix;if(ve){var r=Vt,n=Ut;r=(n&~(1<<32-bt(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Ks++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=Jw++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},nx={readContext:gt,useCallback:bm,useContext:gt,useEffect:Cu,useImperativeHandle:Cm,useInsertionEffect:Sm,useLayoutEffect:wm,useMemo:Em,useReducer:ol,useRef:ym,useState:function(){return ol(Gs)},useDebugValue:bu,useDeferredValue:function(e){var t=_t();return km(t,Pe.memoizedState,e)},useTransition:function(){var e=ol(Gs)[0],t=_t().memoizedState;return[e,t]},useMutableSource:hm,useSyncExternalStore:fm,useId:Rm,unstable_isNewReconciler:!1},sx={readContext:gt,useCallback:bm,useContext:gt,useEffect:Cu,useImperativeHandle:Cm,useInsertionEffect:Sm,useLayoutEffect:wm,useMemo:Em,useReducer:al,useRef:ym,useState:function(){return al(Gs)},useDebugValue:bu,useDeferredValue:function(e){var t=_t();return Pe===null?t.memoizedState=e:km(t,Pe.memoizedState,e)},useTransition:function(){var e=al(Gs)[0],t=_t().memoizedState;return[e,t]},useMutableSource:hm,useSyncExternalStore:fm,useId:Rm,unstable_isNewReconciler:!1};function wt(e,t){if(e&&e.defaultProps){t=Se({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function ac(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:Se({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var sa={isMounted:function(e){return(e=e._reactInternals)?sn(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=He(),s=wr(e),o=Kt(n,s);o.payload=t,r!=null&&(o.callback=r),t=yr(e,o,s),t!==null&&(Et(t,e,s,n),ro(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=He(),s=wr(e),o=Kt(n,s);o.tag=1,o.payload=t,r!=null&&(o.callback=r),t=yr(e,o,s),t!==null&&(Et(t,e,s,n),ro(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=He(),n=wr(e),s=Kt(r,n);s.tag=2,t!=null&&(s.callback=t),t=yr(e,s,n),t!==null&&(Et(t,e,n,r),ro(t,e,n))}};function yh(e,t,r,n,s,o,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,o,l):t.prototype&&t.prototype.isPureReactComponent?!Fs(r,n)||!Fs(s,o):!0}function Am(e,t,r){var n=!1,s=Er,o=t.contextType;return typeof o=="object"&&o!==null?o=gt(o):(s=Xe(t)?qr:$e.current,n=t.contextTypes,o=(n=n!=null)?Bn(e,s):Er),t=new t(r,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=sa,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function Sh(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&sa.enqueueReplaceState(t,t.state,null)}function lc(e,t,r,n){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},vu(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=gt(o):(o=Xe(t)?qr:$e.current,s.context=Bn(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(ac(e,t,o,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&sa.enqueueReplaceState(s,s.state,null),Po(e,r,s,n),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Wn(e,t){try{var r="",n=t;do r+=DS(n),n=n.return;while(n);var s=r}catch(o){s=`
39
- Error generating stack: `+o.message+`
40
- `+o.stack}return{value:e,source:t,stack:s,digest:null}}function ll(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function cc(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var ix=typeof WeakMap=="function"?WeakMap:Map;function Dm(e,t,r){r=Kt(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Mo||(Mo=!0,yc=n),cc(e,t)},r}function Mm(e,t,r){r=Kt(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){cc(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(r.callback=function(){cc(e,t),typeof n!="function"&&(Sr===null?Sr=new Set([this]):Sr.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),r}function wh(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new ix;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=yx.bind(null,e,t,r),t.then(e,e))}function xh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ch(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Kt(-1,1),t.tag=2,yr(r,t,1))),r.lanes|=1),e)}var ox=Zt.ReactCurrentOwner,Ge=!1;function Fe(e,t,r,n){t.child=e===null?lm(t,null,r,n):Fn(t,e.child,r,n)}function bh(e,t,r,n,s){r=r.render;var o=t.ref;return Mn(t,s),n=wu(e,t,r,n,o,s),r=xu(),e!==null&&!Ge?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Yt(e,t,s)):(ve&&r&&cu(t),t.flags|=1,Fe(e,t,n,s),t.child)}function Eh(e,t,r,n,s){if(e===null){var o=r.type;return typeof o=="function"&&!Du(o)&&o.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=o,Nm(e,t,o,n,s)):(e=lo(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var l=o.memoizedProps;if(r=r.compare,r=r!==null?r:Fs,r(l,n)&&e.ref===t.ref)return Yt(e,t,s)}return t.flags|=1,e=xr(o,n),e.ref=t.ref,e.return=t,t.child=e}function Nm(e,t,r,n,s){if(e!==null){var o=e.memoizedProps;if(Fs(o,n)&&e.ref===t.ref)if(Ge=!1,t.pendingProps=n=o,(e.lanes&s)!==0)e.flags&131072&&(Ge=!0);else return t.lanes=e.lanes,Yt(e,t,s)}return uc(e,t,r,n,s)}function Im(e,t,r){var n=t.pendingProps,s=n.children,o=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},he(Pn,et),et|=r;else{if(!(r&1073741824))return e=o!==null?o.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,he(Pn,et),et|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=o!==null?o.baseLanes:r,he(Pn,et),et|=n}else o!==null?(n=o.baseLanes|r,t.memoizedState=null):n=r,he(Pn,et),et|=n;return Fe(e,t,s,r),t.child}function Om(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function uc(e,t,r,n,s){var o=Xe(r)?qr:$e.current;return o=Bn(t,o),Mn(t,s),r=wu(e,t,r,n,o,s),n=xu(),e!==null&&!Ge?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Yt(e,t,s)):(ve&&n&&cu(t),t.flags|=1,Fe(e,t,r,s),t.child)}function kh(e,t,r,n,s){if(Xe(r)){var o=!0;Co(t)}else o=!1;if(Mn(t,s),t.stateNode===null)io(e,t),Am(t,r,n),lc(t,r,n,s),n=!0;else if(e===null){var l=t.stateNode,i=t.memoizedProps;l.props=i;var a=l.context,c=r.contextType;typeof c=="object"&&c!==null?c=gt(c):(c=Xe(r)?qr:$e.current,c=Bn(t,c));var p=r.getDerivedStateFromProps,u=typeof p=="function"||typeof l.getSnapshotBeforeUpdate=="function";u||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(i!==n||a!==c)&&Sh(t,l,n,c),cr=!1;var v=t.memoizedState;l.state=v,Po(t,n,l,s),a=t.memoizedState,i!==n||v!==a||qe.current||cr?(typeof p=="function"&&(ac(t,r,p,n),a=t.memoizedState),(i=cr||yh(t,r,i,n,v,a,c))?(u||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=a),l.props=n,l.state=a,l.context=c,n=i):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{l=t.stateNode,um(e,t),i=t.memoizedProps,c=t.type===t.elementType?i:wt(t.type,i),l.props=c,u=t.pendingProps,v=l.context,a=r.contextType,typeof a=="object"&&a!==null?a=gt(a):(a=Xe(r)?qr:$e.current,a=Bn(t,a));var y=r.getDerivedStateFromProps;(p=typeof y=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(i!==u||v!==a)&&Sh(t,l,n,a),cr=!1,v=t.memoizedState,l.state=v,Po(t,n,l,s);var w=t.memoizedState;i!==u||v!==w||qe.current||cr?(typeof y=="function"&&(ac(t,r,y,n),w=t.memoizedState),(c=cr||yh(t,r,c,n,v,w,a)||!1)?(p||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(n,w,a),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(n,w,a)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||i===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=w),l.props=n,l.state=w,l.context=a,n=c):(typeof l.componentDidUpdate!="function"||i===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),n=!1)}return dc(e,t,r,n,o,s)}function dc(e,t,r,n,s,o){Om(e,t);var l=(t.flags&128)!==0;if(!n&&!l)return s&&dh(t,r,!1),Yt(e,t,o);n=t.stateNode,ox.current=t;var i=l&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&l?(t.child=Fn(t,e.child,null,o),t.child=Fn(t,null,i,o)):Fe(e,t,i,o),t.memoizedState=n.state,s&&dh(t,r,!0),t.child}function jm(e){var t=e.stateNode;t.pendingContext?uh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&uh(e,t.context,!1),gu(e,t.containerInfo)}function Rh(e,t,r,n,s){return $n(),du(s),t.flags|=256,Fe(e,t,r,n),t.child}var hc={dehydrated:null,treeContext:null,retryLane:0};function fc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Bm(e,t,r){var n=t.pendingProps,s=_e.current,o=!1,l=(t.flags&128)!==0,i;if((i=l)||(i=e!==null&&e.memoizedState===null?!1:(s&2)!==0),i?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),he(_e,s&1),e===null)return ic(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=n.children,e=n.fallback,o?(n=t.mode,o=t.child,l={mode:"hidden",children:l},!(n&1)&&o!==null?(o.childLanes=0,o.pendingProps=l):o=aa(l,n,0,null),e=Kr(e,n,r,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=fc(r),t.memoizedState=hc,e):Eu(t,l));if(s=e.memoizedState,s!==null&&(i=s.dehydrated,i!==null))return ax(e,t,l,n,i,s,r);if(o){o=n.fallback,l=t.mode,s=e.child,i=s.sibling;var a={mode:"hidden",children:n.children};return!(l&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=a,t.deletions=null):(n=xr(s,a),n.subtreeFlags=s.subtreeFlags&14680064),i!==null?o=xr(i,o):(o=Kr(o,l,r,null),o.flags|=2),o.return=t,n.return=t,n.sibling=o,t.child=n,n=o,o=t.child,l=e.child.memoizedState,l=l===null?fc(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},o.memoizedState=l,o.childLanes=e.childLanes&~r,t.memoizedState=hc,n}return o=e.child,e=o.sibling,n=xr(o,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Eu(e,t){return t=aa({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Oi(e,t,r,n){return n!==null&&du(n),Fn(t,e.child,null,r),e=Eu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ax(e,t,r,n,s,o,l){if(r)return t.flags&256?(t.flags&=-257,n=ll(Error(Q(422))),Oi(e,t,l,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=n.fallback,s=t.mode,n=aa({mode:"visible",children:n.children},s,0,null),o=Kr(o,s,l,null),o.flags|=2,n.return=t,o.return=t,n.sibling=o,t.child=n,t.mode&1&&Fn(t,e.child,null,l),t.child.memoizedState=fc(l),t.memoizedState=hc,o);if(!(t.mode&1))return Oi(e,t,l,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var i=n.dgst;return n=i,o=Error(Q(419)),n=ll(o,n,void 0),Oi(e,t,l,n)}if(i=(l&e.childLanes)!==0,Ge||i){if(n=De,n!==null){switch(l&-l){case 4:s=2;break;case 16:s=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|l)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,Xt(e,s),Et(n,e,s,-1))}return Au(),n=ll(Error(Q(421))),Oi(e,t,l,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Sx.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,rt=_r(s.nextSibling),nt=t,ve=!0,Ct=null,e!==null&&(ht[ft++]=Ut,ht[ft++]=Vt,ht[ft++]=Xr,Ut=e.id,Vt=e.overflow,Xr=t),t=Eu(t,n.children),t.flags|=4096,t)}function Ph(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),oc(e.return,t,r)}function cl(e,t,r,n,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=r,o.tailMode=s)}function $m(e,t,r){var n=t.pendingProps,s=n.revealOrder,o=n.tail;if(Fe(e,t,n.children,r),n=_e.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ph(e,r,t);else if(e.tag===19)Ph(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(he(_e,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&To(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),cl(t,!1,s,r,o);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&To(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}cl(t,!0,r,null,o);break;case"together":cl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function io(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Yt(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Qr|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Q(153));if(t.child!==null){for(e=t.child,r=xr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=xr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function lx(e,t,r){switch(t.tag){case 3:jm(t),$n();break;case 5:dm(t);break;case 1:Xe(t.type)&&Co(t);break;case 4:gu(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;he(ko,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(he(_e,_e.current&1),t.flags|=128,null):r&t.child.childLanes?Bm(e,t,r):(he(_e,_e.current&1),e=Yt(e,t,r),e!==null?e.sibling:null);he(_e,_e.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return $m(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),he(_e,_e.current),n)break;return null;case 22:case 23:return t.lanes=0,Im(e,t,r)}return Yt(e,t,r)}var Fm,pc,Hm,Wm;Fm=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};pc=function(){};Hm=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,Ur(jt.current);var o=null;switch(r){case"input":s=Ol(e,s),n=Ol(e,n),o=[];break;case"select":s=Se({},s,{value:void 0}),n=Se({},n,{value:void 0}),o=[];break;case"textarea":s=$l(e,s),n=$l(e,n),o=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=wo)}Hl(r,n);var l;r=null;for(c in s)if(!n.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var i=s[c];for(l in i)i.hasOwnProperty(l)&&(r||(r={}),r[l]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Ms.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in n){var a=n[c];if(i=s!=null?s[c]:void 0,n.hasOwnProperty(c)&&a!==i&&(a!=null||i!=null))if(c==="style")if(i){for(l in i)!i.hasOwnProperty(l)||a&&a.hasOwnProperty(l)||(r||(r={}),r[l]="");for(l in a)a.hasOwnProperty(l)&&i[l]!==a[l]&&(r||(r={}),r[l]=a[l])}else r||(o||(o=[]),o.push(c,r)),r=a;else c==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,i=i?i.__html:void 0,a!=null&&i!==a&&(o=o||[]).push(c,a)):c==="children"?typeof a!="string"&&typeof a!="number"||(o=o||[]).push(c,""+a):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Ms.hasOwnProperty(c)?(a!=null&&c==="onScroll"&&pe("scroll",e),o||i===a||(o=[])):(o=o||[]).push(c,a))}r&&(o=o||[]).push("style",r);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};Wm=function(e,t,r,n){r!==n&&(t.flags|=4)};function hs(e,t){if(!ve)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function je(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function cx(e,t,r){var n=t.pendingProps;switch(uu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return je(t),null;case 1:return Xe(t.type)&&xo(),je(t),null;case 3:return n=t.stateNode,Hn(),me(qe),me($e),yu(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ni(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ct!==null&&(xc(Ct),Ct=null))),pc(e,t),je(t),null;case 5:_u(t);var s=Ur(Vs.current);if(r=t.type,e!==null&&t.stateNode!=null)Hm(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(Q(166));return je(t),null}if(e=Ur(jt.current),Ni(t)){n=t.stateNode,r=t.type;var o=t.memoizedProps;switch(n[Mt]=t,n[zs]=o,e=(t.mode&1)!==0,r){case"dialog":pe("cancel",n),pe("close",n);break;case"iframe":case"object":case"embed":pe("load",n);break;case"video":case"audio":for(s=0;s<Ss.length;s++)pe(Ss[s],n);break;case"source":pe("error",n);break;case"img":case"image":case"link":pe("error",n),pe("load",n);break;case"details":pe("toggle",n);break;case"input":jd(n,o),pe("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!o.multiple},pe("invalid",n);break;case"textarea":$d(n,o),pe("invalid",n)}Hl(r,o),s=null;for(var l in o)if(o.hasOwnProperty(l)){var i=o[l];l==="children"?typeof i=="string"?n.textContent!==i&&(o.suppressHydrationWarning!==!0&&Mi(n.textContent,i,e),s=["children",i]):typeof i=="number"&&n.textContent!==""+i&&(o.suppressHydrationWarning!==!0&&Mi(n.textContent,i,e),s=["children",""+i]):Ms.hasOwnProperty(l)&&i!=null&&l==="onScroll"&&pe("scroll",n)}switch(r){case"input":Ei(n),Bd(n,o,!0);break;case"textarea":Ei(n),Fd(n);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(n.onclick=wo)}n=s,t.updateQueue=n,n!==null&&(t.flags|=4)}else{l=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=vp(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=l.createElement(r,{is:n.is}):(e=l.createElement(r),r==="select"&&(l=e,n.multiple?l.multiple=!0:n.size&&(l.size=n.size))):e=l.createElementNS(e,r),e[Mt]=t,e[zs]=n,Fm(e,t,!1,!1),t.stateNode=e;e:{switch(l=Wl(r,n),r){case"dialog":pe("cancel",e),pe("close",e),s=n;break;case"iframe":case"object":case"embed":pe("load",e),s=n;break;case"video":case"audio":for(s=0;s<Ss.length;s++)pe(Ss[s],e);s=n;break;case"source":pe("error",e),s=n;break;case"img":case"image":case"link":pe("error",e),pe("load",e),s=n;break;case"details":pe("toggle",e),s=n;break;case"input":jd(e,n),s=Ol(e,n),pe("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=Se({},n,{value:void 0}),pe("invalid",e);break;case"textarea":$d(e,n),s=$l(e,n),pe("invalid",e);break;default:s=n}Hl(r,s),i=s;for(o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="style"?yp(e,a):o==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&gp(e,a)):o==="children"?typeof a=="string"?(r!=="textarea"||a!=="")&&Ns(e,a):typeof a=="number"&&Ns(e,""+a):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Ms.hasOwnProperty(o)?a!=null&&o==="onScroll"&&pe("scroll",e):a!=null&&Xc(e,o,a,l))}switch(r){case"input":Ei(e),Bd(e,n,!1);break;case"textarea":Ei(e),Fd(e);break;case"option":n.value!=null&&e.setAttribute("value",""+br(n.value));break;case"select":e.multiple=!!n.multiple,o=n.value,o!=null?Tn(e,!!n.multiple,o,!1):n.defaultValue!=null&&Tn(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=wo)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return je(t),null;case 6:if(e&&t.stateNode!=null)Wm(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(Q(166));if(r=Ur(Vs.current),Ur(jt.current),Ni(t)){if(n=t.stateNode,r=t.memoizedProps,n[Mt]=t,(o=n.nodeValue!==r)&&(e=nt,e!==null))switch(e.tag){case 3:Mi(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Mi(n.nodeValue,r,(e.mode&1)!==0)}o&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Mt]=t,t.stateNode=n}return je(t),null;case 13:if(me(_e),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ve&&rt!==null&&t.mode&1&&!(t.flags&128))om(),$n(),t.flags|=98560,o=!1;else if(o=Ni(t),n!==null&&n.dehydrated!==null){if(e===null){if(!o)throw Error(Q(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(Q(317));o[Mt]=t}else $n(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;je(t),o=!1}else Ct!==null&&(xc(Ct),Ct=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||_e.current&1?Te===0&&(Te=3):Au())),t.updateQueue!==null&&(t.flags|=4),je(t),null);case 4:return Hn(),pc(e,t),e===null&&Hs(t.stateNode.containerInfo),je(t),null;case 10:return pu(t.type._context),je(t),null;case 17:return Xe(t.type)&&xo(),je(t),null;case 19:if(me(_e),o=t.memoizedState,o===null)return je(t),null;if(n=(t.flags&128)!==0,l=o.rendering,l===null)if(n)hs(o,!1);else{if(Te!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=To(e),l!==null){for(t.flags|=128,hs(o,!1),n=l.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)o=r,e=n,o.flags&=14680066,l=o.alternate,l===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=l.childLanes,o.lanes=l.lanes,o.child=l.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=l.memoizedProps,o.memoizedState=l.memoizedState,o.updateQueue=l.updateQueue,o.type=l.type,e=l.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return he(_e,_e.current&1|2),t.child}e=e.sibling}o.tail!==null&&xe()>zn&&(t.flags|=128,n=!0,hs(o,!1),t.lanes=4194304)}else{if(!n)if(e=To(l),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),hs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!ve)return je(t),null}else 2*xe()-o.renderingStartTime>zn&&r!==1073741824&&(t.flags|=128,n=!0,hs(o,!1),t.lanes=4194304);o.isBackwards?(l.sibling=t.child,t.child=l):(r=o.last,r!==null?r.sibling=l:t.child=l,o.last=l)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=xe(),t.sibling=null,r=_e.current,he(_e,n?r&1|2:r&1),t):(je(t),null);case 22:case 23:return Lu(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?et&1073741824&&(je(t),t.subtreeFlags&6&&(t.flags|=8192)):je(t),null;case 24:return null;case 25:return null}throw Error(Q(156,t.tag))}function ux(e,t){switch(uu(t),t.tag){case 1:return Xe(t.type)&&xo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Hn(),me(qe),me($e),yu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return _u(t),null;case 13:if(me(_e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Q(340));$n()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return me(_e),null;case 4:return Hn(),null;case 10:return pu(t.type._context),null;case 22:case 23:return Lu(),null;case 24:return null;default:return null}}var ji=!1,Be=!1,dx=typeof WeakSet=="function"?WeakSet:Set,Z=null;function Rn(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){we(e,t,n)}else r.current=null}function mc(e,t,r){try{r()}catch(n){we(e,t,n)}}var Th=!1;function hx(e,t){if(Jl=_o,e=Gp(),lu(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var l=0,i=-1,a=-1,c=0,p=0,u=e,v=null;t:for(;;){for(var y;u!==r||s!==0&&u.nodeType!==3||(i=l+s),u!==o||n!==0&&u.nodeType!==3||(a=l+n),u.nodeType===3&&(l+=u.nodeValue.length),(y=u.firstChild)!==null;)v=u,u=y;for(;;){if(u===e)break t;if(v===r&&++c===s&&(i=l),v===o&&++p===n&&(a=l),(y=u.nextSibling)!==null)break;u=v,v=u.parentNode}u=y}r=i===-1||a===-1?null:{start:i,end:a}}else r=null}r=r||{start:0,end:0}}else r=null;for(Zl={focusedElem:e,selectionRange:r},_o=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var _=w.memoizedProps,m=w.memoizedState,h=t.stateNode,d=h.getSnapshotBeforeUpdate(t.elementType===t.type?_:wt(t.type,_),m);h.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var f=t.stateNode.containerInfo;f.nodeType===1?f.textContent="":f.nodeType===9&&f.documentElement&&f.removeChild(f.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Q(163))}}catch(S){we(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return w=Th,Th=!1,w}function Ts(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&mc(t,r,o)}s=s.next}while(s!==n)}}function ia(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function vc(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function zm(e){var t=e.alternate;t!==null&&(e.alternate=null,zm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Mt],delete t[zs],delete t[rc],delete t[qw],delete t[Xw])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Um(e){return e.tag===5||e.tag===3||e.tag===4}function Lh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Um(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.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 gc(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=wo));else if(n!==4&&(e=e.child,e!==null))for(gc(e,t,r),e=e.sibling;e!==null;)gc(e,t,r),e=e.sibling}function _c(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(_c(e,t,r),e=e.sibling;e!==null;)_c(e,t,r),e=e.sibling}var Me=null,xt=!1;function sr(e,t,r){for(r=r.child;r!==null;)Vm(e,t,r),r=r.sibling}function Vm(e,t,r){if(Ot&&typeof Ot.onCommitFiberUnmount=="function")try{Ot.onCommitFiberUnmount(Qo,r)}catch{}switch(r.tag){case 5:Be||Rn(r,t);case 6:var n=Me,s=xt;Me=null,sr(e,t,r),Me=n,xt=s,Me!==null&&(xt?(e=Me,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Me.removeChild(r.stateNode));break;case 18:Me!==null&&(xt?(e=Me,r=r.stateNode,e.nodeType===8?rl(e.parentNode,r):e.nodeType===1&&rl(e,r),Bs(e)):rl(Me,r.stateNode));break;case 4:n=Me,s=xt,Me=r.stateNode.containerInfo,xt=!0,sr(e,t,r),Me=n,xt=s;break;case 0:case 11:case 14:case 15:if(!Be&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var o=s,l=o.destroy;o=o.tag,l!==void 0&&(o&2||o&4)&&mc(r,t,l),s=s.next}while(s!==n)}sr(e,t,r);break;case 1:if(!Be&&(Rn(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(i){we(r,t,i)}sr(e,t,r);break;case 21:sr(e,t,r);break;case 22:r.mode&1?(Be=(n=Be)||r.memoizedState!==null,sr(e,t,r),Be=n):sr(e,t,r);break;default:sr(e,t,r)}}function Ah(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new dx),t.forEach(function(n){var s=wx.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function yt(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var o=e,l=t,i=l;e:for(;i!==null;){switch(i.tag){case 5:Me=i.stateNode,xt=!1;break e;case 3:Me=i.stateNode.containerInfo,xt=!0;break e;case 4:Me=i.stateNode.containerInfo,xt=!0;break e}i=i.return}if(Me===null)throw Error(Q(160));Vm(o,l,s),Me=null,xt=!1;var a=s.alternate;a!==null&&(a.return=null),s.return=null}catch(c){we(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Km(t,e),t=t.sibling}function Km(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(yt(t,e),At(e),n&4){try{Ts(3,e,e.return),ia(3,e)}catch(_){we(e,e.return,_)}try{Ts(5,e,e.return)}catch(_){we(e,e.return,_)}}break;case 1:yt(t,e),At(e),n&512&&r!==null&&Rn(r,r.return);break;case 5:if(yt(t,e),At(e),n&512&&r!==null&&Rn(r,r.return),e.flags&32){var s=e.stateNode;try{Ns(s,"")}catch(_){we(e,e.return,_)}}if(n&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,l=r!==null?r.memoizedProps:o,i=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{i==="input"&&o.type==="radio"&&o.name!=null&&pp(s,o),Wl(i,l);var c=Wl(i,o);for(l=0;l<a.length;l+=2){var p=a[l],u=a[l+1];p==="style"?yp(s,u):p==="dangerouslySetInnerHTML"?gp(s,u):p==="children"?Ns(s,u):Xc(s,p,u,c)}switch(i){case"input":jl(s,o);break;case"textarea":mp(s,o);break;case"select":var v=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var y=o.value;y!=null?Tn(s,!!o.multiple,y,!1):v!==!!o.multiple&&(o.defaultValue!=null?Tn(s,!!o.multiple,o.defaultValue,!0):Tn(s,!!o.multiple,o.multiple?[]:"",!1))}s[zs]=o}catch(_){we(e,e.return,_)}}break;case 6:if(yt(t,e),At(e),n&4){if(e.stateNode===null)throw Error(Q(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(_){we(e,e.return,_)}}break;case 3:if(yt(t,e),At(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Bs(t.containerInfo)}catch(_){we(e,e.return,_)}break;case 4:yt(t,e),At(e);break;case 13:yt(t,e),At(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(Pu=xe())),n&4&&Ah(e);break;case 22:if(p=r!==null&&r.memoizedState!==null,e.mode&1?(Be=(c=Be)||p,yt(t,e),Be=c):yt(t,e),At(e),n&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!p&&e.mode&1)for(Z=e,p=e.child;p!==null;){for(u=Z=p;Z!==null;){switch(v=Z,y=v.child,v.tag){case 0:case 11:case 14:case 15:Ts(4,v,v.return);break;case 1:Rn(v,v.return);var w=v.stateNode;if(typeof w.componentWillUnmount=="function"){n=v,r=v.return;try{t=n,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(_){we(n,r,_)}}break;case 5:Rn(v,v.return);break;case 22:if(v.memoizedState!==null){Mh(u);continue}}y!==null?(y.return=v,Z=y):Mh(u)}p=p.sibling}e:for(p=null,u=e;;){if(u.tag===5){if(p===null){p=u;try{s=u.stateNode,c?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(i=u.stateNode,a=u.memoizedProps.style,l=a!=null&&a.hasOwnProperty("display")?a.display:null,i.style.display=_p("display",l))}catch(_){we(e,e.return,_)}}}else if(u.tag===6){if(p===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(_){we(e,e.return,_)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;p===u&&(p=null),u=u.return}p===u&&(p=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:yt(t,e),At(e),n&4&&Ah(e);break;case 21:break;default:yt(t,e),At(e)}}function At(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Um(r)){var n=r;break e}r=r.return}throw Error(Q(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(Ns(s,""),n.flags&=-33);var o=Lh(e);_c(e,o,s);break;case 3:case 4:var l=n.stateNode.containerInfo,i=Lh(e);gc(e,i,l);break;default:throw Error(Q(161))}}catch(a){we(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function fx(e,t,r){Z=e,Gm(e)}function Gm(e,t,r){for(var n=(e.mode&1)!==0;Z!==null;){var s=Z,o=s.child;if(s.tag===22&&n){var l=s.memoizedState!==null||ji;if(!l){var i=s.alternate,a=i!==null&&i.memoizedState!==null||Be;i=ji;var c=Be;if(ji=l,(Be=a)&&!c)for(Z=s;Z!==null;)l=Z,a=l.child,l.tag===22&&l.memoizedState!==null?Nh(s):a!==null?(a.return=l,Z=a):Nh(s);for(;o!==null;)Z=o,Gm(o),o=o.sibling;Z=s,ji=i,Be=c}Dh(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,Z=o):Dh(e)}}function Dh(e){for(;Z!==null;){var t=Z;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Be||ia(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Be)if(r===null)n.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:wt(t.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&vh(t,o,n);break;case 3:var l=t.updateQueue;if(l!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}vh(t,l,r)}break;case 5:var i=t.stateNode;if(r===null&&t.flags&4){r=i;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break;case"img":a.src&&(r.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var p=c.memoizedState;if(p!==null){var u=p.dehydrated;u!==null&&Bs(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Q(163))}Be||t.flags&512&&vc(t)}catch(v){we(t,t.return,v)}}if(t===e){Z=null;break}if(r=t.sibling,r!==null){r.return=t.return,Z=r;break}Z=t.return}}function Mh(e){for(;Z!==null;){var t=Z;if(t===e){Z=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Z=r;break}Z=t.return}}function Nh(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{ia(4,t)}catch(a){we(t,r,a)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var s=t.return;try{n.componentDidMount()}catch(a){we(t,s,a)}}var o=t.return;try{vc(t)}catch(a){we(t,o,a)}break;case 5:var l=t.return;try{vc(t)}catch(a){we(t,l,a)}}}catch(a){we(t,t.return,a)}if(t===e){Z=null;break}var i=t.sibling;if(i!==null){i.return=t.return,Z=i;break}Z=t.return}}var px=Math.ceil,Do=Zt.ReactCurrentDispatcher,ku=Zt.ReactCurrentOwner,mt=Zt.ReactCurrentBatchConfig,ce=0,De=null,Ee=null,Ne=0,et=0,Pn=Lr(0),Te=0,Xs=null,Qr=0,oa=0,Ru=0,Ls=null,Ke=null,Pu=0,zn=1/0,Wt=null,Mo=!1,yc=null,Sr=null,Bi=!1,fr=null,No=0,As=0,Sc=null,oo=-1,ao=0;function He(){return ce&6?xe():oo!==-1?oo:oo=xe()}function wr(e){return e.mode&1?ce&2&&Ne!==0?Ne&-Ne:Qw.transition!==null?(ao===0&&(ao=Ap()),ao):(e=ue,e!==0||(e=window.event,e=e===void 0?16:Bp(e.type)),e):1}function Et(e,t,r,n){if(50<As)throw As=0,Sc=null,Error(Q(185));ri(e,r,n),(!(ce&2)||e!==De)&&(e===De&&(!(ce&2)&&(oa|=r),Te===4&&dr(e,Ne)),Ye(e,n),r===1&&ce===0&&!(t.mode&1)&&(zn=xe()+500,ra&&Ar()))}function Ye(e,t){var r=e.callbackNode;QS(e,t);var n=go(e,e===De?Ne:0);if(n===0)r!==null&&zd(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&zd(r),t===1)e.tag===0?Yw(Ih.bind(null,e)):nm(Ih.bind(null,e)),Kw(function(){!(ce&6)&&Ar()}),r=null;else{switch(Dp(n)){case 1:r=eu;break;case 4:r=Tp;break;case 16:r=vo;break;case 536870912:r=Lp;break;default:r=vo}r=tv(r,qm.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function qm(e,t){if(oo=-1,ao=0,ce&6)throw Error(Q(327));var r=e.callbackNode;if(Nn()&&e.callbackNode!==r)return null;var n=go(e,e===De?Ne:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Io(e,n);else{t=n;var s=ce;ce|=2;var o=Ym();(De!==e||Ne!==t)&&(Wt=null,zn=xe()+500,Vr(e,t));do try{gx();break}catch(i){Xm(e,i)}while(!0);fu(),Do.current=o,ce=s,Ee!==null?t=0:(De=null,Ne=0,t=Te)}if(t!==0){if(t===2&&(s=Gl(e),s!==0&&(n=s,t=wc(e,s))),t===1)throw r=Xs,Vr(e,0),dr(e,n),Ye(e,xe()),r;if(t===6)dr(e,n);else{if(s=e.current.alternate,!(n&30)&&!mx(s)&&(t=Io(e,n),t===2&&(o=Gl(e),o!==0&&(n=o,t=wc(e,o))),t===1))throw r=Xs,Vr(e,0),dr(e,n),Ye(e,xe()),r;switch(e.finishedWork=s,e.finishedLanes=n,t){case 0:case 1:throw Error(Q(345));case 2:Hr(e,Ke,Wt);break;case 3:if(dr(e,n),(n&130023424)===n&&(t=Pu+500-xe(),10<t)){if(go(e,0)!==0)break;if(s=e.suspendedLanes,(s&n)!==n){He(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=tc(Hr.bind(null,e,Ke,Wt),t);break}Hr(e,Ke,Wt);break;case 4:if(dr(e,n),(n&4194240)===n)break;for(t=e.eventTimes,s=-1;0<n;){var l=31-bt(n);o=1<<l,l=t[l],l>s&&(s=l),n&=~o}if(n=s,n=xe()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*px(n/1960))-n,10<n){e.timeoutHandle=tc(Hr.bind(null,e,Ke,Wt),n);break}Hr(e,Ke,Wt);break;case 5:Hr(e,Ke,Wt);break;default:throw Error(Q(329))}}}return Ye(e,xe()),e.callbackNode===r?qm.bind(null,e):null}function wc(e,t){var r=Ls;return e.current.memoizedState.isDehydrated&&(Vr(e,t).flags|=256),e=Io(e,t),e!==2&&(t=Ke,Ke=r,t!==null&&xc(t)),e}function xc(e){Ke===null?Ke=e:Ke.push.apply(Ke,e)}function mx(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],o=s.getSnapshot;s=s.value;try{if(!kt(o(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function dr(e,t){for(t&=~Ru,t&=~oa,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-bt(t),n=1<<r;e[r]=-1,t&=~n}}function Ih(e){if(ce&6)throw Error(Q(327));Nn();var t=go(e,0);if(!(t&1))return Ye(e,xe()),null;var r=Io(e,t);if(e.tag!==0&&r===2){var n=Gl(e);n!==0&&(t=n,r=wc(e,n))}if(r===1)throw r=Xs,Vr(e,0),dr(e,t),Ye(e,xe()),r;if(r===6)throw Error(Q(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Hr(e,Ke,Wt),Ye(e,xe()),null}function Tu(e,t){var r=ce;ce|=1;try{return e(t)}finally{ce=r,ce===0&&(zn=xe()+500,ra&&Ar())}}function Jr(e){fr!==null&&fr.tag===0&&!(ce&6)&&Nn();var t=ce;ce|=1;var r=mt.transition,n=ue;try{if(mt.transition=null,ue=1,e)return e()}finally{ue=n,mt.transition=r,ce=t,!(ce&6)&&Ar()}}function Lu(){et=Pn.current,me(Pn)}function Vr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,Vw(r)),Ee!==null)for(r=Ee.return;r!==null;){var n=r;switch(uu(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&xo();break;case 3:Hn(),me(qe),me($e),yu();break;case 5:_u(n);break;case 4:Hn();break;case 13:me(_e);break;case 19:me(_e);break;case 10:pu(n.type._context);break;case 22:case 23:Lu()}r=r.return}if(De=e,Ee=e=xr(e.current,null),Ne=et=t,Te=0,Xs=null,Ru=oa=Qr=0,Ke=Ls=null,zr!==null){for(t=0;t<zr.length;t++)if(r=zr[t],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,o=r.pending;if(o!==null){var l=o.next;o.next=s,n.next=l}r.pending=n}zr=null}return e}function Xm(e,t){do{var r=Ee;try{if(fu(),no.current=Ao,Lo){for(var n=ye.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}Lo=!1}if(Yr=0,Ae=Pe=ye=null,Ps=!1,Ks=0,ku.current=null,r===null||r.return===null){Te=1,Xs=t,Ee=null;break}e:{var o=e,l=r.return,i=r,a=t;if(t=Ne,i.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var c=a,p=i,u=p.tag;if(!(p.mode&1)&&(u===0||u===11||u===15)){var v=p.alternate;v?(p.updateQueue=v.updateQueue,p.memoizedState=v.memoizedState,p.lanes=v.lanes):(p.updateQueue=null,p.memoizedState=null)}var y=xh(l);if(y!==null){y.flags&=-257,Ch(y,l,i,o,t),y.mode&1&&wh(o,c,t),t=y,a=c;var w=t.updateQueue;if(w===null){var _=new Set;_.add(a),t.updateQueue=_}else w.add(a);break e}else{if(!(t&1)){wh(o,c,t),Au();break e}a=Error(Q(426))}}else if(ve&&i.mode&1){var m=xh(l);if(m!==null){!(m.flags&65536)&&(m.flags|=256),Ch(m,l,i,o,t),du(Wn(a,i));break e}}o=a=Wn(a,i),Te!==4&&(Te=2),Ls===null?Ls=[o]:Ls.push(o),o=l;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var h=Dm(o,a,t);mh(o,h);break e;case 1:i=a;var d=o.type,f=o.stateNode;if(!(o.flags&128)&&(typeof d.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Sr===null||!Sr.has(f)))){o.flags|=65536,t&=-t,o.lanes|=t;var S=Mm(o,i,t);mh(o,S);break e}}o=o.return}while(o!==null)}Jm(r)}catch(E){t=E,Ee===r&&r!==null&&(Ee=r=r.return);continue}break}while(!0)}function Ym(){var e=Do.current;return Do.current=Ao,e===null?Ao:e}function Au(){(Te===0||Te===3||Te===2)&&(Te=4),De===null||!(Qr&268435455)&&!(oa&268435455)||dr(De,Ne)}function Io(e,t){var r=ce;ce|=2;var n=Ym();(De!==e||Ne!==t)&&(Wt=null,Vr(e,t));do try{vx();break}catch(s){Xm(e,s)}while(!0);if(fu(),ce=r,Do.current=n,Ee!==null)throw Error(Q(261));return De=null,Ne=0,Te}function vx(){for(;Ee!==null;)Qm(Ee)}function gx(){for(;Ee!==null&&!WS();)Qm(Ee)}function Qm(e){var t=ev(e.alternate,e,et);e.memoizedProps=e.pendingProps,t===null?Jm(e):Ee=t,ku.current=null}function Jm(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=ux(r,t),r!==null){r.flags&=32767,Ee=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Te=6,Ee=null;return}}else if(r=cx(r,t,et),r!==null){Ee=r;return}if(t=t.sibling,t!==null){Ee=t;return}Ee=t=e}while(t!==null);Te===0&&(Te=5)}function Hr(e,t,r){var n=ue,s=mt.transition;try{mt.transition=null,ue=1,_x(e,t,r,n)}finally{mt.transition=s,ue=n}return null}function _x(e,t,r,n){do Nn();while(fr!==null);if(ce&6)throw Error(Q(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(Q(177));e.callbackNode=null,e.callbackPriority=0;var o=r.lanes|r.childLanes;if(JS(e,o),e===De&&(Ee=De=null,Ne=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Bi||(Bi=!0,tv(vo,function(){return Nn(),null})),o=(r.flags&15990)!==0,r.subtreeFlags&15990||o){o=mt.transition,mt.transition=null;var l=ue;ue=1;var i=ce;ce|=4,ku.current=null,hx(e,r),Km(r,e),Bw(Zl),_o=!!Jl,Zl=Jl=null,e.current=r,fx(r),zS(),ce=i,ue=l,mt.transition=o}else e.current=r;if(Bi&&(Bi=!1,fr=e,No=s),o=e.pendingLanes,o===0&&(Sr=null),KS(r.stateNode),Ye(e,xe()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(Mo)throw Mo=!1,e=yc,yc=null,e;return No&1&&e.tag!==0&&Nn(),o=e.pendingLanes,o&1?e===Sc?As++:(As=0,Sc=e):As=0,Ar(),null}function Nn(){if(fr!==null){var e=Dp(No),t=mt.transition,r=ue;try{if(mt.transition=null,ue=16>e?16:e,fr===null)var n=!1;else{if(e=fr,fr=null,No=0,ce&6)throw Error(Q(331));var s=ce;for(ce|=4,Z=e.current;Z!==null;){var o=Z,l=o.child;if(Z.flags&16){var i=o.deletions;if(i!==null){for(var a=0;a<i.length;a++){var c=i[a];for(Z=c;Z!==null;){var p=Z;switch(p.tag){case 0:case 11:case 15:Ts(8,p,o)}var u=p.child;if(u!==null)u.return=p,Z=u;else for(;Z!==null;){p=Z;var v=p.sibling,y=p.return;if(zm(p),p===c){Z=null;break}if(v!==null){v.return=y,Z=v;break}Z=y}}}var w=o.alternate;if(w!==null){var _=w.child;if(_!==null){w.child=null;do{var m=_.sibling;_.sibling=null,_=m}while(_!==null)}}Z=o}}if(o.subtreeFlags&2064&&l!==null)l.return=o,Z=l;else e:for(;Z!==null;){if(o=Z,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Ts(9,o,o.return)}var h=o.sibling;if(h!==null){h.return=o.return,Z=h;break e}Z=o.return}}var d=e.current;for(Z=d;Z!==null;){l=Z;var f=l.child;if(l.subtreeFlags&2064&&f!==null)f.return=l,Z=f;else e:for(l=d;Z!==null;){if(i=Z,i.flags&2048)try{switch(i.tag){case 0:case 11:case 15:ia(9,i)}}catch(E){we(i,i.return,E)}if(i===l){Z=null;break e}var S=i.sibling;if(S!==null){S.return=i.return,Z=S;break e}Z=i.return}}if(ce=s,Ar(),Ot&&typeof Ot.onPostCommitFiberRoot=="function")try{Ot.onPostCommitFiberRoot(Qo,e)}catch{}n=!0}return n}finally{ue=r,mt.transition=t}}return!1}function Oh(e,t,r){t=Wn(r,t),t=Dm(e,t,1),e=yr(e,t,1),t=He(),e!==null&&(ri(e,1,t),Ye(e,t))}function we(e,t,r){if(e.tag===3)Oh(e,e,r);else for(;t!==null;){if(t.tag===3){Oh(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Sr===null||!Sr.has(n))){e=Wn(r,e),e=Mm(t,e,1),t=yr(t,e,1),e=He(),t!==null&&(ri(t,1,e),Ye(t,e));break}}t=t.return}}function yx(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=He(),e.pingedLanes|=e.suspendedLanes&r,De===e&&(Ne&r)===r&&(Te===4||Te===3&&(Ne&130023424)===Ne&&500>xe()-Pu?Vr(e,0):Ru|=r),Ye(e,t)}function Zm(e,t){t===0&&(e.mode&1?(t=Pi,Pi<<=1,!(Pi&130023424)&&(Pi=4194304)):t=1);var r=He();e=Xt(e,t),e!==null&&(ri(e,t,r),Ye(e,r))}function Sx(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Zm(e,r)}function wx(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(Q(314))}n!==null&&n.delete(t),Zm(e,r)}var ev;ev=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||qe.current)Ge=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Ge=!1,lx(e,t,r);Ge=!!(e.flags&131072)}else Ge=!1,ve&&t.flags&1048576&&sm(t,Eo,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;io(e,t),e=t.pendingProps;var s=Bn(t,$e.current);Mn(t,r),s=wu(null,t,n,e,s,r);var o=xu();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Xe(n)?(o=!0,Co(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,vu(t),s.updater=sa,t.stateNode=s,s._reactInternals=t,lc(t,n,e,r),t=dc(null,t,n,!0,o,r)):(t.tag=0,ve&&o&&cu(t),Fe(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(io(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=Cx(n),e=wt(n,e),s){case 0:t=uc(null,t,n,e,r);break e;case 1:t=kh(null,t,n,e,r);break e;case 11:t=bh(null,t,n,e,r);break e;case 14:t=Eh(null,t,n,wt(n.type,e),r);break e}throw Error(Q(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:wt(n,s),uc(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:wt(n,s),kh(e,t,n,s,r);case 3:e:{if(jm(t),e===null)throw Error(Q(387));n=t.pendingProps,o=t.memoizedState,s=o.element,um(e,t),Po(t,n,null,r);var l=t.memoizedState;if(n=l.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=Wn(Error(Q(423)),t),t=Rh(e,t,n,r,s);break e}else if(n!==s){s=Wn(Error(Q(424)),t),t=Rh(e,t,n,r,s);break e}else for(rt=_r(t.stateNode.containerInfo.firstChild),nt=t,ve=!0,Ct=null,r=lm(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if($n(),n===s){t=Yt(e,t,r);break e}Fe(e,t,n,r)}t=t.child}return t;case 5:return dm(t),e===null&&ic(t),n=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,l=s.children,ec(n,s)?l=null:o!==null&&ec(n,o)&&(t.flags|=32),Om(e,t),Fe(e,t,l,r),t.child;case 6:return e===null&&ic(t),null;case 13:return Bm(e,t,r);case 4:return gu(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Fn(t,null,n,r):Fe(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:wt(n,s),bh(e,t,n,s,r);case 7:return Fe(e,t,t.pendingProps,r),t.child;case 8:return Fe(e,t,t.pendingProps.children,r),t.child;case 12:return Fe(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,o=t.memoizedProps,l=s.value,he(ko,n._currentValue),n._currentValue=l,o!==null)if(kt(o.value,l)){if(o.children===s.children&&!qe.current){t=Yt(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var i=o.dependencies;if(i!==null){l=o.child;for(var a=i.firstContext;a!==null;){if(a.context===n){if(o.tag===1){a=Kt(-1,r&-r),a.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var p=c.pending;p===null?a.next=a:(a.next=p.next,p.next=a),c.pending=a}}o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),oc(o.return,r,t),i.lanes|=r;break}a=a.next}}else if(o.tag===10)l=o.type===t.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(Q(341));l.lanes|=r,i=l.alternate,i!==null&&(i.lanes|=r),oc(l,r,t),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===t){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}Fe(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Mn(t,r),s=gt(s),n=n(s),t.flags|=1,Fe(e,t,n,r),t.child;case 14:return n=t.type,s=wt(n,t.pendingProps),s=wt(n.type,s),Eh(e,t,n,s,r);case 15:return Nm(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:wt(n,s),io(e,t),t.tag=1,Xe(n)?(e=!0,Co(t)):e=!1,Mn(t,r),Am(t,n,s),lc(t,n,s,r),dc(null,t,n,!0,e,r);case 19:return $m(e,t,r);case 22:return Im(e,t,r)}throw Error(Q(156,t.tag))};function tv(e,t){return Pp(e,t)}function xx(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pt(e,t,r,n){return new xx(e,t,r,n)}function Du(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Cx(e){if(typeof e=="function")return Du(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Qc)return 11;if(e===Jc)return 14}return 2}function xr(e,t){var r=e.alternate;return r===null?(r=pt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function lo(e,t,r,n,s,o){var l=2;if(n=e,typeof e=="function")Du(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case _n:return Kr(r.children,s,o,t);case Yc:l=8,s|=8;break;case Dl:return e=pt(12,r,t,s|2),e.elementType=Dl,e.lanes=o,e;case Ml:return e=pt(13,r,t,s),e.elementType=Ml,e.lanes=o,e;case Nl:return e=pt(19,r,t,s),e.elementType=Nl,e.lanes=o,e;case dp:return aa(r,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case cp:l=10;break e;case up:l=9;break e;case Qc:l=11;break e;case Jc:l=14;break e;case lr:l=16,n=null;break e}throw Error(Q(130,e==null?e:typeof e,""))}return t=pt(l,r,t,s),t.elementType=e,t.type=n,t.lanes=o,t}function Kr(e,t,r,n){return e=pt(7,e,n,t),e.lanes=r,e}function aa(e,t,r,n){return e=pt(22,e,n,t),e.elementType=dp,e.lanes=r,e.stateNode={isHidden:!1},e}function ul(e,t,r){return e=pt(6,e,null,t),e.lanes=r,e}function dl(e,t,r){return t=pt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function bx(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Va(0),this.expirationTimes=Va(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Va(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Mu(e,t,r,n,s,o,l,i,a){return e=new bx(e,t,r,i,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=pt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},vu(o),e}function Ex(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:gn,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function rv(e){if(!e)return Er;e=e._reactInternals;e:{if(sn(e)!==e||e.tag!==1)throw Error(Q(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Xe(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Q(171))}if(e.tag===1){var r=e.type;if(Xe(r))return rm(e,r,t)}return t}function nv(e,t,r,n,s,o,l,i,a){return e=Mu(r,n,!0,e,s,o,l,i,a),e.context=rv(null),r=e.current,n=He(),s=wr(r),o=Kt(n,s),o.callback=t??null,yr(r,o,s),e.current.lanes=s,ri(e,s,n),Ye(e,n),e}function la(e,t,r,n){var s=t.current,o=He(),l=wr(s);return r=rv(r),t.context===null?t.context=r:t.pendingContext=r,t=Kt(o,l),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=yr(s,t,l),e!==null&&(Et(e,s,l,o),ro(e,s,l)),l}function Oo(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function jh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Nu(e,t){jh(e,t),(e=e.alternate)&&jh(e,t)}function kx(){return null}var sv=typeof reportError=="function"?reportError:function(e){console.error(e)};function Iu(e){this._internalRoot=e}ca.prototype.render=Iu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Q(409));la(e,t,null,null)};ca.prototype.unmount=Iu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Jr(function(){la(null,e,null,null)}),t[qt]=null}};function ca(e){this._internalRoot=e}ca.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ip();e={blockedOn:null,target:e,priority:t};for(var r=0;r<ur.length&&t!==0&&t<ur[r].priority;r++);ur.splice(r,0,e),r===0&&jp(e)}};function Ou(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ua(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Bh(){}function Rx(e,t,r,n,s){if(s){if(typeof n=="function"){var o=n;n=function(){var c=Oo(l);o.call(c)}}var l=nv(t,n,e,0,null,!1,!1,"",Bh);return e._reactRootContainer=l,e[qt]=l.current,Hs(e.nodeType===8?e.parentNode:e),Jr(),l}for(;s=e.lastChild;)e.removeChild(s);if(typeof n=="function"){var i=n;n=function(){var c=Oo(a);i.call(c)}}var a=Mu(e,0,!1,null,null,!1,!1,"",Bh);return e._reactRootContainer=a,e[qt]=a.current,Hs(e.nodeType===8?e.parentNode:e),Jr(function(){la(t,a,r,n)}),a}function da(e,t,r,n,s){var o=r._reactRootContainer;if(o){var l=o;if(typeof s=="function"){var i=s;s=function(){var a=Oo(l);i.call(a)}}la(t,l,e,s)}else l=Rx(r,t,e,s,n);return Oo(l)}Mp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=ys(t.pendingLanes);r!==0&&(tu(t,r|1),Ye(t,xe()),!(ce&6)&&(zn=xe()+500,Ar()))}break;case 13:Jr(function(){var n=Xt(e,1);if(n!==null){var s=He();Et(n,e,1,s)}}),Nu(e,1)}};ru=function(e){if(e.tag===13){var t=Xt(e,134217728);if(t!==null){var r=He();Et(t,e,134217728,r)}Nu(e,134217728)}};Np=function(e){if(e.tag===13){var t=wr(e),r=Xt(e,t);if(r!==null){var n=He();Et(r,e,t,n)}Nu(e,t)}};Ip=function(){return ue};Op=function(e,t){var r=ue;try{return ue=e,t()}finally{ue=r}};Ul=function(e,t,r){switch(t){case"input":if(jl(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var s=ta(n);if(!s)throw Error(Q(90));fp(n),jl(n,s)}}}break;case"textarea":mp(e,r);break;case"select":t=r.value,t!=null&&Tn(e,!!r.multiple,t,!1)}};xp=Tu;Cp=Jr;var Px={usingClientEntryPoint:!1,Events:[si,xn,ta,Sp,wp,Tu]},fs={findFiberByHostInstance:Wr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Tx={bundleType:fs.bundleType,version:fs.version,rendererPackageName:fs.rendererPackageName,rendererConfig:fs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Zt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=kp(e),e===null?null:e.stateNode},findFiberByHostInstance:fs.findFiberByHostInstance||kx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $i=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$i.isDisabled&&$i.supportsFiber)try{Qo=$i.inject(Tx),Ot=$i}catch{}}at.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Px;at.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ou(t))throw Error(Q(200));return Ex(e,t,null,r)};at.createRoot=function(e,t){if(!Ou(e))throw Error(Q(299));var r=!1,n="",s=sv;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Mu(e,1,!1,null,null,r,!1,n,s),e[qt]=t.current,Hs(e.nodeType===8?e.parentNode:e),new Iu(t)};at.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Q(188)):(e=Object.keys(e).join(","),Error(Q(268,e)));return e=kp(t),e=e===null?null:e.stateNode,e};at.flushSync=function(e){return Jr(e)};at.hydrate=function(e,t,r){if(!ua(t))throw Error(Q(200));return da(null,e,t,!0,r)};at.hydrateRoot=function(e,t,r){if(!Ou(e))throw Error(Q(405));var n=r!=null&&r.hydratedSources||null,s=!1,o="",l=sv;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(o=r.identifierPrefix),r.onRecoverableError!==void 0&&(l=r.onRecoverableError)),t=nv(t,null,e,1,r??null,s,!1,o,l),e[qt]=t.current,Hs(e),n)for(e=0;e<n.length;e++)r=n[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new ca(t)};at.render=function(e,t,r){if(!ua(t))throw Error(Q(200));return da(null,e,t,!1,r)};at.unmountComponentAtNode=function(e){if(!ua(e))throw Error(Q(40));return e._reactRootContainer?(Jr(function(){da(null,null,e,!1,function(){e._reactRootContainer=null,e[qt]=null})}),!0):!1};at.unstable_batchedUpdates=Tu;at.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!ua(r))throw Error(Q(200));if(e==null||e._reactInternals===void 0)throw Error(Q(38));return da(e,t,r,!1,n)};at.version="18.3.1-next-f1338f8080-20240426";function iv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(iv)}catch(e){console.error(e)}}iv(),ip.exports=at;var on=ip.exports;const Lx=Gf(on);var $h=on;Ll.createRoot=$h.createRoot,Ll.hydrateRoot=$h.hydrateRoot;/**
41
- * @remix-run/router v1.23.2
42
- *
43
- * Copyright (c) Remix Software Inc.
44
- *
45
- * This source code is licensed under the MIT license found in the
46
- * LICENSE.md file in the root directory of this source tree.
47
- *
48
- * @license MIT
49
- */function Ys(){return Ys=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ys.apply(this,arguments)}var pr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(pr||(pr={}));const Fh="popstate";function Ax(e){e===void 0&&(e={});function t(n,s){let{pathname:o,search:l,hash:i}=n.location;return Cc("",{pathname:o,search:l,hash:i},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(n,s){return typeof s=="string"?s:ov(s)}return Mx(t,r,null,e)}function ke(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ju(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Dx(){return Math.random().toString(36).substr(2,8)}function Hh(e,t){return{usr:e.state,key:e.key,idx:t}}function Cc(e,t,r,n){return r===void 0&&(r=null),Ys({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Qn(t):t,{state:r,key:t&&t.key||n||Dx()})}function ov(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Qn(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Mx(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:o=!1}=n,l=s.history,i=pr.Pop,a=null,c=p();c==null&&(c=0,l.replaceState(Ys({},l.state,{idx:c}),""));function p(){return(l.state||{idx:null}).idx}function u(){i=pr.Pop;let m=p(),h=m==null?null:m-c;c=m,a&&a({action:i,location:_.location,delta:h})}function v(m,h){i=pr.Push;let d=Cc(_.location,m,h);c=p()+1;let f=Hh(d,c),S=_.createHref(d);try{l.pushState(f,"",S)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;s.location.assign(S)}o&&a&&a({action:i,location:_.location,delta:1})}function y(m,h){i=pr.Replace;let d=Cc(_.location,m,h);c=p();let f=Hh(d,c),S=_.createHref(d);l.replaceState(f,"",S),o&&a&&a({action:i,location:_.location,delta:0})}function w(m){let h=s.location.origin!=="null"?s.location.origin:s.location.href,d=typeof m=="string"?m:ov(m);return d=d.replace(/ $/,"%20"),ke(h,"No window.location.(origin|href) available to create URL for href: "+d),new URL(d,h)}let _={get action(){return i},get location(){return e(s,l)},listen(m){if(a)throw new Error("A history only accepts one active listener");return s.addEventListener(Fh,u),a=m,()=>{s.removeEventListener(Fh,u),a=null}},createHref(m){return t(s,m)},createURL:w,encodeLocation(m){let h=w(m);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:v,replace:y,go(m){return l.go(m)}};return _}var Wh;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Wh||(Wh={}));function Nx(e,t,r){return r===void 0&&(r="/"),Ix(e,t,r)}function Ix(e,t,r,n){let s=typeof t=="string"?Qn(t):t,o=cv(s.pathname||"/",r);if(o==null)return null;let l=av(e);Ox(l);let i=null;for(let a=0;i==null&&a<l.length;++a){let c=qx(o);i=Vx(l[a],c)}return i}function av(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let s=(o,l,i)=>{let a={relativePath:i===void 0?o.path||"":i,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};a.relativePath.startsWith("/")&&(ke(a.relativePath.startsWith(n),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(n.length));let c=Gr([n,a.relativePath]),p=r.concat(a);o.children&&o.children.length>0&&(ke(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),av(o.children,t,p,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:zx(c,o.index),routesMeta:p})};return e.forEach((o,l)=>{var i;if(o.path===""||!((i=o.path)!=null&&i.includes("?")))s(o,l);else for(let a of lv(o.path))s(o,l,a)}),t}function lv(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return s?[o,""]:[o];let l=lv(n.join("/")),i=[];return i.push(...l.map(a=>a===""?o:[o,a].join("/"))),s&&i.push(...l),i.map(a=>e.startsWith("/")&&a===""?"/":a)}function Ox(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Ux(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const jx=/^:[\w-]+$/,Bx=3,$x=2,Fx=1,Hx=10,Wx=-2,zh=e=>e==="*";function zx(e,t){let r=e.split("/"),n=r.length;return r.some(zh)&&(n+=Wx),t&&(n+=$x),r.filter(s=>!zh(s)).reduce((s,o)=>s+(jx.test(o)?Bx:o===""?Fx:Hx),n)}function Ux(e,t){return e.length===t.length&&e.slice(0,-1).every((n,s)=>n===t[s])?e[e.length-1]-t[t.length-1]:0}function Vx(e,t,r){let{routesMeta:n}=e,s={},o="/",l=[];for(let i=0;i<n.length;++i){let a=n[i],c=i===n.length-1,p=o==="/"?t:t.slice(o.length)||"/",u=Kx({path:a.relativePath,caseSensitive:a.caseSensitive,end:c},p),v=a.route;if(!u)return null;Object.assign(s,u.params),l.push({params:s,pathname:Gr([o,u.pathname]),pathnameBase:Zx(Gr([o,u.pathnameBase])),route:v}),u.pathnameBase!=="/"&&(o=Gr([o,u.pathnameBase]))}return l}function Kx(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Gx(e.path,e.caseSensitive,e.end),s=t.match(r);if(!s)return null;let o=s[0],l=o.replace(/(.)\/+$/,"$1"),i=s.slice(1);return{params:n.reduce((c,p,u)=>{let{paramName:v,isOptional:y}=p;if(v==="*"){let _=i[u]||"";l=o.slice(0,o.length-_.length).replace(/(.)\/+$/,"$1")}const w=i[u];return y&&!w?c[v]=void 0:c[v]=(w||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:l,pattern:e}}function Gx(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),ju(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,i,a)=>(n.push({paramName:i,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),n]}function qx(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ju(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function cv(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const Xx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Yx=e=>Xx.test(e);function Qx(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?Qn(e):e,o;if(r)if(Yx(r))o=r;else{if(r.includes("//")){let l=r;r=r.replace(/\/\/+/g,"/"),ju(!1,"Pathnames cannot have embedded double slashes - normalizing "+(l+" -> "+r))}r.startsWith("/")?o=Uh(r.substring(1),"/"):o=Uh(r,t)}else o=t;return{pathname:o,search:eC(n),hash:tC(s)}}function Uh(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function hl(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Jx(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function uv(e,t){let r=Jx(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function dv(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=Qn(e):(s=Ys({},e),ke(!s.pathname||!s.pathname.includes("?"),hl("?","pathname","search",s)),ke(!s.pathname||!s.pathname.includes("#"),hl("#","pathname","hash",s)),ke(!s.search||!s.search.includes("#"),hl("#","search","hash",s)));let o=e===""||s.pathname==="",l=o?"/":s.pathname,i;if(l==null)i=r;else{let u=t.length-1;if(!n&&l.startsWith("..")){let v=l.split("/");for(;v[0]==="..";)v.shift(),u-=1;s.pathname=v.join("/")}i=u>=0?t[u]:"/"}let a=Qx(s,i),c=l&&l!=="/"&&l.endsWith("/"),p=(o||l===".")&&r.endsWith("/");return!a.pathname.endsWith("/")&&(c||p)&&(a.pathname+="/"),a}const Gr=e=>e.join("/").replace(/\/\/+/g,"/"),Zx=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),eC=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,tC=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function rC(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const hv=["post","put","patch","delete"];new Set(hv);const nC=["get",...hv];new Set(nC);/**
50
- * React Router v6.30.3
51
- *
52
- * Copyright (c) Remix Software Inc.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE.md file in the root directory of this source tree.
56
- *
57
- * @license MIT
58
- */function Qs(){return Qs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qs.apply(this,arguments)}const Bu=g.createContext(null),sC=g.createContext(null),oi=g.createContext(null),ha=g.createContext(null),an=g.createContext({outlet:null,matches:[],isDataRoute:!1}),fv=g.createContext(null);function ai(){return g.useContext(ha)!=null}function $u(){return ai()||ke(!1),g.useContext(ha).location}function pv(e){g.useContext(oi).static||g.useLayoutEffect(e)}function iC(){let{isDataRoute:e}=g.useContext(an);return e?_C():oC()}function oC(){ai()||ke(!1);let e=g.useContext(Bu),{basename:t,future:r,navigator:n}=g.useContext(oi),{matches:s}=g.useContext(an),{pathname:o}=$u(),l=JSON.stringify(uv(s,r.v7_relativeSplatPath)),i=g.useRef(!1);return pv(()=>{i.current=!0}),g.useCallback(function(c,p){if(p===void 0&&(p={}),!i.current)return;if(typeof c=="number"){n.go(c);return}let u=dv(c,JSON.parse(l),o,p.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:Gr([t,u.pathname])),(p.replace?n.replace:n.push)(u,p.state,p)},[t,n,l,o,e])}function aC(e,t){return lC(e,t)}function lC(e,t,r,n){ai()||ke(!1);let{navigator:s}=g.useContext(oi),{matches:o}=g.useContext(an),l=o[o.length-1],i=l?l.params:{};l&&l.pathname;let a=l?l.pathnameBase:"/";l&&l.route;let c=$u(),p;if(t){var u;let m=typeof t=="string"?Qn(t):t;a==="/"||(u=m.pathname)!=null&&u.startsWith(a)||ke(!1),p=m}else p=c;let v=p.pathname||"/",y=v;if(a!=="/"){let m=a.replace(/^\//,"").split("/");y="/"+v.replace(/^\//,"").split("/").slice(m.length).join("/")}let w=Nx(e,{pathname:y}),_=fC(w&&w.map(m=>Object.assign({},m,{params:Object.assign({},i,m.params),pathname:Gr([a,s.encodeLocation?s.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?a:Gr([a,s.encodeLocation?s.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),o,r,n);return t&&_?g.createElement(ha.Provider,{value:{location:Qs({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:pr.Pop}},_):_}function cC(){let e=gC(),t=rC(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),r?g.createElement("pre",{style:s},r):null,null)}const uC=g.createElement(cC,null);class dC extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?g.createElement(an.Provider,{value:this.props.routeContext},g.createElement(fv.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function hC(e){let{routeContext:t,match:r,children:n}=e,s=g.useContext(Bu);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),g.createElement(an.Provider,{value:t},n)}function fC(e,t,r,n){var s;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var o;if(!r)return null;if(r.errors)e=r.matches;else if((o=n)!=null&&o.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let l=e,i=(s=r)==null?void 0:s.errors;if(i!=null){let p=l.findIndex(u=>u.route.id&&(i==null?void 0:i[u.route.id])!==void 0);p>=0||ke(!1),l=l.slice(0,Math.min(l.length,p+1))}let a=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let p=0;p<l.length;p++){let u=l[p];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(c=p),u.route.id){let{loaderData:v,errors:y}=r,w=u.route.loader&&v[u.route.id]===void 0&&(!y||y[u.route.id]===void 0);if(u.route.lazy||w){a=!0,c>=0?l=l.slice(0,c+1):l=[l[0]];break}}}return l.reduceRight((p,u,v)=>{let y,w=!1,_=null,m=null;r&&(y=i&&u.route.id?i[u.route.id]:void 0,_=u.route.errorElement||uC,a&&(c<0&&v===0?(yC("route-fallback"),w=!0,m=null):c===v&&(w=!0,m=u.route.hydrateFallbackElement||null)));let h=t.concat(l.slice(0,v+1)),d=()=>{let f;return y?f=_:w?f=m:u.route.Component?f=g.createElement(u.route.Component,null):u.route.element?f=u.route.element:f=p,g.createElement(hC,{match:u,routeContext:{outlet:p,matches:h,isDataRoute:r!=null},children:f})};return r&&(u.route.ErrorBoundary||u.route.errorElement||v===0)?g.createElement(dC,{location:r.location,revalidation:r.revalidation,component:_,error:y,children:d(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):d()},null)}var mv=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(mv||{}),vv=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(vv||{});function pC(e){let t=g.useContext(Bu);return t||ke(!1),t}function mC(e){let t=g.useContext(sC);return t||ke(!1),t}function vC(e){let t=g.useContext(an);return t||ke(!1),t}function gv(e){let t=vC(),r=t.matches[t.matches.length-1];return r.route.id||ke(!1),r.route.id}function gC(){var e;let t=g.useContext(fv),r=mC(),n=gv();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function _C(){let{router:e}=pC(mv.UseNavigateStable),t=gv(vv.UseNavigateStable),r=g.useRef(!1);return pv(()=>{r.current=!0}),g.useCallback(function(s,o){o===void 0&&(o={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Qs({fromRouteId:t},o)))},[e,t])}const Vh={};function yC(e,t,r){Vh[e]||(Vh[e]=!0)}function SC(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Kh(e){let{to:t,replace:r,state:n,relative:s}=e;ai()||ke(!1);let{future:o,static:l}=g.useContext(oi),{matches:i}=g.useContext(an),{pathname:a}=$u(),c=iC(),p=dv(t,uv(i,o.v7_relativeSplatPath),a,s==="path"),u=JSON.stringify(p);return g.useEffect(()=>c(JSON.parse(u),{replace:r,state:n,relative:s}),[c,u,s,r,n]),null}function bc(e){ke(!1)}function wC(e){let{basename:t="/",children:r=null,location:n,navigationType:s=pr.Pop,navigator:o,static:l=!1,future:i}=e;ai()&&ke(!1);let a=t.replace(/^\/*/,"/"),c=g.useMemo(()=>({basename:a,navigator:o,static:l,future:Qs({v7_relativeSplatPath:!1},i)}),[a,i,o,l]);typeof n=="string"&&(n=Qn(n));let{pathname:p="/",search:u="",hash:v="",state:y=null,key:w="default"}=n,_=g.useMemo(()=>{let m=cv(p,a);return m==null?null:{location:{pathname:m,search:u,hash:v,state:y,key:w},navigationType:s}},[a,p,u,v,y,w,s]);return _==null?null:g.createElement(oi.Provider,{value:c},g.createElement(ha.Provider,{children:r,value:_}))}function xC(e){let{children:t,location:r}=e;return aC(Ec(t),r)}new Promise(()=>{});function Ec(e,t){t===void 0&&(t=[]);let r=[];return g.Children.forEach(e,(n,s)=>{if(!g.isValidElement(n))return;let o=[...t,s];if(n.type===g.Fragment){r.push.apply(r,Ec(n.props.children,o));return}n.type!==bc&&ke(!1),!n.props.index||!n.props.children||ke(!1);let l={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(l.children=Ec(n.props.children,o)),r.push(l)}),r}/**
59
- * React Router DOM v6.30.3
60
- *
61
- * Copyright (c) Remix Software Inc.
62
- *
63
- * This source code is licensed under the MIT license found in the
64
- * LICENSE.md file in the root directory of this source tree.
65
- *
66
- * @license MIT
67
- */const CC="6";try{window.__reactRouterVersion=CC}catch{}const bC="startTransition",Gh=Yo[bC];function EC(e){let{basename:t,children:r,future:n,window:s}=e,o=g.useRef();o.current==null&&(o.current=Ax({window:s,v5Compat:!0}));let l=o.current,[i,a]=g.useState({action:l.action,location:l.location}),{v7_startTransition:c}=n||{},p=g.useCallback(u=>{c&&Gh?Gh(()=>a(u)):a(u)},[a,c]);return g.useLayoutEffect(()=>l.listen(p),[l,p]),g.useEffect(()=>SC(n),[n]),g.createElement(wC,{basename:t,children:r,location:i.location,navigationType:i.action,navigator:l,future:n})}var qh;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(qh||(qh={}));var Xh;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Xh||(Xh={}));const _v=g.createContext({theme:"system",resolvedTheme:"light",setTheme:()=>{}});function kC(){return g.useContext(_v)}function RC(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Yh(e){return e==="system"?RC():e}function PC({children:e}){const[t,r]=g.useState(()=>localStorage.getItem("launchpod-theme")||"system"),[n,s]=g.useState(()=>Yh(localStorage.getItem("launchpod-theme")||"system")),o=g.useCallback(i=>{const a=Yh(i);s(a),document.documentElement.classList.toggle("dark",a==="dark")},[]),l=g.useCallback(i=>{r(i),localStorage.setItem("launchpod-theme",i),o(i)},[o]);return g.useEffect(()=>{o(t);const i=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>{t==="system"&&o("system")};return i.addEventListener("change",a),()=>i.removeEventListener("change",a)},[t,o]),x.jsx(_v.Provider,{value:{theme:t,resolvedTheme:n,setTheme:l},children:e})}function yv(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=yv(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Sv(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=yv(e))&&(n&&(n+=" "),n+=t);return n}const TC=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},LC=(e,t)=>({classGroupId:e,validator:t}),wv=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),jo="-",Qh=[],AC="arbitrary..",DC=e=>{const t=NC(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return MC(l);const i=l.split(jo),a=i[0]===""&&i.length>1?1:0;return xv(i,a,t)},getConflictingClassGroupIds:(l,i)=>{if(i){const a=n[l],c=r[l];return a?c?TC(c,a):a:c||Qh}return r[l]||Qh}}},xv=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],o=r.nextPart.get(s);if(o){const c=xv(e,t+1,o);if(c)return c}const l=r.validators;if(l===null)return;const i=t===0?e.join(jo):e.slice(t).join(jo),a=l.length;for(let c=0;c<a;c++){const p=l[c];if(p.validator(i))return p.classGroupId}},MC=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?AC+n:void 0})(),NC=e=>{const{theme:t,classGroups:r}=e;return IC(r,t)},IC=(e,t)=>{const r=wv();for(const n in e){const s=e[n];Fu(s,r,n,t)}return r},Fu=(e,t,r,n)=>{const s=e.length;for(let o=0;o<s;o++){const l=e[o];OC(l,t,r,n)}},OC=(e,t,r,n)=>{if(typeof e=="string"){jC(e,t,r);return}if(typeof e=="function"){BC(e,t,r,n);return}$C(e,t,r,n)},jC=(e,t,r)=>{const n=e===""?t:Cv(t,e);n.classGroupId=r},BC=(e,t,r,n)=>{if(FC(e)){Fu(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(LC(r,e))},$C=(e,t,r,n)=>{const s=Object.entries(e),o=s.length;for(let l=0;l<o;l++){const[i,a]=s[l];Fu(a,Cv(t,i),r,n)}},Cv=(e,t)=>{let r=e;const n=t.split(jo),s=n.length;for(let o=0;o<s;o++){const l=n[o];let i=r.nextPart.get(l);i||(i=wv(),r.nextPart.set(l,i)),r=i}return r},FC=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,HC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const s=(o,l)=>{r[o]=l,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(o){let l=r[o];if(l!==void 0)return l;if((l=n[o])!==void 0)return s(o,l),l},set(o,l){o in r?r[o]=l:s(o,l)}}},kc="!",Jh=":",WC=[],Zh=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),zC=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=s=>{const o=[];let l=0,i=0,a=0,c;const p=s.length;for(let _=0;_<p;_++){const m=s[_];if(l===0&&i===0){if(m===Jh){o.push(s.slice(a,_)),a=_+1;continue}if(m==="/"){c=_;continue}}m==="["?l++:m==="]"?l--:m==="("?i++:m===")"&&i--}const u=o.length===0?s:s.slice(a);let v=u,y=!1;u.endsWith(kc)?(v=u.slice(0,-1),y=!0):u.startsWith(kc)&&(v=u.slice(1),y=!0);const w=c&&c>a?c-a:void 0;return Zh(o,y,v,w)};if(t){const s=t+Jh,o=n;n=l=>l.startsWith(s)?o(l.slice(s.length)):Zh(WC,!1,l,void 0,!0)}if(r){const s=n;n=o=>r({className:o,parseClassName:s})}return n},UC=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let s=[];for(let o=0;o<r.length;o++){const l=r[o],i=l[0]==="[",a=t.has(l);i||a?(s.length>0&&(s.sort(),n.push(...s),s=[]),n.push(l)):s.push(l)}return s.length>0&&(s.sort(),n.push(...s)),n}},VC=e=>({cache:HC(e.cacheSize),parseClassName:zC(e),sortModifiers:UC(e),...DC(e)}),KC=/\s+/,GC=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:o}=t,l=[],i=e.trim().split(KC);let a="";for(let c=i.length-1;c>=0;c-=1){const p=i[c],{isExternal:u,modifiers:v,hasImportantModifier:y,baseClassName:w,maybePostfixModifierPosition:_}=r(p);if(u){a=p+(a.length>0?" "+a:a);continue}let m=!!_,h=n(m?w.substring(0,_):w);if(!h){if(!m){a=p+(a.length>0?" "+a:a);continue}if(h=n(w),!h){a=p+(a.length>0?" "+a:a);continue}m=!1}const d=v.length===0?"":v.length===1?v[0]:o(v).join(":"),f=y?d+kc:d,S=f+h;if(l.indexOf(S)>-1)continue;l.push(S);const E=s(h,m);for(let k=0;k<E.length;++k){const b=E[k];l.push(f+b)}a=p+(a.length>0?" "+a:a)}return a},qC=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=bv(r))&&(s&&(s+=" "),s+=n);return s},bv=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=bv(e[n]))&&(r&&(r+=" "),r+=t);return r},XC=(e,...t)=>{let r,n,s,o;const l=a=>{const c=t.reduce((p,u)=>u(p),e());return r=VC(c),n=r.cache.get,s=r.cache.set,o=i,i(a)},i=a=>{const c=n(a);if(c)return c;const p=GC(a,r);return s(a,p),p};return o=l,(...a)=>o(qC(...a))},YC=[],Re=e=>{const t=r=>r[e]||YC;return t.isThemeGetter=!0,t},Ev=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,kv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,QC=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,JC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,e1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,t1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,r1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ir=e=>QC.test(e),oe=e=>!!e&&!Number.isNaN(Number(e)),or=e=>!!e&&Number.isInteger(Number(e)),fl=e=>e.endsWith("%")&&oe(e.slice(0,-1)),Ht=e=>JC.test(e),Rv=()=>!0,n1=e=>ZC.test(e)&&!e1.test(e),Hu=()=>!1,s1=e=>t1.test(e),i1=e=>r1.test(e),o1=e=>!ee(e)&&!te(e),a1=e=>Dr(e,Lv,Hu),ee=e=>Ev.test(e),Br=e=>Dr(e,Av,n1),ef=e=>Dr(e,m1,oe),l1=e=>Dr(e,Mv,Rv),c1=e=>Dr(e,Dv,Hu),tf=e=>Dr(e,Pv,Hu),u1=e=>Dr(e,Tv,i1),Fi=e=>Dr(e,Nv,s1),te=e=>kv.test(e),ps=e=>ln(e,Av),d1=e=>ln(e,Dv),rf=e=>ln(e,Pv),h1=e=>ln(e,Lv),f1=e=>ln(e,Tv),Hi=e=>ln(e,Nv,!0),p1=e=>ln(e,Mv,!0),Dr=(e,t,r)=>{const n=Ev.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},ln=(e,t,r=!1)=>{const n=kv.exec(e);return n?n[1]?t(n[1]):r:!1},Pv=e=>e==="position"||e==="percentage",Tv=e=>e==="image"||e==="url",Lv=e=>e==="length"||e==="size"||e==="bg-size",Av=e=>e==="length",m1=e=>e==="number",Dv=e=>e==="family-name",Mv=e=>e==="number"||e==="weight",Nv=e=>e==="shadow",v1=()=>{const e=Re("color"),t=Re("font"),r=Re("text"),n=Re("font-weight"),s=Re("tracking"),o=Re("leading"),l=Re("breakpoint"),i=Re("container"),a=Re("spacing"),c=Re("radius"),p=Re("shadow"),u=Re("inset-shadow"),v=Re("text-shadow"),y=Re("drop-shadow"),w=Re("blur"),_=Re("perspective"),m=Re("aspect"),h=Re("ease"),d=Re("animate"),f=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...S(),te,ee],k=()=>["auto","hidden","clip","visible","scroll"],b=()=>["auto","contain","none"],C=()=>[te,ee,a],P=()=>[ir,"full","auto",...C()],T=()=>[or,"none","subgrid",te,ee],M=()=>["auto",{span:["full",or,te,ee]},or,te,ee],j=()=>[or,"auto",te,ee],N=()=>["auto","min","max","fr",te,ee],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],K=()=>["auto",...C()],q=()=>[ir,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],B=()=>[ir,"screen","full","dvw","lvw","svw","min","max","fit",...C()],R=()=>[ir,"screen","full","lh","dvh","lvh","svh","min","max","fit",...C()],L=()=>[e,te,ee],I=()=>[...S(),rf,tf,{position:[te,ee]}],D=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",h1,a1,{size:[te,ee]}],F=()=>[fl,ps,Br],U=()=>["","none","full",c,te,ee],G=()=>["",oe,ps,Br],O=()=>["solid","dashed","dotted","double"],A=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>[oe,fl,rf,tf],H=()=>["","none",w,te,ee],Y=()=>["none",oe,te,ee],X=()=>["none",oe,te,ee],ne=()=>[oe,te,ee],ie=()=>[ir,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ht],breakpoint:[Ht],color:[Rv],container:[Ht],"drop-shadow":[Ht],ease:["in","out","in-out"],font:[o1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ht],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ht],shadow:[Ht],spacing:["px",oe],text:[Ht],"text-shadow":[Ht],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ir,ee,te,m]}],container:["container"],columns:[{columns:[oe,ee,te,i]}],"break-after":[{"break-after":f()}],"break-before":[{"break-before":f()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:b()}],"overscroll-x":[{"overscroll-x":b()}],"overscroll-y":[{"overscroll-y":b()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{"inset-s":P(),start:P()}],end:[{"inset-e":P(),end:P()}],"inset-bs":[{"inset-bs":P()}],"inset-be":[{"inset-be":P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[or,"auto",te,ee]}],basis:[{basis:[ir,"full","auto",i,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[oe,ir,"auto","initial","none",ee]}],grow:[{grow:["",oe,te,ee]}],shrink:[{shrink:["",oe,te,ee]}],order:[{order:[or,"first","last","none",te,ee]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:K()}],mx:[{mx:K()}],my:[{my:K()}],ms:[{ms:K()}],me:[{me:K()}],mbs:[{mbs:K()}],mbe:[{mbe:K()}],mt:[{mt:K()}],mr:[{mr:K()}],mb:[{mb:K()}],ml:[{ml:K()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],"inline-size":[{inline:["auto",...B()]}],"min-inline-size":[{"min-inline":["auto",...B()]}],"max-inline-size":[{"max-inline":["none",...B()]}],"block-size":[{block:["auto",...R()]}],"min-block-size":[{"min-block":["auto",...R()]}],"max-block-size":[{"max-block":["none",...R()]}],w:[{w:[i,"screen",...q()]}],"min-w":[{"min-w":[i,"screen","none",...q()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[l]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",r,ps,Br]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,p1,l1]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",fl,ee]}],"font-family":[{font:[d1,c1,t]}],"font-features":[{"font-features":[ee]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,te,ee]}],"line-clamp":[{"line-clamp":[oe,"none",te,ef]}],leading:[{leading:[o,...C()]}],"list-image":[{"list-image":["none",te,ee]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",te,ee]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:[oe,"from-font","auto",te,Br]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[oe,"auto",te,ee]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",te,ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",te,ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:D()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},or,te,ee],radial:["",te,ee],conic:[or,te,ee]},f1,u1]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:G()}],"border-w-x":[{"border-x":G()}],"border-w-y":[{"border-y":G()}],"border-w-s":[{"border-s":G()}],"border-w-e":[{"border-e":G()}],"border-w-bs":[{"border-bs":G()}],"border-w-be":[{"border-be":G()}],"border-w-t":[{"border-t":G()}],"border-w-r":[{"border-r":G()}],"border-w-b":[{"border-b":G()}],"border-w-l":[{"border-l":G()}],"divide-x":[{"divide-x":G()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":G()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...O(),"hidden","none"]}],"divide-style":[{divide:[...O(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...O(),"none","hidden"]}],"outline-offset":[{"outline-offset":[oe,te,ee]}],"outline-w":[{outline:["",oe,ps,Br]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",p,Hi,Fi]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",u,Hi,Fi]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[oe,Br]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":G()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",v,Hi,Fi]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[oe,te,ee]}],"mix-blend":[{"mix-blend":[...A(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":A()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[te,ee]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:D()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",te,ee]}],filter:[{filter:["","none",te,ee]}],blur:[{blur:H()}],brightness:[{brightness:[oe,te,ee]}],contrast:[{contrast:[oe,te,ee]}],"drop-shadow":[{"drop-shadow":["","none",y,Hi,Fi]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",oe,te,ee]}],"hue-rotate":[{"hue-rotate":[oe,te,ee]}],invert:[{invert:["",oe,te,ee]}],saturate:[{saturate:[oe,te,ee]}],sepia:[{sepia:["",oe,te,ee]}],"backdrop-filter":[{"backdrop-filter":["","none",te,ee]}],"backdrop-blur":[{"backdrop-blur":H()}],"backdrop-brightness":[{"backdrop-brightness":[oe,te,ee]}],"backdrop-contrast":[{"backdrop-contrast":[oe,te,ee]}],"backdrop-grayscale":[{"backdrop-grayscale":["",oe,te,ee]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[oe,te,ee]}],"backdrop-invert":[{"backdrop-invert":["",oe,te,ee]}],"backdrop-opacity":[{"backdrop-opacity":[oe,te,ee]}],"backdrop-saturate":[{"backdrop-saturate":[oe,te,ee]}],"backdrop-sepia":[{"backdrop-sepia":["",oe,te,ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",te,ee]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[oe,"initial",te,ee]}],ease:[{ease:["linear","initial",h,te,ee]}],delay:[{delay:[oe,te,ee]}],animate:[{animate:["none",d,te,ee]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,te,ee]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:Y()}],"rotate-x":[{"rotate-x":Y()}],"rotate-y":[{"rotate-y":Y()}],"rotate-z":[{"rotate-z":Y()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[te,ee,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ie()}],"translate-x":[{"translate-x":ie()}],"translate-y":[{"translate-y":ie()}],"translate-z":[{"translate-z":ie()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",te,ee]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",te,ee]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[oe,ps,Br,ef]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},g1=XC(v1);function re(...e){return g1(Sv(e))}function Iv(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l);i.displayName=o+"Context";const a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,_1(s,...t)]}function _1(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function $t(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}var Le=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{};function nf(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fe(...e){return t=>{let r=!1;const n=e.map(s=>{const o=nf(s,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():nf(e[s],null)}}}}function le(...e){return g.useCallback(fe(...e),e)}var y1=Symbol.for("react.lazy"),Bo=Yo[" use ".trim().toString()];function S1(e){return typeof e=="object"&&e!==null&&"then"in e}function Ov(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===y1&&"_payload"in e&&S1(e._payload)}function jv(e){const t=w1(e),r=g.forwardRef((n,s)=>{let{children:o,...l}=n;Ov(o)&&typeof Bo=="function"&&(o=Bo(o._payload));const i=g.Children.toArray(o),a=i.find(C1);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}var Bv=jv("Slot");function w1(e){const t=g.forwardRef((r,n)=>{let{children:s,...o}=r;if(Ov(s)&&typeof Bo=="function"&&(s=Bo(s._payload)),g.isValidElement(s)){const l=E1(s),i=b1(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var x1=Symbol("radix.slottable");function C1(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===x1}function b1(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function E1(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var k1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ue=k1.reduce((e,t)=>{const r=jv(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),$v={exports:{}},Fv={};/**
68
- * @license React
69
- * use-sync-external-store-shim.production.js
70
- *
71
- * Copyright (c) Meta Platforms, Inc. and affiliates.
72
- *
73
- * This source code is licensed under the MIT license found in the
74
- * LICENSE file in the root directory of this source tree.
75
- */var Un=g;function R1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var P1=typeof Object.is=="function"?Object.is:R1,T1=Un.useState,L1=Un.useEffect,A1=Un.useLayoutEffect,D1=Un.useDebugValue;function M1(e,t){var r=t(),n=T1({inst:{value:r,getSnapshot:t}}),s=n[0].inst,o=n[1];return A1(function(){s.value=r,s.getSnapshot=t,pl(s)&&o({inst:s})},[e,r,t]),L1(function(){return pl(s)&&o({inst:s}),e(function(){pl(s)&&o({inst:s})})},[e]),D1(r),r}function pl(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!P1(e,r)}catch{return!0}}function N1(e,t){return t()}var I1=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?N1:M1;Fv.useSyncExternalStore=Un.useSyncExternalStore!==void 0?Un.useSyncExternalStore:I1;$v.exports=Fv;var O1=$v.exports;function j1(){return O1.useSyncExternalStore(B1,()=>!0,()=>!1)}function B1(){return()=>{}}var Wu="Avatar",[$1]=Iv(Wu),[F1,Hv]=$1(Wu),Wv=g.forwardRef((e,t)=>{const{__scopeAvatar:r,...n}=e,[s,o]=g.useState("idle");return x.jsx(F1,{scope:r,imageLoadingStatus:s,onImageLoadingStatusChange:o,children:x.jsx(Ue.span,{...n,ref:t})})});Wv.displayName=Wu;var zv="AvatarImage",Uv=g.forwardRef((e,t)=>{const{__scopeAvatar:r,src:n,onLoadingStatusChange:s=()=>{},...o}=e,l=Hv(zv,r),i=H1(n,o),a=$t(c=>{s(c),l.onImageLoadingStatusChange(c)});return Le(()=>{i!=="idle"&&a(i)},[i,a]),i==="loaded"?x.jsx(Ue.img,{...o,ref:t,src:n}):null});Uv.displayName=zv;var Vv="AvatarFallback",Kv=g.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:n,...s}=e,o=Hv(Vv,r),[l,i]=g.useState(n===void 0);return g.useEffect(()=>{if(n!==void 0){const a=window.setTimeout(()=>i(!0),n);return()=>window.clearTimeout(a)}},[n]),l&&o.imageLoadingStatus!=="loaded"?x.jsx(Ue.span,{...s,ref:t}):null});Kv.displayName=Vv;function sf(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function H1(e,{referrerPolicy:t,crossOrigin:r}){const n=j1(),s=g.useRef(null),o=n?(s.current||(s.current=new window.Image),s.current):null,[l,i]=g.useState(()=>sf(o,e));return Le(()=>{i(sf(o,e))},[o,e]),Le(()=>{const a=u=>()=>{i(u)};if(!o)return;const c=a("loaded"),p=a("error");return o.addEventListener("load",c),o.addEventListener("error",p),t&&(o.referrerPolicy=t),typeof r=="string"&&(o.crossOrigin=r),()=>{o.removeEventListener("load",c),o.removeEventListener("error",p)}},[o,r,t]),l}var Gv=Wv,qv=Uv,Xv=Kv;const W1=g.forwardRef(({className:e,...t},r)=>x.jsx(Gv,{ref:r,className:re("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));W1.displayName=Gv.displayName;const z1=g.forwardRef(({className:e,...t},r)=>x.jsx(qv,{ref:r,className:re("aspect-square h-full w-full",e),...t}));z1.displayName=qv.displayName;const U1=g.forwardRef(({className:e,...t},r)=>x.jsx(Xv,{ref:r,className:re("flex h-full w-full items-center justify-center rounded-full bg-primary/10 text-primary font-medium",e),...t}));U1.displayName=Xv.displayName;const of=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,af=Sv,zu=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return af(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:o}=t,l=Object.keys(s).map(c=>{const p=r==null?void 0:r[c],u=o==null?void 0:o[c];if(p===null)return null;const v=of(p)||of(u);return s[c][v]}),i=r&&Object.entries(r).reduce((c,p)=>{let[u,v]=p;return v===void 0||(c[u]=v),c},{}),a=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,p)=>{let{class:u,className:v,...y}=p;return Object.entries(y).every(w=>{let[_,m]=w;return Array.isArray(m)?m.includes({...o,...i}[_]):{...o,...i}[_]===m})?[...c,u,v]:c},[]);return af(e,l,a,r==null?void 0:r.class,r==null?void 0:r.className)};/**
76
- * @license lucide-react v0.576.0 - ISC
77
- *
78
- * This source code is licensed under the ISC license.
79
- * See the LICENSE file in the root directory of this source tree.
80
- */const Yv=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
81
- * @license lucide-react v0.576.0 - ISC
82
- *
83
- * This source code is licensed under the ISC license.
84
- * See the LICENSE file in the root directory of this source tree.
85
- */const V1=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
86
- * @license lucide-react v0.576.0 - ISC
87
- *
88
- * This source code is licensed under the ISC license.
89
- * See the LICENSE file in the root directory of this source tree.
90
- */const K1=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase());/**
91
- * @license lucide-react v0.576.0 - ISC
92
- *
93
- * This source code is licensed under the ISC license.
94
- * See the LICENSE file in the root directory of this source tree.
95
- */const lf=e=>{const t=K1(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
96
- * @license lucide-react v0.576.0 - ISC
97
- *
98
- * This source code is licensed under the ISC license.
99
- * See the LICENSE file in the root directory of this source tree.
100
- */var G1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
101
- * @license lucide-react v0.576.0 - ISC
102
- *
103
- * This source code is licensed under the ISC license.
104
- * See the LICENSE file in the root directory of this source tree.
105
- */const q1=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
106
- * @license lucide-react v0.576.0 - ISC
107
- *
108
- * This source code is licensed under the ISC license.
109
- * See the LICENSE file in the root directory of this source tree.
110
- */const X1=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:l,...i},a)=>g.createElement("svg",{ref:a,...G1,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Yv("lucide",s),...!o&&!q1(i)&&{"aria-hidden":"true"},...i},[...l.map(([c,p])=>g.createElement(c,p)),...Array.isArray(o)?o:[o]]));/**
111
- * @license lucide-react v0.576.0 - ISC
112
- *
113
- * This source code is licensed under the ISC license.
114
- * See the LICENSE file in the root directory of this source tree.
115
- */const Ce=(e,t)=>{const r=g.forwardRef(({className:n,...s},o)=>g.createElement(X1,{ref:o,iconNode:t,className:Yv(`lucide-${V1(lf(e))}`,`lucide-${e}`,n),...s}));return r.displayName=lf(e),r};/**
116
- * @license lucide-react v0.576.0 - ISC
117
- *
118
- * This source code is licensed under the ISC license.
119
- * See the LICENSE file in the root directory of this source tree.
120
- */const Y1=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Uu=Ce("check",Y1);/**
121
- * @license lucide-react v0.576.0 - ISC
122
- *
123
- * This source code is licensed under the ISC license.
124
- * See the LICENSE file in the root directory of this source tree.
125
- */const Q1=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Vu=Ce("chevron-down",Q1);/**
126
- * @license lucide-react v0.576.0 - ISC
127
- *
128
- * This source code is licensed under the ISC license.
129
- * See the LICENSE file in the root directory of this source tree.
130
- */const J1=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Qv=Ce("chevron-right",J1);/**
131
- * @license lucide-react v0.576.0 - ISC
132
- *
133
- * This source code is licensed under the ISC license.
134
- * See the LICENSE file in the root directory of this source tree.
135
- */const Z1=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],eb=Ce("chevron-up",Z1);/**
136
- * @license lucide-react v0.576.0 - ISC
137
- *
138
- * This source code is licensed under the ISC license.
139
- * See the LICENSE file in the root directory of this source tree.
140
- */const tb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],rb=Ce("circle",tb);/**
141
- * @license lucide-react v0.576.0 - ISC
142
- *
143
- * This source code is licensed under the ISC license.
144
- * See the LICENSE file in the root directory of this source tree.
145
- */const nb=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],sb=Ce("layout-dashboard",nb);/**
146
- * @license lucide-react v0.576.0 - ISC
147
- *
148
- * This source code is licensed under the ISC license.
149
- * See the LICENSE file in the root directory of this source tree.
150
- */const ib=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ob=Ce("loader-circle",ib);/**
151
- * @license lucide-react v0.576.0 - ISC
152
- *
153
- * This source code is licensed under the ISC license.
154
- * See the LICENSE file in the root directory of this source tree.
155
- */const ab=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],lb=Ce("log-out",ab);/**
156
- * @license lucide-react v0.576.0 - ISC
157
- *
158
- * This source code is licensed under the ISC license.
159
- * See the LICENSE file in the root directory of this source tree.
160
- */const cb=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],ub=Ce("moon",cb);/**
161
- * @license lucide-react v0.576.0 - ISC
162
- *
163
- * This source code is licensed under the ISC license.
164
- * See the LICENSE file in the root directory of this source tree.
165
- */const db=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],hb=Ce("pause",db);/**
166
- * @license lucide-react v0.576.0 - ISC
167
- *
168
- * This source code is licensed under the ISC license.
169
- * See the LICENSE file in the root directory of this source tree.
170
- */const fb=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],pb=Ce("play",fb);/**
171
- * @license lucide-react v0.576.0 - ISC
172
- *
173
- * This source code is licensed under the ISC license.
174
- * See the LICENSE file in the root directory of this source tree.
175
- */const mb=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],vb=Ce("refresh-cw",mb);/**
176
- * @license lucide-react v0.576.0 - ISC
177
- *
178
- * This source code is licensed under the ISC license.
179
- * See the LICENSE file in the root directory of this source tree.
180
- */const gb=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],_b=Ce("rotate-ccw",gb);/**
181
- * @license lucide-react v0.576.0 - ISC
182
- *
183
- * This source code is licensed under the ISC license.
184
- * See the LICENSE file in the root directory of this source tree.
185
- */const yb=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Sb=Ce("search",yb);/**
186
- * @license lucide-react v0.576.0 - ISC
187
- *
188
- * This source code is licensed under the ISC license.
189
- * See the LICENSE file in the root directory of this source tree.
190
- */const wb=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],xb=Ce("settings",wb);/**
191
- * @license lucide-react v0.576.0 - ISC
192
- *
193
- * This source code is licensed under the ISC license.
194
- * See the LICENSE file in the root directory of this source tree.
195
- */const Cb=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],bb=Ce("sun",Cb);/**
196
- * @license lucide-react v0.576.0 - ISC
197
- *
198
- * This source code is licensed under the ISC license.
199
- * See the LICENSE file in the root directory of this source tree.
200
- */const Eb=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],kb=Ce("terminal",Eb);/**
201
- * @license lucide-react v0.576.0 - ISC
202
- *
203
- * This source code is licensed under the ISC license.
204
- * See the LICENSE file in the root directory of this source tree.
205
- */const Rb=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Pb=Ce("trash-2",Rb);/**
206
- * @license lucide-react v0.576.0 - ISC
207
- *
208
- * This source code is licensed under the ISC license.
209
- * See the LICENSE file in the root directory of this source tree.
210
- */const Tb=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Lb=Ce("wrench",Tb);/**
211
- * @license lucide-react v0.576.0 - ISC
212
- *
213
- * This source code is licensed under the ISC license.
214
- * See the LICENSE file in the root directory of this source tree.
215
- */const Ab=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Jv=Ce("x",Ab);/**
216
- * @license lucide-react v0.576.0 - ISC
217
- *
218
- * This source code is licensed under the ISC license.
219
- * See the LICENSE file in the root directory of this source tree.
220
- */const Db=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Mb=Ce("zap",Db),Nb=g.forwardRef(({...e},t)=>x.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));Nb.displayName="Breadcrumb";const Ib=g.forwardRef(({className:e,...t},r)=>x.jsx("ol",{ref:r,className:re("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));Ib.displayName="BreadcrumbList";const Ob=g.forwardRef(({className:e,...t},r)=>x.jsx("li",{ref:r,className:re("inline-flex items-center gap-1.5",e),...t}));Ob.displayName="BreadcrumbItem";const jb=g.forwardRef(({asChild:e,className:t,...r},n)=>{const s=e?Bv:"a";return x.jsx(s,{ref:n,className:re("transition-colors hover:text-foreground",t),...r})});jb.displayName="BreadcrumbLink";const Bb=g.forwardRef(({className:e,...t},r)=>x.jsx("span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:re("font-normal text-foreground",e),...t}));Bb.displayName="BreadcrumbPage";const $b=zu("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Zv=g.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},o)=>{const l=n?Bv:"button";return x.jsx(l,{className:re($b({variant:t,size:r,className:e})),ref:o,...s})});Zv.displayName="Button";const Fb=g.forwardRef(({className:e,onClick:t,...r},n)=>{const s=g.useRef(null),[o,l]=g.useState(!1);return g.useEffect(()=>{var c;const i=s.current;if(!i)return;const a=!!t||((c=i.parentElement)==null?void 0:c.tagName)==="A"||!!i.querySelector(":scope > a");l(a)},[t]),x.jsx("div",{ref:i=>{s.current=i,typeof n=="function"?n(i):n&&(n.current=i)},className:re("ls-card rounded-xl bg-card text-card-foreground",o&&"interactive",e),onClick:t,...r})});Fb.displayName="Card";const Hb=g.forwardRef(({className:e,...t},r)=>x.jsx("div",{ref:r,className:re("flex flex-col space-y-1.5 p-6",e),...t}));Hb.displayName="CardHeader";const Wb=g.forwardRef(({className:e,...t},r)=>x.jsx("div",{ref:r,className:re("font-semibold leading-none tracking-tight",e),...t}));Wb.displayName="CardTitle";const zb=g.forwardRef(({className:e,...t},r)=>x.jsx("div",{ref:r,className:re("text-sm text-muted-foreground",e),...t}));zb.displayName="CardDescription";const Ub=g.forwardRef(({className:e,...t},r)=>x.jsx("div",{ref:r,className:re("p-6 pt-0",e),...t}));Ub.displayName="CardContent";const Vb=g.forwardRef(({className:e,...t},r)=>x.jsx("div",{ref:r,className:re("flex items-center p-6 pt-0",e),...t}));Vb.displayName="CardFooter";function Kb(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l),a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,Gb(s,...t)]}function Gb(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function J(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}var qb=Yo[" useInsertionEffect ".trim().toString()]||Le;function li({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,o,l]=Xb({defaultProp:t,onChange:r}),i=e!==void 0,a=i?e:s;{const p=g.useRef(e!==void 0);g.useEffect(()=>{const u=p.current;u!==i&&console.warn(`${n} is changing from ${u?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=i},[i,n])}const c=g.useCallback(p=>{var u;if(i){const v=Yb(p)?p(e):p;v!==e&&((u=l.current)==null||u.call(l,v))}else o(p)},[i,e,o,l]);return[a,c]}function Xb({defaultProp:e,onChange:t}){const[r,n]=g.useState(e),s=g.useRef(r),o=g.useRef(t);return qb(()=>{o.current=t},[t]),g.useEffect(()=>{var l;s.current!==r&&((l=o.current)==null||l.call(o,r),s.current=r)},[r,s]),[r,n,o]}function Yb(e){return typeof e=="function"}function Ku(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Gu(e){const[t,r]=g.useState(void 0);return Le(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let l,i;if("borderBoxSize"in o){const a=o.borderBoxSize,c=Array.isArray(a)?a[0]:a;l=c.inlineSize,i=c.blockSize}else l=e.offsetWidth,i=e.offsetHeight;r({width:l,height:i})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}function Qb(e,t){return g.useReducer((r,n)=>t[r][n]??r,e)}var Qe=e=>{const{present:t,children:r}=e,n=Jb(t),s=typeof r=="function"?r({present:n.isPresent}):g.Children.only(r),o=le(n.ref,Zb(s));return typeof r=="function"||n.isPresent?g.cloneElement(s,{ref:o}):null};Qe.displayName="Presence";function Jb(e){const[t,r]=g.useState(),n=g.useRef(null),s=g.useRef(e),o=g.useRef("none"),l=e?"mounted":"unmounted",[i,a]=Qb(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const c=Wi(n.current);o.current=i==="mounted"?c:"none"},[i]),Le(()=>{const c=n.current,p=s.current;if(p!==e){const v=o.current,y=Wi(c);e?a("MOUNT"):y==="none"||(c==null?void 0:c.display)==="none"?a("UNMOUNT"):a(p&&v!==y?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,a]),Le(()=>{if(t){let c;const p=t.ownerDocument.defaultView??window,u=y=>{const _=Wi(n.current).includes(CSS.escape(y.animationName));if(y.target===t&&_&&(a("ANIMATION_END"),!s.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",c=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},v=y=>{y.target===t&&(o.current=Wi(n.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{p.clearTimeout(c),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:g.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function Wi(e){return(e==null?void 0:e.animationName)||"none"}function Zb(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function eE(e){const t=tE(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(nE);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function tE(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=iE(s),i=sE(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rE=Symbol("radix.slottable");function nE(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rE}function sE(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function iE(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var oE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qu=oE.reduce((e,t)=>{const r=eE(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),fa="Checkbox",[aE]=Kb(fa),[lE,Xu]=aE(fa);function cE(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:s,disabled:o,form:l,name:i,onCheckedChange:a,required:c,value:p="on",internal_do_not_use_render:u}=e,[v,y]=li({prop:r,defaultProp:s??!1,onChange:a,caller:fa}),[w,_]=g.useState(null),[m,h]=g.useState(null),d=g.useRef(!1),f=w?!!l||!!w.closest("form"):!0,S={checked:v,disabled:o,setChecked:y,control:w,setControl:_,name:i,form:l,value:p,hasConsumerStoppedPropagationRef:d,required:c,defaultChecked:Cr(s)?!1:s,isFormControl:f,bubbleInput:m,setBubbleInput:h};return x.jsx(lE,{scope:t,...S,children:uE(u)?u(S):n})}var eg="CheckboxTrigger",tg=g.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},s)=>{const{control:o,value:l,disabled:i,checked:a,required:c,setControl:p,setChecked:u,hasConsumerStoppedPropagationRef:v,isFormControl:y,bubbleInput:w}=Xu(eg,e),_=le(s,p),m=g.useRef(a);return g.useEffect(()=>{const h=o==null?void 0:o.form;if(h){const d=()=>u(m.current);return h.addEventListener("reset",d),()=>h.removeEventListener("reset",d)}},[o,u]),x.jsx(qu.button,{type:"button",role:"checkbox","aria-checked":Cr(a)?"mixed":a,"aria-required":c,"data-state":og(a),"data-disabled":i?"":void 0,disabled:i,value:l,...n,ref:_,onKeyDown:J(t,h=>{h.key==="Enter"&&h.preventDefault()}),onClick:J(r,h=>{u(d=>Cr(d)?!0:!d),w&&y&&(v.current=h.isPropagationStopped(),v.current||h.stopPropagation())})})});tg.displayName=eg;var Yu=g.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:s,defaultChecked:o,required:l,disabled:i,value:a,onCheckedChange:c,form:p,...u}=e;return x.jsx(cE,{__scopeCheckbox:r,checked:s,defaultChecked:o,disabled:i,required:l,onCheckedChange:c,name:n,form:p,value:a,internal_do_not_use_render:({isFormControl:v})=>x.jsxs(x.Fragment,{children:[x.jsx(tg,{...u,ref:t,__scopeCheckbox:r}),v&&x.jsx(ig,{__scopeCheckbox:r})]})})});Yu.displayName=fa;var rg="CheckboxIndicator",ng=g.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...s}=e,o=Xu(rg,r);return x.jsx(Qe,{present:n||Cr(o.checked)||o.checked===!0,children:x.jsx(qu.span,{"data-state":og(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});ng.displayName=rg;var sg="CheckboxBubbleInput",ig=g.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:s,checked:o,defaultChecked:l,required:i,disabled:a,name:c,value:p,form:u,bubbleInput:v,setBubbleInput:y}=Xu(sg,e),w=le(r,y),_=Ku(o),m=Gu(n);g.useEffect(()=>{const d=v;if(!d)return;const f=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(f,"checked").set,k=!s.current;if(_!==o&&E){const b=new Event("click",{bubbles:k});d.indeterminate=Cr(o),E.call(d,Cr(o)?!1:o),d.dispatchEvent(b)}},[v,_,o,s]);const h=g.useRef(Cr(o)?!1:o);return x.jsx(qu.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??h.current,required:i,disabled:a,name:c,value:p,form:u,...t,tabIndex:-1,ref:w,style:{...t.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ig.displayName=sg;function uE(e){return typeof e=="function"}function Cr(e){return e==="indeterminate"}function og(e){return Cr(e)?"indeterminate":e?"checked":"unchecked"}const dE=g.forwardRef(({className:e,...t},r)=>x.jsx(Yu,{ref:r,className:re("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:x.jsx(ng,{className:re("grid place-content-center text-current"),children:x.jsx(Uu,{className:"h-4 w-4"})})}));dE.displayName=Yu.displayName;var hE=Yo[" useId ".trim().toString()]||(()=>{}),fE=0;function st(e){const[t,r]=g.useState(hE());return Le(()=>{r(n=>n??String(fE++))},[e]),t?`radix-${t}`:""}var cf=1,pE=.9,mE=.8,vE=.17,ml=.1,vl=.999,gE=.9999,_E=.99,yE=/[\\\/_+.#"@\[\(\{&]/,SE=/[\\\/_+.#"@\[\(\{&]/g,wE=/[\s-]/,ag=/[\s-]/g;function Rc(e,t,r,n,s,o,l){if(o===t.length)return s===e.length?cf:_E;var i=`${s},${o}`;if(l[i]!==void 0)return l[i];for(var a=n.charAt(o),c=r.indexOf(a,s),p=0,u,v,y,w;c>=0;)u=Rc(e,t,r,n,c+1,o+1,l),u>p&&(c===s?u*=cf:yE.test(e.charAt(c-1))?(u*=mE,y=e.slice(s,c-1).match(SE),y&&s>0&&(u*=Math.pow(vl,y.length))):wE.test(e.charAt(c-1))?(u*=pE,w=e.slice(s,c-1).match(ag),w&&s>0&&(u*=Math.pow(vl,w.length))):(u*=vE,s>0&&(u*=Math.pow(vl,c-s))),e.charAt(c)!==t.charAt(o)&&(u*=gE)),(u<ml&&r.charAt(c-1)===n.charAt(o+1)||n.charAt(o+1)===n.charAt(o)&&r.charAt(c-1)!==n.charAt(o))&&(v=Rc(e,t,r,n,c+1,o+2,l),v*ml>u&&(u=v*ml)),u>p&&(p=u),c=r.indexOf(a,c+1);return l[i]=p,p}function uf(e){return e.toLowerCase().replace(ag," ")}function xE(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Rc(e,t,uf(e),uf(t),0,0,{})}function CE(e,t){const r=g.createContext(t),n=o=>{const{children:l,...i}=o,a=g.useMemo(()=>i,Object.values(i));return x.jsx(r.Provider,{value:a,children:l})};n.displayName=e+"Provider";function s(o){const l=g.useContext(r);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[n,s]}function bE(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l),a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,EE(s,...t)]}function EE(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function kE(e){const t=RE(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(TE);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function RE(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=AE(s),i=LE(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var PE=Symbol("radix.slottable");function TE(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===PE}function LE(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function AE(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var DE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],lg=DE.reduce((e,t)=>{const r=kE(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ME(e,t){e&&on.flushSync(()=>e.dispatchEvent(t))}function NE(e,t=globalThis==null?void 0:globalThis.document){const r=$t(e);g.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var IE="DismissableLayer",Pc="dismissableLayer.update",OE="dismissableLayer.pointerDownOutside",jE="dismissableLayer.focusOutside",df,cg=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Jn=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:l,onDismiss:i,...a}=e,c=g.useContext(cg),[p,u]=g.useState(null),v=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=g.useState({}),w=le(t,b=>u(b)),_=Array.from(c.layers),[m]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),h=_.indexOf(m),d=p?_.indexOf(p):-1,f=c.layersWithOutsidePointerEventsDisabled.size>0,S=d>=h,E=FE(b=>{const C=b.target,P=[...c.branches].some(T=>T.contains(C));!S||P||(s==null||s(b),l==null||l(b),b.defaultPrevented||i==null||i())},v),k=HE(b=>{const C=b.target;[...c.branches].some(T=>T.contains(C))||(o==null||o(b),l==null||l(b),b.defaultPrevented||i==null||i())},v);return NE(b=>{d===c.layers.size-1&&(n==null||n(b),!b.defaultPrevented&&i&&(b.preventDefault(),i()))},v),g.useEffect(()=>{if(p)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(df=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(p)),c.layers.add(p),hf(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=df)}},[p,v,r,c]),g.useEffect(()=>()=>{p&&(c.layers.delete(p),c.layersWithOutsidePointerEventsDisabled.delete(p),hf())},[p,c]),g.useEffect(()=>{const b=()=>y({});return document.addEventListener(Pc,b),()=>document.removeEventListener(Pc,b)},[]),x.jsx(lg.div,{...a,ref:w,style:{pointerEvents:f?S?"auto":"none":void 0,...e.style},onFocusCapture:J(e.onFocusCapture,k.onFocusCapture),onBlurCapture:J(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:J(e.onPointerDownCapture,E.onPointerDownCapture)})});Jn.displayName=IE;var BE="DismissableLayerBranch",$E=g.forwardRef((e,t)=>{const r=g.useContext(cg),n=g.useRef(null),s=le(t,n);return g.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),x.jsx(lg.div,{...e,ref:s})});$E.displayName=BE;function FE(e,t=globalThis==null?void 0:globalThis.document){const r=$t(e),n=g.useRef(!1),s=g.useRef(()=>{});return g.useEffect(()=>{const o=i=>{if(i.target&&!n.current){let a=function(){ug(OE,r,c,{discrete:!0})};const c={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=a,t.addEventListener("click",s.current,{once:!0})):a()}else t.removeEventListener("click",s.current);n.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function HE(e,t=globalThis==null?void 0:globalThis.document){const r=$t(e),n=g.useRef(!1);return g.useEffect(()=>{const s=o=>{o.target&&!n.current&&ug(jE,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function hf(){const e=new CustomEvent(Pc);document.dispatchEvent(e)}function ug(e,t,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?ME(s,o):s.dispatchEvent(o)}function WE(e){const t=zE(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(VE);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function zE(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=GE(s),i=KE(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var UE=Symbol("radix.slottable");function VE(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===UE}function KE(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function GE(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var qE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],XE=qE.reduce((e,t)=>{const r=WE(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),gl="focusScope.autoFocusOnMount",_l="focusScope.autoFocusOnUnmount",ff={bubbles:!1,cancelable:!0},YE="FocusScope",ci=g.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...l}=e,[i,a]=g.useState(null),c=$t(s),p=$t(o),u=g.useRef(null),v=le(t,_=>a(_)),y=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(n){let _=function(f){if(y.paused||!i)return;const S=f.target;i.contains(S)?u.current=S:ar(u.current,{select:!0})},m=function(f){if(y.paused||!i)return;const S=f.relatedTarget;S!==null&&(i.contains(S)||ar(u.current,{select:!0}))},h=function(f){if(document.activeElement===document.body)for(const E of f)E.removedNodes.length>0&&ar(i)};document.addEventListener("focusin",_),document.addEventListener("focusout",m);const d=new MutationObserver(h);return i&&d.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",m),d.disconnect()}}},[n,i,y.paused]),g.useEffect(()=>{if(i){mf.add(y);const _=document.activeElement;if(!i.contains(_)){const h=new CustomEvent(gl,ff);i.addEventListener(gl,c),i.dispatchEvent(h),h.defaultPrevented||(QE(rk(dg(i)),{select:!0}),document.activeElement===_&&ar(i))}return()=>{i.removeEventListener(gl,c),setTimeout(()=>{const h=new CustomEvent(_l,ff);i.addEventListener(_l,p),i.dispatchEvent(h),h.defaultPrevented||ar(_??document.body,{select:!0}),i.removeEventListener(_l,p),mf.remove(y)},0)}}},[i,c,p,y]);const w=g.useCallback(_=>{if(!r&&!n||y.paused)return;const m=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,h=document.activeElement;if(m&&h){const d=_.currentTarget,[f,S]=JE(d);f&&S?!_.shiftKey&&h===S?(_.preventDefault(),r&&ar(f,{select:!0})):_.shiftKey&&h===f&&(_.preventDefault(),r&&ar(S,{select:!0})):h===d&&_.preventDefault()}},[r,n,y.paused]);return x.jsx(XE.div,{tabIndex:-1,...l,ref:v,onKeyDown:w})});ci.displayName=YE;function QE(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(ar(n,{select:t}),document.activeElement!==r)return}function JE(e){const t=dg(e),r=pf(t,e),n=pf(t.reverse(),e);return[r,n]}function dg(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function pf(e,t){for(const r of e)if(!ZE(r,{upTo:t}))return r}function ZE(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ek(e){return e instanceof HTMLInputElement&&"select"in e}function ar(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&ek(e)&&t&&e.select()}}var mf=tk();function tk(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=vf(e,t),e.unshift(t)},remove(t){var r;e=vf(e,t),(r=e[0])==null||r.resume()}}}function vf(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function rk(e){return e.filter(t=>t.tagName!=="A")}function nk(e){const t=sk(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(ok);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function sk(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=lk(s),i=ak(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ik=Symbol("radix.slottable");function ok(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ik}function ak(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function lk(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var ck=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],uk=ck.reduce((e,t)=>{const r=nk(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),dk="Portal",Zn=g.forwardRef((e,t)=>{var i;const{container:r,...n}=e,[s,o]=g.useState(!1);Le(()=>o(!0),[]);const l=r||s&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return l?Lx.createPortal(x.jsx(uk.div,{...n,ref:t}),l):null});Zn.displayName=dk;function hg(e){const t=hk(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(pk);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function hk(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=vk(s),i=mk(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fk=Symbol("radix.slottable");function pk(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fk}function mk(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function vk(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var gk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ui=gk.reduce((e,t)=>{const r=hg(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),yl=0;function pa(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??gf()),document.body.insertAdjacentElement("beforeend",e[1]??gf()),yl++,()=>{yl===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),yl--}},[])}function gf(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Nt=function(){return Nt=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},Nt.apply(this,arguments)};function fg(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function _k(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,o;n<s;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}var co="right-scroll-bar-position",uo="width-before-scroll-bar",yk="with-scroll-bars-hidden",Sk="--removed-body-scroll-bar-size";function Sl(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function wk(e,t){var r=g.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var xk=typeof window<"u"?g.useLayoutEffect:g.useEffect,_f=new WeakMap;function Ck(e,t){var r=wk(null,function(n){return e.forEach(function(s){return Sl(s,n)})});return xk(function(){var n=_f.get(r);if(n){var s=new Set(n),o=new Set(e),l=r.current;s.forEach(function(i){o.has(i)||Sl(i,null)}),o.forEach(function(i){s.has(i)||Sl(i,l)})}_f.set(r,e)},[e]),r}function bk(e){return e}function Ek(e,t){t===void 0&&(t=bk);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(o){var l=t(o,n);return r.push(l),function(){r=r.filter(function(i){return i!==l})}},assignSyncMedium:function(o){for(n=!0;r.length;){var l=r;r=[],l.forEach(o)}r={push:function(i){return o(i)},filter:function(){return r}}},assignMedium:function(o){n=!0;var l=[];if(r.length){var i=r;r=[],i.forEach(o),l=r}var a=function(){var p=l;l=[],p.forEach(o)},c=function(){return Promise.resolve().then(a)};c(),r={push:function(p){l.push(p),c()},filter:function(p){return l=l.filter(p),r}}}};return s}function kk(e){e===void 0&&(e={});var t=Ek(null);return t.options=Nt({async:!0,ssr:!1},e),t}var pg=function(e){var t=e.sideCar,r=fg(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return g.createElement(n,Nt({},r))};pg.isSideCarExport=!0;function Rk(e,t){return e.useMedium(t),pg}var mg=kk(),wl=function(){},ma=g.forwardRef(function(e,t){var r=g.useRef(null),n=g.useState({onScrollCapture:wl,onWheelCapture:wl,onTouchMoveCapture:wl}),s=n[0],o=n[1],l=e.forwardProps,i=e.children,a=e.className,c=e.removeScrollBar,p=e.enabled,u=e.shards,v=e.sideCar,y=e.noRelative,w=e.noIsolation,_=e.inert,m=e.allowPinchZoom,h=e.as,d=h===void 0?"div":h,f=e.gapMode,S=fg(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=v,k=Ck([r,t]),b=Nt(Nt({},S),s);return g.createElement(g.Fragment,null,p&&g.createElement(E,{sideCar:mg,removeScrollBar:c,shards:u,noRelative:y,noIsolation:w,inert:_,setCallbacks:o,allowPinchZoom:!!m,lockRef:r,gapMode:f}),l?g.cloneElement(g.Children.only(i),Nt(Nt({},b),{ref:k})):g.createElement(d,Nt({},b,{className:a,ref:k}),i))});ma.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ma.classNames={fullWidth:uo,zeroRight:co};var Pk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Tk(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Pk();return t&&e.setAttribute("nonce",t),e}function Lk(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ak(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Dk=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Tk())&&(Lk(t,r),Ak(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Mk=function(){var e=Dk();return function(t,r){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},vg=function(){var e=Mk(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},Nk={left:0,top:0,right:0,gap:0},xl=function(e){return parseInt(e||"",10)||0},Ik=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[xl(r),xl(n),xl(s)]},Ok=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Nk;var t=Ik(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},jk=vg(),In="data-scroll-locked",Bk=function(e,t,r,n){var s=e.left,o=e.top,l=e.right,i=e.gap;return r===void 0&&(r="margin"),`
221
- .`.concat(yk,` {
222
- overflow: hidden `).concat(n,`;
223
- padding-right: `).concat(i,"px ").concat(n,`;
224
- }
225
- body[`).concat(In,`] {
226
- overflow: hidden `).concat(n,`;
227
- overscroll-behavior: contain;
228
- `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
229
- padding-left: `.concat(s,`px;
230
- padding-top: `).concat(o,`px;
231
- padding-right: `).concat(l,`px;
232
- margin-left:0;
233
- margin-top:0;
234
- margin-right: `).concat(i,"px ").concat(n,`;
235
- `),r==="padding"&&"padding-right: ".concat(i,"px ").concat(n,";")].filter(Boolean).join(""),`
236
- }
237
-
238
- .`).concat(co,` {
239
- right: `).concat(i,"px ").concat(n,`;
240
- }
241
-
242
- .`).concat(uo,` {
243
- margin-right: `).concat(i,"px ").concat(n,`;
244
- }
245
-
246
- .`).concat(co," .").concat(co,` {
247
- right: 0 `).concat(n,`;
248
- }
249
-
250
- .`).concat(uo," .").concat(uo,` {
251
- margin-right: 0 `).concat(n,`;
252
- }
253
-
254
- body[`).concat(In,`] {
255
- `).concat(Sk,": ").concat(i,`px;
256
- }
257
- `)},yf=function(){var e=parseInt(document.body.getAttribute(In)||"0",10);return isFinite(e)?e:0},$k=function(){g.useEffect(function(){return document.body.setAttribute(In,(yf()+1).toString()),function(){var e=yf()-1;e<=0?document.body.removeAttribute(In):document.body.setAttribute(In,e.toString())}},[])},Fk=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;$k();var o=g.useMemo(function(){return Ok(s)},[s]);return g.createElement(jk,{styles:Bk(o,!t,s,r?"":"!important")})},Tc=!1;if(typeof window<"u")try{var zi=Object.defineProperty({},"passive",{get:function(){return Tc=!0,!0}});window.addEventListener("test",zi,zi),window.removeEventListener("test",zi,zi)}catch{Tc=!1}var hn=Tc?{passive:!1}:!1,Hk=function(e){return e.tagName==="TEXTAREA"},gg=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Hk(e)&&r[t]==="visible")},Wk=function(e){return gg(e,"overflowY")},zk=function(e){return gg(e,"overflowX")},Sf=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=_g(e,n);if(s){var o=yg(e,n),l=o[1],i=o[2];if(l>i)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Uk=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Vk=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},_g=function(e,t){return e==="v"?Wk(t):zk(t)},yg=function(e,t){return e==="v"?Uk(t):Vk(t)},Kk=function(e,t){return e==="h"&&t==="rtl"?-1:1},Gk=function(e,t,r,n,s){var o=Kk(e,window.getComputedStyle(t).direction),l=o*n,i=r.target,a=t.contains(i),c=!1,p=l>0,u=0,v=0;do{if(!i)break;var y=yg(e,i),w=y[0],_=y[1],m=y[2],h=_-m-o*w;(w||h)&&_g(e,i)&&(u+=h,v+=w);var d=i.parentNode;i=d&&d.nodeType===Node.DOCUMENT_FRAGMENT_NODE?d.host:d}while(!a&&i!==document.body||a&&(t.contains(i)||t===i));return(p&&Math.abs(u)<1||!p&&Math.abs(v)<1)&&(c=!0),c},Ui=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},wf=function(e){return[e.deltaX,e.deltaY]},xf=function(e){return e&&"current"in e?e.current:e},qk=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Xk=function(e){return`
258
- .block-interactivity-`.concat(e,` {pointer-events: none;}
259
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
260
- `)},Yk=0,fn=[];function Qk(e){var t=g.useRef([]),r=g.useRef([0,0]),n=g.useRef(),s=g.useState(Yk++)[0],o=g.useState(vg)[0],l=g.useRef(e);g.useEffect(function(){l.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var _=_k([e.lockRef.current],(e.shards||[]).map(xf),!0).filter(Boolean);return _.forEach(function(m){return m.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),_.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var i=g.useCallback(function(_,m){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!l.current.allowPinchZoom;var h=Ui(_),d=r.current,f="deltaX"in _?_.deltaX:d[0]-h[0],S="deltaY"in _?_.deltaY:d[1]-h[1],E,k=_.target,b=Math.abs(f)>Math.abs(S)?"h":"v";if("touches"in _&&b==="h"&&k.type==="range")return!1;var C=window.getSelection(),P=C&&C.anchorNode,T=P?P===k||P.contains(k):!1;if(T)return!1;var M=Sf(b,k);if(!M)return!0;if(M?E=b:(E=b==="v"?"h":"v",M=Sf(b,k)),!M)return!1;if(!n.current&&"changedTouches"in _&&(f||S)&&(n.current=E),!E)return!0;var j=n.current||E;return Gk(j,m,_,j==="h"?f:S)},[]),a=g.useCallback(function(_){var m=_;if(!(!fn.length||fn[fn.length-1]!==o)){var h="deltaY"in m?wf(m):Ui(m),d=t.current.filter(function(E){return E.name===m.type&&(E.target===m.target||m.target===E.shadowParent)&&qk(E.delta,h)})[0];if(d&&d.should){m.cancelable&&m.preventDefault();return}if(!d){var f=(l.current.shards||[]).map(xf).filter(Boolean).filter(function(E){return E.contains(m.target)}),S=f.length>0?i(m,f[0]):!l.current.noIsolation;S&&m.cancelable&&m.preventDefault()}}},[]),c=g.useCallback(function(_,m,h,d){var f={name:_,delta:m,target:h,should:d,shadowParent:Jk(h)};t.current.push(f),setTimeout(function(){t.current=t.current.filter(function(S){return S!==f})},1)},[]),p=g.useCallback(function(_){r.current=Ui(_),n.current=void 0},[]),u=g.useCallback(function(_){c(_.type,wf(_),_.target,i(_,e.lockRef.current))},[]),v=g.useCallback(function(_){c(_.type,Ui(_),_.target,i(_,e.lockRef.current))},[]);g.useEffect(function(){return fn.push(o),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:v}),document.addEventListener("wheel",a,hn),document.addEventListener("touchmove",a,hn),document.addEventListener("touchstart",p,hn),function(){fn=fn.filter(function(_){return _!==o}),document.removeEventListener("wheel",a,hn),document.removeEventListener("touchmove",a,hn),document.removeEventListener("touchstart",p,hn)}},[]);var y=e.removeScrollBar,w=e.inert;return g.createElement(g.Fragment,null,w?g.createElement(o,{styles:Xk(s)}):null,y?g.createElement(Fk,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Jk(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Zk=Rk(mg,Qk);var di=g.forwardRef(function(e,t){return g.createElement(ma,Nt({},e,{ref:t,sideCar:Zk}))});di.classNames=ma.classNames;var e2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},pn=new WeakMap,Vi=new WeakMap,Ki={},Cl=0,Sg=function(e){return e&&(e.host||Sg(e.parentNode))},t2=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Sg(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},r2=function(e,t,r,n){var s=t2(t,Array.isArray(e)?e:[e]);Ki[r]||(Ki[r]=new WeakMap);var o=Ki[r],l=[],i=new Set,a=new Set(s),c=function(u){!u||i.has(u)||(i.add(u),c(u.parentNode))};s.forEach(c);var p=function(u){!u||a.has(u)||Array.prototype.forEach.call(u.children,function(v){if(i.has(v))p(v);else try{var y=v.getAttribute(n),w=y!==null&&y!=="false",_=(pn.get(v)||0)+1,m=(o.get(v)||0)+1;pn.set(v,_),o.set(v,m),l.push(v),_===1&&w&&Vi.set(v,!0),m===1&&v.setAttribute(r,"true"),w||v.setAttribute(n,"true")}catch(h){console.error("aria-hidden: cannot operate on ",v,h)}})};return p(t),i.clear(),Cl++,function(){l.forEach(function(u){var v=pn.get(u)-1,y=o.get(u)-1;pn.set(u,v),o.set(u,y),v||(Vi.has(u)||u.removeAttribute(n),Vi.delete(u)),y||u.removeAttribute(r)}),Cl--,Cl||(pn=new WeakMap,pn=new WeakMap,Vi=new WeakMap,Ki={})}},va=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=e2(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),r2(n,s,r,"aria-hidden")):function(){return null}},ga="Dialog",[wg]=bE(ga),[n2,Tt]=wg(ga),xg=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:l=!0}=e,i=g.useRef(null),a=g.useRef(null),[c,p]=li({prop:n,defaultProp:s??!1,onChange:o,caller:ga});return x.jsx(n2,{scope:t,triggerRef:i,contentRef:a,contentId:st(),titleId:st(),descriptionId:st(),open:c,onOpenChange:p,onOpenToggle:g.useCallback(()=>p(u=>!u),[p]),modal:l,children:r})};xg.displayName=ga;var Cg="DialogTrigger",s2=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Tt(Cg,r),o=le(t,s.triggerRef);return x.jsx(ui.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Zu(s.open),...n,ref:o,onClick:J(e.onClick,s.onOpenToggle)})});s2.displayName=Cg;var Qu="DialogPortal",[i2,bg]=wg(Qu,{forceMount:void 0}),Eg=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,o=Tt(Qu,t);return x.jsx(i2,{scope:t,forceMount:r,children:g.Children.map(n,l=>x.jsx(Qe,{present:r||o.open,children:x.jsx(Zn,{asChild:!0,container:s,children:l})}))})};Eg.displayName=Qu;var $o="DialogOverlay",kg=g.forwardRef((e,t)=>{const r=bg($o,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=Tt($o,e.__scopeDialog);return o.modal?x.jsx(Qe,{present:n||o.open,children:x.jsx(a2,{...s,ref:t})}):null});kg.displayName=$o;var o2=hg("DialogOverlay.RemoveScroll"),a2=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Tt($o,r);return x.jsx(di,{as:o2,allowPinchZoom:!0,shards:[s.contentRef],children:x.jsx(ui.div,{"data-state":Zu(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Zr="DialogContent",Rg=g.forwardRef((e,t)=>{const r=bg(Zr,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=Tt(Zr,e.__scopeDialog);return x.jsx(Qe,{present:n||o.open,children:o.modal?x.jsx(l2,{...s,ref:t}):x.jsx(c2,{...s,ref:t})})});Rg.displayName=Zr;var l2=g.forwardRef((e,t)=>{const r=Tt(Zr,e.__scopeDialog),n=g.useRef(null),s=le(t,r.contentRef,n);return g.useEffect(()=>{const o=n.current;if(o)return va(o)},[]),x.jsx(Pg,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,i=l.button===0&&l.ctrlKey===!0;(l.button===2||i)&&o.preventDefault()}),onFocusOutside:J(e.onFocusOutside,o=>o.preventDefault())})}),c2=g.forwardRef((e,t)=>{const r=Tt(Zr,e.__scopeDialog),n=g.useRef(!1),s=g.useRef(!1);return x.jsx(Pg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,i;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var a,c;(a=e.onInteractOutside)==null||a.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;((c=r.triggerRef.current)==null?void 0:c.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),Pg=g.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,...l}=e,i=Tt(Zr,r),a=g.useRef(null),c=le(t,a);return pa(),x.jsxs(x.Fragment,{children:[x.jsx(ci,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:x.jsx(Jn,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":Zu(i.open),...l,ref:c,onDismiss:()=>i.onOpenChange(!1)})}),x.jsxs(x.Fragment,{children:[x.jsx(u2,{titleId:i.titleId}),x.jsx(h2,{contentRef:a,descriptionId:i.descriptionId})]})]})}),Ju="DialogTitle",Tg=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Tt(Ju,r);return x.jsx(ui.h2,{id:s.titleId,...n,ref:t})});Tg.displayName=Ju;var Lg="DialogDescription",Ag=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Tt(Lg,r);return x.jsx(ui.p,{id:s.descriptionId,...n,ref:t})});Ag.displayName=Lg;var Dg="DialogClose",Mg=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Tt(Dg,r);return x.jsx(ui.button,{type:"button",...n,ref:t,onClick:J(e.onClick,()=>s.onOpenChange(!1))})});Mg.displayName=Dg;function Zu(e){return e?"open":"closed"}var Ng="DialogTitleWarning",[tN,Ig]=CE(Ng,{contentName:Zr,titleName:Ju,docsSlug:"dialog"}),u2=({titleId:e})=>{const t=Ig(Ng),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
261
-
262
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
263
-
264
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},d2="DialogDescriptionWarning",h2=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ig(d2).contentName}}.`;return g.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},f2=xg,ed=Eg,hi=kg,fi=Rg,_a=Tg,ya=Ag,Og=Mg,ms='[cmdk-group=""]',bl='[cmdk-group-items=""]',p2='[cmdk-group-heading=""]',jg='[cmdk-item=""]',Cf=`${jg}:not([aria-disabled="true"])`,Lc="cmdk-item-select",mn="data-value",m2=(e,t,r)=>xE(e,t,r),Bg=g.createContext(void 0),pi=()=>g.useContext(Bg),$g=g.createContext(void 0),td=()=>g.useContext($g),Fg=g.createContext(void 0),Hg=g.forwardRef((e,t)=>{let r=vn(()=>{var D,z;return{search:"",value:(z=(D=e.value)!=null?D:e.defaultValue)!=null?z:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=vn(()=>new Set),s=vn(()=>new Map),o=vn(()=>new Map),l=vn(()=>new Set),i=Wg(e),{label:a,children:c,value:p,onValueChange:u,filter:v,shouldFilter:y,loop:w,disablePointerSelection:_=!1,vimBindings:m=!0,...h}=e,d=st(),f=st(),S=st(),E=g.useRef(null),k=k2();en(()=>{if(p!==void 0){let D=p.trim();r.current.value=D,b.emit()}},[p]),en(()=>{k(6,N)},[]);let b=g.useMemo(()=>({subscribe:D=>(l.current.add(D),()=>l.current.delete(D)),snapshot:()=>r.current,setState:(D,z,F)=>{var U,G,O,A;if(!Object.is(r.current[D],z)){if(r.current[D]=z,D==="search")j(),T(),k(1,M);else if(D==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let W=document.getElementById(S);W?W.focus():(U=document.getElementById(d))==null||U.focus()}if(k(7,()=>{var W;r.current.selectedItemId=(W=$())==null?void 0:W.id,b.emit()}),F||k(5,N),((G=i.current)==null?void 0:G.value)!==void 0){let W=z??"";(A=(O=i.current).onValueChange)==null||A.call(O,W);return}}b.emit()}},emit:()=>{l.current.forEach(D=>D())}}),[]),C=g.useMemo(()=>({value:(D,z,F)=>{var U;z!==((U=o.current.get(D))==null?void 0:U.value)&&(o.current.set(D,{value:z,keywords:F}),r.current.filtered.items.set(D,P(z,F)),k(2,()=>{T(),b.emit()}))},item:(D,z)=>(n.current.add(D),z&&(s.current.has(z)?s.current.get(z).add(D):s.current.set(z,new Set([D]))),k(3,()=>{j(),T(),r.current.value||M(),b.emit()}),()=>{o.current.delete(D),n.current.delete(D),r.current.filtered.items.delete(D);let F=$();k(4,()=>{j(),(F==null?void 0:F.getAttribute("id"))===D&&M(),b.emit()})}),group:D=>(s.current.has(D)||s.current.set(D,new Set),()=>{o.current.delete(D),s.current.delete(D)}),filter:()=>i.current.shouldFilter,label:a||e["aria-label"],getDisablePointerSelection:()=>i.current.disablePointerSelection,listId:d,inputId:S,labelId:f,listInnerRef:E}),[]);function P(D,z){var F,U;let G=(U=(F=i.current)==null?void 0:F.filter)!=null?U:m2;return D?G(D,r.current.search,z):0}function T(){if(!r.current.search||i.current.shouldFilter===!1)return;let D=r.current.filtered.items,z=[];r.current.filtered.groups.forEach(U=>{let G=s.current.get(U),O=0;G.forEach(A=>{let W=D.get(A);O=Math.max(W,O)}),z.push([U,O])});let F=E.current;V().sort((U,G)=>{var O,A;let W=U.getAttribute("id"),H=G.getAttribute("id");return((O=D.get(H))!=null?O:0)-((A=D.get(W))!=null?A:0)}).forEach(U=>{let G=U.closest(bl);G?G.appendChild(U.parentElement===G?U:U.closest(`${bl} > *`)):F.appendChild(U.parentElement===F?U:U.closest(`${bl} > *`))}),z.sort((U,G)=>G[1]-U[1]).forEach(U=>{var G;let O=(G=E.current)==null?void 0:G.querySelector(`${ms}[${mn}="${encodeURIComponent(U[0])}"]`);O==null||O.parentElement.appendChild(O)})}function M(){let D=V().find(F=>F.getAttribute("aria-disabled")!=="true"),z=D==null?void 0:D.getAttribute(mn);b.setState("value",z||void 0)}function j(){var D,z,F,U;if(!r.current.search||i.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let G=0;for(let O of n.current){let A=(z=(D=o.current.get(O))==null?void 0:D.value)!=null?z:"",W=(U=(F=o.current.get(O))==null?void 0:F.keywords)!=null?U:[],H=P(A,W);r.current.filtered.items.set(O,H),H>0&&G++}for(let[O,A]of s.current)for(let W of A)if(r.current.filtered.items.get(W)>0){r.current.filtered.groups.add(O);break}r.current.filtered.count=G}function N(){var D,z,F;let U=$();U&&(((D=U.parentElement)==null?void 0:D.firstChild)===U&&((F=(z=U.closest(ms))==null?void 0:z.querySelector(p2))==null||F.scrollIntoView({block:"nearest"})),U.scrollIntoView({block:"nearest"}))}function $(){var D;return(D=E.current)==null?void 0:D.querySelector(`${jg}[aria-selected="true"]`)}function V(){var D;return Array.from(((D=E.current)==null?void 0:D.querySelectorAll(Cf))||[])}function K(D){let z=V()[D];z&&b.setState("value",z.getAttribute(mn))}function q(D){var z;let F=$(),U=V(),G=U.findIndex(A=>A===F),O=U[G+D];(z=i.current)!=null&&z.loop&&(O=G+D<0?U[U.length-1]:G+D===U.length?U[0]:U[G+D]),O&&b.setState("value",O.getAttribute(mn))}function B(D){let z=$(),F=z==null?void 0:z.closest(ms),U;for(;F&&!U;)F=D>0?b2(F,ms):E2(F,ms),U=F==null?void 0:F.querySelector(Cf);U?b.setState("value",U.getAttribute(mn)):q(D)}let R=()=>K(V().length-1),L=D=>{D.preventDefault(),D.metaKey?R():D.altKey?B(1):q(1)},I=D=>{D.preventDefault(),D.metaKey?K(0):D.altKey?B(-1):q(-1)};return g.createElement(Ue.div,{ref:t,tabIndex:-1,...h,"cmdk-root":"",onKeyDown:D=>{var z;(z=h.onKeyDown)==null||z.call(h,D);let F=D.nativeEvent.isComposing||D.keyCode===229;if(!(D.defaultPrevented||F))switch(D.key){case"n":case"j":{m&&D.ctrlKey&&L(D);break}case"ArrowDown":{L(D);break}case"p":case"k":{m&&D.ctrlKey&&I(D);break}case"ArrowUp":{I(D);break}case"Home":{D.preventDefault(),K(0);break}case"End":{D.preventDefault(),R();break}case"Enter":{D.preventDefault();let U=$();if(U){let G=new Event(Lc);U.dispatchEvent(G)}}}}},g.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:P2},a),Sa(e,D=>g.createElement($g.Provider,{value:b},g.createElement(Bg.Provider,{value:C},D))))}),v2=g.forwardRef((e,t)=>{var r,n;let s=st(),o=g.useRef(null),l=g.useContext(Fg),i=pi(),a=Wg(e),c=(n=(r=a.current)==null?void 0:r.forceMount)!=null?n:l==null?void 0:l.forceMount;en(()=>{if(!c)return i.item(s,l==null?void 0:l.id)},[c]);let p=zg(s,o,[e.value,e.children,o],e.keywords),u=td(),v=kr(k=>k.value&&k.value===p.current),y=kr(k=>c||i.filter()===!1?!0:k.search?k.filtered.items.get(s)>0:!0);g.useEffect(()=>{let k=o.current;if(!(!k||e.disabled))return k.addEventListener(Lc,w),()=>k.removeEventListener(Lc,w)},[y,e.onSelect,e.disabled]);function w(){var k,b;_(),(b=(k=a.current).onSelect)==null||b.call(k,p.current)}function _(){u.setState("value",p.current,!0)}if(!y)return null;let{disabled:m,value:h,onSelect:d,forceMount:f,keywords:S,...E}=e;return g.createElement(Ue.div,{ref:fe(o,t),...E,id:s,"cmdk-item":"",role:"option","aria-disabled":!!m,"aria-selected":!!v,"data-disabled":!!m,"data-selected":!!v,onPointerMove:m||i.getDisablePointerSelection()?void 0:_,onClick:m?void 0:w},e.children)}),g2=g.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...o}=e,l=st(),i=g.useRef(null),a=g.useRef(null),c=st(),p=pi(),u=kr(y=>s||p.filter()===!1?!0:y.search?y.filtered.groups.has(l):!0);en(()=>p.group(l),[]),zg(l,i,[e.value,e.heading,a]);let v=g.useMemo(()=>({id:l,forceMount:s}),[s]);return g.createElement(Ue.div,{ref:fe(i,t),...o,"cmdk-group":"",role:"presentation",hidden:u?void 0:!0},r&&g.createElement("div",{ref:a,"cmdk-group-heading":"","aria-hidden":!0,id:c},r),Sa(e,y=>g.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?c:void 0},g.createElement(Fg.Provider,{value:v},y))))}),_2=g.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=g.useRef(null),o=kr(l=>!l.search);return!r&&!o?null:g.createElement(Ue.div,{ref:fe(s,t),...n,"cmdk-separator":"",role:"separator"})}),y2=g.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=e.value!=null,o=td(),l=kr(c=>c.search),i=kr(c=>c.selectedItemId),a=pi();return g.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),g.createElement(Ue.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":a.listId,"aria-labelledby":a.labelId,"aria-activedescendant":i,id:a.inputId,type:"text",value:s?e.value:l,onChange:c=>{s||o.setState("search",c.target.value),r==null||r(c.target.value)}})}),S2=g.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,o=g.useRef(null),l=g.useRef(null),i=kr(c=>c.selectedItemId),a=pi();return g.useEffect(()=>{if(l.current&&o.current){let c=l.current,p=o.current,u,v=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let y=c.offsetHeight;p.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return v.observe(c),()=>{cancelAnimationFrame(u),v.unobserve(c)}}},[]),g.createElement(Ue.div,{ref:fe(o,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":i,"aria-label":n,id:a.listId},Sa(e,c=>g.createElement("div",{ref:fe(l,a.listInnerRef),"cmdk-list-sizer":""},c)))}),w2=g.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:o,container:l,...i}=e;return g.createElement(f2,{open:r,onOpenChange:n},g.createElement(ed,{container:l},g.createElement(hi,{"cmdk-overlay":"",className:s}),g.createElement(fi,{"aria-label":e.label,"cmdk-dialog":"",className:o},g.createElement(Hg,{ref:t,...i}))))}),x2=g.forwardRef((e,t)=>kr(r=>r.filtered.count===0)?g.createElement(Ue.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),C2=g.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...o}=e;return g.createElement(Ue.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Sa(e,l=>g.createElement("div",{"aria-hidden":!0},l)))}),Je=Object.assign(Hg,{List:S2,Item:v2,Input:y2,Group:g2,Separator:_2,Dialog:w2,Empty:x2,Loading:C2});function b2(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function E2(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function Wg(e){let t=g.useRef(e);return en(()=>{t.current=e}),t}var en=typeof window>"u"?g.useEffect:g.useLayoutEffect;function vn(e){let t=g.useRef();return t.current===void 0&&(t.current=e()),t}function kr(e){let t=td(),r=()=>e(t.snapshot());return g.useSyncExternalStore(t.subscribe,r,r)}function zg(e,t,r,n=[]){let s=g.useRef(),o=pi();return en(()=>{var l;let i=(()=>{var c;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(c=p.current.textContent)==null?void 0:c.trim():s.current}})(),a=n.map(c=>c.trim());o.value(e,i,a),(l=t.current)==null||l.setAttribute(mn,i),s.current=i}),s}var k2=()=>{let[e,t]=g.useState(),r=vn(()=>new Map);return en(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,s)=>{r.current.set(n,s),t({})}};function R2(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Sa({asChild:e,children:t},r){return e&&g.isValidElement(t)?g.cloneElement(R2(t),{ref:t.ref},r(t.props.children)):r(t)}var P2={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const T2=g.forwardRef(({className:e,...t},r)=>x.jsx(Je,{ref:r,className:re("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));T2.displayName=Je.displayName;const L2=g.forwardRef(({className:e,...t},r)=>x.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[x.jsx(Sb,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),x.jsx(Je.Input,{ref:r,className:re("flex h-9 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));L2.displayName=Je.Input.displayName;const A2=g.forwardRef(({className:e,onWheel:t,...r},n)=>x.jsx(Je.List,{ref:n,className:re("overflow-y-auto overflow-x-hidden",e),style:{maxHeight:300},onWheel:t??(s=>{s.currentTarget.scrollTop+=s.deltaY}),...r}));A2.displayName=Je.List.displayName;const D2=g.forwardRef((e,t)=>x.jsx(Je.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));D2.displayName=Je.Empty.displayName;const M2=g.forwardRef(({className:e,...t},r)=>x.jsx(Je.Group,{ref:r,className:re("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));M2.displayName=Je.Group.displayName;const N2=g.forwardRef(({className:e,...t},r)=>x.jsx(Je.Separator,{ref:r,className:re("-mx-1 h-px bg-border",e),...t}));N2.displayName=Je.Separator.displayName;const I2=g.forwardRef(({className:e,...t},r)=>x.jsx(Je.Item,{ref:r,className:re("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));I2.displayName=Je.Item.displayName;const O2=ed,Ug=g.forwardRef(({className:e,...t},r)=>x.jsx(hi,{ref:r,className:re("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Ug.displayName=hi.displayName;const j2=g.forwardRef(({className:e,children:t,...r},n)=>x.jsxs(O2,{children:[x.jsx(Ug,{}),x.jsxs(fi,{ref:n,className:re("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,x.jsxs(Og,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[x.jsx(Jv,{className:"h-4 w-4"}),x.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));j2.displayName=fi.displayName;const B2=g.forwardRef(({className:e,...t},r)=>x.jsx(_a,{ref:r,className:re("text-lg font-semibold leading-none tracking-tight",e),...t}));B2.displayName=_a.displayName;const $2=g.forwardRef(({className:e,...t},r)=>x.jsx(ya,{ref:r,className:re("text-sm text-muted-foreground",e),...t}));$2.displayName=ya.displayName;function F2(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l),a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,H2(s,...t)]}function H2(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function W2(e){const t=z2(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(V2);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function z2(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=G2(s),i=K2(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var U2=Symbol("radix.slottable");function V2(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===U2}function K2(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function G2(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var q2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],X2=q2.reduce((e,t)=>{const r=W2(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Y2(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l),a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,Q2(s,...t)]}function Q2(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function bf(e){const t=J2(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(eR);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function J2(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=rR(s),i=tR(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Z2=Symbol("radix.slottable");function eR(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Z2}function tR(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function rR(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function rd(e){const t=e+"CollectionProvider",[r,n]=Y2(t),[s,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),l=_=>{const{scope:m,children:h}=_,d=Ve.useRef(null),f=Ve.useRef(new Map).current;return x.jsx(s,{scope:m,itemMap:f,collectionRef:d,children:h})};l.displayName=t;const i=e+"CollectionSlot",a=bf(i),c=Ve.forwardRef((_,m)=>{const{scope:h,children:d}=_,f=o(i,h),S=le(m,f.collectionRef);return x.jsx(a,{ref:S,children:d})});c.displayName=i;const p=e+"CollectionItemSlot",u="data-radix-collection-item",v=bf(p),y=Ve.forwardRef((_,m)=>{const{scope:h,children:d,...f}=_,S=Ve.useRef(null),E=le(m,S),k=o(p,h);return Ve.useEffect(()=>(k.itemMap.set(S,{ref:S,...f}),()=>void k.itemMap.delete(S))),x.jsx(v,{[u]:"",ref:E,children:d})});y.displayName=p;function w(_){const m=o(e+"CollectionConsumer",_);return Ve.useCallback(()=>{const d=m.collectionRef.current;if(!d)return[];const f=Array.from(d.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((k,b)=>f.indexOf(k.ref.current)-f.indexOf(b.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:l,Slot:c,ItemSlot:y},w,n]}function nR(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l),a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,sR(s,...t)]}function sR(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}var iR=g.createContext(void 0);function Vg(e){const t=g.useContext(iR);return e||t||"ltr"}const oR=["top","right","bottom","left"],Rr=Math.min,tt=Math.max,Fo=Math.round,Gi=Math.floor,Bt=e=>({x:e,y:e}),aR={left:"right",right:"left",bottom:"top",top:"bottom"};function Ac(e,t,r){return tt(e,Rr(t,r))}function Qt(e,t){return typeof e=="function"?e(t):e}function Jt(e){return e.split("-")[0]}function es(e){return e.split("-")[1]}function nd(e){return e==="x"?"y":"x"}function sd(e){return e==="y"?"height":"width"}function It(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function id(e){return nd(It(e))}function lR(e,t,r){r===void 0&&(r=!1);const n=es(e),s=id(e),o=sd(s);let l=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=Ho(l)),[l,Ho(l)]}function cR(e){const t=Ho(e);return[Dc(e),t,Dc(t)]}function Dc(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ef=["left","right"],kf=["right","left"],uR=["top","bottom"],dR=["bottom","top"];function hR(e,t,r){switch(e){case"top":case"bottom":return r?t?kf:Ef:t?Ef:kf;case"left":case"right":return t?uR:dR;default:return[]}}function fR(e,t,r,n){const s=es(e);let o=hR(Jt(e),r==="start",n);return s&&(o=o.map(l=>l+"-"+s),t&&(o=o.concat(o.map(Dc)))),o}function Ho(e){const t=Jt(e);return aR[t]+e.slice(t.length)}function pR(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kg(e){return typeof e!="number"?pR(e):{top:e,right:e,bottom:e,left:e}}function Wo(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function Rf(e,t,r){let{reference:n,floating:s}=e;const o=It(t),l=id(t),i=sd(l),a=Jt(t),c=o==="y",p=n.x+n.width/2-s.width/2,u=n.y+n.height/2-s.height/2,v=n[i]/2-s[i]/2;let y;switch(a){case"top":y={x:p,y:n.y-s.height};break;case"bottom":y={x:p,y:n.y+n.height};break;case"right":y={x:n.x+n.width,y:u};break;case"left":y={x:n.x-s.width,y:u};break;default:y={x:n.x,y:n.y}}switch(es(t)){case"start":y[l]-=v*(r&&c?-1:1);break;case"end":y[l]+=v*(r&&c?-1:1);break}return y}async function mR(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:o,rects:l,elements:i,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:p="viewport",elementContext:u="floating",altBoundary:v=!1,padding:y=0}=Qt(t,e),w=Kg(y),m=i[v?u==="floating"?"reference":"floating":u],h=Wo(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(m)))==null||r?m:m.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(i.floating)),boundary:c,rootBoundary:p,strategy:a})),d=u==="floating"?{x:n,y:s,width:l.floating.width,height:l.floating.height}:l.reference,f=await(o.getOffsetParent==null?void 0:o.getOffsetParent(i.floating)),S=await(o.isElement==null?void 0:o.isElement(f))?await(o.getScale==null?void 0:o.getScale(f))||{x:1,y:1}:{x:1,y:1},E=Wo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:d,offsetParent:f,strategy:a}):d);return{top:(h.top-E.top+w.top)/S.y,bottom:(E.bottom-h.bottom+w.bottom)/S.y,left:(h.left-E.left+w.left)/S.x,right:(E.right-h.right+w.right)/S.x}}const vR=50,gR=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:l}=r,i=l.detectOverflow?l:{...l,detectOverflow:mR},a=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:p,y:u}=Rf(c,n,a),v=n,y=0;const w={};for(let _=0;_<o.length;_++){const m=o[_];if(!m)continue;const{name:h,fn:d}=m,{x:f,y:S,data:E,reset:k}=await d({x:p,y:u,initialPlacement:n,placement:v,strategy:s,middlewareData:w,rects:c,platform:i,elements:{reference:e,floating:t}});p=f??p,u=S??u,w[h]={...w[h],...E},k&&y<vR&&(y++,typeof k=="object"&&(k.placement&&(v=k.placement),k.rects&&(c=k.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):k.rects),{x:p,y:u}=Rf(c,v,a)),_=-1)}return{x:p,y:u,placement:v,strategy:s,middlewareData:w}},_R=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:l,elements:i,middlewareData:a}=t,{element:c,padding:p=0}=Qt(e,t)||{};if(c==null)return{};const u=Kg(p),v={x:r,y:n},y=id(s),w=sd(y),_=await l.getDimensions(c),m=y==="y",h=m?"top":"left",d=m?"bottom":"right",f=m?"clientHeight":"clientWidth",S=o.reference[w]+o.reference[y]-v[y]-o.floating[w],E=v[y]-o.reference[y],k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let b=k?k[f]:0;(!b||!await(l.isElement==null?void 0:l.isElement(k)))&&(b=i.floating[f]||o.floating[w]);const C=S/2-E/2,P=b/2-_[w]/2-1,T=Rr(u[h],P),M=Rr(u[d],P),j=T,N=b-_[w]-M,$=b/2-_[w]/2+C,V=Ac(j,$,N),K=!a.arrow&&es(s)!=null&&$!==V&&o.reference[w]/2-($<j?T:M)-_[w]/2<0,q=K?$<j?$-j:$-N:0;return{[y]:v[y]+q,data:{[y]:V,centerOffset:$-V-q,...K&&{alignmentOffset:q}},reset:K}}}),yR=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:o,rects:l,initialPlacement:i,platform:a,elements:c}=t,{mainAxis:p=!0,crossAxis:u=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:_=!0,...m}=Qt(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const h=Jt(s),d=It(i),f=Jt(i)===i,S=await(a.isRTL==null?void 0:a.isRTL(c.floating)),E=v||(f||!_?[Ho(i)]:cR(i)),k=w!=="none";!v&&k&&E.push(...fR(i,_,w,S));const b=[i,...E],C=await a.detectOverflow(t,m),P=[];let T=((n=o.flip)==null?void 0:n.overflows)||[];if(p&&P.push(C[h]),u){const $=lR(s,l,S);P.push(C[$[0]],C[$[1]])}if(T=[...T,{placement:s,overflows:P}],!P.every($=>$<=0)){var M,j;const $=(((M=o.flip)==null?void 0:M.index)||0)+1,V=b[$];if(V&&(!(u==="alignment"?d!==It(V):!1)||T.every(B=>It(B.placement)===d?B.overflows[0]>0:!0)))return{data:{index:$,overflows:T},reset:{placement:V}};let K=(j=T.filter(q=>q.overflows[0]<=0).sort((q,B)=>q.overflows[1]-B.overflows[1])[0])==null?void 0:j.placement;if(!K)switch(y){case"bestFit":{var N;const q=(N=T.filter(B=>{if(k){const R=It(B.placement);return R===d||R==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(R=>R>0).reduce((R,L)=>R+L,0)]).sort((B,R)=>B[1]-R[1])[0])==null?void 0:N[0];q&&(K=q);break}case"initialPlacement":K=i;break}if(s!==K)return{reset:{placement:K}}}return{}}}};function Pf(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Tf(e){return oR.some(t=>e[t]>=0)}const SR=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:s="referenceHidden",...o}=Qt(e,t);switch(s){case"referenceHidden":{const l=await n.detectOverflow(t,{...o,elementContext:"reference"}),i=Pf(l,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Tf(i)}}}case"escaped":{const l=await n.detectOverflow(t,{...o,altBoundary:!0}),i=Pf(l,r.floating);return{data:{escapedOffsets:i,escaped:Tf(i)}}}default:return{}}}}},Gg=new Set(["left","top"]);async function wR(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),l=Jt(r),i=es(r),a=It(r)==="y",c=Gg.has(l)?-1:1,p=o&&a?-1:1,u=Qt(t,e);let{mainAxis:v,crossAxis:y,alignmentAxis:w}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return i&&typeof w=="number"&&(y=i==="end"?w*-1:w),a?{x:y*p,y:v*c}:{x:v*c,y:y*p}}const xR=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:o,placement:l,middlewareData:i}=t,a=await wR(t,e);return l===((r=i.offset)==null?void 0:r.placement)&&(n=i.arrow)!=null&&n.alignmentOffset?{}:{x:s+a.x,y:o+a.y,data:{...a,placement:l}}}}},CR=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s,platform:o}=t,{mainAxis:l=!0,crossAxis:i=!1,limiter:a={fn:h=>{let{x:d,y:f}=h;return{x:d,y:f}}},...c}=Qt(e,t),p={x:r,y:n},u=await o.detectOverflow(t,c),v=It(Jt(s)),y=nd(v);let w=p[y],_=p[v];if(l){const h=y==="y"?"top":"left",d=y==="y"?"bottom":"right",f=w+u[h],S=w-u[d];w=Ac(f,w,S)}if(i){const h=v==="y"?"top":"left",d=v==="y"?"bottom":"right",f=_+u[h],S=_-u[d];_=Ac(f,_,S)}const m=a.fn({...t,[y]:w,[v]:_});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[y]:l,[v]:i}}}}}},bR=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:o,middlewareData:l}=t,{offset:i=0,mainAxis:a=!0,crossAxis:c=!0}=Qt(e,t),p={x:r,y:n},u=It(s),v=nd(u);let y=p[v],w=p[u];const _=Qt(i,t),m=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:0,crossAxis:0,..._};if(a){const f=v==="y"?"height":"width",S=o.reference[v]-o.floating[f]+m.mainAxis,E=o.reference[v]+o.reference[f]-m.mainAxis;y<S?y=S:y>E&&(y=E)}if(c){var h,d;const f=v==="y"?"width":"height",S=Gg.has(Jt(s)),E=o.reference[u]-o.floating[f]+(S&&((h=l.offset)==null?void 0:h[u])||0)+(S?0:m.crossAxis),k=o.reference[u]+o.reference[f]+(S?0:((d=l.offset)==null?void 0:d[u])||0)-(S?m.crossAxis:0);w<E?w=E:w>k&&(w=k)}return{[v]:y,[u]:w}}}},ER=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:o,platform:l,elements:i}=t,{apply:a=()=>{},...c}=Qt(e,t),p=await l.detectOverflow(t,c),u=Jt(s),v=es(s),y=It(s)==="y",{width:w,height:_}=o.floating;let m,h;u==="top"||u==="bottom"?(m=u,h=v===(await(l.isRTL==null?void 0:l.isRTL(i.floating))?"start":"end")?"left":"right"):(h=u,m=v==="end"?"top":"bottom");const d=_-p.top-p.bottom,f=w-p.left-p.right,S=Rr(_-p[m],d),E=Rr(w-p[h],f),k=!t.middlewareData.shift;let b=S,C=E;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(C=f),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(b=d),k&&!v){const T=tt(p.left,0),M=tt(p.right,0),j=tt(p.top,0),N=tt(p.bottom,0);y?C=w-2*(T!==0||M!==0?T+M:tt(p.left,p.right)):b=_-2*(j!==0||N!==0?j+N:tt(p.top,p.bottom))}await a({...t,availableWidth:C,availableHeight:b});const P=await l.getDimensions(i.floating);return w!==P.width||_!==P.height?{reset:{rects:!0}}:{}}}};function wa(){return typeof window<"u"}function ts(e){return qg(e)?(e.nodeName||"").toLowerCase():"#document"}function it(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ft(e){var t;return(t=(qg(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qg(e){return wa()?e instanceof Node||e instanceof it(e).Node:!1}function Rt(e){return wa()?e instanceof Element||e instanceof it(e).Element:!1}function er(e){return wa()?e instanceof HTMLElement||e instanceof it(e).HTMLElement:!1}function Lf(e){return!wa()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof it(e).ShadowRoot}function mi(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=Pt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&s!=="inline"&&s!=="contents"}function kR(e){return/^(table|td|th)$/.test(ts(e))}function xa(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const RR=/transform|translate|scale|rotate|perspective|filter/,PR=/paint|layout|strict|content/,$r=e=>!!e&&e!=="none";let El;function od(e){const t=Rt(e)?Pt(e):e;return $r(t.transform)||$r(t.translate)||$r(t.scale)||$r(t.rotate)||$r(t.perspective)||!ad()&&($r(t.backdropFilter)||$r(t.filter))||RR.test(t.willChange||"")||PR.test(t.contain||"")}function TR(e){let t=Pr(e);for(;er(t)&&!Vn(t);){if(od(t))return t;if(xa(t))return null;t=Pr(t)}return null}function ad(){return El==null&&(El=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),El}function Vn(e){return/^(html|body|#document)$/.test(ts(e))}function Pt(e){return it(e).getComputedStyle(e)}function Ca(e){return Rt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pr(e){if(ts(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Lf(e)&&e.host||Ft(e);return Lf(t)?t.host:t}function Xg(e){const t=Pr(e);return Vn(t)?e.ownerDocument?e.ownerDocument.body:e.body:er(t)&&mi(t)?t:Xg(t)}function Js(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=Xg(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),l=it(s);if(o){const i=Mc(l);return t.concat(l,l.visualViewport||[],mi(s)?s:[],i&&r?Js(i):[])}else return t.concat(s,Js(s,[],r))}function Mc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Yg(e){const t=Pt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=er(e),o=s?e.offsetWidth:r,l=s?e.offsetHeight:n,i=Fo(r)!==o||Fo(n)!==l;return i&&(r=o,n=l),{width:r,height:n,$:i}}function ld(e){return Rt(e)?e:e.contextElement}function On(e){const t=ld(e);if(!er(t))return Bt(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=Yg(t);let l=(o?Fo(r.width):r.width)/n,i=(o?Fo(r.height):r.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!i||!Number.isFinite(i))&&(i=1),{x:l,y:i}}const LR=Bt(0);function Qg(e){const t=it(e);return!ad()||!t.visualViewport?LR:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function AR(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==it(e)?!1:t}function tn(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=ld(e);let l=Bt(1);t&&(n?Rt(n)&&(l=On(n)):l=On(e));const i=AR(o,r,n)?Qg(o):Bt(0);let a=(s.left+i.x)/l.x,c=(s.top+i.y)/l.y,p=s.width/l.x,u=s.height/l.y;if(o){const v=it(o),y=n&&Rt(n)?it(n):n;let w=v,_=Mc(w);for(;_&&n&&y!==w;){const m=On(_),h=_.getBoundingClientRect(),d=Pt(_),f=h.left+(_.clientLeft+parseFloat(d.paddingLeft))*m.x,S=h.top+(_.clientTop+parseFloat(d.paddingTop))*m.y;a*=m.x,c*=m.y,p*=m.x,u*=m.y,a+=f,c+=S,w=it(_),_=Mc(w)}}return Wo({width:p,height:u,x:a,y:c})}function ba(e,t){const r=Ca(e).scrollLeft;return t?t.left+r:tn(Ft(e)).left+r}function Jg(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-ba(e,r),s=r.top+t.scrollTop;return{x:n,y:s}}function DR(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",l=Ft(n),i=t?xa(t.floating):!1;if(n===l||i&&o)return r;let a={scrollLeft:0,scrollTop:0},c=Bt(1);const p=Bt(0),u=er(n);if((u||!u&&!o)&&((ts(n)!=="body"||mi(l))&&(a=Ca(n)),u)){const y=tn(n);c=On(n),p.x=y.x+n.clientLeft,p.y=y.y+n.clientTop}const v=l&&!u&&!o?Jg(l,a):Bt(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-a.scrollLeft*c.x+p.x+v.x,y:r.y*c.y-a.scrollTop*c.y+p.y+v.y}}function MR(e){return Array.from(e.getClientRects())}function NR(e){const t=Ft(e),r=Ca(e),n=e.ownerDocument.body,s=tt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=tt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let l=-r.scrollLeft+ba(e);const i=-r.scrollTop;return Pt(n).direction==="rtl"&&(l+=tt(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:l,y:i}}const Af=25;function IR(e,t){const r=it(e),n=Ft(e),s=r.visualViewport;let o=n.clientWidth,l=n.clientHeight,i=0,a=0;if(s){o=s.width,l=s.height;const p=ad();(!p||p&&t==="fixed")&&(i=s.offsetLeft,a=s.offsetTop)}const c=ba(n);if(c<=0){const p=n.ownerDocument,u=p.body,v=getComputedStyle(u),y=p.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,w=Math.abs(n.clientWidth-u.clientWidth-y);w<=Af&&(o-=w)}else c<=Af&&(o+=c);return{width:o,height:l,x:i,y:a}}function OR(e,t){const r=tn(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=er(e)?On(e):Bt(1),l=e.clientWidth*o.x,i=e.clientHeight*o.y,a=s*o.x,c=n*o.y;return{width:l,height:i,x:a,y:c}}function Df(e,t,r){let n;if(t==="viewport")n=IR(e,r);else if(t==="document")n=NR(Ft(e));else if(Rt(t))n=OR(t,r);else{const s=Qg(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Wo(n)}function Zg(e,t){const r=Pr(e);return r===t||!Rt(r)||Vn(r)?!1:Pt(r).position==="fixed"||Zg(r,t)}function jR(e,t){const r=t.get(e);if(r)return r;let n=Js(e,[],!1).filter(i=>Rt(i)&&ts(i)!=="body"),s=null;const o=Pt(e).position==="fixed";let l=o?Pr(e):e;for(;Rt(l)&&!Vn(l);){const i=Pt(l),a=od(l);!a&&i.position==="fixed"&&(s=null),(o?!a&&!s:!a&&i.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||mi(l)&&!a&&Zg(e,l))?n=n.filter(p=>p!==l):s=i,l=Pr(l)}return t.set(e,n),n}function BR(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const l=[...r==="clippingAncestors"?xa(t)?[]:jR(t,this._c):[].concat(r),n],i=Df(t,l[0],s);let a=i.top,c=i.right,p=i.bottom,u=i.left;for(let v=1;v<l.length;v++){const y=Df(t,l[v],s);a=tt(y.top,a),c=Rr(y.right,c),p=Rr(y.bottom,p),u=tt(y.left,u)}return{width:c-u,height:p-a,x:u,y:a}}function $R(e){const{width:t,height:r}=Yg(e);return{width:t,height:r}}function FR(e,t,r){const n=er(t),s=Ft(t),o=r==="fixed",l=tn(e,!0,o,t);let i={scrollLeft:0,scrollTop:0};const a=Bt(0);function c(){a.x=ba(s)}if(n||!n&&!o)if((ts(t)!=="body"||mi(s))&&(i=Ca(t)),n){const y=tn(t,!0,o,t);a.x=y.x+t.clientLeft,a.y=y.y+t.clientTop}else s&&c();o&&!n&&s&&c();const p=s&&!n&&!o?Jg(s,i):Bt(0),u=l.left+i.scrollLeft-a.x-p.x,v=l.top+i.scrollTop-a.y-p.y;return{x:u,y:v,width:l.width,height:l.height}}function kl(e){return Pt(e).position==="static"}function Mf(e,t){if(!er(e)||Pt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ft(e)===r&&(r=r.ownerDocument.body),r}function e_(e,t){const r=it(e);if(xa(e))return r;if(!er(e)){let s=Pr(e);for(;s&&!Vn(s);){if(Rt(s)&&!kl(s))return s;s=Pr(s)}return r}let n=Mf(e,t);for(;n&&kR(n)&&kl(n);)n=Mf(n,t);return n&&Vn(n)&&kl(n)&&!od(n)?r:n||TR(e)||r}const HR=async function(e){const t=this.getOffsetParent||e_,r=this.getDimensions,n=await r(e.floating);return{reference:FR(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function WR(e){return Pt(e).direction==="rtl"}const zR={convertOffsetParentRelativeRectToViewportRelativeRect:DR,getDocumentElement:Ft,getClippingRect:BR,getOffsetParent:e_,getElementRects:HR,getClientRects:MR,getDimensions:$R,getScale:On,isElement:Rt,isRTL:WR};function t_(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function UR(e,t){let r=null,n;const s=Ft(e);function o(){var i;clearTimeout(n),(i=r)==null||i.disconnect(),r=null}function l(i,a){i===void 0&&(i=!1),a===void 0&&(a=1),o();const c=e.getBoundingClientRect(),{left:p,top:u,width:v,height:y}=c;if(i||t(),!v||!y)return;const w=Gi(u),_=Gi(s.clientWidth-(p+v)),m=Gi(s.clientHeight-(u+y)),h=Gi(p),f={rootMargin:-w+"px "+-_+"px "+-m+"px "+-h+"px",threshold:tt(0,Rr(1,a))||1};let S=!0;function E(k){const b=k[0].intersectionRatio;if(b!==a){if(!S)return l();b?l(!1,b):n=setTimeout(()=>{l(!1,1e-7)},1e3)}b===1&&!t_(c,e.getBoundingClientRect())&&l(),S=!1}try{r=new IntersectionObserver(E,{...f,root:s.ownerDocument})}catch{r=new IntersectionObserver(E,f)}r.observe(e)}return l(!0),o}function VR(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:a=!1}=n,c=ld(e),p=s||o?[...c?Js(c):[],...t?Js(t):[]]:[];p.forEach(h=>{s&&h.addEventListener("scroll",r,{passive:!0}),o&&h.addEventListener("resize",r)});const u=c&&i?UR(c,r):null;let v=-1,y=null;l&&(y=new ResizeObserver(h=>{let[d]=h;d&&d.target===c&&y&&t&&(y.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var f;(f=y)==null||f.observe(t)})),r()}),c&&!a&&y.observe(c),t&&y.observe(t));let w,_=a?tn(e):null;a&&m();function m(){const h=tn(e);_&&!t_(_,h)&&r(),_=h,w=requestAnimationFrame(m)}return r(),()=>{var h;p.forEach(d=>{s&&d.removeEventListener("scroll",r),o&&d.removeEventListener("resize",r)}),u==null||u(),(h=y)==null||h.disconnect(),y=null,a&&cancelAnimationFrame(w)}}const KR=xR,GR=CR,qR=yR,XR=ER,YR=SR,Nf=_R,QR=bR,JR=(e,t,r)=>{const n=new Map,s={platform:zR,...r},o={...s.platform,_c:n};return gR(e,t,{...s,platform:o})};var ZR=typeof document<"u",eP=function(){},ho=ZR?g.useLayoutEffect:eP;function zo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!zo(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const o=s[n];if(!(o==="_owner"&&e.$$typeof)&&!zo(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function r_(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function If(e,t){const r=r_(e);return Math.round(t*r)/r}function Rl(e){const t=g.useRef(e);return ho(()=>{t.current=e}),t}function tP(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:l}={},transform:i=!0,whileElementsMounted:a,open:c}=e,[p,u]=g.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[v,y]=g.useState(n);zo(v,n)||y(n);const[w,_]=g.useState(null),[m,h]=g.useState(null),d=g.useCallback(B=>{B!==k.current&&(k.current=B,_(B))},[]),f=g.useCallback(B=>{B!==b.current&&(b.current=B,h(B))},[]),S=o||w,E=l||m,k=g.useRef(null),b=g.useRef(null),C=g.useRef(p),P=a!=null,T=Rl(a),M=Rl(s),j=Rl(c),N=g.useCallback(()=>{if(!k.current||!b.current)return;const B={placement:t,strategy:r,middleware:v};M.current&&(B.platform=M.current),JR(k.current,b.current,B).then(R=>{const L={...R,isPositioned:j.current!==!1};$.current&&!zo(C.current,L)&&(C.current=L,on.flushSync(()=>{u(L)}))})},[v,t,r,M,j]);ho(()=>{c===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,u(B=>({...B,isPositioned:!1})))},[c]);const $=g.useRef(!1);ho(()=>($.current=!0,()=>{$.current=!1}),[]),ho(()=>{if(S&&(k.current=S),E&&(b.current=E),S&&E){if(T.current)return T.current(S,E,N);N()}},[S,E,N,T,P]);const V=g.useMemo(()=>({reference:k,floating:b,setReference:d,setFloating:f}),[d,f]),K=g.useMemo(()=>({reference:S,floating:E}),[S,E]),q=g.useMemo(()=>{const B={position:r,left:0,top:0};if(!K.floating)return B;const R=If(K.floating,p.x),L=If(K.floating,p.y);return i?{...B,transform:"translate("+R+"px, "+L+"px)",...r_(K.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:R,top:L}},[r,i,K.floating,p.x,p.y]);return g.useMemo(()=>({...p,update:N,refs:V,elements:K,floatingStyles:q}),[p,N,V,K,q])}const rP=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Nf({element:n.current,padding:s}).fn(r):{}:n?Nf({element:n,padding:s}).fn(r):{}}}},nP=(e,t)=>{const r=KR(e);return{name:r.name,fn:r.fn,options:[e,t]}},sP=(e,t)=>{const r=GR(e);return{name:r.name,fn:r.fn,options:[e,t]}},iP=(e,t)=>({fn:QR(e).fn,options:[e,t]}),oP=(e,t)=>{const r=qR(e);return{name:r.name,fn:r.fn,options:[e,t]}},aP=(e,t)=>{const r=XR(e);return{name:r.name,fn:r.fn,options:[e,t]}},lP=(e,t)=>{const r=YR(e);return{name:r.name,fn:r.fn,options:[e,t]}},cP=(e,t)=>{const r=rP(e);return{name:r.name,fn:r.fn,options:[e,t]}};function uP(e){const t=dP(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(fP);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function dP(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=mP(s),i=pP(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hP=Symbol("radix.slottable");function fP(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hP}function pP(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function mP(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var vP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],gP=vP.reduce((e,t)=>{const r=uP(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),_P="Arrow",n_=g.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return x.jsx(gP.svg,{...o,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:x.jsx("polygon",{points:"0,0 30,0 15,10"})})});n_.displayName=_P;var yP=n_;function SP(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l),a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,wP(s,...t)]}function wP(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function xP(e){const t=CP(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(EP);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function CP(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=RP(s),i=kP(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bP=Symbol("radix.slottable");function EP(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bP}function kP(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function RP(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var PP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],s_=PP.reduce((e,t)=>{const r=xP(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),i_="Popper",[o_,Mr]=SP(i_),[rN,a_]=o_(i_),l_="PopperAnchor",c_=g.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=a_(l_,r),l=g.useRef(null),i=le(t,l),a=g.useRef(null);return g.useEffect(()=>{const c=a.current;a.current=(n==null?void 0:n.current)||l.current,c!==a.current&&o.onAnchorChange(a.current)}),n?null:x.jsx(s_.div,{...s,ref:i})});c_.displayName=l_;var cd="PopperContent",[TP,LP]=o_(cd),u_=g.forwardRef((e,t)=>{var O,A,W,H,Y,X;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,arrowPadding:i=0,avoidCollisions:a=!0,collisionBoundary:c=[],collisionPadding:p=0,sticky:u="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:w,..._}=e,m=a_(cd,r),[h,d]=g.useState(null),f=le(t,ne=>d(ne)),[S,E]=g.useState(null),k=Gu(S),b=(k==null?void 0:k.width)??0,C=(k==null?void 0:k.height)??0,P=n+(o!=="center"?"-"+o:""),T=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},M=Array.isArray(c)?c:[c],j=M.length>0,N={padding:T,boundary:M.filter(DP),altBoundary:j},{refs:$,floatingStyles:V,placement:K,isPositioned:q,middlewareData:B}=tP({strategy:"fixed",placement:P,whileElementsMounted:(...ne)=>VR(...ne,{animationFrame:y==="always"}),elements:{reference:m.anchor},middleware:[nP({mainAxis:s+C,alignmentAxis:l}),a&&sP({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?iP():void 0,...N}),a&&oP({...N}),aP({...N,apply:({elements:ne,rects:ie,availableWidth:de,availableHeight:be})=>{const{width:se,height:jr}=ie.reference,tr=ne.floating.style;tr.setProperty("--radix-popper-available-width",`${de}px`),tr.setProperty("--radix-popper-available-height",`${be}px`),tr.setProperty("--radix-popper-anchor-width",`${se}px`),tr.setProperty("--radix-popper-anchor-height",`${jr}px`)}}),S&&cP({element:S,padding:i}),MP({arrowWidth:b,arrowHeight:C}),v&&lP({strategy:"referenceHidden",...N})]}),[R,L]=f_(K),I=$t(w);Le(()=>{q&&(I==null||I())},[q,I]);const D=(O=B.arrow)==null?void 0:O.x,z=(A=B.arrow)==null?void 0:A.y,F=((W=B.arrow)==null?void 0:W.centerOffset)!==0,[U,G]=g.useState();return Le(()=>{h&&G(window.getComputedStyle(h).zIndex)},[h]),x.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:q?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:U,"--radix-popper-transform-origin":[(H=B.transformOrigin)==null?void 0:H.x,(Y=B.transformOrigin)==null?void 0:Y.y].join(" "),...((X=B.hide)==null?void 0:X.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:x.jsx(TP,{scope:r,placedSide:R,onArrowChange:E,arrowX:D,arrowY:z,shouldHideArrow:F,children:x.jsx(s_.div,{"data-side":R,"data-align":L,..._,ref:f,style:{..._.style,animation:q?void 0:"none"}})})})});u_.displayName=cd;var d_="PopperArrow",AP={top:"bottom",right:"left",bottom:"top",left:"right"},h_=g.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=LP(d_,n),l=AP[o.placedSide];return x.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:x.jsx(yP,{...s,ref:r,style:{...s.style,display:"block"}})})});h_.displayName=d_;function DP(e){return e!==null}var MP=e=>({name:"transformOrigin",options:e,fn(t){var m,h,d;const{placement:r,rects:n,middlewareData:s}=t,l=((m=s.arrow)==null?void 0:m.centerOffset)!==0,i=l?0:e.arrowWidth,a=l?0:e.arrowHeight,[c,p]=f_(r),u={start:"0%",center:"50%",end:"100%"}[p],v=(((h=s.arrow)==null?void 0:h.x)??0)+i/2,y=(((d=s.arrow)==null?void 0:d.y)??0)+a/2;let w="",_="";return c==="bottom"?(w=l?u:`${v}px`,_=`${-a}px`):c==="top"?(w=l?u:`${v}px`,_=`${n.floating.height+a}px`):c==="right"?(w=`${-a}px`,_=l?u:`${y}px`):c==="left"&&(w=`${n.floating.width+a}px`,_=l?u:`${y}px`),{data:{x:w,y:_}}}});function f_(e){const[t,r="center"]=e.split("-");return[t,r]}var vi=c_,Ea=u_,ka=h_;function p_(e){const t=NP(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(OP);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function NP(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=BP(s),i=jP(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var IP=Symbol("radix.slottable");function OP(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===IP}function jP(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function BP(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var $P=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],gi=$P.reduce((e,t)=>{const r=p_(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function FP(e,t){e&&on.flushSync(()=>e.dispatchEvent(t))}function HP(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l),a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,WP(s,...t)]}function WP(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function zP(e){const t=UP(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(KP);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function UP(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=qP(s),i=GP(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var VP=Symbol("radix.slottable");function KP(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===VP}function GP(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function qP(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var XP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],m_=XP.reduce((e,t)=>{const r=zP(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Pl="rovingFocusGroup.onEntryFocus",YP={bubbles:!1,cancelable:!0},_i="RovingFocusGroup",[Nc,v_,QP]=rd(_i),[JP,Ra]=HP(_i,[QP]),[ZP,eT]=JP(_i),g_=g.forwardRef((e,t)=>x.jsx(Nc.Provider,{scope:e.__scopeRovingFocusGroup,children:x.jsx(Nc.Slot,{scope:e.__scopeRovingFocusGroup,children:x.jsx(tT,{...e,ref:t})})}));g_.displayName=_i;var tT=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:a,onEntryFocus:c,preventScrollOnEntryFocus:p=!1,...u}=e,v=g.useRef(null),y=le(t,v),w=Vg(o),[_,m]=li({prop:l,defaultProp:i??null,onChange:a,caller:_i}),[h,d]=g.useState(!1),f=$t(c),S=v_(r),E=g.useRef(!1),[k,b]=g.useState(0);return g.useEffect(()=>{const C=v.current;if(C)return C.addEventListener(Pl,f),()=>C.removeEventListener(Pl,f)},[f]),x.jsx(ZP,{scope:r,orientation:n,dir:w,loop:s,currentTabStopId:_,onItemFocus:g.useCallback(C=>m(C),[m]),onItemShiftTab:g.useCallback(()=>d(!0),[]),onFocusableItemAdd:g.useCallback(()=>b(C=>C+1),[]),onFocusableItemRemove:g.useCallback(()=>b(C=>C-1),[]),children:x.jsx(m_.div,{tabIndex:h||k===0?-1:0,"data-orientation":n,...u,ref:y,style:{outline:"none",...e.style},onMouseDown:J(e.onMouseDown,()=>{E.current=!0}),onFocus:J(e.onFocus,C=>{const P=!E.current;if(C.target===C.currentTarget&&P&&!h){const T=new CustomEvent(Pl,YP);if(C.currentTarget.dispatchEvent(T),!T.defaultPrevented){const M=S().filter(K=>K.focusable),j=M.find(K=>K.active),N=M.find(K=>K.id===_),V=[j,N,...M].filter(Boolean).map(K=>K.ref.current);S_(V,p)}}E.current=!1}),onBlur:J(e.onBlur,()=>d(!1))})})}),__="RovingFocusGroupItem",y_=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:o,children:l,...i}=e,a=st(),c=o||a,p=eT(__,r),u=p.currentTabStopId===c,v=v_(r),{onFocusableItemAdd:y,onFocusableItemRemove:w,currentTabStopId:_}=p;return g.useEffect(()=>{if(n)return y(),()=>w()},[n,y,w]),x.jsx(Nc.ItemSlot,{scope:r,id:c,focusable:n,active:s,children:x.jsx(m_.span,{tabIndex:u?0:-1,"data-orientation":p.orientation,...i,ref:t,onMouseDown:J(e.onMouseDown,m=>{n?p.onItemFocus(c):m.preventDefault()}),onFocus:J(e.onFocus,()=>p.onItemFocus(c)),onKeyDown:J(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){p.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const h=sT(m,p.orientation,p.dir);if(h!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let f=v().filter(S=>S.focusable).map(S=>S.ref.current);if(h==="last")f.reverse();else if(h==="prev"||h==="next"){h==="prev"&&f.reverse();const S=f.indexOf(m.currentTarget);f=p.loop?iT(f,S+1):f.slice(S+1)}setTimeout(()=>S_(f))}}),children:typeof l=="function"?l({isCurrentTabStop:u,hasTabStop:_!=null}):l})})});y_.displayName=__;var rT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function nT(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function sT(e,t,r){const n=nT(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return rT[n]}function S_(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function iT(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var w_=g_,x_=y_,Ic=["Enter"," "],oT=["ArrowDown","PageUp","Home"],C_=["ArrowUp","PageDown","End"],aT=[...oT,...C_],lT={ltr:[...Ic,"ArrowRight"],rtl:[...Ic,"ArrowLeft"]},cT={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Pa="Menu",[Zs,uT,dT]=rd(Pa),[cn,b_]=nR(Pa,[dT,Mr,Ra]),ud=Mr(),E_=Ra(),[nN,un]=cn(Pa),[sN,yi]=cn(Pa),hT="MenuAnchor",dd=g.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=ud(r);return x.jsx(vi,{...s,...n,ref:t})});dd.displayName=hT;var hd="MenuPortal",[fT,k_]=cn(hd,{forceMount:void 0}),R_=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,o=un(hd,t);return x.jsx(fT,{scope:t,forceMount:r,children:x.jsx(Qe,{present:r||o.open,children:x.jsx(Zn,{asChild:!0,container:s,children:n})})})};R_.displayName=hd;var vt="MenuContent",[pT,fd]=cn(vt),P_=g.forwardRef((e,t)=>{const r=k_(vt,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=un(vt,e.__scopeMenu),l=yi(vt,e.__scopeMenu);return x.jsx(Zs.Provider,{scope:e.__scopeMenu,children:x.jsx(Qe,{present:n||o.open,children:x.jsx(Zs.Slot,{scope:e.__scopeMenu,children:l.modal?x.jsx(mT,{...s,ref:t}):x.jsx(vT,{...s,ref:t})})})})}),mT=g.forwardRef((e,t)=>{const r=un(vt,e.__scopeMenu),n=g.useRef(null),s=le(t,n);return g.useEffect(()=>{const o=n.current;if(o)return va(o)},[]),x.jsx(pd,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:J(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),vT=g.forwardRef((e,t)=>{const r=un(vt,e.__scopeMenu);return x.jsx(pd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),gT=p_("MenuContent.ScrollLock"),pd=g.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:i,onEntryFocus:a,onEscapeKeyDown:c,onPointerDownOutside:p,onFocusOutside:u,onInteractOutside:v,onDismiss:y,disableOutsideScroll:w,..._}=e,m=un(vt,r),h=yi(vt,r),d=ud(r),f=E_(r),S=uT(r),[E,k]=g.useState(null),b=g.useRef(null),C=le(t,b,m.onContentChange),P=g.useRef(0),T=g.useRef(""),M=g.useRef(0),j=g.useRef(null),N=g.useRef("right"),$=g.useRef(0),V=w?di:g.Fragment,K=w?{as:gT,allowPinchZoom:!0}:void 0,q=R=>{var O,A;const L=T.current+R,I=S().filter(W=>!W.disabled),D=document.activeElement,z=(O=I.find(W=>W.ref.current===D))==null?void 0:O.textValue,F=I.map(W=>W.textValue),U=TT(F,L,z),G=(A=I.find(W=>W.textValue===U))==null?void 0:A.ref.current;(function W(H){T.current=H,window.clearTimeout(P.current),H!==""&&(P.current=window.setTimeout(()=>W(""),1e3))})(L),G&&setTimeout(()=>G.focus())};g.useEffect(()=>()=>window.clearTimeout(P.current),[]),pa();const B=g.useCallback(R=>{var I,D;return N.current===((I=j.current)==null?void 0:I.side)&&AT(R,(D=j.current)==null?void 0:D.area)},[]);return x.jsx(pT,{scope:r,searchRef:T,onItemEnter:g.useCallback(R=>{B(R)&&R.preventDefault()},[B]),onItemLeave:g.useCallback(R=>{var L;B(R)||((L=b.current)==null||L.focus(),k(null))},[B]),onTriggerLeave:g.useCallback(R=>{B(R)&&R.preventDefault()},[B]),pointerGraceTimerRef:M,onPointerGraceIntentChange:g.useCallback(R=>{j.current=R},[]),children:x.jsx(V,{...K,children:x.jsx(ci,{asChild:!0,trapped:s,onMountAutoFocus:J(o,R=>{var L;R.preventDefault(),(L=b.current)==null||L.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:x.jsx(Jn,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:p,onFocusOutside:u,onInteractOutside:v,onDismiss:y,children:x.jsx(w_,{asChild:!0,...f,dir:h.dir,orientation:"vertical",loop:n,currentTabStopId:E,onCurrentTabStopIdChange:k,onEntryFocus:J(a,R=>{h.isUsingKeyboardRef.current||R.preventDefault()}),preventScrollOnEntryFocus:!0,children:x.jsx(Ea,{role:"menu","aria-orientation":"vertical","data-state":U_(m.open),"data-radix-menu-content":"",dir:h.dir,...d,..._,ref:C,style:{outline:"none",..._.style},onKeyDown:J(_.onKeyDown,R=>{const I=R.target.closest("[data-radix-menu-content]")===R.currentTarget,D=R.ctrlKey||R.altKey||R.metaKey,z=R.key.length===1;I&&(R.key==="Tab"&&R.preventDefault(),!D&&z&&q(R.key));const F=b.current;if(R.target!==F||!aT.includes(R.key))return;R.preventDefault();const G=S().filter(O=>!O.disabled).map(O=>O.ref.current);C_.includes(R.key)&&G.reverse(),RT(G)}),onBlur:J(e.onBlur,R=>{R.currentTarget.contains(R.target)||(window.clearTimeout(P.current),T.current="")}),onPointerMove:J(e.onPointerMove,ei(R=>{const L=R.target,I=$.current!==R.clientX;if(R.currentTarget.contains(L)&&I){const D=R.clientX>$.current?"right":"left";N.current=D,$.current=R.clientX}}))})})})})})})});P_.displayName=vt;var _T="MenuGroup",md=g.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return x.jsx(gi.div,{role:"group",...n,ref:t})});md.displayName=_T;var yT="MenuLabel",T_=g.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return x.jsx(gi.div,{...n,ref:t})});T_.displayName=yT;var Uo="MenuItem",Of="menu.itemSelect",Ta=g.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,o=g.useRef(null),l=yi(Uo,e.__scopeMenu),i=fd(Uo,e.__scopeMenu),a=le(t,o),c=g.useRef(!1),p=()=>{const u=o.current;if(!r&&u){const v=new CustomEvent(Of,{bubbles:!0,cancelable:!0});u.addEventListener(Of,y=>n==null?void 0:n(y),{once:!0}),FP(u,v),v.defaultPrevented?c.current=!1:l.onClose()}};return x.jsx(L_,{...s,ref:a,disabled:r,onClick:J(e.onClick,p),onPointerDown:u=>{var v;(v=e.onPointerDown)==null||v.call(e,u),c.current=!0},onPointerUp:J(e.onPointerUp,u=>{var v;c.current||(v=u.currentTarget)==null||v.click()}),onKeyDown:J(e.onKeyDown,u=>{const v=i.searchRef.current!=="";r||v&&u.key===" "||Ic.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});Ta.displayName=Uo;var L_=g.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...o}=e,l=fd(Uo,r),i=E_(r),a=g.useRef(null),c=le(t,a),[p,u]=g.useState(!1),[v,y]=g.useState("");return g.useEffect(()=>{const w=a.current;w&&y((w.textContent??"").trim())},[o.children]),x.jsx(Zs.ItemSlot,{scope:r,disabled:n,textValue:s??v,children:x.jsx(x_,{asChild:!0,...i,focusable:!n,children:x.jsx(gi.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:c,onPointerMove:J(e.onPointerMove,ei(w=>{n?l.onItemLeave(w):(l.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:J(e.onPointerLeave,ei(w=>l.onItemLeave(w))),onFocus:J(e.onFocus,()=>u(!0)),onBlur:J(e.onBlur,()=>u(!1))})})})}),ST="MenuCheckboxItem",A_=g.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return x.jsx(O_,{scope:e.__scopeMenu,checked:r,children:x.jsx(Ta,{role:"menuitemcheckbox","aria-checked":Vo(r)?"mixed":r,...s,ref:t,"data-state":gd(r),onSelect:J(s.onSelect,()=>n==null?void 0:n(Vo(r)?!0:!r),{checkForDefaultPrevented:!1})})})});A_.displayName=ST;var D_="MenuRadioGroup",[wT,xT]=cn(D_,{value:void 0,onValueChange:()=>{}}),M_=g.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,o=$t(n);return x.jsx(wT,{scope:e.__scopeMenu,value:r,onValueChange:o,children:x.jsx(md,{...s,ref:t})})});M_.displayName=D_;var N_="MenuRadioItem",I_=g.forwardRef((e,t)=>{const{value:r,...n}=e,s=xT(N_,e.__scopeMenu),o=r===s.value;return x.jsx(O_,{scope:e.__scopeMenu,checked:o,children:x.jsx(Ta,{role:"menuitemradio","aria-checked":o,...n,ref:t,"data-state":gd(o),onSelect:J(n.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,r)},{checkForDefaultPrevented:!1})})})});I_.displayName=N_;var vd="MenuItemIndicator",[O_,CT]=cn(vd,{checked:!1}),j_=g.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,o=CT(vd,r);return x.jsx(Qe,{present:n||Vo(o.checked)||o.checked===!0,children:x.jsx(gi.span,{...s,ref:t,"data-state":gd(o.checked)})})});j_.displayName=vd;var bT="MenuSeparator",B_=g.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return x.jsx(gi.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});B_.displayName=bT;var ET="MenuArrow",$_=g.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=ud(r);return x.jsx(ka,{...s,...n,ref:t})});$_.displayName=ET;var kT="MenuSub",[iN,F_]=cn(kT),ws="MenuSubTrigger",H_=g.forwardRef((e,t)=>{const r=un(ws,e.__scopeMenu),n=yi(ws,e.__scopeMenu),s=F_(ws,e.__scopeMenu),o=fd(ws,e.__scopeMenu),l=g.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:a}=o,c={__scopeMenu:e.__scopeMenu},p=g.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return g.useEffect(()=>p,[p]),g.useEffect(()=>{const u=i.current;return()=>{window.clearTimeout(u),a(null)}},[i,a]),x.jsx(dd,{asChild:!0,...c,children:x.jsx(L_,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":U_(r.open),...e,ref:fe(t,s.onTriggerChange),onClick:u=>{var v;(v=e.onClick)==null||v.call(e,u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:J(e.onPointerMove,ei(u=>{o.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!r.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{r.onOpenChange(!0),p()},100))})),onPointerLeave:J(e.onPointerLeave,ei(u=>{var y,w;p();const v=(y=r.content)==null?void 0:y.getBoundingClientRect();if(v){const _=(w=r.content)==null?void 0:w.dataset.side,m=_==="right",h=m?-5:5,d=v[m?"left":"right"],f=v[m?"right":"left"];o.onPointerGraceIntentChange({area:[{x:u.clientX+h,y:u.clientY},{x:d,y:v.top},{x:f,y:v.top},{x:f,y:v.bottom},{x:d,y:v.bottom}],side:_}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(u),u.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:J(e.onKeyDown,u=>{var y;const v=o.searchRef.current!=="";e.disabled||v&&u.key===" "||lT[n.dir].includes(u.key)&&(r.onOpenChange(!0),(y=r.content)==null||y.focus(),u.preventDefault())})})})});H_.displayName=ws;var W_="MenuSubContent",z_=g.forwardRef((e,t)=>{const r=k_(vt,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=un(vt,e.__scopeMenu),l=yi(vt,e.__scopeMenu),i=F_(W_,e.__scopeMenu),a=g.useRef(null),c=le(t,a);return x.jsx(Zs.Provider,{scope:e.__scopeMenu,children:x.jsx(Qe,{present:n||o.open,children:x.jsx(Zs.Slot,{scope:e.__scopeMenu,children:x.jsx(pd,{id:i.contentId,"aria-labelledby":i.triggerId,...s,ref:c,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var u;l.isUsingKeyboardRef.current&&((u=a.current)==null||u.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:J(e.onFocusOutside,p=>{p.target!==i.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:J(e.onEscapeKeyDown,p=>{l.onClose(),p.preventDefault()}),onKeyDown:J(e.onKeyDown,p=>{var y;const u=p.currentTarget.contains(p.target),v=cT[l.dir].includes(p.key);u&&v&&(o.onOpenChange(!1),(y=i.trigger)==null||y.focus(),p.preventDefault())})})})})})});z_.displayName=W_;function U_(e){return e?"open":"closed"}function Vo(e){return e==="indeterminate"}function gd(e){return Vo(e)?"indeterminate":e?"checked":"unchecked"}function RT(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function PT(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function TT(e,t,r){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let l=PT(e,Math.max(o,0));s.length===1&&(l=l.filter(c=>c!==r));const a=l.find(c=>c.toLowerCase().startsWith(s.toLowerCase()));return a!==r?a:void 0}function LT(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const i=t[o],a=t[l],c=i.x,p=i.y,u=a.x,v=a.y;p>n!=v>n&&r<(u-c)*(n-p)/(v-p)+c&&(s=!s)}return s}function AT(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return LT(r,t)}function ei(e){return t=>t.pointerType==="mouse"?e(t):void 0}var DT=dd,MT=R_,NT=P_,IT=md,OT=T_,jT=Ta,BT=A_,$T=M_,FT=I_,HT=j_,WT=B_,zT=$_,UT=H_,VT=z_,V_="DropdownMenu",[KT]=F2(V_,[b_]),Ze=b_(),[oN,K_]=KT(V_),G_="DropdownMenuTrigger",GT=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,o=K_(G_,r),l=Ze(r);return x.jsx(DT,{asChild:!0,...l,children:x.jsx(X2.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:fe(t,o.triggerRef),onPointerDown:J(e.onPointerDown,i=>{!n&&i.button===0&&i.ctrlKey===!1&&(o.onOpenToggle(),o.open||i.preventDefault())}),onKeyDown:J(e.onKeyDown,i=>{n||(["Enter"," "].includes(i.key)&&o.onOpenToggle(),i.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())})})})});GT.displayName=G_;var qT="DropdownMenuPortal",q_=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Ze(t);return x.jsx(MT,{...n,...r})};q_.displayName=qT;var X_="DropdownMenuContent",Y_=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=K_(X_,r),o=Ze(r),l=g.useRef(!1);return x.jsx(NT,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...n,ref:t,onCloseAutoFocus:J(e.onCloseAutoFocus,i=>{var a;l.current||(a=s.triggerRef.current)==null||a.focus(),l.current=!1,i.preventDefault()}),onInteractOutside:J(e.onInteractOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,p=a.button===2||c;(!s.modal||p)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Y_.displayName=X_;var XT="DropdownMenuGroup",YT=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return x.jsx(IT,{...s,...n,ref:t})});YT.displayName=XT;var QT="DropdownMenuLabel",Q_=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return x.jsx(OT,{...s,...n,ref:t})});Q_.displayName=QT;var JT="DropdownMenuItem",J_=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return x.jsx(jT,{...s,...n,ref:t})});J_.displayName=JT;var ZT="DropdownMenuCheckboxItem",Z_=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return x.jsx(BT,{...s,...n,ref:t})});Z_.displayName=ZT;var eL="DropdownMenuRadioGroup",tL=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return x.jsx($T,{...s,...n,ref:t})});tL.displayName=eL;var rL="DropdownMenuRadioItem",ey=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return x.jsx(FT,{...s,...n,ref:t})});ey.displayName=rL;var nL="DropdownMenuItemIndicator",ty=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return x.jsx(HT,{...s,...n,ref:t})});ty.displayName=nL;var sL="DropdownMenuSeparator",ry=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return x.jsx(WT,{...s,...n,ref:t})});ry.displayName=sL;var iL="DropdownMenuArrow",oL=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return x.jsx(zT,{...s,...n,ref:t})});oL.displayName=iL;var aL="DropdownMenuSubTrigger",ny=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return x.jsx(UT,{...s,...n,ref:t})});ny.displayName=aL;var lL="DropdownMenuSubContent",sy=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return x.jsx(VT,{...s,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});sy.displayName=lL;var cL=q_,iy=Y_,oy=Q_,ay=J_,ly=Z_,cy=ey,uy=ty,dy=ry,hy=ny,fy=sy;const uL=g.forwardRef(({className:e,inset:t,children:r,...n},s)=>x.jsxs(hy,{ref:s,className:re("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n,children:[r,x.jsx(Qv,{className:"ml-auto"})]}));uL.displayName=hy.displayName;const dL=g.forwardRef(({className:e,...t},r)=>x.jsx(fy,{ref:r,className:re("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...t}));dL.displayName=fy.displayName;const hL=g.forwardRef(({className:e,sideOffset:t=4,...r},n)=>x.jsx(cL,{children:x.jsx(iy,{ref:n,sideOffset:t,className:re("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...r})}));hL.displayName=iy.displayName;const fL=g.forwardRef(({className:e,inset:t,...r},n)=>x.jsx(ay,{ref:n,className:re("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...r}));fL.displayName=ay.displayName;const pL=g.forwardRef(({className:e,children:t,checked:r,...n},s)=>x.jsxs(ly,{ref:s,className:re("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(uy,{children:x.jsx(Uu,{className:"h-4 w-4"})})}),t]}));pL.displayName=ly.displayName;const mL=g.forwardRef(({className:e,children:t,...r},n)=>x.jsxs(cy,{ref:n,className:re("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(uy,{children:x.jsx(rb,{className:"h-2 w-2 fill-current"})})}),t]}));mL.displayName=cy.displayName;const vL=g.forwardRef(({className:e,inset:t,...r},n)=>x.jsx(oy,{ref:n,className:re("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));vL.displayName=oy.displayName;const gL=g.forwardRef(({className:e,...t},r)=>x.jsx(dy,{ref:r,className:re("-mx-1 my-1 h-px bg-muted",e),...t}));gL.displayName=dy.displayName;const _L=g.forwardRef(({className:e,type:t,...r},n)=>x.jsx("input",{type:t,className:re("flex h-9 w-full rounded-md border border-transparent bg-input px-3 py-1 text-base transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground/50 placeholder:font-light focus-visible:outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));_L.displayName="Input";var yL="Label",py=g.forwardRef((e,t)=>x.jsx(Ue.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));py.displayName=yL;var my=py;const SL=zu("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),wL=g.forwardRef(({className:e,...t},r)=>x.jsx(my,{ref:r,className:re(SL(),e),...t}));wL.displayName=my.displayName;function xL(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l),a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,CL(s,...t)]}function CL(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function vy(e){const t=bL(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(kL);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function bL(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=PL(s),i=RL(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var EL=Symbol("radix.slottable");function kL(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===EL}function RL(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function PL(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var TL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],gy=TL.reduce((e,t)=>{const r=vy(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),_y="Popover",[yy]=xL(_y,[Mr]),La=Mr(),[aN,Nr]=yy(_y),Sy="PopoverAnchor",LL=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=Nr(Sy,r),o=La(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:i}=s;return g.useEffect(()=>(l(),()=>i()),[l,i]),x.jsx(vi,{...o,...n,ref:t})});LL.displayName=Sy;var wy="PopoverTrigger",AL=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=Nr(wy,r),o=La(r),l=le(t,s.triggerRef),i=x.jsx(gy.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":ky(s.open),...n,ref:l,onClick:J(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?i:x.jsx(vi,{asChild:!0,...o,children:i})});AL.displayName=wy;var _d="PopoverPortal",[DL,ML]=yy(_d,{forceMount:void 0}),xy=e=>{const{__scopePopover:t,forceMount:r,children:n,container:s}=e,o=Nr(_d,t);return x.jsx(DL,{scope:t,forceMount:r,children:x.jsx(Qe,{present:r||o.open,children:x.jsx(Zn,{asChild:!0,container:s,children:n})})})};xy.displayName=_d;var Kn="PopoverContent",Cy=g.forwardRef((e,t)=>{const r=ML(Kn,e.__scopePopover),{forceMount:n=r.forceMount,...s}=e,o=Nr(Kn,e.__scopePopover);return x.jsx(Qe,{present:n||o.open,children:o.modal?x.jsx(IL,{...s,ref:t}):x.jsx(OL,{...s,ref:t})})});Cy.displayName=Kn;var NL=vy("PopoverContent.RemoveScroll"),IL=g.forwardRef((e,t)=>{const r=Nr(Kn,e.__scopePopover),n=g.useRef(null),s=le(t,n),o=g.useRef(!1);return g.useEffect(()=>{const l=n.current;if(l)return va(l)},[]),x.jsx(di,{as:NL,allowPinchZoom:!0,children:x.jsx(by,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(e.onCloseAutoFocus,l=>{var i;l.preventDefault(),o.current||(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,l=>{const i=l.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0,c=i.button===2||a;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:J(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),OL=g.forwardRef((e,t)=>{const r=Nr(Kn,e.__scopePopover),n=g.useRef(!1),s=g.useRef(!1);return x.jsx(by,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,i;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var a,c;(a=e.onInteractOutside)==null||a.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;((c=r.triggerRef.current)==null?void 0:c.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),by=g.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:p,...u}=e,v=Nr(Kn,r),y=La(r);return pa(),x.jsx(ci,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:x.jsx(Jn,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:c,onDismiss:()=>v.onOpenChange(!1),children:x.jsx(Ea,{"data-state":ky(v.open),role:"dialog",id:v.contentId,...y,...u,ref:t,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Ey="PopoverClose",jL=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=Nr(Ey,r);return x.jsx(gy.button,{type:"button",...n,ref:t,onClick:J(e.onClick,()=>s.onOpenChange(!1))})});jL.displayName=Ey;var BL="PopoverArrow",$L=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=La(r);return x.jsx(ka,{...s,...n,ref:t})});$L.displayName=BL;function ky(e){return e?"open":"closed"}var FL=xy,Ry=Cy;const HL=g.forwardRef(({className:e,align:t="start",sideOffset:r=4,...n},s)=>x.jsx(FL,{children:x.jsx(Ry,{ref:s,align:t,sideOffset:r,className:re("z-50 w-[var(--radix-popover-trigger-width)] rounded-md border bg-popover p-0 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));HL.displayName=Ry.displayName;var yd="Progress",Sd=100,[WL]=Iv(yd),[zL,UL]=WL(yd),Py=g.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:s,getValueLabel:o=VL,...l}=e;(s||s===0)&&!jf(s)&&console.error(KL(`${s}`,"Progress"));const i=jf(s)?s:Sd;n!==null&&!Bf(n,i)&&console.error(GL(`${n}`,"Progress"));const a=Bf(n,i)?n:null,c=Ko(a)?o(a,i):void 0;return x.jsx(zL,{scope:r,value:a,max:i,children:x.jsx(Ue.div,{"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":Ko(a)?a:void 0,"aria-valuetext":c,role:"progressbar","data-state":Ay(a,i),"data-value":a??void 0,"data-max":i,...l,ref:t})})});Py.displayName=yd;var Ty="ProgressIndicator",Ly=g.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,s=UL(Ty,r);return x.jsx(Ue.div,{"data-state":Ay(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...n,ref:t})});Ly.displayName=Ty;function VL(e,t){return`${Math.round(e/t*100)}%`}function Ay(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Ko(e){return typeof e=="number"}function jf(e){return Ko(e)&&!isNaN(e)&&e>0}function Bf(e,t){return Ko(e)&&!isNaN(e)&&e<=t&&e>=0}function KL(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Sd}\`.`}function GL(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
265
- - a positive number
266
- - less than the value passed to \`max\` (or ${Sd} if no \`max\` prop is set)
267
- - \`null\` or \`undefined\` if the progress is indeterminate.
268
-
269
- Defaulting to \`null\`.`}var Dy=Py,qL=Ly;const XL=g.forwardRef(({className:e,value:t,...r},n)=>x.jsx(Dy,{ref:n,className:re("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...r,children:x.jsx(qL,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));XL.displayName=Dy.displayName;function $f(e,[t,r]){return Math.min(r,Math.max(t,e))}function YL(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l),a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,QL(s,...t)]}function QL(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function My(e){const t=JL(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(eA);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function JL(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=rA(s),i=tA(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ZL=Symbol("radix.slottable");function eA(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ZL}function tA(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function rA(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var nA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ct=nA.reduce((e,t)=>{const r=My(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function sA(e){const t=iA(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(aA);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function iA(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=cA(s),i=lA(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oA=Symbol("radix.slottable");function aA(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===oA}function lA(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function cA(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var uA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dA=uA.reduce((e,t)=>{const r=sA(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ny=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),hA="VisuallyHidden",Iy=g.forwardRef((e,t)=>x.jsx(dA.span,{...e,ref:t,style:{...Ny,...e.style}}));Iy.displayName=hA;var fA=Iy,pA=[" ","Enter","ArrowUp","ArrowDown"],mA=[" ","Enter"],Aa="Select",[wd,Da,vA]=rd(Aa),[rs]=YL(Aa,[vA,Mr]),xd=Mr(),[lN,Ir]=rs(Aa),[cN,gA]=rs(Aa),Oy="SelectTrigger",jy=g.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=xd(r),l=Ir(Oy,r),i=l.disabled||n,a=le(t,l.onTriggerChange),c=Da(r),p=g.useRef("touch"),[u,v,y]=i0(_=>{const m=c().filter(f=>!f.disabled),h=m.find(f=>f.value===l.value),d=o0(m,_,h);d!==void 0&&l.onValueChange(d.value)}),w=_=>{i||(l.onOpenChange(!0),y()),_&&(l.triggerPointerDownPosRef.current={x:Math.round(_.pageX),y:Math.round(_.pageY)})};return x.jsx(vi,{asChild:!0,...o,children:x.jsx(ct.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":s0(l.value)?"":void 0,...s,ref:a,onClick:J(s.onClick,_=>{_.currentTarget.focus(),p.current!=="mouse"&&w(_)}),onPointerDown:J(s.onPointerDown,_=>{p.current=_.pointerType;const m=_.target;m.hasPointerCapture(_.pointerId)&&m.releasePointerCapture(_.pointerId),_.button===0&&_.ctrlKey===!1&&_.pointerType==="mouse"&&(w(_),_.preventDefault())}),onKeyDown:J(s.onKeyDown,_=>{const m=u.current!=="";!(_.ctrlKey||_.altKey||_.metaKey)&&_.key.length===1&&v(_.key),!(m&&_.key===" ")&&pA.includes(_.key)&&(w(),_.preventDefault())})})})});jy.displayName=Oy;var By="SelectValue",_A=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:l="",...i}=e,a=Ir(By,r),{onValueNodeHasChildrenChange:c}=a,p=o!==void 0,u=le(t,a.onValueNodeChange);return Le(()=>{c(p)},[c,p]),x.jsx(ct.span,{...i,ref:u,style:{pointerEvents:"none"},children:s0(a.value)?x.jsx(x.Fragment,{children:l}):o})});_A.displayName=By;var yA="SelectIcon",$y=g.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return x.jsx(ct.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});$y.displayName=yA;var SA="SelectPortal",Fy=e=>x.jsx(Zn,{asChild:!0,...e});Fy.displayName=SA;var rn="SelectContent",Hy=g.forwardRef((e,t)=>{const r=Ir(rn,e.__scopeSelect),[n,s]=g.useState();if(Le(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?on.createPortal(x.jsx(Wy,{scope:e.__scopeSelect,children:x.jsx(wd.Slot,{scope:e.__scopeSelect,children:x.jsx("div",{children:e.children})})}),o):null}return x.jsx(zy,{...e,ref:t})});Hy.displayName=rn;var St=10,[Wy,Or]=rs(rn),wA="SelectContentImpl",xA=My("SelectContent.RemoveScroll"),zy=g.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:l,side:i,sideOffset:a,align:c,alignOffset:p,arrowPadding:u,collisionBoundary:v,collisionPadding:y,sticky:w,hideWhenDetached:_,avoidCollisions:m,...h}=e,d=Ir(rn,r),[f,S]=g.useState(null),[E,k]=g.useState(null),b=le(t,O=>S(O)),[C,P]=g.useState(null),[T,M]=g.useState(null),j=Da(r),[N,$]=g.useState(!1),V=g.useRef(!1);g.useEffect(()=>{if(f)return va(f)},[f]),pa();const K=g.useCallback(O=>{const[A,...W]=j().map(X=>X.ref.current),[H]=W.slice(-1),Y=document.activeElement;for(const X of O)if(X===Y||(X==null||X.scrollIntoView({block:"nearest"}),X===A&&E&&(E.scrollTop=0),X===H&&E&&(E.scrollTop=E.scrollHeight),X==null||X.focus(),document.activeElement!==Y))return},[j,E]),q=g.useCallback(()=>K([C,f]),[K,C,f]);g.useEffect(()=>{N&&q()},[N,q]);const{onOpenChange:B,triggerPointerDownPosRef:R}=d;g.useEffect(()=>{if(f){let O={x:0,y:0};const A=H=>{var Y,X;O={x:Math.abs(Math.round(H.pageX)-(((Y=R.current)==null?void 0:Y.x)??0)),y:Math.abs(Math.round(H.pageY)-(((X=R.current)==null?void 0:X.y)??0))}},W=H=>{O.x<=10&&O.y<=10?H.preventDefault():f.contains(H.target)||B(!1),document.removeEventListener("pointermove",A),R.current=null};return R.current!==null&&(document.addEventListener("pointermove",A),document.addEventListener("pointerup",W,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",A),document.removeEventListener("pointerup",W,{capture:!0})}}},[f,B,R]),g.useEffect(()=>{const O=()=>B(!1);return window.addEventListener("blur",O),window.addEventListener("resize",O),()=>{window.removeEventListener("blur",O),window.removeEventListener("resize",O)}},[B]);const[L,I]=i0(O=>{const A=j().filter(Y=>!Y.disabled),W=A.find(Y=>Y.ref.current===document.activeElement),H=o0(A,O,W);H&&setTimeout(()=>H.ref.current.focus())}),D=g.useCallback((O,A,W)=>{const H=!V.current&&!W;(d.value!==void 0&&d.value===A||H)&&(P(O),H&&(V.current=!0))},[d.value]),z=g.useCallback(()=>f==null?void 0:f.focus(),[f]),F=g.useCallback((O,A,W)=>{const H=!V.current&&!W;(d.value!==void 0&&d.value===A||H)&&M(O)},[d.value]),U=n==="popper"?Oc:Uy,G=U===Oc?{side:i,sideOffset:a,align:c,alignOffset:p,arrowPadding:u,collisionBoundary:v,collisionPadding:y,sticky:w,hideWhenDetached:_,avoidCollisions:m}:{};return x.jsx(Wy,{scope:r,content:f,viewport:E,onViewportChange:k,itemRefCallback:D,selectedItem:C,onItemLeave:z,itemTextRefCallback:F,focusSelectedItem:q,selectedItemText:T,position:n,isPositioned:N,searchRef:L,children:x.jsx(di,{as:xA,allowPinchZoom:!0,children:x.jsx(ci,{asChild:!0,trapped:d.open,onMountAutoFocus:O=>{O.preventDefault()},onUnmountAutoFocus:J(s,O=>{var A;(A=d.trigger)==null||A.focus({preventScroll:!0}),O.preventDefault()}),children:x.jsx(Jn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:O=>O.preventDefault(),onDismiss:()=>d.onOpenChange(!1),children:x.jsx(U,{role:"listbox",id:d.contentId,"data-state":d.open?"open":"closed",dir:d.dir,onContextMenu:O=>O.preventDefault(),...h,...G,onPlaced:()=>$(!0),ref:b,style:{display:"flex",flexDirection:"column",outline:"none",...h.style},onKeyDown:J(h.onKeyDown,O=>{const A=O.ctrlKey||O.altKey||O.metaKey;if(O.key==="Tab"&&O.preventDefault(),!A&&O.key.length===1&&I(O.key),["ArrowUp","ArrowDown","Home","End"].includes(O.key)){let H=j().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);if(["ArrowUp","End"].includes(O.key)&&(H=H.slice().reverse()),["ArrowUp","ArrowDown"].includes(O.key)){const Y=O.target,X=H.indexOf(Y);H=H.slice(X+1)}setTimeout(()=>K(H)),O.preventDefault()}})})})})})})});zy.displayName=wA;var CA="SelectItemAlignedPosition",Uy=g.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=Ir(rn,r),l=Or(rn,r),[i,a]=g.useState(null),[c,p]=g.useState(null),u=le(t,b=>p(b)),v=Da(r),y=g.useRef(!1),w=g.useRef(!0),{viewport:_,selectedItem:m,selectedItemText:h,focusSelectedItem:d}=l,f=g.useCallback(()=>{if(o.trigger&&o.valueNode&&i&&c&&_&&m&&h){const b=o.trigger.getBoundingClientRect(),C=c.getBoundingClientRect(),P=o.valueNode.getBoundingClientRect(),T=h.getBoundingClientRect();if(o.dir!=="rtl"){const Y=T.left-C.left,X=P.left-Y,ne=b.left-X,ie=b.width+ne,de=Math.max(ie,C.width),be=window.innerWidth-St,se=$f(X,[St,Math.max(St,be-de)]);i.style.minWidth=ie+"px",i.style.left=se+"px"}else{const Y=C.right-T.right,X=window.innerWidth-P.right-Y,ne=window.innerWidth-b.right-X,ie=b.width+ne,de=Math.max(ie,C.width),be=window.innerWidth-St,se=$f(X,[St,Math.max(St,be-de)]);i.style.minWidth=ie+"px",i.style.right=se+"px"}const M=v(),j=window.innerHeight-St*2,N=_.scrollHeight,$=window.getComputedStyle(c),V=parseInt($.borderTopWidth,10),K=parseInt($.paddingTop,10),q=parseInt($.borderBottomWidth,10),B=parseInt($.paddingBottom,10),R=V+K+N+B+q,L=Math.min(m.offsetHeight*5,R),I=window.getComputedStyle(_),D=parseInt(I.paddingTop,10),z=parseInt(I.paddingBottom,10),F=b.top+b.height/2-St,U=j-F,G=m.offsetHeight/2,O=m.offsetTop+G,A=V+K+O,W=R-A;if(A<=F){const Y=M.length>0&&m===M[M.length-1].ref.current;i.style.bottom="0px";const X=c.clientHeight-_.offsetTop-_.offsetHeight,ne=Math.max(U,G+(Y?z:0)+X+q),ie=A+ne;i.style.height=ie+"px"}else{const Y=M.length>0&&m===M[0].ref.current;i.style.top="0px";const ne=Math.max(F,V+_.offsetTop+(Y?D:0)+G)+W;i.style.height=ne+"px",_.scrollTop=A-F+_.offsetTop}i.style.margin=`${St}px 0`,i.style.minHeight=L+"px",i.style.maxHeight=j+"px",n==null||n(),requestAnimationFrame(()=>y.current=!0)}},[v,o.trigger,o.valueNode,i,c,_,m,h,o.dir,n]);Le(()=>f(),[f]);const[S,E]=g.useState();Le(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const k=g.useCallback(b=>{b&&w.current===!0&&(f(),d==null||d(),w.current=!1)},[f,d]);return x.jsx(EA,{scope:r,contentWrapper:i,shouldExpandOnScrollRef:y,onScrollButtonChange:k,children:x.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:x.jsx(ct.div,{...s,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Uy.displayName=CA;var bA="SelectPopperPosition",Oc=g.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=St,...o}=e,l=xd(r);return x.jsx(Ea,{...l,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Oc.displayName=bA;var[EA,Cd]=rs(rn,{}),jc="SelectViewport",Vy=g.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=Or(jc,r),l=Cd(jc,r),i=le(t,o.onViewportChange),a=g.useRef(0);return x.jsxs(x.Fragment,{children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),x.jsx(wd.Slot,{scope:r,children:x.jsx(ct.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:J(s.onScroll,c=>{const p=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:v}=l;if(v!=null&&v.current&&u){const y=Math.abs(a.current-p.scrollTop);if(y>0){const w=window.innerHeight-St*2,_=parseFloat(u.style.minHeight),m=parseFloat(u.style.height),h=Math.max(_,m);if(h<w){const d=h+y,f=Math.min(w,d),S=d-f;u.style.height=f+"px",u.style.bottom==="0px"&&(p.scrollTop=S>0?S:0,u.style.justifyContent="flex-end")}}}a.current=p.scrollTop})})})]})});Vy.displayName=jc;var Ky="SelectGroup",[kA,RA]=rs(Ky),PA=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=st();return x.jsx(kA,{scope:r,id:s,children:x.jsx(ct.div,{role:"group","aria-labelledby":s,...n,ref:t})})});PA.displayName=Ky;var Gy="SelectLabel",qy=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=RA(Gy,r);return x.jsx(ct.div,{id:s.id,...n,ref:t})});qy.displayName=Gy;var Go="SelectItem",[TA,Xy]=rs(Go),Yy=g.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...l}=e,i=Ir(Go,r),a=Or(Go,r),c=i.value===n,[p,u]=g.useState(o??""),[v,y]=g.useState(!1),w=le(t,d=>{var f;return(f=a.itemRefCallback)==null?void 0:f.call(a,d,n,s)}),_=st(),m=g.useRef("touch"),h=()=>{s||(i.onValueChange(n),i.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return x.jsx(TA,{scope:r,value:n,disabled:s,textId:_,isSelected:c,onItemTextChange:g.useCallback(d=>{u(f=>f||((d==null?void 0:d.textContent)??"").trim())},[]),children:x.jsx(wd.ItemSlot,{scope:r,value:n,disabled:s,textValue:p,children:x.jsx(ct.div,{role:"option","aria-labelledby":_,"data-highlighted":v?"":void 0,"aria-selected":c&&v,"data-state":c?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:w,onFocus:J(l.onFocus,()=>y(!0)),onBlur:J(l.onBlur,()=>y(!1)),onClick:J(l.onClick,()=>{m.current!=="mouse"&&h()}),onPointerUp:J(l.onPointerUp,()=>{m.current==="mouse"&&h()}),onPointerDown:J(l.onPointerDown,d=>{m.current=d.pointerType}),onPointerMove:J(l.onPointerMove,d=>{var f;m.current=d.pointerType,s?(f=a.onItemLeave)==null||f.call(a):m.current==="mouse"&&d.currentTarget.focus({preventScroll:!0})}),onPointerLeave:J(l.onPointerLeave,d=>{var f;d.currentTarget===document.activeElement&&((f=a.onItemLeave)==null||f.call(a))}),onKeyDown:J(l.onKeyDown,d=>{var S;((S=a.searchRef)==null?void 0:S.current)!==""&&d.key===" "||(mA.includes(d.key)&&h(),d.key===" "&&d.preventDefault())})})})})});Yy.displayName=Go;var xs="SelectItemText",Qy=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,l=Ir(xs,r),i=Or(xs,r),a=Xy(xs,r),c=gA(xs,r),[p,u]=g.useState(null),v=le(t,h=>u(h),a.onItemTextChange,h=>{var d;return(d=i.itemTextRefCallback)==null?void 0:d.call(i,h,a.value,a.disabled)}),y=p==null?void 0:p.textContent,w=g.useMemo(()=>x.jsx("option",{value:a.value,disabled:a.disabled,children:y},a.value),[a.disabled,a.value,y]),{onNativeOptionAdd:_,onNativeOptionRemove:m}=c;return Le(()=>(_(w),()=>m(w)),[_,m,w]),x.jsxs(x.Fragment,{children:[x.jsx(ct.span,{id:a.textId,...o,ref:v}),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?on.createPortal(o.children,l.valueNode):null]})});Qy.displayName=xs;var Jy="SelectItemIndicator",Zy=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Xy(Jy,r).isSelected?x.jsx(ct.span,{"aria-hidden":!0,...n,ref:t}):null});Zy.displayName=Jy;var Bc="SelectScrollUpButton",e0=g.forwardRef((e,t)=>{const r=Or(Bc,e.__scopeSelect),n=Cd(Bc,e.__scopeSelect),[s,o]=g.useState(!1),l=le(t,n.onScrollButtonChange);return Le(()=>{if(r.viewport&&r.isPositioned){let i=function(){const c=a.scrollTop>0;o(c)};const a=r.viewport;return i(),a.addEventListener("scroll",i),()=>a.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),s?x.jsx(r0,{...e,ref:l,onAutoScroll:()=>{const{viewport:i,selectedItem:a}=r;i&&a&&(i.scrollTop=i.scrollTop-a.offsetHeight)}}):null});e0.displayName=Bc;var $c="SelectScrollDownButton",t0=g.forwardRef((e,t)=>{const r=Or($c,e.__scopeSelect),n=Cd($c,e.__scopeSelect),[s,o]=g.useState(!1),l=le(t,n.onScrollButtonChange);return Le(()=>{if(r.viewport&&r.isPositioned){let i=function(){const c=a.scrollHeight-a.clientHeight,p=Math.ceil(a.scrollTop)<c;o(p)};const a=r.viewport;return i(),a.addEventListener("scroll",i),()=>a.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),s?x.jsx(r0,{...e,ref:l,onAutoScroll:()=>{const{viewport:i,selectedItem:a}=r;i&&a&&(i.scrollTop=i.scrollTop+a.offsetHeight)}}):null});t0.displayName=$c;var r0=g.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=Or("SelectScrollButton",r),l=g.useRef(null),i=Da(r),a=g.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return g.useEffect(()=>()=>a(),[a]),Le(()=>{var p;const c=i().find(u=>u.ref.current===document.activeElement);(p=c==null?void 0:c.ref.current)==null||p.scrollIntoView({block:"nearest"})},[i]),x.jsx(ct.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:J(s.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(n,50))}),onPointerMove:J(s.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),l.current===null&&(l.current=window.setInterval(n,50))}),onPointerLeave:J(s.onPointerLeave,()=>{a()})})}),LA="SelectSeparator",n0=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return x.jsx(ct.div,{"aria-hidden":!0,...n,ref:t})});n0.displayName=LA;var Fc="SelectArrow",AA=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=xd(r),o=Ir(Fc,r),l=Or(Fc,r);return o.open&&l.position==="popper"?x.jsx(ka,{...s,...n,ref:t}):null});AA.displayName=Fc;var DA="SelectBubbleInput",MA=g.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const s=g.useRef(null),o=le(n,s),l=Ku(t);return g.useEffect(()=>{const i=s.current;if(!i)return;const a=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&p){const u=new Event("change",{bubbles:!0});p.call(i,t),i.dispatchEvent(u)}},[l,t]),x.jsx(ct.select,{...r,style:{...Ny,...r.style},ref:o,defaultValue:t})});MA.displayName=DA;function s0(e){return e===""||e===void 0}function i0(e){const t=$t(e),r=g.useRef(""),n=g.useRef(0),s=g.useCallback(l=>{const i=r.current+l;t(i),function a(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>a(""),1e3))}(i)},[t]),o=g.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function o0(e,t,r){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let l=NA(e,Math.max(o,0));s.length===1&&(l=l.filter(c=>c!==r));const a=l.find(c=>c.textValue.toLowerCase().startsWith(s.toLowerCase()));return a!==r?a:void 0}function NA(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var a0=jy,IA=$y,OA=Fy,l0=Hy,jA=Vy,c0=qy,u0=Yy,BA=Qy,$A=Zy,d0=e0,h0=t0,f0=n0;const FA=g.forwardRef(({className:e,children:t,...r},n)=>x.jsxs(a0,{ref:n,className:re("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-transparent bg-input px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground/50 data-[placeholder]:font-light focus:outline-none focus:border-ring focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,x.jsx(IA,{asChild:!0,children:x.jsx(Vu,{className:"h-4 w-4 opacity-50"})})]}));FA.displayName=a0.displayName;const p0=g.forwardRef(({className:e,...t},r)=>x.jsx(d0,{ref:r,className:re("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(eb,{className:"h-4 w-4"})}));p0.displayName=d0.displayName;const m0=g.forwardRef(({className:e,...t},r)=>x.jsx(h0,{ref:r,className:re("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(Vu,{className:"h-4 w-4"})}));m0.displayName=h0.displayName;const HA=g.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>x.jsx(OA,{children:x.jsxs(l0,{ref:s,className:re("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[x.jsx(p0,{}),x.jsx(jA,{className:re("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),x.jsx(m0,{})]})}));HA.displayName=l0.displayName;const WA=g.forwardRef(({className:e,...t},r)=>x.jsx(c0,{ref:r,className:re("px-2 py-1.5 text-sm font-semibold",e),...t}));WA.displayName=c0.displayName;const zA=g.forwardRef(({className:e,children:t,...r},n)=>x.jsxs(u0,{ref:n,className:re("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[x.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx($A,{children:x.jsx(Uu,{className:"h-4 w-4"})})}),x.jsx(BA,{children:t})]}));zA.displayName=u0.displayName;const UA=g.forwardRef(({className:e,...t},r)=>x.jsx(f0,{ref:r,className:re("-mx-1 my-1 h-px bg-muted",e),...t}));UA.displayName=f0.displayName;var VA="Separator",Ff="horizontal",KA=["horizontal","vertical"],v0=g.forwardRef((e,t)=>{const{decorative:r,orientation:n=Ff,...s}=e,o=GA(n)?n:Ff,i=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return x.jsx(Ue.div,{"data-orientation":o,...i,...s,ref:t})});v0.displayName=VA;function GA(e){return KA.includes(e)}var g0=v0;const qA=g.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>x.jsx(g0,{ref:s,decorative:r,orientation:t,className:re("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));qA.displayName=g0.displayName;const XA=ed,_0=g.forwardRef(({className:e,...t},r)=>x.jsx(hi,{className:re("fixed inset-0 z-50 bg-black/80 [will-change:opacity] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));_0.displayName=hi.displayName;const YA=zu("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out [will-change:transform,opacity] data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),QA=g.forwardRef(({side:e="right",className:t,children:r,...n},s)=>x.jsxs(XA,{children:[x.jsx(_0,{}),x.jsxs(fi,{ref:s,className:re(YA({side:e}),t),...n,children:[x.jsxs(Og,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[x.jsx(Jv,{className:"h-4 w-4"}),x.jsx("span",{className:"sr-only",children:"Close"})]}),r]})]}));QA.displayName=fi.displayName;const JA=g.forwardRef(({className:e,...t},r)=>x.jsx(_a,{ref:r,className:re("text-lg font-semibold text-foreground",e),...t}));JA.displayName=_a.displayName;const ZA=g.forwardRef(({className:e,...t},r)=>x.jsx(ya,{ref:r,className:re("text-sm text-muted-foreground",e),...t}));ZA.displayName=ya.displayName;function eD(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l),a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,tD(s,...t)]}function tD(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function rD(e){const t=nD(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(iD);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function nD(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=aD(s),i=oD(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sD=Symbol("radix.slottable");function iD(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sD}function oD(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function aD(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var lD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],y0=lD.reduce((e,t)=>{const r=rD(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ma="Switch",[cD]=eD(Ma),[uD,dD]=cD(Ma),S0=g.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:o,required:l,disabled:i,value:a="on",onCheckedChange:c,form:p,...u}=e,[v,y]=g.useState(null),w=le(t,f=>y(f)),_=g.useRef(!1),m=v?p||!!v.closest("form"):!0,[h,d]=li({prop:s,defaultProp:o??!1,onChange:c,caller:Ma});return x.jsxs(uD,{scope:r,checked:h,disabled:i,children:[x.jsx(y0.button,{type:"button",role:"switch","aria-checked":h,"aria-required":l,"data-state":b0(h),"data-disabled":i?"":void 0,disabled:i,value:a,...u,ref:w,onClick:J(e.onClick,f=>{d(S=>!S),m&&(_.current=f.isPropagationStopped(),_.current||f.stopPropagation())})}),m&&x.jsx(C0,{control:v,bubbles:!_.current,name:n,value:a,checked:h,required:l,disabled:i,form:p,style:{transform:"translateX(-100%)"}})]})});S0.displayName=Ma;var w0="SwitchThumb",x0=g.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=dD(w0,r);return x.jsx(y0.span,{"data-state":b0(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});x0.displayName=w0;var hD="SwitchBubbleInput",C0=g.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...s},o)=>{const l=g.useRef(null),i=le(l,o),a=Ku(r),c=Gu(t);return g.useEffect(()=>{const p=l.current;if(!p)return;const u=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(u,"checked").set;if(a!==r&&y){const w=new Event("click",{bubbles:n});y.call(p,r),p.dispatchEvent(w)}},[a,r,n]),x.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:i,style:{...s.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});C0.displayName=hD;function b0(e){return e?"checked":"unchecked"}var E0=S0,fD=x0;const pD=g.forwardRef(({className:e,...t},r)=>x.jsx(E0,{ref:r,className:re("peer inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,children:x.jsx(fD,{className:re("pointer-events-none block h-3 w-3 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0")})}));pD.displayName=E0.displayName;function mD(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Array(12).fill(0);let Hc=1;class vD{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...s}=t,o=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:Hc++,l=this.toasts.find(a=>a.id===o),i=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),l?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...t,id:o,title:n}),{...a,...t,id:o,dismissible:i,title:n}):a):this.addToast({title:n,...s,dismissible:i,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let o=n!==void 0,l;const i=s.then(async c=>{if(l=["resolve",c],Ve.isValidElement(c))o=!1,this.create({id:n,type:"default",message:c});else if(_D(c)&&!c.ok){o=!1;const u=typeof r.error=="function"?await r.error(`HTTP error! status: ${c.status}`):r.error,v=typeof r.description=="function"?await r.description(`HTTP error! status: ${c.status}`):r.description,w=typeof u=="object"&&!Ve.isValidElement(u)?u:{message:u};this.create({id:n,type:"error",description:v,...w})}else if(c instanceof Error){o=!1;const u=typeof r.error=="function"?await r.error(c):r.error,v=typeof r.description=="function"?await r.description(c):r.description,w=typeof u=="object"&&!Ve.isValidElement(u)?u:{message:u};this.create({id:n,type:"error",description:v,...w})}else if(r.success!==void 0){o=!1;const u=typeof r.success=="function"?await r.success(c):r.success,v=typeof r.description=="function"?await r.description(c):r.description,w=typeof u=="object"&&!Ve.isValidElement(u)?u:{message:u};this.create({id:n,type:"success",description:v,...w})}}).catch(async c=>{if(l=["reject",c],r.error!==void 0){o=!1;const p=typeof r.error=="function"?await r.error(c):r.error,u=typeof r.description=="function"?await r.description(c):r.description,y=typeof p=="object"&&!Ve.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:u,...y})}}).finally(()=>{o&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),a=()=>new Promise((c,p)=>i.then(()=>l[0]==="reject"?p(l[1]):c(l[1])).catch(p));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(t,r)=>{const n=(r==null?void 0:r.id)||Hc++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const dt=new vD,gD=(e,t)=>{const r=(t==null?void 0:t.id)||Hc++;return dt.addToast({title:e,...t,id:r}),r},_D=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",yD=gD,SD=()=>dt.toasts,wD=()=>dt.getActiveToasts();Object.assign(yD,{success:dt.success,info:dt.info,warning:dt.warning,error:dt.error,custom:dt.custom,message:dt.message,promise:dt.promise,dismiss:dt.dismiss,loading:dt.loading},{getHistory:SD,getToasts:wD});mD("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function xD(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l),a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,CD(s,...t)]}function CD(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function bD(e){const t=ED(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(RD);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function ED(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=TD(s),i=PD(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kD=Symbol("radix.slottable");function RD(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kD}function PD(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function TD(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var LD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Na=LD.reduce((e,t)=>{const r=bD(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ia="Tabs",[AD]=xD(Ia,[Ra]),k0=Ra(),[DD,bd]=AD(Ia),MD=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:s,defaultValue:o,orientation:l="horizontal",dir:i,activationMode:a="automatic",...c}=e,p=Vg(i),[u,v]=li({prop:n,onChange:s,defaultProp:o??"",caller:Ia});return x.jsx(DD,{scope:r,baseId:st(),value:u,onValueChange:v,orientation:l,dir:p,activationMode:a,children:x.jsx(Na.div,{dir:p,"data-orientation":l,...c,ref:t})})});MD.displayName=Ia;var R0="TabsList",P0=g.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...s}=e,o=bd(R0,r),l=k0(r);return x.jsx(w_,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:n,children:x.jsx(Na.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});P0.displayName=R0;var T0="TabsTrigger",L0=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:s=!1,...o}=e,l=bd(T0,r),i=k0(r),a=M0(l.baseId,n),c=N0(l.baseId,n),p=n===l.value;return x.jsx(x_,{asChild:!0,...i,focusable:!s,active:p,children:x.jsx(Na.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":c,"data-state":p?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:a,...o,ref:t,onMouseDown:J(e.onMouseDown,u=>{!s&&u.button===0&&u.ctrlKey===!1?l.onValueChange(n):u.preventDefault()}),onKeyDown:J(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&l.onValueChange(n)}),onFocus:J(e.onFocus,()=>{const u=l.activationMode!=="manual";!p&&!s&&u&&l.onValueChange(n)})})})});L0.displayName=T0;var A0="TabsContent",D0=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:s,children:o,...l}=e,i=bd(A0,r),a=M0(i.baseId,n),c=N0(i.baseId,n),p=n===i.value,u=g.useRef(p);return g.useEffect(()=>{const v=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(v)},[]),x.jsx(Qe,{present:s||p,children:({present:v})=>x.jsx(Na.div,{"data-state":p?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":a,hidden:!v,id:c,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0},children:v&&o})})});D0.displayName=A0;function M0(e,t){return`${e}-trigger-${t}`}function N0(e,t){return`${e}-content-${t}`}var I0=P0,O0=L0,j0=D0;const ND=g.forwardRef(({className:e,...t},r)=>x.jsx(I0,{ref:r,className:re("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));ND.displayName=I0.displayName;const ID=g.forwardRef(({className:e,...t},r)=>x.jsx(O0,{ref:r,className:re("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary/10 data-[state=active]:text-primary data-[state=active]:shadow-sm",e),...t}));ID.displayName=O0.displayName;const OD=g.forwardRef(({className:e,...t},r)=>x.jsx(j0,{ref:r,className:re("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));OD.displayName=j0.displayName;const jD=g.forwardRef(({className:e,...t},r)=>x.jsx("textarea",{className:re("flex min-h-[60px] w-full rounded-md border border-transparent bg-input px-3 py-2 text-base placeholder:text-muted-foreground/50 placeholder:font-light focus-visible:outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...t}));jD.displayName="Textarea";function BD(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l),a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,$D(s,...t)]}function $D(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function FD(e){const t=HD(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(zD);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function HD(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=VD(s),i=UD(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var B0=Symbol("radix.slottable");function WD(e){const t=({children:r})=>x.jsx(x.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=B0,t}function zD(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===B0}function UD(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function VD(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var KD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],GD=KD.reduce((e,t)=>{const r=FD(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),[Oa]=BD("Tooltip",[Mr]),Ed=Mr(),qD="TooltipProvider",Hf="tooltip.open",[uN,$0]=Oa(qD),F0="Tooltip",[dN,Si]=Oa(F0),Wc="TooltipTrigger",XD=g.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Si(Wc,r),o=$0(Wc,r),l=Ed(r),i=g.useRef(null),a=le(t,i,s.onTriggerChange),c=g.useRef(!1),p=g.useRef(!1),u=g.useCallback(()=>c.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),x.jsx(vi,{asChild:!0,...l,children:x.jsx(GD.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:a,onPointerMove:J(e.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),p.current=!0)}),onPointerLeave:J(e.onPointerLeave,()=>{s.onTriggerLeave(),p.current=!1}),onPointerDown:J(e.onPointerDown,()=>{s.open&&s.onClose(),c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:J(e.onFocus,()=>{c.current||s.onOpen()}),onBlur:J(e.onBlur,s.onClose),onClick:J(e.onClick,s.onClose)})})});XD.displayName=Wc;var kd="TooltipPortal",[YD,QD]=Oa(kd,{forceMount:void 0}),H0=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:s}=e,o=Si(kd,t);return x.jsx(YD,{scope:t,forceMount:r,children:x.jsx(Qe,{present:r||o.open,children:x.jsx(Zn,{asChild:!0,container:s,children:n})})})};H0.displayName=kd;var Gn="TooltipContent",W0=g.forwardRef((e,t)=>{const r=QD(Gn,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,l=Si(Gn,e.__scopeTooltip);return x.jsx(Qe,{present:n||l.open,children:l.disableHoverableContent?x.jsx(z0,{side:s,...o,ref:t}):x.jsx(JD,{side:s,...o,ref:t})})}),JD=g.forwardRef((e,t)=>{const r=Si(Gn,e.__scopeTooltip),n=$0(Gn,e.__scopeTooltip),s=g.useRef(null),o=le(t,s),[l,i]=g.useState(null),{trigger:a,onClose:c}=r,p=s.current,{onPointerInTransitChange:u}=n,v=g.useCallback(()=>{i(null),u(!1)},[u]),y=g.useCallback((w,_)=>{const m=w.currentTarget,h={x:w.clientX,y:w.clientY},d=nM(h,m.getBoundingClientRect()),f=sM(h,d),S=iM(_.getBoundingClientRect()),E=aM([...f,...S]);i(E),u(!0)},[u]);return g.useEffect(()=>()=>v(),[v]),g.useEffect(()=>{if(a&&p){const w=m=>y(m,p),_=m=>y(m,a);return a.addEventListener("pointerleave",w),p.addEventListener("pointerleave",_),()=>{a.removeEventListener("pointerleave",w),p.removeEventListener("pointerleave",_)}}},[a,p,y,v]),g.useEffect(()=>{if(l){const w=_=>{const m=_.target,h={x:_.clientX,y:_.clientY},d=(a==null?void 0:a.contains(m))||(p==null?void 0:p.contains(m)),f=!oM(h,l);d?v():f&&(v(),c())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[a,p,l,c,v]),x.jsx(z0,{...e,ref:o})}),[ZD,eM]=Oa(F0,{isInside:!1}),tM=WD("TooltipContent"),z0=g.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:l,...i}=e,a=Si(Gn,r),c=Ed(r),{onClose:p}=a;return g.useEffect(()=>(document.addEventListener(Hf,p),()=>document.removeEventListener(Hf,p)),[p]),g.useEffect(()=>{if(a.trigger){const u=v=>{const y=v.target;y!=null&&y.contains(a.trigger)&&p()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[a.trigger,p]),x.jsx(Jn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u=>u.preventDefault(),onDismiss:p,children:x.jsxs(Ea,{"data-state":a.stateAttribute,...c,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[x.jsx(tM,{children:n}),x.jsx(ZD,{scope:r,isInside:!0,children:x.jsx(fA,{id:a.contentId,role:"tooltip",children:s||n})})]})})});W0.displayName=Gn;var U0="TooltipArrow",rM=g.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Ed(r);return eM(U0,r).isInside?null:x.jsx(ka,{...s,...n,ref:t})});rM.displayName=U0;function nM(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function sM(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function iM(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function oM(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const i=t[o],a=t[l],c=i.x,p=i.y,u=a.x,v=a.y;p>n!=v>n&&r<(u-c)*(n-p)/(v-p)+c&&(s=!s)}return s}function aM(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),lM(t)}function lM(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const o=t[t.length-1],l=t[t.length-2];if((o.x-l.x)*(s.y-l.y)>=(o.y-l.y)*(s.x-l.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const o=r[r.length-1],l=r[r.length-2];if((o.x-l.x)*(s.y-l.y)>=(o.y-l.y)*(s.x-l.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var cM=H0,V0=W0;const uM=g.forwardRef(({className:e,sideOffset:t=4,...r},n)=>x.jsx(cM,{children:x.jsx(V0,{ref:n,sideOffset:t,className:re("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...r})}));uM.displayName=V0.displayName;function dM({message:e="Loading...",className:t,fullPage:r=!1}){return x.jsxs("div",{className:re("flex flex-col items-center gap-3 text-muted-foreground",r?"fixed inset-0 z-50 justify-center bg-background":"absolute inset-0 justify-center",t),children:[x.jsx(ob,{className:"h-8 w-8 animate-spin text-primary"}),e&&x.jsx("p",{className:"text-sm",children:e})]})}function hM(){const{setTheme:e,resolvedTheme:t}=kC();return x.jsxs(Zv,{variant:"ghost",size:"icon",className:"relative h-8 w-8",onClick:()=>e(t==="dark"?"light":"dark"),children:[x.jsx(bb,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),x.jsx(ub,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),x.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}const fM=()=>x.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x.jsx("path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"}),x.jsx("path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"}),x.jsx("path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"}),x.jsx("path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"})]});function Rd(){return x.jsxs("span",{className:"logo",children:[x.jsx("span",{className:"logo-icon",children:x.jsx(fM,{})}),x.jsx("span",{className:"logo-text",children:"LaunchPod"})]})}const pM=()=>x.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:x.jsx("polyline",{points:"20 6 9 17 4 12"})}),mM=["Automated security scanning","GitHub-native CI/CD integration","Team collaboration built in"];function vM(){return x.jsxs("div",{className:"brand-panel auth-gradient",children:[x.jsx("div",{className:"auth-blob auth-blob--1"}),x.jsx("div",{className:"auth-blob auth-blob--2"}),x.jsx("div",{className:"auth-blob auth-blob--3"}),x.jsx(Rd,{}),x.jsxs("div",{className:"brand-content",children:[x.jsx("h1",{children:"Ship secure software, faster."}),x.jsx("ul",{className:"feature-list",children:mM.map(e=>x.jsxs("li",{children:[x.jsx(pM,{}),x.jsx("span",{children:e})]},e))})]}),x.jsx("p",{className:"brand-footer",children:"Trusted by development teams"})]})}const gM=()=>x.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x.jsx("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),x.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),_M=()=>x.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x.jsx("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),x.jsx("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),x.jsx("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),x.jsx("path",{d:"m2 2 20 20"})]});function yM({onSuccess:e}){const[t,r]=g.useState(""),[n,s]=g.useState(!1),[o,l]=g.useState(""),[i,a]=g.useState(!1),c=async p=>{p.preventDefault(),l(""),a(!0);try{const v=await(await fetch("/api/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t.trim()})})).json();v.success?e():l(v.error||"Invalid token")}catch{l("Connection failed")}finally{a(!1)}};return x.jsxs("div",{className:"auth-layout",children:[x.jsx(vM,{}),x.jsx("div",{className:"form-panel",children:x.jsxs("div",{className:"form-container",children:[x.jsx("div",{className:"mobile-logo",children:x.jsx(Rd,{})}),x.jsxs("div",{className:"form-header",children:[x.jsx("h2",{children:"Connect your pod"}),x.jsx("p",{children:"Enter your MCP runner token to authenticate"})]}),o&&x.jsx("div",{className:"error-box",children:o}),x.jsxs("form",{onSubmit:c,children:[x.jsxs("div",{className:"form-group",children:[x.jsx("label",{htmlFor:"token",children:"MCP Runner Token"}),x.jsxs("div",{className:"input-wrapper",children:[x.jsx("input",{id:"token",className:"input input--with-toggle",type:n?"text":"password",placeholder:"Paste your MCP runner token",required:!0,autoComplete:"off",value:t,onChange:p=>r(p.target.value)}),x.jsx("button",{type:"button",className:"toggle-visibility",onClick:()=>s(!n),tabIndex:-1,children:n?x.jsx(_M,{}):x.jsx(gM,{})})]})]}),x.jsx("button",{type:"submit",className:"btn btn--primary btn--lg",disabled:i,children:i?"Connecting...":"Connect"})]}),x.jsx("p",{className:"help-text",children:"Find your MCP runner token in the LaunchSecure dashboard under Pipeline Settings."})]})})]})}const SM=5,wM=1e3,xM=3e4;function Pd({onMessage:e}){const[t,r]=g.useState("disconnected"),[n,s]=g.useState(null),o=g.useRef(null),l=g.useRef(0),i=g.useRef(null),a=g.useRef(e);a.current=e;const c=g.useCallback(p=>{const u=o.current;u&&u.readyState===WebSocket.OPEN&&u.send(JSON.stringify(p))},[]);return g.useEffect(()=>{let p=!1,u=null;function v(){if(p)return;r("connecting");const w=location.protocol==="https:"?"wss:":"ws:",_=new WebSocket(`${w}//${location.host}/terminal/ws`);o.current=_,_.onopen=()=>{if(p){_.close();return}l.current=0,r("connected"),i.current=setInterval(()=>{_.readyState===WebSocket.OPEN&&_.send(JSON.stringify({type:"ping"}))},xM)},_.onmessage=m=>{if(p)return;const h=JSON.parse(m.data);h.type==="connected"&&s(h.connectionId),a.current(h)},_.onclose=m=>{if(!p&&(y(),r("disconnected"),!m.wasClean&&l.current<SM)){const h=wM*Math.pow(2,l.current);l.current+=1,u=setTimeout(v,h)}},_.onerror=()=>{}}function y(){i.current&&(clearInterval(i.current),i.current=null)}return v(),()=>{var w;p=!0,y(),u&&clearTimeout(u),(w=o.current)==null||w.close(),o.current=null}},[]),{status:t,connectionId:n,send:c}}function CM(){return x.jsxs("header",{className:"sticky top-0 z-40 flex h-[var(--header-height)] items-center border-b bg-background/80 backdrop-blur-md px-4 shadow-sm",children:[x.jsx(Rd,{}),x.jsx("div",{className:"ml-auto flex items-center gap-2",children:x.jsx(hM,{})})]})}const qi="sidebar-nav-item active relative flex items-center gap-3 overflow-hidden rounded-lg px-3 py-1.5 text-sm bg-gradient-to-r from-sidebar-primary/20 via-transparent via-80% to-transparent font-medium text-sidebar-foreground before:absolute before:left-0 before:top-0 before:h-full before:w-[3px] before:rounded-full before:bg-sidebar-primary",vs="sidebar-nav-item relative flex w-full items-center gap-3 overflow-hidden rounded-lg px-3 py-1.5 text-sm font-normal text-sidebar-muted-foreground transition-colors duration-200 hover:text-sidebar-foreground bg-transparent border-none cursor-pointer";function bM({onLogout:e,terminalAvailable:t,activePage:r="dashboard",onNavigate:n}){return x.jsxs("aside",{className:"hidden lg:flex lg:flex-col w-[var(--sidebar-width)] sidebar-gradient",children:[x.jsx("nav",{className:"flex-1 overflow-y-auto px-3 py-4",children:x.jsxs("ul",{className:"space-y-1",children:[x.jsx("li",{children:x.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n("dashboard"),className:r==="dashboard"?qi:vs,children:[x.jsx(sb,{className:"h-4 w-4 shrink-0"}),"Dashboard"]})}),t&&x.jsx("li",{children:x.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n("terminal"),className:r==="terminal"?qi:vs,children:[x.jsx(kb,{className:"h-4 w-4 shrink-0"}),"Terminal"]})}),x.jsx("li",{children:x.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n("settings"),className:r==="settings"?qi:vs,children:[x.jsx(xb,{className:"h-4 w-4 shrink-0"}),"Settings"]})}),x.jsx("li",{children:x.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n("repair"),className:r==="repair"?qi:vs,children:[x.jsx(Lb,{className:"h-4 w-4 shrink-0"}),"Repair"]})})]})}),x.jsx("div",{className:"border-t border-sidebar-border px-3 py-3",children:x.jsxs("button",{type:"button",onClick:e,className:vs,children:[x.jsx(lb,{className:"h-4 w-4 shrink-0"}),"Disconnect"]})})]})}function qo(e){return e.toLowerCase()}function EM(e){const t=new Map;for(const r of e){const n=t.get(r.ph);n?n.push(r):t.set(r.ph,[r])}return t}function K0(e){return e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function kM(e){return e==="script_pod"?"LOCAL":e==="script"?"SCRIPT":"LLM"}function Td({status:e}){return x.jsx("span",{className:`agent-status-dot agent-status-dot--${qo(e)}`})}function RM({agent:e,status:t,selected:r,dim:n,onClick:s}){const o=["pipeline-compact-item",r&&"pipeline-compact-item--selected",n&&"pipeline-compact-item--dim"].filter(Boolean).join(" ");return x.jsxs("button",{type:"button",className:o,onClick:s,children:[x.jsx(Td,{status:t}),x.jsx("span",{className:"pipeline-compact-name",children:e.nm})]})}function Wf({agents:e,agentStatuses:t,selectedId:r,onSelect:n,nextUpIds:s}){const o=EM(e),l=Array.from(o.keys()).sort((i,a)=>i-a);return e.length===0?x.jsx("div",{className:"pipeline-empty-state",children:"None yet"}):x.jsx(x.Fragment,{children:l.map(i=>x.jsxs("div",{className:"pipeline-phase-group",children:[x.jsxs("div",{className:"pipeline-phase-label",children:["Phase ",i]}),o.get(i).map(a=>{var p;const c=t!=null&&t[a.id]?qo(((p=t[a.id])==null?void 0:p.status)??"pending"):"pending";return x.jsx(RM,{agent:a,status:c,selected:r===a.id,dim:s?!s.has(a.id):!1,onClick:()=>n(a.id)},a.id)})]},i))})}function zf({agent:e,status:t,triggeredAt:r,completedAt:n,needsAttention:s,previews:o,onOpenTerminal:l,podProgressState:i,onResolveIntervention:a,interventions:c}){const[p,u]=g.useState(0);let v=i;if(e.rn==="script_pod"&&!v){const h=c==null?void 0:c.find(d=>d.agent_id===e.id&&d.status==="pending");h&&(v={messages:[{text:h.message,level:"info",ts:Date.now()}],templateMatch:null})}const y=e.rn==="script_pod"&&v,w=o&&o.length>0?Math.min(p,o.length-1):0,_=o==null?void 0:o[w],m=e.gr==="per_unit"&&o&&o.length>1;return x.jsxs("div",{className:`pipeline-detail-card pipeline-detail-card--${t}`,children:[x.jsxs("div",{className:"pipeline-detail-left",children:[x.jsxs("div",{className:"pipeline-detail-header",children:[x.jsx(Td,{status:t}),x.jsx("span",{className:"pipeline-detail-name",children:e.nm}),s&&x.jsx("span",{className:"pipeline-attention-dot",title:"Terminal may need input"})]}),x.jsxs("div",{className:"pipeline-detail-meta",children:[x.jsx("span",{className:"pipeline-detail-id",children:e.id}),x.jsx("span",{className:"pipeline-detail-runner",children:kM(e.rn)})]}),x.jsxs("div",{className:"pipeline-detail-badges",children:[x.jsx("span",{className:"agent-badge agent-badge--ia",children:e.ia}),x.jsx("span",{className:"agent-badge agent-badge--gr",children:e.gr==="per_unit"?"per-unit":e.gr})]}),x.jsxs("div",{className:"pipeline-detail-info",children:[x.jsxs("span",{children:["Phase ",e.ph]}),r&&x.jsxs("span",{children:["Started: ",new Date(r).toLocaleTimeString()]}),n&&x.jsxs("span",{children:["Completed: ",new Date(n).toLocaleTimeString()]})]})]}),x.jsxs("div",{className:"pipeline-detail-right",children:[m&&x.jsx("div",{className:"pipeline-unit-tabs",children:o.map((h,d)=>x.jsx("button",{type:"button",className:`pipeline-unit-tab${d===w?" pipeline-unit-tab--active":""}`,onClick:()=>u(d),children:h.unitId||`unit-${d}`},h.sessionId))}),y?x.jsx(TM,{podState:v}):_!=null&&_.text?x.jsx("pre",{className:"pipeline-preview-text",children:_.text}):x.jsx("div",{className:"pipeline-preview-empty",children:"No output yet"}),e.rn==="script_pod"&&a&&(c==null?void 0:c.filter(h=>h.agent_id===e.id&&h.status==="pending").map(h=>{const{runText:d,skipText:f}=G0(h);return x.jsxs("div",{className:"pipeline-intervention-actions",style:{marginTop:"8px"},children:[x.jsx("button",{type:"button",onClick:()=>a(h.id,"continue"),className:"pipeline-intervention-btn pipeline-intervention-btn--run",children:d}),x.jsx("button",{type:"button",onClick:()=>a(h.id,"skip"),className:"pipeline-intervention-btn pipeline-intervention-btn--skip",children:f})]},h.id)})),!y&&(_==null?void 0:_.sessionId)&&l&&x.jsx("button",{type:"button",className:"pipeline-open-terminal-btn",title:"Open terminal",onClick:()=>l(_.sessionId),children:x.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x.jsx("polyline",{points:"4 17 10 11 4 5"}),x.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})})]})]})}function G0(e){if(e.agent_id==="workspace_setup")return{label:"Workspace Setup",runText:"Use Template",skipText:"Custom Build"};switch(e.type.toLowerCase()){case"checkpoint":return{label:"Checkpoint",runText:"Continue",skipText:"Skip"};case"error":return{label:"Error",runText:"Retry",skipText:"Skip"};case"loop_escalation":return{label:"Loop Escalation",runText:"Continue",skipText:"Stop"};default:return{label:"Review Gate",runText:"Run",skipText:"Skip"}}}function PM({intervention:e,onResolve:t}){const[r,n]=g.useState(!1),{label:s,runText:o,skipText:l}=G0(e),i=a=>{n(!0),t(e.id,a)};return x.jsxs("div",{className:"pipeline-intervention-card",children:[x.jsx("div",{className:"pipeline-intervention-label",children:s}),x.jsx("div",{className:"pipeline-intervention-agent",children:K0(e.agent_id)}),e.message&&x.jsx("p",{className:"pipeline-intervention-msg",children:e.message}),x.jsxs("div",{className:"pipeline-intervention-actions",children:[x.jsx("button",{type:"button",disabled:r,onClick:()=>i("continue"),className:"pipeline-intervention-btn pipeline-intervention-btn--run",children:r?"...":o}),x.jsx("button",{type:"button",disabled:r,onClick:()=>i("skip"),className:"pipeline-intervention-btn pipeline-intervention-btn--skip",children:r?"...":l})]})]})}function TM({podState:e}){const{messages:t}=e;return x.jsx("div",{className:"pod-progress-panel",children:x.jsx("div",{className:"pod-progress-log",children:t.map((r,n)=>x.jsx("div",{className:`pod-progress-entry pod-progress-entry--${r.level}`,children:r.text},n))})})}function LM({agentId:e,agentName:t,error:r}){const[n,s]=g.useState(!1);return x.jsxs("div",{className:"pipeline-detail-card pipeline-detail-card--failed",children:[x.jsxs("div",{className:"pipeline-detail-left",children:[x.jsxs("div",{className:"pipeline-detail-header",children:[x.jsx(Td,{status:"failed"}),x.jsx("span",{className:"pipeline-detail-name",children:t??K0(e)})]}),x.jsx("div",{className:"pipeline-detail-meta",children:x.jsx("span",{className:"pipeline-detail-id",children:e})}),x.jsx("div",{style:{marginTop:"0.5rem"},children:x.jsx("span",{className:"text-red-400 text-xs font-medium",children:"Node failed to start"})}),x.jsx("button",{type:"button",onClick:()=>s(!n),className:"inline-flex items-center gap-1 mt-2 px-2 py-1 rounded text-xs bg-zinc-700 hover:bg-zinc-600 text-zinc-200 transition-colors",children:n?"Hide Log":"Show Log"})]}),x.jsx("div",{className:"pipeline-detail-right",children:n?x.jsx("pre",{className:"pipeline-preview-text",style:{color:"var(--color-red-300, #fca5a5)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:r}):x.jsx("div",{className:"pipeline-preview-empty",children:'Click "Show Log" for details'})})]})}function AM({data:e,agentStatuses:t,interventions:r,onResolveIntervention:n,stalled:s,onPoke:o,attentionAgentIds:l,sessionPreviews:i,onOpenTerminal:a,podProgressStates:c,runStatus:p,nodeErrors:u}){const[v,y]=g.useState(null),w=T=>y(M=>M===T?null:T),_=e.ag??[],m=new Map(_.map(T=>[T.id,T])),h=[],d=[],f=[];for(const T of _){const M=t==null?void 0:t[T.id],j=M?qo(M.status):"pending";j==="completed"||j==="failed"?h.push(T):j==="in_progress"?d.push(T):f.push(T)}const S=new Set;if(f.length>0){const T=Math.min(...f.map(M=>M.ph));for(const M of f)M.ph===T&&S.add(M.id)}const E=new Set(_.filter(T=>T.rn==="script_pod").map(T=>T.id)),k=(r??[]).filter(T=>T.status==="pending"&&!E.has(T.agent_id)),b=v?m.get(v):null,C=v?t==null?void 0:t[v]:null,P=C?qo(C.status):"pending";return x.jsxs("div",{className:"pipeline-dashboard",children:[x.jsxs("div",{className:"pipeline-col pipeline-col--left",children:[x.jsx("div",{className:"pipeline-col-header",children:"Completed"}),x.jsx("div",{className:"pipeline-col-body",children:x.jsx(Wf,{agents:h,agentStatuses:t,selectedId:v,onSelect:w})})]}),x.jsxs("div",{className:"pipeline-col pipeline-col--center",children:[x.jsx("div",{className:"pipeline-col-header",children:"Active"}),x.jsxs("div",{className:"pipeline-col-body",children:[n&&k.map(T=>x.jsx(PM,{intervention:T,onResolve:n},T.id)),b&&!d.some(T=>T.id===v)&&x.jsx(zf,{agent:b,status:P,triggeredAt:C==null?void 0:C.triggered_at,completedAt:C==null?void 0:C.completed_at,needsAttention:l==null?void 0:l.has(b.id),previews:i==null?void 0:i[b.id],onOpenTerminal:a,podProgressState:c==null?void 0:c[b.id],onResolveIntervention:n,interventions:r}),d.map(T=>{const M=t==null?void 0:t[T.id];return x.jsx(zf,{agent:T,status:"in_progress",triggeredAt:M==null?void 0:M.triggered_at,completedAt:M==null?void 0:M.completed_at,needsAttention:l==null?void 0:l.has(T.id),previews:i==null?void 0:i[T.id],onOpenTerminal:a,podProgressState:c==null?void 0:c[T.id],onResolveIntervention:n,interventions:r},T.id)}),u&&Object.entries(u).map(([T,M])=>{const j=m.get(T);return x.jsx(LM,{agentId:T,agentName:j==null?void 0:j.nm,error:M},`err-${T}`)}),!b&&d.length===0&&k.length===0&&Object.keys(u??{}).length===0&&(p==="completed"?x.jsxs("div",{className:"pipeline-empty-state pipeline-empty-state--completed",children:[x.jsx("span",{className:"agent-status-dot agent-status-dot--completed"}),x.jsx("span",{children:"Pipeline Complete"})]}):p==="paused"?x.jsxs("div",{className:"pipeline-empty-state",children:[x.jsx("span",{className:"agent-status-dot agent-status-dot--pending"}),x.jsx("span",{children:"Pipeline Paused"})]}):x.jsxs("div",{className:"pipeline-empty-state",children:[x.jsx("span",{className:"agent-status-dot agent-status-dot--in_progress"}),x.jsx("span",{children:"Waiting for next node..."})]}))]})]}),x.jsxs("div",{className:"pipeline-col pipeline-col--right",children:[x.jsx("div",{className:"pipeline-col-header",children:"Upcoming"}),x.jsx("div",{className:"pipeline-col-body",children:x.jsx(Wf,{agents:f,agentStatuses:t,selectedId:v,onSelect:w,nextUpIds:S})})]})]})}let Uf=!1,Xi=null;function DM({send:e,xtermRef:t,defaultAgent:r,autoSessionId:n}){const[s,o]=g.useState(null),[l,i]=g.useState(!1),a=g.useRef(r);a.current=r;const c=g.useRef(n);c.current=n;function p(w){e({type:w==="claude"?"start_claude":w==="codex"?"start_codex":"start_agent"})}const u=g.useCallback((w,_)=>{e({type:w==="claude"?"start_claude":w==="codex"?"start_codex":"start_agent",options:_})},[e]),v=g.useCallback(()=>{e({type:"stop"})},[e]),y=g.useCallback(w=>{var _,m,h;switch(w.type){case"connected":{if(Uf)break;Uf=!0;const d=c.current;if(d){o(d),e({type:"join_session",sessionId:d});break}Xi==null||Xi.abort();const f=new AbortController;Xi=f,fetch("/terminal/api/sessions/list",{signal:f.signal}).then(S=>S.json()).then(S=>{const E=S.sessions??[];if(E.length>0){const k=E[0];o(k.id),i(k.active),e({type:"join_session",sessionId:k.id}),!k.active&&a.current&&setTimeout(()=>p(a.current),100)}else e({type:"create_session",name:"Session 1"})}).catch(()=>{f.signal.aborted||e({type:"create_session",name:"Session 1"})});break}case"session_created":{o(w.sessionId),i(!1);const d=a.current;d&&p(d);break}case"session_joined":{if(o(w.sessionId),i(w.active),(_=t.current)==null||_.clear(),(m=w.outputBuffer)!=null&&m.length)for(const d of w.outputBuffer)(h=t.current)==null||h.write(d.replace(/\x1b\[\[?[IO]/g,""));break}case"session_left":case"session_deleted":break;case"claude_started":case"codex_started":case"agent_started":i(!0);break;case"claude_stopped":case"codex_stopped":case"agent_stopped":i(!1);break;case"exit":i(!1);break}},[e,t]);return{sessionId:s,agentRunning:l,handleMessage:y,startAgent:u,stopAgent:v}}const Vf=1e4,MM=["Plan mode is active","you MUST NOT make any edits","present your plan by calling the ExitPlanMode tool","Starting plan mode"],NM=["User has approved your plan","You can now start coding","Plan mode exited","Exiting plan mode"],IM=[/## Implementation Plan:/,/### \d+\. /,/## Plan:/,/### Plan Overview/,/## Proposed Solution:/];function Kf(e){return e.replace(/\x1b\[[0-9;]*m/g,"").replace(/\x1b\[[0-9]*[A-Za-z]/g,"")}function q0(){const[e,t]=g.useState(null),[r,n]=g.useState(!1),s=g.useRef([]),o=g.useRef(!1),l=g.useCallback((p=5e4)=>{const u=s.current.join("");return Kf(u).slice(-p)},[]),i=g.useCallback(p=>{let u=null;const v=p.match(/## Implementation Plan:[\s\S]*?(?=(?:User has approved|Exit plan mode|[$>]|^[a-z]+@))/im);if(v&&(u=v[0]),!u){const y=p.match(/##[^#].*?Plan.*?:[\s\S]*?(?:###.*?[\s\S]*?){2,}(?=(?:User has approved|Exit plan mode|[$>]|^[a-z]+@))/im);y&&(u=y[0])}if(!u){const w=p.slice(-5e3).match(/(?:##|Plan:)[\s\S]*?(?:###[\s\S]*?){1,}/);w&&(u=w[0])}return u?(u=Kf(u).replace(/\r\n/g,`
270
- `).replace(/\r/g,`
271
- `).trim(),{content:u,timestamp:Date.now()}):null},[]),a=g.useCallback(p=>{s.current.push(p),s.current.length>Vf&&(s.current=s.current.slice(-Vf/2));const u=l();if(o.current||MM.some(y=>u.includes(y))&&(o.current=!0,n(!0)),o.current){const v=IM.some(w=>w.test(u)),y=u.slice(-1e4);if(v&&y.includes("###")){const w=i(u);w&&t(w)}}o.current&&NM.some(y=>u.includes(y))&&(o.current=!1,n(!1),t(null))},[l,i]),c=g.useCallback(()=>{t(null),s.current=[],o.current=!1,n(!1)},[]);return{plan:e,planModeActive:r,processOutput:a,clearPlan:c}}const X0="launchpod-settings",Tl={defaultAgent:"claude"};function Y0(){try{const e=localStorage.getItem(X0);return e?{...Tl,...JSON.parse(e)}:Tl}catch{return Tl}}function OM(e){localStorage.setItem(X0,JSON.stringify(e));try{const t=JSON.parse(localStorage.getItem("launchpod-terminal-settings")||"{}");t.defaultAgent=e.defaultAgent,localStorage.setItem("launchpod-terminal-settings",JSON.stringify(t))}catch{}}function jM(){const[e,t]=g.useState(Y0),[r,n]=g.useState(!1),s=()=>{OM(e),n(!0),setTimeout(()=>n(!1),2e3)};return x.jsxs("div",{className:"max-w-xl mx-auto py-10 px-6",children:[x.jsx("h1",{className:"text-xl font-semibold text-foreground mb-6",children:"Settings"}),x.jsxs("div",{className:"space-y-6",children:[x.jsxs("div",{className:"space-y-2",children:[x.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Default Agent"}),x.jsx("p",{className:"text-xs text-muted-foreground",children:"Which agent to show in the start prompt when opening the terminal."}),x.jsxs("select",{value:e.defaultAgent,onChange:o=>t({...e,defaultAgent:o.target.value}),className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring",children:[x.jsx("option",{value:"claude",children:"Claude"}),x.jsx("option",{value:"codex",children:"Codex"}),x.jsx("option",{value:"agent",children:"Cursor"})]})]}),x.jsx("button",{onClick:s,className:"rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors",children:r?"Saved":"Save Settings"})]})]})}var Q0={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(globalThis,()=>(()=>{var r={4567:function(l,i,a){var c=this&&this.__decorate||function(d,f,S,E){var k,b=arguments.length,C=b<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(d,f,S,E);else for(var P=d.length-1;P>=0;P--)(k=d[P])&&(C=(b<3?k(C):b>3?k(f,S,C):k(f,S))||C);return b>3&&C&&Object.defineProperty(f,S,C),C},p=this&&this.__param||function(d,f){return function(S,E){f(S,E,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.AccessibilityManager=void 0;const u=a(9042),v=a(9924),y=a(844),w=a(4725),_=a(2585),m=a(3656);let h=i.AccessibilityManager=class extends y.Disposable{constructor(d,f,S,E){super(),this._terminal=d,this._coreBrowserService=S,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let k=0;k<this._terminal.rows;k++)this._rowElements[k]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[k]);if(this._topBoundaryFocusListener=k=>this._handleBoundaryFocus(k,0),this._bottomBoundaryFocusListener=k=>this._handleBoundaryFocus(k,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new v.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(k=>this._handleResize(k.rows))),this.register(this._terminal.onRender(k=>this._refreshRows(k.start,k.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(k=>this._handleChar(k))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
272
- `))),this.register(this._terminal.onA11yTab(k=>this._handleTab(k))),this.register(this._terminal.onKey(k=>this._handleKey(k.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,m.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,y.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(d){for(let f=0;f<d;f++)this._handleChar(" ")}_handleChar(d){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==d&&(this._charsToAnnounce+=d):this._charsToAnnounce+=d,d===`
273
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(d){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(d)||this._charsToConsume.push(d)}_refreshRows(d,f){this._liveRegionDebouncer.refresh(d,f,this._terminal.rows)}_renderRows(d,f){const S=this._terminal.buffer,E=S.lines.length.toString();for(let k=d;k<=f;k++){const b=S.lines.get(S.ydisp+k),C=[],P=(b==null?void 0:b.translateToString(!0,void 0,void 0,C))||"",T=(S.ydisp+k+1).toString(),M=this._rowElements[k];M&&(P.length===0?(M.innerText=" ",this._rowColumns.set(M,[0,1])):(M.textContent=P,this._rowColumns.set(M,C)),M.setAttribute("aria-posinset",T),M.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(d,f){const S=d.target,E=this._rowElements[f===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(f===0?"1":`${this._terminal.buffer.lines.length}`)||d.relatedTarget!==E)return;let k,b;if(f===0?(k=S,b=this._rowElements.pop(),this._rowContainer.removeChild(b)):(k=this._rowElements.shift(),b=S,this._rowContainer.removeChild(k)),k.removeEventListener("focus",this._topBoundaryFocusListener),b.removeEventListener("focus",this._bottomBoundaryFocusListener),f===0){const C=this._createAccessibilityTreeNode();this._rowElements.unshift(C),this._rowContainer.insertAdjacentElement("afterbegin",C)}else{const C=this._createAccessibilityTreeNode();this._rowElements.push(C),this._rowContainer.appendChild(C)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(f===0?-1:1),this._rowElements[f===0?1:this._rowElements.length-2].focus(),d.preventDefault(),d.stopImmediatePropagation()}_handleSelectionChange(){var P;if(this._rowElements.length===0)return;const d=document.getSelection();if(!d)return;if(d.isCollapsed)return void(this._rowContainer.contains(d.anchorNode)&&this._terminal.clearSelection());if(!d.anchorNode||!d.focusNode)return void console.error("anchorNode and/or focusNode are null");let f={node:d.anchorNode,offset:d.anchorOffset},S={node:d.focusNode,offset:d.focusOffset};if((f.node.compareDocumentPosition(S.node)&Node.DOCUMENT_POSITION_PRECEDING||f.node===S.node&&f.offset>S.offset)&&([f,S]=[S,f]),f.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(f={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(f.node))return;const E=this._rowElements.slice(-1)[0];if(S.node.compareDocumentPosition(E)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(S={node:E,offset:((P=E.textContent)==null?void 0:P.length)??0}),!this._rowContainer.contains(S.node))return;const k=({node:T,offset:M})=>{const j=T instanceof Text?T.parentNode:T;let N=parseInt(j==null?void 0:j.getAttribute("aria-posinset"),10)-1;if(isNaN(N))return console.warn("row is invalid. Race condition?"),null;const $=this._rowColumns.get(j);if(!$)return console.warn("columns is null. Race condition?"),null;let V=M<$.length?$[M]:$.slice(-1)[0]+1;return V>=this._terminal.cols&&(++N,V=0),{row:N,column:V}},b=k(f),C=k(S);if(b&&C){if(b.row>C.row||b.row===C.row&&b.column>=C.column)throw new Error("invalid range");this._terminal.select(b.column,b.row,(C.row-b.row)*this._terminal.cols-b.column+C.column)}}_handleResize(d){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let f=this._rowContainer.children.length;f<this._terminal.rows;f++)this._rowElements[f]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[f]);for(;this._rowElements.length>d;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const d=this._coreBrowserService.mainDocument.createElement("div");return d.setAttribute("role","listitem"),d.tabIndex=-1,this._refreshRowDimensions(d),d}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let d=0;d<this._terminal.rows;d++)this._refreshRowDimensions(this._rowElements[d])}}_refreshRowDimensions(d){d.style.height=`${this._renderService.dimensions.css.cell.height}px`}};i.AccessibilityManager=h=c([p(1,_.IInstantiationService),p(2,w.ICoreBrowserService),p(3,w.IRenderService)],h)},3614:(l,i)=>{function a(v){return v.replace(/\r?\n/g,"\r")}function c(v,y){return y?"\x1B[200~"+v+"\x1B[201~":v}function p(v,y,w,_){v=c(v=a(v),w.decPrivateModes.bracketedPasteMode&&_.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(v,!0),y.value=""}function u(v,y,w){const _=w.getBoundingClientRect(),m=v.clientX-_.left-10,h=v.clientY-_.top-10;y.style.width="20px",y.style.height="20px",y.style.left=`${m}px`,y.style.top=`${h}px`,y.style.zIndex="1000",y.focus()}Object.defineProperty(i,"__esModule",{value:!0}),i.rightClickHandler=i.moveTextAreaUnderMouseCursor=i.paste=i.handlePasteEvent=i.copyHandler=i.bracketTextForPaste=i.prepareTextForTerminal=void 0,i.prepareTextForTerminal=a,i.bracketTextForPaste=c,i.copyHandler=function(v,y){v.clipboardData&&v.clipboardData.setData("text/plain",y.selectionText),v.preventDefault()},i.handlePasteEvent=function(v,y,w,_){v.stopPropagation(),v.clipboardData&&p(v.clipboardData.getData("text/plain"),y,w,_)},i.paste=p,i.moveTextAreaUnderMouseCursor=u,i.rightClickHandler=function(v,y,w,_,m){u(v,y,w),m&&_.rightClickSelect(v),y.value=_.selectionText,y.select()}},7239:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorContrastCache=void 0;const c=a(1505);i.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(p,u,v){this._css.set(p,u,v)}getCss(p,u){return this._css.get(p,u)}setColor(p,u,v){this._color.set(p,u,v)}getColor(p,u){return this._color.get(p,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addDisposableDomListener=void 0,i.addDisposableDomListener=function(a,c,p,u){a.addEventListener(c,p,u);let v=!1;return{dispose:()=>{v||(v=!0,a.removeEventListener(c,p,u))}}}},3551:function(l,i,a){var c=this&&this.__decorate||function(h,d,f,S){var E,k=arguments.length,b=k<3?d:S===null?S=Object.getOwnPropertyDescriptor(d,f):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(h,d,f,S);else for(var C=h.length-1;C>=0;C--)(E=h[C])&&(b=(k<3?E(b):k>3?E(d,f,b):E(d,f))||b);return k>3&&b&&Object.defineProperty(d,f,b),b},p=this&&this.__param||function(h,d){return function(f,S){d(f,S,h)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Linkifier=void 0;const u=a(3656),v=a(8460),y=a(844),w=a(2585),_=a(4725);let m=i.Linkifier=class extends y.Disposable{get currentLink(){return this._currentLink}constructor(h,d,f,S,E){super(),this._element=h,this._mouseService=d,this._renderService=f,this._bufferService=S,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new v.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new v.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,y.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,y.toDisposable)(()=>{var k;this._lastMouseEvent=void 0,(k=this._activeProviderReplies)==null||k.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(h){this._lastMouseEvent=h;const d=this._positionFromMouseEvent(h,this._element,this._mouseService);if(!d)return;this._isMouseOut=!1;const f=h.composedPath();for(let S=0;S<f.length;S++){const E=f[S];if(E.classList.contains("xterm"))break;if(E.classList.contains("xterm-hover"))return}this._lastBufferCell&&d.x===this._lastBufferCell.x&&d.y===this._lastBufferCell.y||(this._handleHover(d),this._lastBufferCell=d)}_handleHover(h){if(this._activeLine!==h.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(h,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,h)||(this._clearCurrentLink(),this._askForLink(h,!0))}_askForLink(h,d){var S,E;this._activeProviderReplies&&d||((S=this._activeProviderReplies)==null||S.forEach(k=>{k==null||k.forEach(b=>{b.link.dispose&&b.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=h.y);let f=!1;for(const[k,b]of this._linkProviderService.linkProviders.entries())d?(E=this._activeProviderReplies)!=null&&E.get(k)&&(f=this._checkLinkProviderResult(k,h,f)):b.provideLinks(h.y,C=>{var T,M;if(this._isMouseOut)return;const P=C==null?void 0:C.map(j=>({link:j}));(T=this._activeProviderReplies)==null||T.set(k,P),f=this._checkLinkProviderResult(k,h,f),((M=this._activeProviderReplies)==null?void 0:M.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(h.y,this._activeProviderReplies)})}_removeIntersectingLinks(h,d){const f=new Set;for(let S=0;S<d.size;S++){const E=d.get(S);if(E)for(let k=0;k<E.length;k++){const b=E[k],C=b.link.range.start.y<h?0:b.link.range.start.x,P=b.link.range.end.y>h?this._bufferService.cols:b.link.range.end.x;for(let T=C;T<=P;T++){if(f.has(T)){E.splice(k--,1);break}f.add(T)}}}}_checkLinkProviderResult(h,d,f){var k;if(!this._activeProviderReplies)return f;const S=this._activeProviderReplies.get(h);let E=!1;for(let b=0;b<h;b++)this._activeProviderReplies.has(b)&&!this._activeProviderReplies.get(b)||(E=!0);if(!E&&S){const b=S.find(C=>this._linkAtPosition(C.link,d));b&&(f=!0,this._handleNewLink(b))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!f)for(let b=0;b<this._activeProviderReplies.size;b++){const C=(k=this._activeProviderReplies.get(b))==null?void 0:k.find(P=>this._linkAtPosition(P.link,d));if(C){f=!0,this._handleNewLink(C);break}}return f}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(h){if(!this._currentLink)return;const d=this._positionFromMouseEvent(h,this._element,this._mouseService);d&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,d)&&this._currentLink.link.activate(h,this._currentLink.link.text)}_clearCurrentLink(h,d){this._currentLink&&this._lastMouseEvent&&(!h||!d||this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=d)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,y.disposeArray)(this._linkCacheDisposables))}_handleNewLink(h){if(!this._lastMouseEvent)return;const d=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);d&&this._linkAtPosition(h.link,d)&&(this._currentLink=h,this._currentLink.state={decorations:{underline:h.link.decorations===void 0||h.link.decorations.underline,pointerCursor:h.link.decorations===void 0||h.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,h.link,this._lastMouseEvent),h.link.decorations={},Object.defineProperties(h.link.decorations,{pointerCursor:{get:()=>{var f,S;return(S=(f=this._currentLink)==null?void 0:f.state)==null?void 0:S.decorations.pointerCursor},set:f=>{var S;(S=this._currentLink)!=null&&S.state&&this._currentLink.state.decorations.pointerCursor!==f&&(this._currentLink.state.decorations.pointerCursor=f,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",f))}},underline:{get:()=>{var f,S;return(S=(f=this._currentLink)==null?void 0:f.state)==null?void 0:S.decorations.underline},set:f=>{var S,E,k;(S=this._currentLink)!=null&&S.state&&((k=(E=this._currentLink)==null?void 0:E.state)==null?void 0:k.decorations.underline)!==f&&(this._currentLink.state.decorations.underline=f,this._currentLink.state.isHovered&&this._fireUnderlineEvent(h.link,f))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(f=>{if(!this._currentLink)return;const S=f.start===0?0:f.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+f.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(S,E),this._lastMouseEvent)){const k=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);k&&this._askForLink(k,!1)}})))}_linkHover(h,d,f){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!0),this._currentLink.state.decorations.pointerCursor&&h.classList.add("xterm-cursor-pointer")),d.hover&&d.hover(f,d.text)}_fireUnderlineEvent(h,d){const f=h.range,S=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(f.start.x-1,f.start.y-S-1,f.end.x,f.end.y-S-1,void 0);(d?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(h,d,f){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!1),this._currentLink.state.decorations.pointerCursor&&h.classList.remove("xterm-cursor-pointer")),d.leave&&d.leave(f,d.text)}_linkAtPosition(h,d){const f=h.range.start.y*this._bufferService.cols+h.range.start.x,S=h.range.end.y*this._bufferService.cols+h.range.end.x,E=d.y*this._bufferService.cols+d.x;return f<=E&&E<=S}_positionFromMouseEvent(h,d,f){const S=f.getCoords(h,d,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(h,d,f,S,E){return{x1:h,y1:d,x2:f,y2:S,cols:this._bufferService.cols,fg:E}}};i.Linkifier=m=c([p(1,_.IMouseService),p(2,_.IRenderService),p(3,w.IBufferService),p(4,_.ILinkProviderService)],m)},9042:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.tooMuchOutput=i.promptLabel=void 0,i.promptLabel="Terminal input",i.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(l,i,a){var c=this&&this.__decorate||function(_,m,h,d){var f,S=arguments.length,E=S<3?m:d===null?d=Object.getOwnPropertyDescriptor(m,h):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(_,m,h,d);else for(var k=_.length-1;k>=0;k--)(f=_[k])&&(E=(S<3?f(E):S>3?f(m,h,E):f(m,h))||E);return S>3&&E&&Object.defineProperty(m,h,E),E},p=this&&this.__param||function(_,m){return function(h,d){m(h,d,_)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkProvider=void 0;const u=a(511),v=a(2585);let y=i.OscLinkProvider=class{constructor(_,m,h){this._bufferService=_,this._optionsService=m,this._oscLinkService=h}provideLinks(_,m){var P;const h=this._bufferService.buffer.lines.get(_-1);if(!h)return void m(void 0);const d=[],f=this._optionsService.rawOptions.linkHandler,S=new u.CellData,E=h.getTrimmedLength();let k=-1,b=-1,C=!1;for(let T=0;T<E;T++)if(b!==-1||h.hasContent(T)){if(h.loadCell(T,S),S.hasExtendedAttrs()&&S.extended.urlId){if(b===-1){b=T,k=S.extended.urlId;continue}C=S.extended.urlId!==k}else b!==-1&&(C=!0);if(C||b!==-1&&T===E-1){const M=(P=this._oscLinkService.getLinkData(k))==null?void 0:P.uri;if(M){const j={start:{x:b+1,y:_},end:{x:T+(C||T!==E-1?0:1),y:_}};let N=!1;if(!(f!=null&&f.allowNonHttpProtocols))try{const $=new URL(M);["http:","https:"].includes($.protocol)||(N=!0)}catch{N=!0}N||d.push({text:M,range:j,activate:($,V)=>f?f.activate($,V,j):w(0,V),hover:($,V)=>{var K;return(K=f==null?void 0:f.hover)==null?void 0:K.call(f,$,V,j)},leave:($,V)=>{var K;return(K=f==null?void 0:f.leave)==null?void 0:K.call(f,$,V,j)}})}C=!1,S.hasExtendedAttrs()&&S.extended.urlId?(b=T,k=S.extended.urlId):(b=-1,k=-1)}}m(d)}};function w(_,m){if(confirm(`Do you want to navigate to ${m}?
274
-
275
- WARNING: This link could potentially be dangerous`)){const h=window.open();if(h){try{h.opener=null}catch{}h.location.href=m}else console.warn("Opening link blocked as opener could not be cleared")}}i.OscLinkProvider=y=c([p(0,v.IBufferService),p(1,v.IOptionsService),p(2,v.IOscLinkService)],y)},6193:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RenderDebouncer=void 0,i.RenderDebouncer=class{constructor(a,c){this._renderCallback=a,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(a,c,p){this._rowCount=p,a=a!==void 0?a:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const a=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},3236:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Terminal=void 0;const c=a(3614),p=a(3656),u=a(3551),v=a(9042),y=a(3730),w=a(1680),_=a(3107),m=a(5744),h=a(2950),d=a(1296),f=a(428),S=a(4269),E=a(5114),k=a(8934),b=a(3230),C=a(9312),P=a(4725),T=a(6731),M=a(8055),j=a(8969),N=a(8460),$=a(844),V=a(6114),K=a(8437),q=a(2584),B=a(7399),R=a(5941),L=a(9074),I=a(2585),D=a(5435),z=a(4567),F=a(779);class U extends j.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(O={}){super(O),this.browser=V,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new $.MutableDisposable),this._onCursorMove=this.register(new N.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new N.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new N.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new N.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new N.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new N.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new N.EventEmitter),this._onBlur=this.register(new N.EventEmitter),this._onA11yCharEmitter=this.register(new N.EventEmitter),this._onA11yTabEmitter=this.register(new N.EventEmitter),this._onWillOpen=this.register(new N.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(I.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(F.LinkProviderService),this._instantiationService.setService(P.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(y.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((A,W)=>this.refresh(A,W))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(A=>this._reportWindowsOptions(A))),this.register(this._inputHandler.onColor(A=>this._handleColorEvent(A))),this.register((0,N.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,N.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,N.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,N.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(A=>this._afterResize(A.cols,A.rows))),this.register((0,$.toDisposable)(()=>{var A,W;this._customKeyEventHandler=void 0,(W=(A=this.element)==null?void 0:A.parentNode)==null||W.removeChild(this.element)}))}_handleColorEvent(O){if(this._themeService)for(const A of O){let W,H="";switch(A.index){case 256:W="foreground",H="10";break;case 257:W="background",H="11";break;case 258:W="cursor",H="12";break;default:W="ansi",H="4;"+A.index}switch(A.type){case 0:const Y=M.color.toColorRGB(W==="ansi"?this._themeService.colors.ansi[A.index]:this._themeService.colors[W]);this.coreService.triggerDataEvent(`${q.C0.ESC}]${H};${(0,R.toRgbString)(Y)}${q.C1_ESCAPED.ST}`);break;case 1:if(W==="ansi")this._themeService.modifyColors(X=>X.ansi[A.index]=M.channels.toColor(...A.color));else{const X=W;this._themeService.modifyColors(ne=>ne[X]=M.channels.toColor(...A.color))}break;case 2:this._themeService.restoreColor(A.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(O){O?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(z.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(O){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(q.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var O;return(O=this.textarea)==null?void 0:O.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(q.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const O=this.buffer.ybase+this.buffer.y,A=this.buffer.lines.get(O);if(!A)return;const W=Math.min(this.buffer.x,this.cols-1),H=this._renderService.dimensions.css.cell.height,Y=A.getWidth(W),X=this._renderService.dimensions.css.cell.width*Y,ne=this.buffer.y*this._renderService.dimensions.css.cell.height,ie=W*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ie+"px",this.textarea.style.top=ne+"px",this.textarea.style.width=X+"px",this.textarea.style.height=H+"px",this.textarea.style.lineHeight=H+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",A=>{this.hasSelection()&&(0,c.copyHandler)(A,this._selectionService)}));const O=A=>(0,c.handlePasteEvent)(A,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",O)),this.register((0,p.addDisposableDomListener)(this.element,"paste",O)),V.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",A=>{A.button===2&&(0,c.rightClickHandler)(A,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",A=>{(0,c.rightClickHandler)(A,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),V.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",A=>{A.button===1&&(0,c.moveTextAreaUnderMouseCursor)(A,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",O=>this._keyUp(O),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",O=>this._keyDown(O),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",O=>this._keyPress(O),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",O=>this._compositionHelper.compositionupdate(O))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,p.addDisposableDomListener)(this.textarea,"input",O=>this._inputEvent(O),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(O){var W;if(!O)throw new Error("Terminal requires a parent element.");if(O.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((W=this.element)==null?void 0:W.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=O.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"),O.appendChild(this.element);const A=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),A.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,p.addDisposableDomListener)(this.screenElement,"mousemove",H=>this.updateCursorStyle(H))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),A.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel),V.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(E.CoreBrowserService,this.textarea,O.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(P.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",H=>this._handleTextAreaFocus(H))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(f.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(P.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(P.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(P.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(b.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(P.IRenderService,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(h.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(k.MouseService),this._instantiationService.setService(P.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(u.Linkifier,this.screenElement)),this.element.appendChild(A);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(H=>this.scrollLines(H.amount,H.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(C.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(P.ISelectionService,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(this._onScroll.event(H=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(_.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(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(z.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",H=>this._handleScreenReaderModeOptionChange(H))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",H=>{!this._overviewRulerRenderer&&H&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(d.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const O=this,A=this.element;function W(X){const ne=O._mouseService.getMouseReportCoords(X,O.screenElement);if(!ne)return!1;let ie,de;switch(X.overrideType||X.type){case"mousemove":de=32,X.buttons===void 0?(ie=3,X.button!==void 0&&(ie=X.button<3?X.button:3)):ie=1&X.buttons?0:4&X.buttons?1:2&X.buttons?2:3;break;case"mouseup":de=0,ie=X.button<3?X.button:3;break;case"mousedown":de=1,ie=X.button<3?X.button:3;break;case"wheel":if(O._customWheelEventHandler&&O._customWheelEventHandler(X)===!1||O.viewport.getLinesScrolled(X)===0)return!1;de=X.deltaY<0?0:1,ie=4;break;default:return!1}return!(de===void 0||ie===void 0||ie>4)&&O.coreMouseService.triggerMouseEvent({col:ne.col,row:ne.row,x:ne.x,y:ne.y,button:ie,action:de,ctrl:X.ctrlKey,alt:X.altKey,shift:X.shiftKey})}const H={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Y={mouseup:X=>(W(X),X.buttons||(this._document.removeEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.removeEventListener("mousemove",H.mousedrag)),this.cancel(X)),wheel:X=>(W(X),this.cancel(X,!0)),mousedrag:X=>{X.buttons&&W(X)},mousemove:X=>{X.buttons||W(X)}};this.register(this.coreMouseService.onProtocolChange(X=>{X?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(X)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&X?H.mousemove||(A.addEventListener("mousemove",Y.mousemove),H.mousemove=Y.mousemove):(A.removeEventListener("mousemove",H.mousemove),H.mousemove=null),16&X?H.wheel||(A.addEventListener("wheel",Y.wheel,{passive:!1}),H.wheel=Y.wheel):(A.removeEventListener("wheel",H.wheel),H.wheel=null),2&X?H.mouseup||(H.mouseup=Y.mouseup):(this._document.removeEventListener("mouseup",H.mouseup),H.mouseup=null),4&X?H.mousedrag||(H.mousedrag=Y.mousedrag):(this._document.removeEventListener("mousemove",H.mousedrag),H.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(A,"mousedown",X=>{if(X.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(X))return W(X),H.mouseup&&this._document.addEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.addEventListener("mousemove",H.mousedrag),this.cancel(X)})),this.register((0,p.addDisposableDomListener)(A,"wheel",X=>{if(!H.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(X)===!1)return!1;if(!this.buffer.hasScrollback){const ne=this.viewport.getLinesScrolled(X);if(ne===0)return;const ie=q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(X.deltaY<0?"A":"B");let de="";for(let be=0;be<Math.abs(ne);be++)de+=ie;return this.coreService.triggerDataEvent(de,!0),this.cancel(X,!0)}return this.viewport.handleWheel(X)?this.cancel(X):void 0}},{passive:!1})),this.register((0,p.addDisposableDomListener)(A,"touchstart",X=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(X),this.cancel(X)},{passive:!0})),this.register((0,p.addDisposableDomListener)(A,"touchmove",X=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(X)?void 0:this.cancel(X)},{passive:!1}))}refresh(O,A){var W;(W=this._renderService)==null||W.refreshRows(O,A)}updateCursorStyle(O){var A;(A=this._selectionService)!=null&&A.shouldColumnSelect(O)?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(O,A,W=0){var H;W===1?(super.scrollLines(O,A,W),this.refresh(0,this.rows-1)):(H=this.viewport)==null||H.scrollLines(O)}paste(O){(0,c.paste)(O,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(O){this._customKeyEventHandler=O}attachCustomWheelEventHandler(O){this._customWheelEventHandler=O}registerLinkProvider(O){return this._linkProviderService.registerLinkProvider(O)}registerCharacterJoiner(O){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const A=this._characterJoinerService.register(O);return this.refresh(0,this.rows-1),A}deregisterCharacterJoiner(O){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(O)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(O){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+O)}registerDecoration(O){return this._decorationService.registerDecoration(O)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(O,A,W){this._selectionService.setSelection(O,A,W)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var O;(O=this._selectionService)==null||O.clearSelection()}selectAll(){var O;(O=this._selectionService)==null||O.selectAll()}selectLines(O,A){var W;(W=this._selectionService)==null||W.selectLines(O,A)}_keyDown(O){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(O)===!1)return!1;const A=this.browser.isMac&&this.options.macOptionIsMeta&&O.altKey;if(!A&&!this._compositionHelper.keydown(O))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;A||O.key!=="Dead"&&O.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const W=(0,B.evaluateKeyboardEvent)(O,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(O),W.type===3||W.type===2){const H=this.rows-1;return this.scrollLines(W.type===2?-H:H),this.cancel(O,!0)}return W.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,O)||(W.cancel&&this.cancel(O,!0),!W.key||!!(O.key&&!O.ctrlKey&&!O.altKey&&!O.metaKey&&O.key.length===1&&O.key.charCodeAt(0)>=65&&O.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(W.key!==q.C0.ETX&&W.key!==q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:W.key,domEvent:O}),this._showCursor(),this.coreService.triggerDataEvent(W.key,!0),!this.optionsService.rawOptions.screenReaderMode||O.altKey||O.ctrlKey?this.cancel(O,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(O,A){const W=O.isMac&&!this.options.macOptionIsMeta&&A.altKey&&!A.ctrlKey&&!A.metaKey||O.isWindows&&A.altKey&&A.ctrlKey&&!A.metaKey||O.isWindows&&A.getModifierState("AltGraph");return A.type==="keypress"?W:W&&(!A.keyCode||A.keyCode>47)}_keyUp(O){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(O)===!1||(function(A){return A.keyCode===16||A.keyCode===17||A.keyCode===18}(O)||this.focus(),this.updateCursorStyle(O),this._keyPressHandled=!1)}_keyPress(O){let A;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(O)===!1)return!1;if(this.cancel(O),O.charCode)A=O.charCode;else if(O.which===null||O.which===void 0)A=O.keyCode;else{if(O.which===0||O.charCode===0)return!1;A=O.which}return!(!A||(O.altKey||O.ctrlKey||O.metaKey)&&!this._isThirdLevelShift(this.browser,O)||(A=String.fromCharCode(A),this._onKey.fire({key:A,domEvent:O}),this._showCursor(),this.coreService.triggerDataEvent(A,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(O){if(O.data&&O.inputType==="insertText"&&(!O.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const A=O.data;return this.coreService.triggerDataEvent(A,!0),this.cancel(O),!0}return!1}resize(O,A){O!==this.cols||A!==this.rows?super.resize(O,A):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(O,A){var W,H;(W=this._charSizeService)==null||W.measure(),(H=this.viewport)==null||H.syncScrollArea(!0)}clear(){var O;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 A=1;A<this.rows;A++)this.buffer.lines.push(this.buffer.getBlankLine(K.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(O=this.viewport)==null||O.reset(),this.refresh(0,this.rows-1)}}reset(){var A,W;this.options.rows=this.rows,this.options.cols=this.cols;const O=this._customKeyEventHandler;this._setup(),super.reset(),(A=this._selectionService)==null||A.reset(),this._decorationService.reset(),(W=this.viewport)==null||W.reset(),this._customKeyEventHandler=O,this.refresh(0,this.rows-1)}clearTextureAtlas(){var O;(O=this._renderService)==null||O.clearTextureAtlas()}_reportFocus(){var O;(O=this.element)!=null&&O.classList.contains("focus")?this.coreService.triggerDataEvent(q.C0.ESC+"[I"):this.coreService.triggerDataEvent(q.C0.ESC+"[O")}_reportWindowsOptions(O){if(this._renderService)switch(O){case D.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const A=this._renderService.dimensions.css.canvas.width.toFixed(0),W=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${q.C0.ESC}[4;${W};${A}t`);break;case D.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const H=this._renderService.dimensions.css.cell.width.toFixed(0),Y=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${q.C0.ESC}[6;${Y};${H}t`)}}cancel(O,A){if(this.options.cancelEvents||A)return O.preventDefault(),O.stopPropagation(),!1}}i.Terminal=U},9924:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TimeBasedDebouncer=void 0,i.TimeBasedDebouncer=class{constructor(a,c=1e3){this._renderCallback=a,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,c,p){this._rowCount=p,a=a!==void 0?a:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const v=u-this._lastRefreshMs,y=this._debounceThresholdMS-v;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},y)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,c)}}},1680:function(l,i,a){var c=this&&this.__decorate||function(h,d,f,S){var E,k=arguments.length,b=k<3?d:S===null?S=Object.getOwnPropertyDescriptor(d,f):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(h,d,f,S);else for(var C=h.length-1;C>=0;C--)(E=h[C])&&(b=(k<3?E(b):k>3?E(d,f,b):E(d,f))||b);return k>3&&b&&Object.defineProperty(d,f,b),b},p=this&&this.__param||function(h,d){return function(f,S){d(f,S,h)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Viewport=void 0;const u=a(3656),v=a(4725),y=a(8460),w=a(844),_=a(2585);let m=i.Viewport=class extends w.Disposable{constructor(h,d,f,S,E,k,b,C){super(),this._viewportElement=h,this._scrollArea=d,this._bufferService=f,this._optionsService=S,this._charSizeService=E,this._renderService=k,this._coreBrowserService=b,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new y.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(P=>this._activeBuffer=P.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(P=>this._renderDimensions=P)),this._handleThemeChange(C.colors),this.register(C.onChangeColors(P=>this._handleThemeChange(P))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(h){this._viewportElement.style.backgroundColor=h.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(h){if(h)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const d=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==d&&(this._lastRecordedBufferHeight=d,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const h=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==h&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=h),this._refreshAnimationFrame=null}syncScrollArea(h=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(h);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(h)}_handleScroll(h){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const d=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:d,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const h=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(h*(this._smoothScrollState.target-this._smoothScrollState.origin)),h<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(h,d){const f=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(d<0&&this._viewportElement.scrollTop!==0||d>0&&f<this._lastRecordedBufferHeight)||(h.cancelable&&h.preventDefault(),!1)}handleWheel(h){const d=this._getPixelsScrolled(h);return d!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+d:this._smoothScrollState.target+=d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=d,this._bubbleScroll(h,d))}scrollLines(h){if(h!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const d=h*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:h,suppressScrollEvent:!1})}_getPixelsScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let d=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_LINE?d*=this._currentRowHeight:h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._currentRowHeight*this._bufferService.rows),d}getBufferElements(h,d){var C;let f,S="";const E=[],k=d??this._bufferService.buffer.lines.length,b=this._bufferService.buffer.lines;for(let P=h;P<k;P++){const T=b.get(P);if(!T)continue;const M=(C=b.get(P+1))==null?void 0:C.isWrapped;if(S+=T.translateToString(!M),!M||P===b.length-1){const j=document.createElement("div");j.textContent=S,E.push(j),S.length>0&&(f=j),S=""}}return{bufferElements:E,cursorElement:f}}getLinesScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let d=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(d/=this._currentRowHeight+0,this._wheelPartialScroll+=d,d=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._bufferService.rows),d}_applyScrollModifier(h,d){const f=this._optionsService.rawOptions.fastScrollModifier;return f==="alt"&&d.altKey||f==="ctrl"&&d.ctrlKey||f==="shift"&&d.shiftKey?h*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:h*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(h){this._lastTouchY=h.touches[0].pageY}handleTouchMove(h){const d=this._lastTouchY-h.touches[0].pageY;return this._lastTouchY=h.touches[0].pageY,d!==0&&(this._viewportElement.scrollTop+=d,this._bubbleScroll(h,d))}};i.Viewport=m=c([p(2,_.IBufferService),p(3,_.IOptionsService),p(4,v.ICharSizeService),p(5,v.IRenderService),p(6,v.ICoreBrowserService),p(7,v.IThemeService)],m)},3107:function(l,i,a){var c=this&&this.__decorate||function(_,m,h,d){var f,S=arguments.length,E=S<3?m:d===null?d=Object.getOwnPropertyDescriptor(m,h):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(_,m,h,d);else for(var k=_.length-1;k>=0;k--)(f=_[k])&&(E=(S<3?f(E):S>3?f(m,h,E):f(m,h))||E);return S>3&&E&&Object.defineProperty(m,h,E),E},p=this&&this.__param||function(_,m){return function(h,d){m(h,d,_)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferDecorationRenderer=void 0;const u=a(4725),v=a(844),y=a(2585);let w=i.BufferDecorationRenderer=class extends v.Disposable{constructor(_,m,h,d,f){super(),this._screenElement=_,this._bufferService=m,this._coreBrowserService=h,this._decorationService=d,this._renderService=f,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(S=>this._removeDecoration(S))),this.register((0,v.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const _ of this._decorationService.decorations)this._renderDecoration(_);this._dimensionsChanged=!1}_renderDecoration(_){this._refreshStyle(_),this._dimensionsChanged&&this._refreshXPosition(_)}_createElement(_){var d;const m=this._coreBrowserService.mainDocument.createElement("div");m.classList.add("xterm-decoration"),m.classList.toggle("xterm-decoration-top-layer",((d=_==null?void 0:_.options)==null?void 0:d.layer)==="top"),m.style.width=`${Math.round((_.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,m.style.height=(_.options.height||1)*this._renderService.dimensions.css.cell.height+"px",m.style.top=(_.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",m.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const h=_.options.x??0;return h&&h>this._bufferService.cols&&(m.style.display="none"),this._refreshXPosition(_,m),m}_refreshStyle(_){const m=_.marker.line-this._bufferService.buffers.active.ydisp;if(m<0||m>=this._bufferService.rows)_.element&&(_.element.style.display="none",_.onRenderEmitter.fire(_.element));else{let h=this._decorationElements.get(_);h||(h=this._createElement(_),_.element=h,this._decorationElements.set(_,h),this._container.appendChild(h),_.onDispose(()=>{this._decorationElements.delete(_),h.remove()})),h.style.top=m*this._renderService.dimensions.css.cell.height+"px",h.style.display=this._altBufferIsActive?"none":"block",_.onRenderEmitter.fire(h)}}_refreshXPosition(_,m=_.element){if(!m)return;const h=_.options.x??0;(_.options.anchor||"left")==="right"?m.style.right=h?h*this._renderService.dimensions.css.cell.width+"px":"":m.style.left=h?h*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(_){var m;(m=this._decorationElements.get(_))==null||m.remove(),this._decorationElements.delete(_),_.dispose()}};i.BufferDecorationRenderer=w=c([p(1,y.IBufferService),p(2,u.ICoreBrowserService),p(3,y.IDecorationService),p(4,u.IRenderService)],w)},5871:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorZoneStore=void 0,i.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(a){if(a.options.overviewRulerOptions){for(const c of this._zones)if(c.color===a.options.overviewRulerOptions.color&&c.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,a.marker.line))return;if(this._lineAdjacentToZone(c,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(c,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,c){return c>=a.startBufferLine&&c<=a.endBufferLine}_lineAdjacentToZone(a,c,p){return c>=a.startBufferLine-this._linePadding[p||"full"]&&c<=a.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(a,c){a.startBufferLine=Math.min(a.startBufferLine,c),a.endBufferLine=Math.max(a.endBufferLine,c)}}},5744:function(l,i,a){var c=this&&this.__decorate||function(f,S,E,k){var b,C=arguments.length,P=C<3?S:k===null?k=Object.getOwnPropertyDescriptor(S,E):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(f,S,E,k);else for(var T=f.length-1;T>=0;T--)(b=f[T])&&(P=(C<3?b(P):C>3?b(S,E,P):b(S,E))||P);return C>3&&P&&Object.defineProperty(S,E,P),P},p=this&&this.__param||function(f,S){return function(E,k){S(E,k,f)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OverviewRulerRenderer=void 0;const u=a(5871),v=a(4725),y=a(844),w=a(2585),_={full:0,left:0,center:0,right:0},m={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0};let d=i.OverviewRulerRenderer=class extends y.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(f,S,E,k,b,C,P){var M;super(),this._viewportElement=f,this._screenElement=S,this._bufferService=E,this._decorationService=k,this._renderService=b,this._optionsService=C,this._coreBrowserService=P,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(M=this._viewportElement.parentElement)==null||M.insertBefore(this._canvas,this._viewportElement);const T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,y.toDisposable)(()=>{var j;(j=this._canvas)==null||j.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const f=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);m.full=this._canvas.width,m.left=f,m.center=S,m.right=f,this._refreshDrawHeightConstants(),h.full=0,h.left=0,h.center=m.left,h.right=m.left+m.center}_refreshDrawHeightConstants(){_.full=Math.round(2*this._coreBrowserService.dpr);const f=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(f,12),6)*this._coreBrowserService.dpr);_.left=S,_.center=S,_.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const f=this._colorZoneStore.zones;for(const S of f)S.position!=="full"&&this._renderColorZone(S);for(const S of f)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(f){this._ctx.fillStyle=f.color,this._ctx.fillRect(h[f.position||"full"],Math.round((this._canvas.height-1)*(f.startBufferLine/this._bufferService.buffers.active.lines.length)-_[f.position||"full"]/2),m[f.position||"full"],Math.round((this._canvas.height-1)*((f.endBufferLine-f.startBufferLine)/this._bufferService.buffers.active.lines.length)+_[f.position||"full"]))}_queueRefresh(f,S){this._shouldUpdateDimensions=f||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};i.OverviewRulerRenderer=d=c([p(2,w.IBufferService),p(3,w.IDecorationService),p(4,v.IRenderService),p(5,w.IOptionsService),p(6,v.ICoreBrowserService)],d)},2950:function(l,i,a){var c=this&&this.__decorate||function(_,m,h,d){var f,S=arguments.length,E=S<3?m:d===null?d=Object.getOwnPropertyDescriptor(m,h):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(_,m,h,d);else for(var k=_.length-1;k>=0;k--)(f=_[k])&&(E=(S<3?f(E):S>3?f(m,h,E):f(m,h))||E);return S>3&&E&&Object.defineProperty(m,h,E),E},p=this&&this.__param||function(_,m){return function(h,d){m(h,d,_)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CompositionHelper=void 0;const u=a(4725),v=a(2585),y=a(2584);let w=i.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(_,m,h,d,f,S){this._textarea=_,this._compositionView=m,this._bufferService=h,this._optionsService=d,this._coreService=f,this._renderService=S,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(_){this._compositionView.textContent=_.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(_){if(this._isComposing||this._isSendingComposition){if(_.keyCode===229||_.keyCode===16||_.keyCode===17||_.keyCode===18)return!1;this._finalizeComposition(!1)}return _.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(_){if(this._compositionView.classList.remove("active"),this._isComposing=!1,_){const m={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let h;this._isSendingComposition=!1,m.start+=this._dataAlreadySent.length,h=this._isComposing?this._textarea.value.substring(m.start,m.end):this._textarea.value.substring(m.start),h.length>0&&this._coreService.triggerDataEvent(h,!0)}},0)}else{this._isSendingComposition=!1;const m=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(m,!0)}}_handleAnyTextareaChanges(){const _=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const m=this._textarea.value,h=m.replace(_,"");this._dataAlreadySent=h,m.length>_.length?this._coreService.triggerDataEvent(h,!0):m.length<_.length?this._coreService.triggerDataEvent(`${y.C0.DEL}`,!0):m.length===_.length&&m!==_&&this._coreService.triggerDataEvent(m,!0)}},0)}updateCompositionElements(_){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const m=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),h=this._renderService.dimensions.css.cell.height,d=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,f=m*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=f+"px",this._compositionView.style.top=d+"px",this._compositionView.style.height=h+"px",this._compositionView.style.lineHeight=h+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const S=this._compositionView.getBoundingClientRect();this._textarea.style.left=f+"px",this._textarea.style.top=d+"px",this._textarea.style.width=Math.max(S.width,1)+"px",this._textarea.style.height=Math.max(S.height,1)+"px",this._textarea.style.lineHeight=S.height+"px"}_||setTimeout(()=>this.updateCompositionElements(!0),0)}}};i.CompositionHelper=w=c([p(2,v.IBufferService),p(3,v.IOptionsService),p(4,v.ICoreService),p(5,u.IRenderService)],w)},9806:(l,i)=>{function a(c,p,u){const v=u.getBoundingClientRect(),y=c.getComputedStyle(u),w=parseInt(y.getPropertyValue("padding-left")),_=parseInt(y.getPropertyValue("padding-top"));return[p.clientX-v.left-w,p.clientY-v.top-_]}Object.defineProperty(i,"__esModule",{value:!0}),i.getCoords=i.getCoordsRelativeToElement=void 0,i.getCoordsRelativeToElement=a,i.getCoords=function(c,p,u,v,y,w,_,m,h){if(!w)return;const d=a(c,p,u);return d?(d[0]=Math.ceil((d[0]+(h?_/2:0))/_),d[1]=Math.ceil(d[1]/m),d[0]=Math.min(Math.max(d[0],1),v+(h?1:0)),d[1]=Math.min(Math.max(d[1],1),y),d):void 0}},9504:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.moveToCellSequence=void 0;const c=a(2584);function p(m,h,d,f){const S=m-u(m,d),E=h-u(h,d),k=Math.abs(S-E)-function(b,C,P){let T=0;const M=b-u(b,P),j=C-u(C,P);for(let N=0;N<Math.abs(M-j);N++){const $=v(b,C)==="A"?-1:1,V=P.buffer.lines.get(M+$*N);V!=null&&V.isWrapped&&T++}return T}(m,h,d);return _(k,w(v(m,h),f))}function u(m,h){let d=0,f=h.buffer.lines.get(m),S=f==null?void 0:f.isWrapped;for(;S&&m>=0&&m<h.rows;)d++,f=h.buffer.lines.get(--m),S=f==null?void 0:f.isWrapped;return d}function v(m,h){return m>h?"A":"B"}function y(m,h,d,f,S,E){let k=m,b=h,C="";for(;k!==d||b!==f;)k+=S?1:-1,S&&k>E.cols-1?(C+=E.buffer.translateBufferLineToString(b,!1,m,k),k=0,m=0,b++):!S&&k<0&&(C+=E.buffer.translateBufferLineToString(b,!1,0,m+1),k=E.cols-1,m=k,b--);return C+E.buffer.translateBufferLineToString(b,!1,m,k)}function w(m,h){const d=h?"O":"[";return c.C0.ESC+d+m}function _(m,h){m=Math.floor(m);let d="";for(let f=0;f<m;f++)d+=h;return d}i.moveToCellSequence=function(m,h,d,f){const S=d.buffer.x,E=d.buffer.y;if(!d.buffer.hasScrollback)return function(C,P,T,M,j,N){return p(P,M,j,N).length===0?"":_(y(C,P,C,P-u(P,j),!1,j).length,w("D",N))}(S,E,0,h,d,f)+p(E,h,d,f)+function(C,P,T,M,j,N){let $;$=p(P,M,j,N).length>0?M-u(M,j):P;const V=M,K=function(q,B,R,L,I,D){let z;return z=p(R,L,I,D).length>0?L-u(L,I):B,q<R&&z<=L||q>=R&&z<L?"C":"D"}(C,P,T,M,j,N);return _(y(C,$,T,V,K==="C",j).length,w(K,N))}(S,E,m,h,d,f);let k;if(E===h)return k=S>m?"D":"C",_(Math.abs(S-m),w(k,f));k=E>h?"D":"C";const b=Math.abs(E-h);return _(function(C,P){return P.cols-C}(E>h?m:S,d)+(b-1)*d.cols+1+((E>h?S:m)-1),w(k,f))}},1296:function(l,i,a){var c=this&&this.__decorate||function(N,$,V,K){var q,B=arguments.length,R=B<3?$:K===null?K=Object.getOwnPropertyDescriptor($,V):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(N,$,V,K);else for(var L=N.length-1;L>=0;L--)(q=N[L])&&(R=(B<3?q(R):B>3?q($,V,R):q($,V))||R);return B>3&&R&&Object.defineProperty($,V,R),R},p=this&&this.__param||function(N,$){return function(V,K){$(V,K,N)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRenderer=void 0;const u=a(3787),v=a(2550),y=a(2223),w=a(6171),_=a(6052),m=a(4725),h=a(8055),d=a(8460),f=a(844),S=a(2585),E="xterm-dom-renderer-owner-",k="xterm-rows",b="xterm-fg-",C="xterm-bg-",P="xterm-focus",T="xterm-selection";let M=1,j=i.DomRenderer=class extends f.Disposable{constructor(N,$,V,K,q,B,R,L,I,D,z,F,U){super(),this._terminal=N,this._document=$,this._element=V,this._screenElement=K,this._viewportElement=q,this._helperContainer=B,this._linkifier2=R,this._charSizeService=I,this._optionsService=D,this._bufferService=z,this._coreBrowserService=F,this._themeService=U,this._terminalClass=M++,this._rowElements=[],this._selectionRenderModel=(0,_.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new d.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(k),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(G=>this._injectCss(G))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(G=>this._handleLinkHover(G))),this.register(this._linkifier2.onHideLinkUnderline(G=>this._handleLinkLeave(G))),this.register((0,f.toDisposable)(()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new v.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const N=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*N,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*N),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/N),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/N),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const V of this._rowElements)V.style.width=`${this.dimensions.css.canvas.width}px`,V.style.height=`${this.dimensions.css.cell.height}px`,V.style.lineHeight=`${this.dimensions.css.cell.height}px`,V.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const $=`${this._terminalSelector} .${k} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=$,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(N){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let $=`${this._terminalSelector} .${k} { color: ${N.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;$+=`${this._terminalSelector} .${k} .xterm-dim { color: ${h.color.multiplyOpacity(N.foreground,.5).css};}`,$+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const V=`blink_underline_${this._terminalClass}`,K=`blink_bar_${this._terminalClass}`,q=`blink_block_${this._terminalClass}`;$+=`@keyframes ${V} { 50% { border-bottom-style: hidden; }}`,$+=`@keyframes ${K} { 50% { box-shadow: none; }}`,$+=`@keyframes ${q} { 0% { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css}; } 50% { background-color: inherit; color: ${N.cursor.css}; }}`,$+=`${this._terminalSelector} .${k}.${P} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${k}.${P} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${k}.${P} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css};}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${N.cursor.css} !important; color: ${N.cursorAccent.css} !important;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${N.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${N.cursor.css} inset;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${N.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,$+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${N.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${N.selectionInactiveBackgroundOpaque.css};}`;for(const[B,R]of N.ansi.entries())$+=`${this._terminalSelector} .${b}${B} { color: ${R.css}; }${this._terminalSelector} .${b}${B}.xterm-dim { color: ${h.color.multiplyOpacity(R,.5).css}; }${this._terminalSelector} .${C}${B} { background-color: ${R.css}; }`;$+=`${this._terminalSelector} .${b}${y.INVERTED_DEFAULT_COLOR} { color: ${h.color.opaque(N.background).css}; }${this._terminalSelector} .${b}${y.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${h.color.multiplyOpacity(h.color.opaque(N.background),.5).css}; }${this._terminalSelector} .${C}${y.INVERTED_DEFAULT_COLOR} { background-color: ${N.foreground.css}; }`,this._themeStyleElement.textContent=$}_setDefaultSpacing(){const N=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${N}px`,this._rowFactory.defaultSpacing=N}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(N,$){for(let V=this._rowElements.length;V<=$;V++){const K=this._document.createElement("div");this._rowContainer.appendChild(K),this._rowElements.push(K)}for(;this._rowElements.length>$;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(N,$){this._refreshRowElements(N,$),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(P),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(P),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(N,$,V){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(N,$,V),this.renderRows(0,this._bufferService.rows-1),!N||!$)return;this._selectionRenderModel.update(this._terminal,N,$,V);const K=this._selectionRenderModel.viewportStartRow,q=this._selectionRenderModel.viewportEndRow,B=this._selectionRenderModel.viewportCappedStartRow,R=this._selectionRenderModel.viewportCappedEndRow;if(B>=this._bufferService.rows||R<0)return;const L=this._document.createDocumentFragment();if(V){const I=N[0]>$[0];L.appendChild(this._createSelectionElement(B,I?$[0]:N[0],I?N[0]:$[0],R-B+1))}else{const I=K===B?N[0]:0,D=B===q?$[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(B,I,D));const z=R-B-1;if(L.appendChild(this._createSelectionElement(B+1,0,this._bufferService.cols,z)),B!==R){const F=q===R?$[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(R,0,F))}}this._selectionContainer.appendChild(L)}_createSelectionElement(N,$,V,K=1){const q=this._document.createElement("div"),B=$*this.dimensions.css.cell.width;let R=this.dimensions.css.cell.width*(V-$);return B+R>this.dimensions.css.canvas.width&&(R=this.dimensions.css.canvas.width-B),q.style.height=K*this.dimensions.css.cell.height+"px",q.style.top=N*this.dimensions.css.cell.height+"px",q.style.left=`${B}px`,q.style.width=`${R}px`,q}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const N of this._rowElements)N.replaceChildren()}renderRows(N,$){const V=this._bufferService.buffer,K=V.ybase+V.y,q=Math.min(V.x,this._bufferService.cols-1),B=this._optionsService.rawOptions.cursorBlink,R=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let I=N;I<=$;I++){const D=I+V.ydisp,z=this._rowElements[I],F=V.lines.get(D);if(!z||!F)break;z.replaceChildren(...this._rowFactory.createRow(F,D,D===K,R,L,q,B,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(N){this._setCellUnderline(N.x1,N.x2,N.y1,N.y2,N.cols,!0)}_handleLinkLeave(N){this._setCellUnderline(N.x1,N.x2,N.y1,N.y2,N.cols,!1)}_setCellUnderline(N,$,V,K,q,B){V<0&&(N=0),K<0&&($=0);const R=this._bufferService.rows-1;V=Math.max(Math.min(V,R),0),K=Math.max(Math.min(K,R),0),q=Math.min(q,this._bufferService.cols);const L=this._bufferService.buffer,I=L.ybase+L.y,D=Math.min(L.x,q-1),z=this._optionsService.rawOptions.cursorBlink,F=this._optionsService.rawOptions.cursorStyle,U=this._optionsService.rawOptions.cursorInactiveStyle;for(let G=V;G<=K;++G){const O=G+L.ydisp,A=this._rowElements[G],W=L.lines.get(O);if(!A||!W)break;A.replaceChildren(...this._rowFactory.createRow(W,O,O===I,F,U,D,z,this.dimensions.css.cell.width,this._widthCache,B?G===V?N:0:-1,B?(G===K?$:q)-1:-1))}}};i.DomRenderer=j=c([p(7,S.IInstantiationService),p(8,m.ICharSizeService),p(9,S.IOptionsService),p(10,S.IBufferService),p(11,m.ICoreBrowserService),p(12,m.IThemeService)],j)},3787:function(l,i,a){var c=this&&this.__decorate||function(k,b,C,P){var T,M=arguments.length,j=M<3?b:P===null?P=Object.getOwnPropertyDescriptor(b,C):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(k,b,C,P);else for(var N=k.length-1;N>=0;N--)(T=k[N])&&(j=(M<3?T(j):M>3?T(b,C,j):T(b,C))||j);return M>3&&j&&Object.defineProperty(b,C,j),j},p=this&&this.__param||function(k,b){return function(C,P){b(C,P,k)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRendererRowFactory=void 0;const u=a(2223),v=a(643),y=a(511),w=a(2585),_=a(8055),m=a(4725),h=a(4269),d=a(6171),f=a(3734);let S=i.DomRendererRowFactory=class{constructor(k,b,C,P,T,M,j){this._document=k,this._characterJoinerService=b,this._optionsService=C,this._coreBrowserService=P,this._coreService=T,this._decorationService=M,this._themeService=j,this._workCell=new y.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(k,b,C){this._selectionStart=k,this._selectionEnd=b,this._columnSelectMode=C}createRow(k,b,C,P,T,M,j,N,$,V,K){const q=[],B=this._characterJoinerService.getJoinedCharacters(b),R=this._themeService.colors;let L,I=k.getNoBgTrimmedLength();C&&I<M+1&&(I=M+1);let D=0,z="",F=0,U=0,G=0,O=!1,A=0,W=!1,H=0;const Y=[],X=V!==-1&&K!==-1;for(let ne=0;ne<I;ne++){k.loadCell(ne,this._workCell);let ie=this._workCell.getWidth();if(ie===0)continue;let de=!1,be=ne,se=this._workCell;if(B.length>0&&ne===B[0][0]){de=!0;const ge=B.shift();se=new h.JoinedCellData(this._workCell,k.translateToString(!0,ge[0],ge[1]),ge[1]-ge[0]),be=ge[1]-1,ie=se.getWidth()}const jr=this._isCellInSelection(ne,b),tr=C&&ne===M,ja=X&&ne>=V&&ne<=K;let Ba=!1;this._decorationService.forEachDecorationAtCell(ne,b,void 0,ge=>{Ba=!0});let wi=se.getChars()||v.WHITESPACE_CELL_CHAR;if(wi===" "&&(se.isUnderline()||se.isOverline())&&(wi=" "),H=ie*N-$.get(wi,se.isBold(),se.isItalic()),L){if(D&&(jr&&W||!jr&&!W&&se.bg===F)&&(jr&&W&&R.selectionForeground||se.fg===U)&&se.extended.ext===G&&ja===O&&H===A&&!tr&&!de&&!Ba){se.isInvisible()?z+=v.WHITESPACE_CELL_CHAR:z+=wi,D++;continue}D&&(L.textContent=z),L=this._document.createElement("span"),D=0,z=""}else L=this._document.createElement("span");if(F=se.bg,U=se.fg,G=se.extended.ext,O=ja,A=H,W=jr,de&&M>=ne&&M<=be&&(M=ne),!this._coreService.isCursorHidden&&tr&&this._coreService.isCursorInitialized){if(Y.push("xterm-cursor"),this._coreBrowserService.isFocused)j&&Y.push("xterm-cursor-blink"),Y.push(P==="bar"?"xterm-cursor-bar":P==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":Y.push("xterm-cursor-outline");break;case"block":Y.push("xterm-cursor-block");break;case"bar":Y.push("xterm-cursor-bar");break;case"underline":Y.push("xterm-cursor-underline")}}if(se.isBold()&&Y.push("xterm-bold"),se.isItalic()&&Y.push("xterm-italic"),se.isDim()&&Y.push("xterm-dim"),z=se.isInvisible()?v.WHITESPACE_CELL_CHAR:se.getChars()||v.WHITESPACE_CELL_CHAR,se.isUnderline()&&(Y.push(`xterm-underline-${se.extended.underlineStyle}`),z===" "&&(z=" "),!se.isUnderlineColorDefault()))if(se.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${f.AttributeData.toColorRGB(se.getUnderlineColor()).join(",")})`;else{let ge=se.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&se.isBold()&&ge<8&&(ge+=8),L.style.textDecorationColor=R.ansi[ge].css}se.isOverline()&&(Y.push("xterm-overline"),z===" "&&(z=" ")),se.isStrikethrough()&&Y.push("xterm-strikethrough"),ja&&(L.style.textDecoration="underline");let ut=se.getFgColor(),ns=se.getFgColorMode(),Lt=se.getBgColor(),ss=se.getBgColorMode();const $a=!!se.isInverse();if($a){const ge=ut;ut=Lt,Lt=ge;const nS=ns;ns=ss,ss=nS}let rr,xi,nr,is=!1;switch(this._decorationService.forEachDecorationAtCell(ne,b,void 0,ge=>{ge.options.layer!=="top"&&is||(ge.backgroundColorRGB&&(ss=50331648,Lt=ge.backgroundColorRGB.rgba>>8&16777215,rr=ge.backgroundColorRGB),ge.foregroundColorRGB&&(ns=50331648,ut=ge.foregroundColorRGB.rgba>>8&16777215,xi=ge.foregroundColorRGB),is=ge.options.layer==="top")}),!is&&jr&&(rr=this._coreBrowserService.isFocused?R.selectionBackgroundOpaque:R.selectionInactiveBackgroundOpaque,Lt=rr.rgba>>8&16777215,ss=50331648,is=!0,R.selectionForeground&&(ns=50331648,ut=R.selectionForeground.rgba>>8&16777215,xi=R.selectionForeground)),is&&Y.push("xterm-decoration-top"),ss){case 16777216:case 33554432:nr=R.ansi[Lt],Y.push(`xterm-bg-${Lt}`);break;case 50331648:nr=_.channels.toColor(Lt>>16,Lt>>8&255,255&Lt),this._addStyle(L,`background-color:#${E((Lt>>>0).toString(16),"0",6)}`);break;default:$a?(nr=R.foreground,Y.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):nr=R.background}switch(rr||se.isDim()&&(rr=_.color.multiplyOpacity(nr,.5)),ns){case 16777216:case 33554432:se.isBold()&&ut<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ut+=8),this._applyMinimumContrast(L,nr,R.ansi[ut],se,rr,void 0)||Y.push(`xterm-fg-${ut}`);break;case 50331648:const ge=_.channels.toColor(ut>>16&255,ut>>8&255,255&ut);this._applyMinimumContrast(L,nr,ge,se,rr,xi)||this._addStyle(L,`color:#${E(ut.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,nr,R.foreground,se,rr,xi)||$a&&Y.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}Y.length&&(L.className=Y.join(" "),Y.length=0),tr||de||Ba?L.textContent=z:D++,H!==this.defaultSpacing&&(L.style.letterSpacing=`${H}px`),q.push(L),ne=be}return L&&D&&(L.textContent=z),q}_applyMinimumContrast(k,b,C,P,T,M){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,d.treatGlyphAsBackgroundColor)(P.getCode()))return!1;const j=this._getContrastCache(P);let N;if(T||M||(N=j.getColor(b.rgba,C.rgba)),N===void 0){const $=this._optionsService.rawOptions.minimumContrastRatio/(P.isDim()?2:1);N=_.color.ensureContrastRatio(T||b,M||C,$),j.setColor((T||b).rgba,(M||C).rgba,N??null)}return!!N&&(this._addStyle(k,`color:${N.css}`),!0)}_getContrastCache(k){return k.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(k,b){k.setAttribute("style",`${k.getAttribute("style")||""}${b};`)}_isCellInSelection(k,b){const C=this._selectionStart,P=this._selectionEnd;return!(!C||!P)&&(this._columnSelectMode?C[0]<=P[0]?k>=C[0]&&b>=C[1]&&k<P[0]&&b<=P[1]:k<C[0]&&b>=C[1]&&k>=P[0]&&b<=P[1]:b>C[1]&&b<P[1]||C[1]===P[1]&&b===C[1]&&k>=C[0]&&k<P[0]||C[1]<P[1]&&b===P[1]&&k<P[0]||C[1]<P[1]&&b===C[1]&&k>=C[0])}};function E(k,b,C){for(;k.length<C;)k=b+k;return k}i.DomRendererRowFactory=S=c([p(1,m.ICharacterJoinerService),p(2,w.IOptionsService),p(3,m.ICoreBrowserService),p(4,w.ICoreService),p(5,w.IDecorationService),p(6,m.IThemeService)],S)},2550:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WidthCache=void 0,i.WidthCache=class{constructor(a,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const p=a.createElement("span");p.classList.add("xterm-char-measure-element");const u=a.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const v=a.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontStyle="italic";const y=a.createElement("span");y.classList.add("xterm-char-measure-element"),y.style.fontWeight="bold",y.style.fontStyle="italic",this._measureElements=[p,u,v,y],this._container.appendChild(p),this._container.appendChild(u),this._container.appendChild(v),this._container.appendChild(y),c.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(a,c,p,u){a===this._font&&c===this._fontSize&&p===this._weight&&u===this._weightBold||(this._font=a,this._fontSize=c,this._weight=p,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(a,c,p){let u=0;if(!c&&!p&&a.length===1&&(u=a.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const w=this._measure(a,0);return w>0&&(this._flat[u]=w),w}let v=a;c&&(v+="B"),p&&(v+="I");let y=this._holey.get(v);if(y===void 0){let w=0;c&&(w|=1),p&&(w|=2),y=this._measure(a,w),y>0&&this._holey.set(v,y)}return y}_measure(a,c){const p=this._measureElements[c];return p.textContent=a.repeat(32),p.offsetWidth/32}}},2223:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TEXT_BASELINE=i.DIM_OPACITY=i.INVERTED_DEFAULT_COLOR=void 0;const c=a(6114);i.INVERTED_DEFAULT_COLOR=257,i.DIM_OPACITY=.5,i.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(l,i)=>{function a(p){return 57508<=p&&p<=57558}function c(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(i,"__esModule",{value:!0}),i.computeNextVariantOffset=i.createRenderDimensions=i.treatGlyphAsBackgroundColor=i.allowRescaling=i.isEmoji=i.isRestrictedPowerlineGlyph=i.isPowerlineGlyph=i.throwIfFalsy=void 0,i.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},i.isPowerlineGlyph=a,i.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},i.isEmoji=c,i.allowRescaling=function(p,u,v,y){return u===1&&v>Math.ceil(1.5*y)&&p!==void 0&&p>255&&!c(p)&&!a(p)&&!function(w){return 57344<=w&&w<=63743}(p)},i.treatGlyphAsBackgroundColor=function(p){return a(p)||function(u){return 9472<=u&&u<=9631}(p)},i.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},i.computeNextVariantOffset=function(p,u,v=0){return(p-(2*Math.round(u)-v))%(2*Math.round(u))}},6052:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSelectionRenderModel=void 0;class a{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(p,u,v,y=!1){if(this.selectionStart=u,this.selectionEnd=v,!u||!v||u[0]===v[0]&&u[1]===v[1])return void this.clear();const w=p.buffers.active.ydisp,_=u[1]-w,m=v[1]-w,h=Math.max(_,0),d=Math.min(m,p.rows-1);h>=p.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=y,this.viewportStartRow=_,this.viewportEndRow=m,this.viewportCappedStartRow=h,this.viewportCappedEndRow=d,this.startCol=u[0],this.endCol=v[0])}isCellSelected(p,u,v){return!!this.hasSelection&&(v-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&v>=this.viewportCappedStartRow&&u<this.endCol&&v<=this.viewportCappedEndRow:u<this.startCol&&v>=this.viewportCappedStartRow&&u>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&v===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportStartRow&&u>=this.startCol)}}i.createSelectionRenderModel=function(){return new a}},456:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionModel=void 0,i.SelectionModel=class{constructor(a){this._bufferService=a,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,c=this.selectionEnd;return!(!a||!c)&&(a[1]>c[1]||a[1]===c[1]&&a[0]>c[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(l,i,a){var c=this&&this.__decorate||function(d,f,S,E){var k,b=arguments.length,C=b<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(d,f,S,E);else for(var P=d.length-1;P>=0;P--)(k=d[P])&&(C=(b<3?k(C):b>3?k(f,S,C):k(f,S))||C);return b>3&&C&&Object.defineProperty(f,S,C),C},p=this&&this.__param||function(d,f){return function(S,E){f(S,E,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharSizeService=void 0;const u=a(2585),v=a(8460),y=a(844);let w=i.CharSizeService=class extends y.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(d,f,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new v.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new h(this._optionsService))}catch{this._measureStrategy=this.register(new m(d,f,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const d=this._measureStrategy.measure();d.width===this.width&&d.height===this.height||(this.width=d.width,this.height=d.height,this._onCharSizeChange.fire())}};i.CharSizeService=w=c([p(2,u.IOptionsService)],w);class _ extends y.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(f,S){f!==void 0&&f>0&&S!==void 0&&S>0&&(this._result.width=f,this._result.height=S)}}class m extends _{constructor(f,S,E){super(),this._document=f,this._parentElement=S,this._optionsService=E,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class h extends _{constructor(f){super(),this._optionsService=f,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const 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}`;const f=this._ctx.measureText("W");return this._validateAndSet(f.width,f.fontBoundingBoxAscent+f.fontBoundingBoxDescent),this._result}}},4269:function(l,i,a){var c=this&&this.__decorate||function(h,d,f,S){var E,k=arguments.length,b=k<3?d:S===null?S=Object.getOwnPropertyDescriptor(d,f):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(h,d,f,S);else for(var C=h.length-1;C>=0;C--)(E=h[C])&&(b=(k<3?E(b):k>3?E(d,f,b):E(d,f))||b);return k>3&&b&&Object.defineProperty(d,f,b),b},p=this&&this.__param||function(h,d){return function(f,S){d(f,S,h)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharacterJoinerService=i.JoinedCellData=void 0;const u=a(3734),v=a(643),y=a(511),w=a(2585);class _ extends u.AttributeData{constructor(d,f,S){super(),this.content=0,this.combinedData="",this.fg=d.fg,this.bg=d.bg,this.combinedData=f,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(d){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.JoinedCellData=_;let m=i.CharacterJoinerService=class J0{constructor(d){this._bufferService=d,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new y.CellData}register(d){const f={id:this._nextCharacterJoinerId++,handler:d};return this._characterJoiners.push(f),f.id}deregister(d){for(let f=0;f<this._characterJoiners.length;f++)if(this._characterJoiners[f].id===d)return this._characterJoiners.splice(f,1),!0;return!1}getJoinedCharacters(d){if(this._characterJoiners.length===0)return[];const f=this._bufferService.buffer.lines.get(d);if(!f||f.length===0)return[];const S=[],E=f.translateToString(!0);let k=0,b=0,C=0,P=f.getFg(0),T=f.getBg(0);for(let M=0;M<f.getTrimmedLength();M++)if(f.loadCell(M,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==P||this._workCell.bg!==T){if(M-k>1){const j=this._getJoinedRanges(E,C,b,f,k);for(let N=0;N<j.length;N++)S.push(j[N])}k=M,C=b,P=this._workCell.fg,T=this._workCell.bg}b+=this._workCell.getChars().length||v.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-k>1){const M=this._getJoinedRanges(E,C,b,f,k);for(let j=0;j<M.length;j++)S.push(M[j])}return S}_getJoinedRanges(d,f,S,E,k){const b=d.substring(f,S);let C=[];try{C=this._characterJoiners[0].handler(b)}catch(P){console.error(P)}for(let P=1;P<this._characterJoiners.length;P++)try{const T=this._characterJoiners[P].handler(b);for(let M=0;M<T.length;M++)J0._mergeRanges(C,T[M])}catch(T){console.error(T)}return this._stringRangesToCellRanges(C,E,k),C}_stringRangesToCellRanges(d,f,S){let E=0,k=!1,b=0,C=d[E];if(C){for(let P=S;P<this._bufferService.cols;P++){const T=f.getWidth(P),M=f.getString(P).length||v.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!k&&C[0]<=b&&(C[0]=P,k=!0),C[1]<=b){if(C[1]=P,C=d[++E],!C)break;C[0]<=b?(C[0]=P,k=!0):k=!1}b+=M}}C&&(C[1]=this._bufferService.cols)}}static _mergeRanges(d,f){let S=!1;for(let E=0;E<d.length;E++){const k=d[E];if(S){if(f[1]<=k[0])return d[E-1][1]=f[1],d;if(f[1]<=k[1])return d[E-1][1]=Math.max(f[1],k[1]),d.splice(E,1),d;d.splice(E,1),E--}else{if(f[1]<=k[0])return d.splice(E,0,f),d;if(f[1]<=k[1])return k[0]=Math.min(f[0],k[0]),d;f[0]<k[1]&&(k[0]=Math.min(f[0],k[0]),S=!0)}}return S?d[d.length-1][1]=f[1]:d.push(f),d}};i.CharacterJoinerService=m=c([p(0,w.IBufferService)],m)},5114:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreBrowserService=void 0;const c=a(844),p=a(8460),u=a(3656);class v extends c.Disposable{constructor(_,m,h){super(),this._textarea=_,this._window=m,this.mainDocument=h,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new y(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(d=>this._screenDprMonitor.setWindow(d))),this.register((0,p.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get window(){return this._window}set window(_){this._window!==_&&(this._window=_,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}}i.CoreBrowserService=v;class y extends c.Disposable{constructor(_){super(),this._parentWindow=_,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)(()=>this.clearListener()))}setWindow(_){this._parentWindow=_,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var _;this._outerListener&&((_=this._resolutionMediaMatchList)==null||_.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LinkProviderService=void 0;const c=a(844);class p extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(v){return this.linkProviders.push(v),{dispose:()=>{const y=this.linkProviders.indexOf(v);y!==-1&&this.linkProviders.splice(y,1)}}}}i.LinkProviderService=p},8934:function(l,i,a){var c=this&&this.__decorate||function(w,_,m,h){var d,f=arguments.length,S=f<3?_:h===null?h=Object.getOwnPropertyDescriptor(_,m):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(w,_,m,h);else for(var E=w.length-1;E>=0;E--)(d=w[E])&&(S=(f<3?d(S):f>3?d(_,m,S):d(_,m))||S);return f>3&&S&&Object.defineProperty(_,m,S),S},p=this&&this.__param||function(w,_){return function(m,h){_(m,h,w)}};Object.defineProperty(i,"__esModule",{value:!0}),i.MouseService=void 0;const u=a(4725),v=a(9806);let y=i.MouseService=class{constructor(w,_){this._renderService=w,this._charSizeService=_}getCoords(w,_,m,h,d){return(0,v.getCoords)(window,w,_,m,h,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,d)}getMouseReportCoords(w,_){const m=(0,v.getCoordsRelativeToElement)(window,w,_);if(this._charSizeService.hasValidSize)return m[0]=Math.min(Math.max(m[0],0),this._renderService.dimensions.css.canvas.width-1),m[1]=Math.min(Math.max(m[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(m[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(m[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(m[0]),y:Math.floor(m[1])}}};i.MouseService=y=c([p(0,u.IRenderService),p(1,u.ICharSizeService)],y)},3230:function(l,i,a){var c=this&&this.__decorate||function(d,f,S,E){var k,b=arguments.length,C=b<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(d,f,S,E);else for(var P=d.length-1;P>=0;P--)(k=d[P])&&(C=(b<3?k(C):b>3?k(f,S,C):k(f,S))||C);return b>3&&C&&Object.defineProperty(f,S,C),C},p=this&&this.__param||function(d,f){return function(S,E){f(S,E,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.RenderService=void 0;const u=a(6193),v=a(4725),y=a(8460),w=a(844),_=a(7226),m=a(2585);let h=i.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(d,f,S,E,k,b,C,P){super(),this._rowCount=d,this._charSizeService=E,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new _.DebouncedIdleTask,this._observerDisposable=this.register(new w.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new y.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new y.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new y.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new y.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer((T,M)=>this._renderRows(T,M),C),this.register(this._renderDebouncer),this.register(C.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(b.onResize(()=>this._fullRefresh())),this.register(b.buffers.onBufferActivate(()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()})),this.register(S.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(k.onDecorationRegistered(()=>this._fullRefresh())),this.register(k.onDecorationRemoved(()=>this._fullRefresh())),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(b.cols,b.rows),this._fullRefresh()})),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(b.buffer.y,b.buffer.y,!0))),this.register(P.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(C.window,f),this.register(C.onWindowChange(T=>this._registerIntersectionObserver(T,f)))}_registerIntersectionObserver(d,f){if("IntersectionObserver"in d){const S=new d.IntersectionObserver(E=>this._handleIntersectionChange(E[E.length-1]),{threshold:0});S.observe(f),this._observerDisposable.value=(0,w.toDisposable)(()=>S.disconnect())}}_handleIntersectionChange(d){this._isPaused=d.isIntersecting===void 0?d.intersectionRatio===0:!d.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(d,f,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(d,f,this._rowCount))}_renderRows(d,f){this._renderer.value&&(d=Math.min(d,this._rowCount-1),f=Math.min(f,this._rowCount-1),this._renderer.value.renderRows(d,f),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:d,end:f}),this._onRender.fire({start:d,end:f}),this._isNextRenderRedrawOnly=!0)}resize(d,f){this._rowCount=f,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(d){this._renderer.value=d,this._renderer.value&&(this._renderer.value.onRequestRedraw(f=>this.refreshRows(f.start,f.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(d){return this._renderDebouncer.addRefreshCallback(d)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var d,f;this._renderer.value&&((f=(d=this._renderer.value).clearTextureAtlas)==null||f.call(d),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(d,f){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var S;return(S=this._renderer.value)==null?void 0:S.handleResize(d,f)}):this._renderer.value.handleResize(d,f),this._fullRefresh())}handleCharSizeChanged(){var d;(d=this._renderer.value)==null||d.handleCharSizeChanged()}handleBlur(){var d;(d=this._renderer.value)==null||d.handleBlur()}handleFocus(){var d;(d=this._renderer.value)==null||d.handleFocus()}handleSelectionChanged(d,f,S){var E;this._selectionState.start=d,this._selectionState.end=f,this._selectionState.columnSelectMode=S,(E=this._renderer.value)==null||E.handleSelectionChanged(d,f,S)}handleCursorMove(){var d;(d=this._renderer.value)==null||d.handleCursorMove()}clear(){var d;(d=this._renderer.value)==null||d.clear()}};i.RenderService=h=c([p(2,m.IOptionsService),p(3,v.ICharSizeService),p(4,m.IDecorationService),p(5,m.IBufferService),p(6,v.ICoreBrowserService),p(7,v.IThemeService)],h)},9312:function(l,i,a){var c=this&&this.__decorate||function(C,P,T,M){var j,N=arguments.length,$=N<3?P:M===null?M=Object.getOwnPropertyDescriptor(P,T):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(C,P,T,M);else for(var V=C.length-1;V>=0;V--)(j=C[V])&&($=(N<3?j($):N>3?j(P,T,$):j(P,T))||$);return N>3&&$&&Object.defineProperty(P,T,$),$},p=this&&this.__param||function(C,P){return function(T,M){P(T,M,C)}};Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionService=void 0;const u=a(9806),v=a(9504),y=a(456),w=a(4725),_=a(8460),m=a(844),h=a(6114),d=a(4841),f=a(511),S=a(2585),E=" ",k=new RegExp(E,"g");let b=i.SelectionService=class extends m.Disposable{constructor(C,P,T,M,j,N,$,V,K){super(),this._element=C,this._screenElement=P,this._linkifier=T,this._bufferService=M,this._coreService=j,this._mouseService=N,this._optionsService=$,this._renderService=V,this._coreBrowserService=K,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new f.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new _.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new _.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new _.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=q=>this._handleMouseMove(q),this._mouseUpListener=q=>this._handleMouseUp(q),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(q=>this._handleTrim(q)),this.register(this._bufferService.buffers.onBufferActivate(q=>this._handleBufferActivate(q))),this.enable(),this._model=new y.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,m.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const C=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!(!C||!P||C[0]===P[0]&&C[1]===P[1])}get selectionText(){const C=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;if(!C||!P)return"";const T=this._bufferService.buffer,M=[];if(this._activeSelectionMode===3){if(C[0]===P[0])return"";const j=C[0]<P[0]?C[0]:P[0],N=C[0]<P[0]?P[0]:C[0];for(let $=C[1];$<=P[1];$++){const V=T.translateBufferLineToString($,!0,j,N);M.push(V)}}else{const j=C[1]===P[1]?P[0]:void 0;M.push(T.translateBufferLineToString(C[1],!0,C[0],j));for(let N=C[1]+1;N<=P[1]-1;N++){const $=T.lines.get(N),V=T.translateBufferLineToString(N,!0);$!=null&&$.isWrapped?M[M.length-1]+=V:M.push(V)}if(C[1]!==P[1]){const N=T.lines.get(P[1]),$=T.translateBufferLineToString(P[1],!0,0,P[0]);N&&N.isWrapped?M[M.length-1]+=$:M.push($)}}return M.map(j=>j.replace(k," ")).join(h.isWindows?`\r
276
- `:`
277
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(C){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),h.isLinux&&C&&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(C){const P=this._getMouseBufferCoords(C),T=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!!(T&&M&&P)&&this._areCoordsInSelection(P,T,M)}isCellInSelection(C,P){const T=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!T||!M)&&this._areCoordsInSelection([C,P],T,M)}_areCoordsInSelection(C,P,T){return C[1]>P[1]&&C[1]<T[1]||P[1]===T[1]&&C[1]===P[1]&&C[0]>=P[0]&&C[0]<T[0]||P[1]<T[1]&&C[1]===T[1]&&C[0]<T[0]||P[1]<T[1]&&C[1]===P[1]&&C[0]>=P[0]}_selectWordAtCursor(C,P){var j,N;const T=(N=(j=this._linkifier.currentLink)==null?void 0:j.link)==null?void 0:N.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,d.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const M=this._getMouseBufferCoords(C);return!!M&&(this._selectWordAt(M,P),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(C,P){this._model.clearSelection(),C=Math.max(C,0),P=Math.min(P,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,C],this._model.selectionEnd=[this._bufferService.cols,P],this.refresh(),this._onSelectionChange.fire()}_handleTrim(C){this._model.handleTrim(C)&&this.refresh()}_getMouseBufferCoords(C){const P=this._mouseService.getCoords(C,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(P)return P[0]--,P[1]--,P[1]+=this._bufferService.buffer.ydisp,P}_getMouseEventScrollAmount(C){let P=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,C,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return P>=0&&P<=T?0:(P>T&&(P-=T),P=Math.min(Math.max(P,-50),50),P/=50,P/Math.abs(P)+Math.round(14*P))}shouldForceSelection(C){return h.isMac?C.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:C.shiftKey}handleMouseDown(C){if(this._mouseDownTimeStamp=C.timeStamp,(C.button!==2||!this.hasSelection)&&C.button===0){if(!this._enabled){if(!this.shouldForceSelection(C))return;C.stopPropagation()}C.preventDefault(),this._dragScrollAmount=0,this._enabled&&C.shiftKey?this._handleIncrementalClick(C):C.detail===1?this._handleSingleClick(C):C.detail===2?this._handleDoubleClick(C):C.detail===3&&this._handleTripleClick(C),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(C){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(C))}_handleSingleClick(C){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(C)?3:0,this._model.selectionStart=this._getMouseBufferCoords(C),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const P=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);P&&P.length!==this._model.selectionStart[0]&&P.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(C){this._selectWordAtCursor(C,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(C){const P=this._getMouseBufferCoords(C);P&&(this._activeSelectionMode=2,this._selectLineAt(P[1]))}shouldColumnSelect(C){return C.altKey&&!(h.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(C){if(C.stopImmediatePropagation(),!this._model.selectionStart)return;const P=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(C),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(C),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){const M=T.lines.get(this._model.selectionEnd[1]);M&&M.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}P&&P[0]===this._model.selectionEnd[0]&&P[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const C=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(C.ydisp+this._bufferService.rows,C.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=C.ydisp),this.refresh()}}_handleMouseUp(C){const P=C.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&P<500&&C.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const T=this._mouseService.getCoords(C,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){const M=(0,v.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(M,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const C=this._model.finalSelectionStart,P=this._model.finalSelectionEnd,T=!(!C||!P||C[0]===P[0]&&C[1]===P[1]);T?C&&P&&(this._oldSelectionStart&&this._oldSelectionEnd&&C[0]===this._oldSelectionStart[0]&&C[1]===this._oldSelectionStart[1]&&P[0]===this._oldSelectionEnd[0]&&P[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(C,P,T)):this._oldHasSelection&&this._fireOnSelectionChange(C,P,T)}_fireOnSelectionChange(C,P,T){this._oldSelectionStart=C,this._oldSelectionEnd=P,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(C){this.clearSelection(),this._trimListener.dispose(),this._trimListener=C.activeBuffer.lines.onTrim(P=>this._handleTrim(P))}_convertViewportColToCharacterIndex(C,P){let T=P;for(let M=0;P>=M;M++){const j=C.loadCell(M,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:j>1&&P!==M&&(T+=j-1)}return T}setSelection(C,P,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[C,P],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(C){this._isClickInSelection(C)||(this._selectWordAtCursor(C,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(C,P,T=!0,M=!0){if(C[0]>=this._bufferService.cols)return;const j=this._bufferService.buffer,N=j.lines.get(C[1]);if(!N)return;const $=j.translateBufferLineToString(C[1],!1);let V=this._convertViewportColToCharacterIndex(N,C[0]),K=V;const q=C[0]-V;let B=0,R=0,L=0,I=0;if($.charAt(V)===" "){for(;V>0&&$.charAt(V-1)===" ";)V--;for(;K<$.length&&$.charAt(K+1)===" ";)K++}else{let F=C[0],U=C[0];N.getWidth(F)===0&&(B++,F--),N.getWidth(U)===2&&(R++,U++);const G=N.getString(U).length;for(G>1&&(I+=G-1,K+=G-1);F>0&&V>0&&!this._isCharWordSeparator(N.loadCell(F-1,this._workCell));){N.loadCell(F-1,this._workCell);const O=this._workCell.getChars().length;this._workCell.getWidth()===0?(B++,F--):O>1&&(L+=O-1,V-=O-1),V--,F--}for(;U<N.length&&K+1<$.length&&!this._isCharWordSeparator(N.loadCell(U+1,this._workCell));){N.loadCell(U+1,this._workCell);const O=this._workCell.getChars().length;this._workCell.getWidth()===2?(R++,U++):O>1&&(I+=O-1,K+=O-1),K++,U++}}K++;let D=V+q-B+L,z=Math.min(this._bufferService.cols,K-V+B+R-L-I);if(P||$.slice(V,K).trim()!==""){if(T&&D===0&&N.getCodePoint(0)!==32){const F=j.lines.get(C[1]-1);if(F&&N.isWrapped&&F.getCodePoint(this._bufferService.cols-1)!==32){const U=this._getWordAt([this._bufferService.cols-1,C[1]-1],!1,!0,!1);if(U){const G=this._bufferService.cols-U.start;D-=G,z+=G}}}if(M&&D+z===this._bufferService.cols&&N.getCodePoint(this._bufferService.cols-1)!==32){const F=j.lines.get(C[1]+1);if(F!=null&&F.isWrapped&&F.getCodePoint(0)!==32){const U=this._getWordAt([0,C[1]+1],!1,!1,!0);U&&(z+=U.length)}}return{start:D,length:z}}}_selectWordAt(C,P){const T=this._getWordAt(C,P);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,C[1]--;this._model.selectionStart=[T.start,C[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(C){const P=this._getWordAt(C,!0);if(P){let T=C[1];for(;P.start<0;)P.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;P.start+P.length>this._bufferService.cols;)P.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?P.start:P.start+P.length,T]}}_isCharWordSeparator(C){return C.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(C.getChars())>=0}_selectLineAt(C){const P=this._bufferService.buffer.getWrappedRangeForLine(C),T={start:{x:0,y:P.first},end:{x:this._bufferService.cols-1,y:P.last}};this._model.selectionStart=[0,P.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,d.getRangeLength)(T,this._bufferService.cols)}};i.SelectionService=b=c([p(3,S.IBufferService),p(4,S.ICoreService),p(5,w.IMouseService),p(6,S.IOptionsService),p(7,w.IRenderService),p(8,w.ICoreBrowserService)],b)},4725:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ILinkProviderService=i.IThemeService=i.ICharacterJoinerService=i.ISelectionService=i.IRenderService=i.IMouseService=i.ICoreBrowserService=i.ICharSizeService=void 0;const c=a(8343);i.ICharSizeService=(0,c.createDecorator)("CharSizeService"),i.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),i.IMouseService=(0,c.createDecorator)("MouseService"),i.IRenderService=(0,c.createDecorator)("RenderService"),i.ISelectionService=(0,c.createDecorator)("SelectionService"),i.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),i.IThemeService=(0,c.createDecorator)("ThemeService"),i.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(l,i,a){var c=this&&this.__decorate||function(b,C,P,T){var M,j=arguments.length,N=j<3?C:T===null?T=Object.getOwnPropertyDescriptor(C,P):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(b,C,P,T);else for(var $=b.length-1;$>=0;$--)(M=b[$])&&(N=(j<3?M(N):j>3?M(C,P,N):M(C,P))||N);return j>3&&N&&Object.defineProperty(C,P,N),N},p=this&&this.__param||function(b,C){return function(P,T){C(P,T,b)}};Object.defineProperty(i,"__esModule",{value:!0}),i.ThemeService=i.DEFAULT_ANSI_COLORS=void 0;const u=a(7239),v=a(8055),y=a(8460),w=a(844),_=a(2585),m=v.css.toColor("#ffffff"),h=v.css.toColor("#000000"),d=v.css.toColor("#ffffff"),f=v.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};i.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const b=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],C=[0,95,135,175,215,255];for(let P=0;P<216;P++){const T=C[P/36%6|0],M=C[P/6%6|0],j=C[P%6];b.push({css:v.channels.toCss(T,M,j),rgba:v.channels.toRgba(T,M,j)})}for(let P=0;P<24;P++){const T=8+10*P;b.push({css:v.channels.toCss(T,T,T),rgba:v.channels.toRgba(T,T,T)})}return b})());let E=i.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(b){super(),this._optionsService=b,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new y.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:m,background:h,cursor:d,cursorAccent:f,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:v.color.blend(h,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:v.color.blend(h,S),ansi:i.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(b={}){const C=this._colors;if(C.foreground=k(b.foreground,m),C.background=k(b.background,h),C.cursor=k(b.cursor,d),C.cursorAccent=k(b.cursorAccent,f),C.selectionBackgroundTransparent=k(b.selectionBackground,S),C.selectionBackgroundOpaque=v.color.blend(C.background,C.selectionBackgroundTransparent),C.selectionInactiveBackgroundTransparent=k(b.selectionInactiveBackground,C.selectionBackgroundTransparent),C.selectionInactiveBackgroundOpaque=v.color.blend(C.background,C.selectionInactiveBackgroundTransparent),C.selectionForeground=b.selectionForeground?k(b.selectionForeground,v.NULL_COLOR):void 0,C.selectionForeground===v.NULL_COLOR&&(C.selectionForeground=void 0),v.color.isOpaque(C.selectionBackgroundTransparent)&&(C.selectionBackgroundTransparent=v.color.opacity(C.selectionBackgroundTransparent,.3)),v.color.isOpaque(C.selectionInactiveBackgroundTransparent)&&(C.selectionInactiveBackgroundTransparent=v.color.opacity(C.selectionInactiveBackgroundTransparent,.3)),C.ansi=i.DEFAULT_ANSI_COLORS.slice(),C.ansi[0]=k(b.black,i.DEFAULT_ANSI_COLORS[0]),C.ansi[1]=k(b.red,i.DEFAULT_ANSI_COLORS[1]),C.ansi[2]=k(b.green,i.DEFAULT_ANSI_COLORS[2]),C.ansi[3]=k(b.yellow,i.DEFAULT_ANSI_COLORS[3]),C.ansi[4]=k(b.blue,i.DEFAULT_ANSI_COLORS[4]),C.ansi[5]=k(b.magenta,i.DEFAULT_ANSI_COLORS[5]),C.ansi[6]=k(b.cyan,i.DEFAULT_ANSI_COLORS[6]),C.ansi[7]=k(b.white,i.DEFAULT_ANSI_COLORS[7]),C.ansi[8]=k(b.brightBlack,i.DEFAULT_ANSI_COLORS[8]),C.ansi[9]=k(b.brightRed,i.DEFAULT_ANSI_COLORS[9]),C.ansi[10]=k(b.brightGreen,i.DEFAULT_ANSI_COLORS[10]),C.ansi[11]=k(b.brightYellow,i.DEFAULT_ANSI_COLORS[11]),C.ansi[12]=k(b.brightBlue,i.DEFAULT_ANSI_COLORS[12]),C.ansi[13]=k(b.brightMagenta,i.DEFAULT_ANSI_COLORS[13]),C.ansi[14]=k(b.brightCyan,i.DEFAULT_ANSI_COLORS[14]),C.ansi[15]=k(b.brightWhite,i.DEFAULT_ANSI_COLORS[15]),b.extendedAnsi){const P=Math.min(C.ansi.length-16,b.extendedAnsi.length);for(let T=0;T<P;T++)C.ansi[T+16]=k(b.extendedAnsi[T],i.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(b){this._restoreColor(b),this._onChangeColors.fire(this.colors)}_restoreColor(b){if(b!==void 0)switch(b){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[b]=this._restoreColors.ansi[b]}else for(let C=0;C<this._restoreColors.ansi.length;++C)this._colors.ansi[C]=this._restoreColors.ansi[C]}modifyColors(b){b(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function k(b,C){if(b!==void 0)try{return v.css.toColor(b)}catch{}return C}i.ThemeService=E=c([p(0,_.IOptionsService)],E)},6349:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CircularList=void 0;const c=a(8460),p=a(844);class u extends p.Disposable{constructor(y){super(),this._maxLength=y,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(y){if(this._maxLength===y)return;const w=new Array(y);for(let _=0;_<Math.min(y,this.length);_++)w[_]=this._array[this._getCyclicIndex(_)];this._array=w,this._maxLength=y,this._startIndex=0}get length(){return this._length}set length(y){if(y>this._length)for(let w=this._length;w<y;w++)this._array[w]=void 0;this._length=y}get(y){return this._array[this._getCyclicIndex(y)]}set(y,w){this._array[this._getCyclicIndex(y)]=w}push(y){this._array[this._getCyclicIndex(this._length)]=y,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(y,w,..._){if(w){for(let m=y;m<this._length-w;m++)this._array[this._getCyclicIndex(m)]=this._array[this._getCyclicIndex(m+w)];this._length-=w,this.onDeleteEmitter.fire({index:y,amount:w})}for(let m=this._length-1;m>=y;m--)this._array[this._getCyclicIndex(m+_.length)]=this._array[this._getCyclicIndex(m)];for(let m=0;m<_.length;m++)this._array[this._getCyclicIndex(y+m)]=_[m];if(_.length&&this.onInsertEmitter.fire({index:y,amount:_.length}),this._length+_.length>this._maxLength){const m=this._length+_.length-this._maxLength;this._startIndex+=m,this._length=this._maxLength,this.onTrimEmitter.fire(m)}else this._length+=_.length}trimStart(y){y>this._length&&(y=this._length),this._startIndex+=y,this._length-=y,this.onTrimEmitter.fire(y)}shiftElements(y,w,_){if(!(w<=0)){if(y<0||y>=this._length)throw new Error("start argument out of range");if(y+_<0)throw new Error("Cannot shift elements in list beyond index 0");if(_>0){for(let h=w-1;h>=0;h--)this.set(y+h+_,this.get(y+h));const m=y+w+_-this._length;if(m>0)for(this._length+=m;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let m=0;m<w;m++)this.set(y+m+_,this.get(y+m))}}_getCyclicIndex(y){return(this._startIndex+y)%this._maxLength}}i.CircularList=u},1439:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clone=void 0,i.clone=function a(c,p=5){if(typeof c!="object")return c;const u=Array.isArray(c)?[]:{};for(const v in c)u[v]=p<=1?c[v]:c[v]&&a(c[v],p-1);return u}},8055:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.contrastRatio=i.toPaddedHex=i.rgba=i.rgb=i.css=i.color=i.channels=i.NULL_COLOR=void 0;let a=0,c=0,p=0,u=0;var v,y,w,_,m;function h(f){const S=f.toString(16);return S.length<2?"0"+S:S}function d(f,S){return f<S?(S+.05)/(f+.05):(f+.05)/(S+.05)}i.NULL_COLOR={css:"#00000000",rgba:0},function(f){f.toCss=function(S,E,k,b){return b!==void 0?`#${h(S)}${h(E)}${h(k)}${h(b)}`:`#${h(S)}${h(E)}${h(k)}`},f.toRgba=function(S,E,k,b=255){return(S<<24|E<<16|k<<8|b)>>>0},f.toColor=function(S,E,k,b){return{css:f.toCss(S,E,k,b),rgba:f.toRgba(S,E,k,b)}}}(v||(i.channels=v={})),function(f){function S(E,k){return u=Math.round(255*k),[a,c,p]=m.toChannels(E.rgba),{css:v.toCss(a,c,p,u),rgba:v.toRgba(a,c,p,u)}}f.blend=function(E,k){if(u=(255&k.rgba)/255,u===1)return{css:k.css,rgba:k.rgba};const b=k.rgba>>24&255,C=k.rgba>>16&255,P=k.rgba>>8&255,T=E.rgba>>24&255,M=E.rgba>>16&255,j=E.rgba>>8&255;return a=T+Math.round((b-T)*u),c=M+Math.round((C-M)*u),p=j+Math.round((P-j)*u),{css:v.toCss(a,c,p),rgba:v.toRgba(a,c,p)}},f.isOpaque=function(E){return(255&E.rgba)==255},f.ensureContrastRatio=function(E,k,b){const C=m.ensureContrastRatio(E.rgba,k.rgba,b);if(C)return v.toColor(C>>24&255,C>>16&255,C>>8&255)},f.opaque=function(E){const k=(255|E.rgba)>>>0;return[a,c,p]=m.toChannels(k),{css:v.toCss(a,c,p),rgba:k}},f.opacity=S,f.multiplyOpacity=function(E,k){return u=255&E.rgba,S(E,u*k/255)},f.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}}(y||(i.color=y={})),function(f){let S,E;try{const k=document.createElement("canvas");k.width=1,k.height=1;const b=k.getContext("2d",{willReadFrequently:!0});b&&(S=b,S.globalCompositeOperation="copy",E=S.createLinearGradient(0,0,1,1))}catch{}f.toColor=function(k){if(k.match(/#[\da-f]{3,8}/i))switch(k.length){case 4:return a=parseInt(k.slice(1,2).repeat(2),16),c=parseInt(k.slice(2,3).repeat(2),16),p=parseInt(k.slice(3,4).repeat(2),16),v.toColor(a,c,p);case 5:return a=parseInt(k.slice(1,2).repeat(2),16),c=parseInt(k.slice(2,3).repeat(2),16),p=parseInt(k.slice(3,4).repeat(2),16),u=parseInt(k.slice(4,5).repeat(2),16),v.toColor(a,c,p,u);case 7:return{css:k,rgba:(parseInt(k.slice(1),16)<<8|255)>>>0};case 9:return{css:k,rgba:parseInt(k.slice(1),16)>>>0}}const b=k.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(b)return a=parseInt(b[1]),c=parseInt(b[2]),p=parseInt(b[3]),u=Math.round(255*(b[5]===void 0?1:parseFloat(b[5]))),v.toColor(a,c,p,u);if(!S||!E)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=E,S.fillStyle=k,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[a,c,p,u]=S.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:v.toRgba(a,c,p,u),css:k}}}(w||(i.css=w={})),function(f){function S(E,k,b){const C=E/255,P=k/255,T=b/255;return .2126*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))+.7152*(P<=.03928?P/12.92:Math.pow((P+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}f.relativeLuminance=function(E){return S(E>>16&255,E>>8&255,255&E)},f.relativeLuminance2=S}(_||(i.rgb=_={})),function(f){function S(k,b,C){const P=k>>24&255,T=k>>16&255,M=k>>8&255;let j=b>>24&255,N=b>>16&255,$=b>>8&255,V=d(_.relativeLuminance2(j,N,$),_.relativeLuminance2(P,T,M));for(;V<C&&(j>0||N>0||$>0);)j-=Math.max(0,Math.ceil(.1*j)),N-=Math.max(0,Math.ceil(.1*N)),$-=Math.max(0,Math.ceil(.1*$)),V=d(_.relativeLuminance2(j,N,$),_.relativeLuminance2(P,T,M));return(j<<24|N<<16|$<<8|255)>>>0}function E(k,b,C){const P=k>>24&255,T=k>>16&255,M=k>>8&255;let j=b>>24&255,N=b>>16&255,$=b>>8&255,V=d(_.relativeLuminance2(j,N,$),_.relativeLuminance2(P,T,M));for(;V<C&&(j<255||N<255||$<255);)j=Math.min(255,j+Math.ceil(.1*(255-j))),N=Math.min(255,N+Math.ceil(.1*(255-N))),$=Math.min(255,$+Math.ceil(.1*(255-$))),V=d(_.relativeLuminance2(j,N,$),_.relativeLuminance2(P,T,M));return(j<<24|N<<16|$<<8|255)>>>0}f.blend=function(k,b){if(u=(255&b)/255,u===1)return b;const C=b>>24&255,P=b>>16&255,T=b>>8&255,M=k>>24&255,j=k>>16&255,N=k>>8&255;return a=M+Math.round((C-M)*u),c=j+Math.round((P-j)*u),p=N+Math.round((T-N)*u),v.toRgba(a,c,p)},f.ensureContrastRatio=function(k,b,C){const P=_.relativeLuminance(k>>8),T=_.relativeLuminance(b>>8);if(d(P,T)<C){if(T<P){const N=S(k,b,C),$=d(P,_.relativeLuminance(N>>8));if($<C){const V=E(k,b,C);return $>d(P,_.relativeLuminance(V>>8))?N:V}return N}const M=E(k,b,C),j=d(P,_.relativeLuminance(M>>8));if(j<C){const N=S(k,b,C);return j>d(P,_.relativeLuminance(N>>8))?M:N}return M}},f.reduceLuminance=S,f.increaseLuminance=E,f.toChannels=function(k){return[k>>24&255,k>>16&255,k>>8&255,255&k]}}(m||(i.rgba=m={})),i.toPaddedHex=h,i.contrastRatio=d},8969:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreTerminal=void 0;const c=a(844),p=a(2585),u=a(4348),v=a(7866),y=a(744),w=a(7302),_=a(6975),m=a(8460),h=a(1753),d=a(1480),f=a(7994),S=a(9282),E=a(5435),k=a(5981),b=a(2660);let C=!1;class P extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new m.EventEmitter),this._onScroll.event(M=>{var j;(j=this._onScrollApi)==null||j.fire(M.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(M){for(const j in M)this.optionsService.options[j]=M[j]}constructor(M){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new m.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new m.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new m.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new m.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new w.OptionsService(M)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(y.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(v.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(_.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(h.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(d.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(f.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(b.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,m.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,m.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,m.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,m.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(j=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(j=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new k.WriteBuffer((j,N)=>this._inputHandler.parse(j,N))),this.register((0,m.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(M,j){this._writeBuffer.write(M,j)}writeSync(M,j){this._logService.logLevel<=p.LogLevelEnum.WARN&&!C&&(this._logService.warn("writeSync is unreliable and will be removed soon."),C=!0),this._writeBuffer.writeSync(M,j)}input(M,j=!0){this.coreService.triggerDataEvent(M,j)}resize(M,j){isNaN(M)||isNaN(j)||(M=Math.max(M,y.MINIMUM_COLS),j=Math.max(j,y.MINIMUM_ROWS),this._bufferService.resize(M,j))}scroll(M,j=!1){this._bufferService.scroll(M,j)}scrollLines(M,j,N){this._bufferService.scrollLines(M,j,N)}scrollPages(M){this.scrollLines(M*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(M){const j=M-this._bufferService.buffer.ydisp;j!==0&&this.scrollLines(j)}registerEscHandler(M,j){return this._inputHandler.registerEscHandler(M,j)}registerDcsHandler(M,j){return this._inputHandler.registerDcsHandler(M,j)}registerCsiHandler(M,j){return this._inputHandler.registerCsiHandler(M,j)}registerOscHandler(M,j){return this._inputHandler.registerOscHandler(M,j)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let M=!1;const j=this.optionsService.rawOptions.windowsPty;j&&j.buildNumber!==void 0&&j.buildNumber!==void 0?M=j.backend==="conpty"&&j.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(M=!0),M?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const M=[];M.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),M.push(this.registerCsiHandler({final:"H"},()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)(()=>{for(const j of M)j.dispose()})}}}i.CoreTerminal=P},8460:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.runAndSubscribe=i.forwardEvent=i.EventEmitter=void 0,i.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const p=[];for(let u=0;u<this._listeners.length;u++)p.push(this._listeners[u]);for(let u=0;u<p.length;u++)p[u].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(a,c){return a(p=>c.fire(p))},i.runAndSubscribe=function(a,c){return c(void 0),a(p=>c(p))}},5435:function(l,i,a){var c=this&&this.__decorate||function(B,R,L,I){var D,z=arguments.length,F=z<3?R:I===null?I=Object.getOwnPropertyDescriptor(R,L):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(B,R,L,I);else for(var U=B.length-1;U>=0;U--)(D=B[U])&&(F=(z<3?D(F):z>3?D(R,L,F):D(R,L))||F);return z>3&&F&&Object.defineProperty(R,L,F),F},p=this&&this.__param||function(B,R){return function(L,I){R(L,I,B)}};Object.defineProperty(i,"__esModule",{value:!0}),i.InputHandler=i.WindowsOptionsReportType=void 0;const u=a(2584),v=a(7116),y=a(2015),w=a(844),_=a(482),m=a(8437),h=a(8460),d=a(643),f=a(511),S=a(3734),E=a(2585),k=a(1480),b=a(6242),C=a(6351),P=a(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},M=131072;function j(B,R){if(B>24)return R.setWinLines||!1;switch(B){case 1:return!!R.restoreWin;case 2:return!!R.minimizeWin;case 3:return!!R.setWinPosition;case 4:return!!R.setWinSizePixels;case 5:return!!R.raiseWin;case 6:return!!R.lowerWin;case 7:return!!R.refreshWin;case 8:return!!R.setWinSizeChars;case 9:return!!R.maximizeWin;case 10:return!!R.fullscreenWin;case 11:return!!R.getWinState;case 13:return!!R.getWinPosition;case 14:return!!R.getWinSizePixels;case 15:return!!R.getScreenSizePixels;case 16:return!!R.getCellSizePixels;case 18:return!!R.getWinSizeChars;case 19:return!!R.getScreenSizeChars;case 20:return!!R.getIconTitle;case 21:return!!R.getWinTitle;case 22:return!!R.pushTitle;case 23:return!!R.popTitle;case 24:return!!R.setWinLines}return!1}var N;(function(B){B[B.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",B[B.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(N||(i.WindowsOptionsReportType=N={}));let $=0;class V extends w.Disposable{getAttrData(){return this._curAttrData}constructor(R,L,I,D,z,F,U,G,O=new y.EscapeSequenceParser){super(),this._bufferService=R,this._charsetService=L,this._coreService=I,this._logService=D,this._optionsService=z,this._oscLinkService=F,this._coreMouseService=U,this._unicodeService=G,this._parser=O,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new _.StringToUtf32,this._utf8Decoder=new _.Utf8ToUtf32,this._workCell=new f.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new h.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new h.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new h.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new h.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new h.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new h.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new h.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new h.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new h.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new h.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new h.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new K(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(A=>this._activeBuffer=A.activeBuffer)),this._parser.setCsiHandlerFallback((A,W)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(A),params:W.toArray()})}),this._parser.setEscHandlerFallback(A=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(A)})}),this._parser.setExecuteHandlerFallback(A=>{this._logService.debug("Unknown EXECUTE code: ",{code:A})}),this._parser.setOscHandlerFallback((A,W,H)=>{this._logService.debug("Unknown OSC code: ",{identifier:A,action:W,data:H})}),this._parser.setDcsHandlerFallback((A,W,H)=>{W==="HOOK"&&(H=H.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(A),action:W,payload:H})}),this._parser.setPrintHandler((A,W,H)=>this.print(A,W,H)),this._parser.registerCsiHandler({final:"@"},A=>this.insertChars(A)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},A=>this.scrollLeft(A)),this._parser.registerCsiHandler({final:"A"},A=>this.cursorUp(A)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},A=>this.scrollRight(A)),this._parser.registerCsiHandler({final:"B"},A=>this.cursorDown(A)),this._parser.registerCsiHandler({final:"C"},A=>this.cursorForward(A)),this._parser.registerCsiHandler({final:"D"},A=>this.cursorBackward(A)),this._parser.registerCsiHandler({final:"E"},A=>this.cursorNextLine(A)),this._parser.registerCsiHandler({final:"F"},A=>this.cursorPrecedingLine(A)),this._parser.registerCsiHandler({final:"G"},A=>this.cursorCharAbsolute(A)),this._parser.registerCsiHandler({final:"H"},A=>this.cursorPosition(A)),this._parser.registerCsiHandler({final:"I"},A=>this.cursorForwardTab(A)),this._parser.registerCsiHandler({final:"J"},A=>this.eraseInDisplay(A,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},A=>this.eraseInDisplay(A,!0)),this._parser.registerCsiHandler({final:"K"},A=>this.eraseInLine(A,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},A=>this.eraseInLine(A,!0)),this._parser.registerCsiHandler({final:"L"},A=>this.insertLines(A)),this._parser.registerCsiHandler({final:"M"},A=>this.deleteLines(A)),this._parser.registerCsiHandler({final:"P"},A=>this.deleteChars(A)),this._parser.registerCsiHandler({final:"S"},A=>this.scrollUp(A)),this._parser.registerCsiHandler({final:"T"},A=>this.scrollDown(A)),this._parser.registerCsiHandler({final:"X"},A=>this.eraseChars(A)),this._parser.registerCsiHandler({final:"Z"},A=>this.cursorBackwardTab(A)),this._parser.registerCsiHandler({final:"`"},A=>this.charPosAbsolute(A)),this._parser.registerCsiHandler({final:"a"},A=>this.hPositionRelative(A)),this._parser.registerCsiHandler({final:"b"},A=>this.repeatPrecedingCharacter(A)),this._parser.registerCsiHandler({final:"c"},A=>this.sendDeviceAttributesPrimary(A)),this._parser.registerCsiHandler({prefix:">",final:"c"},A=>this.sendDeviceAttributesSecondary(A)),this._parser.registerCsiHandler({final:"d"},A=>this.linePosAbsolute(A)),this._parser.registerCsiHandler({final:"e"},A=>this.vPositionRelative(A)),this._parser.registerCsiHandler({final:"f"},A=>this.hVPosition(A)),this._parser.registerCsiHandler({final:"g"},A=>this.tabClear(A)),this._parser.registerCsiHandler({final:"h"},A=>this.setMode(A)),this._parser.registerCsiHandler({prefix:"?",final:"h"},A=>this.setModePrivate(A)),this._parser.registerCsiHandler({final:"l"},A=>this.resetMode(A)),this._parser.registerCsiHandler({prefix:"?",final:"l"},A=>this.resetModePrivate(A)),this._parser.registerCsiHandler({final:"m"},A=>this.charAttributes(A)),this._parser.registerCsiHandler({final:"n"},A=>this.deviceStatus(A)),this._parser.registerCsiHandler({prefix:"?",final:"n"},A=>this.deviceStatusPrivate(A)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},A=>this.softReset(A)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},A=>this.setCursorStyle(A)),this._parser.registerCsiHandler({final:"r"},A=>this.setScrollRegion(A)),this._parser.registerCsiHandler({final:"s"},A=>this.saveCursor(A)),this._parser.registerCsiHandler({final:"t"},A=>this.windowOptions(A)),this._parser.registerCsiHandler({final:"u"},A=>this.restoreCursor(A)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},A=>this.insertColumns(A)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},A=>this.deleteColumns(A)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},A=>this.selectProtected(A)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},A=>this.requestMode(A,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},A=>this.requestMode(A,!1)),this._parser.setExecuteHandler(u.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(u.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(u.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(u.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(u.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(u.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(u.C1.IND,()=>this.index()),this._parser.setExecuteHandler(u.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(u.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new b.OscHandler(A=>(this.setTitle(A),this.setIconName(A),!0))),this._parser.registerOscHandler(1,new b.OscHandler(A=>this.setIconName(A))),this._parser.registerOscHandler(2,new b.OscHandler(A=>this.setTitle(A))),this._parser.registerOscHandler(4,new b.OscHandler(A=>this.setOrReportIndexedColor(A))),this._parser.registerOscHandler(8,new b.OscHandler(A=>this.setHyperlink(A))),this._parser.registerOscHandler(10,new b.OscHandler(A=>this.setOrReportFgColor(A))),this._parser.registerOscHandler(11,new b.OscHandler(A=>this.setOrReportBgColor(A))),this._parser.registerOscHandler(12,new b.OscHandler(A=>this.setOrReportCursorColor(A))),this._parser.registerOscHandler(104,new b.OscHandler(A=>this.restoreIndexedColor(A))),this._parser.registerOscHandler(110,new b.OscHandler(A=>this.restoreFgColor(A))),this._parser.registerOscHandler(111,new b.OscHandler(A=>this.restoreBgColor(A))),this._parser.registerOscHandler(112,new b.OscHandler(A=>this.restoreCursorColor(A))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const A in v.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:A},()=>this.selectCharset("("+A)),this._parser.registerEscHandler({intermediates:")",final:A},()=>this.selectCharset(")"+A)),this._parser.registerEscHandler({intermediates:"*",final:A},()=>this.selectCharset("*"+A)),this._parser.registerEscHandler({intermediates:"+",final:A},()=>this.selectCharset("+"+A)),this._parser.registerEscHandler({intermediates:"-",final:A},()=>this.selectCharset("-"+A)),this._parser.registerEscHandler({intermediates:".",final:A},()=>this.selectCharset("."+A)),this._parser.registerEscHandler({intermediates:"/",final:A},()=>this.selectCharset("/"+A));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(A=>(this._logService.error("Parsing error: ",A),A)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new C.DcsHandler((A,W)=>this.requestStatusString(A,W)))}_preserveStack(R,L,I,D){this._parseStack.paused=!0,this._parseStack.cursorStartX=R,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=I,this._parseStack.position=D}_logSlowResolvingAsync(R){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([R,new Promise((L,I)=>setTimeout(()=>I("#SLOW_TIMEOUT"),5e3))]).catch(L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(R,L){let I,D=this._activeBuffer.x,z=this._activeBuffer.y,F=0;const U=this._parseStack.paused;if(U){if(I=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(I),I;D=this._parseStack.cursorStartX,z=this._parseStack.cursorStartY,this._parseStack.paused=!1,R.length>M&&(F=this._parseStack.position+M)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof R=="string"?` "${R}"`:` "${Array.prototype.map.call(R,A=>String.fromCharCode(A)).join("")}"`),typeof R=="string"?R.split("").map(A=>A.charCodeAt(0)):R),this._parseBuffer.length<R.length&&this._parseBuffer.length<M&&(this._parseBuffer=new Uint32Array(Math.min(R.length,M))),U||this._dirtyRowTracker.clearRange(),R.length>M)for(let A=F;A<R.length;A+=M){const W=A+M<R.length?A+M:R.length,H=typeof R=="string"?this._stringDecoder.decode(R.substring(A,W),this._parseBuffer):this._utf8Decoder.decode(R.subarray(A,W),this._parseBuffer);if(I=this._parser.parse(this._parseBuffer,H))return this._preserveStack(D,z,H,A),this._logSlowResolvingAsync(I),I}else if(!U){const A=typeof R=="string"?this._stringDecoder.decode(R,this._parseBuffer):this._utf8Decoder.decode(R,this._parseBuffer);if(I=this._parser.parse(this._parseBuffer,A))return this._preserveStack(D,z,A,0),this._logSlowResolvingAsync(I),I}this._activeBuffer.x===D&&this._activeBuffer.y===z||this._onCursorMove.fire();const G=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),O=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);O<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(O,this._bufferService.rows-1),Math.min(G,this._bufferService.rows-1))}print(R,L,I){let D,z;const F=this._charsetService.charset,U=this._optionsService.rawOptions.screenReaderMode,G=this._bufferService.cols,O=this._coreService.decPrivateModes.wraparound,A=this._coreService.modes.insertMode,W=this._curAttrData;let H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&I-L>0&&H.getWidth(this._activeBuffer.x-1)===2&&H.setCellFromCodepoint(this._activeBuffer.x-1,0,1,W);let Y=this._parser.precedingJoinState;for(let X=L;X<I;++X){if(D=R[X],D<127&&F){const be=F[String.fromCharCode(D)];be&&(D=be.charCodeAt(0))}const ne=this._unicodeService.charProperties(D,Y);z=k.UnicodeService.extractWidth(ne);const ie=k.UnicodeService.extractShouldJoin(ne),de=ie?k.UnicodeService.extractWidth(Y):0;if(Y=ne,U&&this._onA11yChar.fire((0,_.stringFromCodePoint)(D)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+z-de>G){if(O){const be=H;let se=this._activeBuffer.x-de;for(this._activeBuffer.x=de,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),H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),de>0&&H instanceof m.BufferLine&&H.copyCellsFrom(be,se,0,de,!1);se<G;)be.setCellFromCodepoint(se++,0,1,W)}else if(this._activeBuffer.x=G-1,z===2)continue}if(ie&&this._activeBuffer.x){const be=H.getWidth(this._activeBuffer.x-1)?1:2;H.addCodepointToCell(this._activeBuffer.x-be,D,z);for(let se=z-de;--se>=0;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,W)}else if(A&&(H.insertCells(this._activeBuffer.x,z-de,this._activeBuffer.getNullCell(W)),H.getWidth(G-1)===2&&H.setCellFromCodepoint(G-1,d.NULL_CELL_CODE,d.NULL_CELL_WIDTH,W)),H.setCellFromCodepoint(this._activeBuffer.x++,D,z,W),z>0)for(;--z;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,W)}this._parser.precedingJoinState=Y,this._activeBuffer.x<G&&I-L>0&&H.getWidth(this._activeBuffer.x)===0&&!H.hasContent(this._activeBuffer.x)&&H.setCellFromCodepoint(this._activeBuffer.x,0,1,W),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(R,L){return R.final!=="t"||R.prefix||R.intermediates?this._parser.registerCsiHandler(R,L):this._parser.registerCsiHandler(R,I=>!j(I.params[0],this._optionsService.rawOptions.windowOptions)||L(I))}registerDcsHandler(R,L){return this._parser.registerDcsHandler(R,new C.DcsHandler(L))}registerEscHandler(R,L){return this._parser.registerEscHandler(R,L)}registerOscHandler(R,L){return this._parser.registerOscHandler(R,new b.OscHandler(L))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var R;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&&((R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&R.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);L.hasWidth(this._activeBuffer.x)&&!L.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const R=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-R),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(R=this._bufferService.cols-1){this._activeBuffer.x=Math.min(R,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(R,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=R,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=R,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(R,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+R,this._activeBuffer.y+L)}cursorUp(R){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,R.params[0]||1)):this._moveCursor(0,-(R.params[0]||1)),!0}cursorDown(R){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,R.params[0]||1)):this._moveCursor(0,R.params[0]||1),!0}cursorForward(R){return this._moveCursor(R.params[0]||1,0),!0}cursorBackward(R){return this._moveCursor(-(R.params[0]||1),0),!0}cursorNextLine(R){return this.cursorDown(R),this._activeBuffer.x=0,!0}cursorPrecedingLine(R){return this.cursorUp(R),this._activeBuffer.x=0,!0}cursorCharAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(R){return this._setCursor(R.length>=2?(R.params[1]||1)-1:0,(R.params[0]||1)-1),!0}charPosAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(R){return this._moveCursor(R.params[0]||1,0),!0}linePosAbsolute(R){return this._setCursor(this._activeBuffer.x,(R.params[0]||1)-1),!0}vPositionRelative(R){return this._moveCursor(0,R.params[0]||1),!0}hVPosition(R){return this.cursorPosition(R),!0}tabClear(R){const L=R.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=R.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=R.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(R){const L=R.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(R,L,I,D=!1,z=!1){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);F.replaceCells(L,I,this._activeBuffer.getNullCell(this._eraseAttrData()),z),D&&(F.isWrapped=!1)}_resetBufferLine(R,L=!1){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);I&&(I.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+R),I.isWrapped=!1)}eraseInDisplay(R,L=!1){let I;switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);I<this._bufferService.rows;I++)this._resetBufferLine(I,L);this._dirtyRowTracker.markDirty(I);break;case 1:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I,0,this._activeBuffer.x+1,!0,L),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(I+1).isWrapped=!1);I--;)this._resetBufferLine(I,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(I=this._bufferService.rows,this._dirtyRowTracker.markDirty(I-1);I--;)this._resetBufferLine(I,L);this._dirtyRowTracker.markDirty(0);break;case 3:const D=this._activeBuffer.lines.length-this._bufferService.rows;D>0&&(this._activeBuffer.lines.trimStart(D),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-D,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-D,0),this._onScroll.fire(0))}return!0}eraseInLine(R,L=!1){switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(R){this._restrictCursor();let L=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=this._activeBuffer.ybase+this._activeBuffer.y,D=this._bufferService.rows-1-this._activeBuffer.scrollBottom,z=this._bufferService.rows-1+this._activeBuffer.ybase-D+1;for(;L--;)this._activeBuffer.lines.splice(z-1,1),this._activeBuffer.lines.splice(I,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(R){this._restrictCursor();let L=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=this._activeBuffer.ybase+this._activeBuffer.y;let D;for(D=this._bufferService.rows-1-this._activeBuffer.scrollBottom,D=this._bufferService.rows-1+this._activeBuffer.ybase-D;L--;)this._activeBuffer.lines.splice(I,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(R){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.insertCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(R){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.deleteCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(R){let L=R.params[0]||1;for(;L--;)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(R){let L=R.params[0]||1;for(;L--;)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(m.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=R.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);D.deleteCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=R.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);D.insertCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=R.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);D.insertCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=R.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);D.deleteCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(R){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(R.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(R){const L=this._parser.precedingJoinState;if(!L)return!0;const I=R.params[0]||1,D=k.UnicodeService.extractWidth(L),z=this._activeBuffer.x-D,F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(z),U=new Uint32Array(F.length*I);let G=0;for(let A=0;A<F.length;){const W=F.codePointAt(A)||0;U[G++]=W,A+=W>65535?2:1}let O=G;for(let A=1;A<I;++A)U.copyWithin(O,0,G),O+=G;return this.print(U,0,O),!0}sendDeviceAttributesPrimary(R){return R.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(R){return R.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(R.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(R){return(this._optionsService.rawOptions.termName+"").indexOf(R)===0}setMode(R){for(let L=0;L<R.length;L++)switch(R.params[L]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(R){for(let L=0;L<R.length;L++)switch(R.params[L]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),this._charsetService.setgCharset(1,v.DEFAULT_CHARSET),this._charsetService.setgCharset(2,v.DEFAULT_CHARSET),this._charsetService.setgCharset(3,v.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(R){for(let L=0;L<R.length;L++)switch(R.params[L]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(R){for(let L=0;L<R.length;L++)switch(R.params[L]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),R.params[L]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(R,L){const I=this._coreService.decPrivateModes,{activeProtocol:D,activeEncoding:z}=this._coreMouseService,F=this._coreService,{buffers:U,cols:G}=this._bufferService,{active:O,alt:A}=U,W=this._optionsService.rawOptions,H=ie=>ie?1:2,Y=R.params[0];return X=Y,ne=L?Y===2?4:Y===4?H(F.modes.insertMode):Y===12?3:Y===20?H(W.convertEol):0:Y===1?H(I.applicationCursorKeys):Y===3?W.windowOptions.setWinLines?G===80?2:G===132?1:0:0:Y===6?H(I.origin):Y===7?H(I.wraparound):Y===8?3:Y===9?H(D==="X10"):Y===12?H(W.cursorBlink):Y===25?H(!F.isCursorHidden):Y===45?H(I.reverseWraparound):Y===66?H(I.applicationKeypad):Y===67?4:Y===1e3?H(D==="VT200"):Y===1002?H(D==="DRAG"):Y===1003?H(D==="ANY"):Y===1004?H(I.sendFocus):Y===1005?4:Y===1006?H(z==="SGR"):Y===1015?4:Y===1016?H(z==="SGR_PIXELS"):Y===1048?1:Y===47||Y===1047||Y===1049?H(O===A):Y===2004?H(I.bracketedPasteMode):0,F.triggerDataEvent(`${u.C0.ESC}[${L?"":"?"}${X};${ne}$y`),!0;var X,ne}_updateAttrColor(R,L,I,D,z){return L===2?(R|=50331648,R&=-16777216,R|=S.AttributeData.fromColorRGB([I,D,z])):L===5&&(R&=-50331904,R|=33554432|255&I),R}_extractColor(R,L,I){const D=[0,0,-1,0,0,0];let z=0,F=0;do{if(D[F+z]=R.params[L+F],R.hasSubParams(L+F)){const U=R.getSubParams(L+F);let G=0;do D[1]===5&&(z=1),D[F+G+1+z]=U[G];while(++G<U.length&&G+F+1+z<D.length);break}if(D[1]===5&&F+z>=2||D[1]===2&&F+z>=5)break;D[1]&&(z=1)}while(++F+L<R.length&&F+z<D.length);for(let U=2;U<D.length;++U)D[U]===-1&&(D[U]=0);switch(D[0]){case 38:I.fg=this._updateAttrColor(I.fg,D[1],D[3],D[4],D[5]);break;case 48:I.bg=this._updateAttrColor(I.bg,D[1],D[3],D[4],D[5]);break;case 58:I.extended=I.extended.clone(),I.extended.underlineColor=this._updateAttrColor(I.extended.underlineColor,D[1],D[3],D[4],D[5])}return F}_processUnderline(R,L){L.extended=L.extended.clone(),(!~R||R>5)&&(R=1),L.extended.underlineStyle=R,L.fg|=268435456,R===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(R){R.fg=m.DEFAULT_ATTR_DATA.fg,R.bg=m.DEFAULT_ATTR_DATA.bg,R.extended=R.extended.clone(),R.extended.underlineStyle=0,R.extended.underlineColor&=-67108864,R.updateExtended()}charAttributes(R){if(R.length===1&&R.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=R.length;let I;const D=this._curAttrData;for(let z=0;z<L;z++)I=R.params[z],I>=30&&I<=37?(D.fg&=-50331904,D.fg|=16777216|I-30):I>=40&&I<=47?(D.bg&=-50331904,D.bg|=16777216|I-40):I>=90&&I<=97?(D.fg&=-50331904,D.fg|=16777224|I-90):I>=100&&I<=107?(D.bg&=-50331904,D.bg|=16777224|I-100):I===0?this._processSGR0(D):I===1?D.fg|=134217728:I===3?D.bg|=67108864:I===4?(D.fg|=268435456,this._processUnderline(R.hasSubParams(z)?R.getSubParams(z)[0]:1,D)):I===5?D.fg|=536870912:I===7?D.fg|=67108864:I===8?D.fg|=1073741824:I===9?D.fg|=2147483648:I===2?D.bg|=134217728:I===21?this._processUnderline(2,D):I===22?(D.fg&=-134217729,D.bg&=-134217729):I===23?D.bg&=-67108865:I===24?(D.fg&=-268435457,this._processUnderline(0,D)):I===25?D.fg&=-536870913:I===27?D.fg&=-67108865:I===28?D.fg&=-1073741825:I===29?D.fg&=2147483647:I===39?(D.fg&=-67108864,D.fg|=16777215&m.DEFAULT_ATTR_DATA.fg):I===49?(D.bg&=-67108864,D.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):I===38||I===48||I===58?z+=this._extractColor(R,z,D):I===53?D.bg|=1073741824:I===55?D.bg&=-1073741825:I===59?(D.extended=D.extended.clone(),D.extended.underlineColor=-1,D.updateExtended()):I===100?(D.fg&=-67108864,D.fg|=16777215&m.DEFAULT_ATTR_DATA.fg,D.bg&=-67108864,D.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",I);return!0}deviceStatus(R){switch(R.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${L};${I}R`)}return!0}deviceStatusPrivate(R){if(R.params[0]===6){const L=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${L};${I}R`)}return!0}softReset(R){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(R){const L=R.params[0]||1;switch(L){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const I=L%2==1;return this._optionsService.options.cursorBlink=I,!0}setScrollRegion(R){const L=R.params[0]||1;let I;return(R.length<2||(I=R.params[1])>this._bufferService.rows||I===0)&&(I=this._bufferService.rows),I>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=I-1,this._setCursor(0,0)),!0}windowOptions(R){if(!j(R.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=R.length>1?R.params[1]:0;switch(R.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(N.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(N.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(R){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(R){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(R){return this._windowTitle=R,this._onTitleChange.fire(R),!0}setIconName(R){return this._iconName=R,!0}setOrReportIndexedColor(R){const L=[],I=R.split(";");for(;I.length>1;){const D=I.shift(),z=I.shift();if(/^\d+$/.exec(D)){const F=parseInt(D);if(q(F))if(z==="?")L.push({type:0,index:F});else{const U=(0,P.parseColor)(z);U&&L.push({type:1,index:F,color:U})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(R){const L=R.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(R,L){this._getCurrentLinkId()&&this._finishHyperlink();const I=R.split(":");let D;const z=I.findIndex(F=>F.startsWith("id="));return z!==-1&&(D=I[z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:D,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(R,L){const I=R.split(";");for(let D=0;D<I.length&&!(L>=this._specialColors.length);++D,++L)if(I[D]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const z=(0,P.parseColor)(I[D]);z&&this._onColor.fire([{type:1,index:this._specialColors[L],color:z}])}return!0}setOrReportFgColor(R){return this._setOrReportSpecialColor(R,0)}setOrReportBgColor(R){return this._setOrReportSpecialColor(R,1)}setOrReportCursorColor(R){return this._setOrReportSpecialColor(R,2)}restoreIndexedColor(R){if(!R)return this._onColor.fire([{type:2}]),!0;const L=[],I=R.split(";");for(let D=0;D<I.length;++D)if(/^\d+$/.exec(I[D])){const z=parseInt(I[D]);q(z)&&L.push({type:2,index:z})}return L.length&&this._onColor.fire(L),!0}restoreFgColor(R){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(R){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(R){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,v.DEFAULT_CHARSET),!0}selectCharset(R){return R.length!==2?(this.selectDefaultCharset(),!0):(R[0]==="/"||this._charsetService.setgCharset(T[R[0]],v.CHARSETS[R[1]]||v.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const R=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,R,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=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(R){return this._charsetService.setgLevel(R),!0}screenAlignmentPattern(){const R=new f.CellData;R.content=4194373,R.fg=this._curAttrData.fg,R.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L<this._bufferService.rows;++L){const I=this._activeBuffer.ybase+this._activeBuffer.y+L,D=this._activeBuffer.lines.get(I);D&&(D.fill(R),D.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(R,L){const I=this._bufferService.buffer,D=this._optionsService.rawOptions;return(z=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${z}${u.C0.ESC}\\`),!0))(R==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:R==='"p'?'P1$r61;1"p':R==="r"?`P1$r${I.scrollTop+1};${I.scrollBottom+1}r`:R==="m"?"P1$r0m":R===" q"?`P1$r${{block:2,underline:4,bar:6}[D.cursorStyle]-(D.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(R,L){this._dirtyRowTracker.markRangeDirty(R,L)}}i.InputHandler=V;let K=class{constructor(B){this._bufferService=B,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(B){B<this.start?this.start=B:B>this.end&&(this.end=B)}markRangeDirty(B,R){B>R&&($=B,B=R,R=$),B<this.start&&(this.start=B),R>this.end&&(this.end=R)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function q(B){return 0<=B&&B<256}K=c([p(0,E.IBufferService)],K)},844:(l,i)=>{function a(c){for(const p of c)p.dispose();c.length=0}Object.defineProperty(i,"__esModule",{value:!0}),i.getDisposeArrayDisposable=i.disposeArray=i.toDisposable=i.MutableDisposable=i.Disposable=void 0,i.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const p=this._disposables.indexOf(c);p!==-1&&this._disposables.splice(p,1)}},i.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var p;this._isDisposed||c===this._value||((p=this._value)==null||p.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},i.toDisposable=function(c){return{dispose:c}},i.disposeArray=a,i.getDisposeArrayDisposable=function(c){return{dispose:()=>a(c)}}},1505:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.FourKeyMap=i.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(p,u,v){this._data[p]||(this._data[p]={}),this._data[p][u]=v}get(p,u){return this._data[p]?this._data[p][u]:void 0}clear(){this._data={}}}i.TwoKeyMap=a,i.FourKeyMap=class{constructor(){this._data=new a}set(c,p,u,v,y){this._data.get(c,p)||this._data.set(c,p,new a),this._data.get(c,p).set(u,v,y)}get(c,p,u,v){var y;return(y=this._data.get(c,p))==null?void 0:y.get(u,v)}clear(){this._data.clear()}}},6114:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isChromeOS=i.isLinux=i.isWindows=i.isIphone=i.isIpad=i.isMac=i.getSafariVersion=i.isSafari=i.isLegacyEdge=i.isFirefox=i.isNode=void 0,i.isNode=typeof process<"u"&&"title"in process;const a=i.isNode?"node":navigator.userAgent,c=i.isNode?"node":navigator.platform;i.isFirefox=a.includes("Firefox"),i.isLegacyEdge=a.includes("Edge"),i.isSafari=/^((?!chrome|android).)*safari/i.test(a),i.getSafariVersion=function(){if(!i.isSafari)return 0;const p=a.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},i.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),i.isIpad=c==="iPad",i.isIphone=c==="iPhone",i.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),i.isLinux=c.indexOf("Linux")>=0,i.isChromeOS=/\bCrOS\b/.test(a)},6106:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SortedList=void 0;let a=0;i.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(a=this._search(this._getKey(c)),this._array.splice(a,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const p=this._getKey(c);if(p===void 0||(a=this._search(p),a===-1)||this._getKey(this._array[a])!==p)return!1;do if(this._array[a]===c)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===p);return!1}*getKeyIterator(c){if(this._array.length!==0&&(a=this._search(c),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===c))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===c)}forEachByKey(c,p){if(this._array.length!==0&&(a=this._search(c),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===c))do p(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===c)}values(){return[...this._array].values()}_search(c){let p=0,u=this._array.length-1;for(;u>=p;){let v=p+u>>1;const y=this._getKey(this._array[v]);if(y>c)u=v-1;else{if(!(y<c)){for(;v>0&&this._getKey(this._array[v-1])===c;)v--;return v}p=v+1}}return p}}},7226:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DebouncedIdleTask=i.IdleTaskQueue=i.PriorityTaskQueue=void 0;const c=a(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(y){this._tasks.push(y),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(y){this._idleCallback=void 0;let w=0,_=0,m=y.timeRemaining(),h=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),_=Math.max(w,_),h=y.timeRemaining(),1.5*_>h)return m-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(m-w))}ms`),void this._start();m=h}this.clear()}}class u extends p{_requestCallback(y){return setTimeout(()=>y(this._createDeadline(16)))}_cancelCallback(y){clearTimeout(y)}_createDeadline(y){const w=Date.now()+y;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}i.PriorityTaskQueue=u,i.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:u,i.DebouncedIdleTask=class{constructor(){this._queue=new i.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},9282:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.updateWindowsModeWrappedState=void 0;const c=a(643);i.updateWindowsModeWrappedState=function(p){const u=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),v=u==null?void 0:u.get(p.cols-1),y=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);y&&v&&(y.isWrapped=v[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&v[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ExtendedAttrs=i.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new a;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}i.AttributeData=a;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,v=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=v}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}i.ExtendedAttrs=c},9092:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Buffer=i.MAX_BUFFER_SIZE=void 0;const c=a(6349),p=a(7226),u=a(3734),v=a(8437),y=a(4634),w=a(511),_=a(643),m=a(4863),h=a(7116);i.MAX_BUFFER_SIZE=4294967295,i.Buffer=class{constructor(d,f,S){this._hasScrollback=d,this._optionsService=f,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=h.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(d){return d?(this._nullCell.fg=d.fg,this._nullCell.bg=d.bg,this._nullCell.extended=d.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(d){return d?(this._whitespaceCell.fg=d.fg,this._whitespaceCell.bg=d.bg,this._whitespaceCell.extended=d.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(d,f){return new v.BufferLine(this._bufferService.cols,this.getNullCell(d),f)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const d=this.ybase+this.y-this.ydisp;return d>=0&&d<this._rows}_getCorrectBufferLength(d){if(!this._hasScrollback)return d;const f=d+this._optionsService.rawOptions.scrollback;return f>i.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:f}fillViewportRows(d){if(this.lines.length===0){d===void 0&&(d=v.DEFAULT_ATTR_DATA);let f=this._rows;for(;f--;)this.lines.push(this.getBlankLine(d))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(d,f){const S=this.getNullCell(v.DEFAULT_ATTR_DATA);let E=0;const k=this._getCorrectBufferLength(f);if(k>this.lines.maxLength&&(this.lines.maxLength=k),this.lines.length>0){if(this._cols<d)for(let C=0;C<this.lines.length;C++)E+=+this.lines.get(C).resize(d,S);let b=0;if(this._rows<f)for(let C=this._rows;C<f;C++)this.lines.length<f+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new v.BufferLine(d,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+b+1?(this.ybase--,b++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(d,S)));else for(let C=this._rows;C>f;C--)this.lines.length>f+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(k<this.lines.maxLength){const C=this.lines.length-k;C>0&&(this.lines.trimStart(C),this.ybase=Math.max(this.ybase-C,0),this.ydisp=Math.max(this.ydisp-C,0),this.savedY=Math.max(this.savedY-C,0)),this.lines.maxLength=k}this.x=Math.min(this.x,d-1),this.y=Math.min(this.y,f-1),b&&(this.y+=b),this.savedX=Math.min(this.savedX,d-1),this.scrollTop=0}if(this.scrollBottom=f-1,this._isReflowEnabled&&(this._reflow(d,f),this._cols>d))for(let b=0;b<this.lines.length;b++)E+=+this.lines.get(b).resize(d,S);this._cols=d,this._rows=f,this._memoryCleanupQueue.clear(),E>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let d=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,d=!1);let f=0;for(;this._memoryCleanupPosition<this.lines.length;)if(f+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),f>100)return!0;return d}get _isReflowEnabled(){const d=this._optionsService.rawOptions.windowsPty;return d&&d.buildNumber?this._hasScrollback&&d.backend==="conpty"&&d.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(d,f){this._cols!==d&&(d>this._cols?this._reflowLarger(d,f):this._reflowSmaller(d,f))}_reflowLarger(d,f){const S=(0,y.reflowLargerGetLinesToRemove)(this.lines,this._cols,d,this.ybase+this.y,this.getNullCell(v.DEFAULT_ATTR_DATA));if(S.length>0){const E=(0,y.reflowLargerCreateNewLayout)(this.lines,S);(0,y.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(d,f,E.countRemoved)}}_reflowLargerAdjustViewport(d,f,S){const E=this.getNullCell(v.DEFAULT_ATTR_DATA);let k=S;for(;k-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<f&&this.lines.push(new v.BufferLine(d,E))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(d,f){const S=this.getNullCell(v.DEFAULT_ATTR_DATA),E=[];let k=0;for(let b=this.lines.length-1;b>=0;b--){let C=this.lines.get(b);if(!C||!C.isWrapped&&C.getTrimmedLength()<=d)continue;const P=[C];for(;C.isWrapped&&b>0;)C=this.lines.get(--b),P.unshift(C);const T=this.ybase+this.y;if(T>=b&&T<b+P.length)continue;const M=P[P.length-1].getTrimmedLength(),j=(0,y.reflowSmallerGetNewLineLengths)(P,this._cols,d),N=j.length-P.length;let $;$=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+N):Math.max(0,this.lines.length-this.lines.maxLength+N);const V=[];for(let I=0;I<N;I++){const D=this.getBlankLine(v.DEFAULT_ATTR_DATA,!0);V.push(D)}V.length>0&&(E.push({start:b+P.length+k,newLines:V}),k+=V.length),P.push(...V);let K=j.length-1,q=j[K];q===0&&(K--,q=j[K]);let B=P.length-N-1,R=M;for(;B>=0;){const I=Math.min(R,q);if(P[K]===void 0)break;if(P[K].copyCellsFrom(P[B],R-I,q-I,I,!0),q-=I,q===0&&(K--,q=j[K]),R-=I,R===0){B--;const D=Math.max(B,0);R=(0,y.getWrappedLineTrimmedLength)(P,D,this._cols)}}for(let I=0;I<P.length;I++)j[I]<d&&P[I].setCell(j[I],S);let L=N-$;for(;L-- >0;)this.ybase===0?this.y<f-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+k)-f&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+N,this.ybase+f-1)}if(E.length>0){const b=[],C=[];for(let K=0;K<this.lines.length;K++)C.push(this.lines.get(K));const P=this.lines.length;let T=P-1,M=0,j=E[M];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+k);let N=0;for(let K=Math.min(this.lines.maxLength-1,P+k-1);K>=0;K--)if(j&&j.start>T+N){for(let q=j.newLines.length-1;q>=0;q--)this.lines.set(K--,j.newLines[q]);K++,b.push({index:T+1,amount:j.newLines.length}),N+=j.newLines.length,j=E[++M]}else this.lines.set(K,C[T--]);let $=0;for(let K=b.length-1;K>=0;K--)b[K].index+=$,this.lines.onInsertEmitter.fire(b[K]),$+=b[K].amount;const V=Math.max(0,P+k-this.lines.maxLength);V>0&&this.lines.onTrimEmitter.fire(V)}}translateBufferLineToString(d,f,S=0,E){const k=this.lines.get(d);return k?k.translateToString(f,S,E):""}getWrappedRangeForLine(d){let f=d,S=d;for(;f>0&&this.lines.get(f).isWrapped;)f--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:f,last:S}}setupTabStops(d){for(d!=null?this.tabs[d]||(d=this.prevStop(d)):(this.tabs={},d=0);d<this._cols;d+=this._optionsService.rawOptions.tabStopWidth)this.tabs[d]=!0}prevStop(d){for(d==null&&(d=this.x);!this.tabs[--d]&&d>0;);return d>=this._cols?this._cols-1:d<0?0:d}nextStop(d){for(d==null&&(d=this.x);!this.tabs[++d]&&d<this._cols;);return d>=this._cols?this._cols-1:d<0?0:d}clearMarkers(d){this._isClearing=!0;for(let f=0;f<this.markers.length;f++)this.markers[f].line===d&&(this.markers[f].dispose(),this.markers.splice(f--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let d=0;d<this.markers.length;d++)this.markers[d].dispose(),this.markers.splice(d--,1);this._isClearing=!1}addMarker(d){const f=new m.Marker(d);return this.markers.push(f),f.register(this.lines.onTrim(S=>{f.line-=S,f.line<0&&f.dispose()})),f.register(this.lines.onInsert(S=>{f.line>=S.index&&(f.line+=S.amount)})),f.register(this.lines.onDelete(S=>{f.line>=S.index&&f.line<S.index+S.amount&&f.dispose(),f.line>S.index&&(f.line-=S.amount)})),f.register(f.onDispose(()=>this._removeMarker(f))),f}_removeMarker(d){this._isClearing||this.markers.splice(this.markers.indexOf(d),1)}}},8437:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLine=i.DEFAULT_ATTR_DATA=void 0;const c=a(3734),p=a(511),u=a(643),v=a(482);i.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let y=0;class w{constructor(m,h,d=!1){this.isWrapped=d,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*m);const f=h||p.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let S=0;S<m;++S)this.setCell(S,f);this.length=m}get(m){const h=this._data[3*m+0],d=2097151&h;return[this._data[3*m+1],2097152&h?this._combined[m]:d?(0,v.stringFromCodePoint)(d):"",h>>22,2097152&h?this._combined[m].charCodeAt(this._combined[m].length-1):d]}set(m,h){this._data[3*m+1]=h[u.CHAR_DATA_ATTR_INDEX],h[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[m]=h[1],this._data[3*m+0]=2097152|m|h[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*m+0]=h[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|h[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(m){return this._data[3*m+0]>>22}hasWidth(m){return 12582912&this._data[3*m+0]}getFg(m){return this._data[3*m+1]}getBg(m){return this._data[3*m+2]}hasContent(m){return 4194303&this._data[3*m+0]}getCodePoint(m){const h=this._data[3*m+0];return 2097152&h?this._combined[m].charCodeAt(this._combined[m].length-1):2097151&h}isCombined(m){return 2097152&this._data[3*m+0]}getString(m){const h=this._data[3*m+0];return 2097152&h?this._combined[m]:2097151&h?(0,v.stringFromCodePoint)(2097151&h):""}isProtected(m){return 536870912&this._data[3*m+2]}loadCell(m,h){return y=3*m,h.content=this._data[y+0],h.fg=this._data[y+1],h.bg=this._data[y+2],2097152&h.content&&(h.combinedData=this._combined[m]),268435456&h.bg&&(h.extended=this._extendedAttrs[m]),h}setCell(m,h){2097152&h.content&&(this._combined[m]=h.combinedData),268435456&h.bg&&(this._extendedAttrs[m]=h.extended),this._data[3*m+0]=h.content,this._data[3*m+1]=h.fg,this._data[3*m+2]=h.bg}setCellFromCodepoint(m,h,d,f){268435456&f.bg&&(this._extendedAttrs[m]=f.extended),this._data[3*m+0]=h|d<<22,this._data[3*m+1]=f.fg,this._data[3*m+2]=f.bg}addCodepointToCell(m,h,d){let f=this._data[3*m+0];2097152&f?this._combined[m]+=(0,v.stringFromCodePoint)(h):2097151&f?(this._combined[m]=(0,v.stringFromCodePoint)(2097151&f)+(0,v.stringFromCodePoint)(h),f&=-2097152,f|=2097152):f=h|4194304,d&&(f&=-12582913,f|=d<<22),this._data[3*m+0]=f}insertCells(m,h,d){if((m%=this.length)&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,d),h<this.length-m){const f=new p.CellData;for(let S=this.length-m-h-1;S>=0;--S)this.setCell(m+h+S,this.loadCell(m+S,f));for(let S=0;S<h;++S)this.setCell(m+S,d)}else for(let f=m;f<this.length;++f)this.setCell(f,d);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,d)}deleteCells(m,h,d){if(m%=this.length,h<this.length-m){const f=new p.CellData;for(let S=0;S<this.length-m-h;++S)this.setCell(m+S,this.loadCell(m+h+S,f));for(let S=this.length-h;S<this.length;++S)this.setCell(S,d)}else for(let f=m;f<this.length;++f)this.setCell(f,d);m&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,d),this.getWidth(m)!==0||this.hasContent(m)||this.setCellFromCodepoint(m,0,1,d)}replaceCells(m,h,d,f=!1){if(f)for(m&&this.getWidth(m-1)===2&&!this.isProtected(m-1)&&this.setCellFromCodepoint(m-1,0,1,d),h<this.length&&this.getWidth(h-1)===2&&!this.isProtected(h)&&this.setCellFromCodepoint(h,0,1,d);m<h&&m<this.length;)this.isProtected(m)||this.setCell(m,d),m++;else for(m&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,d),h<this.length&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h,0,1,d);m<h&&m<this.length;)this.setCell(m++,d)}resize(m,h){if(m===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const d=3*m;if(m>this.length){if(this._data.buffer.byteLength>=4*d)this._data=new Uint32Array(this._data.buffer,0,d);else{const f=new Uint32Array(d);f.set(this._data),this._data=f}for(let f=this.length;f<m;++f)this.setCell(f,h)}else{this._data=this._data.subarray(0,d);const f=Object.keys(this._combined);for(let E=0;E<f.length;E++){const k=parseInt(f[E],10);k>=m&&delete this._combined[k]}const S=Object.keys(this._extendedAttrs);for(let E=0;E<S.length;E++){const k=parseInt(S[E],10);k>=m&&delete this._extendedAttrs[k]}}return this.length=m,4*d*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const m=new Uint32Array(this._data.length);return m.set(this._data),this._data=m,1}return 0}fill(m,h=!1){if(h)for(let d=0;d<this.length;++d)this.isProtected(d)||this.setCell(d,m);else{this._combined={},this._extendedAttrs={};for(let d=0;d<this.length;++d)this.setCell(d,m)}}copyFrom(m){this.length!==m.length?this._data=new Uint32Array(m._data):this._data.set(m._data),this.length=m.length,this._combined={};for(const h in m._combined)this._combined[h]=m._combined[h];this._extendedAttrs={};for(const h in m._extendedAttrs)this._extendedAttrs[h]=m._extendedAttrs[h];this.isWrapped=m.isWrapped}clone(){const m=new w(0);m._data=new Uint32Array(this._data),m.length=this.length;for(const h in this._combined)m._combined[h]=this._combined[h];for(const h in this._extendedAttrs)m._extendedAttrs[h]=this._extendedAttrs[h];return m.isWrapped=this.isWrapped,m}getTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0])return m+(this._data[3*m+0]>>22);return 0}getNoBgTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0]||50331648&this._data[3*m+2])return m+(this._data[3*m+0]>>22);return 0}copyCellsFrom(m,h,d,f,S){const E=m._data;if(S)for(let b=f-1;b>=0;b--){for(let C=0;C<3;C++)this._data[3*(d+b)+C]=E[3*(h+b)+C];268435456&E[3*(h+b)+2]&&(this._extendedAttrs[d+b]=m._extendedAttrs[h+b])}else for(let b=0;b<f;b++){for(let C=0;C<3;C++)this._data[3*(d+b)+C]=E[3*(h+b)+C];268435456&E[3*(h+b)+2]&&(this._extendedAttrs[d+b]=m._extendedAttrs[h+b])}const k=Object.keys(m._combined);for(let b=0;b<k.length;b++){const C=parseInt(k[b],10);C>=h&&(this._combined[C-h+d]=m._combined[C])}}translateToString(m,h,d,f){h=h??0,d=d??this.length,m&&(d=Math.min(d,this.getTrimmedLength())),f&&(f.length=0);let S="";for(;h<d;){const E=this._data[3*h+0],k=2097151&E,b=2097152&E?this._combined[h]:k?(0,v.stringFromCodePoint)(k):u.WHITESPACE_CELL_CHAR;if(S+=b,f)for(let C=0;C<b.length;++C)f.push(h);h+=E>>22||1}return f&&f.push(h),S}}i.BufferLine=w},4841:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getRangeLength=void 0,i.getRangeLength=function(a,c){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return c*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(l,i)=>{function a(c,p,u){if(p===c.length-1)return c[p].getTrimmedLength();const v=!c[p].hasContent(u-1)&&c[p].getWidth(u-1)===1,y=c[p+1].getWidth(0)===2;return v&&y?u-1:u}Object.defineProperty(i,"__esModule",{value:!0}),i.getWrappedLineTrimmedLength=i.reflowSmallerGetNewLineLengths=i.reflowLargerApplyNewLayout=i.reflowLargerCreateNewLayout=i.reflowLargerGetLinesToRemove=void 0,i.reflowLargerGetLinesToRemove=function(c,p,u,v,y){const w=[];for(let _=0;_<c.length-1;_++){let m=_,h=c.get(++m);if(!h.isWrapped)continue;const d=[c.get(_)];for(;m<c.length&&h.isWrapped;)d.push(h),h=c.get(++m);if(v>=_&&v<m){_+=d.length-1;continue}let f=0,S=a(d,f,p),E=1,k=0;for(;E<d.length;){const C=a(d,E,p),P=C-k,T=u-S,M=Math.min(P,T);d[f].copyCellsFrom(d[E],k,S,M,!1),S+=M,S===u&&(f++,S=0),k+=M,k===C&&(E++,k=0),S===0&&f!==0&&d[f-1].getWidth(u-1)===2&&(d[f].copyCellsFrom(d[f-1],u-1,S++,1,!1),d[f-1].setCell(u-1,y))}d[f].replaceCells(S,u,y);let b=0;for(let C=d.length-1;C>0&&(C>f||d[C].getTrimmedLength()===0);C--)b++;b>0&&(w.push(_+d.length-b),w.push(b)),_+=d.length-1}return w},i.reflowLargerCreateNewLayout=function(c,p){const u=[];let v=0,y=p[v],w=0;for(let _=0;_<c.length;_++)if(y===_){const m=p[++v];c.onDeleteEmitter.fire({index:_-w,amount:m}),_+=m-1,w+=m,y=p[++v]}else u.push(_);return{layout:u,countRemoved:w}},i.reflowLargerApplyNewLayout=function(c,p){const u=[];for(let v=0;v<p.length;v++)u.push(c.get(p[v]));for(let v=0;v<u.length;v++)c.set(v,u[v]);c.length=p.length},i.reflowSmallerGetNewLineLengths=function(c,p,u){const v=[],y=c.map((h,d)=>a(c,d,p)).reduce((h,d)=>h+d);let w=0,_=0,m=0;for(;m<y;){if(y-m<u){v.push(y-m);break}w+=u;const h=a(c,_,p);w>h&&(w-=h,_++);const d=c[_].getWidth(w-1)===2;d&&w--;const f=d?u-1:u;v.push(f),m+=f}return v},i.getWrappedLineTrimmedLength=a},5295:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferSet=void 0;const c=a(8460),p=a(844),u=a(9092);class v extends p.Disposable{constructor(w,_){super(),this._optionsService=w,this._bufferService=_,this._onBufferActivate=this.register(new c.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),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(w,_){this._normal.resize(w,_),this._alt.resize(w,_),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}i.BufferSet=v},511:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellData=void 0;const c=a(482),p=a(643),u=a(3734);class v extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const _=new v;return _.setFromCharData(w),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(w[p.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(w[p.CHAR_DATA_CHAR_INDEX].length===2){const m=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=m&&m<=56319){const h=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(m-55296)+h-56320+65536|w[p.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[p.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=w[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.CellData=v},643:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WHITESPACE_CELL_CODE=i.WHITESPACE_CELL_WIDTH=i.WHITESPACE_CELL_CHAR=i.NULL_CELL_CODE=i.NULL_CELL_WIDTH=i.NULL_CELL_CHAR=i.CHAR_DATA_CODE_INDEX=i.CHAR_DATA_WIDTH_INDEX=i.CHAR_DATA_CHAR_INDEX=i.CHAR_DATA_ATTR_INDEX=i.DEFAULT_EXT=i.DEFAULT_ATTR=i.DEFAULT_COLOR=void 0,i.DEFAULT_COLOR=0,i.DEFAULT_ATTR=256|i.DEFAULT_COLOR<<9,i.DEFAULT_EXT=0,i.CHAR_DATA_ATTR_INDEX=0,i.CHAR_DATA_CHAR_INDEX=1,i.CHAR_DATA_WIDTH_INDEX=2,i.CHAR_DATA_CODE_INDEX=3,i.NULL_CELL_CHAR="",i.NULL_CELL_WIDTH=1,i.NULL_CELL_CODE=0,i.WHITESPACE_CELL_CHAR=" ",i.WHITESPACE_CELL_WIDTH=1,i.WHITESPACE_CELL_CODE=32},4863:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Marker=void 0;const c=a(8460),p=a(844);class u{get id(){return this._id}constructor(y){this.line=y,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(y){return this._disposables.push(y),y}}i.Marker=u,u._nextId=1},7116:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DEFAULT_CHARSET=i.CHARSETS=void 0,i.CHARSETS={},i.DEFAULT_CHARSET=i.CHARSETS.B,i.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},i.CHARSETS.A={"#":"£"},i.CHARSETS.B=void 0,i.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},i.CHARSETS.C=i.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},i.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},i.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},i.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},i.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},i.CHARSETS.E=i.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},i.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},i.CHARSETS.H=i.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},i.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(l,i)=>{var a,c,p;Object.defineProperty(i,"__esModule",{value:!0}),i.C1_ESCAPED=i.C1=i.C0=void 0,function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
278
- `,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""}(a||(i.C0=a={})),function(u){u.PAD="€",u.HOP="",u.BPH="‚",u.NBH="ƒ",u.IND="„",u.NEL="…",u.SSA="†",u.ESA="‡",u.HTS="ˆ",u.HTJ="‰",u.VTS="Š",u.PLD="‹",u.PLU="Œ",u.RI="",u.SS2="Ž",u.SS3="",u.DCS="",u.PU1="‘",u.PU2="’",u.STS="“",u.CCH="”",u.MW="•",u.SPA="–",u.EPA="—",u.SOS="˜",u.SGCI="™",u.SCI="š",u.CSI="›",u.ST="œ",u.OSC="",u.PM="ž",u.APC="Ÿ"}(c||(i.C1=c={})),function(u){u.ST=`${a.ESC}\\`}(p||(i.C1_ESCAPED=p={}))},7399:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.evaluateKeyboardEvent=void 0;const c=a(2584),p={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:["'",'"']};i.evaluateKeyboardEvent=function(u,v,y,w){const _={type:0,cancel:!1,key:void 0},m=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?_.key=v?c.C0.ESC+"OA":c.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?_.key=v?c.C0.ESC+"OD":c.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?_.key=v?c.C0.ESC+"OC":c.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(_.key=v?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:_.key=u.ctrlKey?"\b":c.C0.DEL,u.altKey&&(_.key=c.C0.ESC+_.key);break;case 9:if(u.shiftKey){_.key=c.C0.ESC+"[Z";break}_.key=c.C0.HT,_.cancel=!0;break;case 13:_.key=u.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,_.cancel=!0;break;case 27:_.key=c.C0.ESC,u.altKey&&(_.key=c.C0.ESC+c.C0.ESC),_.cancel=!0;break;case 37:if(u.metaKey)break;m?(_.key=c.C0.ESC+"[1;"+(m+1)+"D",_.key===c.C0.ESC+"[1;3D"&&(_.key=c.C0.ESC+(y?"b":"[1;5D"))):_.key=v?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(u.metaKey)break;m?(_.key=c.C0.ESC+"[1;"+(m+1)+"C",_.key===c.C0.ESC+"[1;3C"&&(_.key=c.C0.ESC+(y?"f":"[1;5C"))):_.key=v?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(u.metaKey)break;m?(_.key=c.C0.ESC+"[1;"+(m+1)+"A",y||_.key!==c.C0.ESC+"[1;3A"||(_.key=c.C0.ESC+"[1;5A")):_.key=v?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(u.metaKey)break;m?(_.key=c.C0.ESC+"[1;"+(m+1)+"B",y||_.key!==c.C0.ESC+"[1;3B"||(_.key=c.C0.ESC+"[1;5B")):_.key=v?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(_.key=c.C0.ESC+"[2~");break;case 46:_.key=m?c.C0.ESC+"[3;"+(m+1)+"~":c.C0.ESC+"[3~";break;case 36:_.key=m?c.C0.ESC+"[1;"+(m+1)+"H":v?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:_.key=m?c.C0.ESC+"[1;"+(m+1)+"F":v?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:u.shiftKey?_.type=2:u.ctrlKey?_.key=c.C0.ESC+"[5;"+(m+1)+"~":_.key=c.C0.ESC+"[5~";break;case 34:u.shiftKey?_.type=3:u.ctrlKey?_.key=c.C0.ESC+"[6;"+(m+1)+"~":_.key=c.C0.ESC+"[6~";break;case 112:_.key=m?c.C0.ESC+"[1;"+(m+1)+"P":c.C0.ESC+"OP";break;case 113:_.key=m?c.C0.ESC+"[1;"+(m+1)+"Q":c.C0.ESC+"OQ";break;case 114:_.key=m?c.C0.ESC+"[1;"+(m+1)+"R":c.C0.ESC+"OR";break;case 115:_.key=m?c.C0.ESC+"[1;"+(m+1)+"S":c.C0.ESC+"OS";break;case 116:_.key=m?c.C0.ESC+"[15;"+(m+1)+"~":c.C0.ESC+"[15~";break;case 117:_.key=m?c.C0.ESC+"[17;"+(m+1)+"~":c.C0.ESC+"[17~";break;case 118:_.key=m?c.C0.ESC+"[18;"+(m+1)+"~":c.C0.ESC+"[18~";break;case 119:_.key=m?c.C0.ESC+"[19;"+(m+1)+"~":c.C0.ESC+"[19~";break;case 120:_.key=m?c.C0.ESC+"[20;"+(m+1)+"~":c.C0.ESC+"[20~";break;case 121:_.key=m?c.C0.ESC+"[21;"+(m+1)+"~":c.C0.ESC+"[21~";break;case 122:_.key=m?c.C0.ESC+"[23;"+(m+1)+"~":c.C0.ESC+"[23~";break;case 123:_.key=m?c.C0.ESC+"[24;"+(m+1)+"~":c.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(y&&!w||!u.altKey||u.metaKey)!y||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?_.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(_.key=c.C0.US),u.key==="@"&&(_.key=c.C0.NUL)):u.keyCode===65&&(_.type=1);else{const h=p[u.keyCode],d=h==null?void 0:h[u.shiftKey?1:0];if(d)_.key=c.C0.ESC+d;else if(u.keyCode>=65&&u.keyCode<=90){const f=u.ctrlKey?u.keyCode-64:u.keyCode+32;let S=String.fromCharCode(f);u.shiftKey&&(S=S.toUpperCase()),_.key=c.C0.ESC+S}else if(u.keyCode===32)_.key=c.C0.ESC+(u.ctrlKey?c.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let f=u.code.slice(3,4);u.shiftKey||(f=f.toLowerCase()),_.key=c.C0.ESC+f,_.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?_.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?_.key=c.C0.NUL:u.keyCode>=51&&u.keyCode<=55?_.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?_.key=c.C0.DEL:u.keyCode===219?_.key=c.C0.ESC:u.keyCode===220?_.key=c.C0.FS:u.keyCode===221&&(_.key=c.C0.GS)}return _}},482:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Utf8ToUtf32=i.StringToUtf32=i.utf32ToString=i.stringFromCodePoint=void 0,i.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},i.utf32ToString=function(a,c=0,p=a.length){let u="";for(let v=c;v<p;++v){let y=a[v];y>65535?(y-=65536,u+=String.fromCharCode(55296+(y>>10))+String.fromCharCode(y%1024+56320)):u+=String.fromCharCode(y)}return u},i.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,c){const p=a.length;if(!p)return 0;let u=0,v=0;if(this._interim){const y=a.charCodeAt(v++);56320<=y&&y<=57343?c[u++]=1024*(this._interim-55296)+y-56320+65536:(c[u++]=this._interim,c[u++]=y),this._interim=0}for(let y=v;y<p;++y){const w=a.charCodeAt(y);if(55296<=w&&w<=56319){if(++y>=p)return this._interim=w,u;const _=a.charCodeAt(y);56320<=_&&_<=57343?c[u++]=1024*(w-55296)+_-56320+65536:(c[u++]=w,c[u++]=_)}else w!==65279&&(c[u++]=w)}return u}},i.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,c){const p=a.length;if(!p)return 0;let u,v,y,w,_=0,m=0,h=0;if(this.interim[0]){let S=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let k,b=0;for(;(k=63&this.interim[++b])&&b<4;)E<<=6,E|=k;const C=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,P=C-b;for(;h<P;){if(h>=p)return 0;if(k=a[h++],(192&k)!=128){h--,S=!0;break}this.interim[b++]=k,E<<=6,E|=63&k}S||(C===2?E<128?h--:c[_++]=E:C===3?E<2048||E>=55296&&E<=57343||E===65279||(c[_++]=E):E<65536||E>1114111||(c[_++]=E)),this.interim.fill(0)}const d=p-4;let f=h;for(;f<p;){for(;!(!(f<d)||128&(u=a[f])||128&(v=a[f+1])||128&(y=a[f+2])||128&(w=a[f+3]));)c[_++]=u,c[_++]=v,c[_++]=y,c[_++]=w,f+=4;if(u=a[f++],u<128)c[_++]=u;else if((224&u)==192){if(f>=p)return this.interim[0]=u,_;if(v=a[f++],(192&v)!=128){f--;continue}if(m=(31&u)<<6|63&v,m<128){f--;continue}c[_++]=m}else if((240&u)==224){if(f>=p)return this.interim[0]=u,_;if(v=a[f++],(192&v)!=128){f--;continue}if(f>=p)return this.interim[0]=u,this.interim[1]=v,_;if(y=a[f++],(192&y)!=128){f--;continue}if(m=(15&u)<<12|(63&v)<<6|63&y,m<2048||m>=55296&&m<=57343||m===65279)continue;c[_++]=m}else if((248&u)==240){if(f>=p)return this.interim[0]=u,_;if(v=a[f++],(192&v)!=128){f--;continue}if(f>=p)return this.interim[0]=u,this.interim[1]=v,_;if(y=a[f++],(192&y)!=128){f--;continue}if(f>=p)return this.interim[0]=u,this.interim[1]=v,this.interim[2]=y,_;if(w=a[f++],(192&w)!=128){f--;continue}if(m=(7&u)<<18|(63&v)<<12|(63&y)<<6|63&w,m<65536||m>1114111)continue;c[_++]=m}}return _}}},225:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeV6=void 0;const c=a(1480),p=[[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]],u=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let v;i.UnicodeV6=class{constructor(){if(this.version="6",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160),v.fill(2,4352,4448),v[9001]=2,v[9002]=2,v.fill(2,11904,42192),v[12351]=1,v.fill(2,44032,55204),v.fill(2,63744,64256),v.fill(2,65040,65050),v.fill(2,65072,65136),v.fill(2,65280,65377),v.fill(2,65504,65511);for(let y=0;y<p.length;++y)v.fill(0,p[y][0],p[y][1]+1)}}wcwidth(y){return y<32?0:y<127?1:y<65536?v[y]:function(w,_){let m,h=0,d=_.length-1;if(w<_[0][0]||w>_[d][1])return!1;for(;d>=h;)if(m=h+d>>1,w>_[m][1])h=m+1;else{if(!(w<_[m][0]))return!0;d=m-1}return!1}(y,u)?0:y>=131072&&y<=196605||y>=196608&&y<=262141?2:1}charProperties(y,w){let _=this.wcwidth(y),m=_===0&&w!==0;if(m){const h=c.UnicodeService.extractWidth(w);h===0?m=!1:h>_&&(_=h)}return c.UnicodeService.createPropertyValue(0,_,m)}}},5981:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WriteBuffer=void 0;const c=a(8460),p=a(844);class u extends p.Disposable{constructor(y){super(),this._action=y,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(y,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=y.length,this._writeBuffer.push(y),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let _;for(this._isSyncWriting=!0;_=this._writeBuffer.shift();){this._action(_);const m=this._callbacks.shift();m&&m()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(y,w){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=y.length,this._writeBuffer.push(y),this._callbacks.push(w),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=y.length,this._writeBuffer.push(y),this._callbacks.push(w)}_innerWrite(y=0,w=!0){const _=y||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const m=this._writeBuffer[this._bufferOffset],h=this._action(m,w);if(h){const f=S=>Date.now()-_>=12?setTimeout(()=>this._innerWrite(0,S)):this._innerWrite(_,S);return void h.catch(S=>(queueMicrotask(()=>{throw S}),Promise.resolve(!1))).then(f)}const d=this._callbacks[this._bufferOffset];if(d&&d(),this._bufferOffset++,this._pendingData-=m.length,Date.now()-_>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}i.WriteBuffer=u},5941:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.toRgbString=i.parseColor=void 0;const a=/^([\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})$/,c=/^[\da-f]+$/;function p(u,v){const y=u.toString(16),w=y.length<2?"0"+y:y;switch(v){case 4:return y[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}i.parseColor=function(u){if(!u)return;let v=u.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const y=a.exec(v);if(y){const w=y[1]?15:y[4]?255:y[7]?4095:65535;return[Math.round(parseInt(y[1]||y[4]||y[7]||y[10],16)/w*255),Math.round(parseInt(y[2]||y[5]||y[8]||y[11],16)/w*255),Math.round(parseInt(y[3]||y[6]||y[9]||y[12],16)/w*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),c.exec(v)&&[3,6,9,12].includes(v.length))){const y=v.length/3,w=[0,0,0];for(let _=0;_<3;++_){const m=parseInt(v.slice(y*_,y*_+y),16);w[_]=y===1?m<<4:y===2?m:y===3?m>>4:m>>8}return w}},i.toRgbString=function(u,v=16){const[y,w,_]=u;return`rgb:${p(y,v)}/${p(w,v)}/${p(_,v)}`}},5770:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PAYLOAD_LIMIT=void 0,i.PAYLOAD_LIMIT=1e7},6351:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DcsHandler=i.DcsParser=void 0;const c=a(482),p=a(8742),u=a(5770),v=[];i.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(w,_){this._handlers[w]===void 0&&(this._handlers[w]=[]);const m=this._handlers[w];return m.push(_),{dispose:()=>{const h=m.indexOf(_);h!==-1&&m.splice(h,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(w,_){if(this.reset(),this._ident=w,this._active=this._handlers[w]||v,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].hook(_);else this._handlerFb(this._ident,"HOOK",_)}put(w,_,m){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(w,_,m);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(w,_,m))}unhook(w,_=!0){if(this._active.length){let m=!1,h=this._active.length-1,d=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,m=_,d=this._stack.fallThrough,this._stack.paused=!1),!d&&m===!1){for(;h>=0&&(m=this._active[h].unhook(w),m!==!0);h--)if(m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,m;h--}for(;h>=0;h--)if(m=this._active[h].unhook(!1),m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,m}else this._handlerFb(this._ident,"UNHOOK",w);this._active=v,this._ident=0}};const y=new p.Params;y.addParam(0),i.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=y,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():y,this._data="",this._hitLimit=!1}put(w,_,m){this._hitLimit||(this._data+=(0,c.utf32ToString)(w,_,m),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let _=!1;if(this._hitLimit)_=!1;else if(w&&(_=this._handler(this._data,this._params),_ instanceof Promise))return _.then(m=>(this._params=y,this._data="",this._hitLimit=!1,m));return this._params=y,this._data="",this._hitLimit=!1,_}}},2015:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.EscapeSequenceParser=i.VT500_TRANSITION_TABLE=i.TransitionTable=void 0;const c=a(844),p=a(8742),u=a(6242),v=a(6351);class y{constructor(h){this.table=new Uint8Array(h)}setDefault(h,d){this.table.fill(h<<4|d)}add(h,d,f,S){this.table[d<<8|h]=f<<4|S}addMany(h,d,f,S){for(let E=0;E<h.length;E++)this.table[d<<8|h[E]]=f<<4|S}}i.TransitionTable=y;const w=160;i.VT500_TRANSITION_TABLE=function(){const m=new y(4095),h=Array.apply(null,Array(256)).map((b,C)=>C),d=(b,C)=>h.slice(b,C),f=d(32,127),S=d(0,24);S.push(25),S.push.apply(S,d(28,32));const E=d(0,14);let k;for(k in m.setDefault(1,0),m.addMany(f,0,2,0),E)m.addMany([24,26,153,154],k,3,0),m.addMany(d(128,144),k,3,0),m.addMany(d(144,152),k,3,0),m.add(156,k,0,0),m.add(27,k,11,1),m.add(157,k,4,8),m.addMany([152,158,159],k,0,7),m.add(155,k,11,3),m.add(144,k,11,9);return m.addMany(S,0,3,0),m.addMany(S,1,3,1),m.add(127,1,0,1),m.addMany(S,8,0,8),m.addMany(S,3,3,3),m.add(127,3,0,3),m.addMany(S,4,3,4),m.add(127,4,0,4),m.addMany(S,6,3,6),m.addMany(S,5,3,5),m.add(127,5,0,5),m.addMany(S,2,3,2),m.add(127,2,0,2),m.add(93,1,4,8),m.addMany(f,8,5,8),m.add(127,8,5,8),m.addMany([156,27,24,26,7],8,6,0),m.addMany(d(28,32),8,0,8),m.addMany([88,94,95],1,0,7),m.addMany(f,7,0,7),m.addMany(S,7,0,7),m.add(156,7,0,0),m.add(127,7,0,7),m.add(91,1,11,3),m.addMany(d(64,127),3,7,0),m.addMany(d(48,60),3,8,4),m.addMany([60,61,62,63],3,9,4),m.addMany(d(48,60),4,8,4),m.addMany(d(64,127),4,7,0),m.addMany([60,61,62,63],4,0,6),m.addMany(d(32,64),6,0,6),m.add(127,6,0,6),m.addMany(d(64,127),6,0,0),m.addMany(d(32,48),3,9,5),m.addMany(d(32,48),5,9,5),m.addMany(d(48,64),5,0,6),m.addMany(d(64,127),5,7,0),m.addMany(d(32,48),4,9,5),m.addMany(d(32,48),1,9,2),m.addMany(d(32,48),2,9,2),m.addMany(d(48,127),2,10,0),m.addMany(d(48,80),1,10,0),m.addMany(d(81,88),1,10,0),m.addMany([89,90,92],1,10,0),m.addMany(d(96,127),1,10,0),m.add(80,1,11,9),m.addMany(S,9,0,9),m.add(127,9,0,9),m.addMany(d(28,32),9,0,9),m.addMany(d(32,48),9,9,12),m.addMany(d(48,60),9,8,10),m.addMany([60,61,62,63],9,9,10),m.addMany(S,11,0,11),m.addMany(d(32,128),11,0,11),m.addMany(d(28,32),11,0,11),m.addMany(S,10,0,10),m.add(127,10,0,10),m.addMany(d(28,32),10,0,10),m.addMany(d(48,60),10,8,10),m.addMany([60,61,62,63],10,0,11),m.addMany(d(32,48),10,9,12),m.addMany(S,12,0,12),m.add(127,12,0,12),m.addMany(d(28,32),12,0,12),m.addMany(d(32,48),12,9,12),m.addMany(d(48,64),12,0,11),m.addMany(d(64,127),12,12,13),m.addMany(d(64,127),10,12,13),m.addMany(d(64,127),9,12,13),m.addMany(S,13,13,13),m.addMany(f,13,13,13),m.add(127,13,0,13),m.addMany([27,156,24,26],13,14,0),m.add(w,0,2,0),m.add(w,8,5,8),m.add(w,6,0,6),m.add(w,11,0,11),m.add(w,13,13,13),m}();class _ extends c.Disposable{constructor(h=i.VT500_TRANSITION_TABLE){super(),this._transitions=h,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(d,f,S)=>{},this._executeHandlerFb=d=>{},this._csiHandlerFb=(d,f)=>{},this._escHandlerFb=d=>{},this._errorHandlerFb=d=>d,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(h,d=[64,126]){let f=0;if(h.prefix){if(h.prefix.length>1)throw new Error("only one byte as prefix supported");if(f=h.prefix.charCodeAt(0),f&&60>f||f>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(h.intermediates){if(h.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let E=0;E<h.intermediates.length;++E){const k=h.intermediates.charCodeAt(E);if(32>k||k>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");f<<=8,f|=k}}if(h.final.length!==1)throw new Error("final must be a single byte");const S=h.final.charCodeAt(0);if(d[0]>S||S>d[1])throw new Error(`final must be in range ${d[0]} .. ${d[1]}`);return f<<=8,f|=S,f}identToString(h){const d=[];for(;h;)d.push(String.fromCharCode(255&h)),h>>=8;return d.reverse().join("")}setPrintHandler(h){this._printHandler=h}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(h,d){const f=this._identifier(h,[48,126]);this._escHandlers[f]===void 0&&(this._escHandlers[f]=[]);const S=this._escHandlers[f];return S.push(d),{dispose:()=>{const E=S.indexOf(d);E!==-1&&S.splice(E,1)}}}clearEscHandler(h){this._escHandlers[this._identifier(h,[48,126])]&&delete this._escHandlers[this._identifier(h,[48,126])]}setEscHandlerFallback(h){this._escHandlerFb=h}setExecuteHandler(h,d){this._executeHandlers[h.charCodeAt(0)]=d}clearExecuteHandler(h){this._executeHandlers[h.charCodeAt(0)]&&delete this._executeHandlers[h.charCodeAt(0)]}setExecuteHandlerFallback(h){this._executeHandlerFb=h}registerCsiHandler(h,d){const f=this._identifier(h);this._csiHandlers[f]===void 0&&(this._csiHandlers[f]=[]);const S=this._csiHandlers[f];return S.push(d),{dispose:()=>{const E=S.indexOf(d);E!==-1&&S.splice(E,1)}}}clearCsiHandler(h){this._csiHandlers[this._identifier(h)]&&delete this._csiHandlers[this._identifier(h)]}setCsiHandlerFallback(h){this._csiHandlerFb=h}registerDcsHandler(h,d){return this._dcsParser.registerHandler(this._identifier(h),d)}clearDcsHandler(h){this._dcsParser.clearHandler(this._identifier(h))}setDcsHandlerFallback(h){this._dcsParser.setHandlerFallback(h)}registerOscHandler(h,d){return this._oscParser.registerHandler(h,d)}clearOscHandler(h){this._oscParser.clearHandler(h)}setOscHandlerFallback(h){this._oscParser.setHandlerFallback(h)}setErrorHandler(h){this._errorHandler=h}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(h,d,f,S,E){this._parseStack.state=h,this._parseStack.handlers=d,this._parseStack.handlerPos=f,this._parseStack.transition=S,this._parseStack.chunkPos=E}parse(h,d,f){let S,E=0,k=0,b=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,b=this._parseStack.chunkPos+1;else{if(f===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const C=this._parseStack.handlers;let P=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(f===!1&&P>-1){for(;P>=0&&(S=C[P](this._params),S!==!0);P--)if(S instanceof Promise)return this._parseStack.handlerPos=P,S}this._parseStack.handlers=[];break;case 4:if(f===!1&&P>-1){for(;P>=0&&(S=C[P](),S!==!0);P--)if(S instanceof Promise)return this._parseStack.handlerPos=P,S}this._parseStack.handlers=[];break;case 6:if(E=h[this._parseStack.chunkPos],S=this._dcsParser.unhook(E!==24&&E!==26,f),S)return S;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=h[this._parseStack.chunkPos],S=this._oscParser.end(E!==24&&E!==26,f),S)return S;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,b=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let C=b;C<d;++C){switch(E=h[C],k=this._transitions.table[this.currentState<<8|(E<160?E:w)],k>>4){case 2:for(let N=C+1;;++N){if(N>=d||(E=h[N])<32||E>126&&E<w){this._printHandler(h,C,N),C=N-1;break}if(++N>=d||(E=h[N])<32||E>126&&E<w){this._printHandler(h,C,N),C=N-1;break}if(++N>=d||(E=h[N])<32||E>126&&E<w){this._printHandler(h,C,N),C=N-1;break}if(++N>=d||(E=h[N])<32||E>126&&E<w){this._printHandler(h,C,N),C=N-1;break}}break;case 3:this._executeHandlers[E]?this._executeHandlers[E]():this._executeHandlerFb(E),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:C,code:E,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const P=this._csiHandlers[this._collect<<8|E];let T=P?P.length-1:-1;for(;T>=0&&(S=P[T](this._params),S!==!0);T--)if(S instanceof Promise)return this._preserveStack(3,P,T,k,C),S;T<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++C<d&&(E=h[C])>47&&E<60);C--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const M=this._escHandlers[this._collect<<8|E];let j=M?M.length-1:-1;for(;j>=0&&(S=M[j](),S!==!0);j--)if(S instanceof Promise)return this._preserveStack(4,M,j,k,C),S;j<0&&this._escHandlerFb(this._collect<<8|E),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|E,this._params);break;case 13:for(let N=C+1;;++N)if(N>=d||(E=h[N])===24||E===26||E===27||E>127&&E<w){this._dcsParser.put(h,C,N),C=N-1;break}break;case 14:if(S=this._dcsParser.unhook(E!==24&&E!==26),S)return this._preserveStack(6,[],0,k,C),S;E===27&&(k|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let N=C+1;;N++)if(N>=d||(E=h[N])<32||E>127&&E<w){this._oscParser.put(h,C,N),C=N-1;break}break;case 6:if(S=this._oscParser.end(E!==24&&E!==26),S)return this._preserveStack(5,[],0,k,C),S;E===27&&(k|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&k}}}i.EscapeSequenceParser=_},6242:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OscHandler=i.OscParser=void 0;const c=a(5770),p=a(482),u=[];i.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(v,y){this._handlers[v]===void 0&&(this._handlers[v]=[]);const w=this._handlers[v];return w.push(y),{dispose:()=>{const _=w.indexOf(y);_!==-1&&w.splice(_,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,y,w){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(v,y,w);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(v,y,w))}start(){this.reset(),this._state=1}put(v,y,w){if(this._state!==3){if(this._state===1)for(;y<w;){const _=v[y++];if(_===59){this._state=2,this._start();break}if(_<48||57<_)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+_-48}this._state===2&&w-y>0&&this._put(v,y,w)}}end(v,y=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,_=this._active.length-1,m=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,w=y,m=this._stack.fallThrough,this._stack.paused=!1),!m&&w===!1){for(;_>=0&&(w=this._active[_].end(v),w!==!0);_--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,w;_--}for(;_>=0;_--)if(w=this._active[_].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",v);this._active=u,this._id=-1,this._state=0}}},i.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,y,w){this._hitLimit||(this._data+=(0,p.utf32ToString)(v,y,w),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let y=!1;if(this._hitLimit)y=!1;else if(v&&(y=this._handler(this._data),y instanceof Promise))return y.then(w=>(this._data="",this._hitLimit=!1,w));return this._data="",this._hitLimit=!1,y}}},8742:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Params=void 0;const a=2147483647;class c{static fromArray(u){const v=new c;if(!u.length)return v;for(let y=Array.isArray(u[0])?1:0;y<u.length;++y){const w=u[y];if(Array.isArray(w))for(let _=0;_<w.length;++_)v.addSubParam(w[_]);else v.addParam(w)}return v}constructor(u=32,v=32){if(this.maxLength=u,this.maxSubParamsLength=v,v>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(v),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new c(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let v=0;v<this.length;++v){u.push(this.params[v]);const y=this._subParamsIdx[v]>>8,w=255&this._subParamsIdx[v];w-y>0&&u.push(Array.prototype.slice.call(this._subParams,y,w))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>a?a:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>a?a:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const v=this._subParamsIdx[u]>>8,y=255&this._subParamsIdx[u];return y-v>0?this._subParams.subarray(v,y):null}getSubParamsAll(){const u={};for(let v=0;v<this.length;++v){const y=this._subParamsIdx[v]>>8,w=255&this._subParamsIdx[v];w-y>0&&(u[v]=this._subParams.slice(y,w))}return u}addDigit(u){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const y=this._digitIsSub?this._subParams:this.params,w=y[v-1];y[v-1]=~w?Math.min(10*w+u,a):u}}i.Params=c},5741:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.AddonManager=void 0,i.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,c){const p={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(p),c.dispose=()=>this._wrappedAddonDispose(p),c.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let c=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===a){c=p;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(c,1)}}},8771:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferApiView=void 0;const c=a(3785),p=a(511);i.BufferApiView=class{constructor(u,v){this._buffer=u,this.type=v}init(u){return this._buffer=u,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(u){const v=this._buffer.lines.get(u);if(v)return new c.BufferLineApiView(v)}getNullCell(){return new p.CellData}}},3785:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLineApiView=void 0;const c=a(511);i.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,u){if(!(p<0||p>=this._line.length))return u?(this._line.loadCell(p,u),u):this._line.loadCell(p,new c.CellData)}translateToString(p,u,v){return this._line.translateToString(p,u,v)}}},8285:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferNamespaceApi=void 0;const c=a(8771),p=a(8460),u=a(844);class v extends u.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}i.BufferNamespaceApi=v},7975:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ParserApi=void 0,i.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,c){return this._core.registerCsiHandler(a,p=>c(p.toArray()))}addCsiHandler(a,c){return this.registerCsiHandler(a,c)}registerDcsHandler(a,c){return this._core.registerDcsHandler(a,(p,u)=>c(p,u.toArray()))}addDcsHandler(a,c){return this.registerDcsHandler(a,c)}registerEscHandler(a,c){return this._core.registerEscHandler(a,c)}addEscHandler(a,c){return this.registerEscHandler(a,c)}registerOscHandler(a,c){return this._core.registerOscHandler(a,c)}addOscHandler(a,c){return this.registerOscHandler(a,c)}}},7090:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeApi=void 0,i.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(l,i,a){var c=this&&this.__decorate||function(m,h,d,f){var S,E=arguments.length,k=E<3?h:f===null?f=Object.getOwnPropertyDescriptor(h,d):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(m,h,d,f);else for(var b=m.length-1;b>=0;b--)(S=m[b])&&(k=(E<3?S(k):E>3?S(h,d,k):S(h,d))||k);return E>3&&k&&Object.defineProperty(h,d,k),k},p=this&&this.__param||function(m,h){return function(d,f){h(d,f,m)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferService=i.MINIMUM_ROWS=i.MINIMUM_COLS=void 0;const u=a(8460),v=a(844),y=a(5295),w=a(2585);i.MINIMUM_COLS=2,i.MINIMUM_ROWS=1;let _=i.BufferService=class extends v.Disposable{get buffer(){return this.buffers.active}constructor(m){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(m.rawOptions.cols||0,i.MINIMUM_COLS),this.rows=Math.max(m.rawOptions.rows||0,i.MINIMUM_ROWS),this.buffers=this.register(new y.BufferSet(m,this))}resize(m,h){this.cols=m,this.rows=h,this.buffers.resize(m,h),this._onResize.fire({cols:m,rows:h})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(m,h=!1){const d=this.buffer;let f;f=this._cachedBlankLine,f&&f.length===this.cols&&f.getFg(0)===m.fg&&f.getBg(0)===m.bg||(f=d.getBlankLine(m,h),this._cachedBlankLine=f),f.isWrapped=h;const S=d.ybase+d.scrollTop,E=d.ybase+d.scrollBottom;if(d.scrollTop===0){const k=d.lines.isFull;E===d.lines.length-1?k?d.lines.recycle().copyFrom(f):d.lines.push(f.clone()):d.lines.splice(E+1,0,f.clone()),k?this.isUserScrolling&&(d.ydisp=Math.max(d.ydisp-1,0)):(d.ybase++,this.isUserScrolling||d.ydisp++)}else{const k=E-S+1;d.lines.shiftElements(S+1,k-1,-1),d.lines.set(E,f.clone())}this.isUserScrolling||(d.ydisp=d.ybase),this._onScroll.fire(d.ydisp)}scrollLines(m,h,d){const f=this.buffer;if(m<0){if(f.ydisp===0)return;this.isUserScrolling=!0}else m+f.ydisp>=f.ybase&&(this.isUserScrolling=!1);const S=f.ydisp;f.ydisp=Math.max(Math.min(f.ydisp+m,f.ybase),0),S!==f.ydisp&&(h||this._onScroll.fire(f.ydisp))}};i.BufferService=_=c([p(0,w.IOptionsService)],_)},7994:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CharsetService=void 0,i.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,c){this._charsets[a]=c,this.glevel===a&&(this.charset=c)}}},1753:function(l,i,a){var c=this&&this.__decorate||function(f,S,E,k){var b,C=arguments.length,P=C<3?S:k===null?k=Object.getOwnPropertyDescriptor(S,E):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(f,S,E,k);else for(var T=f.length-1;T>=0;T--)(b=f[T])&&(P=(C<3?b(P):C>3?b(S,E,P):b(S,E))||P);return C>3&&P&&Object.defineProperty(S,E,P),P},p=this&&this.__param||function(f,S){return function(E,k){S(E,k,f)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreMouseService=void 0;const u=a(2585),v=a(8460),y=a(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:f=>f.button!==4&&f.action===1&&(f.ctrl=!1,f.alt=!1,f.shift=!1,!0)},VT200:{events:19,restrict:f=>f.action!==32},DRAG:{events:23,restrict:f=>f.action!==32||f.button!==3},ANY:{events:31,restrict:f=>!0}};function _(f,S){let E=(f.ctrl?16:0)|(f.shift?4:0)|(f.alt?8:0);return f.button===4?(E|=64,E|=f.action):(E|=3&f.button,4&f.button&&(E|=64),8&f.button&&(E|=128),f.action===32?E|=32:f.action!==0||S||(E|=3)),E}const m=String.fromCharCode,h={DEFAULT:f=>{const S=[_(f,!1)+32,f.col+32,f.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${m(S[0])}${m(S[1])}${m(S[2])}`},SGR:f=>{const S=f.action===0&&f.button!==4?"m":"M";return`\x1B[<${_(f,!0)};${f.col};${f.row}${S}`},SGR_PIXELS:f=>{const S=f.action===0&&f.button!==4?"m":"M";return`\x1B[<${_(f,!0)};${f.x};${f.y}${S}`}};let d=i.CoreMouseService=class extends y.Disposable{constructor(f,S){super(),this._bufferService=f,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(w))this.addProtocol(E,w[E]);for(const E of Object.keys(h))this.addEncoding(E,h[E]);this.reset()}addProtocol(f,S){this._protocols[f]=S}addEncoding(f,S){this._encodings[f]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(f){if(!this._protocols[f])throw new Error(`unknown protocol "${f}"`);this._activeProtocol=f,this._onProtocolChange.fire(this._protocols[f].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(f){if(!this._encodings[f])throw new Error(`unknown encoding "${f}"`);this._activeEncoding=f}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(f){if(f.col<0||f.col>=this._bufferService.cols||f.row<0||f.row>=this._bufferService.rows||f.button===4&&f.action===32||f.button===3&&f.action!==32||f.button!==4&&(f.action===2||f.action===3)||(f.col++,f.row++,f.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,f,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(f))return!1;const S=this._encodings[this._activeEncoding](f);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=f,!0}explainEvents(f){return{down:!!(1&f),up:!!(2&f),drag:!!(4&f),move:!!(8&f),wheel:!!(16&f)}}_equalEvents(f,S,E){if(E){if(f.x!==S.x||f.y!==S.y)return!1}else if(f.col!==S.col||f.row!==S.row)return!1;return f.button===S.button&&f.action===S.action&&f.ctrl===S.ctrl&&f.alt===S.alt&&f.shift===S.shift}};i.CoreMouseService=d=c([p(0,u.IBufferService),p(1,u.ICoreService)],d)},6975:function(l,i,a){var c=this&&this.__decorate||function(d,f,S,E){var k,b=arguments.length,C=b<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(d,f,S,E);else for(var P=d.length-1;P>=0;P--)(k=d[P])&&(C=(b<3?k(C):b>3?k(f,S,C):k(f,S))||C);return b>3&&C&&Object.defineProperty(f,S,C),C},p=this&&this.__param||function(d,f){return function(S,E){f(S,E,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreService=void 0;const u=a(1439),v=a(8460),y=a(844),w=a(2585),_=Object.freeze({insertMode:!1}),m=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let h=i.CoreService=class extends y.Disposable{constructor(d,f,S){super(),this._bufferService=d,this._logService=f,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(_),this.decPrivateModes=(0,u.clone)(m)}reset(){this.modes=(0,u.clone)(_),this.decPrivateModes=(0,u.clone)(m)}triggerDataEvent(d,f=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;f&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),f&&this._onUserInput.fire(),this._logService.debug(`sending data "${d}"`,()=>d.split("").map(E=>E.charCodeAt(0))),this._onData.fire(d)}triggerBinaryEvent(d){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${d}"`,()=>d.split("").map(f=>f.charCodeAt(0))),this._onBinary.fire(d))}};i.CoreService=h=c([p(0,w.IBufferService),p(1,w.ILogService),p(2,w.IOptionsService)],h)},9074:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DecorationService=void 0;const c=a(8055),p=a(8460),u=a(844),v=a(6106);let y=0,w=0;class _ extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList(d=>d==null?void 0:d.marker.line),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)(()=>this.reset()))}registerDecoration(d){if(d.marker.isDisposed)return;const f=new m(d);if(f){const S=f.marker.onDispose(()=>f.dispose());f.onDispose(()=>{f&&(this._decorations.delete(f)&&this._onDecorationRemoved.fire(f),S.dispose())}),this._decorations.insert(f),this._onDecorationRegistered.fire(f)}return f}reset(){for(const d of this._decorations.values())d.dispose();this._decorations.clear()}*getDecorationsAtCell(d,f,S){let E=0,k=0;for(const b of this._decorations.getKeyIterator(f))E=b.options.x??0,k=E+(b.options.width??1),d>=E&&d<k&&(!S||(b.options.layer??"bottom")===S)&&(yield b)}forEachDecorationAtCell(d,f,S,E){this._decorations.forEachByKey(f,k=>{y=k.options.x??0,w=y+(k.options.width??1),d>=y&&d<w&&(!S||(k.options.layer??"bottom")===S)&&E(k)})}}i.DecorationService=_;class m extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(d){super(),this.options=d,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=d.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.InstantiationService=i.ServiceCollection=void 0;const c=a(2585),p=a(8343);class u{constructor(...y){this._entries=new Map;for(const[w,_]of y)this.set(w,_)}set(y,w){const _=this._entries.get(y);return this._entries.set(y,w),_}forEach(y){for(const[w,_]of this._entries.entries())y(w,_)}has(y){return this._entries.has(y)}get(y){return this._entries.get(y)}}i.ServiceCollection=u,i.InstantiationService=class{constructor(){this._services=new u,this._services.set(c.IInstantiationService,this)}setService(v,y){this._services.set(v,y)}getService(v){return this._services.get(v)}createInstance(v,...y){const w=(0,p.getServiceDependencies)(v).sort((h,d)=>h.index-d.index),_=[];for(const h of w){const d=this._services.get(h.id);if(!d)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${h.id}.`);_.push(d)}const m=w.length>0?w[0].index:y.length;if(y.length!==m)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${m+1} conflicts with ${y.length} static arguments`);return new v(...y,..._)}}},7866:function(l,i,a){var c=this&&this.__decorate||function(m,h,d,f){var S,E=arguments.length,k=E<3?h:f===null?f=Object.getOwnPropertyDescriptor(h,d):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(m,h,d,f);else for(var b=m.length-1;b>=0;b--)(S=m[b])&&(k=(E<3?S(k):E>3?S(h,d,k):S(h,d))||k);return E>3&&k&&Object.defineProperty(h,d,k),k},p=this&&this.__param||function(m,h){return function(d,f){h(d,f,m)}};Object.defineProperty(i,"__esModule",{value:!0}),i.traceCall=i.setTraceLogger=i.LogService=void 0;const u=a(844),v=a(2585),y={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let w,_=i.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(m){super(),this._optionsService=m,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),w=this}_updateLogLevel(){this._logLevel=y[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(m){for(let h=0;h<m.length;h++)typeof m[h]=="function"&&(m[h]=m[h]())}_log(m,h,d){this._evalLazyOptionalParams(d),m.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...d)}trace(m,...h){var d;this._logLevel<=v.LogLevelEnum.TRACE&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.trace.bind(this._optionsService.options.logger))??console.log,m,h)}debug(m,...h){var d;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.debug.bind(this._optionsService.options.logger))??console.log,m,h)}info(m,...h){var d;this._logLevel<=v.LogLevelEnum.INFO&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.info.bind(this._optionsService.options.logger))??console.info,m,h)}warn(m,...h){var d;this._logLevel<=v.LogLevelEnum.WARN&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.warn.bind(this._optionsService.options.logger))??console.warn,m,h)}error(m,...h){var d;this._logLevel<=v.LogLevelEnum.ERROR&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.error.bind(this._optionsService.options.logger))??console.error,m,h)}};i.LogService=_=c([p(0,v.IOptionsService)],_),i.setTraceLogger=function(m){w=m},i.traceCall=function(m,h,d){if(typeof d.value!="function")throw new Error("not supported");const f=d.value;d.value=function(...S){if(w.logLevel!==v.LogLevelEnum.TRACE)return f.apply(this,S);w.trace(`GlyphRenderer#${f.name}(${S.map(k=>JSON.stringify(k)).join(", ")})`);const E=f.apply(this,S);return w.trace(`GlyphRenderer#${f.name} return`,E),E}}},7302:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OptionsService=i.DEFAULT_OPTIONS=void 0;const c=a(8460),p=a(844),u=a(6114);i.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const v=["normal","bold","100","200","300","400","500","600","700","800","900"];class y extends p.Disposable{constructor(_){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const m={...i.DEFAULT_OPTIONS};for(const h in _)if(h in m)try{const d=_[h];m[h]=this._sanitizeAndValidateOption(h,d)}catch(d){console.error(d)}this.rawOptions=m,this.options={...m},this._setupOptions(),this.register((0,p.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(_,m){return this.onOptionChange(h=>{h===_&&m(this.rawOptions[_])})}onMultipleOptionChange(_,m){return this.onOptionChange(h=>{_.indexOf(h)!==-1&&m()})}_setupOptions(){const _=h=>{if(!(h in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);return this.rawOptions[h]},m=(h,d)=>{if(!(h in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);d=this._sanitizeAndValidateOption(h,d),this.rawOptions[h]!==d&&(this.rawOptions[h]=d,this._onOptionChange.fire(h))};for(const h in this.rawOptions){const d={get:_.bind(this,h),set:m.bind(this,h)};Object.defineProperty(this.options,h,d)}}_sanitizeAndValidateOption(_,m){switch(_){case"cursorStyle":if(m||(m=i.DEFAULT_OPTIONS[_]),!function(h){return h==="block"||h==="underline"||h==="bar"}(m))throw new Error(`"${m}" is not a valid value for ${_}`);break;case"wordSeparator":m||(m=i.DEFAULT_OPTIONS[_]);break;case"fontWeight":case"fontWeightBold":if(typeof m=="number"&&1<=m&&m<=1e3)break;m=v.includes(m)?m:i.DEFAULT_OPTIONS[_];break;case"cursorWidth":m=Math.floor(m);case"lineHeight":case"tabStopWidth":if(m<1)throw new Error(`${_} cannot be less than 1, value: ${m}`);break;case"minimumContrastRatio":m=Math.max(1,Math.min(21,Math.round(10*m)/10));break;case"scrollback":if((m=Math.min(m,4294967295))<0)throw new Error(`${_} cannot be less than 0, value: ${m}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(m<=0)throw new Error(`${_} cannot be less than or equal to 0, value: ${m}`);break;case"rows":case"cols":if(!m&&m!==0)throw new Error(`${_} must be numeric, value: ${m}`);break;case"windowsPty":m=m??{}}return m}}i.OptionsService=y},2660:function(l,i,a){var c=this&&this.__decorate||function(y,w,_,m){var h,d=arguments.length,f=d<3?w:m===null?m=Object.getOwnPropertyDescriptor(w,_):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(y,w,_,m);else for(var S=y.length-1;S>=0;S--)(h=y[S])&&(f=(d<3?h(f):d>3?h(w,_,f):h(w,_))||f);return d>3&&f&&Object.defineProperty(w,_,f),f},p=this&&this.__param||function(y,w){return function(_,m){w(_,m,y)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkService=void 0;const u=a(2585);let v=i.OscLinkService=class{constructor(y){this._bufferService=y,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(y){const w=this._bufferService.buffer;if(y.id===void 0){const S=w.addMarker(w.ybase+w.y),E={data:y,id:this._nextId++,lines:[S]};return S.onDispose(()=>this._removeMarkerFromLink(E,S)),this._dataByLinkId.set(E.id,E),E.id}const _=y,m=this._getEntryIdKey(_),h=this._entriesWithId.get(m);if(h)return this.addLineToLink(h.id,w.ybase+w.y),h.id;const d=w.addMarker(w.ybase+w.y),f={id:this._nextId++,key:this._getEntryIdKey(_),data:_,lines:[d]};return d.onDispose(()=>this._removeMarkerFromLink(f,d)),this._entriesWithId.set(f.key,f),this._dataByLinkId.set(f.id,f),f.id}addLineToLink(y,w){const _=this._dataByLinkId.get(y);if(_&&_.lines.every(m=>m.line!==w)){const m=this._bufferService.buffer.addMarker(w);_.lines.push(m),m.onDispose(()=>this._removeMarkerFromLink(_,m))}}getLinkData(y){var w;return(w=this._dataByLinkId.get(y))==null?void 0:w.data}_getEntryIdKey(y){return`${y.id};;${y.uri}`}_removeMarkerFromLink(y,w){const _=y.lines.indexOf(w);_!==-1&&(y.lines.splice(_,1),y.lines.length===0&&(y.data.id!==void 0&&this._entriesWithId.delete(y.key),this._dataByLinkId.delete(y.id)))}};i.OscLinkService=v=c([p(0,u.IBufferService)],v)},8343:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createDecorator=i.getServiceDependencies=i.serviceRegistry=void 0;const a="di$target",c="di$dependencies";i.serviceRegistry=new Map,i.getServiceDependencies=function(p){return p[c]||[]},i.createDecorator=function(p){if(i.serviceRegistry.has(p))return i.serviceRegistry.get(p);const u=function(v,y,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,m,h){m[a]===m?m[c].push({id:_,index:h}):(m[c]=[{id:_,index:h}],m[a]=m)})(u,v,w)};return u.toString=()=>p,i.serviceRegistry.set(p,u),u}},2585:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IDecorationService=i.IUnicodeService=i.IOscLinkService=i.IOptionsService=i.ILogService=i.LogLevelEnum=i.IInstantiationService=i.ICharsetService=i.ICoreService=i.ICoreMouseService=i.IBufferService=void 0;const c=a(8343);var p;i.IBufferService=(0,c.createDecorator)("BufferService"),i.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),i.ICoreService=(0,c.createDecorator)("CoreService"),i.ICharsetService=(0,c.createDecorator)("CharsetService"),i.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(p||(i.LogLevelEnum=p={})),i.ILogService=(0,c.createDecorator)("LogService"),i.IOptionsService=(0,c.createDecorator)("OptionsService"),i.IOscLinkService=(0,c.createDecorator)("OscLinkService"),i.IUnicodeService=(0,c.createDecorator)("UnicodeService"),i.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(l,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeService=void 0;const c=a(8460),p=a(225);class u{static extractShouldJoin(y){return(1&y)!=0}static extractWidth(y){return y>>1&3}static extractCharKind(y){return y>>3}static createPropertyValue(y,w,_=!1){return(16777215&y)<<3|(3&w)<<1|(_?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const y=new p.UnicodeV6;this.register(y),this._active=y.version,this._activeProvider=y}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(y){if(!this._providers[y])throw new Error(`unknown Unicode version "${y}"`);this._active=y,this._activeProvider=this._providers[y],this._onChange.fire(y)}register(y){this._providers[y.version]=y}wcwidth(y){return this._activeProvider.wcwidth(y)}getStringCellWidth(y){let w=0,_=0;const m=y.length;for(let h=0;h<m;++h){let d=y.charCodeAt(h);if(55296<=d&&d<=56319){if(++h>=m)return w+this.wcwidth(d);const E=y.charCodeAt(h);56320<=E&&E<=57343?d=1024*(d-55296)+E-56320+65536:w+=this.wcwidth(E)}const f=this.charProperties(d,_);let S=u.extractWidth(f);u.extractShouldJoin(f)&&(S-=u.extractWidth(_)),w+=S,_=f}return w}charProperties(y,w){return this._activeProvider.charProperties(y,w)}}i.UnicodeService=u}},n={};function s(l){var i=n[l];if(i!==void 0)return i.exports;var a=n[l]={exports:{}};return r[l].call(a.exports,a,a.exports,s),a.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const i=s(9042),a=s(3236),c=s(844),p=s(5741),u=s(8285),v=s(7975),y=s(7090),w=["cols","rows"];class _ extends c.Disposable{constructor(h){super(),this._core=this.register(new a.Terminal(h)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const d=S=>this._core.options[S],f=(S,E)=>{this._checkReadonlyOptions(S),this._core.options[S]=E};for(const S in this._core.options){const E={get:d.bind(this,S),set:f.bind(this,S)};Object.defineProperty(this._publicOptions,S,E)}}_checkReadonlyOptions(h){if(w.includes(h))throw new Error(`Option "${h}" 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 v.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new y.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const h=this._core.coreService.decPrivateModes;let d="none";switch(this._core.coreMouseService.activeProtocol){case"X10":d="x10";break;case"VT200":d="vt200";break;case"DRAG":d="drag";break;case"ANY":d="any"}return{applicationCursorKeysMode:h.applicationCursorKeys,applicationKeypadMode:h.applicationKeypad,bracketedPasteMode:h.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:d,originMode:h.origin,reverseWraparoundMode:h.reverseWraparound,sendFocusMode:h.sendFocus,wraparoundMode:h.wraparound}}get options(){return this._publicOptions}set options(h){for(const d in h)this._publicOptions[d]=h[d]}blur(){this._core.blur()}focus(){this._core.focus()}input(h,d=!0){this._core.input(h,d)}resize(h,d){this._verifyIntegers(h,d),this._core.resize(h,d)}open(h){this._core.open(h)}attachCustomKeyEventHandler(h){this._core.attachCustomKeyEventHandler(h)}attachCustomWheelEventHandler(h){this._core.attachCustomWheelEventHandler(h)}registerLinkProvider(h){return this._core.registerLinkProvider(h)}registerCharacterJoiner(h){return this._checkProposedApi(),this._core.registerCharacterJoiner(h)}deregisterCharacterJoiner(h){this._checkProposedApi(),this._core.deregisterCharacterJoiner(h)}registerMarker(h=0){return this._verifyIntegers(h),this._core.registerMarker(h)}registerDecoration(h){return this._checkProposedApi(),this._verifyPositiveIntegers(h.x??0,h.width??0,h.height??0),this._core.registerDecoration(h)}hasSelection(){return this._core.hasSelection()}select(h,d,f){this._verifyIntegers(h,d,f),this._core.select(h,d,f)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(h,d){this._verifyIntegers(h,d),this._core.selectLines(h,d)}dispose(){super.dispose()}scrollLines(h){this._verifyIntegers(h),this._core.scrollLines(h)}scrollPages(h){this._verifyIntegers(h),this._core.scrollPages(h)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(h){this._verifyIntegers(h),this._core.scrollToLine(h)}clear(){this._core.clear()}write(h,d){this._core.write(h,d)}writeln(h,d){this._core.write(h),this._core.write(`\r
279
- `,d)}paste(h){this._core.paste(h)}refresh(h,d){this._verifyIntegers(h,d),this._core.refresh(h,d)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(h){this._addonManager.loadAddon(this,h)}static get strings(){return i}_verifyIntegers(...h){for(const d of h)if(d===1/0||isNaN(d)||d%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...h){for(const d of h)if(d&&(d===1/0||isNaN(d)||d%1!=0||d<0))throw new Error("This API only accepts positive integers")}}l.Terminal=_})(),o})())})(Q0);var BM=Q0.exports,Z0={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={};return(()=>{var n=r;Object.defineProperty(n,"__esModule",{value:!0}),n.FitAddon=void 0,n.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const o=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(o._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,o=s._renderService.dimensions;if(o.css.cell.width===0||o.css.cell.height===0)return;const l=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,i=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(i.getPropertyValue("height")),c=Math.max(0,parseInt(i.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),u=a-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),v=c-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-l;return{cols:Math.max(2,Math.floor(v/o.css.cell.width)),rows:Math.max(1,Math.floor(u/o.css.cell.height))}}}})(),r})())})(Z0);var $M=Z0.exports,eS={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={6:(l,i)=>{function a(p){try{const u=new URL(p),v=u.password&&u.username?`${u.protocol}//${u.username}:${u.password}@${u.host}`:u.username?`${u.protocol}//${u.username}@${u.host}`:`${u.protocol}//${u.host}`;return p.toLocaleLowerCase().startsWith(v.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(i,"__esModule",{value:!0}),i.LinkComputer=i.WebLinkProvider=void 0,i.WebLinkProvider=class{constructor(p,u,v,y={}){this._terminal=p,this._regex=u,this._handler=v,this._options=y}provideLinks(p,u){const v=c.computeLink(p,this._regex,this._terminal,this._handler);u(this._addCallbacks(v))}_addCallbacks(p){return p.map(u=>(u.leave=this._options.leave,u.hover=(v,y)=>{if(this._options.hover){const{range:w}=u;this._options.hover(v,y,w)}},u))}};class c{static computeLink(u,v,y,w){const _=new RegExp(v.source,(v.flags||"")+"g"),[m,h]=c._getWindowedLineStrings(u-1,y),d=m.join("");let f;const S=[];for(;f=_.exec(d);){const E=f[0];if(!a(E))continue;const[k,b]=c._mapStrIdx(y,h,0,f.index),[C,P]=c._mapStrIdx(y,k,b,E.length);if(k===-1||b===-1||C===-1||P===-1)continue;const T={start:{x:b+1,y:k+1},end:{x:P,y:C+1}};S.push({range:T,text:E,activate:w})}return S}static _getWindowedLineStrings(u,v){let y,w=u,_=u,m=0,h="";const d=[];if(y=v.buffer.active.getLine(u)){const f=y.translateToString(!0);if(y.isWrapped&&f[0]!==" "){for(m=0;(y=v.buffer.active.getLine(--w))&&m<2048&&(h=y.translateToString(!0),m+=h.length,d.push(h),y.isWrapped&&h.indexOf(" ")===-1););d.reverse()}for(d.push(f),m=0;(y=v.buffer.active.getLine(++_))&&y.isWrapped&&m<2048&&(h=y.translateToString(!0),m+=h.length,d.push(h),h.indexOf(" ")===-1););}return[d,w]}static _mapStrIdx(u,v,y,w){const _=u.buffer.active,m=_.getNullCell();let h=y;for(;w;){const d=_.getLine(v);if(!d)return[-1,-1];for(let f=h;f<d.length;++f){d.getCell(f,m);const S=m.getChars();if(m.getWidth()&&(w-=S.length||1,f===d.length-1&&S==="")){const E=_.getLine(v+1);E&&E.isWrapped&&(E.getCell(0,m),m.getWidth()===2&&(w+=1))}if(w<0)return[v,f]}v++,h=0}return[v,h]}}i.LinkComputer=c}},n={};function s(l){var i=n[l];if(i!==void 0)return i.exports;var a=n[l]={exports:{}};return r[l](a,a.exports,s),a.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.WebLinksAddon=void 0;const i=s(6),a=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function c(p,u){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}l.WebLinksAddon=class{constructor(p=c,u={}){this._handler=p,this._options=u}activate(p){this._terminal=p;const u=this._options,v=u.urlRegex||a;this._linkProvider=this._terminal.registerLinkProvider(new i.WebLinkProvider(this._terminal,v,this._handler,u))}dispose(){var p;(p=this._linkProvider)==null||p.dispose()}}})(),o})())})(eS);var FM=eS.exports;const Ld=g.forwardRef(({onData:e,onResize:t},r)=>{const n=g.useRef(null),s=g.useRef(null),o=g.useRef(null),l=g.useRef(e);l.current=e;const i=g.useRef(t);return i.current=t,g.useImperativeHandle(r,()=>({write(a){var c;(c=s.current)==null||c.write(a)},clear(){var a;(a=s.current)==null||a.clear()},fit(){var a;try{(a=o.current)==null||a.fit()}catch{}},focus(){var a;(a=s.current)==null||a.focus()}})),g.useEffect(()=>{const a=n.current;if(!a)return;const c=new BM.Terminal({fontSize:14,fontFamily:"JetBrains Mono, Fira Code, Monaco, Consolas, monospace",theme:{background:"transparent",foreground:"#f0f6fc",cursor:"#58a6ff",cursorAccent:"#0d1117",selectionBackground:"rgba(88, 166, 255, 0.3)",black:"#484f58",red:"#ff7b72",green:"#7ee787",yellow:"#ffa657",blue:"#79c0ff",magenta:"#d2a8ff",cyan:"#a5f3fc",white:"#b1bac4",brightBlack:"#6e7681",brightRed:"#ffa198",brightGreen:"#56d364",brightYellow:"#ffdf5d",brightBlue:"#79c0ff",brightMagenta:"#d2a8ff",brightCyan:"#a5f3fc",brightWhite:"#f0f6fc"},allowProposedApi:!0,scrollback:1e4,rightClickSelectsWord:!1,allowTransparency:!0,windowOptions:{}}),p=new $M.FitAddon,u=new FM.WebLinksAddon;c.loadAddon(p),c.loadAddon(u),c.open(a);try{p.fit()}catch{}c.onData(y=>{const w=y.replace(/\x1b\[\[?[IO]/g,"");w&&l.current(w)}),c.onResize(({cols:y,rows:w})=>{var _;(_=i.current)==null||_.call(i,y,w)}),s.current=c,o.current=p;const v=new ResizeObserver(()=>{try{p.fit()}catch{}});return v.observe(a),()=>{v.disconnect(),c.dispose(),s.current=null,o.current=null}},[]),x.jsx("div",{ref:n,className:"xterm-renderer"})});Ld.displayName="XTermRenderer";const HM=[{kind:"claude",label:"Start Claude",icon:WM},{kind:"codex",label:"Start Codex",icon:zM},{kind:"agent",label:"Start Cursor",icon:UM}];function tS({visible:e,onStart:t}){return e?x.jsxs("div",{className:"start-prompt",children:[x.jsx("p",{className:"start-prompt-heading",children:"Choose an agent to start"}),x.jsx("div",{className:"start-prompt-buttons",children:HM.map(({kind:r,label:n,icon:s})=>x.jsxs("button",{className:"start-prompt-btn",onClick:()=>t(r),children:[s(),x.jsx("span",{children:n})]},r))})]}):null}function WM(){return x.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:x.jsx("path",{d:"M12 3l1.912 5.813a2 2 0 001.275 1.275L21 12l-5.813 1.912a2 2 0 00-1.275 1.275L12 21l-1.912-5.813a2 2 0 00-1.275-1.275L3 12l5.813-1.912a2 2 0 001.275-1.275L12 3z"})})}function zM(){return x.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x.jsx("polyline",{points:"4 17 10 11 4 5"}),x.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})}function UM(){return x.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:x.jsx("path",{d:"M5 3l14 9-7 2-4 7L5 3z"})})}function rS({plan:e,onAccept:t,onReject:r}){const[n,s]=g.useState(!1);return e?x.jsxs("div",{className:"plan-panel",children:[x.jsxs("div",{className:"plan-panel-header",children:[x.jsxs("button",{className:"plan-panel-toggle",onClick:()=>s(o=>!o),children:[x.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:n?"rotate(-90deg)":"rotate(0deg)",transition:"transform 150ms"},children:x.jsx("polyline",{points:"6 9 12 15 18 9"})}),x.jsx("span",{children:"Plan Detected"})]}),x.jsxs("div",{className:"plan-panel-actions",children:[x.jsx("button",{className:"plan-panel-btn plan-panel-btn--accept",onClick:t,children:"Accept"}),x.jsx("button",{className:"plan-panel-btn plan-panel-btn--reject",onClick:r,children:"Reject"})]})]}),!n&&x.jsx("div",{className:"plan-panel-body",children:x.jsx("pre",{className:"plan-panel-content",children:e.content})})]}):null}function VM({open:e,onClose:t,autoSessionId:r}){const[n,s]=g.useState(!1),o=g.useRef(null),l=g.useMemo(()=>Y0().defaultAgent,[]);e&&!n&&s(!0);const{plan:i,processOutput:a,clearPlan:c}=q0(),p=g.useRef(a);p.current=a;const u=g.useRef(c);u.current=c;const v=g.useRef(null),{status:y,send:w}=Pd({onMessage:g.useCallback(b=>{var C,P,T,M;switch((C=v.current)==null||C.handleMessage(b),b.type){case"output":(P=o.current)==null||P.write(b.data),p.current(b.data);break;case"error":(T=o.current)==null||T.write(`\r
280
- \x1B[31mError: ${b.message}\x1B[0m\r
281
- `);break;case"exit":(M=o.current)==null||M.write(`\r
282
- \x1B[33mAgent exited (code ${b.code??"unknown"})\x1B[0m\r
283
- `);break;case"claude_started":case"codex_started":case"agent_started":u.current();break}},[])}),_=DM({send:w,xtermRef:o,defaultAgent:l,autoSessionId:r});v.current=_,g.useEffect(()=>{if(!e)return;const b=setTimeout(()=>{var C,P;(C=o.current)==null||C.fit(),(P=o.current)==null||P.focus()},250);return()=>clearTimeout(b)},[e]);const m=g.useCallback(b=>w({type:"input",data:b}),[w]),h=g.useCallback((b,C)=>w({type:"resize",cols:b,rows:C}),[w]),d=g.useCallback(()=>{w({type:"input",data:`y
284
- `}),c()},[w,c]),f=g.useCallback(()=>{w({type:"input",data:`n
285
- `}),c()},[w,c]),S=!!_.sessionId&&!_.agentRunning&&y==="connected",E=g.useRef(null);g.useEffect(()=>{!r||r===E.current||y==="connected"&&(E.current=r,w({type:"join_session",sessionId:r}))},[r,y,w]);const k=y==="connected"?"bg-emerald-400":y==="connecting"?"bg-amber-400 animate-pulse":"bg-red-400";return x.jsxs(x.Fragment,{children:[e&&x.jsx("div",{className:"fixed inset-0 z-40 bg-black/40",onClick:t}),x.jsxs("div",{className:"fixed top-0 right-0 z-50 h-full w-[50vw] min-w-[400px] max-w-[80vw] bg-background border-l border-border shadow-xl flex flex-col transition-transform duration-200",style:{transform:e?"translateX(0)":"translateX(100%)",pointerEvents:e?"auto":"none"},children:[x.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border bg-muted/50",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${k}`}),x.jsx("h3",{className:"text-sm font-medium text-foreground",children:"Terminal"})]}),x.jsx("button",{onClick:t,className:"rounded-md p-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:x.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[x.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),x.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n&&x.jsxs("div",{className:"relative flex-1 min-h-0 flex flex-col",children:[x.jsx("div",{className:"flex-1 min-h-0 terminal-body-bg",children:x.jsx(Ld,{ref:o,onData:m,onResize:h})}),x.jsx(tS,{visible:S,onStart:_.startAgent}),x.jsx(rS,{plan:i,onAccept:d,onReject:f})]})]})]})}const KM=3e3;function GM({sessionId:e}){const t=g.useRef(null),[r,n]=g.useState(!1),s=g.useRef(!1),{plan:o,processOutput:l,clearPlan:i}=q0(),a=g.useRef(l);a.current=l;const c=g.useRef(i);c.current=i;const{status:p,send:u}=Pd({onMessage:g.useCallback(h=>{var d,f,S,E,k,b;switch(h.type){case"connected":s.current||(s.current=!0,u({type:"join_session",sessionId:e}));break;case"session_joined":if(n(h.active),(d=t.current)==null||d.clear(),(f=h.outputBuffer)!=null&&f.length)for(const C of h.outputBuffer)(S=t.current)==null||S.write(C.replace(/\x1b\[\[?[IO]/g,""));break;case"output":(E=t.current)==null||E.write(h.data),a.current(h.data);break;case"error":(k=t.current)==null||k.write(`\r
286
- \x1B[31mError: ${h.message}\x1B[0m\r
287
- `);break;case"exit":(b=t.current)==null||b.write(`\r
288
- \x1B[33mAgent exited (code ${h.code??"unknown"})\x1B[0m\r
289
- `),n(!1);break;case"claude_started":case"codex_started":case"agent_started":n(!0),c.current();break;case"claude_stopped":case"codex_stopped":case"agent_stopped":n(!1);break}},[e])});g.useEffect(()=>{const h=setTimeout(()=>{var d,f;(d=t.current)==null||d.fit(),(f=t.current)==null||f.focus()},150);return()=>clearTimeout(h)},[]);const v=g.useCallback(h=>u({type:"input",data:h}),[u]),y=g.useCallback((h,d)=>u({type:"resize",cols:h,rows:d}),[u]),w=g.useCallback(h=>{u({type:h==="claude"?"start_claude":h==="codex"?"start_codex":"start_agent"})},[u]),_=!r&&p==="connected",m=p==="connected"?"bg-emerald-400":p==="connecting"?"bg-amber-400 animate-pulse":"bg-red-400";return x.jsxs("div",{className:"flex flex-col h-full",children:[x.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border bg-muted/50",children:[x.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${m}`}),x.jsx("h3",{className:"text-sm font-medium text-foreground",children:"Terminal"})]}),x.jsxs("div",{className:"relative flex-1 min-h-0 flex flex-col",children:[x.jsx("div",{className:"flex-1 min-h-0 terminal-body-bg",children:x.jsx(Ld,{ref:t,onData:v,onResize:y})}),x.jsx(tS,{visible:_,onStart:w}),x.jsx(rS,{plan:o,onAccept:()=>{u({type:"input",data:`y
290
- `}),i()},onReject:()=>{u({type:"input",data:`n
291
- `}),i()}})]})]})}function qM(){const[e,t]=g.useState([]),[r,n]=g.useState(!0),[s,o]=g.useState(null),[l,i]=g.useState(new Set),a=g.useRef(null),c=g.useCallback(async()=>{try{const v=await(await fetch("/terminal/api/sessions/list")).json();t(v.sessions??[])}catch{}finally{n(!1)}},[]);g.useEffect(()=>(c(),a.current=setInterval(c,KM),()=>{a.current&&clearInterval(a.current)}),[c]);const p=async u=>{i(v=>new Set(v).add(u));try{await fetch(`/terminal/api/sessions/${u}`,{method:"DELETE"}),s===u&&o(null),await c()}finally{i(v=>{const y=new Set(v);return y.delete(u),y})}};return s?x.jsxs("div",{className:"flex flex-col h-full",children:[x.jsx("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-border bg-muted/30",children:x.jsxs("button",{type:"button",onClick:()=>o(null),className:"inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-sm text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:[x.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:x.jsx("polyline",{points:"15 18 9 12 15 6"})}),"Back to sessions"]})}),x.jsx("div",{className:"flex-1 min-h-0",children:x.jsx(GM,{sessionId:s},s)})]}):x.jsxs("div",{className:"p-6 max-w-4xl mx-auto",children:[x.jsxs("div",{className:"flex items-center justify-between mb-6",children:[x.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Terminal Sessions"}),x.jsxs("span",{className:"text-xs text-muted-foreground",children:[e.length," session",e.length!==1?"s":""]})]}),r?x.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading sessions..."}):e.length===0?x.jsx("div",{className:"rounded-lg border border-border bg-muted/30 p-8 text-center",children:x.jsx("p",{className:"text-sm text-muted-foreground",children:"No terminal sessions. Sessions are created automatically when the pipeline triggers an LLM node."})}):x.jsx("div",{className:"space-y-2",children:e.map(u=>x.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border bg-card px-4 py-3 hover:bg-muted/30 transition-colors",children:[x.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[x.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${u.active?"bg-emerald-400":"bg-zinc-400"}`}),x.jsxs("div",{className:"min-w-0",children:[x.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:u.name||u.id}),x.jsxs("p",{className:"text-xs text-muted-foreground",children:[u.active?"Active":"Inactive",u.lastActivity?` · ${XM(u.lastActivity)}`:""]})]})]}),x.jsxs("div",{className:"flex items-center gap-2 shrink-0 ml-4",children:[x.jsx("button",{type:"button",onClick:()=>o(u.id),className:"rounded-md px-3 py-1.5 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",children:"Open"}),x.jsx("button",{type:"button",onClick:()=>p(u.id),disabled:l.has(u.id),className:"rounded-md px-3 py-1.5 text-xs font-medium text-destructive border border-destructive/30 hover:bg-destructive/10 transition-colors disabled:opacity-50",children:l.has(u.id)?"Closing...":"Close"})]})]},u.id))})]})}function XM(e){const t=Date.now()-new Date(e).getTime(),r=Math.floor(t/1e3);if(r<60)return"just now";const n=Math.floor(r/60);if(n<60)return`${n}m ago`;const s=Math.floor(n/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}const YM={pending:"bg-zinc-500/20 text-zinc-400",in_progress:"bg-blue-500/20 text-blue-400",completed:"bg-emerald-500/20 text-emerald-400",failed:"bg-red-500/20 text-red-400",paused:"bg-amber-500/20 text-amber-400",cancelled:"bg-zinc-500/20 text-zinc-500"};function Ds({status:e}){return x.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${YM[e]??"bg-zinc-500/20 text-zinc-400"}`,children:e})}function Yi(e){if(!e)return"—";try{return new Date(e).toLocaleTimeString()}catch{return e}}function QM(){var k;const[e,t]=g.useState(null),[r,n]=g.useState({}),[s,o]=g.useState(!1),[l,i]=g.useState(null),[a,c]=g.useState(new Set),p=g.useCallback(async()=>{o(!0),i(null);try{const[b,C]=await Promise.all([fetch("/api/repair/tracker"),fetch("/api/pipeline-graph")]);if(!b.ok)throw new Error(`Tracker: HTTP ${b.status}`);const P=await b.json();if(t(P),C.ok){const T=await C.json(),M=T.data??T,j=(M==null?void 0:M.ag)??[],N={};j.forEach(($,V)=>{N[$.id]={phase:$.ph,index:V}}),n(N)}}catch(b){i(String(b))}finally{o(!1)}},[]),u=g.useCallback(async(b,C,P)=>{try{const T={agent_id:b,status:C};P&&(T.unit_id=P),await fetch("/api/repair/agent-status",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)}),await p()}catch(T){i(String(T))}},[p]),v=g.useCallback(async b=>{try{await fetch("/api/repair/run-status",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:b})}),await p()}catch(C){i(String(C))}},[p]),y=g.useCallback(async()=>{try{await fetch("/api/poke-orchestrator",{method:"POST"})}catch(b){i(String(b))}},[]),w=g.useCallback(async(b,C)=>{try{await fetch("/api/resolve-intervention",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:b,response:C})}),await p()}catch(P){i(String(P))}},[p]),_=g.useCallback(async()=>{if(window.confirm("FULL RESET: This will reset ALL agents to pending AND clear all output data, interventions, and loop state. Continue?"))try{await fetch("/api/repair/full-reset",{method:"POST"}),await p()}catch(b){i(String(b))}},[p]),m=g.useCallback(b=>{c(C=>{const P=new Set(C);return P.has(b)?P.delete(b):P.add(b),P})},[]);function h({agentId:b,status:C,unitId:P}){return C==="pending"?null:x.jsxs("button",{type:"button",onClick:()=>u(b,"pending",P),className:"inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs bg-zinc-700 hover:bg-zinc-600 text-zinc-200 transition-colors",title:"Reset to pending (re-run)",children:[x.jsx(_b,{className:"h-3 w-3"})," Reset"]})}const d=(k=e==null?void 0:e.run)==null?void 0:k.status,f=(e==null?void 0:e.agents)??{},S=(e==null?void 0:e.interventions)??[],E=Object.entries(f).sort(([b],[C])=>{const P=r[b],T=r[C];return P&&T?P.phase!==T.phase?P.phase-T.phase:P.index-T.index:P&&!T?-1:!P&&T?1:b.localeCompare(C)});return x.jsxs("div",{className:"max-w-4xl mx-auto py-8 px-6 space-y-6",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx("h1",{className:"text-xl font-semibold text-foreground",children:"Repair"}),x.jsxs("button",{type:"button",onClick:p,disabled:s,className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-background px-3 py-1.5 text-sm text-foreground hover:bg-zinc-800 transition-colors disabled:opacity-50",children:[x.jsx(vb,{className:`h-3.5 w-3.5 ${s?"animate-spin":""}`}),e?"Refresh":"Load Tracker"]})]}),l&&x.jsx("div",{className:"rounded-md bg-red-500/10 border border-red-500/30 px-4 py-3 text-sm text-red-400",children:l}),!e&&!s&&!l&&x.jsx("p",{className:"text-sm text-muted-foreground",children:'Click "Load Tracker" to fetch the current pipeline state.'}),e&&x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[x.jsxs("div",{className:"flex items-center justify-between mb-3",children:[x.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Run Status"}),d&&x.jsx(Ds,{status:d})]}),x.jsxs("div",{className:"flex flex-wrap gap-2",children:[d!=="in_progress"&&x.jsxs("button",{type:"button",onClick:()=>v("in_progress"),className:"inline-flex items-center gap-1.5 rounded-md bg-emerald-600 hover:bg-emerald-500 px-3 py-1.5 text-xs font-medium text-white transition-colors",children:[x.jsx(pb,{className:"h-3 w-3"})," Resume"]}),d==="in_progress"&&x.jsxs("button",{type:"button",onClick:()=>v("paused"),className:"inline-flex items-center gap-1.5 rounded-md bg-amber-600 hover:bg-amber-500 px-3 py-1.5 text-xs font-medium text-white transition-colors",children:[x.jsx(hb,{className:"h-3 w-3"})," Pause"]}),x.jsxs("button",{type:"button",onClick:y,className:"inline-flex items-center gap-1.5 rounded-md bg-blue-600 hover:bg-blue-500 px-3 py-1.5 text-xs font-medium text-white transition-colors",children:[x.jsx(Mb,{className:"h-3 w-3"})," Poke Orchestrator"]}),x.jsxs("button",{type:"button",onClick:_,className:"inline-flex items-center gap-1.5 rounded-md bg-red-800 hover:bg-red-700 px-3 py-1.5 text-xs font-medium text-white transition-colors",children:[x.jsx(Pb,{className:"h-3 w-3"})," Full Reset"]})]})]}),x.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[x.jsxs("h2",{className:"text-sm font-medium text-foreground mb-3",children:["Agents (",Object.keys(f).length,")"]}),Object.keys(f).length===0?x.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents in tracker."}):x.jsx("div",{className:"overflow-x-auto",children:x.jsxs("table",{className:"w-full text-sm",children:[x.jsx("thead",{children:x.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[x.jsx("th",{className:"pb-2 pr-3 font-medium",children:"Agent"}),x.jsx("th",{className:"pb-2 pr-3 font-medium",children:"Phase"}),x.jsx("th",{className:"pb-2 pr-3 font-medium",children:"Status"}),x.jsx("th",{className:"pb-2 pr-3 font-medium",children:"Triggered"}),x.jsx("th",{className:"pb-2 pr-3 font-medium",children:"Completed"}),x.jsx("th",{className:"pb-2 font-medium",children:"Actions"})]})}),x.jsx("tbody",{children:E.map(([b,C])=>{var M;const P=C.units&&Object.keys(C.units).length>0,T=a.has(b);return x.jsx(JM,{agentId:b,agent:C,phase:(M=r[b])==null?void 0:M.phase,hasUnits:!!P,isExpanded:T,onToggle:()=>m(b),actions:x.jsx(h,{agentId:b,status:C.status}),unitActions:(j,N)=>x.jsx(h,{agentId:b,status:N,unitId:j})},b)})})]})})]}),x.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[x.jsxs("h2",{className:"text-sm font-medium text-foreground mb-3",children:["Interventions (",S.length,")"]}),S.length===0?x.jsx("p",{className:"text-sm text-muted-foreground",children:"No interventions."}):x.jsx("div",{className:"overflow-x-auto",children:x.jsxs("table",{className:"w-full text-sm",children:[x.jsx("thead",{children:x.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[x.jsx("th",{className:"pb-2 pr-3 font-medium",children:"ID"}),x.jsx("th",{className:"pb-2 pr-3 font-medium",children:"Agent"}),x.jsx("th",{className:"pb-2 pr-3 font-medium",children:"Type"}),x.jsx("th",{className:"pb-2 pr-3 font-medium",children:"Status"}),x.jsx("th",{className:"pb-2 pr-3 font-medium",children:"Message"}),x.jsx("th",{className:"pb-2 font-medium",children:"Actions"})]})}),x.jsx("tbody",{children:S.map(b=>x.jsxs("tr",{className:"border-b border-border/50",children:[x.jsx("td",{className:"py-2 pr-3 font-mono text-xs text-muted-foreground",title:b.id,children:b.id.length>12?b.id.slice(0,12)+"...":b.id}),x.jsx("td",{className:"py-2 pr-3 font-mono text-xs",children:b.agent_id}),x.jsx("td",{className:"py-2 pr-3",children:x.jsx(Ds,{status:b.type})}),x.jsx("td",{className:"py-2 pr-3",children:x.jsx(Ds,{status:b.status})}),x.jsx("td",{className:"py-2 pr-3 text-xs text-muted-foreground max-w-[200px] truncate",title:b.message,children:b.message}),x.jsx("td",{className:"py-2",children:b.status==="pending"&&x.jsxs("div",{className:"flex gap-1.5",children:[x.jsx("button",{type:"button",onClick:()=>w(b.id,"continue"),className:"inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs bg-emerald-600 hover:bg-emerald-500 text-white transition-colors",children:"Continue"}),x.jsx("button",{type:"button",onClick:()=>w(b.id,"skip"),className:"inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs bg-zinc-700 hover:bg-zinc-600 text-zinc-200 transition-colors",children:"Skip"})]})})]},b.id))})]})})]})]})]})}function JM({agentId:e,agent:t,phase:r,hasUnits:n,isExpanded:s,onToggle:o,actions:l,unitActions:i}){return x.jsxs(x.Fragment,{children:[x.jsxs("tr",{className:"border-b border-border/50",children:[x.jsx("td",{className:"py-2 pr-3 font-mono text-xs",children:x.jsxs("div",{className:"flex items-center gap-1",children:[n&&x.jsx("button",{type:"button",onClick:o,className:"text-muted-foreground hover:text-foreground",children:s?x.jsx(Vu,{className:"h-3.5 w-3.5"}):x.jsx(Qv,{className:"h-3.5 w-3.5"})}),e]})}),x.jsx("td",{className:"py-2 pr-3 text-xs text-muted-foreground",children:r??"—"}),x.jsx("td",{className:"py-2 pr-3",children:x.jsx(Ds,{status:t.status})}),x.jsx("td",{className:"py-2 pr-3 text-xs text-muted-foreground",children:Yi(t.triggered_at)}),x.jsx("td",{className:"py-2 pr-3 text-xs text-muted-foreground",children:Yi(t.completed_at)}),x.jsx("td",{className:"py-2",children:l})]}),n&&s&&Object.entries(t.units).map(([a,c])=>x.jsxs("tr",{className:"border-b border-border/30 bg-zinc-900/30",children:[x.jsx("td",{className:"py-1.5 pr-3 pl-8 font-mono text-xs text-muted-foreground",children:a}),x.jsx("td",{className:"py-1.5 pr-3"}),x.jsx("td",{className:"py-1.5 pr-3",children:x.jsx(Ds,{status:c.status})}),x.jsx("td",{className:"py-1.5 pr-3 text-xs text-muted-foreground",children:Yi(c.triggered_at)}),x.jsx("td",{className:"py-1.5 pr-3 text-xs text-muted-foreground",children:Yi(c.completed_at)}),x.jsx("td",{className:"py-1.5",children:i(a,c.status)})]},`${e}-${a}`))]})}function ZM({onLogout:e}){const[t,r]=g.useState(null),[n,s]=g.useState(null),[o,l]=g.useState(null),[i,a]=g.useState(!0),[c,p]=g.useState(!1),[u,v]=g.useState(!1),[y,w]=g.useState("dashboard"),[_,m]=g.useState(null),[h,d]=g.useState(!1),[f,S]=g.useState(!1),[E,k]=g.useState([]),[b,C]=g.useState(!1),[P,T]=g.useState(null),[M,j]=g.useState(new Set),[N,$]=g.useState({}),[V,K]=g.useState({}),[q,B]=g.useState({}),R=async()=>{await fetch("/api/auth",{method:"DELETE"}),e()},L=g.useCallback(F=>{switch(F.type){case"tracker_update":s(F.agents),C(!1),F.interventions&&k(F.interventions);break;case"pipeline_stalled":C(!0);break;case"pipeline_completed":T("completed");break;case"run_status_change":T(F.status);break;case"sessions_needing_attention":j(new Set(F.agentIds));break;case"session_previews":$(F.previews);break;case"workspace_setup_progress":B(U=>({...U,workspace_setup:{messages:F.messages,templateMatch:F.templateMatch}}));break;case"impl_prep_progress":B(U=>({...U,impl_prep:{messages:F.messages}}));break;case"post_impl_launch_progress":B(U=>({...U,post_impl_launch:{messages:F.messages,appUrl:F.appUrl}}));break;case"node_start_failed":K(U=>({...U,[F.agentId]:F.error}));break;case"llm_node_started":m(F.sessionId),v(!0),S(!1);break;case"llm_node_stopped":S(!0);break}},[]);Pd({onMessage:L}),g.useEffect(()=>{Promise.all([fetch("/api/pipeline-graph").then(F=>F.json()),fetch("/api/pipeline-tracker").then(F=>F.json()).catch(()=>null),fetch("/api/terminal-status").then(F=>F.json()).catch(()=>({available:!1})),fetch("/api/active-llm-session").then(F=>F.json()).catch(()=>null),fetch("/terminal/api/sessions/list").then(F=>F.json()).catch(()=>({sessions:[]})),fetch("/api/node-errors").then(F=>F.json()).catch(()=>[])]).then(([F,U,G,O,A,W])=>{const H=F.error?null:F.data??F;F.error?l(F.error):r(H),U!=null&&U.agents&&s(U.agents),Array.isArray(U==null?void 0:U.interventions)&&k(U.interventions),U!=null&&U.runStatus&&T(U.runStatus);const Y=G.available===!0;p(Y),Y&&(O!=null&&O.sessionId)&&(m(O.sessionId),v(!0));const X=(A==null?void 0:A.sessions)??[];if(d(X.some(ne=>ne.active)),Array.isArray(W)){const ne={};for(const ie of W)ie.agentId&&ie.error&&(ne[ie.agentId]=ie.error);Object.keys(ne).length>0&&K(ne)}}).catch(F=>l(String(F))).finally(()=>a(!1))},[]);const I=g.useCallback(()=>{C(!1),fetch("/api/poke-orchestrator",{method:"POST"}).catch(F=>console.error("Poke failed:",F))},[]),D=g.useCallback(F=>{m(F),v(!0)},[]),z=g.useCallback((F,U)=>{k(G=>G.filter(O=>O.id!==F)),fetch("/api/resolve-intervention",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:F,response:U})}).catch(G=>console.error("Failed to resolve intervention:",G))},[]);return x.jsxs("div",{className:"flex h-screen flex-col overflow-hidden",children:[x.jsx(CM,{}),x.jsxs("div",{className:"flex flex-1 min-h-0",children:[x.jsx(bM,{onLogout:R,terminalAvailable:c,activePage:y,onNavigate:w}),x.jsxs("main",{className:"flex-1 overflow-y-auto content-gradient",children:[y==="dashboard"&&x.jsxs("div",{className:"welcome-content",children:[x.jsx("h1",{children:"Welcome to LaunchPod"}),i?x.jsx("p",{className:"text-muted-foreground",children:"Loading pipeline graph..."}):o?x.jsx("p",{className:"text-destructive",children:o}):t?x.jsx(x.Fragment,{children:x.jsx(AM,{data:t,agentStatuses:n??void 0,interventions:E,onResolveIntervention:z,stalled:b,onPoke:I,attentionAgentIds:M,sessionPreviews:N,onOpenTerminal:D,podProgressStates:q,runStatus:P??void 0,nodeErrors:V})}):null]}),y==="terminal"&&x.jsx(qM,{}),y==="settings"&&x.jsx(jM,{}),y==="repair"&&x.jsx(QM,{})]})]}),c&&x.jsx(VM,{open:u,onClose:()=>v(!1),autoSessionId:_}),b&&x.jsx("button",{type:"button",onClick:I,className:"pipeline-poke-fab",title:"Poke orchestrator",children:x.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x.jsx("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),x.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]})})]})}function eN(){const[e,t]=g.useState(null);return g.useEffect(()=>{fetch("/api/auth").then(r=>r.json()).then(r=>t(r.authenticated)).catch(()=>t(!1))},[]),e===null?x.jsx(dM,{fullPage:!0}):x.jsxs(xC,{children:[x.jsx(bc,{path:"/login",element:e?x.jsx(Kh,{to:"/",replace:!0}):x.jsx(yM,{onSuccess:()=>t(!0)})}),x.jsx(bc,{path:"/",element:e?x.jsx(ZM,{onLogout:()=>t(!1)}):x.jsx(Kh,{to:"/login",replace:!0})})]})}Ll.createRoot(document.getElementById("root")).render(x.jsx(Ve.StrictMode,{children:x.jsx(EC,{children:x.jsx(PC,{children:x.jsx(eN,{})})})}));