clustr-ai 0.1.8
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.
- package/LICENSE +21 -0
- package/README.md +42 -0
- package/bin/clustr.js +106 -0
- package/dist/client/assets/index-B5DBV_7j.js +109 -0
- package/dist/client/assets/index-Y3n54xBs.css +32 -0
- package/dist/client/favicon.svg +12 -0
- package/dist/client/index.html +14 -0
- package/dist/server/index.js +483 -0
- package/dist/server/mcp-stdio-bridge.js +43 -0
- package/package.json +45 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))o(u);new MutationObserver(u=>{for(const S of u)if(S.type==="childList")for(const y of S.addedNodes)y.tagName==="LINK"&&y.rel==="modulepreload"&&o(y)}).observe(document,{childList:!0,subtree:!0});function i(u){const S={};return u.integrity&&(S.integrity=u.integrity),u.referrerPolicy&&(S.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?S.credentials="include":u.crossOrigin==="anonymous"?S.credentials="omit":S.credentials="same-origin",S}function o(u){if(u.ep)return;u.ep=!0;const S=i(u);fetch(u.href,S)}})();function Iu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Oc={exports:{}},as={},Hc={exports:{}},Re={};/**
|
|
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 Af;function V0(){if(Af)return Re;Af=1;var e=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),y=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),_=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),l=Symbol.iterator;function m(P){return P===null||typeof P!="object"?null:(P=l&&P[l]||P["@@iterator"],typeof P=="function"?P:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,C={};function f(P,H,G){this.props=P,this.context=H,this.refs=C,this.updater=G||x}f.prototype.isReactComponent={},f.prototype.setState=function(P,H){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,H,"setState")},f.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function p(){}p.prototype=f.prototype;function d(P,H,G){this.props=P,this.context=H,this.refs=C,this.updater=G||x}var h=d.prototype=new p;h.constructor=d,b(h,f.prototype),h.isPureReactComponent=!0;var w=Array.isArray,L=Object.prototype.hasOwnProperty,R={current:null},D={key:!0,ref:!0,__self:!0,__source:!0};function k(P,H,G){var Z,se={},ee=null,X=null;if(H!=null)for(Z in H.ref!==void 0&&(X=H.ref),H.key!==void 0&&(ee=""+H.key),H)L.call(H,Z)&&!D.hasOwnProperty(Z)&&(se[Z]=H[Z]);var O=arguments.length-2;if(O===1)se.children=G;else if(1<O){for(var re=Array(O),ne=0;ne<O;ne++)re[ne]=arguments[ne+2];se.children=re}if(P&&P.defaultProps)for(Z in O=P.defaultProps,O)se[Z]===void 0&&(se[Z]=O[Z]);return{$$typeof:e,type:P,key:ee,ref:X,props:se,_owner:R.current}}function M(P,H){return{$$typeof:e,type:P.type,key:H,ref:P.ref,props:P.props,_owner:P._owner}}function W(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function z(P){var H={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(G){return H[G]})}var F=/\/+/g;function N(P,H){return typeof P=="object"&&P!==null&&P.key!=null?z(""+P.key):H.toString(36)}function I(P,H,G,Z,se){var ee=typeof P;(ee==="undefined"||ee==="boolean")&&(P=null);var X=!1;if(P===null)X=!0;else switch(ee){case"string":case"number":X=!0;break;case"object":switch(P.$$typeof){case e:case r:X=!0}}if(X)return X=P,se=se(X),P=Z===""?"."+N(X,0):Z,w(se)?(G="",P!=null&&(G=P.replace(F,"$&/")+"/"),I(se,H,G,"",function(ne){return ne})):se!=null&&(W(se)&&(se=M(se,G+(!se.key||X&&X.key===se.key?"":(""+se.key).replace(F,"$&/")+"/")+P)),H.push(se)),1;if(X=0,Z=Z===""?".":Z+":",w(P))for(var O=0;O<P.length;O++){ee=P[O];var re=Z+N(ee,O);X+=I(ee,H,G,re,se)}else if(re=m(P),typeof re=="function")for(P=re.call(P),O=0;!(ee=P.next()).done;)ee=ee.value,re=Z+N(ee,O++),X+=I(ee,H,G,re,se);else if(ee==="object")throw H=String(P),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.");return X}function q(P,H,G){if(P==null)return P;var Z=[],se=0;return I(P,Z,"","",function(ee){return H.call(G,ee,se++)}),Z}function V(P){if(P._status===-1){var H=P._result;H=H(),H.then(function(G){(P._status===0||P._status===-1)&&(P._status=1,P._result=G)},function(G){(P._status===0||P._status===-1)&&(P._status=2,P._result=G)}),P._status===-1&&(P._status=0,P._result=H)}if(P._status===1)return P._result.default;throw P._result}var K={current:null},U={transition:null},A={ReactCurrentDispatcher:K,ReactCurrentBatchConfig:U,ReactCurrentOwner:R};function B(){throw Error("act(...) is not supported in production builds of React.")}return Re.Children={map:q,forEach:function(P,H,G){q(P,function(){H.apply(this,arguments)},G)},count:function(P){var H=0;return q(P,function(){H++}),H},toArray:function(P){return q(P,function(H){return H})||[]},only:function(P){if(!W(P))throw Error("React.Children.only expected to receive a single React element child.");return P}},Re.Component=f,Re.Fragment=i,Re.Profiler=u,Re.PureComponent=d,Re.StrictMode=o,Re.Suspense=c,Re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=A,Re.act=B,Re.cloneElement=function(P,H,G){if(P==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+P+".");var Z=b({},P.props),se=P.key,ee=P.ref,X=P._owner;if(H!=null){if(H.ref!==void 0&&(ee=H.ref,X=R.current),H.key!==void 0&&(se=""+H.key),P.type&&P.type.defaultProps)var O=P.type.defaultProps;for(re in H)L.call(H,re)&&!D.hasOwnProperty(re)&&(Z[re]=H[re]===void 0&&O!==void 0?O[re]:H[re])}var re=arguments.length-2;if(re===1)Z.children=G;else if(1<re){O=Array(re);for(var ne=0;ne<re;ne++)O[ne]=arguments[ne+2];Z.children=O}return{$$typeof:e,type:P.type,key:se,ref:ee,props:Z,_owner:X}},Re.createContext=function(P){return P={$$typeof:y,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},P.Provider={$$typeof:S,_context:P},P.Consumer=P},Re.createElement=k,Re.createFactory=function(P){var H=k.bind(null,P);return H.type=P,H},Re.createRef=function(){return{current:null}},Re.forwardRef=function(P){return{$$typeof:a,render:P}},Re.isValidElement=W,Re.lazy=function(P){return{$$typeof:v,_payload:{_status:-1,_result:P},_init:V}},Re.memo=function(P,H){return{$$typeof:_,type:P,compare:H===void 0?null:H}},Re.startTransition=function(P){var H=U.transition;U.transition={};try{P()}finally{U.transition=H}},Re.unstable_act=B,Re.useCallback=function(P,H){return K.current.useCallback(P,H)},Re.useContext=function(P){return K.current.useContext(P)},Re.useDebugValue=function(){},Re.useDeferredValue=function(P){return K.current.useDeferredValue(P)},Re.useEffect=function(P,H){return K.current.useEffect(P,H)},Re.useId=function(){return K.current.useId()},Re.useImperativeHandle=function(P,H,G){return K.current.useImperativeHandle(P,H,G)},Re.useInsertionEffect=function(P,H){return K.current.useInsertionEffect(P,H)},Re.useLayoutEffect=function(P,H){return K.current.useLayoutEffect(P,H)},Re.useMemo=function(P,H){return K.current.useMemo(P,H)},Re.useReducer=function(P,H,G){return K.current.useReducer(P,H,G)},Re.useRef=function(P){return K.current.useRef(P)},Re.useState=function(P){return K.current.useState(P)},Re.useSyncExternalStore=function(P,H,G){return K.current.useSyncExternalStore(P,H,G)},Re.useTransition=function(){return K.current.useTransition()},Re.version="18.3.1",Re}var Mf;function Es(){return Mf||(Mf=1,Hc.exports=V0()),Hc.exports}/**
|
|
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 Pf;function q0(){if(Pf)return as;Pf=1;var e=Es(),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,u=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,S={key:!0,ref:!0,__self:!0,__source:!0};function y(a,c,_){var v,l={},m=null,x=null;_!==void 0&&(m=""+_),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(x=c.ref);for(v in c)o.call(c,v)&&!S.hasOwnProperty(v)&&(l[v]=c[v]);if(a&&a.defaultProps)for(v in c=a.defaultProps,c)l[v]===void 0&&(l[v]=c[v]);return{$$typeof:r,type:a,key:m,ref:x,props:l,_owner:u.current}}return as.Fragment=i,as.jsx=y,as.jsxs=y,as}var Bf;function K0(){return Bf||(Bf=1,Oc.exports=q0()),Oc.exports}var j=K0(),J=Es();const Ou=Iu(J);var Yo={},Fc={exports:{}},bt={},jc={exports:{}},zc={};/**
|
|
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
|
+
*/var Nf;function X0(){return Nf||(Nf=1,(function(e){function r(U,A){var B=U.length;U.push(A);e:for(;0<B;){var P=B-1>>>1,H=U[P];if(0<u(H,A))U[P]=A,U[B]=H,B=P;else break e}}function i(U){return U.length===0?null:U[0]}function o(U){if(U.length===0)return null;var A=U[0],B=U.pop();if(B!==A){U[0]=B;e:for(var P=0,H=U.length,G=H>>>1;P<G;){var Z=2*(P+1)-1,se=U[Z],ee=Z+1,X=U[ee];if(0>u(se,B))ee<H&&0>u(X,se)?(U[P]=X,U[ee]=B,P=ee):(U[P]=se,U[Z]=B,P=Z);else if(ee<H&&0>u(X,B))U[P]=X,U[ee]=B,P=ee;else break e}}return A}function u(U,A){var B=U.sortIndex-A.sortIndex;return B!==0?B:U.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var S=performance;e.unstable_now=function(){return S.now()}}else{var y=Date,a=y.now();e.unstable_now=function(){return y.now()-a}}var c=[],_=[],v=1,l=null,m=3,x=!1,b=!1,C=!1,f=typeof setTimeout=="function"?setTimeout:null,p=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 h(U){for(var A=i(_);A!==null;){if(A.callback===null)o(_);else if(A.startTime<=U)o(_),A.sortIndex=A.expirationTime,r(c,A);else break;A=i(_)}}function w(U){if(C=!1,h(U),!b)if(i(c)!==null)b=!0,V(L);else{var A=i(_);A!==null&&K(w,A.startTime-U)}}function L(U,A){b=!1,C&&(C=!1,p(k),k=-1),x=!0;var B=m;try{for(h(A),l=i(c);l!==null&&(!(l.expirationTime>A)||U&&!z());){var P=l.callback;if(typeof P=="function"){l.callback=null,m=l.priorityLevel;var H=P(l.expirationTime<=A);A=e.unstable_now(),typeof H=="function"?l.callback=H:l===i(c)&&o(c),h(A)}else o(c);l=i(c)}if(l!==null)var G=!0;else{var Z=i(_);Z!==null&&K(w,Z.startTime-A),G=!1}return G}finally{l=null,m=B,x=!1}}var R=!1,D=null,k=-1,M=5,W=-1;function z(){return!(e.unstable_now()-W<M)}function F(){if(D!==null){var U=e.unstable_now();W=U;var A=!0;try{A=D(!0,U)}finally{A?N():(R=!1,D=null)}}else R=!1}var N;if(typeof d=="function")N=function(){d(F)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,q=I.port2;I.port1.onmessage=F,N=function(){q.postMessage(null)}}else N=function(){f(F,0)};function V(U){D=U,R||(R=!0,N())}function K(U,A){k=f(function(){U(e.unstable_now())},A)}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(U){U.callback=null},e.unstable_continueExecution=function(){b||x||(b=!0,V(L))},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return i(c)},e.unstable_next=function(U){switch(m){case 1:case 2:case 3:var A=3;break;default:A=m}var B=m;m=A;try{return U()}finally{m=B}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(U,A){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var B=m;m=U;try{return A()}finally{m=B}},e.unstable_scheduleCallback=function(U,A,B){var P=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?P+B:P):B=P,U){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=B+H,U={id:v++,callback:A,priorityLevel:U,startTime:B,expirationTime:H,sortIndex:-1},B>P?(U.sortIndex=B,r(_,U),i(c)===null&&U===i(_)&&(C?(p(k),k=-1):C=!0,K(w,B-P))):(U.sortIndex=H,r(c,U),b||x||(b=!0,V(L))),U},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(U){var A=m;return function(){var B=m;m=A;try{return U.apply(this,arguments)}finally{m=B}}}})(zc)),zc}var If;function Y0(){return If||(If=1,jc.exports=X0()),jc.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 Of;function G0(){if(Of)return bt;Of=1;var e=Es(),r=Y0();function i(t){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+t,s=1;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s]);return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,u={};function S(t,n){y(t,n),y(t+"Capture",n)}function y(t,n){for(u[t]=n,t=0;t<n.length;t++)o.add(n[t])}var a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,_=/^[: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]*$/,v={},l={};function m(t){return c.call(l,t)?!0:c.call(v,t)?!1:_.test(t)?l[t]=!0:(v[t]=!0,!1)}function x(t,n,s,g){if(s!==null&&s.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return g?!1:s!==null?!s.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function b(t,n,s,g){if(n===null||typeof n>"u"||x(t,n,s,g))return!0;if(g)return!1;if(s!==null)switch(s.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function C(t,n,s,g,E,T,$){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=g,this.attributeNamespace=E,this.mustUseProperty=s,this.propertyName=t,this.type=n,this.sanitizeURL=T,this.removeEmptyString=$}var f={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){f[t]=new C(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var n=t[0];f[n]=new C(n,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){f[t]=new C(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){f[t]=new C(t,2,!1,t,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(t){f[t]=new C(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){f[t]=new C(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){f[t]=new C(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){f[t]=new C(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){f[t]=new C(t,5,!1,t.toLowerCase(),null,!1,!1)});var p=/[\-:]([a-z])/g;function d(t){return t[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(t){var n=t.replace(p,d);f[n]=new C(n,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var n=t.replace(p,d);f[n]=new C(n,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var n=t.replace(p,d);f[n]=new C(n,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){f[t]=new C(t,1,!1,t.toLowerCase(),null,!1,!1)}),f.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){f[t]=new C(t,1,!1,t.toLowerCase(),null,!0,!0)});function h(t,n,s,g){var E=f.hasOwnProperty(n)?f[n]:null;(E!==null?E.type!==0:g||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(b(n,s,E,g)&&(s=null),g||E===null?m(n)&&(s===null?t.removeAttribute(n):t.setAttribute(n,""+s)):E.mustUseProperty?t[E.propertyName]=s===null?E.type===3?!1:"":s:(n=E.attributeName,g=E.attributeNamespace,s===null?t.removeAttribute(n):(E=E.type,s=E===3||E===4&&s===!0?"":""+s,g?t.setAttributeNS(g,n,s):t.setAttribute(n,s))))}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,L=Symbol.for("react.element"),R=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),W=Symbol.for("react.provider"),z=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),K=Symbol.for("react.offscreen"),U=Symbol.iterator;function A(t){return t===null||typeof t!="object"?null:(t=U&&t[U]||t["@@iterator"],typeof t=="function"?t:null)}var B=Object.assign,P;function H(t){if(P===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);P=n&&n[1]||""}return`
|
|
34
|
+
`+P+t}var G=!1;function Z(t,n){if(!t||G)return"";G=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(ae){var g=ae}Reflect.construct(t,[],n)}else{try{n.call()}catch(ae){g=ae}t.call(n.prototype)}else{try{throw Error()}catch(ae){g=ae}t()}}catch(ae){if(ae&&g&&typeof ae.stack=="string"){for(var E=ae.stack.split(`
|
|
35
|
+
`),T=g.stack.split(`
|
|
36
|
+
`),$=E.length-1,Y=T.length-1;1<=$&&0<=Y&&E[$]!==T[Y];)Y--;for(;1<=$&&0<=Y;$--,Y--)if(E[$]!==T[Y]){if($!==1||Y!==1)do if($--,Y--,0>Y||E[$]!==T[Y]){var Q=`
|
|
37
|
+
`+E[$].replace(" at new "," at ");return t.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",t.displayName)),Q}while(1<=$&&0<=Y);break}}}finally{G=!1,Error.prepareStackTrace=s}return(t=t?t.displayName||t.name:"")?H(t):""}function se(t){switch(t.tag){case 5:return H(t.type);case 16:return H("Lazy");case 13:return H("Suspense");case 19:return H("SuspenseList");case 0:case 2:case 15:return t=Z(t.type,!1),t;case 11:return t=Z(t.type.render,!1),t;case 1:return t=Z(t.type,!0),t;default:return""}}function ee(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case D:return"Fragment";case R:return"Portal";case M:return"Profiler";case k:return"StrictMode";case N:return"Suspense";case I:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case z:return(t.displayName||"Context")+".Consumer";case W:return(t._context.displayName||"Context")+".Provider";case F:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case q:return n=t.displayName||null,n!==null?n:ee(t.type)||"Memo";case V:n=t._payload,t=t._init;try{return ee(t(n))}catch{}}return null}function X(t){var n=t.type;switch(t.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=n.render,t=t.displayName||t.name||"",n.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ee(n);case 8:return n===k?"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 n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function O(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function re(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ne(t){var n=re(t)?"checked":"value",s=Object.getOwnPropertyDescriptor(t.constructor.prototype,n),g=""+t[n];if(!t.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var E=s.get,T=s.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return E.call(this)},set:function($){g=""+$,T.call(this,$)}}),Object.defineProperty(t,n,{enumerable:s.enumerable}),{getValue:function(){return g},setValue:function($){g=""+$},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function ce(t){t._valueTracker||(t._valueTracker=ne(t))}function le(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var s=n.getValue(),g="";return t&&(g=re(t)?t.checked?"true":"false":t.value),t=g,t!==s?(n.setValue(t),!0):!1}function fe(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function we(t,n){var s=n.checked;return B({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??t._wrapperState.initialChecked})}function ye(t,n){var s=n.defaultValue==null?"":n.defaultValue,g=n.checked!=null?n.checked:n.defaultChecked;s=O(n.value!=null?n.value:s),t._wrapperState={initialChecked:g,initialValue:s,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function xe(t,n){n=n.checked,n!=null&&h(t,"checked",n,!1)}function ge(t,n){xe(t,n);var s=O(n.value),g=n.type;if(s!=null)g==="number"?(s===0&&t.value===""||t.value!=s)&&(t.value=""+s):t.value!==""+s&&(t.value=""+s);else if(g==="submit"||g==="reset"){t.removeAttribute("value");return}n.hasOwnProperty("value")?st(t,n.type,s):n.hasOwnProperty("defaultValue")&&st(t,n.type,O(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(t.defaultChecked=!!n.defaultChecked)}function Ie(t,n,s){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var g=n.type;if(!(g!=="submit"&&g!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+t._wrapperState.initialValue,s||n===t.value||(t.value=n),t.defaultValue=n}s=t.name,s!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,s!==""&&(t.name=s)}function st(t,n,s){(n!=="number"||fe(t.ownerDocument)!==t)&&(s==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+s&&(t.defaultValue=""+s))}var ot=Array.isArray;function ct(t,n,s,g){if(t=t.options,n){n={};for(var E=0;E<s.length;E++)n["$"+s[E]]=!0;for(s=0;s<t.length;s++)E=n.hasOwnProperty("$"+t[s].value),t[s].selected!==E&&(t[s].selected=E),E&&g&&(t[s].defaultSelected=!0)}else{for(s=""+O(s),n=null,E=0;E<t.length;E++){if(t[E].value===s){t[E].selected=!0,g&&(t[E].defaultSelected=!0);return}n!==null||t[E].disabled||(n=t[E])}n!==null&&(n.selected=!0)}}function vt(t,n){if(n.dangerouslySetInnerHTML!=null)throw Error(i(91));return B({},n,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function qe(t,n){var s=n.value;if(s==null){if(s=n.children,n=n.defaultValue,s!=null){if(n!=null)throw Error(i(92));if(ot(s)){if(1<s.length)throw Error(i(93));s=s[0]}n=s}n==null&&(n=""),s=n}t._wrapperState={initialValue:O(s)}}function Nt(t,n){var s=O(n.value),g=O(n.defaultValue);s!=null&&(s=""+s,s!==t.value&&(t.value=s),n.defaultValue==null&&t.defaultValue!==s&&(t.defaultValue=s)),g!=null&&(t.defaultValue=""+g)}function et(t){var n=t.textContent;n===t._wrapperState.initialValue&&n!==""&&n!==null&&(t.value=n)}function _t(t){switch(t){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 kt(t,n){return t==null||t==="http://www.w3.org/1999/xhtml"?_t(n):t==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var ut,pr=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,s,g,E){MSApp.execUnsafeLocalFunction(function(){return t(n,s,g,E)})}:t})(function(t,n){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=n;else{for(ut=ut||document.createElement("div"),ut.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=ut.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;n.firstChild;)t.appendChild(n.firstChild)}});function tt(t,n){if(n){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=n;return}}t.textContent=n}var Lt={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},Be=["Webkit","ms","Moz","O"];Object.keys(Lt).forEach(function(t){Be.forEach(function(n){n=n+t.charAt(0).toUpperCase()+t.substring(1),Lt[n]=Lt[t]})});function Ln(t,n,s){return n==null||typeof n=="boolean"||n===""?"":s||typeof n!="number"||n===0||Lt.hasOwnProperty(t)&&Lt[t]?(""+n).trim():n+"px"}function Ms(t,n){t=t.style;for(var s in n)if(n.hasOwnProperty(s)){var g=s.indexOf("--")===0,E=Ln(s,n[s],g);s==="float"&&(s="cssFloat"),g?t.setProperty(s,E):t[s]=E}}var qa=B({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 mi(t,n){if(n){if(qa[t]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(i(137,t));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(i(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(i(61))}if(n.style!=null&&typeof n.style!="object")throw Error(i(62))}}function vi(t,n){if(t.indexOf("-")===-1)return typeof n.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var yi=null;function wi(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Si=null,Rr=null,Dr=null;function Ps(t){if(t=qi(t)){if(typeof Si!="function")throw Error(i(280));var n=t.stateNode;n&&(n=co(n),Si(t.stateNode,t.type,n))}}function Bs(t){Rr?Dr?Dr.push(t):Dr=[t]:Rr=t}function Ns(){if(Rr){var t=Rr,n=Dr;if(Dr=Rr=null,Ps(t),n)for(t=0;t<n.length;t++)Ps(n[t])}}function Is(t,n){return t(n)}function Os(){}var Ci=!1;function Hs(t,n,s){if(Ci)return t(n,s);Ci=!0;try{return Is(t,n,s)}finally{Ci=!1,(Rr!==null||Dr!==null)&&(Os(),Ns())}}function tn(t,n){var s=t.stateNode;if(s===null)return null;var g=co(s);if(g===null)return null;s=g[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(t=t.type,g=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!g;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(i(231,n,typeof s));return s}var xi=!1;if(a)try{var rn={};Object.defineProperty(rn,"passive",{get:function(){xi=!0}}),window.addEventListener("test",rn,rn),window.removeEventListener("test",rn,rn)}catch{xi=!1}function Ka(t,n,s,g,E,T,$,Y,Q){var ae=Array.prototype.slice.call(arguments,3);try{n.apply(s,ae)}catch(he){this.onError(he)}}var nn=!1,Rn=null,Dn=!1,bi=null,Xa={onError:function(t){nn=!0,Rn=t}};function Ya(t,n,s,g,E,T,$,Y,Q){nn=!1,Rn=null,Ka.apply(Xa,arguments)}function Ga(t,n,s,g,E,T,$,Y,Q){if(Ya.apply(this,arguments),nn){if(nn){var ae=Rn;nn=!1,Rn=null}else throw Error(i(198));Dn||(Dn=!0,bi=ae)}}function rr(t){var n=t,s=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(s=n.return),t=n.return;while(t)}return n.tag===3?s:null}function Ei(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function ki(t){if(rr(t)!==t)throw Error(i(188))}function Qa(t){var n=t.alternate;if(!n){if(n=rr(t),n===null)throw Error(i(188));return n!==t?null:t}for(var s=t,g=n;;){var E=s.return;if(E===null)break;var T=E.alternate;if(T===null){if(g=E.return,g!==null){s=g;continue}break}if(E.child===T.child){for(T=E.child;T;){if(T===s)return ki(E),t;if(T===g)return ki(E),n;T=T.sibling}throw Error(i(188))}if(s.return!==g.return)s=E,g=T;else{for(var $=!1,Y=E.child;Y;){if(Y===s){$=!0,s=E,g=T;break}if(Y===g){$=!0,g=E,s=T;break}Y=Y.sibling}if(!$){for(Y=T.child;Y;){if(Y===s){$=!0,s=T,g=E;break}if(Y===g){$=!0,g=T,s=E;break}Y=Y.sibling}if(!$)throw Error(i(189))}}if(s.alternate!==g)throw Error(i(190))}if(s.tag!==3)throw Error(i(188));return s.stateNode.current===s?t:n}function Fs(t){return t=Qa(t),t!==null?js(t):null}function js(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var n=js(t);if(n!==null)return n;t=t.sibling}return null}var zs=r.unstable_scheduleCallback,$s=r.unstable_cancelCallback,Ja=r.unstable_shouldYield,Ws=r.unstable_requestPaint,$e=r.unstable_now,Za=r.unstable_getCurrentPriorityLevel,Li=r.unstable_ImmediatePriority,Us=r.unstable_UserBlockingPriority,Tn=r.unstable_NormalPriority,el=r.unstable_LowPriority,Vs=r.unstable_IdlePriority,sn=null,It=null;function tl(t){if(It&&typeof It.onCommitFiberRoot=="function")try{It.onCommitFiberRoot(sn,t,void 0,(t.current.flags&128)===128)}catch{}}var Rt=Math.clz32?Math.clz32:il,rl=Math.log,nl=Math.LN2;function il(t){return t>>>=0,t===0?32:31-(rl(t)/nl|0)|0}var An=64,Mn=4194304;function nr(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Pn(t,n){var s=t.pendingLanes;if(s===0)return 0;var g=0,E=t.suspendedLanes,T=t.pingedLanes,$=s&268435455;if($!==0){var Y=$&~E;Y!==0?g=nr(Y):(T&=$,T!==0&&(g=nr(T)))}else $=s&~E,$!==0?g=nr($):T!==0&&(g=nr(T));if(g===0)return 0;if(n!==0&&n!==g&&(n&E)===0&&(E=g&-g,T=n&-n,E>=T||E===16&&(T&4194240)!==0))return n;if((g&4)!==0&&(g|=s&16),n=t.entangledLanes,n!==0)for(t=t.entanglements,n&=g;0<n;)s=31-Rt(n),E=1<<s,g|=t[s],n&=~E;return g}function qs(t,n){switch(t){case 1:case 2:case 4:return n+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 n+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 sl(t,n){for(var s=t.suspendedLanes,g=t.pingedLanes,E=t.expirationTimes,T=t.pendingLanes;0<T;){var $=31-Rt(T),Y=1<<$,Q=E[$];Q===-1?((Y&s)===0||(Y&g)!==0)&&(E[$]=qs(Y,n)):Q<=n&&(t.expiredLanes|=Y),T&=~Y}}function Ri(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Bn(){var t=An;return An<<=1,(An&4194240)===0&&(An=64),t}function Di(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function on(t,n,s){t.pendingLanes|=n,n!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,n=31-Rt(n),t[n]=s}function Ks(t,n){var s=t.pendingLanes&~n;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=n,t.mutableReadLanes&=n,t.entangledLanes&=n,n=t.entanglements;var g=t.eventTimes;for(t=t.expirationTimes;0<s;){var E=31-Rt(s),T=1<<E;n[E]=0,g[E]=-1,t[E]=-1,s&=~T}}function ol(t,n){var s=t.entangledLanes|=n;for(t=t.entanglements;s;){var g=31-Rt(s),E=1<<g;E&n|t[g]&n&&(t[g]|=n),s&=~E}}var Pe=0;function lh(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var ch,al,uh,hh,dh,ll=!1,Xs=[],Tr=null,Ar=null,Mr=null,Ti=new Map,Ai=new Map,Pr=[],fm="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 fh(t,n){switch(t){case"focusin":case"focusout":Tr=null;break;case"dragenter":case"dragleave":Ar=null;break;case"mouseover":case"mouseout":Mr=null;break;case"pointerover":case"pointerout":Ti.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ai.delete(n.pointerId)}}function Mi(t,n,s,g,E,T){return t===null||t.nativeEvent!==T?(t={blockedOn:n,domEventName:s,eventSystemFlags:g,nativeEvent:T,targetContainers:[E]},n!==null&&(n=qi(n),n!==null&&al(n)),t):(t.eventSystemFlags|=g,n=t.targetContainers,E!==null&&n.indexOf(E)===-1&&n.push(E),t)}function pm(t,n,s,g,E){switch(n){case"focusin":return Tr=Mi(Tr,t,n,s,g,E),!0;case"dragenter":return Ar=Mi(Ar,t,n,s,g,E),!0;case"mouseover":return Mr=Mi(Mr,t,n,s,g,E),!0;case"pointerover":var T=E.pointerId;return Ti.set(T,Mi(Ti.get(T)||null,t,n,s,g,E)),!0;case"gotpointercapture":return T=E.pointerId,Ai.set(T,Mi(Ai.get(T)||null,t,n,s,g,E)),!0}return!1}function ph(t){var n=an(t.target);if(n!==null){var s=rr(n);if(s!==null){if(n=s.tag,n===13){if(n=Ei(s),n!==null){t.blockedOn=n,dh(t.priority,function(){uh(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Ys(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var s=ul(t.domEventName,t.eventSystemFlags,n[0],t.nativeEvent);if(s===null){s=t.nativeEvent;var g=new s.constructor(s.type,s);yi=g,s.target.dispatchEvent(g),yi=null}else return n=qi(s),n!==null&&al(n),t.blockedOn=s,!1;n.shift()}return!0}function _h(t,n,s){Ys(t)&&s.delete(n)}function _m(){ll=!1,Tr!==null&&Ys(Tr)&&(Tr=null),Ar!==null&&Ys(Ar)&&(Ar=null),Mr!==null&&Ys(Mr)&&(Mr=null),Ti.forEach(_h),Ai.forEach(_h)}function Pi(t,n){t.blockedOn===n&&(t.blockedOn=null,ll||(ll=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,_m)))}function Bi(t){function n(E){return Pi(E,t)}if(0<Xs.length){Pi(Xs[0],t);for(var s=1;s<Xs.length;s++){var g=Xs[s];g.blockedOn===t&&(g.blockedOn=null)}}for(Tr!==null&&Pi(Tr,t),Ar!==null&&Pi(Ar,t),Mr!==null&&Pi(Mr,t),Ti.forEach(n),Ai.forEach(n),s=0;s<Pr.length;s++)g=Pr[s],g.blockedOn===t&&(g.blockedOn=null);for(;0<Pr.length&&(s=Pr[0],s.blockedOn===null);)ph(s),s.blockedOn===null&&Pr.shift()}var Nn=w.ReactCurrentBatchConfig,Gs=!0;function gm(t,n,s,g){var E=Pe,T=Nn.transition;Nn.transition=null;try{Pe=1,cl(t,n,s,g)}finally{Pe=E,Nn.transition=T}}function mm(t,n,s,g){var E=Pe,T=Nn.transition;Nn.transition=null;try{Pe=4,cl(t,n,s,g)}finally{Pe=E,Nn.transition=T}}function cl(t,n,s,g){if(Gs){var E=ul(t,n,s,g);if(E===null)Ll(t,n,g,Qs,s),fh(t,g);else if(pm(E,t,n,s,g))g.stopPropagation();else if(fh(t,g),n&4&&-1<fm.indexOf(t)){for(;E!==null;){var T=qi(E);if(T!==null&&ch(T),T=ul(t,n,s,g),T===null&&Ll(t,n,g,Qs,s),T===E)break;E=T}E!==null&&g.stopPropagation()}else Ll(t,n,g,null,s)}}var Qs=null;function ul(t,n,s,g){if(Qs=null,t=wi(g),t=an(t),t!==null)if(n=rr(t),n===null)t=null;else if(s=n.tag,s===13){if(t=Ei(n),t!==null)return t;t=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null);return Qs=t,null}function gh(t){switch(t){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(Za()){case Li:return 1;case Us:return 4;case Tn:case el:return 16;case Vs:return 536870912;default:return 16}default:return 16}}var Br=null,hl=null,Js=null;function mh(){if(Js)return Js;var t,n=hl,s=n.length,g,E="value"in Br?Br.value:Br.textContent,T=E.length;for(t=0;t<s&&n[t]===E[t];t++);var $=s-t;for(g=1;g<=$&&n[s-g]===E[T-g];g++);return Js=E.slice(t,1<g?1-g:void 0)}function Zs(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function eo(){return!0}function vh(){return!1}function Dt(t){function n(s,g,E,T,$){this._reactName=s,this._targetInst=E,this.type=g,this.nativeEvent=T,this.target=$,this.currentTarget=null;for(var Y in t)t.hasOwnProperty(Y)&&(s=t[Y],this[Y]=s?s(T):T[Y]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?eo:vh,this.isPropagationStopped=vh,this}return B(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=eo)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=eo)},persist:function(){},isPersistent:eo}),n}var In={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dl=Dt(In),Ni=B({},In,{view:0,detail:0}),vm=Dt(Ni),fl,pl,Ii,to=B({},Ni,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gl,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ii&&(Ii&&t.type==="mousemove"?(fl=t.screenX-Ii.screenX,pl=t.screenY-Ii.screenY):pl=fl=0,Ii=t),fl)},movementY:function(t){return"movementY"in t?t.movementY:pl}}),yh=Dt(to),ym=B({},to,{dataTransfer:0}),wm=Dt(ym),Sm=B({},Ni,{relatedTarget:0}),_l=Dt(Sm),Cm=B({},In,{animationName:0,elapsedTime:0,pseudoElement:0}),xm=Dt(Cm),bm=B({},In,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Em=Dt(bm),km=B({},In,{data:0}),wh=Dt(km),Lm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Rm={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"},Dm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Tm(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=Dm[t])?!!n[t]:!1}function gl(){return Tm}var Am=B({},Ni,{key:function(t){if(t.key){var n=Lm[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Zs(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Rm[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gl,charCode:function(t){return t.type==="keypress"?Zs(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Zs(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Mm=Dt(Am),Pm=B({},to,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sh=Dt(Pm),Bm=B({},Ni,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gl}),Nm=Dt(Bm),Im=B({},In,{propertyName:0,elapsedTime:0,pseudoElement:0}),Om=Dt(Im),Hm=B({},to,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Fm=Dt(Hm),jm=[9,13,27,32],ml=a&&"CompositionEvent"in window,Oi=null;a&&"documentMode"in document&&(Oi=document.documentMode);var zm=a&&"TextEvent"in window&&!Oi,Ch=a&&(!ml||Oi&&8<Oi&&11>=Oi),xh=" ",bh=!1;function Eh(t,n){switch(t){case"keyup":return jm.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var On=!1;function $m(t,n){switch(t){case"compositionend":return kh(n);case"keypress":return n.which!==32?null:(bh=!0,xh);case"textInput":return t=n.data,t===xh&&bh?null:t;default:return null}}function Wm(t,n){if(On)return t==="compositionend"||!ml&&Eh(t,n)?(t=mh(),Js=hl=Br=null,On=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Ch&&n.locale!=="ko"?null:n.data;default:return null}}var Um={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 Lh(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!Um[t.type]:n==="textarea"}function Rh(t,n,s,g){Bs(g),n=oo(n,"onChange"),0<n.length&&(s=new dl("onChange","change",null,s,g),t.push({event:s,listeners:n}))}var Hi=null,Fi=null;function Vm(t){qh(t,0)}function ro(t){var n=$n(t);if(le(n))return t}function qm(t,n){if(t==="change")return n}var Dh=!1;if(a){var vl;if(a){var yl="oninput"in document;if(!yl){var Th=document.createElement("div");Th.setAttribute("oninput","return;"),yl=typeof Th.oninput=="function"}vl=yl}else vl=!1;Dh=vl&&(!document.documentMode||9<document.documentMode)}function Ah(){Hi&&(Hi.detachEvent("onpropertychange",Mh),Fi=Hi=null)}function Mh(t){if(t.propertyName==="value"&&ro(Fi)){var n=[];Rh(n,Fi,t,wi(t)),Hs(Vm,n)}}function Km(t,n,s){t==="focusin"?(Ah(),Hi=n,Fi=s,Hi.attachEvent("onpropertychange",Mh)):t==="focusout"&&Ah()}function Xm(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return ro(Fi)}function Ym(t,n){if(t==="click")return ro(n)}function Gm(t,n){if(t==="input"||t==="change")return ro(n)}function Qm(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Ut=typeof Object.is=="function"?Object.is:Qm;function ji(t,n){if(Ut(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var s=Object.keys(t),g=Object.keys(n);if(s.length!==g.length)return!1;for(g=0;g<s.length;g++){var E=s[g];if(!c.call(n,E)||!Ut(t[E],n[E]))return!1}return!0}function Ph(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Bh(t,n){var s=Ph(t);t=0;for(var g;s;){if(s.nodeType===3){if(g=t+s.textContent.length,t<=n&&g>=n)return{node:s,offset:n-t};t=g}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Ph(s)}}function Nh(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Nh(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Ih(){for(var t=window,n=fe();n instanceof t.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)t=n.contentWindow;else break;n=fe(t.document)}return n}function wl(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}function Jm(t){var n=Ih(),s=t.focusedElem,g=t.selectionRange;if(n!==s&&s&&s.ownerDocument&&Nh(s.ownerDocument.documentElement,s)){if(g!==null&&wl(s)){if(n=g.start,t=g.end,t===void 0&&(t=n),"selectionStart"in s)s.selectionStart=n,s.selectionEnd=Math.min(t,s.value.length);else if(t=(n=s.ownerDocument||document)&&n.defaultView||window,t.getSelection){t=t.getSelection();var E=s.textContent.length,T=Math.min(g.start,E);g=g.end===void 0?T:Math.min(g.end,E),!t.extend&&T>g&&(E=g,g=T,T=E),E=Bh(s,T);var $=Bh(s,g);E&&$&&(t.rangeCount!==1||t.anchorNode!==E.node||t.anchorOffset!==E.offset||t.focusNode!==$.node||t.focusOffset!==$.offset)&&(n=n.createRange(),n.setStart(E.node,E.offset),t.removeAllRanges(),T>g?(t.addRange(n),t.extend($.node,$.offset)):(n.setEnd($.node,$.offset),t.addRange(n)))}}for(n=[],t=s;t=t.parentNode;)t.nodeType===1&&n.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<n.length;s++)t=n[s],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var Zm=a&&"documentMode"in document&&11>=document.documentMode,Hn=null,Sl=null,zi=null,Cl=!1;function Oh(t,n,s){var g=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Cl||Hn==null||Hn!==fe(g)||(g=Hn,"selectionStart"in g&&wl(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),zi&&ji(zi,g)||(zi=g,g=oo(Sl,"onSelect"),0<g.length&&(n=new dl("onSelect","select",null,n,s),t.push({event:n,listeners:g}),n.target=Hn)))}function no(t,n){var s={};return s[t.toLowerCase()]=n.toLowerCase(),s["Webkit"+t]="webkit"+n,s["Moz"+t]="moz"+n,s}var Fn={animationend:no("Animation","AnimationEnd"),animationiteration:no("Animation","AnimationIteration"),animationstart:no("Animation","AnimationStart"),transitionend:no("Transition","TransitionEnd")},xl={},Hh={};a&&(Hh=document.createElement("div").style,"AnimationEvent"in window||(delete Fn.animationend.animation,delete Fn.animationiteration.animation,delete Fn.animationstart.animation),"TransitionEvent"in window||delete Fn.transitionend.transition);function io(t){if(xl[t])return xl[t];if(!Fn[t])return t;var n=Fn[t],s;for(s in n)if(n.hasOwnProperty(s)&&s in Hh)return xl[t]=n[s];return t}var Fh=io("animationend"),jh=io("animationiteration"),zh=io("animationstart"),$h=io("transitionend"),Wh=new Map,Uh="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 Nr(t,n){Wh.set(t,n),S(n,[t])}for(var bl=0;bl<Uh.length;bl++){var El=Uh[bl],e0=El.toLowerCase(),t0=El[0].toUpperCase()+El.slice(1);Nr(e0,"on"+t0)}Nr(Fh,"onAnimationEnd"),Nr(jh,"onAnimationIteration"),Nr(zh,"onAnimationStart"),Nr("dblclick","onDoubleClick"),Nr("focusin","onFocus"),Nr("focusout","onBlur"),Nr($h,"onTransitionEnd"),y("onMouseEnter",["mouseout","mouseover"]),y("onMouseLeave",["mouseout","mouseover"]),y("onPointerEnter",["pointerout","pointerover"]),y("onPointerLeave",["pointerout","pointerover"]),S("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),S("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),S("onBeforeInput",["compositionend","keypress","textInput","paste"]),S("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),S("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),S("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $i="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(" "),r0=new Set("cancel close invalid load scroll toggle".split(" ").concat($i));function Vh(t,n,s){var g=t.type||"unknown-event";t.currentTarget=s,Ga(g,n,void 0,t),t.currentTarget=null}function qh(t,n){n=(n&4)!==0;for(var s=0;s<t.length;s++){var g=t[s],E=g.event;g=g.listeners;e:{var T=void 0;if(n)for(var $=g.length-1;0<=$;$--){var Y=g[$],Q=Y.instance,ae=Y.currentTarget;if(Y=Y.listener,Q!==T&&E.isPropagationStopped())break e;Vh(E,Y,ae),T=Q}else for($=0;$<g.length;$++){if(Y=g[$],Q=Y.instance,ae=Y.currentTarget,Y=Y.listener,Q!==T&&E.isPropagationStopped())break e;Vh(E,Y,ae),T=Q}}}if(Dn)throw t=bi,Dn=!1,bi=null,t}function Oe(t,n){var s=n[Pl];s===void 0&&(s=n[Pl]=new Set);var g=t+"__bubble";s.has(g)||(Kh(n,t,2,!1),s.add(g))}function kl(t,n,s){var g=0;n&&(g|=4),Kh(s,t,g,n)}var so="_reactListening"+Math.random().toString(36).slice(2);function Wi(t){if(!t[so]){t[so]=!0,o.forEach(function(s){s!=="selectionchange"&&(r0.has(s)||kl(s,!1,t),kl(s,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[so]||(n[so]=!0,kl("selectionchange",!1,n))}}function Kh(t,n,s,g){switch(gh(n)){case 1:var E=gm;break;case 4:E=mm;break;default:E=cl}s=E.bind(null,n,s,t),E=void 0,!xi||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(E=!0),g?E!==void 0?t.addEventListener(n,s,{capture:!0,passive:E}):t.addEventListener(n,s,!0):E!==void 0?t.addEventListener(n,s,{passive:E}):t.addEventListener(n,s,!1)}function Ll(t,n,s,g,E){var T=g;if((n&1)===0&&(n&2)===0&&g!==null)e:for(;;){if(g===null)return;var $=g.tag;if($===3||$===4){var Y=g.stateNode.containerInfo;if(Y===E||Y.nodeType===8&&Y.parentNode===E)break;if($===4)for($=g.return;$!==null;){var Q=$.tag;if((Q===3||Q===4)&&(Q=$.stateNode.containerInfo,Q===E||Q.nodeType===8&&Q.parentNode===E))return;$=$.return}for(;Y!==null;){if($=an(Y),$===null)return;if(Q=$.tag,Q===5||Q===6){g=T=$;continue e}Y=Y.parentNode}}g=g.return}Hs(function(){var ae=T,he=wi(s),de=[];e:{var ue=Wh.get(t);if(ue!==void 0){var _e=dl,ve=t;switch(t){case"keypress":if(Zs(s)===0)break e;case"keydown":case"keyup":_e=Mm;break;case"focusin":ve="focus",_e=_l;break;case"focusout":ve="blur",_e=_l;break;case"beforeblur":case"afterblur":_e=_l;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":_e=yh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_e=wm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_e=Nm;break;case Fh:case jh:case zh:_e=xm;break;case $h:_e=Om;break;case"scroll":_e=vm;break;case"wheel":_e=Fm;break;case"copy":case"cut":case"paste":_e=Em;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_e=Sh}var Se=(n&4)!==0,Ke=!Se&&t==="scroll",ie=Se?ue!==null?ue+"Capture":null:ue;Se=[];for(var te=ae,oe;te!==null;){oe=te;var pe=oe.stateNode;if(oe.tag===5&&pe!==null&&(oe=pe,ie!==null&&(pe=tn(te,ie),pe!=null&&Se.push(Ui(te,pe,oe)))),Ke)break;te=te.return}0<Se.length&&(ue=new _e(ue,ve,null,s,he),de.push({event:ue,listeners:Se}))}}if((n&7)===0){e:{if(ue=t==="mouseover"||t==="pointerover",_e=t==="mouseout"||t==="pointerout",ue&&s!==yi&&(ve=s.relatedTarget||s.fromElement)&&(an(ve)||ve[_r]))break e;if((_e||ue)&&(ue=he.window===he?he:(ue=he.ownerDocument)?ue.defaultView||ue.parentWindow:window,_e?(ve=s.relatedTarget||s.toElement,_e=ae,ve=ve?an(ve):null,ve!==null&&(Ke=rr(ve),ve!==Ke||ve.tag!==5&&ve.tag!==6)&&(ve=null)):(_e=null,ve=ae),_e!==ve)){if(Se=yh,pe="onMouseLeave",ie="onMouseEnter",te="mouse",(t==="pointerout"||t==="pointerover")&&(Se=Sh,pe="onPointerLeave",ie="onPointerEnter",te="pointer"),Ke=_e==null?ue:$n(_e),oe=ve==null?ue:$n(ve),ue=new Se(pe,te+"leave",_e,s,he),ue.target=Ke,ue.relatedTarget=oe,pe=null,an(he)===ae&&(Se=new Se(ie,te+"enter",ve,s,he),Se.target=oe,Se.relatedTarget=Ke,pe=Se),Ke=pe,_e&&ve)t:{for(Se=_e,ie=ve,te=0,oe=Se;oe;oe=jn(oe))te++;for(oe=0,pe=ie;pe;pe=jn(pe))oe++;for(;0<te-oe;)Se=jn(Se),te--;for(;0<oe-te;)ie=jn(ie),oe--;for(;te--;){if(Se===ie||ie!==null&&Se===ie.alternate)break t;Se=jn(Se),ie=jn(ie)}Se=null}else Se=null;_e!==null&&Xh(de,ue,_e,Se,!1),ve!==null&&Ke!==null&&Xh(de,Ke,ve,Se,!0)}}e:{if(ue=ae?$n(ae):window,_e=ue.nodeName&&ue.nodeName.toLowerCase(),_e==="select"||_e==="input"&&ue.type==="file")var Ce=qm;else if(Lh(ue))if(Dh)Ce=Gm;else{Ce=Xm;var Ee=Km}else(_e=ue.nodeName)&&_e.toLowerCase()==="input"&&(ue.type==="checkbox"||ue.type==="radio")&&(Ce=Ym);if(Ce&&(Ce=Ce(t,ae))){Rh(de,Ce,s,he);break e}Ee&&Ee(t,ue,ae),t==="focusout"&&(Ee=ue._wrapperState)&&Ee.controlled&&ue.type==="number"&&st(ue,"number",ue.value)}switch(Ee=ae?$n(ae):window,t){case"focusin":(Lh(Ee)||Ee.contentEditable==="true")&&(Hn=Ee,Sl=ae,zi=null);break;case"focusout":zi=Sl=Hn=null;break;case"mousedown":Cl=!0;break;case"contextmenu":case"mouseup":case"dragend":Cl=!1,Oh(de,s,he);break;case"selectionchange":if(Zm)break;case"keydown":case"keyup":Oh(de,s,he)}var ke;if(ml)e:{switch(t){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else On?Eh(t,s)&&(Le="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(Le="onCompositionStart");Le&&(Ch&&s.locale!=="ko"&&(On||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&On&&(ke=mh()):(Br=he,hl="value"in Br?Br.value:Br.textContent,On=!0)),Ee=oo(ae,Le),0<Ee.length&&(Le=new wh(Le,t,null,s,he),de.push({event:Le,listeners:Ee}),ke?Le.data=ke:(ke=kh(s),ke!==null&&(Le.data=ke)))),(ke=zm?$m(t,s):Wm(t,s))&&(ae=oo(ae,"onBeforeInput"),0<ae.length&&(he=new wh("onBeforeInput","beforeinput",null,s,he),de.push({event:he,listeners:ae}),he.data=ke))}qh(de,n)})}function Ui(t,n,s){return{instance:t,listener:n,currentTarget:s}}function oo(t,n){for(var s=n+"Capture",g=[];t!==null;){var E=t,T=E.stateNode;E.tag===5&&T!==null&&(E=T,T=tn(t,s),T!=null&&g.unshift(Ui(t,T,E)),T=tn(t,n),T!=null&&g.push(Ui(t,T,E))),t=t.return}return g}function jn(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Xh(t,n,s,g,E){for(var T=n._reactName,$=[];s!==null&&s!==g;){var Y=s,Q=Y.alternate,ae=Y.stateNode;if(Q!==null&&Q===g)break;Y.tag===5&&ae!==null&&(Y=ae,E?(Q=tn(s,T),Q!=null&&$.unshift(Ui(s,Q,Y))):E||(Q=tn(s,T),Q!=null&&$.push(Ui(s,Q,Y)))),s=s.return}$.length!==0&&t.push({event:n,listeners:$})}var n0=/\r\n?/g,i0=/\u0000|\uFFFD/g;function Yh(t){return(typeof t=="string"?t:""+t).replace(n0,`
|
|
38
|
+
`).replace(i0,"")}function ao(t,n,s){if(n=Yh(n),Yh(t)!==n&&s)throw Error(i(425))}function lo(){}var Rl=null,Dl=null;function Tl(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Al=typeof setTimeout=="function"?setTimeout:void 0,s0=typeof clearTimeout=="function"?clearTimeout:void 0,Gh=typeof Promise=="function"?Promise:void 0,o0=typeof queueMicrotask=="function"?queueMicrotask:typeof Gh<"u"?function(t){return Gh.resolve(null).then(t).catch(a0)}:Al;function a0(t){setTimeout(function(){throw t})}function Ml(t,n){var s=n,g=0;do{var E=s.nextSibling;if(t.removeChild(s),E&&E.nodeType===8)if(s=E.data,s==="/$"){if(g===0){t.removeChild(E),Bi(n);return}g--}else s!=="$"&&s!=="$?"&&s!=="$!"||g++;s=E}while(s);Bi(n)}function Ir(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return t}function Qh(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"){if(n===0)return t;n--}else s==="/$"&&n++}t=t.previousSibling}return null}var zn=Math.random().toString(36).slice(2),ir="__reactFiber$"+zn,Vi="__reactProps$"+zn,_r="__reactContainer$"+zn,Pl="__reactEvents$"+zn,l0="__reactListeners$"+zn,c0="__reactHandles$"+zn;function an(t){var n=t[ir];if(n)return n;for(var s=t.parentNode;s;){if(n=s[_r]||s[ir]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(t=Qh(t);t!==null;){if(s=t[ir])return s;t=Qh(t)}return n}t=s,s=t.parentNode}return null}function qi(t){return t=t[ir]||t[_r],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function $n(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(i(33))}function co(t){return t[Vi]||null}var Bl=[],Wn=-1;function Or(t){return{current:t}}function He(t){0>Wn||(t.current=Bl[Wn],Bl[Wn]=null,Wn--)}function Ne(t,n){Wn++,Bl[Wn]=t.current,t.current=n}var Hr={},ht=Or(Hr),yt=Or(!1),ln=Hr;function Un(t,n){var s=t.type.contextTypes;if(!s)return Hr;var g=t.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===n)return g.__reactInternalMemoizedMaskedChildContext;var E={},T;for(T in s)E[T]=n[T];return g&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=n,t.__reactInternalMemoizedMaskedChildContext=E),E}function wt(t){return t=t.childContextTypes,t!=null}function uo(){He(yt),He(ht)}function Jh(t,n,s){if(ht.current!==Hr)throw Error(i(168));Ne(ht,n),Ne(yt,s)}function Zh(t,n,s){var g=t.stateNode;if(n=n.childContextTypes,typeof g.getChildContext!="function")return s;g=g.getChildContext();for(var E in g)if(!(E in n))throw Error(i(108,X(t)||"Unknown",E));return B({},s,g)}function ho(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Hr,ln=ht.current,Ne(ht,t),Ne(yt,yt.current),!0}function ed(t,n,s){var g=t.stateNode;if(!g)throw Error(i(169));s?(t=Zh(t,n,ln),g.__reactInternalMemoizedMergedChildContext=t,He(yt),He(ht),Ne(ht,t)):He(yt),Ne(yt,s)}var gr=null,fo=!1,Nl=!1;function td(t){gr===null?gr=[t]:gr.push(t)}function u0(t){fo=!0,td(t)}function Fr(){if(!Nl&&gr!==null){Nl=!0;var t=0,n=Pe;try{var s=gr;for(Pe=1;t<s.length;t++){var g=s[t];do g=g(!0);while(g!==null)}gr=null,fo=!1}catch(E){throw gr!==null&&(gr=gr.slice(t+1)),zs(Li,Fr),E}finally{Pe=n,Nl=!1}}return null}var Vn=[],qn=0,po=null,_o=0,Ot=[],Ht=0,cn=null,mr=1,vr="";function un(t,n){Vn[qn++]=_o,Vn[qn++]=po,po=t,_o=n}function rd(t,n,s){Ot[Ht++]=mr,Ot[Ht++]=vr,Ot[Ht++]=cn,cn=t;var g=mr;t=vr;var E=32-Rt(g)-1;g&=~(1<<E),s+=1;var T=32-Rt(n)+E;if(30<T){var $=E-E%5;T=(g&(1<<$)-1).toString(32),g>>=$,E-=$,mr=1<<32-Rt(n)+E|s<<E|g,vr=T+t}else mr=1<<T|s<<E|g,vr=t}function Il(t){t.return!==null&&(un(t,1),rd(t,1,0))}function Ol(t){for(;t===po;)po=Vn[--qn],Vn[qn]=null,_o=Vn[--qn],Vn[qn]=null;for(;t===cn;)cn=Ot[--Ht],Ot[Ht]=null,vr=Ot[--Ht],Ot[Ht]=null,mr=Ot[--Ht],Ot[Ht]=null}var Tt=null,At=null,Fe=!1,Vt=null;function nd(t,n){var s=$t(5,null,null,0);s.elementType="DELETED",s.stateNode=n,s.return=t,n=t.deletions,n===null?(t.deletions=[s],t.flags|=16):n.push(s)}function id(t,n){switch(t.tag){case 5:var s=t.type;return n=n.nodeType!==1||s.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(t.stateNode=n,Tt=t,At=Ir(n.firstChild),!0):!1;case 6:return n=t.pendingProps===""||n.nodeType!==3?null:n,n!==null?(t.stateNode=n,Tt=t,At=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(s=cn!==null?{id:mr,overflow:vr}:null,t.memoizedState={dehydrated:n,treeContext:s,retryLane:1073741824},s=$t(18,null,null,0),s.stateNode=n,s.return=t,t.child=s,Tt=t,At=null,!0):!1;default:return!1}}function Hl(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Fl(t){if(Fe){var n=At;if(n){var s=n;if(!id(t,n)){if(Hl(t))throw Error(i(418));n=Ir(s.nextSibling);var g=Tt;n&&id(t,n)?nd(g,s):(t.flags=t.flags&-4097|2,Fe=!1,Tt=t)}}else{if(Hl(t))throw Error(i(418));t.flags=t.flags&-4097|2,Fe=!1,Tt=t}}}function sd(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Tt=t}function go(t){if(t!==Tt)return!1;if(!Fe)return sd(t),Fe=!0,!1;var n;if((n=t.tag!==3)&&!(n=t.tag!==5)&&(n=t.type,n=n!=="head"&&n!=="body"&&!Tl(t.type,t.memoizedProps)),n&&(n=At)){if(Hl(t))throw od(),Error(i(418));for(;n;)nd(t,n),n=Ir(n.nextSibling)}if(sd(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));e:{for(t=t.nextSibling,n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"){if(n===0){At=Ir(t.nextSibling);break e}n--}else s!=="$"&&s!=="$!"&&s!=="$?"||n++}t=t.nextSibling}At=null}}else At=Tt?Ir(t.stateNode.nextSibling):null;return!0}function od(){for(var t=At;t;)t=Ir(t.nextSibling)}function Kn(){At=Tt=null,Fe=!1}function jl(t){Vt===null?Vt=[t]:Vt.push(t)}var h0=w.ReactCurrentBatchConfig;function Ki(t,n,s){if(t=s.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(i(309));var g=s.stateNode}if(!g)throw Error(i(147,t));var E=g,T=""+t;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===T?n.ref:(n=function($){var Y=E.refs;$===null?delete Y[T]:Y[T]=$},n._stringRef=T,n)}if(typeof t!="string")throw Error(i(284));if(!s._owner)throw Error(i(290,t))}return t}function mo(t,n){throw t=Object.prototype.toString.call(n),Error(i(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t))}function ad(t){var n=t._init;return n(t._payload)}function ld(t){function n(ie,te){if(t){var oe=ie.deletions;oe===null?(ie.deletions=[te],ie.flags|=16):oe.push(te)}}function s(ie,te){if(!t)return null;for(;te!==null;)n(ie,te),te=te.sibling;return null}function g(ie,te){for(ie=new Map;te!==null;)te.key!==null?ie.set(te.key,te):ie.set(te.index,te),te=te.sibling;return ie}function E(ie,te){return ie=Kr(ie,te),ie.index=0,ie.sibling=null,ie}function T(ie,te,oe){return ie.index=oe,t?(oe=ie.alternate,oe!==null?(oe=oe.index,oe<te?(ie.flags|=2,te):oe):(ie.flags|=2,te)):(ie.flags|=1048576,te)}function $(ie){return t&&ie.alternate===null&&(ie.flags|=2),ie}function Y(ie,te,oe,pe){return te===null||te.tag!==6?(te=Ac(oe,ie.mode,pe),te.return=ie,te):(te=E(te,oe),te.return=ie,te)}function Q(ie,te,oe,pe){var Ce=oe.type;return Ce===D?he(ie,te,oe.props.children,pe,oe.key):te!==null&&(te.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===V&&ad(Ce)===te.type)?(pe=E(te,oe.props),pe.ref=Ki(ie,te,oe),pe.return=ie,pe):(pe=zo(oe.type,oe.key,oe.props,null,ie.mode,pe),pe.ref=Ki(ie,te,oe),pe.return=ie,pe)}function ae(ie,te,oe,pe){return te===null||te.tag!==4||te.stateNode.containerInfo!==oe.containerInfo||te.stateNode.implementation!==oe.implementation?(te=Mc(oe,ie.mode,pe),te.return=ie,te):(te=E(te,oe.children||[]),te.return=ie,te)}function he(ie,te,oe,pe,Ce){return te===null||te.tag!==7?(te=vn(oe,ie.mode,pe,Ce),te.return=ie,te):(te=E(te,oe),te.return=ie,te)}function de(ie,te,oe){if(typeof te=="string"&&te!==""||typeof te=="number")return te=Ac(""+te,ie.mode,oe),te.return=ie,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case L:return oe=zo(te.type,te.key,te.props,null,ie.mode,oe),oe.ref=Ki(ie,null,te),oe.return=ie,oe;case R:return te=Mc(te,ie.mode,oe),te.return=ie,te;case V:var pe=te._init;return de(ie,pe(te._payload),oe)}if(ot(te)||A(te))return te=vn(te,ie.mode,oe,null),te.return=ie,te;mo(ie,te)}return null}function ue(ie,te,oe,pe){var Ce=te!==null?te.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number")return Ce!==null?null:Y(ie,te,""+oe,pe);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case L:return oe.key===Ce?Q(ie,te,oe,pe):null;case R:return oe.key===Ce?ae(ie,te,oe,pe):null;case V:return Ce=oe._init,ue(ie,te,Ce(oe._payload),pe)}if(ot(oe)||A(oe))return Ce!==null?null:he(ie,te,oe,pe,null);mo(ie,oe)}return null}function _e(ie,te,oe,pe,Ce){if(typeof pe=="string"&&pe!==""||typeof pe=="number")return ie=ie.get(oe)||null,Y(te,ie,""+pe,Ce);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case L:return ie=ie.get(pe.key===null?oe:pe.key)||null,Q(te,ie,pe,Ce);case R:return ie=ie.get(pe.key===null?oe:pe.key)||null,ae(te,ie,pe,Ce);case V:var Ee=pe._init;return _e(ie,te,oe,Ee(pe._payload),Ce)}if(ot(pe)||A(pe))return ie=ie.get(oe)||null,he(te,ie,pe,Ce,null);mo(te,pe)}return null}function ve(ie,te,oe,pe){for(var Ce=null,Ee=null,ke=te,Le=te=0,it=null;ke!==null&&Le<oe.length;Le++){ke.index>Le?(it=ke,ke=null):it=ke.sibling;var Me=ue(ie,ke,oe[Le],pe);if(Me===null){ke===null&&(ke=it);break}t&&ke&&Me.alternate===null&&n(ie,ke),te=T(Me,te,Le),Ee===null?Ce=Me:Ee.sibling=Me,Ee=Me,ke=it}if(Le===oe.length)return s(ie,ke),Fe&&un(ie,Le),Ce;if(ke===null){for(;Le<oe.length;Le++)ke=de(ie,oe[Le],pe),ke!==null&&(te=T(ke,te,Le),Ee===null?Ce=ke:Ee.sibling=ke,Ee=ke);return Fe&&un(ie,Le),Ce}for(ke=g(ie,ke);Le<oe.length;Le++)it=_e(ke,ie,Le,oe[Le],pe),it!==null&&(t&&it.alternate!==null&&ke.delete(it.key===null?Le:it.key),te=T(it,te,Le),Ee===null?Ce=it:Ee.sibling=it,Ee=it);return t&&ke.forEach(function(Xr){return n(ie,Xr)}),Fe&&un(ie,Le),Ce}function Se(ie,te,oe,pe){var Ce=A(oe);if(typeof Ce!="function")throw Error(i(150));if(oe=Ce.call(oe),oe==null)throw Error(i(151));for(var Ee=Ce=null,ke=te,Le=te=0,it=null,Me=oe.next();ke!==null&&!Me.done;Le++,Me=oe.next()){ke.index>Le?(it=ke,ke=null):it=ke.sibling;var Xr=ue(ie,ke,Me.value,pe);if(Xr===null){ke===null&&(ke=it);break}t&&ke&&Xr.alternate===null&&n(ie,ke),te=T(Xr,te,Le),Ee===null?Ce=Xr:Ee.sibling=Xr,Ee=Xr,ke=it}if(Me.done)return s(ie,ke),Fe&&un(ie,Le),Ce;if(ke===null){for(;!Me.done;Le++,Me=oe.next())Me=de(ie,Me.value,pe),Me!==null&&(te=T(Me,te,Le),Ee===null?Ce=Me:Ee.sibling=Me,Ee=Me);return Fe&&un(ie,Le),Ce}for(ke=g(ie,ke);!Me.done;Le++,Me=oe.next())Me=_e(ke,ie,Le,Me.value,pe),Me!==null&&(t&&Me.alternate!==null&&ke.delete(Me.key===null?Le:Me.key),te=T(Me,te,Le),Ee===null?Ce=Me:Ee.sibling=Me,Ee=Me);return t&&ke.forEach(function(U0){return n(ie,U0)}),Fe&&un(ie,Le),Ce}function Ke(ie,te,oe,pe){if(typeof oe=="object"&&oe!==null&&oe.type===D&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case L:e:{for(var Ce=oe.key,Ee=te;Ee!==null;){if(Ee.key===Ce){if(Ce=oe.type,Ce===D){if(Ee.tag===7){s(ie,Ee.sibling),te=E(Ee,oe.props.children),te.return=ie,ie=te;break e}}else if(Ee.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===V&&ad(Ce)===Ee.type){s(ie,Ee.sibling),te=E(Ee,oe.props),te.ref=Ki(ie,Ee,oe),te.return=ie,ie=te;break e}s(ie,Ee);break}else n(ie,Ee);Ee=Ee.sibling}oe.type===D?(te=vn(oe.props.children,ie.mode,pe,oe.key),te.return=ie,ie=te):(pe=zo(oe.type,oe.key,oe.props,null,ie.mode,pe),pe.ref=Ki(ie,te,oe),pe.return=ie,ie=pe)}return $(ie);case R:e:{for(Ee=oe.key;te!==null;){if(te.key===Ee)if(te.tag===4&&te.stateNode.containerInfo===oe.containerInfo&&te.stateNode.implementation===oe.implementation){s(ie,te.sibling),te=E(te,oe.children||[]),te.return=ie,ie=te;break e}else{s(ie,te);break}else n(ie,te);te=te.sibling}te=Mc(oe,ie.mode,pe),te.return=ie,ie=te}return $(ie);case V:return Ee=oe._init,Ke(ie,te,Ee(oe._payload),pe)}if(ot(oe))return ve(ie,te,oe,pe);if(A(oe))return Se(ie,te,oe,pe);mo(ie,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"?(oe=""+oe,te!==null&&te.tag===6?(s(ie,te.sibling),te=E(te,oe),te.return=ie,ie=te):(s(ie,te),te=Ac(oe,ie.mode,pe),te.return=ie,ie=te),$(ie)):s(ie,te)}return Ke}var Xn=ld(!0),cd=ld(!1),vo=Or(null),yo=null,Yn=null,zl=null;function $l(){zl=Yn=yo=null}function Wl(t){var n=vo.current;He(vo),t._currentValue=n}function Ul(t,n,s){for(;t!==null;){var g=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,g!==null&&(g.childLanes|=n)):g!==null&&(g.childLanes&n)!==n&&(g.childLanes|=n),t===s)break;t=t.return}}function Gn(t,n){yo=t,zl=Yn=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&n)!==0&&(St=!0),t.firstContext=null)}function Ft(t){var n=t._currentValue;if(zl!==t)if(t={context:t,memoizedValue:n,next:null},Yn===null){if(yo===null)throw Error(i(308));Yn=t,yo.dependencies={lanes:0,firstContext:t}}else Yn=Yn.next=t;return n}var hn=null;function Vl(t){hn===null?hn=[t]:hn.push(t)}function ud(t,n,s,g){var E=n.interleaved;return E===null?(s.next=s,Vl(n)):(s.next=E.next,E.next=s),n.interleaved=s,yr(t,g)}function yr(t,n){t.lanes|=n;var s=t.alternate;for(s!==null&&(s.lanes|=n),s=t,t=t.return;t!==null;)t.childLanes|=n,s=t.alternate,s!==null&&(s.childLanes|=n),s=t,t=t.return;return s.tag===3?s.stateNode:null}var jr=!1;function ql(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function hd(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function wr(t,n){return{eventTime:t,lane:n,tag:0,payload:null,callback:null,next:null}}function zr(t,n,s){var g=t.updateQueue;if(g===null)return null;if(g=g.shared,(Ae&2)!==0){var E=g.pending;return E===null?n.next=n:(n.next=E.next,E.next=n),g.pending=n,yr(t,s)}return E=g.interleaved,E===null?(n.next=n,Vl(g)):(n.next=E.next,E.next=n),g.interleaved=n,yr(t,s)}function wo(t,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194240)!==0)){var g=n.lanes;g&=t.pendingLanes,s|=g,n.lanes=s,ol(t,s)}}function dd(t,n){var s=t.updateQueue,g=t.alternate;if(g!==null&&(g=g.updateQueue,s===g)){var E=null,T=null;if(s=s.firstBaseUpdate,s!==null){do{var $={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};T===null?E=T=$:T=T.next=$,s=s.next}while(s!==null);T===null?E=T=n:T=T.next=n}else E=T=n;s={baseState:g.baseState,firstBaseUpdate:E,lastBaseUpdate:T,shared:g.shared,effects:g.effects},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=n:t.next=n,s.lastBaseUpdate=n}function So(t,n,s,g){var E=t.updateQueue;jr=!1;var T=E.firstBaseUpdate,$=E.lastBaseUpdate,Y=E.shared.pending;if(Y!==null){E.shared.pending=null;var Q=Y,ae=Q.next;Q.next=null,$===null?T=ae:$.next=ae,$=Q;var he=t.alternate;he!==null&&(he=he.updateQueue,Y=he.lastBaseUpdate,Y!==$&&(Y===null?he.firstBaseUpdate=ae:Y.next=ae,he.lastBaseUpdate=Q))}if(T!==null){var de=E.baseState;$=0,he=ae=Q=null,Y=T;do{var ue=Y.lane,_e=Y.eventTime;if((g&ue)===ue){he!==null&&(he=he.next={eventTime:_e,lane:0,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null});e:{var ve=t,Se=Y;switch(ue=n,_e=s,Se.tag){case 1:if(ve=Se.payload,typeof ve=="function"){de=ve.call(_e,de,ue);break e}de=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Se.payload,ue=typeof ve=="function"?ve.call(_e,de,ue):ve,ue==null)break e;de=B({},de,ue);break e;case 2:jr=!0}}Y.callback!==null&&Y.lane!==0&&(t.flags|=64,ue=E.effects,ue===null?E.effects=[Y]:ue.push(Y))}else _e={eventTime:_e,lane:ue,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},he===null?(ae=he=_e,Q=de):he=he.next=_e,$|=ue;if(Y=Y.next,Y===null){if(Y=E.shared.pending,Y===null)break;ue=Y,Y=ue.next,ue.next=null,E.lastBaseUpdate=ue,E.shared.pending=null}}while(!0);if(he===null&&(Q=de),E.baseState=Q,E.firstBaseUpdate=ae,E.lastBaseUpdate=he,n=E.shared.interleaved,n!==null){E=n;do $|=E.lane,E=E.next;while(E!==n)}else T===null&&(E.shared.lanes=0);pn|=$,t.lanes=$,t.memoizedState=de}}function fd(t,n,s){if(t=n.effects,n.effects=null,t!==null)for(n=0;n<t.length;n++){var g=t[n],E=g.callback;if(E!==null){if(g.callback=null,g=s,typeof E!="function")throw Error(i(191,E));E.call(g)}}}var Xi={},sr=Or(Xi),Yi=Or(Xi),Gi=Or(Xi);function dn(t){if(t===Xi)throw Error(i(174));return t}function Kl(t,n){switch(Ne(Gi,n),Ne(Yi,t),Ne(sr,Xi),t=n.nodeType,t){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:kt(null,"");break;default:t=t===8?n.parentNode:n,n=t.namespaceURI||null,t=t.tagName,n=kt(n,t)}He(sr),Ne(sr,n)}function Qn(){He(sr),He(Yi),He(Gi)}function pd(t){dn(Gi.current);var n=dn(sr.current),s=kt(n,t.type);n!==s&&(Ne(Yi,t),Ne(sr,s))}function Xl(t){Yi.current===t&&(He(sr),He(Yi))}var We=Or(0);function Co(t){for(var n=t;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Yl=[];function Gl(){for(var t=0;t<Yl.length;t++)Yl[t]._workInProgressVersionPrimary=null;Yl.length=0}var xo=w.ReactCurrentDispatcher,Ql=w.ReactCurrentBatchConfig,fn=0,Ue=null,Qe=null,rt=null,bo=!1,Qi=!1,Ji=0,d0=0;function dt(){throw Error(i(321))}function Jl(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!Ut(t[s],n[s]))return!1;return!0}function Zl(t,n,s,g,E,T){if(fn=T,Ue=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,xo.current=t===null||t.memoizedState===null?g0:m0,t=s(g,E),Qi){T=0;do{if(Qi=!1,Ji=0,25<=T)throw Error(i(301));T+=1,rt=Qe=null,n.updateQueue=null,xo.current=v0,t=s(g,E)}while(Qi)}if(xo.current=Lo,n=Qe!==null&&Qe.next!==null,fn=0,rt=Qe=Ue=null,bo=!1,n)throw Error(i(300));return t}function ec(){var t=Ji!==0;return Ji=0,t}function or(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rt===null?Ue.memoizedState=rt=t:rt=rt.next=t,rt}function jt(){if(Qe===null){var t=Ue.alternate;t=t!==null?t.memoizedState:null}else t=Qe.next;var n=rt===null?Ue.memoizedState:rt.next;if(n!==null)rt=n,Qe=t;else{if(t===null)throw Error(i(310));Qe=t,t={memoizedState:Qe.memoizedState,baseState:Qe.baseState,baseQueue:Qe.baseQueue,queue:Qe.queue,next:null},rt===null?Ue.memoizedState=rt=t:rt=rt.next=t}return rt}function Zi(t,n){return typeof n=="function"?n(t):n}function tc(t){var n=jt(),s=n.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=t;var g=Qe,E=g.baseQueue,T=s.pending;if(T!==null){if(E!==null){var $=E.next;E.next=T.next,T.next=$}g.baseQueue=E=T,s.pending=null}if(E!==null){T=E.next,g=g.baseState;var Y=$=null,Q=null,ae=T;do{var he=ae.lane;if((fn&he)===he)Q!==null&&(Q=Q.next={lane:0,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),g=ae.hasEagerState?ae.eagerState:t(g,ae.action);else{var de={lane:he,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null};Q===null?(Y=Q=de,$=g):Q=Q.next=de,Ue.lanes|=he,pn|=he}ae=ae.next}while(ae!==null&&ae!==T);Q===null?$=g:Q.next=Y,Ut(g,n.memoizedState)||(St=!0),n.memoizedState=g,n.baseState=$,n.baseQueue=Q,s.lastRenderedState=g}if(t=s.interleaved,t!==null){E=t;do T=E.lane,Ue.lanes|=T,pn|=T,E=E.next;while(E!==t)}else E===null&&(s.lanes=0);return[n.memoizedState,s.dispatch]}function rc(t){var n=jt(),s=n.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=t;var g=s.dispatch,E=s.pending,T=n.memoizedState;if(E!==null){s.pending=null;var $=E=E.next;do T=t(T,$.action),$=$.next;while($!==E);Ut(T,n.memoizedState)||(St=!0),n.memoizedState=T,n.baseQueue===null&&(n.baseState=T),s.lastRenderedState=T}return[T,g]}function _d(){}function gd(t,n){var s=Ue,g=jt(),E=n(),T=!Ut(g.memoizedState,E);if(T&&(g.memoizedState=E,St=!0),g=g.queue,nc(yd.bind(null,s,g,t),[t]),g.getSnapshot!==n||T||rt!==null&&rt.memoizedState.tag&1){if(s.flags|=2048,es(9,vd.bind(null,s,g,E,n),void 0,null),nt===null)throw Error(i(349));(fn&30)!==0||md(s,n,E)}return E}function md(t,n,s){t.flags|=16384,t={getSnapshot:n,value:s},n=Ue.updateQueue,n===null?(n={lastEffect:null,stores:null},Ue.updateQueue=n,n.stores=[t]):(s=n.stores,s===null?n.stores=[t]:s.push(t))}function vd(t,n,s,g){n.value=s,n.getSnapshot=g,wd(n)&&Sd(t)}function yd(t,n,s){return s(function(){wd(n)&&Sd(t)})}function wd(t){var n=t.getSnapshot;t=t.value;try{var s=n();return!Ut(t,s)}catch{return!0}}function Sd(t){var n=yr(t,1);n!==null&&Yt(n,t,1,-1)}function Cd(t){var n=or();return typeof t=="function"&&(t=t()),n.memoizedState=n.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Zi,lastRenderedState:t},n.queue=t,t=t.dispatch=_0.bind(null,Ue,t),[n.memoizedState,t]}function es(t,n,s,g){return t={tag:t,create:n,destroy:s,deps:g,next:null},n=Ue.updateQueue,n===null?(n={lastEffect:null,stores:null},Ue.updateQueue=n,n.lastEffect=t.next=t):(s=n.lastEffect,s===null?n.lastEffect=t.next=t:(g=s.next,s.next=t,t.next=g,n.lastEffect=t)),t}function xd(){return jt().memoizedState}function Eo(t,n,s,g){var E=or();Ue.flags|=t,E.memoizedState=es(1|n,s,void 0,g===void 0?null:g)}function ko(t,n,s,g){var E=jt();g=g===void 0?null:g;var T=void 0;if(Qe!==null){var $=Qe.memoizedState;if(T=$.destroy,g!==null&&Jl(g,$.deps)){E.memoizedState=es(n,s,T,g);return}}Ue.flags|=t,E.memoizedState=es(1|n,s,T,g)}function bd(t,n){return Eo(8390656,8,t,n)}function nc(t,n){return ko(2048,8,t,n)}function Ed(t,n){return ko(4,2,t,n)}function kd(t,n){return ko(4,4,t,n)}function Ld(t,n){if(typeof n=="function")return t=t(),n(t),function(){n(null)};if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function Rd(t,n,s){return s=s!=null?s.concat([t]):null,ko(4,4,Ld.bind(null,n,t),s)}function ic(){}function Dd(t,n){var s=jt();n=n===void 0?null:n;var g=s.memoizedState;return g!==null&&n!==null&&Jl(n,g[1])?g[0]:(s.memoizedState=[t,n],t)}function Td(t,n){var s=jt();n=n===void 0?null:n;var g=s.memoizedState;return g!==null&&n!==null&&Jl(n,g[1])?g[0]:(t=t(),s.memoizedState=[t,n],t)}function Ad(t,n,s){return(fn&21)===0?(t.baseState&&(t.baseState=!1,St=!0),t.memoizedState=s):(Ut(s,n)||(s=Bn(),Ue.lanes|=s,pn|=s,t.baseState=!0),n)}function f0(t,n){var s=Pe;Pe=s!==0&&4>s?s:4,t(!0);var g=Ql.transition;Ql.transition={};try{t(!1),n()}finally{Pe=s,Ql.transition=g}}function Md(){return jt().memoizedState}function p0(t,n,s){var g=Vr(t);if(s={lane:g,action:s,hasEagerState:!1,eagerState:null,next:null},Pd(t))Bd(n,s);else if(s=ud(t,n,s,g),s!==null){var E=mt();Yt(s,t,g,E),Nd(s,n,g)}}function _0(t,n,s){var g=Vr(t),E={lane:g,action:s,hasEagerState:!1,eagerState:null,next:null};if(Pd(t))Bd(n,E);else{var T=t.alternate;if(t.lanes===0&&(T===null||T.lanes===0)&&(T=n.lastRenderedReducer,T!==null))try{var $=n.lastRenderedState,Y=T($,s);if(E.hasEagerState=!0,E.eagerState=Y,Ut(Y,$)){var Q=n.interleaved;Q===null?(E.next=E,Vl(n)):(E.next=Q.next,Q.next=E),n.interleaved=E;return}}catch{}finally{}s=ud(t,n,E,g),s!==null&&(E=mt(),Yt(s,t,g,E),Nd(s,n,g))}}function Pd(t){var n=t.alternate;return t===Ue||n!==null&&n===Ue}function Bd(t,n){Qi=bo=!0;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}function Nd(t,n,s){if((s&4194240)!==0){var g=n.lanes;g&=t.pendingLanes,s|=g,n.lanes=s,ol(t,s)}}var Lo={readContext:Ft,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useInsertionEffect:dt,useLayoutEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useMutableSource:dt,useSyncExternalStore:dt,useId:dt,unstable_isNewReconciler:!1},g0={readContext:Ft,useCallback:function(t,n){return or().memoizedState=[t,n===void 0?null:n],t},useContext:Ft,useEffect:bd,useImperativeHandle:function(t,n,s){return s=s!=null?s.concat([t]):null,Eo(4194308,4,Ld.bind(null,n,t),s)},useLayoutEffect:function(t,n){return Eo(4194308,4,t,n)},useInsertionEffect:function(t,n){return Eo(4,2,t,n)},useMemo:function(t,n){var s=or();return n=n===void 0?null:n,t=t(),s.memoizedState=[t,n],t},useReducer:function(t,n,s){var g=or();return n=s!==void 0?s(n):n,g.memoizedState=g.baseState=n,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:n},g.queue=t,t=t.dispatch=p0.bind(null,Ue,t),[g.memoizedState,t]},useRef:function(t){var n=or();return t={current:t},n.memoizedState=t},useState:Cd,useDebugValue:ic,useDeferredValue:function(t){return or().memoizedState=t},useTransition:function(){var t=Cd(!1),n=t[0];return t=f0.bind(null,t[1]),or().memoizedState=t,[n,t]},useMutableSource:function(){},useSyncExternalStore:function(t,n,s){var g=Ue,E=or();if(Fe){if(s===void 0)throw Error(i(407));s=s()}else{if(s=n(),nt===null)throw Error(i(349));(fn&30)!==0||md(g,n,s)}E.memoizedState=s;var T={value:s,getSnapshot:n};return E.queue=T,bd(yd.bind(null,g,T,t),[t]),g.flags|=2048,es(9,vd.bind(null,g,T,s,n),void 0,null),s},useId:function(){var t=or(),n=nt.identifierPrefix;if(Fe){var s=vr,g=mr;s=(g&~(1<<32-Rt(g)-1)).toString(32)+s,n=":"+n+"R"+s,s=Ji++,0<s&&(n+="H"+s.toString(32)),n+=":"}else s=d0++,n=":"+n+"r"+s.toString(32)+":";return t.memoizedState=n},unstable_isNewReconciler:!1},m0={readContext:Ft,useCallback:Dd,useContext:Ft,useEffect:nc,useImperativeHandle:Rd,useInsertionEffect:Ed,useLayoutEffect:kd,useMemo:Td,useReducer:tc,useRef:xd,useState:function(){return tc(Zi)},useDebugValue:ic,useDeferredValue:function(t){var n=jt();return Ad(n,Qe.memoizedState,t)},useTransition:function(){var t=tc(Zi)[0],n=jt().memoizedState;return[t,n]},useMutableSource:_d,useSyncExternalStore:gd,useId:Md,unstable_isNewReconciler:!1},v0={readContext:Ft,useCallback:Dd,useContext:Ft,useEffect:nc,useImperativeHandle:Rd,useInsertionEffect:Ed,useLayoutEffect:kd,useMemo:Td,useReducer:rc,useRef:xd,useState:function(){return rc(Zi)},useDebugValue:ic,useDeferredValue:function(t){var n=jt();return Qe===null?n.memoizedState=t:Ad(n,Qe.memoizedState,t)},useTransition:function(){var t=rc(Zi)[0],n=jt().memoizedState;return[t,n]},useMutableSource:_d,useSyncExternalStore:gd,useId:Md,unstable_isNewReconciler:!1};function qt(t,n){if(t&&t.defaultProps){n=B({},n),t=t.defaultProps;for(var s in t)n[s]===void 0&&(n[s]=t[s]);return n}return n}function sc(t,n,s,g){n=t.memoizedState,s=s(g,n),s=s==null?n:B({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var Ro={isMounted:function(t){return(t=t._reactInternals)?rr(t)===t:!1},enqueueSetState:function(t,n,s){t=t._reactInternals;var g=mt(),E=Vr(t),T=wr(g,E);T.payload=n,s!=null&&(T.callback=s),n=zr(t,T,E),n!==null&&(Yt(n,t,E,g),wo(n,t,E))},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var g=mt(),E=Vr(t),T=wr(g,E);T.tag=1,T.payload=n,s!=null&&(T.callback=s),n=zr(t,T,E),n!==null&&(Yt(n,t,E,g),wo(n,t,E))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=mt(),g=Vr(t),E=wr(s,g);E.tag=2,n!=null&&(E.callback=n),n=zr(t,E,g),n!==null&&(Yt(n,t,g,s),wo(n,t,g))}};function Id(t,n,s,g,E,T,$){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(g,T,$):n.prototype&&n.prototype.isPureReactComponent?!ji(s,g)||!ji(E,T):!0}function Od(t,n,s){var g=!1,E=Hr,T=n.contextType;return typeof T=="object"&&T!==null?T=Ft(T):(E=wt(n)?ln:ht.current,g=n.contextTypes,T=(g=g!=null)?Un(t,E):Hr),n=new n(s,T),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Ro,t.stateNode=n,n._reactInternals=t,g&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=E,t.__reactInternalMemoizedMaskedChildContext=T),n}function Hd(t,n,s,g){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,g),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,g),n.state!==t&&Ro.enqueueReplaceState(n,n.state,null)}function oc(t,n,s,g){var E=t.stateNode;E.props=s,E.state=t.memoizedState,E.refs={},ql(t);var T=n.contextType;typeof T=="object"&&T!==null?E.context=Ft(T):(T=wt(n)?ln:ht.current,E.context=Un(t,T)),E.state=t.memoizedState,T=n.getDerivedStateFromProps,typeof T=="function"&&(sc(t,n,T,s),E.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(n=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),n!==E.state&&Ro.enqueueReplaceState(E,E.state,null),So(t,s,E,g),E.state=t.memoizedState),typeof E.componentDidMount=="function"&&(t.flags|=4194308)}function Jn(t,n){try{var s="",g=n;do s+=se(g),g=g.return;while(g);var E=s}catch(T){E=`
|
|
39
|
+
Error generating stack: `+T.message+`
|
|
40
|
+
`+T.stack}return{value:t,source:n,stack:E,digest:null}}function ac(t,n,s){return{value:t,source:null,stack:s??null,digest:n??null}}function lc(t,n){try{console.error(n.value)}catch(s){setTimeout(function(){throw s})}}var y0=typeof WeakMap=="function"?WeakMap:Map;function Fd(t,n,s){s=wr(-1,s),s.tag=3,s.payload={element:null};var g=n.value;return s.callback=function(){No||(No=!0,xc=g),lc(t,n)},s}function jd(t,n,s){s=wr(-1,s),s.tag=3;var g=t.type.getDerivedStateFromError;if(typeof g=="function"){var E=n.value;s.payload=function(){return g(E)},s.callback=function(){lc(t,n)}}var T=t.stateNode;return T!==null&&typeof T.componentDidCatch=="function"&&(s.callback=function(){lc(t,n),typeof g!="function"&&(Wr===null?Wr=new Set([this]):Wr.add(this));var $=n.stack;this.componentDidCatch(n.value,{componentStack:$!==null?$:""})}),s}function zd(t,n,s){var g=t.pingCache;if(g===null){g=t.pingCache=new y0;var E=new Set;g.set(n,E)}else E=g.get(n),E===void 0&&(E=new Set,g.set(n,E));E.has(s)||(E.add(s),t=P0.bind(null,t,n,s),n.then(t,t))}function $d(t){do{var n;if((n=t.tag===13)&&(n=t.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return t;t=t.return}while(t!==null);return null}function Wd(t,n,s,g,E){return(t.mode&1)===0?(t===n?t.flags|=65536:(t.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(n=wr(-1,1),n.tag=2,zr(s,n,1))),s.lanes|=1),t):(t.flags|=65536,t.lanes=E,t)}var w0=w.ReactCurrentOwner,St=!1;function gt(t,n,s,g){n.child=t===null?cd(n,null,s,g):Xn(n,t.child,s,g)}function Ud(t,n,s,g,E){s=s.render;var T=n.ref;return Gn(n,E),g=Zl(t,n,s,g,T,E),s=ec(),t!==null&&!St?(n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~E,Sr(t,n,E)):(Fe&&s&&Il(n),n.flags|=1,gt(t,n,g,E),n.child)}function Vd(t,n,s,g,E){if(t===null){var T=s.type;return typeof T=="function"&&!Tc(T)&&T.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(n.tag=15,n.type=T,qd(t,n,T,g,E)):(t=zo(s.type,null,g,n,n.mode,E),t.ref=n.ref,t.return=n,n.child=t)}if(T=t.child,(t.lanes&E)===0){var $=T.memoizedProps;if(s=s.compare,s=s!==null?s:ji,s($,g)&&t.ref===n.ref)return Sr(t,n,E)}return n.flags|=1,t=Kr(T,g),t.ref=n.ref,t.return=n,n.child=t}function qd(t,n,s,g,E){if(t!==null){var T=t.memoizedProps;if(ji(T,g)&&t.ref===n.ref)if(St=!1,n.pendingProps=g=T,(t.lanes&E)!==0)(t.flags&131072)!==0&&(St=!0);else return n.lanes=t.lanes,Sr(t,n,E)}return cc(t,n,s,g,E)}function Kd(t,n,s){var g=n.pendingProps,E=g.children,T=t!==null?t.memoizedState:null;if(g.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ne(ei,Mt),Mt|=s;else{if((s&1073741824)===0)return t=T!==null?T.baseLanes|s:s,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:t,cachePool:null,transitions:null},n.updateQueue=null,Ne(ei,Mt),Mt|=t,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=T!==null?T.baseLanes:s,Ne(ei,Mt),Mt|=g}else T!==null?(g=T.baseLanes|s,n.memoizedState=null):g=s,Ne(ei,Mt),Mt|=g;return gt(t,n,E,s),n.child}function Xd(t,n){var s=n.ref;(t===null&&s!==null||t!==null&&t.ref!==s)&&(n.flags|=512,n.flags|=2097152)}function cc(t,n,s,g,E){var T=wt(s)?ln:ht.current;return T=Un(n,T),Gn(n,E),s=Zl(t,n,s,g,T,E),g=ec(),t!==null&&!St?(n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~E,Sr(t,n,E)):(Fe&&g&&Il(n),n.flags|=1,gt(t,n,s,E),n.child)}function Yd(t,n,s,g,E){if(wt(s)){var T=!0;ho(n)}else T=!1;if(Gn(n,E),n.stateNode===null)To(t,n),Od(n,s,g),oc(n,s,g,E),g=!0;else if(t===null){var $=n.stateNode,Y=n.memoizedProps;$.props=Y;var Q=$.context,ae=s.contextType;typeof ae=="object"&&ae!==null?ae=Ft(ae):(ae=wt(s)?ln:ht.current,ae=Un(n,ae));var he=s.getDerivedStateFromProps,de=typeof he=="function"||typeof $.getSnapshotBeforeUpdate=="function";de||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(Y!==g||Q!==ae)&&Hd(n,$,g,ae),jr=!1;var ue=n.memoizedState;$.state=ue,So(n,g,$,E),Q=n.memoizedState,Y!==g||ue!==Q||yt.current||jr?(typeof he=="function"&&(sc(n,s,he,g),Q=n.memoizedState),(Y=jr||Id(n,s,Y,g,ue,Q,ae))?(de||typeof $.UNSAFE_componentWillMount!="function"&&typeof $.componentWillMount!="function"||(typeof $.componentWillMount=="function"&&$.componentWillMount(),typeof $.UNSAFE_componentWillMount=="function"&&$.UNSAFE_componentWillMount()),typeof $.componentDidMount=="function"&&(n.flags|=4194308)):(typeof $.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=g,n.memoizedState=Q),$.props=g,$.state=Q,$.context=ae,g=Y):(typeof $.componentDidMount=="function"&&(n.flags|=4194308),g=!1)}else{$=n.stateNode,hd(t,n),Y=n.memoizedProps,ae=n.type===n.elementType?Y:qt(n.type,Y),$.props=ae,de=n.pendingProps,ue=$.context,Q=s.contextType,typeof Q=="object"&&Q!==null?Q=Ft(Q):(Q=wt(s)?ln:ht.current,Q=Un(n,Q));var _e=s.getDerivedStateFromProps;(he=typeof _e=="function"||typeof $.getSnapshotBeforeUpdate=="function")||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(Y!==de||ue!==Q)&&Hd(n,$,g,Q),jr=!1,ue=n.memoizedState,$.state=ue,So(n,g,$,E);var ve=n.memoizedState;Y!==de||ue!==ve||yt.current||jr?(typeof _e=="function"&&(sc(n,s,_e,g),ve=n.memoizedState),(ae=jr||Id(n,s,ae,g,ue,ve,Q)||!1)?(he||typeof $.UNSAFE_componentWillUpdate!="function"&&typeof $.componentWillUpdate!="function"||(typeof $.componentWillUpdate=="function"&&$.componentWillUpdate(g,ve,Q),typeof $.UNSAFE_componentWillUpdate=="function"&&$.UNSAFE_componentWillUpdate(g,ve,Q)),typeof $.componentDidUpdate=="function"&&(n.flags|=4),typeof $.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof $.componentDidUpdate!="function"||Y===t.memoizedProps&&ue===t.memoizedState||(n.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||Y===t.memoizedProps&&ue===t.memoizedState||(n.flags|=1024),n.memoizedProps=g,n.memoizedState=ve),$.props=g,$.state=ve,$.context=Q,g=ae):(typeof $.componentDidUpdate!="function"||Y===t.memoizedProps&&ue===t.memoizedState||(n.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||Y===t.memoizedProps&&ue===t.memoizedState||(n.flags|=1024),g=!1)}return uc(t,n,s,g,T,E)}function uc(t,n,s,g,E,T){Xd(t,n);var $=(n.flags&128)!==0;if(!g&&!$)return E&&ed(n,s,!1),Sr(t,n,T);g=n.stateNode,w0.current=n;var Y=$&&typeof s.getDerivedStateFromError!="function"?null:g.render();return n.flags|=1,t!==null&&$?(n.child=Xn(n,t.child,null,T),n.child=Xn(n,null,Y,T)):gt(t,n,Y,T),n.memoizedState=g.state,E&&ed(n,s,!0),n.child}function Gd(t){var n=t.stateNode;n.pendingContext?Jh(t,n.pendingContext,n.pendingContext!==n.context):n.context&&Jh(t,n.context,!1),Kl(t,n.containerInfo)}function Qd(t,n,s,g,E){return Kn(),jl(E),n.flags|=256,gt(t,n,s,g),n.child}var hc={dehydrated:null,treeContext:null,retryLane:0};function dc(t){return{baseLanes:t,cachePool:null,transitions:null}}function Jd(t,n,s){var g=n.pendingProps,E=We.current,T=!1,$=(n.flags&128)!==0,Y;if((Y=$)||(Y=t!==null&&t.memoizedState===null?!1:(E&2)!==0),Y?(T=!0,n.flags&=-129):(t===null||t.memoizedState!==null)&&(E|=1),Ne(We,E&1),t===null)return Fl(n),t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((n.mode&1)===0?n.lanes=1:t.data==="$!"?n.lanes=8:n.lanes=1073741824,null):($=g.children,t=g.fallback,T?(g=n.mode,T=n.child,$={mode:"hidden",children:$},(g&1)===0&&T!==null?(T.childLanes=0,T.pendingProps=$):T=$o($,g,0,null),t=vn(t,g,s,null),T.return=n,t.return=n,T.sibling=t,n.child=T,n.child.memoizedState=dc(s),n.memoizedState=hc,t):fc(n,$));if(E=t.memoizedState,E!==null&&(Y=E.dehydrated,Y!==null))return S0(t,n,$,g,Y,E,s);if(T){T=g.fallback,$=n.mode,E=t.child,Y=E.sibling;var Q={mode:"hidden",children:g.children};return($&1)===0&&n.child!==E?(g=n.child,g.childLanes=0,g.pendingProps=Q,n.deletions=null):(g=Kr(E,Q),g.subtreeFlags=E.subtreeFlags&14680064),Y!==null?T=Kr(Y,T):(T=vn(T,$,s,null),T.flags|=2),T.return=n,g.return=n,g.sibling=T,n.child=g,g=T,T=n.child,$=t.child.memoizedState,$=$===null?dc(s):{baseLanes:$.baseLanes|s,cachePool:null,transitions:$.transitions},T.memoizedState=$,T.childLanes=t.childLanes&~s,n.memoizedState=hc,g}return T=t.child,t=T.sibling,g=Kr(T,{mode:"visible",children:g.children}),(n.mode&1)===0&&(g.lanes=s),g.return=n,g.sibling=null,t!==null&&(s=n.deletions,s===null?(n.deletions=[t],n.flags|=16):s.push(t)),n.child=g,n.memoizedState=null,g}function fc(t,n){return n=$o({mode:"visible",children:n},t.mode,0,null),n.return=t,t.child=n}function Do(t,n,s,g){return g!==null&&jl(g),Xn(n,t.child,null,s),t=fc(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function S0(t,n,s,g,E,T,$){if(s)return n.flags&256?(n.flags&=-257,g=ac(Error(i(422))),Do(t,n,$,g)):n.memoizedState!==null?(n.child=t.child,n.flags|=128,null):(T=g.fallback,E=n.mode,g=$o({mode:"visible",children:g.children},E,0,null),T=vn(T,E,$,null),T.flags|=2,g.return=n,T.return=n,g.sibling=T,n.child=g,(n.mode&1)!==0&&Xn(n,t.child,null,$),n.child.memoizedState=dc($),n.memoizedState=hc,T);if((n.mode&1)===0)return Do(t,n,$,null);if(E.data==="$!"){if(g=E.nextSibling&&E.nextSibling.dataset,g)var Y=g.dgst;return g=Y,T=Error(i(419)),g=ac(T,g,void 0),Do(t,n,$,g)}if(Y=($&t.childLanes)!==0,St||Y){if(g=nt,g!==null){switch($&-$){case 4:E=2;break;case 16:E=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:E=32;break;case 536870912:E=268435456;break;default:E=0}E=(E&(g.suspendedLanes|$))!==0?0:E,E!==0&&E!==T.retryLane&&(T.retryLane=E,yr(t,E),Yt(g,t,E,-1))}return Dc(),g=ac(Error(i(421))),Do(t,n,$,g)}return E.data==="$?"?(n.flags|=128,n.child=t.child,n=B0.bind(null,t),E._reactRetry=n,null):(t=T.treeContext,At=Ir(E.nextSibling),Tt=n,Fe=!0,Vt=null,t!==null&&(Ot[Ht++]=mr,Ot[Ht++]=vr,Ot[Ht++]=cn,mr=t.id,vr=t.overflow,cn=n),n=fc(n,g.children),n.flags|=4096,n)}function Zd(t,n,s){t.lanes|=n;var g=t.alternate;g!==null&&(g.lanes|=n),Ul(t.return,n,s)}function pc(t,n,s,g,E){var T=t.memoizedState;T===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:g,tail:s,tailMode:E}:(T.isBackwards=n,T.rendering=null,T.renderingStartTime=0,T.last=g,T.tail=s,T.tailMode=E)}function ef(t,n,s){var g=n.pendingProps,E=g.revealOrder,T=g.tail;if(gt(t,n,g.children,s),g=We.current,(g&2)!==0)g=g&1|2,n.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Zd(t,s,n);else if(t.tag===19)Zd(t,s,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}g&=1}if(Ne(We,g),(n.mode&1)===0)n.memoizedState=null;else switch(E){case"forwards":for(s=n.child,E=null;s!==null;)t=s.alternate,t!==null&&Co(t)===null&&(E=s),s=s.sibling;s=E,s===null?(E=n.child,n.child=null):(E=s.sibling,s.sibling=null),pc(n,!1,E,s,T);break;case"backwards":for(s=null,E=n.child,n.child=null;E!==null;){if(t=E.alternate,t!==null&&Co(t)===null){n.child=E;break}t=E.sibling,E.sibling=s,s=E,E=t}pc(n,!0,s,null,T);break;case"together":pc(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function To(t,n){(n.mode&1)===0&&t!==null&&(t.alternate=null,n.alternate=null,n.flags|=2)}function Sr(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),pn|=n.lanes,(s&n.childLanes)===0)return null;if(t!==null&&n.child!==t.child)throw Error(i(153));if(n.child!==null){for(t=n.child,s=Kr(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=Kr(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}function C0(t,n,s){switch(n.tag){case 3:Gd(n),Kn();break;case 5:pd(n);break;case 1:wt(n.type)&&ho(n);break;case 4:Kl(n,n.stateNode.containerInfo);break;case 10:var g=n.type._context,E=n.memoizedProps.value;Ne(vo,g._currentValue),g._currentValue=E;break;case 13:if(g=n.memoizedState,g!==null)return g.dehydrated!==null?(Ne(We,We.current&1),n.flags|=128,null):(s&n.child.childLanes)!==0?Jd(t,n,s):(Ne(We,We.current&1),t=Sr(t,n,s),t!==null?t.sibling:null);Ne(We,We.current&1);break;case 19:if(g=(s&n.childLanes)!==0,(t.flags&128)!==0){if(g)return ef(t,n,s);n.flags|=128}if(E=n.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),Ne(We,We.current),g)break;return null;case 22:case 23:return n.lanes=0,Kd(t,n,s)}return Sr(t,n,s)}var tf,_c,rf,nf;tf=function(t,n){for(var s=n.child;s!==null;){if(s.tag===5||s.tag===6)t.appendChild(s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return;s=s.return}s.sibling.return=s.return,s=s.sibling}},_c=function(){},rf=function(t,n,s,g){var E=t.memoizedProps;if(E!==g){t=n.stateNode,dn(sr.current);var T=null;switch(s){case"input":E=we(t,E),g=we(t,g),T=[];break;case"select":E=B({},E,{value:void 0}),g=B({},g,{value:void 0}),T=[];break;case"textarea":E=vt(t,E),g=vt(t,g),T=[];break;default:typeof E.onClick!="function"&&typeof g.onClick=="function"&&(t.onclick=lo)}mi(s,g);var $;s=null;for(ae in E)if(!g.hasOwnProperty(ae)&&E.hasOwnProperty(ae)&&E[ae]!=null)if(ae==="style"){var Y=E[ae];for($ in Y)Y.hasOwnProperty($)&&(s||(s={}),s[$]="")}else ae!=="dangerouslySetInnerHTML"&&ae!=="children"&&ae!=="suppressContentEditableWarning"&&ae!=="suppressHydrationWarning"&&ae!=="autoFocus"&&(u.hasOwnProperty(ae)?T||(T=[]):(T=T||[]).push(ae,null));for(ae in g){var Q=g[ae];if(Y=E!=null?E[ae]:void 0,g.hasOwnProperty(ae)&&Q!==Y&&(Q!=null||Y!=null))if(ae==="style")if(Y){for($ in Y)!Y.hasOwnProperty($)||Q&&Q.hasOwnProperty($)||(s||(s={}),s[$]="");for($ in Q)Q.hasOwnProperty($)&&Y[$]!==Q[$]&&(s||(s={}),s[$]=Q[$])}else s||(T||(T=[]),T.push(ae,s)),s=Q;else ae==="dangerouslySetInnerHTML"?(Q=Q?Q.__html:void 0,Y=Y?Y.__html:void 0,Q!=null&&Y!==Q&&(T=T||[]).push(ae,Q)):ae==="children"?typeof Q!="string"&&typeof Q!="number"||(T=T||[]).push(ae,""+Q):ae!=="suppressContentEditableWarning"&&ae!=="suppressHydrationWarning"&&(u.hasOwnProperty(ae)?(Q!=null&&ae==="onScroll"&&Oe("scroll",t),T||Y===Q||(T=[])):(T=T||[]).push(ae,Q))}s&&(T=T||[]).push("style",s);var ae=T;(n.updateQueue=ae)&&(n.flags|=4)}},nf=function(t,n,s,g){s!==g&&(n.flags|=4)};function ts(t,n){if(!Fe)switch(t.tailMode){case"hidden":n=t.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var g=null;s!==null;)s.alternate!==null&&(g=s),s=s.sibling;g===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:g.sibling=null}}function ft(t){var n=t.alternate!==null&&t.alternate.child===t.child,s=0,g=0;if(n)for(var E=t.child;E!==null;)s|=E.lanes|E.childLanes,g|=E.subtreeFlags&14680064,g|=E.flags&14680064,E.return=t,E=E.sibling;else for(E=t.child;E!==null;)s|=E.lanes|E.childLanes,g|=E.subtreeFlags,g|=E.flags,E.return=t,E=E.sibling;return t.subtreeFlags|=g,t.childLanes=s,n}function x0(t,n,s){var g=n.pendingProps;switch(Ol(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(n),null;case 1:return wt(n.type)&&uo(),ft(n),null;case 3:return g=n.stateNode,Qn(),He(yt),He(ht),Gl(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(t===null||t.child===null)&&(go(n)?n.flags|=4:t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Vt!==null&&(kc(Vt),Vt=null))),_c(t,n),ft(n),null;case 5:Xl(n);var E=dn(Gi.current);if(s=n.type,t!==null&&n.stateNode!=null)rf(t,n,s,g,E),t.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!g){if(n.stateNode===null)throw Error(i(166));return ft(n),null}if(t=dn(sr.current),go(n)){g=n.stateNode,s=n.type;var T=n.memoizedProps;switch(g[ir]=n,g[Vi]=T,t=(n.mode&1)!==0,s){case"dialog":Oe("cancel",g),Oe("close",g);break;case"iframe":case"object":case"embed":Oe("load",g);break;case"video":case"audio":for(E=0;E<$i.length;E++)Oe($i[E],g);break;case"source":Oe("error",g);break;case"img":case"image":case"link":Oe("error",g),Oe("load",g);break;case"details":Oe("toggle",g);break;case"input":ye(g,T),Oe("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!T.multiple},Oe("invalid",g);break;case"textarea":qe(g,T),Oe("invalid",g)}mi(s,T),E=null;for(var $ in T)if(T.hasOwnProperty($)){var Y=T[$];$==="children"?typeof Y=="string"?g.textContent!==Y&&(T.suppressHydrationWarning!==!0&&ao(g.textContent,Y,t),E=["children",Y]):typeof Y=="number"&&g.textContent!==""+Y&&(T.suppressHydrationWarning!==!0&&ao(g.textContent,Y,t),E=["children",""+Y]):u.hasOwnProperty($)&&Y!=null&&$==="onScroll"&&Oe("scroll",g)}switch(s){case"input":ce(g),Ie(g,T,!0);break;case"textarea":ce(g),et(g);break;case"select":case"option":break;default:typeof T.onClick=="function"&&(g.onclick=lo)}g=E,n.updateQueue=g,g!==null&&(n.flags|=4)}else{$=E.nodeType===9?E:E.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=_t(s)),t==="http://www.w3.org/1999/xhtml"?s==="script"?(t=$.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof g.is=="string"?t=$.createElement(s,{is:g.is}):(t=$.createElement(s),s==="select"&&($=t,g.multiple?$.multiple=!0:g.size&&($.size=g.size))):t=$.createElementNS(t,s),t[ir]=n,t[Vi]=g,tf(t,n,!1,!1),n.stateNode=t;e:{switch($=vi(s,g),s){case"dialog":Oe("cancel",t),Oe("close",t),E=g;break;case"iframe":case"object":case"embed":Oe("load",t),E=g;break;case"video":case"audio":for(E=0;E<$i.length;E++)Oe($i[E],t);E=g;break;case"source":Oe("error",t),E=g;break;case"img":case"image":case"link":Oe("error",t),Oe("load",t),E=g;break;case"details":Oe("toggle",t),E=g;break;case"input":ye(t,g),E=we(t,g),Oe("invalid",t);break;case"option":E=g;break;case"select":t._wrapperState={wasMultiple:!!g.multiple},E=B({},g,{value:void 0}),Oe("invalid",t);break;case"textarea":qe(t,g),E=vt(t,g),Oe("invalid",t);break;default:E=g}mi(s,E),Y=E;for(T in Y)if(Y.hasOwnProperty(T)){var Q=Y[T];T==="style"?Ms(t,Q):T==="dangerouslySetInnerHTML"?(Q=Q?Q.__html:void 0,Q!=null&&pr(t,Q)):T==="children"?typeof Q=="string"?(s!=="textarea"||Q!=="")&&tt(t,Q):typeof Q=="number"&&tt(t,""+Q):T!=="suppressContentEditableWarning"&&T!=="suppressHydrationWarning"&&T!=="autoFocus"&&(u.hasOwnProperty(T)?Q!=null&&T==="onScroll"&&Oe("scroll",t):Q!=null&&h(t,T,Q,$))}switch(s){case"input":ce(t),Ie(t,g,!1);break;case"textarea":ce(t),et(t);break;case"option":g.value!=null&&t.setAttribute("value",""+O(g.value));break;case"select":t.multiple=!!g.multiple,T=g.value,T!=null?ct(t,!!g.multiple,T,!1):g.defaultValue!=null&&ct(t,!!g.multiple,g.defaultValue,!0);break;default:typeof E.onClick=="function"&&(t.onclick=lo)}switch(s){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}}g&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return ft(n),null;case 6:if(t&&n.stateNode!=null)nf(t,n,t.memoizedProps,g);else{if(typeof g!="string"&&n.stateNode===null)throw Error(i(166));if(s=dn(Gi.current),dn(sr.current),go(n)){if(g=n.stateNode,s=n.memoizedProps,g[ir]=n,(T=g.nodeValue!==s)&&(t=Tt,t!==null))switch(t.tag){case 3:ao(g.nodeValue,s,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&ao(g.nodeValue,s,(t.mode&1)!==0)}T&&(n.flags|=4)}else g=(s.nodeType===9?s:s.ownerDocument).createTextNode(g),g[ir]=n,n.stateNode=g}return ft(n),null;case 13:if(He(We),g=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Fe&&At!==null&&(n.mode&1)!==0&&(n.flags&128)===0)od(),Kn(),n.flags|=98560,T=!1;else if(T=go(n),g!==null&&g.dehydrated!==null){if(t===null){if(!T)throw Error(i(318));if(T=n.memoizedState,T=T!==null?T.dehydrated:null,!T)throw Error(i(317));T[ir]=n}else Kn(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ft(n),T=!1}else Vt!==null&&(kc(Vt),Vt=null),T=!0;if(!T)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=s,n):(g=g!==null,g!==(t!==null&&t.memoizedState!==null)&&g&&(n.child.flags|=8192,(n.mode&1)!==0&&(t===null||(We.current&1)!==0?Je===0&&(Je=3):Dc())),n.updateQueue!==null&&(n.flags|=4),ft(n),null);case 4:return Qn(),_c(t,n),t===null&&Wi(n.stateNode.containerInfo),ft(n),null;case 10:return Wl(n.type._context),ft(n),null;case 17:return wt(n.type)&&uo(),ft(n),null;case 19:if(He(We),T=n.memoizedState,T===null)return ft(n),null;if(g=(n.flags&128)!==0,$=T.rendering,$===null)if(g)ts(T,!1);else{if(Je!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if($=Co(t),$!==null){for(n.flags|=128,ts(T,!1),g=$.updateQueue,g!==null&&(n.updateQueue=g,n.flags|=4),n.subtreeFlags=0,g=s,s=n.child;s!==null;)T=s,t=g,T.flags&=14680066,$=T.alternate,$===null?(T.childLanes=0,T.lanes=t,T.child=null,T.subtreeFlags=0,T.memoizedProps=null,T.memoizedState=null,T.updateQueue=null,T.dependencies=null,T.stateNode=null):(T.childLanes=$.childLanes,T.lanes=$.lanes,T.child=$.child,T.subtreeFlags=0,T.deletions=null,T.memoizedProps=$.memoizedProps,T.memoizedState=$.memoizedState,T.updateQueue=$.updateQueue,T.type=$.type,t=$.dependencies,T.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),s=s.sibling;return Ne(We,We.current&1|2),n.child}t=t.sibling}T.tail!==null&&$e()>ti&&(n.flags|=128,g=!0,ts(T,!1),n.lanes=4194304)}else{if(!g)if(t=Co($),t!==null){if(n.flags|=128,g=!0,s=t.updateQueue,s!==null&&(n.updateQueue=s,n.flags|=4),ts(T,!0),T.tail===null&&T.tailMode==="hidden"&&!$.alternate&&!Fe)return ft(n),null}else 2*$e()-T.renderingStartTime>ti&&s!==1073741824&&(n.flags|=128,g=!0,ts(T,!1),n.lanes=4194304);T.isBackwards?($.sibling=n.child,n.child=$):(s=T.last,s!==null?s.sibling=$:n.child=$,T.last=$)}return T.tail!==null?(n=T.tail,T.rendering=n,T.tail=n.sibling,T.renderingStartTime=$e(),n.sibling=null,s=We.current,Ne(We,g?s&1|2:s&1),n):(ft(n),null);case 22:case 23:return Rc(),g=n.memoizedState!==null,t!==null&&t.memoizedState!==null!==g&&(n.flags|=8192),g&&(n.mode&1)!==0?(Mt&1073741824)!==0&&(ft(n),n.subtreeFlags&6&&(n.flags|=8192)):ft(n),null;case 24:return null;case 25:return null}throw Error(i(156,n.tag))}function b0(t,n){switch(Ol(n),n.tag){case 1:return wt(n.type)&&uo(),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Qn(),He(yt),He(ht),Gl(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 5:return Xl(n),null;case 13:if(He(We),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(i(340));Kn()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return He(We),null;case 4:return Qn(),null;case 10:return Wl(n.type._context),null;case 22:case 23:return Rc(),null;case 24:return null;default:return null}}var Ao=!1,pt=!1,E0=typeof WeakSet=="function"?WeakSet:Set,me=null;function Zn(t,n){var s=t.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(g){Ve(t,n,g)}else s.current=null}function gc(t,n,s){try{s()}catch(g){Ve(t,n,g)}}var sf=!1;function k0(t,n){if(Rl=Gs,t=Ih(),wl(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var g=s.getSelection&&s.getSelection();if(g&&g.rangeCount!==0){s=g.anchorNode;var E=g.anchorOffset,T=g.focusNode;g=g.focusOffset;try{s.nodeType,T.nodeType}catch{s=null;break e}var $=0,Y=-1,Q=-1,ae=0,he=0,de=t,ue=null;t:for(;;){for(var _e;de!==s||E!==0&&de.nodeType!==3||(Y=$+E),de!==T||g!==0&&de.nodeType!==3||(Q=$+g),de.nodeType===3&&($+=de.nodeValue.length),(_e=de.firstChild)!==null;)ue=de,de=_e;for(;;){if(de===t)break t;if(ue===s&&++ae===E&&(Y=$),ue===T&&++he===g&&(Q=$),(_e=de.nextSibling)!==null)break;de=ue,ue=de.parentNode}de=_e}s=Y===-1||Q===-1?null:{start:Y,end:Q}}else s=null}s=s||{start:0,end:0}}else s=null;for(Dl={focusedElem:t,selectionRange:s},Gs=!1,me=n;me!==null;)if(n=me,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,me=t;else for(;me!==null;){n=me;try{var ve=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(ve!==null){var Se=ve.memoizedProps,Ke=ve.memoizedState,ie=n.stateNode,te=ie.getSnapshotBeforeUpdate(n.elementType===n.type?Se:qt(n.type,Se),Ke);ie.__reactInternalSnapshotBeforeUpdate=te}break;case 3:var oe=n.stateNode.containerInfo;oe.nodeType===1?oe.textContent="":oe.nodeType===9&&oe.documentElement&&oe.removeChild(oe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(pe){Ve(n,n.return,pe)}if(t=n.sibling,t!==null){t.return=n.return,me=t;break}me=n.return}return ve=sf,sf=!1,ve}function rs(t,n,s){var g=n.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var E=g=g.next;do{if((E.tag&t)===t){var T=E.destroy;E.destroy=void 0,T!==void 0&&gc(n,s,T)}E=E.next}while(E!==g)}}function Mo(t,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&t)===t){var g=s.create;s.destroy=g()}s=s.next}while(s!==n)}}function mc(t){var n=t.ref;if(n!==null){var s=t.stateNode;switch(t.tag){case 5:t=s;break;default:t=s}typeof n=="function"?n(t):n.current=t}}function of(t){var n=t.alternate;n!==null&&(t.alternate=null,of(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&(delete n[ir],delete n[Vi],delete n[Pl],delete n[l0],delete n[c0])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function af(t){return t.tag===5||t.tag===3||t.tag===4}function lf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||af(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function vc(t,n,s){var g=t.tag;if(g===5||g===6)t=t.stateNode,n?s.nodeType===8?s.parentNode.insertBefore(t,n):s.insertBefore(t,n):(s.nodeType===8?(n=s.parentNode,n.insertBefore(t,s)):(n=s,n.appendChild(t)),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=lo));else if(g!==4&&(t=t.child,t!==null))for(vc(t,n,s),t=t.sibling;t!==null;)vc(t,n,s),t=t.sibling}function yc(t,n,s){var g=t.tag;if(g===5||g===6)t=t.stateNode,n?s.insertBefore(t,n):s.appendChild(t);else if(g!==4&&(t=t.child,t!==null))for(yc(t,n,s),t=t.sibling;t!==null;)yc(t,n,s),t=t.sibling}var at=null,Kt=!1;function $r(t,n,s){for(s=s.child;s!==null;)cf(t,n,s),s=s.sibling}function cf(t,n,s){if(It&&typeof It.onCommitFiberUnmount=="function")try{It.onCommitFiberUnmount(sn,s)}catch{}switch(s.tag){case 5:pt||Zn(s,n);case 6:var g=at,E=Kt;at=null,$r(t,n,s),at=g,Kt=E,at!==null&&(Kt?(t=at,s=s.stateNode,t.nodeType===8?t.parentNode.removeChild(s):t.removeChild(s)):at.removeChild(s.stateNode));break;case 18:at!==null&&(Kt?(t=at,s=s.stateNode,t.nodeType===8?Ml(t.parentNode,s):t.nodeType===1&&Ml(t,s),Bi(t)):Ml(at,s.stateNode));break;case 4:g=at,E=Kt,at=s.stateNode.containerInfo,Kt=!0,$r(t,n,s),at=g,Kt=E;break;case 0:case 11:case 14:case 15:if(!pt&&(g=s.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){E=g=g.next;do{var T=E,$=T.destroy;T=T.tag,$!==void 0&&((T&2)!==0||(T&4)!==0)&&gc(s,n,$),E=E.next}while(E!==g)}$r(t,n,s);break;case 1:if(!pt&&(Zn(s,n),g=s.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=s.memoizedProps,g.state=s.memoizedState,g.componentWillUnmount()}catch(Y){Ve(s,n,Y)}$r(t,n,s);break;case 21:$r(t,n,s);break;case 22:s.mode&1?(pt=(g=pt)||s.memoizedState!==null,$r(t,n,s),pt=g):$r(t,n,s);break;default:$r(t,n,s)}}function uf(t){var n=t.updateQueue;if(n!==null){t.updateQueue=null;var s=t.stateNode;s===null&&(s=t.stateNode=new E0),n.forEach(function(g){var E=N0.bind(null,t,g);s.has(g)||(s.add(g),g.then(E,E))})}}function Xt(t,n){var s=n.deletions;if(s!==null)for(var g=0;g<s.length;g++){var E=s[g];try{var T=t,$=n,Y=$;e:for(;Y!==null;){switch(Y.tag){case 5:at=Y.stateNode,Kt=!1;break e;case 3:at=Y.stateNode.containerInfo,Kt=!0;break e;case 4:at=Y.stateNode.containerInfo,Kt=!0;break e}Y=Y.return}if(at===null)throw Error(i(160));cf(T,$,E),at=null,Kt=!1;var Q=E.alternate;Q!==null&&(Q.return=null),E.return=null}catch(ae){Ve(E,n,ae)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)hf(n,t),n=n.sibling}function hf(t,n){var s=t.alternate,g=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Xt(n,t),ar(t),g&4){try{rs(3,t,t.return),Mo(3,t)}catch(Se){Ve(t,t.return,Se)}try{rs(5,t,t.return)}catch(Se){Ve(t,t.return,Se)}}break;case 1:Xt(n,t),ar(t),g&512&&s!==null&&Zn(s,s.return);break;case 5:if(Xt(n,t),ar(t),g&512&&s!==null&&Zn(s,s.return),t.flags&32){var E=t.stateNode;try{tt(E,"")}catch(Se){Ve(t,t.return,Se)}}if(g&4&&(E=t.stateNode,E!=null)){var T=t.memoizedProps,$=s!==null?s.memoizedProps:T,Y=t.type,Q=t.updateQueue;if(t.updateQueue=null,Q!==null)try{Y==="input"&&T.type==="radio"&&T.name!=null&&xe(E,T),vi(Y,$);var ae=vi(Y,T);for($=0;$<Q.length;$+=2){var he=Q[$],de=Q[$+1];he==="style"?Ms(E,de):he==="dangerouslySetInnerHTML"?pr(E,de):he==="children"?tt(E,de):h(E,he,de,ae)}switch(Y){case"input":ge(E,T);break;case"textarea":Nt(E,T);break;case"select":var ue=E._wrapperState.wasMultiple;E._wrapperState.wasMultiple=!!T.multiple;var _e=T.value;_e!=null?ct(E,!!T.multiple,_e,!1):ue!==!!T.multiple&&(T.defaultValue!=null?ct(E,!!T.multiple,T.defaultValue,!0):ct(E,!!T.multiple,T.multiple?[]:"",!1))}E[Vi]=T}catch(Se){Ve(t,t.return,Se)}}break;case 6:if(Xt(n,t),ar(t),g&4){if(t.stateNode===null)throw Error(i(162));E=t.stateNode,T=t.memoizedProps;try{E.nodeValue=T}catch(Se){Ve(t,t.return,Se)}}break;case 3:if(Xt(n,t),ar(t),g&4&&s!==null&&s.memoizedState.isDehydrated)try{Bi(n.containerInfo)}catch(Se){Ve(t,t.return,Se)}break;case 4:Xt(n,t),ar(t);break;case 13:Xt(n,t),ar(t),E=t.child,E.flags&8192&&(T=E.memoizedState!==null,E.stateNode.isHidden=T,!T||E.alternate!==null&&E.alternate.memoizedState!==null||(Cc=$e())),g&4&&uf(t);break;case 22:if(he=s!==null&&s.memoizedState!==null,t.mode&1?(pt=(ae=pt)||he,Xt(n,t),pt=ae):Xt(n,t),ar(t),g&8192){if(ae=t.memoizedState!==null,(t.stateNode.isHidden=ae)&&!he&&(t.mode&1)!==0)for(me=t,he=t.child;he!==null;){for(de=me=he;me!==null;){switch(ue=me,_e=ue.child,ue.tag){case 0:case 11:case 14:case 15:rs(4,ue,ue.return);break;case 1:Zn(ue,ue.return);var ve=ue.stateNode;if(typeof ve.componentWillUnmount=="function"){g=ue,s=ue.return;try{n=g,ve.props=n.memoizedProps,ve.state=n.memoizedState,ve.componentWillUnmount()}catch(Se){Ve(g,s,Se)}}break;case 5:Zn(ue,ue.return);break;case 22:if(ue.memoizedState!==null){pf(de);continue}}_e!==null?(_e.return=ue,me=_e):pf(de)}he=he.sibling}e:for(he=null,de=t;;){if(de.tag===5){if(he===null){he=de;try{E=de.stateNode,ae?(T=E.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none"):(Y=de.stateNode,Q=de.memoizedProps.style,$=Q!=null&&Q.hasOwnProperty("display")?Q.display:null,Y.style.display=Ln("display",$))}catch(Se){Ve(t,t.return,Se)}}}else if(de.tag===6){if(he===null)try{de.stateNode.nodeValue=ae?"":de.memoizedProps}catch(Se){Ve(t,t.return,Se)}}else if((de.tag!==22&&de.tag!==23||de.memoizedState===null||de===t)&&de.child!==null){de.child.return=de,de=de.child;continue}if(de===t)break e;for(;de.sibling===null;){if(de.return===null||de.return===t)break e;he===de&&(he=null),de=de.return}he===de&&(he=null),de.sibling.return=de.return,de=de.sibling}}break;case 19:Xt(n,t),ar(t),g&4&&uf(t);break;case 21:break;default:Xt(n,t),ar(t)}}function ar(t){var n=t.flags;if(n&2){try{e:{for(var s=t.return;s!==null;){if(af(s)){var g=s;break e}s=s.return}throw Error(i(160))}switch(g.tag){case 5:var E=g.stateNode;g.flags&32&&(tt(E,""),g.flags&=-33);var T=lf(t);yc(t,T,E);break;case 3:case 4:var $=g.stateNode.containerInfo,Y=lf(t);vc(t,Y,$);break;default:throw Error(i(161))}}catch(Q){Ve(t,t.return,Q)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function L0(t,n,s){me=t,df(t)}function df(t,n,s){for(var g=(t.mode&1)!==0;me!==null;){var E=me,T=E.child;if(E.tag===22&&g){var $=E.memoizedState!==null||Ao;if(!$){var Y=E.alternate,Q=Y!==null&&Y.memoizedState!==null||pt;Y=Ao;var ae=pt;if(Ao=$,(pt=Q)&&!ae)for(me=E;me!==null;)$=me,Q=$.child,$.tag===22&&$.memoizedState!==null?_f(E):Q!==null?(Q.return=$,me=Q):_f(E);for(;T!==null;)me=T,df(T),T=T.sibling;me=E,Ao=Y,pt=ae}ff(t)}else(E.subtreeFlags&8772)!==0&&T!==null?(T.return=E,me=T):ff(t)}}function ff(t){for(;me!==null;){var n=me;if((n.flags&8772)!==0){var s=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:pt||Mo(5,n);break;case 1:var g=n.stateNode;if(n.flags&4&&!pt)if(s===null)g.componentDidMount();else{var E=n.elementType===n.type?s.memoizedProps:qt(n.type,s.memoizedProps);g.componentDidUpdate(E,s.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var T=n.updateQueue;T!==null&&fd(n,T,g);break;case 3:var $=n.updateQueue;if($!==null){if(s=null,n.child!==null)switch(n.child.tag){case 5:s=n.child.stateNode;break;case 1:s=n.child.stateNode}fd(n,$,s)}break;case 5:var Y=n.stateNode;if(s===null&&n.flags&4){s=Y;var Q=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":Q.autoFocus&&s.focus();break;case"img":Q.src&&(s.src=Q.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var ae=n.alternate;if(ae!==null){var he=ae.memoizedState;if(he!==null){var de=he.dehydrated;de!==null&&Bi(de)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}pt||n.flags&512&&mc(n)}catch(ue){Ve(n,n.return,ue)}}if(n===t){me=null;break}if(s=n.sibling,s!==null){s.return=n.return,me=s;break}me=n.return}}function pf(t){for(;me!==null;){var n=me;if(n===t){me=null;break}var s=n.sibling;if(s!==null){s.return=n.return,me=s;break}me=n.return}}function _f(t){for(;me!==null;){var n=me;try{switch(n.tag){case 0:case 11:case 15:var s=n.return;try{Mo(4,n)}catch(Q){Ve(n,s,Q)}break;case 1:var g=n.stateNode;if(typeof g.componentDidMount=="function"){var E=n.return;try{g.componentDidMount()}catch(Q){Ve(n,E,Q)}}var T=n.return;try{mc(n)}catch(Q){Ve(n,T,Q)}break;case 5:var $=n.return;try{mc(n)}catch(Q){Ve(n,$,Q)}}}catch(Q){Ve(n,n.return,Q)}if(n===t){me=null;break}var Y=n.sibling;if(Y!==null){Y.return=n.return,me=Y;break}me=n.return}}var R0=Math.ceil,Po=w.ReactCurrentDispatcher,wc=w.ReactCurrentOwner,zt=w.ReactCurrentBatchConfig,Ae=0,nt=null,Xe=null,lt=0,Mt=0,ei=Or(0),Je=0,ns=null,pn=0,Bo=0,Sc=0,is=null,Ct=null,Cc=0,ti=1/0,Cr=null,No=!1,xc=null,Wr=null,Io=!1,Ur=null,Oo=0,ss=0,bc=null,Ho=-1,Fo=0;function mt(){return(Ae&6)!==0?$e():Ho!==-1?Ho:Ho=$e()}function Vr(t){return(t.mode&1)===0?1:(Ae&2)!==0&<!==0?lt&-lt:h0.transition!==null?(Fo===0&&(Fo=Bn()),Fo):(t=Pe,t!==0||(t=window.event,t=t===void 0?16:gh(t.type)),t)}function Yt(t,n,s,g){if(50<ss)throw ss=0,bc=null,Error(i(185));on(t,s,g),((Ae&2)===0||t!==nt)&&(t===nt&&((Ae&2)===0&&(Bo|=s),Je===4&&qr(t,lt)),xt(t,g),s===1&&Ae===0&&(n.mode&1)===0&&(ti=$e()+500,fo&&Fr()))}function xt(t,n){var s=t.callbackNode;sl(t,n);var g=Pn(t,t===nt?lt:0);if(g===0)s!==null&&$s(s),t.callbackNode=null,t.callbackPriority=0;else if(n=g&-g,t.callbackPriority!==n){if(s!=null&&$s(s),n===1)t.tag===0?u0(mf.bind(null,t)):td(mf.bind(null,t)),o0(function(){(Ae&6)===0&&Fr()}),s=null;else{switch(lh(g)){case 1:s=Li;break;case 4:s=Us;break;case 16:s=Tn;break;case 536870912:s=Vs;break;default:s=Tn}s=Ef(s,gf.bind(null,t))}t.callbackPriority=n,t.callbackNode=s}}function gf(t,n){if(Ho=-1,Fo=0,(Ae&6)!==0)throw Error(i(327));var s=t.callbackNode;if(ri()&&t.callbackNode!==s)return null;var g=Pn(t,t===nt?lt:0);if(g===0)return null;if((g&30)!==0||(g&t.expiredLanes)!==0||n)n=jo(t,g);else{n=g;var E=Ae;Ae|=2;var T=yf();(nt!==t||lt!==n)&&(Cr=null,ti=$e()+500,gn(t,n));do try{A0();break}catch(Y){vf(t,Y)}while(!0);$l(),Po.current=T,Ae=E,Xe!==null?n=0:(nt=null,lt=0,n=Je)}if(n!==0){if(n===2&&(E=Ri(t),E!==0&&(g=E,n=Ec(t,E))),n===1)throw s=ns,gn(t,0),qr(t,g),xt(t,$e()),s;if(n===6)qr(t,g);else{if(E=t.current.alternate,(g&30)===0&&!D0(E)&&(n=jo(t,g),n===2&&(T=Ri(t),T!==0&&(g=T,n=Ec(t,T))),n===1))throw s=ns,gn(t,0),qr(t,g),xt(t,$e()),s;switch(t.finishedWork=E,t.finishedLanes=g,n){case 0:case 1:throw Error(i(345));case 2:mn(t,Ct,Cr);break;case 3:if(qr(t,g),(g&130023424)===g&&(n=Cc+500-$e(),10<n)){if(Pn(t,0)!==0)break;if(E=t.suspendedLanes,(E&g)!==g){mt(),t.pingedLanes|=t.suspendedLanes&E;break}t.timeoutHandle=Al(mn.bind(null,t,Ct,Cr),n);break}mn(t,Ct,Cr);break;case 4:if(qr(t,g),(g&4194240)===g)break;for(n=t.eventTimes,E=-1;0<g;){var $=31-Rt(g);T=1<<$,$=n[$],$>E&&(E=$),g&=~T}if(g=E,g=$e()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*R0(g/1960))-g,10<g){t.timeoutHandle=Al(mn.bind(null,t,Ct,Cr),g);break}mn(t,Ct,Cr);break;case 5:mn(t,Ct,Cr);break;default:throw Error(i(329))}}}return xt(t,$e()),t.callbackNode===s?gf.bind(null,t):null}function Ec(t,n){var s=is;return t.current.memoizedState.isDehydrated&&(gn(t,n).flags|=256),t=jo(t,n),t!==2&&(n=Ct,Ct=s,n!==null&&kc(n)),t}function kc(t){Ct===null?Ct=t:Ct.push.apply(Ct,t)}function D0(t){for(var n=t;;){if(n.flags&16384){var s=n.updateQueue;if(s!==null&&(s=s.stores,s!==null))for(var g=0;g<s.length;g++){var E=s[g],T=E.getSnapshot;E=E.value;try{if(!Ut(T(),E))return!1}catch{return!1}}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function qr(t,n){for(n&=~Sc,n&=~Bo,t.suspendedLanes|=n,t.pingedLanes&=~n,t=t.expirationTimes;0<n;){var s=31-Rt(n),g=1<<s;t[s]=-1,n&=~g}}function mf(t){if((Ae&6)!==0)throw Error(i(327));ri();var n=Pn(t,0);if((n&1)===0)return xt(t,$e()),null;var s=jo(t,n);if(t.tag!==0&&s===2){var g=Ri(t);g!==0&&(n=g,s=Ec(t,g))}if(s===1)throw s=ns,gn(t,0),qr(t,n),xt(t,$e()),s;if(s===6)throw Error(i(345));return t.finishedWork=t.current.alternate,t.finishedLanes=n,mn(t,Ct,Cr),xt(t,$e()),null}function Lc(t,n){var s=Ae;Ae|=1;try{return t(n)}finally{Ae=s,Ae===0&&(ti=$e()+500,fo&&Fr())}}function _n(t){Ur!==null&&Ur.tag===0&&(Ae&6)===0&&ri();var n=Ae;Ae|=1;var s=zt.transition,g=Pe;try{if(zt.transition=null,Pe=1,t)return t()}finally{Pe=g,zt.transition=s,Ae=n,(Ae&6)===0&&Fr()}}function Rc(){Mt=ei.current,He(ei)}function gn(t,n){t.finishedWork=null,t.finishedLanes=0;var s=t.timeoutHandle;if(s!==-1&&(t.timeoutHandle=-1,s0(s)),Xe!==null)for(s=Xe.return;s!==null;){var g=s;switch(Ol(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&uo();break;case 3:Qn(),He(yt),He(ht),Gl();break;case 5:Xl(g);break;case 4:Qn();break;case 13:He(We);break;case 19:He(We);break;case 10:Wl(g.type._context);break;case 22:case 23:Rc()}s=s.return}if(nt=t,Xe=t=Kr(t.current,null),lt=Mt=n,Je=0,ns=null,Sc=Bo=pn=0,Ct=is=null,hn!==null){for(n=0;n<hn.length;n++)if(s=hn[n],g=s.interleaved,g!==null){s.interleaved=null;var E=g.next,T=s.pending;if(T!==null){var $=T.next;T.next=E,g.next=$}s.pending=g}hn=null}return t}function vf(t,n){do{var s=Xe;try{if($l(),xo.current=Lo,bo){for(var g=Ue.memoizedState;g!==null;){var E=g.queue;E!==null&&(E.pending=null),g=g.next}bo=!1}if(fn=0,rt=Qe=Ue=null,Qi=!1,Ji=0,wc.current=null,s===null||s.return===null){Je=1,ns=n,Xe=null;break}e:{var T=t,$=s.return,Y=s,Q=n;if(n=lt,Y.flags|=32768,Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var ae=Q,he=Y,de=he.tag;if((he.mode&1)===0&&(de===0||de===11||de===15)){var ue=he.alternate;ue?(he.updateQueue=ue.updateQueue,he.memoizedState=ue.memoizedState,he.lanes=ue.lanes):(he.updateQueue=null,he.memoizedState=null)}var _e=$d($);if(_e!==null){_e.flags&=-257,Wd(_e,$,Y,T,n),_e.mode&1&&zd(T,ae,n),n=_e,Q=ae;var ve=n.updateQueue;if(ve===null){var Se=new Set;Se.add(Q),n.updateQueue=Se}else ve.add(Q);break e}else{if((n&1)===0){zd(T,ae,n),Dc();break e}Q=Error(i(426))}}else if(Fe&&Y.mode&1){var Ke=$d($);if(Ke!==null){(Ke.flags&65536)===0&&(Ke.flags|=256),Wd(Ke,$,Y,T,n),jl(Jn(Q,Y));break e}}T=Q=Jn(Q,Y),Je!==4&&(Je=2),is===null?is=[T]:is.push(T),T=$;do{switch(T.tag){case 3:T.flags|=65536,n&=-n,T.lanes|=n;var ie=Fd(T,Q,n);dd(T,ie);break e;case 1:Y=Q;var te=T.type,oe=T.stateNode;if((T.flags&128)===0&&(typeof te.getDerivedStateFromError=="function"||oe!==null&&typeof oe.componentDidCatch=="function"&&(Wr===null||!Wr.has(oe)))){T.flags|=65536,n&=-n,T.lanes|=n;var pe=jd(T,Y,n);dd(T,pe);break e}}T=T.return}while(T!==null)}Sf(s)}catch(Ce){n=Ce,Xe===s&&s!==null&&(Xe=s=s.return);continue}break}while(!0)}function yf(){var t=Po.current;return Po.current=Lo,t===null?Lo:t}function Dc(){(Je===0||Je===3||Je===2)&&(Je=4),nt===null||(pn&268435455)===0&&(Bo&268435455)===0||qr(nt,lt)}function jo(t,n){var s=Ae;Ae|=2;var g=yf();(nt!==t||lt!==n)&&(Cr=null,gn(t,n));do try{T0();break}catch(E){vf(t,E)}while(!0);if($l(),Ae=s,Po.current=g,Xe!==null)throw Error(i(261));return nt=null,lt=0,Je}function T0(){for(;Xe!==null;)wf(Xe)}function A0(){for(;Xe!==null&&!Ja();)wf(Xe)}function wf(t){var n=bf(t.alternate,t,Mt);t.memoizedProps=t.pendingProps,n===null?Sf(t):Xe=n,wc.current=null}function Sf(t){var n=t;do{var s=n.alternate;if(t=n.return,(n.flags&32768)===0){if(s=x0(s,n,Mt),s!==null){Xe=s;return}}else{if(s=b0(s,n),s!==null){s.flags&=32767,Xe=s;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Je=6,Xe=null;return}}if(n=n.sibling,n!==null){Xe=n;return}Xe=n=t}while(n!==null);Je===0&&(Je=5)}function mn(t,n,s){var g=Pe,E=zt.transition;try{zt.transition=null,Pe=1,M0(t,n,s,g)}finally{zt.transition=E,Pe=g}return null}function M0(t,n,s,g){do ri();while(Ur!==null);if((Ae&6)!==0)throw Error(i(327));s=t.finishedWork;var E=t.finishedLanes;if(s===null)return null;if(t.finishedWork=null,t.finishedLanes=0,s===t.current)throw Error(i(177));t.callbackNode=null,t.callbackPriority=0;var T=s.lanes|s.childLanes;if(Ks(t,T),t===nt&&(Xe=nt=null,lt=0),(s.subtreeFlags&2064)===0&&(s.flags&2064)===0||Io||(Io=!0,Ef(Tn,function(){return ri(),null})),T=(s.flags&15990)!==0,(s.subtreeFlags&15990)!==0||T){T=zt.transition,zt.transition=null;var $=Pe;Pe=1;var Y=Ae;Ae|=4,wc.current=null,k0(t,s),hf(s,t),Jm(Dl),Gs=!!Rl,Dl=Rl=null,t.current=s,L0(s),Ws(),Ae=Y,Pe=$,zt.transition=T}else t.current=s;if(Io&&(Io=!1,Ur=t,Oo=E),T=t.pendingLanes,T===0&&(Wr=null),tl(s.stateNode),xt(t,$e()),n!==null)for(g=t.onRecoverableError,s=0;s<n.length;s++)E=n[s],g(E.value,{componentStack:E.stack,digest:E.digest});if(No)throw No=!1,t=xc,xc=null,t;return(Oo&1)!==0&&t.tag!==0&&ri(),T=t.pendingLanes,(T&1)!==0?t===bc?ss++:(ss=0,bc=t):ss=0,Fr(),null}function ri(){if(Ur!==null){var t=lh(Oo),n=zt.transition,s=Pe;try{if(zt.transition=null,Pe=16>t?16:t,Ur===null)var g=!1;else{if(t=Ur,Ur=null,Oo=0,(Ae&6)!==0)throw Error(i(331));var E=Ae;for(Ae|=4,me=t.current;me!==null;){var T=me,$=T.child;if((me.flags&16)!==0){var Y=T.deletions;if(Y!==null){for(var Q=0;Q<Y.length;Q++){var ae=Y[Q];for(me=ae;me!==null;){var he=me;switch(he.tag){case 0:case 11:case 15:rs(8,he,T)}var de=he.child;if(de!==null)de.return=he,me=de;else for(;me!==null;){he=me;var ue=he.sibling,_e=he.return;if(of(he),he===ae){me=null;break}if(ue!==null){ue.return=_e,me=ue;break}me=_e}}}var ve=T.alternate;if(ve!==null){var Se=ve.child;if(Se!==null){ve.child=null;do{var Ke=Se.sibling;Se.sibling=null,Se=Ke}while(Se!==null)}}me=T}}if((T.subtreeFlags&2064)!==0&&$!==null)$.return=T,me=$;else e:for(;me!==null;){if(T=me,(T.flags&2048)!==0)switch(T.tag){case 0:case 11:case 15:rs(9,T,T.return)}var ie=T.sibling;if(ie!==null){ie.return=T.return,me=ie;break e}me=T.return}}var te=t.current;for(me=te;me!==null;){$=me;var oe=$.child;if(($.subtreeFlags&2064)!==0&&oe!==null)oe.return=$,me=oe;else e:for($=te;me!==null;){if(Y=me,(Y.flags&2048)!==0)try{switch(Y.tag){case 0:case 11:case 15:Mo(9,Y)}}catch(Ce){Ve(Y,Y.return,Ce)}if(Y===$){me=null;break e}var pe=Y.sibling;if(pe!==null){pe.return=Y.return,me=pe;break e}me=Y.return}}if(Ae=E,Fr(),It&&typeof It.onPostCommitFiberRoot=="function")try{It.onPostCommitFiberRoot(sn,t)}catch{}g=!0}return g}finally{Pe=s,zt.transition=n}}return!1}function Cf(t,n,s){n=Jn(s,n),n=Fd(t,n,1),t=zr(t,n,1),n=mt(),t!==null&&(on(t,1,n),xt(t,n))}function Ve(t,n,s){if(t.tag===3)Cf(t,t,s);else for(;n!==null;){if(n.tag===3){Cf(n,t,s);break}else if(n.tag===1){var g=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Wr===null||!Wr.has(g))){t=Jn(s,t),t=jd(n,t,1),n=zr(n,t,1),t=mt(),n!==null&&(on(n,1,t),xt(n,t));break}}n=n.return}}function P0(t,n,s){var g=t.pingCache;g!==null&&g.delete(n),n=mt(),t.pingedLanes|=t.suspendedLanes&s,nt===t&&(lt&s)===s&&(Je===4||Je===3&&(lt&130023424)===lt&&500>$e()-Cc?gn(t,0):Sc|=s),xt(t,n)}function xf(t,n){n===0&&((t.mode&1)===0?n=1:(n=Mn,Mn<<=1,(Mn&130023424)===0&&(Mn=4194304)));var s=mt();t=yr(t,n),t!==null&&(on(t,n,s),xt(t,s))}function B0(t){var n=t.memoizedState,s=0;n!==null&&(s=n.retryLane),xf(t,s)}function N0(t,n){var s=0;switch(t.tag){case 13:var g=t.stateNode,E=t.memoizedState;E!==null&&(s=E.retryLane);break;case 19:g=t.stateNode;break;default:throw Error(i(314))}g!==null&&g.delete(n),xf(t,s)}var bf;bf=function(t,n,s){if(t!==null)if(t.memoizedProps!==n.pendingProps||yt.current)St=!0;else{if((t.lanes&s)===0&&(n.flags&128)===0)return St=!1,C0(t,n,s);St=(t.flags&131072)!==0}else St=!1,Fe&&(n.flags&1048576)!==0&&rd(n,_o,n.index);switch(n.lanes=0,n.tag){case 2:var g=n.type;To(t,n),t=n.pendingProps;var E=Un(n,ht.current);Gn(n,s),E=Zl(null,n,g,t,E,s);var T=ec();return n.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,wt(g)?(T=!0,ho(n)):T=!1,n.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,ql(n),E.updater=Ro,n.stateNode=E,E._reactInternals=n,oc(n,g,t,s),n=uc(null,n,g,!0,T,s)):(n.tag=0,Fe&&T&&Il(n),gt(null,n,E,s),n=n.child),n;case 16:g=n.elementType;e:{switch(To(t,n),t=n.pendingProps,E=g._init,g=E(g._payload),n.type=g,E=n.tag=O0(g),t=qt(g,t),E){case 0:n=cc(null,n,g,t,s);break e;case 1:n=Yd(null,n,g,t,s);break e;case 11:n=Ud(null,n,g,t,s);break e;case 14:n=Vd(null,n,g,qt(g.type,t),s);break e}throw Error(i(306,g,""))}return n;case 0:return g=n.type,E=n.pendingProps,E=n.elementType===g?E:qt(g,E),cc(t,n,g,E,s);case 1:return g=n.type,E=n.pendingProps,E=n.elementType===g?E:qt(g,E),Yd(t,n,g,E,s);case 3:e:{if(Gd(n),t===null)throw Error(i(387));g=n.pendingProps,T=n.memoizedState,E=T.element,hd(t,n),So(n,g,null,s);var $=n.memoizedState;if(g=$.element,T.isDehydrated)if(T={element:g,isDehydrated:!1,cache:$.cache,pendingSuspenseBoundaries:$.pendingSuspenseBoundaries,transitions:$.transitions},n.updateQueue.baseState=T,n.memoizedState=T,n.flags&256){E=Jn(Error(i(423)),n),n=Qd(t,n,g,s,E);break e}else if(g!==E){E=Jn(Error(i(424)),n),n=Qd(t,n,g,s,E);break e}else for(At=Ir(n.stateNode.containerInfo.firstChild),Tt=n,Fe=!0,Vt=null,s=cd(n,null,g,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Kn(),g===E){n=Sr(t,n,s);break e}gt(t,n,g,s)}n=n.child}return n;case 5:return pd(n),t===null&&Fl(n),g=n.type,E=n.pendingProps,T=t!==null?t.memoizedProps:null,$=E.children,Tl(g,E)?$=null:T!==null&&Tl(g,T)&&(n.flags|=32),Xd(t,n),gt(t,n,$,s),n.child;case 6:return t===null&&Fl(n),null;case 13:return Jd(t,n,s);case 4:return Kl(n,n.stateNode.containerInfo),g=n.pendingProps,t===null?n.child=Xn(n,null,g,s):gt(t,n,g,s),n.child;case 11:return g=n.type,E=n.pendingProps,E=n.elementType===g?E:qt(g,E),Ud(t,n,g,E,s);case 7:return gt(t,n,n.pendingProps,s),n.child;case 8:return gt(t,n,n.pendingProps.children,s),n.child;case 12:return gt(t,n,n.pendingProps.children,s),n.child;case 10:e:{if(g=n.type._context,E=n.pendingProps,T=n.memoizedProps,$=E.value,Ne(vo,g._currentValue),g._currentValue=$,T!==null)if(Ut(T.value,$)){if(T.children===E.children&&!yt.current){n=Sr(t,n,s);break e}}else for(T=n.child,T!==null&&(T.return=n);T!==null;){var Y=T.dependencies;if(Y!==null){$=T.child;for(var Q=Y.firstContext;Q!==null;){if(Q.context===g){if(T.tag===1){Q=wr(-1,s&-s),Q.tag=2;var ae=T.updateQueue;if(ae!==null){ae=ae.shared;var he=ae.pending;he===null?Q.next=Q:(Q.next=he.next,he.next=Q),ae.pending=Q}}T.lanes|=s,Q=T.alternate,Q!==null&&(Q.lanes|=s),Ul(T.return,s,n),Y.lanes|=s;break}Q=Q.next}}else if(T.tag===10)$=T.type===n.type?null:T.child;else if(T.tag===18){if($=T.return,$===null)throw Error(i(341));$.lanes|=s,Y=$.alternate,Y!==null&&(Y.lanes|=s),Ul($,s,n),$=T.sibling}else $=T.child;if($!==null)$.return=T;else for($=T;$!==null;){if($===n){$=null;break}if(T=$.sibling,T!==null){T.return=$.return,$=T;break}$=$.return}T=$}gt(t,n,E.children,s),n=n.child}return n;case 9:return E=n.type,g=n.pendingProps.children,Gn(n,s),E=Ft(E),g=g(E),n.flags|=1,gt(t,n,g,s),n.child;case 14:return g=n.type,E=qt(g,n.pendingProps),E=qt(g.type,E),Vd(t,n,g,E,s);case 15:return qd(t,n,n.type,n.pendingProps,s);case 17:return g=n.type,E=n.pendingProps,E=n.elementType===g?E:qt(g,E),To(t,n),n.tag=1,wt(g)?(t=!0,ho(n)):t=!1,Gn(n,s),Od(n,g,E),oc(n,g,E,s),uc(null,n,g,!0,t,s);case 19:return ef(t,n,s);case 22:return Kd(t,n,s)}throw Error(i(156,n.tag))};function Ef(t,n){return zs(t,n)}function I0(t,n,s,g){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $t(t,n,s,g){return new I0(t,n,s,g)}function Tc(t){return t=t.prototype,!(!t||!t.isReactComponent)}function O0(t){if(typeof t=="function")return Tc(t)?1:0;if(t!=null){if(t=t.$$typeof,t===F)return 11;if(t===q)return 14}return 2}function Kr(t,n){var s=t.alternate;return s===null?(s=$t(t.tag,n,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=n,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&14680064,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,n=t.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s}function zo(t,n,s,g,E,T){var $=2;if(g=t,typeof t=="function")Tc(t)&&($=1);else if(typeof t=="string")$=5;else e:switch(t){case D:return vn(s.children,E,T,n);case k:$=8,E|=8;break;case M:return t=$t(12,s,n,E|2),t.elementType=M,t.lanes=T,t;case N:return t=$t(13,s,n,E),t.elementType=N,t.lanes=T,t;case I:return t=$t(19,s,n,E),t.elementType=I,t.lanes=T,t;case K:return $o(s,E,T,n);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case W:$=10;break e;case z:$=9;break e;case F:$=11;break e;case q:$=14;break e;case V:$=16,g=null;break e}throw Error(i(130,t==null?t:typeof t,""))}return n=$t($,s,n,E),n.elementType=t,n.type=g,n.lanes=T,n}function vn(t,n,s,g){return t=$t(7,t,g,n),t.lanes=s,t}function $o(t,n,s,g){return t=$t(22,t,g,n),t.elementType=K,t.lanes=s,t.stateNode={isHidden:!1},t}function Ac(t,n,s){return t=$t(6,t,null,n),t.lanes=s,t}function Mc(t,n,s){return n=$t(4,t.children!==null?t.children:[],t.key,n),n.lanes=s,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}function H0(t,n,s,g,E){this.tag=n,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Di(0),this.expirationTimes=Di(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Di(0),this.identifierPrefix=g,this.onRecoverableError=E,this.mutableSourceEagerHydrationData=null}function Pc(t,n,s,g,E,T,$,Y,Q){return t=new H0(t,n,s,Y,Q),n===1?(n=1,T===!0&&(n|=8)):n=0,T=$t(3,null,null,n),t.current=T,T.stateNode=t,T.memoizedState={element:g,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},ql(T),t}function F0(t,n,s){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:g==null?null:""+g,children:t,containerInfo:n,implementation:s}}function kf(t){if(!t)return Hr;t=t._reactInternals;e:{if(rr(t)!==t||t.tag!==1)throw Error(i(170));var n=t;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(wt(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(i(171))}if(t.tag===1){var s=t.type;if(wt(s))return Zh(t,s,n)}return n}function Lf(t,n,s,g,E,T,$,Y,Q){return t=Pc(s,g,!0,t,E,T,$,Y,Q),t.context=kf(null),s=t.current,g=mt(),E=Vr(s),T=wr(g,E),T.callback=n??null,zr(s,T,E),t.current.lanes=E,on(t,E,g),xt(t,g),t}function Wo(t,n,s,g){var E=n.current,T=mt(),$=Vr(E);return s=kf(s),n.context===null?n.context=s:n.pendingContext=s,n=wr(T,$),n.payload={element:t},g=g===void 0?null:g,g!==null&&(n.callback=g),t=zr(E,n,$),t!==null&&(Yt(t,E,$,T),wo(t,E,$)),$}function Uo(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function Rf(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function Bc(t,n){Rf(t,n),(t=t.alternate)&&Rf(t,n)}function j0(){return null}var Df=typeof reportError=="function"?reportError:function(t){console.error(t)};function Nc(t){this._internalRoot=t}Vo.prototype.render=Nc.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(i(409));Wo(t,n,null,null)},Vo.prototype.unmount=Nc.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;_n(function(){Wo(null,t,null,null)}),n[_r]=null}};function Vo(t){this._internalRoot=t}Vo.prototype.unstable_scheduleHydration=function(t){if(t){var n=hh();t={blockedOn:null,target:t,priority:n};for(var s=0;s<Pr.length&&n!==0&&n<Pr[s].priority;s++);Pr.splice(s,0,t),s===0&&ph(t)}};function Ic(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function qo(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Tf(){}function z0(t,n,s,g,E){if(E){if(typeof g=="function"){var T=g;g=function(){var ae=Uo($);T.call(ae)}}var $=Lf(n,g,t,0,null,!1,!1,"",Tf);return t._reactRootContainer=$,t[_r]=$.current,Wi(t.nodeType===8?t.parentNode:t),_n(),$}for(;E=t.lastChild;)t.removeChild(E);if(typeof g=="function"){var Y=g;g=function(){var ae=Uo(Q);Y.call(ae)}}var Q=Pc(t,0,!1,null,null,!1,!1,"",Tf);return t._reactRootContainer=Q,t[_r]=Q.current,Wi(t.nodeType===8?t.parentNode:t),_n(function(){Wo(n,Q,s,g)}),Q}function Ko(t,n,s,g,E){var T=s._reactRootContainer;if(T){var $=T;if(typeof E=="function"){var Y=E;E=function(){var Q=Uo($);Y.call(Q)}}Wo(n,$,t,E)}else $=z0(s,n,t,E,g);return Uo($)}ch=function(t){switch(t.tag){case 3:var n=t.stateNode;if(n.current.memoizedState.isDehydrated){var s=nr(n.pendingLanes);s!==0&&(ol(n,s|1),xt(n,$e()),(Ae&6)===0&&(ti=$e()+500,Fr()))}break;case 13:_n(function(){var g=yr(t,1);if(g!==null){var E=mt();Yt(g,t,1,E)}}),Bc(t,1)}},al=function(t){if(t.tag===13){var n=yr(t,134217728);if(n!==null){var s=mt();Yt(n,t,134217728,s)}Bc(t,134217728)}},uh=function(t){if(t.tag===13){var n=Vr(t),s=yr(t,n);if(s!==null){var g=mt();Yt(s,t,n,g)}Bc(t,n)}},hh=function(){return Pe},dh=function(t,n){var s=Pe;try{return Pe=t,n()}finally{Pe=s}},Si=function(t,n,s){switch(n){case"input":if(ge(t,s),n=s.name,s.type==="radio"&&n!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<s.length;n++){var g=s[n];if(g!==t&&g.form===t.form){var E=co(g);if(!E)throw Error(i(90));le(g),ge(g,E)}}}break;case"textarea":Nt(t,s);break;case"select":n=s.value,n!=null&&ct(t,!!s.multiple,n,!1)}},Is=Lc,Os=_n;var $0={usingClientEntryPoint:!1,Events:[qi,$n,co,Bs,Ns,Lc]},os={findFiberByHostInstance:an,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},W0={bundleType:os.bundleType,version:os.version,rendererPackageName:os.rendererPackageName,rendererConfig:os.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Fs(t),t===null?null:t.stateNode},findFiberByHostInstance:os.findFiberByHostInstance||j0,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 Xo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xo.isDisabled&&Xo.supportsFiber)try{sn=Xo.inject(W0),It=Xo}catch{}}return bt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$0,bt.createPortal=function(t,n){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ic(n))throw Error(i(200));return F0(t,n,null,s)},bt.createRoot=function(t,n){if(!Ic(t))throw Error(i(299));var s=!1,g="",E=Df;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(g=n.identifierPrefix),n.onRecoverableError!==void 0&&(E=n.onRecoverableError)),n=Pc(t,1,!1,null,null,s,!1,g,E),t[_r]=n.current,Wi(t.nodeType===8?t.parentNode:t),new Nc(n)},bt.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(i(188)):(t=Object.keys(t).join(","),Error(i(268,t)));return t=Fs(n),t=t===null?null:t.stateNode,t},bt.flushSync=function(t){return _n(t)},bt.hydrate=function(t,n,s){if(!qo(n))throw Error(i(200));return Ko(null,t,n,!0,s)},bt.hydrateRoot=function(t,n,s){if(!Ic(t))throw Error(i(405));var g=s!=null&&s.hydratedSources||null,E=!1,T="",$=Df;if(s!=null&&(s.unstable_strictMode===!0&&(E=!0),s.identifierPrefix!==void 0&&(T=s.identifierPrefix),s.onRecoverableError!==void 0&&($=s.onRecoverableError)),n=Lf(n,null,t,1,s??null,E,!1,T,$),t[_r]=n.current,Wi(t),g)for(t=0;t<g.length;t++)s=g[t],E=s._getVersion,E=E(s._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[s,E]:n.mutableSourceEagerHydrationData.push(s,E);return new Vo(n)},bt.render=function(t,n,s){if(!qo(n))throw Error(i(200));return Ko(null,t,n,!1,s)},bt.unmountComponentAtNode=function(t){if(!qo(t))throw Error(i(40));return t._reactRootContainer?(_n(function(){Ko(null,null,t,!1,function(){t._reactRootContainer=null,t[_r]=null})}),!0):!1},bt.unstable_batchedUpdates=Lc,bt.unstable_renderSubtreeIntoContainer=function(t,n,s,g){if(!qo(s))throw Error(i(200));if(t==null||t._reactInternals===void 0)throw Error(i(38));return Ko(t,n,s,!1,g)},bt.version="18.3.1-next-f1338f8080-20240426",bt}var Hf;function t_(){if(Hf)return Fc.exports;Hf=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),Fc.exports=G0(),Fc.exports}var Ff;function Q0(){if(Ff)return Yo;Ff=1;var e=t_();return Yo.createRoot=e.createRoot,Yo.hydrateRoot=e.hydrateRoot,Yo}var J0=Q0();const Z0=Iu(J0),hr=Object.create(null);hr.open="0";hr.close="1";hr.ping="2";hr.pong="3";hr.message="4";hr.upgrade="5";hr.noop="6";const la=Object.create(null);Object.keys(hr).forEach(e=>{la[hr[e]]=e});const hu={type:"error",data:"parser error"},r_=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",n_=typeof ArrayBuffer=="function",i_=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Hu=({type:e,data:r},i,o)=>r_&&r instanceof Blob?i?o(r):jf(r,o):n_&&(r instanceof ArrayBuffer||i_(r))?i?o(r):jf(new Blob([r]),o):o(hr[e]+(r||"")),jf=(e,r)=>{const i=new FileReader;return i.onload=function(){const o=i.result.split(",")[1];r("b"+(o||""))},i.readAsDataURL(e)};function zf(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let $c;function ev(e,r){if(r_&&e.data instanceof Blob)return e.data.arrayBuffer().then(zf).then(r);if(n_&&(e.data instanceof ArrayBuffer||i_(e.data)))return r(zf(e.data));Hu(e,!1,i=>{$c||($c=new TextEncoder),r($c.encode(i))})}const $f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",hs=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<$f.length;e++)hs[$f.charCodeAt(e)]=e;const tv=e=>{let r=e.length*.75,i=e.length,o,u=0,S,y,a,c;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);const _=new ArrayBuffer(r),v=new Uint8Array(_);for(o=0;o<i;o+=4)S=hs[e.charCodeAt(o)],y=hs[e.charCodeAt(o+1)],a=hs[e.charCodeAt(o+2)],c=hs[e.charCodeAt(o+3)],v[u++]=S<<2|y>>4,v[u++]=(y&15)<<4|a>>2,v[u++]=(a&3)<<6|c&63;return _},rv=typeof ArrayBuffer=="function",Fu=(e,r)=>{if(typeof e!="string")return{type:"message",data:s_(e,r)};const i=e.charAt(0);return i==="b"?{type:"message",data:nv(e.substring(1),r)}:la[i]?e.length>1?{type:la[i],data:e.substring(1)}:{type:la[i]}:hu},nv=(e,r)=>{if(rv){const i=tv(e);return s_(i,r)}else return{base64:!0,data:e}},s_=(e,r)=>{switch(r){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},o_="",iv=(e,r)=>{const i=e.length,o=new Array(i);let u=0;e.forEach((S,y)=>{Hu(S,!1,a=>{o[y]=a,++u===i&&r(o.join(o_))})})},sv=(e,r)=>{const i=e.split(o_),o=[];for(let u=0;u<i.length;u++){const S=Fu(i[u],r);if(o.push(S),S.type==="error")break}return o};function ov(){return new TransformStream({transform(e,r){ev(e,i=>{const o=i.length;let u;if(o<126)u=new Uint8Array(1),new DataView(u.buffer).setUint8(0,o);else if(o<65536){u=new Uint8Array(3);const S=new DataView(u.buffer);S.setUint8(0,126),S.setUint16(1,o)}else{u=new Uint8Array(9);const S=new DataView(u.buffer);S.setUint8(0,127),S.setBigUint64(1,BigInt(o))}e.data&&typeof e.data!="string"&&(u[0]|=128),r.enqueue(u),r.enqueue(i)})}})}let Wc;function Go(e){return e.reduce((r,i)=>r+i.length,0)}function Qo(e,r){if(e[0].length===r)return e.shift();const i=new Uint8Array(r);let o=0;for(let u=0;u<r;u++)i[u]=e[0][o++],o===e[0].length&&(e.shift(),o=0);return e.length&&o<e[0].length&&(e[0]=e[0].slice(o)),i}function av(e,r){Wc||(Wc=new TextDecoder);const i=[];let o=0,u=-1,S=!1;return new TransformStream({transform(y,a){for(i.push(y);;){if(o===0){if(Go(i)<1)break;const c=Qo(i,1);S=(c[0]&128)===128,u=c[0]&127,u<126?o=3:u===126?o=1:o=2}else if(o===1){if(Go(i)<2)break;const c=Qo(i,2);u=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),o=3}else if(o===2){if(Go(i)<8)break;const c=Qo(i,8),_=new DataView(c.buffer,c.byteOffset,c.length),v=_.getUint32(0);if(v>Math.pow(2,21)-1){a.enqueue(hu);break}u=v*Math.pow(2,32)+_.getUint32(4),o=3}else{if(Go(i)<u)break;const c=Qo(i,u);a.enqueue(Fu(S?c:Wc.decode(c),r)),o=0}if(u===0||u>e){a.enqueue(hu);break}}}})}const a_=4;function Ye(e){if(e)return lv(e)}function lv(e){for(var r in Ye.prototype)e[r]=Ye.prototype[r];return e}Ye.prototype.on=Ye.prototype.addEventListener=function(e,r){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(r),this};Ye.prototype.once=function(e,r){function i(){this.off(e,i),r.apply(this,arguments)}return i.fn=r,this.on(e,i),this};Ye.prototype.off=Ye.prototype.removeListener=Ye.prototype.removeAllListeners=Ye.prototype.removeEventListener=function(e,r){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+e];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var o,u=0;u<i.length;u++)if(o=i[u],o===r||o.fn===r){i.splice(u,1);break}return i.length===0&&delete this._callbacks["$"+e],this};Ye.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var r=new Array(arguments.length-1),i=this._callbacks["$"+e],o=1;o<arguments.length;o++)r[o-1]=arguments[o];if(i){i=i.slice(0);for(var o=0,u=i.length;o<u;++o)i[o].apply(this,r)}return this};Ye.prototype.emitReserved=Ye.prototype.emit;Ye.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Ye.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Ma=typeof Promise=="function"&&typeof Promise.resolve=="function"?r=>Promise.resolve().then(r):(r,i)=>i(r,0),Wt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),cv="arraybuffer";function l_(e,...r){return r.reduce((i,o)=>(e.hasOwnProperty(o)&&(i[o]=e[o]),i),{})}const uv=Wt.setTimeout,hv=Wt.clearTimeout;function Pa(e,r){r.useNativeTimers?(e.setTimeoutFn=uv.bind(Wt),e.clearTimeoutFn=hv.bind(Wt)):(e.setTimeoutFn=Wt.setTimeout.bind(Wt),e.clearTimeoutFn=Wt.clearTimeout.bind(Wt))}const dv=1.33;function fv(e){return typeof e=="string"?pv(e):Math.ceil((e.byteLength||e.size)*dv)}function pv(e){let r=0,i=0;for(let o=0,u=e.length;o<u;o++)r=e.charCodeAt(o),r<128?i+=1:r<2048?i+=2:r<55296||r>=57344?i+=3:(o++,i+=4);return i}function c_(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function _v(e){let r="";for(let i in e)e.hasOwnProperty(i)&&(r.length&&(r+="&"),r+=encodeURIComponent(i)+"="+encodeURIComponent(e[i]));return r}function gv(e){let r={},i=e.split("&");for(let o=0,u=i.length;o<u;o++){let S=i[o].split("=");r[decodeURIComponent(S[0])]=decodeURIComponent(S[1])}return r}class mv extends Error{constructor(r,i,o){super(r),this.description=i,this.context=o,this.type="TransportError"}}class ju extends Ye{constructor(r){super(),this.writable=!1,Pa(this,r),this.opts=r,this.query=r.query,this.socket=r.socket,this.supportsBinary=!r.forceBase64}onError(r,i,o){return super.emitReserved("error",new mv(r,i,o)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(r){this.readyState==="open"&&this.write(r)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(r){const i=Fu(r,this.socket.binaryType);this.onPacket(i)}onPacket(r){super.emitReserved("packet",r)}onClose(r){this.readyState="closed",super.emitReserved("close",r)}pause(r){}createUri(r,i={}){return r+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){const r=this.opts.hostname;return r.indexOf(":")===-1?r:"["+r+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(r){const i=_v(r);return i.length?"?"+i:""}}class vv extends ju{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(r){this.readyState="pausing";const i=()=>{this.readyState="paused",r()};if(this._polling||!this.writable){let o=0;this._polling&&(o++,this.once("pollComplete",function(){--o||i()})),this.writable||(o++,this.once("drain",function(){--o||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(r){const i=o=>{if(this.readyState==="opening"&&o.type==="open"&&this.onOpen(),o.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(o)};sv(r,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const r=()=>{this.write([{type:"close"}])};this.readyState==="open"?r():this.once("open",r)}write(r){this.writable=!1,iv(r,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const r=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=c_()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(r,i)}}let u_=!1;try{u_=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const yv=u_;function wv(){}class Sv extends vv{constructor(r){if(super(r),typeof location<"u"){const i=location.protocol==="https:";let o=location.port;o||(o=i?"443":"80"),this.xd=typeof location<"u"&&r.hostname!==location.hostname||o!==r.port}}doWrite(r,i){const o=this.request({method:"POST",data:r});o.on("success",i),o.on("error",(u,S)=>{this.onError("xhr post error",u,S)})}doPoll(){const r=this.request();r.on("data",this.onData.bind(this)),r.on("error",(i,o)=>{this.onError("xhr poll error",i,o)}),this.pollXhr=r}}class cr extends Ye{constructor(r,i,o){super(),this.createRequest=r,Pa(this,o),this._opts=o,this._method=o.method||"GET",this._uri=i,this._data=o.data!==void 0?o.data:null,this._create()}_create(){var r;const i=l_(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;const o=this._xhr=this.createRequest(i);try{o.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){o.setDisableHeaderCheck&&o.setDisableHeaderCheck(!0);for(let u in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(u)&&o.setRequestHeader(u,this._opts.extraHeaders[u])}}catch{}if(this._method==="POST")try{o.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{o.setRequestHeader("Accept","*/*")}catch{}(r=this._opts.cookieJar)===null||r===void 0||r.addCookies(o),"withCredentials"in o&&(o.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(o.timeout=this._opts.requestTimeout),o.onreadystatechange=()=>{var u;o.readyState===3&&((u=this._opts.cookieJar)===null||u===void 0||u.parseCookies(o.getResponseHeader("set-cookie"))),o.readyState===4&&(o.status===200||o.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof o.status=="number"?o.status:0)},0))},o.send(this._data)}catch(u){this.setTimeoutFn(()=>{this._onError(u)},0);return}typeof document<"u"&&(this._index=cr.requestsCount++,cr.requests[this._index]=this)}_onError(r){this.emitReserved("error",r,this._xhr),this._cleanup(!0)}_cleanup(r){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=wv,r)try{this._xhr.abort()}catch{}typeof document<"u"&&delete cr.requests[this._index],this._xhr=null}}_onLoad(){const r=this._xhr.responseText;r!==null&&(this.emitReserved("data",r),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}cr.requestsCount=0;cr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Wf);else if(typeof addEventListener=="function"){const e="onpagehide"in Wt?"pagehide":"unload";addEventListener(e,Wf,!1)}}function Wf(){for(let e in cr.requests)cr.requests.hasOwnProperty(e)&&cr.requests[e].abort()}const Cv=(function(){const e=h_({xdomain:!1});return e&&e.responseType!==null})();class xv extends Sv{constructor(r){super(r);const i=r&&r.forceBase64;this.supportsBinary=Cv&&!i}request(r={}){return Object.assign(r,{xd:this.xd},this.opts),new cr(h_,this.uri(),r)}}function h_(e){const r=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!r||yv))return new XMLHttpRequest}catch{}if(!r)try{return new Wt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const d_=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class bv extends ju{get name(){return"websocket"}doOpen(){const r=this.uri(),i=this.opts.protocols,o=d_?{}:l_(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(o.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(r,i,o)}catch(u){return this.emitReserved("error",u)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=r=>this.onClose({description:"websocket connection closed",context:r}),this.ws.onmessage=r=>this.onData(r.data),this.ws.onerror=r=>this.onError("websocket error",r)}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const o=r[i],u=i===r.length-1;Hu(o,this.supportsBinary,S=>{try{this.doWrite(o,S)}catch{}u&&Ma(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const r=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=c_()),this.supportsBinary||(i.b64=1),this.createUri(r,i)}}const Uc=Wt.WebSocket||Wt.MozWebSocket;class Ev extends bv{createSocket(r,i,o){return d_?new Uc(r,i,o):i?new Uc(r,i):new Uc(r)}doWrite(r,i){this.ws.send(i)}}class kv extends ju{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(r){return this.emitReserved("error",r)}this._transport.closed.then(()=>{this.onClose()}).catch(r=>{this.onError("webtransport error",r)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(r=>{const i=av(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=r.readable.pipeThrough(i).getReader(),u=ov();u.readable.pipeTo(r.writable),this._writer=u.writable.getWriter();const S=()=>{o.read().then(({done:a,value:c})=>{a||(this.onPacket(c),S())}).catch(a=>{})};S();const y={type:"open"};this.query.sid&&(y.data=`{"sid":"${this.query.sid}"}`),this._writer.write(y).then(()=>this.onOpen())})})}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const o=r[i],u=i===r.length-1;this._writer.write(o).then(()=>{u&&Ma(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var r;(r=this._transport)===null||r===void 0||r.close()}}const Lv={websocket:Ev,webtransport:kv,polling:xv},Rv=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Dv=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function du(e){if(e.length>8e3)throw"URI too long";const r=e,i=e.indexOf("["),o=e.indexOf("]");i!=-1&&o!=-1&&(e=e.substring(0,i)+e.substring(i,o).replace(/:/g,";")+e.substring(o,e.length));let u=Rv.exec(e||""),S={},y=14;for(;y--;)S[Dv[y]]=u[y]||"";return i!=-1&&o!=-1&&(S.source=r,S.host=S.host.substring(1,S.host.length-1).replace(/;/g,":"),S.authority=S.authority.replace("[","").replace("]","").replace(/;/g,":"),S.ipv6uri=!0),S.pathNames=Tv(S,S.path),S.queryKey=Av(S,S.query),S}function Tv(e,r){const i=/\/{2,9}/g,o=r.replace(i,"/").split("/");return(r.slice(0,1)=="/"||r.length===0)&&o.splice(0,1),r.slice(-1)=="/"&&o.splice(o.length-1,1),o}function Av(e,r){const i={};return r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,u,S){u&&(i[u]=S)}),i}const fu=typeof addEventListener=="function"&&typeof removeEventListener=="function",ca=[];fu&&addEventListener("offline",()=>{ca.forEach(e=>e())},!1);class Zr extends Ye{constructor(r,i){if(super(),this.binaryType=cv,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,r&&typeof r=="object"&&(i=r,r=null),r){const o=du(r);i.hostname=o.host,i.secure=o.protocol==="https"||o.protocol==="wss",i.port=o.port,o.query&&(i.query=o.query)}else i.host&&(i.hostname=du(i.host).host);Pa(this,i),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(o=>{const u=o.prototype.name;this.transports.push(u),this._transportsByName[u]=o}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=gv(this.opts.query)),fu&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ca.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(r){const i=Object.assign({},this.opts.query);i.EIO=a_,i.transport=r,this.id&&(i.sid=this.id);const o=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[r]);return new this._transportsByName[r](o)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const r=this.opts.rememberUpgrade&&Zr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const i=this.createTransport(r);i.open(),this.setTransport(i)}setTransport(r){this.transport&&this.transport.removeAllListeners(),this.transport=r,r.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",i=>this._onClose("transport close",i))}onOpen(){this.readyState="open",Zr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",r),this.emitReserved("heartbeat"),r.type){case"open":this.onHandshake(JSON.parse(r.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const i=new Error("server error");i.code=r.data,this._onError(i);break;case"message":this.emitReserved("data",r.data),this.emitReserved("message",r.data);break}}onHandshake(r){this.emitReserved("handshake",r),this.id=r.sid,this.transport.query.sid=r.sid,this._pingInterval=r.pingInterval,this._pingTimeout=r.pingTimeout,this._maxPayload=r.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const r=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+r,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},r),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const r=this._getWritablePackets();this.transport.send(r),this._prevBufferLen=r.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let o=0;o<this.writeBuffer.length;o++){const u=this.writeBuffer[o].data;if(u&&(i+=fv(u)),o>0&&i>this._maxPayload)return this.writeBuffer.slice(0,o);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const r=Date.now()>this._pingTimeoutTime;return r&&(this._pingTimeoutTime=0,Ma(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),r}write(r,i,o){return this._sendPacket("message",r,i,o),this}send(r,i,o){return this._sendPacket("message",r,i,o),this}_sendPacket(r,i,o,u){if(typeof i=="function"&&(u=i,i=void 0),typeof o=="function"&&(u=o,o=null),this.readyState==="closing"||this.readyState==="closed")return;o=o||{},o.compress=o.compress!==!1;const S={type:r,data:i,options:o};this.emitReserved("packetCreate",S),this.writeBuffer.push(S),u&&this.once("flush",u),this.flush()}close(){const r=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),r()},o=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?o():r()}):this.upgrading?o():r()),this}_onError(r){if(Zr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",r),this._onClose("transport error",r)}_onClose(r,i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),fu&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const o=ca.indexOf(this._offlineEventListener);o!==-1&&ca.splice(o,1)}this.readyState="closed",this.id=null,this.emitReserved("close",r,i),this.writeBuffer=[],this._prevBufferLen=0}}}Zr.protocol=a_;class Mv extends Zr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let r=0;r<this._upgrades.length;r++)this._probe(this._upgrades[r])}_probe(r){let i=this.createTransport(r),o=!1;Zr.priorWebsocketSuccess=!1;const u=()=>{o||(i.send([{type:"ping",data:"probe"}]),i.once("packet",l=>{if(!o)if(l.type==="pong"&&l.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;Zr.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{o||this.readyState!=="closed"&&(v(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=i.name,this.emitReserved("upgradeError",m)}}))};function S(){o||(o=!0,v(),i.close(),i=null)}const y=l=>{const m=new Error("probe error: "+l);m.transport=i.name,S(),this.emitReserved("upgradeError",m)};function a(){y("transport closed")}function c(){y("socket closed")}function _(l){i&&l.name!==i.name&&S()}const v=()=>{i.removeListener("open",u),i.removeListener("error",y),i.removeListener("close",a),this.off("close",c),this.off("upgrading",_)};i.once("open",u),i.once("error",y),i.once("close",a),this.once("close",c),this.once("upgrading",_),this._upgrades.indexOf("webtransport")!==-1&&r!=="webtransport"?this.setTimeoutFn(()=>{o||i.open()},200):i.open()}onHandshake(r){this._upgrades=this._filterUpgrades(r.upgrades),super.onHandshake(r)}_filterUpgrades(r){const i=[];for(let o=0;o<r.length;o++)~this.transports.indexOf(r[o])&&i.push(r[o]);return i}}let Pv=class extends Mv{constructor(r,i={}){const o=typeof r=="object"?r:i;(!o.transports||o.transports&&typeof o.transports[0]=="string")&&(o.transports=(o.transports||["polling","websocket","webtransport"]).map(u=>Lv[u]).filter(u=>!!u)),super(r,o)}};function Bv(e,r="",i){let o=e;i=i||typeof location<"u"&&location,e==null&&(e=i.protocol+"//"+i.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=i.protocol+e:e=i.host+e),/^(https?|wss?):\/\//.test(e)||(typeof i<"u"?e=i.protocol+"//"+e:e="https://"+e),o=du(e)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";const S=o.host.indexOf(":")!==-1?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+S+":"+o.port+r,o.href=o.protocol+"://"+S+(i&&i.port===o.port?"":":"+o.port),o}const Nv=typeof ArrayBuffer=="function",Iv=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,f_=Object.prototype.toString,Ov=typeof Blob=="function"||typeof Blob<"u"&&f_.call(Blob)==="[object BlobConstructor]",Hv=typeof File=="function"||typeof File<"u"&&f_.call(File)==="[object FileConstructor]";function zu(e){return Nv&&(e instanceof ArrayBuffer||Iv(e))||Ov&&e instanceof Blob||Hv&&e instanceof File}function ua(e,r){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let i=0,o=e.length;i<o;i++)if(ua(e[i]))return!0;return!1}if(zu(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return ua(e.toJSON(),!0);for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&ua(e[i]))return!0;return!1}function Fv(e){const r=[],i=e.data,o=e;return o.data=pu(i,r),o.attachments=r.length,{packet:o,buffers:r}}function pu(e,r){if(!e)return e;if(zu(e)){const i={_placeholder:!0,num:r.length};return r.push(e),i}else if(Array.isArray(e)){const i=new Array(e.length);for(let o=0;o<e.length;o++)i[o]=pu(e[o],r);return i}else if(typeof e=="object"&&!(e instanceof Date)){const i={};for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=pu(e[o],r));return i}return e}function jv(e,r){return e.data=_u(e.data,r),delete e.attachments,e}function _u(e,r){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<r.length)return r[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i]=_u(e[i],r);else if(typeof e=="object")for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(e[i]=_u(e[i],r));return e}const zv=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var De;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(De||(De={}));class $v{constructor(r){this.replacer=r}encode(r){return(r.type===De.EVENT||r.type===De.ACK)&&ua(r)?this.encodeAsBinary({type:r.type===De.EVENT?De.BINARY_EVENT:De.BINARY_ACK,nsp:r.nsp,data:r.data,id:r.id}):[this.encodeAsString(r)]}encodeAsString(r){let i=""+r.type;return(r.type===De.BINARY_EVENT||r.type===De.BINARY_ACK)&&(i+=r.attachments+"-"),r.nsp&&r.nsp!=="/"&&(i+=r.nsp+","),r.id!=null&&(i+=r.id),r.data!=null&&(i+=JSON.stringify(r.data,this.replacer)),i}encodeAsBinary(r){const i=Fv(r),o=this.encodeAsString(i.packet),u=i.buffers;return u.unshift(o),u}}class $u extends Ye{constructor(r){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof r=="function"?{reviver:r}:r)}add(r){let i;if(typeof r=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(r);const o=i.type===De.BINARY_EVENT;o||i.type===De.BINARY_ACK?(i.type=o?De.EVENT:De.ACK,this.reconstructor=new Wv(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(zu(r)||r.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(r),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+r)}decodeString(r){let i=0;const o={type:Number(r.charAt(0))};if(De[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===De.BINARY_EVENT||o.type===De.BINARY_ACK){const S=i+1;for(;r.charAt(++i)!=="-"&&i!=r.length;);const y=r.substring(S,i);if(y!=Number(y)||r.charAt(i)!=="-")throw new Error("Illegal attachments");const a=Number(y);if(!Uv(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");o.attachments=a}if(r.charAt(i+1)==="/"){const S=i+1;for(;++i&&!(r.charAt(i)===","||i===r.length););o.nsp=r.substring(S,i)}else o.nsp="/";const u=r.charAt(i+1);if(u!==""&&Number(u)==u){const S=i+1;for(;++i;){const y=r.charAt(i);if(y==null||Number(y)!=y){--i;break}if(i===r.length)break}o.id=Number(r.substring(S,i+1))}if(r.charAt(++i)){const S=this.tryParse(r.substr(i));if($u.isPayloadValid(o.type,S))o.data=S;else throw new Error("invalid payload")}return o}tryParse(r){try{return JSON.parse(r,this.opts.reviver)}catch{return!1}}static isPayloadValid(r,i){switch(r){case De.CONNECT:return Uf(i);case De.DISCONNECT:return i===void 0;case De.CONNECT_ERROR:return typeof i=="string"||Uf(i);case De.EVENT:case De.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&zv.indexOf(i[0])===-1);case De.ACK:case De.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Wv{constructor(r){this.packet=r,this.buffers=[],this.reconPack=r}takeBinaryData(r){if(this.buffers.push(r),this.buffers.length===this.reconPack.attachments){const i=jv(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Uv=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function Uf(e){return Object.prototype.toString.call(e)==="[object Object]"}const Vv=Object.freeze(Object.defineProperty({__proto__:null,Decoder:$u,Encoder:$v,get PacketType(){return De}},Symbol.toStringTag,{value:"Module"}));function Gt(e,r,i){return e.on(r,i),function(){e.off(r,i)}}const qv=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class p_ extends Ye{constructor(r,i,o){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=r,this.nsp=i,o&&o.auth&&(this.auth=o.auth),this._opts=Object.assign({},o),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const r=this.io;this.subs=[Gt(r,"open",this.onopen.bind(this)),Gt(r,"packet",this.onpacket.bind(this)),Gt(r,"error",this.onerror.bind(this)),Gt(r,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...r){return r.unshift("message"),this.emit.apply(this,r),this}emit(r,...i){var o,u,S;if(qv.hasOwnProperty(r))throw new Error('"'+r.toString()+'" is a reserved event name');if(i.unshift(r),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;const y={type:De.EVENT,data:i};if(y.options={},y.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const v=this.ids++,l=i.pop();this._registerAckCallback(v,l),y.id=v}const a=(u=(o=this.io.engine)===null||o===void 0?void 0:o.transport)===null||u===void 0?void 0:u.writable,c=this.connected&&!(!((S=this.io.engine)===null||S===void 0)&&S._hasPingExpired());return this.flags.volatile&&!a||(c?(this.notifyOutgoingListeners(y),this.packet(y)):this.sendBuffer.push(y)),this.flags={},this}_registerAckCallback(r,i){var o;const u=(o=this.flags.timeout)!==null&&o!==void 0?o:this._opts.ackTimeout;if(u===void 0){this.acks[r]=i;return}const S=this.io.setTimeoutFn(()=>{delete this.acks[r];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===r&&this.sendBuffer.splice(a,1);i.call(this,new Error("operation has timed out"))},u),y=(...a)=>{this.io.clearTimeoutFn(S),i.apply(this,a)};y.withError=!0,this.acks[r]=y}emitWithAck(r,...i){return new Promise((o,u)=>{const S=(y,a)=>y?u(y):o(a);S.withError=!0,i.push(S),this.emit(r,...i)})}_addToQueue(r){let i;typeof r[r.length-1]=="function"&&(i=r.pop());const o={id:this._queueSeq++,tryCount:0,pending:!1,args:r,flags:Object.assign({fromQueue:!0},this.flags)};r.push((u,...S)=>(this._queue[0],u!==null?o.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(u)):(this._queue.shift(),i&&i(null,...S)),o.pending=!1,this._drainQueue())),this._queue.push(o),this._drainQueue()}_drainQueue(r=!1){if(!this.connected||this._queue.length===0)return;const i=this._queue[0];i.pending&&!r||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(r){r.nsp=this.nsp,this.io._packet(r)}onopen(){typeof this.auth=="function"?this.auth(r=>{this._sendConnectPacket(r)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(r){this.packet({type:De.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},r):r})}onerror(r){this.connected||this.emitReserved("connect_error",r)}onclose(r,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",r,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(r=>{if(!this.sendBuffer.some(o=>String(o.id)===r)){const o=this.acks[r];delete this.acks[r],o.withError&&o.call(this,new Error("socket has been disconnected"))}})}onpacket(r){if(r.nsp===this.nsp)switch(r.type){case De.CONNECT:r.data&&r.data.sid?this.onconnect(r.data.sid,r.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case De.EVENT:case De.BINARY_EVENT:this.onevent(r);break;case De.ACK:case De.BINARY_ACK:this.onack(r);break;case De.DISCONNECT:this.ondisconnect();break;case De.CONNECT_ERROR:this.destroy();const o=new Error(r.data.message);o.data=r.data.data,this.emitReserved("connect_error",o);break}}onevent(r){const i=r.data||[];r.id!=null&&i.push(this.ack(r.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(r){if(this._anyListeners&&this._anyListeners.length){const i=this._anyListeners.slice();for(const o of i)o.apply(this,r)}super.emit.apply(this,r),this._pid&&r.length&&typeof r[r.length-1]=="string"&&(this._lastOffset=r[r.length-1])}ack(r){const i=this;let o=!1;return function(...u){o||(o=!0,i.packet({type:De.ACK,id:r,data:u}))}}onack(r){const i=this.acks[r.id];typeof i=="function"&&(delete this.acks[r.id],i.withError&&r.data.unshift(null),i.apply(this,r.data))}onconnect(r,i){this.id=r,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(r=>this.emitEvent(r)),this.receiveBuffer=[],this.sendBuffer.forEach(r=>{this.notifyOutgoingListeners(r),this.packet(r)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(r=>r()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:De.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(r){return this.flags.compress=r,this}get volatile(){return this.flags.volatile=!0,this}timeout(r){return this.flags.timeout=r,this}onAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(r),this}prependAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(r),this}offAny(r){if(!this._anyListeners)return this;if(r){const i=this._anyListeners;for(let o=0;o<i.length;o++)if(r===i[o])return i.splice(o,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(r),this}prependAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(r),this}offAnyOutgoing(r){if(!this._anyOutgoingListeners)return this;if(r){const i=this._anyOutgoingListeners;for(let o=0;o<i.length;o++)if(r===i[o])return i.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(r){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const i=this._anyOutgoingListeners.slice();for(const o of i)o.apply(this,r.data)}}}function gi(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}gi.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var r=Math.random(),i=Math.floor(r*this.jitter*e);e=(Math.floor(r*10)&1)==0?e-i:e+i}return Math.min(e,this.max)|0};gi.prototype.reset=function(){this.attempts=0};gi.prototype.setMin=function(e){this.ms=e};gi.prototype.setMax=function(e){this.max=e};gi.prototype.setJitter=function(e){this.jitter=e};class gu extends Ye{constructor(r,i){var o;super(),this.nsps={},this.subs=[],r&&typeof r=="object"&&(i=r,r=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,Pa(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((o=i.randomizationFactor)!==null&&o!==void 0?o:.5),this.backoff=new gi({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=r;const u=i.parser||Vv;this.encoder=new u.Encoder,this.decoder=new u.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(r){return arguments.length?(this._reconnection=!!r,r||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(r){return r===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=r,this)}reconnectionDelay(r){var i;return r===void 0?this._reconnectionDelay:(this._reconnectionDelay=r,(i=this.backoff)===null||i===void 0||i.setMin(r),this)}randomizationFactor(r){var i;return r===void 0?this._randomizationFactor:(this._randomizationFactor=r,(i=this.backoff)===null||i===void 0||i.setJitter(r),this)}reconnectionDelayMax(r){var i;return r===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=r,(i=this.backoff)===null||i===void 0||i.setMax(r),this)}timeout(r){return arguments.length?(this._timeout=r,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(r){if(~this._readyState.indexOf("open"))return this;this.engine=new Pv(this.uri,this.opts);const i=this.engine,o=this;this._readyState="opening",this.skipReconnect=!1;const u=Gt(i,"open",function(){o.onopen(),r&&r()}),S=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),r?r(a):this.maybeReconnectOnOpen()},y=Gt(i,"error",S);if(this._timeout!==!1){const a=this._timeout,c=this.setTimeoutFn(()=>{u(),S(new Error("timeout")),i.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(u),this.subs.push(y),this}connect(r){return this.open(r)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const r=this.engine;this.subs.push(Gt(r,"ping",this.onping.bind(this)),Gt(r,"data",this.ondata.bind(this)),Gt(r,"error",this.onerror.bind(this)),Gt(r,"close",this.onclose.bind(this)),Gt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(r){try{this.decoder.add(r)}catch(i){this.onclose("parse error",i)}}ondecoded(r){Ma(()=>{this.emitReserved("packet",r)},this.setTimeoutFn)}onerror(r){this.emitReserved("error",r)}socket(r,i){let o=this.nsps[r];return o?this._autoConnect&&!o.active&&o.connect():(o=new p_(this,r,i),this.nsps[r]=o),o}_destroy(r){const i=Object.keys(this.nsps);for(const o of i)if(this.nsps[o].active)return;this._close()}_packet(r){const i=this.encoder.encode(r);for(let o=0;o<i.length;o++)this.engine.write(i[o],r.options)}cleanup(){this.subs.forEach(r=>r()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(r,i){var o;this.cleanup(),(o=this.engine)===null||o===void 0||o.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",r,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const r=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const i=this.backoff.duration();this._reconnecting=!0;const o=this.setTimeoutFn(()=>{r.skipReconnect||(this.emitReserved("reconnect_attempt",r.backoff.attempts),!r.skipReconnect&&r.open(u=>{u?(r._reconnecting=!1,r.reconnect(),this.emitReserved("reconnect_error",u)):r.onreconnect()}))},i);this.opts.autoUnref&&o.unref(),this.subs.push(()=>{this.clearTimeoutFn(o)})}}onreconnect(){const r=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",r)}}const ls={};function ha(e,r){typeof e=="object"&&(r=e,e=void 0),r=r||{};const i=Bv(e,r.path||"/socket.io"),o=i.source,u=i.id,S=i.path,y=ls[u]&&S in ls[u].nsps,a=r.forceNew||r["force new connection"]||r.multiplex===!1||y;let c;return a?c=new gu(o,r):(ls[u]||(ls[u]=new gu(o,r)),c=ls[u]),i.query&&!r.query&&(r.query=i.queryKey),c.socket(i.path,r)}Object.assign(ha,{Manager:gu,Socket:p_,io:ha,connect:ha});function Kv(){const e=J.useRef(null),[r,i]=J.useState([]),[o,u]=J.useState([]),[S,y]=J.useState([]),[a,c]=J.useState(""),[_,v]=J.useState([]);return J.useEffect(()=>{const l=ha(window.location.origin,{path:"/socket.io"});return e.current=l,l.on("agents:updated",m=>{Array.isArray(m)&&i(m)}),l.on("messages:new",m=>{u(x=>[m,...x])}),l.on("messages:all",m=>{Array.isArray(m)&&u(m)}),l.on("context:updated",m=>{y(x=>{const b=x.findIndex(C=>C.key===m.key);if(b>=0){const C=[...x];return C[b]=m,C}return[...x,m]})}),l.on("context:removed",({key:m})=>{y(x=>x.filter(b=>b.key!==m))}),l.on("crewmd:updated",m=>{typeof m=="string"&&c(m)}),l.on("agent:cost",m=>{i(x=>x.map(b=>b.id===m.id?{...b,total_cost:m.total_cost,total_tokens:m.total_tokens}:b))}),l.on("file:changed",m=>{v(x=>[m,...x].slice(0,500))}),l.on("file:changes:cleared",()=>{v([])}),fetch("/api/file-changes").then(m=>m.json()).then(m=>{Array.isArray(m)&&v(m)}).catch(()=>{}),fetch("/api/context").then(m=>m.json()).then(m=>{Array.isArray(m)&&y(m)}).catch(()=>{}),()=>{l.disconnect()}},[]),{socket:e,agents:r,messages:o,contextEntries:S,crewMd:a,setCrewMd:c,fileChanges:_,setFileChanges:v}}const Xv={running:"var(--green)",starting:"var(--yellow)",idle:"var(--yellow)",done:"var(--text-muted)",dead:"var(--red)"};function Yv({agents:e,selectedId:r,onSelect:i,onKill:o,onRemove:u,onRollback:S,onRestart:y}){return j.jsxs("div",{className:"agent-list",children:[j.jsxs("div",{className:"agent-list-header",children:["Agents (",e.length,")"]}),e.length===0&&j.jsx("div",{className:"agent-list-empty",children:"No agents running"}),e.map(a=>j.jsxs("div",{className:`agent-item ${a.id===r?"selected":""}`,onClick:()=>i(a),children:[j.jsxs("div",{className:"agent-item-header",children:[j.jsx("span",{className:"status-dot",style:{background:Xv[a.status]||"var(--text-muted)"}}),j.jsx("span",{className:"agent-name",children:a.name}),j.jsx("span",{className:`agent-service-badge service-${a.service||"claude"}`,children:a.service||"claude"}),a.total_cost>0&&j.jsxs("span",{className:"agent-cost",children:["$",a.total_cost.toFixed(4)]}),j.jsx("span",{className:"agent-status",children:a.status})]}),j.jsx("div",{className:"agent-task",children:a.task}),(a.status==="running"||a.status==="starting")&&j.jsx("div",{className:"agent-running-actions",children:j.jsx("button",{className:"stop-btn",onClick:c=>{c.stopPropagation(),o(a.id)},children:"Stop"})}),(a.status==="done"||a.status==="dead")&&j.jsxs("div",{className:"agent-done-actions",children:[j.jsx("button",{className:"restart-btn",onClick:c=>{c.stopPropagation(),y(a)},children:"Restart"}),a.checkpoint_hash&&j.jsx("button",{className:"rollback-btn",onClick:c=>{c.stopPropagation(),confirm(`Rollback all changes made by "${a.name}"? This will reset files to the state before the agent started.`)&&S(a.id)},children:"Rollback"}),j.jsx("button",{className:"remove-btn",onClick:c=>{c.stopPropagation(),u(a.id)},children:"Remove"})]})]},a.id))]})}function Ge(e){if(typeof e=="string"||typeof e=="number")return""+e;let r="";if(Array.isArray(e))for(let i=0,o;i<e.length;i++)(o=Ge(e[i]))!==""&&(r+=(r&&" ")+o);else for(let i in e)e[i]&&(r+=(r&&" ")+i);return r}var Gv={value:()=>{}};function Ba(){for(var e=0,r=arguments.length,i={},o;e<r;++e){if(!(o=arguments[e]+"")||o in i||/[\s.]/.test(o))throw new Error("illegal type: "+o);i[o]=[]}return new da(i)}function da(e){this._=e}function Qv(e,r){return e.trim().split(/^|\s+/).map(function(i){var o="",u=i.indexOf(".");if(u>=0&&(o=i.slice(u+1),i=i.slice(0,u)),i&&!r.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:o}})}da.prototype=Ba.prototype={constructor:da,on:function(e,r){var i=this._,o=Qv(e+"",i),u,S=-1,y=o.length;if(arguments.length<2){for(;++S<y;)if((u=(e=o[S]).type)&&(u=Jv(i[u],e.name)))return u;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++S<y;)if(u=(e=o[S]).type)i[u]=Vf(i[u],e.name,r);else if(r==null)for(u in i)i[u]=Vf(i[u],e.name,null);return this},copy:function(){var e={},r=this._;for(var i in r)e[i]=r[i].slice();return new da(e)},call:function(e,r){if((u=arguments.length-2)>0)for(var i=new Array(u),o=0,u,S;o<u;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(S=this._[e],o=0,u=S.length;o<u;++o)S[o].value.apply(r,i)},apply:function(e,r,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],u=0,S=o.length;u<S;++u)o[u].value.apply(r,i)}};function Jv(e,r){for(var i=0,o=e.length,u;i<o;++i)if((u=e[i]).name===r)return u.value}function Vf(e,r,i){for(var o=0,u=e.length;o<u;++o)if(e[o].name===r){e[o]=Gv,e=e.slice(0,o).concat(e.slice(o+1));break}return i!=null&&e.push({name:r,value:i}),e}var mu="http://www.w3.org/1999/xhtml";const qf={svg:"http://www.w3.org/2000/svg",xhtml:mu,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Na(e){var r=e+="",i=r.indexOf(":");return i>=0&&(r=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),qf.hasOwnProperty(r)?{space:qf[r],local:e}:e}function Zv(e){return function(){var r=this.ownerDocument,i=this.namespaceURI;return i===mu&&r.documentElement.namespaceURI===mu?r.createElement(e):r.createElementNS(i,e)}}function ey(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function __(e){var r=Na(e);return(r.local?ey:Zv)(r)}function ty(){}function Wu(e){return e==null?ty:function(){return this.querySelector(e)}}function ry(e){typeof e!="function"&&(e=Wu(e));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var S=r[u],y=S.length,a=o[u]=new Array(y),c,_,v=0;v<y;++v)(c=S[v])&&(_=e.call(c,c.__data__,v,S))&&("__data__"in c&&(_.__data__=c.__data__),a[v]=_);return new Bt(o,this._parents)}function ny(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function iy(){return[]}function g_(e){return e==null?iy:function(){return this.querySelectorAll(e)}}function sy(e){return function(){return ny(e.apply(this,arguments))}}function oy(e){typeof e=="function"?e=sy(e):e=g_(e);for(var r=this._groups,i=r.length,o=[],u=[],S=0;S<i;++S)for(var y=r[S],a=y.length,c,_=0;_<a;++_)(c=y[_])&&(o.push(e.call(c,c.__data__,_,y)),u.push(c));return new Bt(o,u)}function m_(e){return function(){return this.matches(e)}}function v_(e){return function(r){return r.matches(e)}}var ay=Array.prototype.find;function ly(e){return function(){return ay.call(this.children,e)}}function cy(){return this.firstElementChild}function uy(e){return this.select(e==null?cy:ly(typeof e=="function"?e:v_(e)))}var hy=Array.prototype.filter;function dy(){return Array.from(this.children)}function fy(e){return function(){return hy.call(this.children,e)}}function py(e){return this.selectAll(e==null?dy:fy(typeof e=="function"?e:v_(e)))}function _y(e){typeof e!="function"&&(e=m_(e));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var S=r[u],y=S.length,a=o[u]=[],c,_=0;_<y;++_)(c=S[_])&&e.call(c,c.__data__,_,S)&&a.push(c);return new Bt(o,this._parents)}function y_(e){return new Array(e.length)}function gy(){return new Bt(this._enter||this._groups.map(y_),this._parents)}function ya(e,r){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=r}ya.prototype={constructor:ya,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,r){return this._parent.insertBefore(e,r)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function my(e){return function(){return e}}function vy(e,r,i,o,u,S){for(var y=0,a,c=r.length,_=S.length;y<_;++y)(a=r[y])?(a.__data__=S[y],o[y]=a):i[y]=new ya(e,S[y]);for(;y<c;++y)(a=r[y])&&(u[y]=a)}function yy(e,r,i,o,u,S,y){var a,c,_=new Map,v=r.length,l=S.length,m=new Array(v),x;for(a=0;a<v;++a)(c=r[a])&&(m[a]=x=y.call(c,c.__data__,a,r)+"",_.has(x)?u[a]=c:_.set(x,c));for(a=0;a<l;++a)x=y.call(e,S[a],a,S)+"",(c=_.get(x))?(o[a]=c,c.__data__=S[a],_.delete(x)):i[a]=new ya(e,S[a]);for(a=0;a<v;++a)(c=r[a])&&_.get(m[a])===c&&(u[a]=c)}function wy(e){return e.__data__}function Sy(e,r){if(!arguments.length)return Array.from(this,wy);var i=r?yy:vy,o=this._parents,u=this._groups;typeof e!="function"&&(e=my(e));for(var S=u.length,y=new Array(S),a=new Array(S),c=new Array(S),_=0;_<S;++_){var v=o[_],l=u[_],m=l.length,x=Cy(e.call(v,v&&v.__data__,_,o)),b=x.length,C=a[_]=new Array(b),f=y[_]=new Array(b),p=c[_]=new Array(m);i(v,l,C,f,p,x,r);for(var d=0,h=0,w,L;d<b;++d)if(w=C[d]){for(d>=h&&(h=d+1);!(L=f[h])&&++h<b;);w._next=L||null}}return y=new Bt(y,o),y._enter=a,y._exit=c,y}function Cy(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function xy(){return new Bt(this._exit||this._groups.map(y_),this._parents)}function by(e,r,i){var o=this.enter(),u=this,S=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),r!=null&&(u=r(u),u&&(u=u.selection())),i==null?S.remove():i(S),o&&u?o.merge(u).order():u}function Ey(e){for(var r=e.selection?e.selection():e,i=this._groups,o=r._groups,u=i.length,S=o.length,y=Math.min(u,S),a=new Array(u),c=0;c<y;++c)for(var _=i[c],v=o[c],l=_.length,m=a[c]=new Array(l),x,b=0;b<l;++b)(x=_[b]||v[b])&&(m[b]=x);for(;c<u;++c)a[c]=i[c];return new Bt(a,this._parents)}function ky(){for(var e=this._groups,r=-1,i=e.length;++r<i;)for(var o=e[r],u=o.length-1,S=o[u],y;--u>=0;)(y=o[u])&&(S&&y.compareDocumentPosition(S)^4&&S.parentNode.insertBefore(y,S),S=y);return this}function Ly(e){e||(e=Ry);function r(l,m){return l&&m?e(l.__data__,m.__data__):!l-!m}for(var i=this._groups,o=i.length,u=new Array(o),S=0;S<o;++S){for(var y=i[S],a=y.length,c=u[S]=new Array(a),_,v=0;v<a;++v)(_=y[v])&&(c[v]=_);c.sort(r)}return new Bt(u,this._parents).order()}function Ry(e,r){return e<r?-1:e>r?1:e>=r?0:NaN}function Dy(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Ty(){return Array.from(this)}function Ay(){for(var e=this._groups,r=0,i=e.length;r<i;++r)for(var o=e[r],u=0,S=o.length;u<S;++u){var y=o[u];if(y)return y}return null}function My(){let e=0;for(const r of this)++e;return e}function Py(){return!this.node()}function By(e){for(var r=this._groups,i=0,o=r.length;i<o;++i)for(var u=r[i],S=0,y=u.length,a;S<y;++S)(a=u[S])&&e.call(a,a.__data__,S,u);return this}function Ny(e){return function(){this.removeAttribute(e)}}function Iy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Oy(e,r){return function(){this.setAttribute(e,r)}}function Hy(e,r){return function(){this.setAttributeNS(e.space,e.local,r)}}function Fy(e,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function jy(e,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function zy(e,r){var i=Na(e);if(arguments.length<2){var o=this.node();return i.local?o.getAttributeNS(i.space,i.local):o.getAttribute(i)}return this.each((r==null?i.local?Iy:Ny:typeof r=="function"?i.local?jy:Fy:i.local?Hy:Oy)(i,r))}function w_(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function $y(e){return function(){this.style.removeProperty(e)}}function Wy(e,r,i){return function(){this.style.setProperty(e,r,i)}}function Uy(e,r,i){return function(){var o=r.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,i)}}function Vy(e,r,i){return arguments.length>1?this.each((r==null?$y:typeof r=="function"?Uy:Wy)(e,r,i??"")):li(this.node(),e)}function li(e,r){return e.style.getPropertyValue(r)||w_(e).getComputedStyle(e,null).getPropertyValue(r)}function qy(e){return function(){delete this[e]}}function Ky(e,r){return function(){this[e]=r}}function Xy(e,r){return function(){var i=r.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function Yy(e,r){return arguments.length>1?this.each((r==null?qy:typeof r=="function"?Xy:Ky)(e,r)):this.node()[e]}function S_(e){return e.trim().split(/^|\s+/)}function Uu(e){return e.classList||new C_(e)}function C_(e){this._node=e,this._names=S_(e.getAttribute("class")||"")}C_.prototype={add:function(e){var r=this._names.indexOf(e);r<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var r=this._names.indexOf(e);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function x_(e,r){for(var i=Uu(e),o=-1,u=r.length;++o<u;)i.add(r[o])}function b_(e,r){for(var i=Uu(e),o=-1,u=r.length;++o<u;)i.remove(r[o])}function Gy(e){return function(){x_(this,e)}}function Qy(e){return function(){b_(this,e)}}function Jy(e,r){return function(){(r.apply(this,arguments)?x_:b_)(this,e)}}function Zy(e,r){var i=S_(e+"");if(arguments.length<2){for(var o=Uu(this.node()),u=-1,S=i.length;++u<S;)if(!o.contains(i[u]))return!1;return!0}return this.each((typeof r=="function"?Jy:r?Gy:Qy)(i,r))}function e1(){this.textContent=""}function t1(e){return function(){this.textContent=e}}function r1(e){return function(){var r=e.apply(this,arguments);this.textContent=r??""}}function n1(e){return arguments.length?this.each(e==null?e1:(typeof e=="function"?r1:t1)(e)):this.node().textContent}function i1(){this.innerHTML=""}function s1(e){return function(){this.innerHTML=e}}function o1(e){return function(){var r=e.apply(this,arguments);this.innerHTML=r??""}}function a1(e){return arguments.length?this.each(e==null?i1:(typeof e=="function"?o1:s1)(e)):this.node().innerHTML}function l1(){this.nextSibling&&this.parentNode.appendChild(this)}function c1(){return this.each(l1)}function u1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function h1(){return this.each(u1)}function d1(e){var r=typeof e=="function"?e:__(e);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function f1(){return null}function p1(e,r){var i=typeof e=="function"?e:__(e),o=r==null?f1:typeof r=="function"?r:Wu(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),o.apply(this,arguments)||null)})}function _1(){var e=this.parentNode;e&&e.removeChild(this)}function g1(){return this.each(_1)}function m1(){var e=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(e,this.nextSibling):e}function v1(){var e=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(e,this.nextSibling):e}function y1(e){return this.select(e?v1:m1)}function w1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function S1(e){return function(r){e.call(this,r,this.__data__)}}function C1(e){return e.trim().split(/^|\s+/).map(function(r){var i="",o=r.indexOf(".");return o>=0&&(i=r.slice(o+1),r=r.slice(0,o)),{type:r,name:i}})}function x1(e){return function(){var r=this.__on;if(r){for(var i=0,o=-1,u=r.length,S;i<u;++i)S=r[i],(!e.type||S.type===e.type)&&S.name===e.name?this.removeEventListener(S.type,S.listener,S.options):r[++o]=S;++o?r.length=o:delete this.__on}}}function b1(e,r,i){return function(){var o=this.__on,u,S=S1(r);if(o){for(var y=0,a=o.length;y<a;++y)if((u=o[y]).type===e.type&&u.name===e.name){this.removeEventListener(u.type,u.listener,u.options),this.addEventListener(u.type,u.listener=S,u.options=i),u.value=r;return}}this.addEventListener(e.type,S,i),u={type:e.type,name:e.name,value:r,listener:S,options:i},o?o.push(u):this.__on=[u]}}function E1(e,r,i){var o=C1(e+""),u,S=o.length,y;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,_=a.length,v;c<_;++c)for(u=0,v=a[c];u<S;++u)if((y=o[u]).type===v.type&&y.name===v.name)return v.value}return}for(a=r?b1:x1,u=0;u<S;++u)this.each(a(o[u],r,i));return this}function E_(e,r,i){var o=w_(e),u=o.CustomEvent;typeof u=="function"?u=new u(r,i):(u=o.document.createEvent("Event"),i?(u.initEvent(r,i.bubbles,i.cancelable),u.detail=i.detail):u.initEvent(r,!1,!1)),e.dispatchEvent(u)}function k1(e,r){return function(){return E_(this,e,r)}}function L1(e,r){return function(){return E_(this,e,r.apply(this,arguments))}}function R1(e,r){return this.each((typeof r=="function"?L1:k1)(e,r))}function*D1(){for(var e=this._groups,r=0,i=e.length;r<i;++r)for(var o=e[r],u=0,S=o.length,y;u<S;++u)(y=o[u])&&(yield y)}var k_=[null];function Bt(e,r){this._groups=e,this._parents=r}function ks(){return new Bt([[document.documentElement]],k_)}function T1(){return this}Bt.prototype=ks.prototype={constructor:Bt,select:ry,selectAll:oy,selectChild:uy,selectChildren:py,filter:_y,data:Sy,enter:gy,exit:xy,join:by,merge:Ey,selection:T1,order:ky,sort:Ly,call:Dy,nodes:Ty,node:Ay,size:My,empty:Py,each:By,attr:zy,style:Vy,property:Yy,classed:Zy,text:n1,html:a1,raise:c1,lower:h1,append:d1,insert:p1,remove:g1,clone:y1,datum:w1,on:E1,dispatch:R1,[Symbol.iterator]:D1};function Pt(e){return typeof e=="string"?new Bt([[document.querySelector(e)]],[document.documentElement]):new Bt([[e]],k_)}function A1(e){let r;for(;r=e.sourceEvent;)e=r;return e}function Qt(e,r){if(e=A1(e),r===void 0&&(r=e.currentTarget),r){var i=r.ownerSVGElement||r;if(i.createSVGPoint){var o=i.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(r.getScreenCTM().inverse()),[o.x,o.y]}if(r.getBoundingClientRect){var u=r.getBoundingClientRect();return[e.clientX-u.left-r.clientLeft,e.clientY-u.top-r.clientTop]}}return[e.pageX,e.pageY]}const M1={passive:!1},gs={capture:!0,passive:!1};function Vc(e){e.stopImmediatePropagation()}function oi(e){e.preventDefault(),e.stopImmediatePropagation()}function L_(e){var r=e.document.documentElement,i=Pt(e).on("dragstart.drag",oi,gs);"onselectstart"in r?i.on("selectstart.drag",oi,gs):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function R_(e,r){var i=e.document.documentElement,o=Pt(e).on("dragstart.drag",null);r&&(o.on("click.drag",oi,gs),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in i?o.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Jo=e=>()=>e;function vu(e,{sourceEvent:r,subject:i,target:o,identifier:u,active:S,x:y,y:a,dx:c,dy:_,dispatch:v}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:u,enumerable:!0,configurable:!0},active:{value:S,enumerable:!0,configurable:!0},x:{value:y,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:_,enumerable:!0,configurable:!0},_:{value:v}})}vu.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function P1(e){return!e.ctrlKey&&!e.button}function B1(){return this.parentNode}function N1(e,r){return r??{x:e.x,y:e.y}}function I1(){return navigator.maxTouchPoints||"ontouchstart"in this}function D_(){var e=P1,r=B1,i=N1,o=I1,u={},S=Ba("start","drag","end"),y=0,a,c,_,v,l=0;function m(w){w.on("mousedown.drag",x).filter(o).on("touchstart.drag",f).on("touchmove.drag",p,M1).on("touchend.drag touchcancel.drag",d).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(w,L){if(!(v||!e.call(this,w,L))){var R=h(this,r.call(this,w,L),w,L,"mouse");R&&(Pt(w.view).on("mousemove.drag",b,gs).on("mouseup.drag",C,gs),L_(w.view),Vc(w),_=!1,a=w.clientX,c=w.clientY,R("start",w))}}function b(w){if(oi(w),!_){var L=w.clientX-a,R=w.clientY-c;_=L*L+R*R>l}u.mouse("drag",w)}function C(w){Pt(w.view).on("mousemove.drag mouseup.drag",null),R_(w.view,_),oi(w),u.mouse("end",w)}function f(w,L){if(e.call(this,w,L)){var R=w.changedTouches,D=r.call(this,w,L),k=R.length,M,W;for(M=0;M<k;++M)(W=h(this,D,w,L,R[M].identifier,R[M]))&&(Vc(w),W("start",w,R[M]))}}function p(w){var L=w.changedTouches,R=L.length,D,k;for(D=0;D<R;++D)(k=u[L[D].identifier])&&(oi(w),k("drag",w,L[D]))}function d(w){var L=w.changedTouches,R=L.length,D,k;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),D=0;D<R;++D)(k=u[L[D].identifier])&&(Vc(w),k("end",w,L[D]))}function h(w,L,R,D,k,M){var W=S.copy(),z=Qt(M||R,L),F,N,I;if((I=i.call(w,new vu("beforestart",{sourceEvent:R,target:m,identifier:k,active:y,x:z[0],y:z[1],dx:0,dy:0,dispatch:W}),D))!=null)return F=I.x-z[0]||0,N=I.y-z[1]||0,function q(V,K,U){var A=z,B;switch(V){case"start":u[k]=q,B=y++;break;case"end":delete u[k],--y;case"drag":z=Qt(U||K,L),B=y;break}W.call(V,w,new vu(V,{sourceEvent:K,subject:I,target:m,identifier:k,active:B,x:z[0]+F,y:z[1]+N,dx:z[0]-A[0],dy:z[1]-A[1],dispatch:W}),D)}}return m.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Jo(!!w),m):e},m.container=function(w){return arguments.length?(r=typeof w=="function"?w:Jo(w),m):r},m.subject=function(w){return arguments.length?(i=typeof w=="function"?w:Jo(w),m):i},m.touchable=function(w){return arguments.length?(o=typeof w=="function"?w:Jo(!!w),m):o},m.on=function(){var w=S.on.apply(S,arguments);return w===S?m:w},m.clickDistance=function(w){return arguments.length?(l=(w=+w)*w,m):Math.sqrt(l)},m}function Vu(e,r,i){e.prototype=r.prototype=i,i.constructor=e}function T_(e,r){var i=Object.create(e.prototype);for(var o in r)i[o]=r[o];return i}function Ls(){}var ms=.7,wa=1/ms,ai="\\s*([+-]?\\d+)\\s*",vs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ur="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",O1=/^#([0-9a-f]{3,8})$/,H1=new RegExp(`^rgb\\(${ai},${ai},${ai}\\)$`),F1=new RegExp(`^rgb\\(${ur},${ur},${ur}\\)$`),j1=new RegExp(`^rgba\\(${ai},${ai},${ai},${vs}\\)$`),z1=new RegExp(`^rgba\\(${ur},${ur},${ur},${vs}\\)$`),$1=new RegExp(`^hsl\\(${vs},${ur},${ur}\\)$`),W1=new RegExp(`^hsla\\(${vs},${ur},${ur},${vs}\\)$`),Kf={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Vu(Ls,xn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Xf,formatHex:Xf,formatHex8:U1,formatHsl:V1,formatRgb:Yf,toString:Yf});function Xf(){return this.rgb().formatHex()}function U1(){return this.rgb().formatHex8()}function V1(){return A_(this).formatHsl()}function Yf(){return this.rgb().formatRgb()}function xn(e){var r,i;return e=(e+"").trim().toLowerCase(),(r=O1.exec(e))?(i=r[1].length,r=parseInt(r[1],16),i===6?Gf(r):i===3?new Et(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):i===8?Zo(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):i===4?Zo(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=H1.exec(e))?new Et(r[1],r[2],r[3],1):(r=F1.exec(e))?new Et(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=j1.exec(e))?Zo(r[1],r[2],r[3],r[4]):(r=z1.exec(e))?Zo(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=$1.exec(e))?Zf(r[1],r[2]/100,r[3]/100,1):(r=W1.exec(e))?Zf(r[1],r[2]/100,r[3]/100,r[4]):Kf.hasOwnProperty(e)?Gf(Kf[e]):e==="transparent"?new Et(NaN,NaN,NaN,0):null}function Gf(e){return new Et(e>>16&255,e>>8&255,e&255,1)}function Zo(e,r,i,o){return o<=0&&(e=r=i=NaN),new Et(e,r,i,o)}function q1(e){return e instanceof Ls||(e=xn(e)),e?(e=e.rgb(),new Et(e.r,e.g,e.b,e.opacity)):new Et}function yu(e,r,i,o){return arguments.length===1?q1(e):new Et(e,r,i,o??1)}function Et(e,r,i,o){this.r=+e,this.g=+r,this.b=+i,this.opacity=+o}Vu(Et,yu,T_(Ls,{brighter(e){return e=e==null?wa:Math.pow(wa,e),new Et(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ms:Math.pow(ms,e),new Et(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Et(Sn(this.r),Sn(this.g),Sn(this.b),Sa(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Qf,formatHex:Qf,formatHex8:K1,formatRgb:Jf,toString:Jf}));function Qf(){return`#${wn(this.r)}${wn(this.g)}${wn(this.b)}`}function K1(){return`#${wn(this.r)}${wn(this.g)}${wn(this.b)}${wn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Jf(){const e=Sa(this.opacity);return`${e===1?"rgb(":"rgba("}${Sn(this.r)}, ${Sn(this.g)}, ${Sn(this.b)}${e===1?")":`, ${e})`}`}function Sa(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Sn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function wn(e){return e=Sn(e),(e<16?"0":"")+e.toString(16)}function Zf(e,r,i,o){return o<=0?e=r=i=NaN:i<=0||i>=1?e=r=NaN:r<=0&&(e=NaN),new Jt(e,r,i,o)}function A_(e){if(e instanceof Jt)return new Jt(e.h,e.s,e.l,e.opacity);if(e instanceof Ls||(e=xn(e)),!e)return new Jt;if(e instanceof Jt)return e;e=e.rgb();var r=e.r/255,i=e.g/255,o=e.b/255,u=Math.min(r,i,o),S=Math.max(r,i,o),y=NaN,a=S-u,c=(S+u)/2;return a?(r===S?y=(i-o)/a+(i<o)*6:i===S?y=(o-r)/a+2:y=(r-i)/a+4,a/=c<.5?S+u:2-S-u,y*=60):a=c>0&&c<1?0:y,new Jt(y,a,c,e.opacity)}function X1(e,r,i,o){return arguments.length===1?A_(e):new Jt(e,r,i,o??1)}function Jt(e,r,i,o){this.h=+e,this.s=+r,this.l=+i,this.opacity=+o}Vu(Jt,X1,T_(Ls,{brighter(e){return e=e==null?wa:Math.pow(wa,e),new Jt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ms:Math.pow(ms,e),new Jt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,r=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,o=i+(i<.5?i:1-i)*r,u=2*i-o;return new Et(qc(e>=240?e-240:e+120,u,o),qc(e,u,o),qc(e<120?e+240:e-120,u,o),this.opacity)},clamp(){return new Jt(ep(this.h),ea(this.s),ea(this.l),Sa(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Sa(this.opacity);return`${e===1?"hsl(":"hsla("}${ep(this.h)}, ${ea(this.s)*100}%, ${ea(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ep(e){return e=(e||0)%360,e<0?e+360:e}function ea(e){return Math.max(0,Math.min(1,e||0))}function qc(e,r,i){return(e<60?r+(i-r)*e/60:e<180?i:e<240?r+(i-r)*(240-e)/60:r)*255}const qu=e=>()=>e;function Y1(e,r){return function(i){return e+i*r}}function G1(e,r,i){return e=Math.pow(e,i),r=Math.pow(r,i)-e,i=1/i,function(o){return Math.pow(e+o*r,i)}}function Q1(e){return(e=+e)==1?M_:function(r,i){return i-r?G1(r,i,e):qu(isNaN(r)?i:r)}}function M_(e,r){var i=r-e;return i?Y1(e,i):qu(isNaN(e)?r:e)}const Ca=(function e(r){var i=Q1(r);function o(u,S){var y=i((u=yu(u)).r,(S=yu(S)).r),a=i(u.g,S.g),c=i(u.b,S.b),_=M_(u.opacity,S.opacity);return function(v){return u.r=y(v),u.g=a(v),u.b=c(v),u.opacity=_(v),u+""}}return o.gamma=e,o})(1);function J1(e,r){r||(r=[]);var i=e?Math.min(r.length,e.length):0,o=r.slice(),u;return function(S){for(u=0;u<i;++u)o[u]=e[u]*(1-S)+r[u]*S;return o}}function Z1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ew(e,r){var i=r?r.length:0,o=e?Math.min(i,e.length):0,u=new Array(o),S=new Array(i),y;for(y=0;y<o;++y)u[y]=ps(e[y],r[y]);for(;y<i;++y)S[y]=r[y];return function(a){for(y=0;y<o;++y)S[y]=u[y](a);return S}}function tw(e,r){var i=new Date;return e=+e,r=+r,function(o){return i.setTime(e*(1-o)+r*o),i}}function lr(e,r){return e=+e,r=+r,function(i){return e*(1-i)+r*i}}function rw(e,r){var i={},o={},u;(e===null||typeof e!="object")&&(e={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in e?i[u]=ps(e[u],r[u]):o[u]=r[u];return function(S){for(u in i)o[u]=i[u](S);return o}}var wu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Kc=new RegExp(wu.source,"g");function nw(e){return function(){return e}}function iw(e){return function(r){return e(r)+""}}function P_(e,r){var i=wu.lastIndex=Kc.lastIndex=0,o,u,S,y=-1,a=[],c=[];for(e=e+"",r=r+"";(o=wu.exec(e))&&(u=Kc.exec(r));)(S=u.index)>i&&(S=r.slice(i,S),a[y]?a[y]+=S:a[++y]=S),(o=o[0])===(u=u[0])?a[y]?a[y]+=u:a[++y]=u:(a[++y]=null,c.push({i:y,x:lr(o,u)})),i=Kc.lastIndex;return i<r.length&&(S=r.slice(i),a[y]?a[y]+=S:a[++y]=S),a.length<2?c[0]?iw(c[0].x):nw(r):(r=c.length,function(_){for(var v=0,l;v<r;++v)a[(l=c[v]).i]=l.x(_);return a.join("")})}function ps(e,r){var i=typeof r,o;return r==null||i==="boolean"?qu(r):(i==="number"?lr:i==="string"?(o=xn(r))?(r=o,Ca):P_:r instanceof xn?Ca:r instanceof Date?tw:Z1(r)?J1:Array.isArray(r)?ew:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?rw:lr)(e,r)}var tp=180/Math.PI,Su={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function B_(e,r,i,o,u,S){var y,a,c;return(y=Math.sqrt(e*e+r*r))&&(e/=y,r/=y),(c=e*i+r*o)&&(i-=e*c,o-=r*c),(a=Math.sqrt(i*i+o*o))&&(i/=a,o/=a,c/=a),e*o<r*i&&(e=-e,r=-r,c=-c,y=-y),{translateX:u,translateY:S,rotate:Math.atan2(r,e)*tp,skewX:Math.atan(c)*tp,scaleX:y,scaleY:a}}var ta;function sw(e){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return r.isIdentity?Su:B_(r.a,r.b,r.c,r.d,r.e,r.f)}function ow(e){return e==null||(ta||(ta=document.createElementNS("http://www.w3.org/2000/svg","g")),ta.setAttribute("transform",e),!(e=ta.transform.baseVal.consolidate()))?Su:(e=e.matrix,B_(e.a,e.b,e.c,e.d,e.e,e.f))}function N_(e,r,i,o){function u(_){return _.length?_.pop()+" ":""}function S(_,v,l,m,x,b){if(_!==l||v!==m){var C=x.push("translate(",null,r,null,i);b.push({i:C-4,x:lr(_,l)},{i:C-2,x:lr(v,m)})}else(l||m)&&x.push("translate("+l+r+m+i)}function y(_,v,l,m){_!==v?(_-v>180?v+=360:v-_>180&&(_+=360),m.push({i:l.push(u(l)+"rotate(",null,o)-2,x:lr(_,v)})):v&&l.push(u(l)+"rotate("+v+o)}function a(_,v,l,m){_!==v?m.push({i:l.push(u(l)+"skewX(",null,o)-2,x:lr(_,v)}):v&&l.push(u(l)+"skewX("+v+o)}function c(_,v,l,m,x,b){if(_!==l||v!==m){var C=x.push(u(x)+"scale(",null,",",null,")");b.push({i:C-4,x:lr(_,l)},{i:C-2,x:lr(v,m)})}else(l!==1||m!==1)&&x.push(u(x)+"scale("+l+","+m+")")}return function(_,v){var l=[],m=[];return _=e(_),v=e(v),S(_.translateX,_.translateY,v.translateX,v.translateY,l,m),y(_.rotate,v.rotate,l,m),a(_.skewX,v.skewX,l,m),c(_.scaleX,_.scaleY,v.scaleX,v.scaleY,l,m),_=v=null,function(x){for(var b=-1,C=m.length,f;++b<C;)l[(f=m[b]).i]=f.x(x);return l.join("")}}}var aw=N_(sw,"px, ","px)","deg)"),lw=N_(ow,", ",")",")"),cw=1e-12;function rp(e){return((e=Math.exp(e))+1/e)/2}function uw(e){return((e=Math.exp(e))-1/e)/2}function hw(e){return((e=Math.exp(2*e))-1)/(e+1)}const fa=(function e(r,i,o){function u(S,y){var a=S[0],c=S[1],_=S[2],v=y[0],l=y[1],m=y[2],x=v-a,b=l-c,C=x*x+b*b,f,p;if(C<cw)p=Math.log(m/_)/r,f=function(D){return[a+D*x,c+D*b,_*Math.exp(r*D*p)]};else{var d=Math.sqrt(C),h=(m*m-_*_+o*C)/(2*_*i*d),w=(m*m-_*_-o*C)/(2*m*i*d),L=Math.log(Math.sqrt(h*h+1)-h),R=Math.log(Math.sqrt(w*w+1)-w);p=(R-L)/r,f=function(D){var k=D*p,M=rp(L),W=_/(i*d)*(M*hw(r*k+L)-uw(L));return[a+W*x,c+W*b,_*M/rp(r*k+L)]}}return f.duration=p*1e3*r/Math.SQRT2,f}return u.rho=function(S){var y=Math.max(.001,+S),a=y*y,c=a*a;return e(y,a,c)},u})(Math.SQRT2,2,4);var ci=0,ds=0,cs=0,I_=1e3,xa,fs,ba=0,bn=0,Ia=0,ys=typeof performance=="object"&&performance.now?performance:Date,O_=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ku(){return bn||(O_(dw),bn=ys.now()+Ia)}function dw(){bn=0}function Ea(){this._call=this._time=this._next=null}Ea.prototype=H_.prototype={constructor:Ea,restart:function(e,r,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?Ku():+i)+(r==null?0:+r),!this._next&&fs!==this&&(fs?fs._next=this:xa=this,fs=this),this._call=e,this._time=i,Cu()},stop:function(){this._call&&(this._call=null,this._time=1/0,Cu())}};function H_(e,r,i){var o=new Ea;return o.restart(e,r,i),o}function fw(){Ku(),++ci;for(var e=xa,r;e;)(r=bn-e._time)>=0&&e._call.call(void 0,r),e=e._next;--ci}function np(){bn=(ba=ys.now())+Ia,ci=ds=0;try{fw()}finally{ci=0,_w(),bn=0}}function pw(){var e=ys.now(),r=e-ba;r>I_&&(Ia-=r,ba=e)}function _w(){for(var e,r=xa,i,o=1/0;r;)r._call?(o>r._time&&(o=r._time),e=r,r=r._next):(i=r._next,r._next=null,r=e?e._next=i:xa=i);fs=e,Cu(o)}function Cu(e){if(!ci){ds&&(ds=clearTimeout(ds));var r=e-bn;r>24?(e<1/0&&(ds=setTimeout(np,e-ys.now()-Ia)),cs&&(cs=clearInterval(cs))):(cs||(ba=ys.now(),cs=setInterval(pw,I_)),ci=1,O_(np))}}function ip(e,r,i){var o=new Ea;return r=r==null?0:+r,o.restart(u=>{o.stop(),e(u+r)},r,i),o}var gw=Ba("start","end","cancel","interrupt"),mw=[],F_=0,sp=1,xu=2,pa=3,op=4,bu=5,_a=6;function Oa(e,r,i,o,u,S){var y=e.__transition;if(!y)e.__transition={};else if(i in y)return;vw(e,i,{name:r,index:o,group:u,on:gw,tween:mw,time:S.time,delay:S.delay,duration:S.duration,ease:S.ease,timer:null,state:F_})}function Xu(e,r){var i=tr(e,r);if(i.state>F_)throw new Error("too late; already scheduled");return i}function fr(e,r){var i=tr(e,r);if(i.state>pa)throw new Error("too late; already running");return i}function tr(e,r){var i=e.__transition;if(!i||!(i=i[r]))throw new Error("transition not found");return i}function vw(e,r,i){var o=e.__transition,u;o[r]=i,i.timer=H_(S,0,i.time);function S(_){i.state=sp,i.timer.restart(y,i.delay,i.time),i.delay<=_&&y(_-i.delay)}function y(_){var v,l,m,x;if(i.state!==sp)return c();for(v in o)if(x=o[v],x.name===i.name){if(x.state===pa)return ip(y);x.state===op?(x.state=_a,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete o[v]):+v<r&&(x.state=_a,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete o[v])}if(ip(function(){i.state===pa&&(i.state=op,i.timer.restart(a,i.delay,i.time),a(_))}),i.state=xu,i.on.call("start",e,e.__data__,i.index,i.group),i.state===xu){for(i.state=pa,u=new Array(m=i.tween.length),v=0,l=-1;v<m;++v)(x=i.tween[v].value.call(e,e.__data__,i.index,i.group))&&(u[++l]=x);u.length=l+1}}function a(_){for(var v=_<i.duration?i.ease.call(null,_/i.duration):(i.timer.restart(c),i.state=bu,1),l=-1,m=u.length;++l<m;)u[l].call(e,v);i.state===bu&&(i.on.call("end",e,e.__data__,i.index,i.group),c())}function c(){i.state=_a,i.timer.stop(),delete o[r];for(var _ in o)return;delete e.__transition}}function ga(e,r){var i=e.__transition,o,u,S=!0,y;if(i){r=r==null?null:r+"";for(y in i){if((o=i[y]).name!==r){S=!1;continue}u=o.state>xu&&o.state<bu,o.state=_a,o.timer.stop(),o.on.call(u?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete i[y]}S&&delete e.__transition}}function yw(e){return this.each(function(){ga(this,e)})}function ww(e,r){var i,o;return function(){var u=fr(this,e),S=u.tween;if(S!==i){o=i=S;for(var y=0,a=o.length;y<a;++y)if(o[y].name===r){o=o.slice(),o.splice(y,1);break}}u.tween=o}}function Sw(e,r,i){var o,u;if(typeof i!="function")throw new Error;return function(){var S=fr(this,e),y=S.tween;if(y!==o){u=(o=y).slice();for(var a={name:r,value:i},c=0,_=u.length;c<_;++c)if(u[c].name===r){u[c]=a;break}c===_&&u.push(a)}S.tween=u}}function Cw(e,r){var i=this._id;if(e+="",arguments.length<2){for(var o=tr(this.node(),i).tween,u=0,S=o.length,y;u<S;++u)if((y=o[u]).name===e)return y.value;return null}return this.each((r==null?ww:Sw)(i,e,r))}function Yu(e,r,i){var o=e._id;return e.each(function(){var u=fr(this,o);(u.value||(u.value={}))[r]=i.apply(this,arguments)}),function(u){return tr(u,o).value[r]}}function j_(e,r){var i;return(typeof r=="number"?lr:r instanceof xn?Ca:(i=xn(r))?(r=i,Ca):P_)(e,r)}function xw(e){return function(){this.removeAttribute(e)}}function bw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ew(e,r,i){var o,u=i+"",S;return function(){var y=this.getAttribute(e);return y===u?null:y===o?S:S=r(o=y,i)}}function kw(e,r,i){var o,u=i+"",S;return function(){var y=this.getAttributeNS(e.space,e.local);return y===u?null:y===o?S:S=r(o=y,i)}}function Lw(e,r,i){var o,u,S;return function(){var y,a=i(this),c;return a==null?void this.removeAttribute(e):(y=this.getAttribute(e),c=a+"",y===c?null:y===o&&c===u?S:(u=c,S=r(o=y,a)))}}function Rw(e,r,i){var o,u,S;return function(){var y,a=i(this),c;return a==null?void this.removeAttributeNS(e.space,e.local):(y=this.getAttributeNS(e.space,e.local),c=a+"",y===c?null:y===o&&c===u?S:(u=c,S=r(o=y,a)))}}function Dw(e,r){var i=Na(e),o=i==="transform"?lw:j_;return this.attrTween(e,typeof r=="function"?(i.local?Rw:Lw)(i,o,Yu(this,"attr."+e,r)):r==null?(i.local?bw:xw)(i):(i.local?kw:Ew)(i,o,r))}function Tw(e,r){return function(i){this.setAttribute(e,r.call(this,i))}}function Aw(e,r){return function(i){this.setAttributeNS(e.space,e.local,r.call(this,i))}}function Mw(e,r){var i,o;function u(){var S=r.apply(this,arguments);return S!==o&&(i=(o=S)&&Aw(e,S)),i}return u._value=r,u}function Pw(e,r){var i,o;function u(){var S=r.apply(this,arguments);return S!==o&&(i=(o=S)&&Tw(e,S)),i}return u._value=r,u}function Bw(e,r){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(r==null)return this.tween(i,null);if(typeof r!="function")throw new Error;var o=Na(e);return this.tween(i,(o.local?Mw:Pw)(o,r))}function Nw(e,r){return function(){Xu(this,e).delay=+r.apply(this,arguments)}}function Iw(e,r){return r=+r,function(){Xu(this,e).delay=r}}function Ow(e){var r=this._id;return arguments.length?this.each((typeof e=="function"?Nw:Iw)(r,e)):tr(this.node(),r).delay}function Hw(e,r){return function(){fr(this,e).duration=+r.apply(this,arguments)}}function Fw(e,r){return r=+r,function(){fr(this,e).duration=r}}function jw(e){var r=this._id;return arguments.length?this.each((typeof e=="function"?Hw:Fw)(r,e)):tr(this.node(),r).duration}function zw(e,r){if(typeof r!="function")throw new Error;return function(){fr(this,e).ease=r}}function $w(e){var r=this._id;return arguments.length?this.each(zw(r,e)):tr(this.node(),r).ease}function Ww(e,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;fr(this,e).ease=i}}function Uw(e){if(typeof e!="function")throw new Error;return this.each(Ww(this._id,e))}function Vw(e){typeof e!="function"&&(e=m_(e));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var S=r[u],y=S.length,a=o[u]=[],c,_=0;_<y;++_)(c=S[_])&&e.call(c,c.__data__,_,S)&&a.push(c);return new kr(o,this._parents,this._name,this._id)}function qw(e){if(e._id!==this._id)throw new Error;for(var r=this._groups,i=e._groups,o=r.length,u=i.length,S=Math.min(o,u),y=new Array(o),a=0;a<S;++a)for(var c=r[a],_=i[a],v=c.length,l=y[a]=new Array(v),m,x=0;x<v;++x)(m=c[x]||_[x])&&(l[x]=m);for(;a<o;++a)y[a]=r[a];return new kr(y,this._parents,this._name,this._id)}function Kw(e){return(e+"").trim().split(/^|\s+/).every(function(r){var i=r.indexOf(".");return i>=0&&(r=r.slice(0,i)),!r||r==="start"})}function Xw(e,r,i){var o,u,S=Kw(r)?Xu:fr;return function(){var y=S(this,e),a=y.on;a!==o&&(u=(o=a).copy()).on(r,i),y.on=u}}function Yw(e,r){var i=this._id;return arguments.length<2?tr(this.node(),i).on.on(e):this.each(Xw(i,e,r))}function Gw(e){return function(){var r=this.parentNode;for(var i in this.__transition)if(+i!==e)return;r&&r.removeChild(this)}}function Qw(){return this.on("end.remove",Gw(this._id))}function Jw(e){var r=this._name,i=this._id;typeof e!="function"&&(e=Wu(e));for(var o=this._groups,u=o.length,S=new Array(u),y=0;y<u;++y)for(var a=o[y],c=a.length,_=S[y]=new Array(c),v,l,m=0;m<c;++m)(v=a[m])&&(l=e.call(v,v.__data__,m,a))&&("__data__"in v&&(l.__data__=v.__data__),_[m]=l,Oa(_[m],r,i,m,_,tr(v,i)));return new kr(S,this._parents,r,i)}function Zw(e){var r=this._name,i=this._id;typeof e!="function"&&(e=g_(e));for(var o=this._groups,u=o.length,S=[],y=[],a=0;a<u;++a)for(var c=o[a],_=c.length,v,l=0;l<_;++l)if(v=c[l]){for(var m=e.call(v,v.__data__,l,c),x,b=tr(v,i),C=0,f=m.length;C<f;++C)(x=m[C])&&Oa(x,r,i,C,m,b);S.push(m),y.push(v)}return new kr(S,y,r,i)}var eS=ks.prototype.constructor;function tS(){return new eS(this._groups,this._parents)}function rS(e,r){var i,o,u;return function(){var S=li(this,e),y=(this.style.removeProperty(e),li(this,e));return S===y?null:S===i&&y===o?u:u=r(i=S,o=y)}}function z_(e){return function(){this.style.removeProperty(e)}}function nS(e,r,i){var o,u=i+"",S;return function(){var y=li(this,e);return y===u?null:y===o?S:S=r(o=y,i)}}function iS(e,r,i){var o,u,S;return function(){var y=li(this,e),a=i(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),li(this,e))),y===c?null:y===o&&c===u?S:(u=c,S=r(o=y,a))}}function sS(e,r){var i,o,u,S="style."+r,y="end."+S,a;return function(){var c=fr(this,e),_=c.on,v=c.value[S]==null?a||(a=z_(r)):void 0;(_!==i||u!==v)&&(o=(i=_).copy()).on(y,u=v),c.on=o}}function oS(e,r,i){var o=(e+="")=="transform"?aw:j_;return r==null?this.styleTween(e,rS(e,o)).on("end.style."+e,z_(e)):typeof r=="function"?this.styleTween(e,iS(e,o,Yu(this,"style."+e,r))).each(sS(this._id,e)):this.styleTween(e,nS(e,o,r),i).on("end.style."+e,null)}function aS(e,r,i){return function(o){this.style.setProperty(e,r.call(this,o),i)}}function lS(e,r,i){var o,u;function S(){var y=r.apply(this,arguments);return y!==u&&(o=(u=y)&&aS(e,y,i)),o}return S._value=r,S}function cS(e,r,i){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(r==null)return this.tween(o,null);if(typeof r!="function")throw new Error;return this.tween(o,lS(e,r,i??""))}function uS(e){return function(){this.textContent=e}}function hS(e){return function(){var r=e(this);this.textContent=r??""}}function dS(e){return this.tween("text",typeof e=="function"?hS(Yu(this,"text",e)):uS(e==null?"":e+""))}function fS(e){return function(r){this.textContent=e.call(this,r)}}function pS(e){var r,i;function o(){var u=e.apply(this,arguments);return u!==i&&(r=(i=u)&&fS(u)),r}return o._value=e,o}function _S(e){var r="text";if(arguments.length<1)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,pS(e))}function gS(){for(var e=this._name,r=this._id,i=$_(),o=this._groups,u=o.length,S=0;S<u;++S)for(var y=o[S],a=y.length,c,_=0;_<a;++_)if(c=y[_]){var v=tr(c,r);Oa(c,e,i,_,y,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new kr(o,this._parents,e,i)}function mS(){var e,r,i=this,o=i._id,u=i.size();return new Promise(function(S,y){var a={value:y},c={value:function(){--u===0&&S()}};i.each(function(){var _=fr(this,o),v=_.on;v!==e&&(r=(e=v).copy(),r._.cancel.push(a),r._.interrupt.push(a),r._.end.push(c)),_.on=r}),u===0&&S()})}var vS=0;function kr(e,r,i,o){this._groups=e,this._parents=r,this._name=i,this._id=o}function $_(){return++vS}var xr=ks.prototype;kr.prototype={constructor:kr,select:Jw,selectAll:Zw,selectChild:xr.selectChild,selectChildren:xr.selectChildren,filter:Vw,merge:qw,selection:tS,transition:gS,call:xr.call,nodes:xr.nodes,node:xr.node,size:xr.size,empty:xr.empty,each:xr.each,on:Yw,attr:Dw,attrTween:Bw,style:oS,styleTween:cS,text:dS,textTween:_S,remove:Qw,tween:Cw,delay:Ow,duration:jw,ease:$w,easeVarying:Uw,end:mS,[Symbol.iterator]:xr[Symbol.iterator]};function yS(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var wS={time:null,delay:0,duration:250,ease:yS};function SS(e,r){for(var i;!(i=e.__transition)||!(i=i[r]);)if(!(e=e.parentNode))throw new Error(`transition ${r} not found`);return i}function CS(e){var r,i;e instanceof kr?(r=e._id,e=e._name):(r=$_(),(i=wS).time=Ku(),e=e==null?null:e+"");for(var o=this._groups,u=o.length,S=0;S<u;++S)for(var y=o[S],a=y.length,c,_=0;_<a;++_)(c=y[_])&&Oa(c,e,r,_,y,i||SS(c,r));return new kr(o,this._parents,e,r)}ks.prototype.interrupt=yw;ks.prototype.transition=CS;const ra=e=>()=>e;function xS(e,{sourceEvent:r,target:i,transform:o,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:u}})}function Er(e,r,i){this.k=e,this.x=r,this.y=i}Er.prototype={constructor:Er,scale:function(e){return e===1?this:new Er(this.k*e,this.x,this.y)},translate:function(e,r){return e===0&r===0?this:new Er(this.k,this.x+this.k*e,this.y+this.k*r)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ha=new Er(1,0,0);W_.prototype=Er.prototype;function W_(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ha;return e.__zoom}function Xc(e){e.stopImmediatePropagation()}function us(e){e.preventDefault(),e.stopImmediatePropagation()}function bS(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function ES(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function ap(){return this.__zoom||Ha}function kS(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function LS(){return navigator.maxTouchPoints||"ontouchstart"in this}function RS(e,r,i){var o=e.invertX(r[0][0])-i[0][0],u=e.invertX(r[1][0])-i[1][0],S=e.invertY(r[0][1])-i[0][1],y=e.invertY(r[1][1])-i[1][1];return e.translate(u>o?(o+u)/2:Math.min(0,o)||Math.max(0,u),y>S?(S+y)/2:Math.min(0,S)||Math.max(0,y))}function U_(){var e=bS,r=ES,i=RS,o=kS,u=LS,S=[0,1/0],y=[[-1/0,-1/0],[1/0,1/0]],a=250,c=fa,_=Ba("start","zoom","end"),v,l,m,x=500,b=150,C=0,f=10;function p(I){I.property("__zoom",ap).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",W).filter(u).on("touchstart.zoom",z).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(I,q,V,K){var U=I.selection?I.selection():I;U.property("__zoom",ap),I!==U?L(I,q,V,K):U.interrupt().each(function(){R(this,arguments).event(K).start().zoom(null,typeof q=="function"?q.apply(this,arguments):q).end()})},p.scaleBy=function(I,q,V,K){p.scaleTo(I,function(){var U=this.__zoom.k,A=typeof q=="function"?q.apply(this,arguments):q;return U*A},V,K)},p.scaleTo=function(I,q,V,K){p.transform(I,function(){var U=r.apply(this,arguments),A=this.__zoom,B=V==null?w(U):typeof V=="function"?V.apply(this,arguments):V,P=A.invert(B),H=typeof q=="function"?q.apply(this,arguments):q;return i(h(d(A,H),B,P),U,y)},V,K)},p.translateBy=function(I,q,V,K){p.transform(I,function(){return i(this.__zoom.translate(typeof q=="function"?q.apply(this,arguments):q,typeof V=="function"?V.apply(this,arguments):V),r.apply(this,arguments),y)},null,K)},p.translateTo=function(I,q,V,K,U){p.transform(I,function(){var A=r.apply(this,arguments),B=this.__zoom,P=K==null?w(A):typeof K=="function"?K.apply(this,arguments):K;return i(Ha.translate(P[0],P[1]).scale(B.k).translate(typeof q=="function"?-q.apply(this,arguments):-q,typeof V=="function"?-V.apply(this,arguments):-V),A,y)},K,U)};function d(I,q){return q=Math.max(S[0],Math.min(S[1],q)),q===I.k?I:new Er(q,I.x,I.y)}function h(I,q,V){var K=q[0]-V[0]*I.k,U=q[1]-V[1]*I.k;return K===I.x&&U===I.y?I:new Er(I.k,K,U)}function w(I){return[(+I[0][0]+ +I[1][0])/2,(+I[0][1]+ +I[1][1])/2]}function L(I,q,V,K){I.on("start.zoom",function(){R(this,arguments).event(K).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(K).end()}).tween("zoom",function(){var U=this,A=arguments,B=R(U,A).event(K),P=r.apply(U,A),H=V==null?w(P):typeof V=="function"?V.apply(U,A):V,G=Math.max(P[1][0]-P[0][0],P[1][1]-P[0][1]),Z=U.__zoom,se=typeof q=="function"?q.apply(U,A):q,ee=c(Z.invert(H).concat(G/Z.k),se.invert(H).concat(G/se.k));return function(X){if(X===1)X=se;else{var O=ee(X),re=G/O[2];X=new Er(re,H[0]-O[0]*re,H[1]-O[1]*re)}B.zoom(null,X)}})}function R(I,q,V){return!V&&I.__zooming||new D(I,q)}function D(I,q){this.that=I,this.args=q,this.active=0,this.sourceEvent=null,this.extent=r.apply(I,q),this.taps=0}D.prototype={event:function(I){return I&&(this.sourceEvent=I),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(I,q){return this.mouse&&I!=="mouse"&&(this.mouse[1]=q.invert(this.mouse[0])),this.touch0&&I!=="touch"&&(this.touch0[1]=q.invert(this.touch0[0])),this.touch1&&I!=="touch"&&(this.touch1[1]=q.invert(this.touch1[0])),this.that.__zoom=q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(I){var q=Pt(this.that).datum();_.call(I,this.that,new xS(I,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:_}),q)}};function k(I,...q){if(!e.apply(this,arguments))return;var V=R(this,q).event(I),K=this.__zoom,U=Math.max(S[0],Math.min(S[1],K.k*Math.pow(2,o.apply(this,arguments)))),A=Qt(I);if(V.wheel)(V.mouse[0][0]!==A[0]||V.mouse[0][1]!==A[1])&&(V.mouse[1]=K.invert(V.mouse[0]=A)),clearTimeout(V.wheel);else{if(K.k===U)return;V.mouse=[A,K.invert(A)],ga(this),V.start()}us(I),V.wheel=setTimeout(B,b),V.zoom("mouse",i(h(d(K,U),V.mouse[0],V.mouse[1]),V.extent,y));function B(){V.wheel=null,V.end()}}function M(I,...q){if(m||!e.apply(this,arguments))return;var V=I.currentTarget,K=R(this,q,!0).event(I),U=Pt(I.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",G,!0),A=Qt(I,V),B=I.clientX,P=I.clientY;L_(I.view),Xc(I),K.mouse=[A,this.__zoom.invert(A)],ga(this),K.start();function H(Z){if(us(Z),!K.moved){var se=Z.clientX-B,ee=Z.clientY-P;K.moved=se*se+ee*ee>C}K.event(Z).zoom("mouse",i(h(K.that.__zoom,K.mouse[0]=Qt(Z,V),K.mouse[1]),K.extent,y))}function G(Z){U.on("mousemove.zoom mouseup.zoom",null),R_(Z.view,K.moved),us(Z),K.event(Z).end()}}function W(I,...q){if(e.apply(this,arguments)){var V=this.__zoom,K=Qt(I.changedTouches?I.changedTouches[0]:I,this),U=V.invert(K),A=V.k*(I.shiftKey?.5:2),B=i(h(d(V,A),K,U),r.apply(this,q),y);us(I),a>0?Pt(this).transition().duration(a).call(L,B,K,I):Pt(this).call(p.transform,B,K,I)}}function z(I,...q){if(e.apply(this,arguments)){var V=I.touches,K=V.length,U=R(this,q,I.changedTouches.length===K).event(I),A,B,P,H;for(Xc(I),B=0;B<K;++B)P=V[B],H=Qt(P,this),H=[H,this.__zoom.invert(H),P.identifier],U.touch0?!U.touch1&&U.touch0[2]!==H[2]&&(U.touch1=H,U.taps=0):(U.touch0=H,A=!0,U.taps=1+!!v);v&&(v=clearTimeout(v)),A&&(U.taps<2&&(l=H[0],v=setTimeout(function(){v=null},x)),ga(this),U.start())}}function F(I,...q){if(this.__zooming){var V=R(this,q).event(I),K=I.changedTouches,U=K.length,A,B,P,H;for(us(I),A=0;A<U;++A)B=K[A],P=Qt(B,this),V.touch0&&V.touch0[2]===B.identifier?V.touch0[0]=P:V.touch1&&V.touch1[2]===B.identifier&&(V.touch1[0]=P);if(B=V.that.__zoom,V.touch1){var G=V.touch0[0],Z=V.touch0[1],se=V.touch1[0],ee=V.touch1[1],X=(X=se[0]-G[0])*X+(X=se[1]-G[1])*X,O=(O=ee[0]-Z[0])*O+(O=ee[1]-Z[1])*O;B=d(B,Math.sqrt(X/O)),P=[(G[0]+se[0])/2,(G[1]+se[1])/2],H=[(Z[0]+ee[0])/2,(Z[1]+ee[1])/2]}else if(V.touch0)P=V.touch0[0],H=V.touch0[1];else return;V.zoom("touch",i(h(B,P,H),V.extent,y))}}function N(I,...q){if(this.__zooming){var V=R(this,q).event(I),K=I.changedTouches,U=K.length,A,B;for(Xc(I),m&&clearTimeout(m),m=setTimeout(function(){m=null},x),A=0;A<U;++A)B=K[A],V.touch0&&V.touch0[2]===B.identifier?delete V.touch0:V.touch1&&V.touch1[2]===B.identifier&&delete V.touch1;if(V.touch1&&!V.touch0&&(V.touch0=V.touch1,delete V.touch1),V.touch0)V.touch0[1]=this.__zoom.invert(V.touch0[0]);else if(V.end(),V.taps===2&&(B=Qt(B,this),Math.hypot(l[0]-B[0],l[1]-B[1])<f)){var P=Pt(this).on("dblclick.zoom");P&&P.apply(this,arguments)}}}return p.wheelDelta=function(I){return arguments.length?(o=typeof I=="function"?I:ra(+I),p):o},p.filter=function(I){return arguments.length?(e=typeof I=="function"?I:ra(!!I),p):e},p.touchable=function(I){return arguments.length?(u=typeof I=="function"?I:ra(!!I),p):u},p.extent=function(I){return arguments.length?(r=typeof I=="function"?I:ra([[+I[0][0],+I[0][1]],[+I[1][0],+I[1][1]]]),p):r},p.scaleExtent=function(I){return arguments.length?(S[0]=+I[0],S[1]=+I[1],p):[S[0],S[1]]},p.translateExtent=function(I){return arguments.length?(y[0][0]=+I[0][0],y[1][0]=+I[1][0],y[0][1]=+I[0][1],y[1][1]=+I[1][1],p):[[y[0][0],y[0][1]],[y[1][0],y[1][1]]]},p.constrain=function(I){return arguments.length?(i=I,p):i},p.duration=function(I){return arguments.length?(a=+I,p):a},p.interpolate=function(I){return arguments.length?(c=I,p):c},p.on=function(){var I=_.on.apply(_,arguments);return I===_?p:I},p.clickDistance=function(I){return arguments.length?(C=(I=+I)*I,p):Math.sqrt(C)},p.tapDistance=function(I){return arguments.length?(f=+I,p):f},p}const dr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:r,sourceHandle:i,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?i:o}", edge id: ${r}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},ws=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],V_=["Enter"," ","Escape"],q_={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:r,y:i})=>`Moved selected node ${e}. New position, x: ${r}, y: ${i}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var ui;(function(e){e.Strict="strict",e.Loose="loose"})(ui||(ui={}));var Cn;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Cn||(Cn={}));var Ss;(function(e){e.Partial="partial",e.Full="full"})(Ss||(Ss={}));const K_={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Jr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Jr||(Jr={}));var ka;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ka||(ka={}));var be;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(be||(be={}));const lp={[be.Left]:be.Right,[be.Right]:be.Left,[be.Top]:be.Bottom,[be.Bottom]:be.Top};function X_(e){return e===null?null:e?"valid":"invalid"}const Y_=e=>"id"in e&&"source"in e&&"target"in e,DS=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Gu=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Rs=(e,r=[0,0])=>{const{width:i,height:o}=Lr(e),u=e.origin??r,S=i*u[0],y=o*u[1];return{x:e.position.x-S,y:e.position.y-y}},TS=(e,r={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const i=e.reduce((o,u)=>{const S=typeof u=="string";let y=!r.nodeLookup&&!S?u:void 0;r.nodeLookup&&(y=S?r.nodeLookup.get(u):Gu(u)?u:r.nodeLookup.get(u.id));const a=y?La(y,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Fa(o,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ja(i)},Ds=(e,r={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return e.forEach(u=>{(r.filter===void 0||r.filter(u))&&(i=Fa(i,La(u)),o=!0)}),o?ja(i):{x:0,y:0,width:0,height:0}},Qu=(e,r,[i,o,u]=[0,0,1],S=!1,y=!1)=>{const a={...As(r,[i,o,u]),width:r.width/u,height:r.height/u},c=[];for(const _ of e.values()){const{measured:v,selectable:l=!0,hidden:m=!1}=_;if(y&&!l||m)continue;const x=v.width??_.width??_.initialWidth??null,b=v.height??_.height??_.initialHeight??null,C=Cs(a,di(_)),f=(x??0)*(b??0),p=S&&C>0;(!_.internals.handleBounds||p||C>=f||_.dragging)&&c.push(_)}return c},AS=(e,r)=>{const i=new Set;return e.forEach(o=>{i.add(o.id)}),r.filter(o=>i.has(o.source)||i.has(o.target))};function MS(e,r){const i=new Map,o=r!=null&&r.nodes?new Set(r.nodes.map(u=>u.id)):null;return e.forEach(u=>{u.measured.width&&u.measured.height&&((r==null?void 0:r.includeHiddenNodes)||!u.hidden)&&(!o||o.has(u.id))&&i.set(u.id,u)}),i}async function PS({nodes:e,width:r,height:i,panZoom:o,minZoom:u,maxZoom:S},y){if(e.size===0)return Promise.resolve(!0);const a=MS(e,y),c=Ds(a),_=Ju(c,r,i,(y==null?void 0:y.minZoom)??u,(y==null?void 0:y.maxZoom)??S,(y==null?void 0:y.padding)??.1);return await o.setViewport(_,{duration:y==null?void 0:y.duration,ease:y==null?void 0:y.ease,interpolate:y==null?void 0:y.interpolate}),Promise.resolve(!0)}function G_({nodeId:e,nextPosition:r,nodeLookup:i,nodeOrigin:o=[0,0],nodeExtent:u,onError:S}){const y=i.get(e),a=y.parentId?i.get(y.parentId):void 0,{x:c,y:_}=a?a.internals.positionAbsolute:{x:0,y:0},v=y.origin??o;let l=y.extent||u;if(y.extent==="parent"&&!y.expandParent)if(!a)S==null||S("005",dr.error005());else{const x=a.measured.width,b=a.measured.height;x&&b&&(l=[[c,_],[c+x,_+b]])}else a&&fi(y.extent)&&(l=[[y.extent[0][0]+c,y.extent[0][1]+_],[y.extent[1][0]+c,y.extent[1][1]+_]]);const m=fi(l)?En(r,l,y.measured):r;return(y.measured.width===void 0||y.measured.height===void 0)&&(S==null||S("015",dr.error015())),{position:{x:m.x-c+(y.measured.width??0)*v[0],y:m.y-_+(y.measured.height??0)*v[1]},positionAbsolute:m}}async function BS({nodesToRemove:e=[],edgesToRemove:r=[],nodes:i,edges:o,onBeforeDelete:u}){const S=new Set(e.map(m=>m.id)),y=[];for(const m of i){if(m.deletable===!1)continue;const x=S.has(m.id),b=!x&&m.parentId&&y.find(C=>C.id===m.parentId);(x||b)&&y.push(m)}const a=new Set(r.map(m=>m.id)),c=o.filter(m=>m.deletable!==!1),v=AS(y,c);for(const m of c)a.has(m.id)&&!v.find(b=>b.id===m.id)&&v.push(m);if(!u)return{edges:v,nodes:y};const l=await u({nodes:y,edges:v});return typeof l=="boolean"?l?{edges:v,nodes:y}:{edges:[],nodes:[]}:l}const hi=(e,r=0,i=1)=>Math.min(Math.max(e,r),i),En=(e={x:0,y:0},r,i)=>({x:hi(e.x,r[0][0],r[1][0]-((i==null?void 0:i.width)??0)),y:hi(e.y,r[0][1],r[1][1]-((i==null?void 0:i.height)??0))});function Q_(e,r,i){const{width:o,height:u}=Lr(i),{x:S,y}=i.internals.positionAbsolute;return En(e,[[S,y],[S+o,y+u]],r)}const cp=(e,r,i)=>e<r?hi(Math.abs(e-r),1,r)/r:e>i?-hi(Math.abs(e-i),1,r)/r:0,J_=(e,r,i=15,o=40)=>{const u=cp(e.x,o,r.width-o)*i,S=cp(e.y,o,r.height-o)*i;return[u,S]},Fa=(e,r)=>({x:Math.min(e.x,r.x),y:Math.min(e.y,r.y),x2:Math.max(e.x2,r.x2),y2:Math.max(e.y2,r.y2)}),Eu=({x:e,y:r,width:i,height:o})=>({x:e,y:r,x2:e+i,y2:r+o}),ja=({x:e,y:r,x2:i,y2:o})=>({x:e,y:r,width:i-e,height:o-r}),di=(e,r=[0,0])=>{var u,S;const{x:i,y:o}=Gu(e)?e.internals.positionAbsolute:Rs(e,r);return{x:i,y:o,width:((u=e.measured)==null?void 0:u.width)??e.width??e.initialWidth??0,height:((S=e.measured)==null?void 0:S.height)??e.height??e.initialHeight??0}},La=(e,r=[0,0])=>{var u,S;const{x:i,y:o}=Gu(e)?e.internals.positionAbsolute:Rs(e,r);return{x:i,y:o,x2:i+(((u=e.measured)==null?void 0:u.width)??e.width??e.initialWidth??0),y2:o+(((S=e.measured)==null?void 0:S.height)??e.height??e.initialHeight??0)}},Z_=(e,r)=>ja(Fa(Eu(e),Eu(r))),Cs=(e,r)=>{const i=Math.max(0,Math.min(e.x+e.width,r.x+r.width)-Math.max(e.x,r.x)),o=Math.max(0,Math.min(e.y+e.height,r.y+r.height)-Math.max(e.y,r.y));return Math.ceil(i*o)},up=e=>Zt(e.width)&&Zt(e.height)&&Zt(e.x)&&Zt(e.y),Zt=e=>!isNaN(e)&&isFinite(e),NS=(e,r)=>{},Ts=(e,r=[1,1])=>({x:r[0]*Math.round(e.x/r[0]),y:r[1]*Math.round(e.y/r[1])}),As=({x:e,y:r},[i,o,u],S=!1,y=[1,1])=>{const a={x:(e-i)/u,y:(r-o)/u};return S?Ts(a,y):a},Ra=({x:e,y:r},[i,o,u])=>({x:e*u+i,y:r*u+o});function ni(e,r){if(typeof e=="number")return Math.floor((r-r/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(i)}if(typeof e=="string"&&e.endsWith("%")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(r*i*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function IS(e,r,i){if(typeof e=="string"||typeof e=="number"){const o=ni(e,i),u=ni(e,r);return{top:o,right:u,bottom:o,left:u,x:u*2,y:o*2}}if(typeof e=="object"){const o=ni(e.top??e.y??0,i),u=ni(e.bottom??e.y??0,i),S=ni(e.left??e.x??0,r),y=ni(e.right??e.x??0,r);return{top:o,right:y,bottom:u,left:S,x:S+y,y:o+u}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function OS(e,r,i,o,u,S){const{x:y,y:a}=Ra(e,[r,i,o]),{x:c,y:_}=Ra({x:e.x+e.width,y:e.y+e.height},[r,i,o]),v=u-c,l=S-_;return{left:Math.floor(y),top:Math.floor(a),right:Math.floor(v),bottom:Math.floor(l)}}const Ju=(e,r,i,o,u,S)=>{const y=IS(S,r,i),a=(r-y.x)/e.width,c=(i-y.y)/e.height,_=Math.min(a,c),v=hi(_,o,u),l=e.x+e.width/2,m=e.y+e.height/2,x=r/2-l*v,b=i/2-m*v,C=OS(e,x,b,v,r,i),f={left:Math.min(C.left-y.left,0),top:Math.min(C.top-y.top,0),right:Math.min(C.right-y.right,0),bottom:Math.min(C.bottom-y.bottom,0)};return{x:x-f.left+f.right,y:b-f.top+f.bottom,zoom:v}},xs=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function fi(e){return e!=null&&e!=="parent"}function Lr(e){var r,i;return{width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}}function eg(e){var r,i;return(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth)!==void 0&&(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight)!==void 0}function tg(e,r={width:0,height:0},i,o,u){const S={...e},y=o.get(i);if(y){const a=y.origin||u;S.x+=y.internals.positionAbsolute.x-(r.width??0)*a[0],S.y+=y.internals.positionAbsolute.y-(r.height??0)*a[1]}return S}function hp(e,r){if(e.size!==r.size)return!1;for(const i of e)if(!r.has(i))return!1;return!0}function HS(){let e,r;return{promise:new Promise((o,u)=>{e=o,r=u}),resolve:e,reject:r}}function FS(e){return{...q_,...e||{}}}function _s(e,{snapGrid:r=[0,0],snapToGrid:i=!1,transform:o,containerBounds:u}){const{x:S,y}=er(e),a=As({x:S-((u==null?void 0:u.left)??0),y:y-((u==null?void 0:u.top)??0)},o),{x:c,y:_}=i?Ts(a,r):a;return{xSnapped:c,ySnapped:_,...a}}const Zu=e=>({width:e.offsetWidth,height:e.offsetHeight}),rg=e=>{var r;return((r=e==null?void 0:e.getRootNode)==null?void 0:r.call(e))||(window==null?void 0:window.document)},jS=["INPUT","SELECT","TEXTAREA"];function ng(e){var o,u;const r=((u=(o=e.composedPath)==null?void 0:o.call(e))==null?void 0:u[0])||e.target;return(r==null?void 0:r.nodeType)!==1?!1:jS.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const ig=e=>"clientX"in e,er=(e,r)=>{var S,y;const i=ig(e),o=i?e.clientX:(S=e.touches)==null?void 0:S[0].clientX,u=i?e.clientY:(y=e.touches)==null?void 0:y[0].clientY;return{x:o-((r==null?void 0:r.left)??0),y:u-((r==null?void 0:r.top)??0)}},dp=(e,r,i,o,u)=>{const S=r.querySelectorAll(`.${e}`);return!S||!S.length?null:Array.from(S).map(y=>{const a=y.getBoundingClientRect();return{id:y.getAttribute("data-handleid"),type:e,nodeId:u,position:y.getAttribute("data-handlepos"),x:(a.left-i.left)/o,y:(a.top-i.top)/o,...Zu(y)}})};function sg({sourceX:e,sourceY:r,targetX:i,targetY:o,sourceControlX:u,sourceControlY:S,targetControlX:y,targetControlY:a}){const c=e*.125+u*.375+y*.375+i*.125,_=r*.125+S*.375+a*.375+o*.125,v=Math.abs(c-e),l=Math.abs(_-r);return[c,_,v,l]}function na(e,r){return e>=0?.5*e:r*25*Math.sqrt(-e)}function fp({pos:e,x1:r,y1:i,x2:o,y2:u,c:S}){switch(e){case be.Left:return[r-na(r-o,S),i];case be.Right:return[r+na(o-r,S),i];case be.Top:return[r,i-na(i-u,S)];case be.Bottom:return[r,i+na(u-i,S)]}}function og({sourceX:e,sourceY:r,sourcePosition:i=be.Bottom,targetX:o,targetY:u,targetPosition:S=be.Top,curvature:y=.25}){const[a,c]=fp({pos:i,x1:e,y1:r,x2:o,y2:u,c:y}),[_,v]=fp({pos:S,x1:o,y1:u,x2:e,y2:r,c:y}),[l,m,x,b]=sg({sourceX:e,sourceY:r,targetX:o,targetY:u,sourceControlX:a,sourceControlY:c,targetControlX:_,targetControlY:v});return[`M${e},${r} C${a},${c} ${_},${v} ${o},${u}`,l,m,x,b]}function ag({sourceX:e,sourceY:r,targetX:i,targetY:o}){const u=Math.abs(i-e)/2,S=i<e?i+u:i-u,y=Math.abs(o-r)/2,a=o<r?o+y:o-y;return[S,a,u,y]}function zS({sourceNode:e,targetNode:r,selected:i=!1,zIndex:o=0,elevateOnSelect:u=!1,zIndexMode:S="basic"}){if(S==="manual")return o;const y=u&&i?o+1e3:o,a=Math.max(e.parentId||u&&e.selected?e.internals.z:0,r.parentId||u&&r.selected?r.internals.z:0);return y+a}function $S({sourceNode:e,targetNode:r,width:i,height:o,transform:u}){const S=Fa(La(e),La(r));S.x===S.x2&&(S.x2+=1),S.y===S.y2&&(S.y2+=1);const y={x:-u[0]/u[2],y:-u[1]/u[2],width:i/u[2],height:o/u[2]};return Cs(y,ja(S))>0}const WS=({source:e,sourceHandle:r,target:i,targetHandle:o})=>`xy-edge__${e}${r||""}-${i}${o||""}`,US=(e,r)=>r.some(i=>i.source===e.source&&i.target===e.target&&(i.sourceHandle===e.sourceHandle||!i.sourceHandle&&!e.sourceHandle)&&(i.targetHandle===e.targetHandle||!i.targetHandle&&!e.targetHandle)),VS=(e,r,i={})=>{if(!e.source||!e.target)return r;const o=i.getEdgeId||WS;let u;return Y_(e)?u={...e}:u={...e,id:o(e)},US(u,r)?r:(u.sourceHandle===null&&delete u.sourceHandle,u.targetHandle===null&&delete u.targetHandle,r.concat(u))};function lg({sourceX:e,sourceY:r,targetX:i,targetY:o}){const[u,S,y,a]=ag({sourceX:e,sourceY:r,targetX:i,targetY:o});return[`M ${e},${r}L ${i},${o}`,u,S,y,a]}const pp={[be.Left]:{x:-1,y:0},[be.Right]:{x:1,y:0},[be.Top]:{x:0,y:-1},[be.Bottom]:{x:0,y:1}},qS=({source:e,sourcePosition:r=be.Bottom,target:i})=>r===be.Left||r===be.Right?e.x<i.x?{x:1,y:0}:{x:-1,y:0}:e.y<i.y?{x:0,y:1}:{x:0,y:-1},_p=(e,r)=>Math.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2));function KS({source:e,sourcePosition:r=be.Bottom,target:i,targetPosition:o=be.Top,center:u,offset:S,stepPosition:y}){const a=pp[r],c=pp[o],_={x:e.x+a.x*S,y:e.y+a.y*S},v={x:i.x+c.x*S,y:i.y+c.y*S},l=qS({source:_,sourcePosition:r,target:v}),m=l.x!==0?"x":"y",x=l[m];let b=[],C,f;const p={x:0,y:0},d={x:0,y:0},[,,h,w]=ag({sourceX:e.x,sourceY:e.y,targetX:i.x,targetY:i.y});if(a[m]*c[m]===-1){m==="x"?(C=u.x??_.x+(v.x-_.x)*y,f=u.y??(_.y+v.y)/2):(C=u.x??(_.x+v.x)/2,f=u.y??_.y+(v.y-_.y)*y);const k=[{x:C,y:_.y},{x:C,y:v.y}],M=[{x:_.x,y:f},{x:v.x,y:f}];a[m]===x?b=m==="x"?k:M:b=m==="x"?M:k}else{const k=[{x:_.x,y:v.y}],M=[{x:v.x,y:_.y}];if(m==="x"?b=a.x===x?M:k:b=a.y===x?k:M,r===o){const I=Math.abs(e[m]-i[m]);if(I<=S){const q=Math.min(S-1,S-I);a[m]===x?p[m]=(_[m]>e[m]?-1:1)*q:d[m]=(v[m]>i[m]?-1:1)*q}}if(r!==o){const I=m==="x"?"y":"x",q=a[m]===c[I],V=_[I]>v[I],K=_[I]<v[I];(a[m]===1&&(!q&&V||q&&K)||a[m]!==1&&(!q&&K||q&&V))&&(b=m==="x"?k:M)}const W={x:_.x+p.x,y:_.y+p.y},z={x:v.x+d.x,y:v.y+d.y},F=Math.max(Math.abs(W.x-b[0].x),Math.abs(z.x-b[0].x)),N=Math.max(Math.abs(W.y-b[0].y),Math.abs(z.y-b[0].y));F>=N?(C=(W.x+z.x)/2,f=b[0].y):(C=b[0].x,f=(W.y+z.y)/2)}const L={x:_.x+p.x,y:_.y+p.y},R={x:v.x+d.x,y:v.y+d.y};return[[e,...L.x!==b[0].x||L.y!==b[0].y?[L]:[],...b,...R.x!==b[b.length-1].x||R.y!==b[b.length-1].y?[R]:[],i],C,f,h,w]}function XS(e,r,i,o){const u=Math.min(_p(e,r)/2,_p(r,i)/2,o),{x:S,y}=r;if(e.x===S&&S===i.x||e.y===y&&y===i.y)return`L${S} ${y}`;if(e.y===y){const _=e.x<i.x?-1:1,v=e.y<i.y?1:-1;return`L ${S+u*_},${y}Q ${S},${y} ${S},${y+u*v}`}const a=e.x<i.x?1:-1,c=e.y<i.y?-1:1;return`L ${S},${y+u*c}Q ${S},${y} ${S+u*a},${y}`}function ku({sourceX:e,sourceY:r,sourcePosition:i=be.Bottom,targetX:o,targetY:u,targetPosition:S=be.Top,borderRadius:y=5,centerX:a,centerY:c,offset:_=20,stepPosition:v=.5}){const[l,m,x,b,C]=KS({source:{x:e,y:r},sourcePosition:i,target:{x:o,y:u},targetPosition:S,center:{x:a,y:c},offset:_,stepPosition:v});let f=`M${l[0].x} ${l[0].y}`;for(let p=1;p<l.length-1;p++)f+=XS(l[p-1],l[p],l[p+1],y);return f+=`L${l[l.length-1].x} ${l[l.length-1].y}`,[f,m,x,b,C]}function gp(e){var r;return e&&!!(e.internals.handleBounds||(r=e.handles)!=null&&r.length)&&!!(e.measured.width||e.width||e.initialWidth)}function YS(e){var l;const{sourceNode:r,targetNode:i}=e;if(!gp(r)||!gp(i))return null;const o=r.internals.handleBounds||mp(r.handles),u=i.internals.handleBounds||mp(i.handles),S=vp((o==null?void 0:o.source)??[],e.sourceHandle),y=vp(e.connectionMode===ui.Strict?(u==null?void 0:u.target)??[]:((u==null?void 0:u.target)??[]).concat((u==null?void 0:u.source)??[]),e.targetHandle);if(!S||!y)return(l=e.onError)==null||l.call(e,"008",dr.error008(S?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(S==null?void 0:S.position)||be.Bottom,c=(y==null?void 0:y.position)||be.Top,_=kn(r,S,a),v=kn(i,y,c);return{sourceX:_.x,sourceY:_.y,targetX:v.x,targetY:v.y,sourcePosition:a,targetPosition:c}}function mp(e){if(!e)return null;const r=[],i=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,o.type==="source"?r.push(o):o.type==="target"&&i.push(o);return{source:r,target:i}}function kn(e,r,i=be.Left,o=!1){const u=((r==null?void 0:r.x)??0)+e.internals.positionAbsolute.x,S=((r==null?void 0:r.y)??0)+e.internals.positionAbsolute.y,{width:y,height:a}=r??Lr(e);if(o)return{x:u+y/2,y:S+a/2};switch((r==null?void 0:r.position)??i){case be.Top:return{x:u+y/2,y:S};case be.Right:return{x:u+y,y:S+a/2};case be.Bottom:return{x:u+y/2,y:S+a};case be.Left:return{x:u,y:S+a/2}}}function vp(e,r){return e&&(r?e.find(i=>i.id===r):e[0])||null}function Lu(e,r){return e?typeof e=="string"?e:`${r?`${r}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function GS(e,{id:r,defaultColor:i,defaultMarkerStart:o,defaultMarkerEnd:u}){const S=new Set;return e.reduce((y,a)=>([a.markerStart||o,a.markerEnd||u].forEach(c=>{if(c&&typeof c=="object"){const _=Lu(c,r);S.has(_)||(y.push({id:_,color:c.color||i,...c}),S.add(_))}}),y),[]).sort((y,a)=>y.id.localeCompare(a.id))}const cg=1e3,QS=10,eh={nodeOrigin:[0,0],nodeExtent:ws,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},JS={...eh,checkEquality:!0};function th(e,r){const i={...e};for(const o in r)r[o]!==void 0&&(i[o]=r[o]);return i}function ZS(e,r,i){const o=th(eh,i);for(const u of e.values())if(u.parentId)nh(u,e,r,o);else{const S=Rs(u,o.nodeOrigin),y=fi(u.extent)?u.extent:o.nodeExtent,a=En(S,y,Lr(u));u.internals.positionAbsolute=a}}function eC(e,r){if(!e.handles)return e.measured?r==null?void 0:r.internals.handleBounds:void 0;const i=[],o=[];for(const u of e.handles){const S={id:u.id,width:u.width??1,height:u.height??1,nodeId:e.id,x:u.x,y:u.y,position:u.position,type:u.type};u.type==="source"?i.push(S):u.type==="target"&&o.push(S)}return{source:i,target:o}}function rh(e){return e==="manual"}function Ru(e,r,i,o={}){var v,l;const u=th(JS,o),S={i:0},y=new Map(r),a=u!=null&&u.elevateNodesOnSelect&&!rh(u.zIndexMode)?cg:0;let c=e.length>0,_=!1;r.clear(),i.clear();for(const m of e){let x=y.get(m.id);if(u.checkEquality&&m===(x==null?void 0:x.internals.userNode))r.set(m.id,x);else{const b=Rs(m,u.nodeOrigin),C=fi(m.extent)?m.extent:u.nodeExtent,f=En(b,C,Lr(m));x={...u.defaults,...m,measured:{width:(v=m.measured)==null?void 0:v.width,height:(l=m.measured)==null?void 0:l.height},internals:{positionAbsolute:f,handleBounds:eC(m,x),z:ug(m,a,u.zIndexMode),userNode:m}},r.set(m.id,x)}(x.measured===void 0||x.measured.width===void 0||x.measured.height===void 0)&&!x.hidden&&(c=!1),m.parentId&&nh(x,r,i,o,S),_||(_=m.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:_}}function tC(e,r){if(!e.parentId)return;const i=r.get(e.parentId);i?i.set(e.id,e):r.set(e.parentId,new Map([[e.id,e]]))}function nh(e,r,i,o,u){const{elevateNodesOnSelect:S,nodeOrigin:y,nodeExtent:a,zIndexMode:c}=th(eh,o),_=e.parentId,v=r.get(_);if(!v){console.warn(`Parent node ${_} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}tC(e,i),u&&!v.parentId&&v.internals.rootParentIndex===void 0&&c==="auto"&&(v.internals.rootParentIndex=++u.i,v.internals.z=v.internals.z+u.i*QS),u&&v.internals.rootParentIndex!==void 0&&(u.i=v.internals.rootParentIndex);const l=S&&!rh(c)?cg:0,{x:m,y:x,z:b}=rC(e,v,y,a,l,c),{positionAbsolute:C}=e.internals,f=m!==C.x||x!==C.y;(f||b!==e.internals.z)&&r.set(e.id,{...e,internals:{...e.internals,positionAbsolute:f?{x:m,y:x}:C,z:b}})}function ug(e,r,i){const o=Zt(e.zIndex)?e.zIndex:0;return rh(i)?o:o+(e.selected?r:0)}function rC(e,r,i,o,u,S){const{x:y,y:a}=r.internals.positionAbsolute,c=Lr(e),_=Rs(e,i),v=fi(e.extent)?En(_,e.extent,c):_;let l=En({x:y+v.x,y:a+v.y},o,c);e.extent==="parent"&&(l=Q_(l,c,r));const m=ug(e,u,S),x=r.internals.z??0;return{x:l.x,y:l.y,z:x>=m?x+1:m}}function ih(e,r,i,o=[0,0]){var y;const u=[],S=new Map;for(const a of e){const c=r.get(a.parentId);if(!c)continue;const _=((y=S.get(a.parentId))==null?void 0:y.expandedRect)??di(c),v=Z_(_,a.rect);S.set(a.parentId,{expandedRect:v,parent:c})}return S.size>0&&S.forEach(({expandedRect:a,parent:c},_)=>{var h;const v=c.internals.positionAbsolute,l=Lr(c),m=c.origin??o,x=a.x<v.x?Math.round(Math.abs(v.x-a.x)):0,b=a.y<v.y?Math.round(Math.abs(v.y-a.y)):0,C=Math.max(l.width,Math.round(a.width)),f=Math.max(l.height,Math.round(a.height)),p=(C-l.width)*m[0],d=(f-l.height)*m[1];(x>0||b>0||p||d)&&(u.push({id:_,type:"position",position:{x:c.position.x-x+p,y:c.position.y-b+d}}),(h=i.get(_))==null||h.forEach(w=>{e.some(L=>L.id===w.id)||u.push({id:w.id,type:"position",position:{x:w.position.x+x,y:w.position.y+b}})})),(l.width<a.width||l.height<a.height||x||b)&&u.push({id:_,type:"dimensions",setAttributes:!0,dimensions:{width:C+(x?m[0]*x-p:0),height:f+(b?m[1]*b-d:0)}})}),u}function nC(e,r,i,o,u,S,y){const a=o==null?void 0:o.querySelector(".xyflow__viewport");let c=!1;if(!a)return{changes:[],updatedInternals:c};const _=[],v=window.getComputedStyle(a),{m22:l}=new window.DOMMatrixReadOnly(v.transform),m=[];for(const x of e.values()){const b=r.get(x.id);if(!b)continue;if(b.hidden){r.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),c=!0;continue}const C=Zu(x.nodeElement),f=b.measured.width!==C.width||b.measured.height!==C.height;if(!!(C.width&&C.height&&(f||!b.internals.handleBounds||x.force))){const d=x.nodeElement.getBoundingClientRect(),h=fi(b.extent)?b.extent:S;let{positionAbsolute:w}=b.internals;b.parentId&&b.extent==="parent"?w=Q_(w,C,r.get(b.parentId)):h&&(w=En(w,h,C));const L={...b,measured:C,internals:{...b.internals,positionAbsolute:w,handleBounds:{source:dp("source",x.nodeElement,d,l,b.id),target:dp("target",x.nodeElement,d,l,b.id)}}};r.set(b.id,L),b.parentId&&nh(L,r,i,{nodeOrigin:u,zIndexMode:y}),c=!0,f&&(_.push({id:b.id,type:"dimensions",dimensions:C}),b.expandParent&&b.parentId&&m.push({id:b.id,parentId:b.parentId,rect:di(L,u)}))}}if(m.length>0){const x=ih(m,r,i,u);_.push(...x)}return{changes:_,updatedInternals:c}}async function iC({delta:e,panZoom:r,transform:i,translateExtent:o,width:u,height:S}){if(!r||!e.x&&!e.y)return Promise.resolve(!1);const y=await r.setViewportConstrained({x:i[0]+e.x,y:i[1]+e.y,zoom:i[2]},[[0,0],[u,S]],o),a=!!y&&(y.x!==i[0]||y.y!==i[1]||y.k!==i[2]);return Promise.resolve(a)}function yp(e,r,i,o,u,S){let y=u;const a=o.get(y)||new Map;o.set(y,a.set(i,r)),y=`${u}-${e}`;const c=o.get(y)||new Map;if(o.set(y,c.set(i,r)),S){y=`${u}-${e}-${S}`;const _=o.get(y)||new Map;o.set(y,_.set(i,r))}}function hg(e,r,i){e.clear(),r.clear();for(const o of i){const{source:u,target:S,sourceHandle:y=null,targetHandle:a=null}=o,c={edgeId:o.id,source:u,target:S,sourceHandle:y,targetHandle:a},_=`${u}-${y}--${S}-${a}`,v=`${S}-${a}--${u}-${y}`;yp("source",c,v,e,u,y),yp("target",c,_,e,S,a),r.set(o.id,o)}}function dg(e,r){if(!e.parentId)return!1;const i=r.get(e.parentId);return i?i.selected?!0:dg(i,r):!1}function wp(e,r,i){var u;let o=e;do{if((u=o==null?void 0:o.matches)!=null&&u.call(o,r))return!0;if(o===i)return!1;o=o==null?void 0:o.parentElement}while(o);return!1}function sC(e,r,i,o){const u=new Map;for(const[S,y]of e)if((y.selected||y.id===o)&&(!y.parentId||!dg(y,e))&&(y.draggable||r&&typeof y.draggable>"u")){const a=e.get(S);a&&u.set(S,{id:S,position:a.position||{x:0,y:0},distance:{x:i.x-a.internals.positionAbsolute.x,y:i.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return u}function Yc({nodeId:e,dragItems:r,nodeLookup:i,dragging:o=!0}){var y,a,c;const u=[];for(const[_,v]of r){const l=(y=i.get(_))==null?void 0:y.internals.userNode;l&&u.push({...l,position:v.position,dragging:o})}if(!e)return[u[0],u];const S=(a=i.get(e))==null?void 0:a.internals.userNode;return[S?{...S,position:((c=r.get(e))==null?void 0:c.position)||S.position,dragging:o}:u[0],u]}function oC({dragItems:e,snapGrid:r,x:i,y:o}){const u=e.values().next().value;if(!u)return null;const S={x:i-u.distance.x,y:o-u.distance.y},y=Ts(S,r);return{x:y.x-S.x,y:y.y-S.y}}function aC({onNodeMouseDown:e,getStoreItems:r,onDragStart:i,onDrag:o,onDragStop:u}){let S={x:null,y:null},y=0,a=new Map,c=!1,_={x:0,y:0},v=null,l=!1,m=null,x=!1,b=!1,C=null;function f({noDragClassName:d,handleSelector:h,domNode:w,isSelectable:L,nodeId:R,nodeClickDistance:D=0}){m=Pt(w);function k({x:F,y:N}){const{nodeLookup:I,nodeExtent:q,snapGrid:V,snapToGrid:K,nodeOrigin:U,onNodeDrag:A,onSelectionDrag:B,onError:P,updateNodePositions:H}=r();S={x:F,y:N};let G=!1;const Z=a.size>1,se=Z&&q?Eu(Ds(a)):null,ee=Z&&K?oC({dragItems:a,snapGrid:V,x:F,y:N}):null;for(const[X,O]of a){if(!I.has(X))continue;let re={x:F-O.distance.x,y:N-O.distance.y};K&&(re=ee?{x:Math.round(re.x+ee.x),y:Math.round(re.y+ee.y)}:Ts(re,V));let ne=null;if(Z&&q&&!O.extent&&se){const{positionAbsolute:fe}=O.internals,we=fe.x-se.x+q[0][0],ye=fe.x+O.measured.width-se.x2+q[1][0],xe=fe.y-se.y+q[0][1],ge=fe.y+O.measured.height-se.y2+q[1][1];ne=[[we,xe],[ye,ge]]}const{position:ce,positionAbsolute:le}=G_({nodeId:X,nextPosition:re,nodeLookup:I,nodeExtent:ne||q,nodeOrigin:U,onError:P});G=G||O.position.x!==ce.x||O.position.y!==ce.y,O.position=ce,O.internals.positionAbsolute=le}if(b=b||G,!!G&&(H(a,!0),C&&(o||A||!R&&B))){const[X,O]=Yc({nodeId:R,dragItems:a,nodeLookup:I});o==null||o(C,a,X,O),A==null||A(C,X,O),R||B==null||B(C,O)}}async function M(){if(!v)return;const{transform:F,panBy:N,autoPanSpeed:I,autoPanOnNodeDrag:q}=r();if(!q){c=!1,cancelAnimationFrame(y);return}const[V,K]=J_(_,v,I);(V!==0||K!==0)&&(S.x=(S.x??0)-V/F[2],S.y=(S.y??0)-K/F[2],await N({x:V,y:K})&&k(S)),y=requestAnimationFrame(M)}function W(F){var Z;const{nodeLookup:N,multiSelectionActive:I,nodesDraggable:q,transform:V,snapGrid:K,snapToGrid:U,selectNodesOnDrag:A,onNodeDragStart:B,onSelectionDragStart:P,unselectNodesAndEdges:H}=r();l=!0,(!A||!L)&&!I&&R&&((Z=N.get(R))!=null&&Z.selected||H()),L&&A&&R&&(e==null||e(R));const G=_s(F.sourceEvent,{transform:V,snapGrid:K,snapToGrid:U,containerBounds:v});if(S=G,a=sC(N,q,G,R),a.size>0&&(i||B||!R&&P)){const[se,ee]=Yc({nodeId:R,dragItems:a,nodeLookup:N});i==null||i(F.sourceEvent,a,se,ee),B==null||B(F.sourceEvent,se,ee),R||P==null||P(F.sourceEvent,ee)}}const z=D_().clickDistance(D).on("start",F=>{const{domNode:N,nodeDragThreshold:I,transform:q,snapGrid:V,snapToGrid:K}=r();v=(N==null?void 0:N.getBoundingClientRect())||null,x=!1,b=!1,C=F.sourceEvent,I===0&&W(F),S=_s(F.sourceEvent,{transform:q,snapGrid:V,snapToGrid:K,containerBounds:v}),_=er(F.sourceEvent,v)}).on("drag",F=>{const{autoPanOnNodeDrag:N,transform:I,snapGrid:q,snapToGrid:V,nodeDragThreshold:K,nodeLookup:U}=r(),A=_s(F.sourceEvent,{transform:I,snapGrid:q,snapToGrid:V,containerBounds:v});if(C=F.sourceEvent,(F.sourceEvent.type==="touchmove"&&F.sourceEvent.touches.length>1||R&&!U.has(R))&&(x=!0),!x){if(!c&&N&&l&&(c=!0,M()),!l){const B=er(F.sourceEvent,v),P=B.x-_.x,H=B.y-_.y;Math.sqrt(P*P+H*H)>K&&W(F)}(S.x!==A.xSnapped||S.y!==A.ySnapped)&&a&&l&&(_=er(F.sourceEvent,v),k(A))}}).on("end",F=>{if(!(!l||x)&&(c=!1,l=!1,cancelAnimationFrame(y),a.size>0)){const{nodeLookup:N,updateNodePositions:I,onNodeDragStop:q,onSelectionDragStop:V}=r();if(b&&(I(a,!1),b=!1),u||q||!R&&V){const[K,U]=Yc({nodeId:R,dragItems:a,nodeLookup:N,dragging:!1});u==null||u(F.sourceEvent,a,K,U),q==null||q(F.sourceEvent,K,U),R||V==null||V(F.sourceEvent,U)}}}).filter(F=>{const N=F.target;return!F.button&&(!d||!wp(N,`.${d}`,w))&&(!h||wp(N,h,w))});m.call(z)}function p(){m==null||m.on(".drag",null)}return{update:f,destroy:p}}function lC(e,r,i){const o=[],u={x:e.x-i,y:e.y-i,width:i*2,height:i*2};for(const S of r.values())Cs(u,di(S))>0&&o.push(S);return o}const cC=250;function uC(e,r,i,o){var a,c;let u=[],S=1/0;const y=lC(e,i,r+cC);for(const _ of y){const v=[...((a=_.internals.handleBounds)==null?void 0:a.source)??[],...((c=_.internals.handleBounds)==null?void 0:c.target)??[]];for(const l of v){if(o.nodeId===l.nodeId&&o.type===l.type&&o.id===l.id)continue;const{x:m,y:x}=kn(_,l,l.position,!0),b=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(x-e.y,2));b>r||(b<S?(u=[{...l,x:m,y:x}],S=b):b===S&&u.push({...l,x:m,y:x}))}}if(!u.length)return null;if(u.length>1){const _=o.type==="source"?"target":"source";return u.find(v=>v.type===_)??u[0]}return u[0]}function fg(e,r,i,o,u,S=!1){var _,v,l;const y=o.get(e);if(!y)return null;const a=u==="strict"?(_=y.internals.handleBounds)==null?void 0:_[r]:[...((v=y.internals.handleBounds)==null?void 0:v.source)??[],...((l=y.internals.handleBounds)==null?void 0:l.target)??[]],c=(i?a==null?void 0:a.find(m=>m.id===i):a==null?void 0:a[0])??null;return c&&S?{...c,...kn(y,c,c.position,!0)}:c}function pg(e,r){return e||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function hC(e,r){let i=null;return r?i=!0:e&&!r&&(i=!1),i}const _g=()=>!0;function dC(e,{connectionMode:r,connectionRadius:i,handleId:o,nodeId:u,edgeUpdaterType:S,isTarget:y,domNode:a,nodeLookup:c,lib:_,autoPanOnConnect:v,flowId:l,panBy:m,cancelConnection:x,onConnectStart:b,onConnect:C,onConnectEnd:f,isValidConnection:p=_g,onReconnectEnd:d,updateConnection:h,getTransform:w,getFromHandle:L,autoPanSpeed:R,dragThreshold:D=1,handleDomNode:k}){const M=rg(e.target);let W=0,z;const{x:F,y:N}=er(e),I=pg(S,k),q=a==null?void 0:a.getBoundingClientRect();let V=!1;if(!q||!I)return;const K=fg(u,I,o,c,r);if(!K)return;let U=er(e,q),A=!1,B=null,P=!1,H=null;function G(){if(!v||!q)return;const[ce,le]=J_(U,q,R);m({x:ce,y:le}),W=requestAnimationFrame(G)}const Z={...K,nodeId:u,type:I,position:K.position},se=c.get(u);let X={inProgress:!0,isValid:null,from:kn(se,Z,be.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:se,to:U,toHandle:null,toPosition:lp[Z.position],toNode:null,pointer:U};function O(){V=!0,h(X),b==null||b(e,{nodeId:u,handleId:o,handleType:I})}D===0&&O();function re(ce){if(!V){const{x:ge,y:Ie}=er(ce),st=ge-F,ot=Ie-N;if(!(st*st+ot*ot>D*D))return;O()}if(!L()||!Z){ne(ce);return}const le=w();U=er(ce,q),z=uC(As(U,le,!1,[1,1]),i,c,Z),A||(G(),A=!0);const fe=gg(ce,{handle:z,connectionMode:r,fromNodeId:u,fromHandleId:o,fromType:y?"target":"source",isValidConnection:p,doc:M,lib:_,flowId:l,nodeLookup:c});H=fe.handleDomNode,B=fe.connection,P=hC(!!z,fe.isValid);const we=c.get(u),ye=we?kn(we,Z,be.Left,!0):X.from,xe={...X,from:ye,isValid:P,to:fe.toHandle&&P?Ra({x:fe.toHandle.x,y:fe.toHandle.y},le):U,toHandle:fe.toHandle,toPosition:P&&fe.toHandle?fe.toHandle.position:lp[Z.position],toNode:fe.toHandle?c.get(fe.toHandle.nodeId):null,pointer:U};h(xe),X=xe}function ne(ce){if(!("touches"in ce&&ce.touches.length>0)){if(V){(z||H)&&B&&P&&(C==null||C(B));const{inProgress:le,...fe}=X,we={...fe,toPosition:X.toHandle?X.toPosition:null};f==null||f(ce,we),S&&(d==null||d(ce,we))}x(),cancelAnimationFrame(W),A=!1,P=!1,B=null,H=null,M.removeEventListener("mousemove",re),M.removeEventListener("mouseup",ne),M.removeEventListener("touchmove",re),M.removeEventListener("touchend",ne)}}M.addEventListener("mousemove",re),M.addEventListener("mouseup",ne),M.addEventListener("touchmove",re),M.addEventListener("touchend",ne)}function gg(e,{handle:r,connectionMode:i,fromNodeId:o,fromHandleId:u,fromType:S,doc:y,lib:a,flowId:c,isValidConnection:_=_g,nodeLookup:v}){const l=S==="target",m=r?y.querySelector(`.${a}-flow__handle[data-id="${c}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x,y:b}=er(e),C=y.elementFromPoint(x,b),f=C!=null&&C.classList.contains(`${a}-flow__handle`)?C:m,p={handleDomNode:f,isValid:!1,connection:null,toHandle:null};if(f){const d=pg(void 0,f),h=f.getAttribute("data-nodeid"),w=f.getAttribute("data-handleid"),L=f.classList.contains("connectable"),R=f.classList.contains("connectableend");if(!h||!d)return p;const D={source:l?h:o,sourceHandle:l?w:u,target:l?o:h,targetHandle:l?u:w};p.connection=D;const M=L&&R&&(i===ui.Strict?l&&d==="source"||!l&&d==="target":h!==o||w!==u);p.isValid=M&&_(D),p.toHandle=fg(h,d,w,v,i,!0)}return p}const Du={onPointerDown:dC,isValid:gg};function fC({domNode:e,panZoom:r,getTransform:i,getViewScale:o}){const u=Pt(e);function S({translateExtent:a,width:c,height:_,zoomStep:v=1,pannable:l=!0,zoomable:m=!0,inversePan:x=!1}){const b=h=>{if(h.sourceEvent.type!=="wheel"||!r)return;const w=i(),L=h.sourceEvent.ctrlKey&&xs()?10:1,R=-h.sourceEvent.deltaY*(h.sourceEvent.deltaMode===1?.05:h.sourceEvent.deltaMode?1:.002)*v,D=w[2]*Math.pow(2,R*L);r.scaleTo(D)};let C=[0,0];const f=h=>{(h.sourceEvent.type==="mousedown"||h.sourceEvent.type==="touchstart")&&(C=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY])},p=h=>{const w=i();if(h.sourceEvent.type!=="mousemove"&&h.sourceEvent.type!=="touchmove"||!r)return;const L=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY],R=[L[0]-C[0],L[1]-C[1]];C=L;const D=o()*Math.max(w[2],Math.log(w[2]))*(x?-1:1),k={x:w[0]-R[0]*D,y:w[1]-R[1]*D},M=[[0,0],[c,_]];r.setViewportConstrained({x:k.x,y:k.y,zoom:w[2]},M,a)},d=U_().on("start",f).on("zoom",l?p:null).on("zoom.wheel",m?b:null);u.call(d,{})}function y(){u.on("zoom",null)}return{update:S,destroy:y,pointer:Qt}}const za=e=>({x:e.x,y:e.y,zoom:e.k}),Gc=({x:e,y:r,zoom:i})=>Ha.translate(e,r).scale(i),ii=(e,r)=>e.target.closest(`.${r}`),mg=(e,r)=>r===2&&Array.isArray(e)&&e.includes(2),pC=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Qc=(e,r=0,i=pC,o=()=>{})=>{const u=typeof r=="number"&&r>0;return u||o(),u?e.transition().duration(r).ease(i).on("end",o):e},vg=e=>{const r=e.ctrlKey&&xs()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*r};function _C({zoomPanValues:e,noWheelClassName:r,d3Selection:i,d3Zoom:o,panOnScrollMode:u,panOnScrollSpeed:S,zoomOnPinch:y,onPanZoomStart:a,onPanZoom:c,onPanZoomEnd:_}){return v=>{if(ii(v,r))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const l=i.property("__zoom").k||1;if(v.ctrlKey&&y){const f=Qt(v),p=vg(v),d=l*Math.pow(2,p);o.scaleTo(i,d,f,v);return}const m=v.deltaMode===1?20:1;let x=u===Cn.Vertical?0:v.deltaX*m,b=u===Cn.Horizontal?0:v.deltaY*m;!xs()&&v.shiftKey&&u!==Cn.Vertical&&(x=v.deltaY*m,b=0),o.translateBy(i,-(x/l)*S,-(b/l)*S,{internal:!0});const C=za(i.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(v,C),e.panScrollTimeout=setTimeout(()=>{_==null||_(v,C),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a==null||a(v,C))}}function gC({noWheelClassName:e,preventScrolling:r,d3ZoomHandler:i}){return function(o,u){const S=o.type==="wheel",y=!r&&S&&!o.ctrlKey,a=ii(o,e);if(o.ctrlKey&&S&&a&&o.preventDefault(),y||a)return null;o.preventDefault(),i.call(this,o,u)}}function mC({zoomPanValues:e,onDraggingChange:r,onPanZoomStart:i}){return o=>{var S,y,a;if((S=o.sourceEvent)!=null&&S.internal)return;const u=za(o.transform);e.mouseButton=((y=o.sourceEvent)==null?void 0:y.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=u,((a=o.sourceEvent)==null?void 0:a.type)==="mousedown"&&r(!0),i&&(i==null||i(o.sourceEvent,u))}}function vC({zoomPanValues:e,panOnDrag:r,onPaneContextMenu:i,onTransformChange:o,onPanZoom:u}){return S=>{var y,a;e.usedRightMouseButton=!!(i&&mg(r,e.mouseButton??0)),(y=S.sourceEvent)!=null&&y.sync||o([S.transform.x,S.transform.y,S.transform.k]),u&&!((a=S.sourceEvent)!=null&&a.internal)&&(u==null||u(S.sourceEvent,za(S.transform)))}}function yC({zoomPanValues:e,panOnDrag:r,panOnScroll:i,onDraggingChange:o,onPanZoomEnd:u,onPaneContextMenu:S}){return y=>{var a;if(!((a=y.sourceEvent)!=null&&a.internal)&&(e.isZoomingOrPanning=!1,S&&mg(r,e.mouseButton??0)&&!e.usedRightMouseButton&&y.sourceEvent&&S(y.sourceEvent),e.usedRightMouseButton=!1,o(!1),u)){const c=za(y.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{u==null||u(y.sourceEvent,c)},i?150:0)}}}function wC({zoomActivationKeyPressed:e,zoomOnScroll:r,zoomOnPinch:i,panOnDrag:o,panOnScroll:u,zoomOnDoubleClick:S,userSelectionActive:y,noWheelClassName:a,noPanClassName:c,lib:_,connectionInProgress:v}){return l=>{var f;const m=e||r,x=i&&l.ctrlKey,b=l.type==="wheel";if(l.button===1&&l.type==="mousedown"&&(ii(l,`${_}-flow__node`)||ii(l,`${_}-flow__edge`)))return!0;if(!o&&!m&&!u&&!S&&!i||y||v&&!b||ii(l,a)&&b||ii(l,c)&&(!b||u&&b&&!e)||!i&&l.ctrlKey&&b)return!1;if(!i&&l.type==="touchstart"&&((f=l.touches)==null?void 0:f.length)>1)return l.preventDefault(),!1;if(!m&&!u&&!x&&b||!o&&(l.type==="mousedown"||l.type==="touchstart")||Array.isArray(o)&&!o.includes(l.button)&&l.type==="mousedown")return!1;const C=Array.isArray(o)&&o.includes(l.button)||!l.button||l.button<=1;return(!l.ctrlKey||b)&&C}}function SC({domNode:e,minZoom:r,maxZoom:i,translateExtent:o,viewport:u,onPanZoom:S,onPanZoomStart:y,onPanZoomEnd:a,onDraggingChange:c}){const _={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},v=e.getBoundingClientRect(),l=U_().scaleExtent([r,i]).translateExtent(o),m=Pt(e).call(l);d({x:u.x,y:u.y,zoom:hi(u.zoom,r,i)},[[0,0],[v.width,v.height]],o);const x=m.on("wheel.zoom"),b=m.on("dblclick.zoom");l.wheelDelta(vg);function C(z,F){return m?new Promise(N=>{l==null||l.interpolate((F==null?void 0:F.interpolate)==="linear"?ps:fa).transform(Qc(m,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>N(!0)),z)}):Promise.resolve(!1)}function f({noWheelClassName:z,noPanClassName:F,onPaneContextMenu:N,userSelectionActive:I,panOnScroll:q,panOnDrag:V,panOnScrollMode:K,panOnScrollSpeed:U,preventScrolling:A,zoomOnPinch:B,zoomOnScroll:P,zoomOnDoubleClick:H,zoomActivationKeyPressed:G,lib:Z,onTransformChange:se,connectionInProgress:ee,paneClickDistance:X,selectionOnDrag:O}){I&&!_.isZoomingOrPanning&&p();const re=q&&!G&&!I;l.clickDistance(O?1/0:!Zt(X)||X<0?0:X);const ne=re?_C({zoomPanValues:_,noWheelClassName:z,d3Selection:m,d3Zoom:l,panOnScrollMode:K,panOnScrollSpeed:U,zoomOnPinch:B,onPanZoomStart:y,onPanZoom:S,onPanZoomEnd:a}):gC({noWheelClassName:z,preventScrolling:A,d3ZoomHandler:x});if(m.on("wheel.zoom",ne,{passive:!1}),!I){const le=mC({zoomPanValues:_,onDraggingChange:c,onPanZoomStart:y});l.on("start",le);const fe=vC({zoomPanValues:_,panOnDrag:V,onPaneContextMenu:!!N,onPanZoom:S,onTransformChange:se});l.on("zoom",fe);const we=yC({zoomPanValues:_,panOnDrag:V,panOnScroll:q,onPaneContextMenu:N,onPanZoomEnd:a,onDraggingChange:c});l.on("end",we)}const ce=wC({zoomActivationKeyPressed:G,panOnDrag:V,zoomOnScroll:P,panOnScroll:q,zoomOnDoubleClick:H,zoomOnPinch:B,userSelectionActive:I,noPanClassName:F,noWheelClassName:z,lib:Z,connectionInProgress:ee});l.filter(ce),H?m.on("dblclick.zoom",b):m.on("dblclick.zoom",null)}function p(){l.on("zoom",null)}async function d(z,F,N){const I=Gc(z),q=l==null?void 0:l.constrain()(I,F,N);return q&&await C(q),new Promise(V=>V(q))}async function h(z,F){const N=Gc(z);return await C(N,F),new Promise(I=>I(N))}function w(z){if(m){const F=Gc(z),N=m.property("__zoom");(N.k!==z.zoom||N.x!==z.x||N.y!==z.y)&&(l==null||l.transform(m,F,null,{sync:!0}))}}function L(){const z=m?W_(m.node()):{x:0,y:0,k:1};return{x:z.x,y:z.y,zoom:z.k}}function R(z,F){return m?new Promise(N=>{l==null||l.interpolate((F==null?void 0:F.interpolate)==="linear"?ps:fa).scaleTo(Qc(m,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>N(!0)),z)}):Promise.resolve(!1)}function D(z,F){return m?new Promise(N=>{l==null||l.interpolate((F==null?void 0:F.interpolate)==="linear"?ps:fa).scaleBy(Qc(m,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>N(!0)),z)}):Promise.resolve(!1)}function k(z){l==null||l.scaleExtent(z)}function M(z){l==null||l.translateExtent(z)}function W(z){const F=!Zt(z)||z<0?0:z;l==null||l.clickDistance(F)}return{update:f,destroy:p,setViewport:h,setViewportConstrained:d,getViewport:L,scaleTo:R,scaleBy:D,setScaleExtent:k,setTranslateExtent:M,syncViewport:w,setClickDistance:W}}var pi;(function(e){e.Line="line",e.Handle="handle"})(pi||(pi={}));function CC({width:e,prevWidth:r,height:i,prevHeight:o,affectsX:u,affectsY:S}){const y=e-r,a=i-o,c=[y>0?1:y<0?-1:0,a>0?1:a<0?-1:0];return y&&u&&(c[0]=c[0]*-1),a&&S&&(c[1]=c[1]*-1),c}function Sp(e){const r=e.includes("right")||e.includes("left"),i=e.includes("bottom")||e.includes("top"),o=e.includes("left"),u=e.includes("top");return{isHorizontal:r,isVertical:i,affectsX:o,affectsY:u}}function Yr(e,r){return Math.max(0,r-e)}function Gr(e,r){return Math.max(0,e-r)}function ia(e,r,i){return Math.max(0,r-e,e-i)}function Cp(e,r){return e?!r:r}function xC(e,r,i,o,u,S,y,a){let{affectsX:c,affectsY:_}=r;const{isHorizontal:v,isVertical:l}=r,m=v&&l,{xSnapped:x,ySnapped:b}=i,{minWidth:C,maxWidth:f,minHeight:p,maxHeight:d}=o,{x:h,y:w,width:L,height:R,aspectRatio:D}=e;let k=Math.floor(v?x-e.pointerX:0),M=Math.floor(l?b-e.pointerY:0);const W=L+(c?-k:k),z=R+(_?-M:M),F=-S[0]*L,N=-S[1]*R;let I=ia(W,C,f),q=ia(z,p,d);if(y){let U=0,A=0;c&&k<0?U=Yr(h+k+F,y[0][0]):!c&&k>0&&(U=Gr(h+W+F,y[1][0])),_&&M<0?A=Yr(w+M+N,y[0][1]):!_&&M>0&&(A=Gr(w+z+N,y[1][1])),I=Math.max(I,U),q=Math.max(q,A)}if(a){let U=0,A=0;c&&k>0?U=Gr(h+k,a[0][0]):!c&&k<0&&(U=Yr(h+W,a[1][0])),_&&M>0?A=Gr(w+M,a[0][1]):!_&&M<0&&(A=Yr(w+z,a[1][1])),I=Math.max(I,U),q=Math.max(q,A)}if(u){if(v){const U=ia(W/D,p,d)*D;if(I=Math.max(I,U),y){let A=0;!c&&!_||c&&!_&&m?A=Gr(w+N+W/D,y[1][1])*D:A=Yr(w+N+(c?k:-k)/D,y[0][1])*D,I=Math.max(I,A)}if(a){let A=0;!c&&!_||c&&!_&&m?A=Yr(w+W/D,a[1][1])*D:A=Gr(w+(c?k:-k)/D,a[0][1])*D,I=Math.max(I,A)}}if(l){const U=ia(z*D,C,f)/D;if(q=Math.max(q,U),y){let A=0;!c&&!_||_&&!c&&m?A=Gr(h+z*D+F,y[1][0])/D:A=Yr(h+(_?M:-M)*D+F,y[0][0])/D,q=Math.max(q,A)}if(a){let A=0;!c&&!_||_&&!c&&m?A=Yr(h+z*D,a[1][0])/D:A=Gr(h+(_?M:-M)*D,a[0][0])/D,q=Math.max(q,A)}}}M=M+(M<0?q:-q),k=k+(k<0?I:-I),u&&(m?W>z*D?M=(Cp(c,_)?-k:k)/D:k=(Cp(c,_)?-M:M)*D:v?(M=k/D,_=c):(k=M*D,c=_));const V=c?h+k:h,K=_?w+M:w;return{width:L+(c?-k:k),height:R+(_?-M:M),x:S[0]*k*(c?-1:1)+V,y:S[1]*M*(_?-1:1)+K}}const yg={width:0,height:0,x:0,y:0},bC={...yg,pointerX:0,pointerY:0,aspectRatio:1};function EC(e){return[[0,0],[e.measured.width,e.measured.height]]}function kC(e,r,i){const o=r.position.x+e.position.x,u=r.position.y+e.position.y,S=e.measured.width??0,y=e.measured.height??0,a=i[0]*S,c=i[1]*y;return[[o-a,u-c],[o+S-a,u+y-c]]}function LC({domNode:e,nodeId:r,getStoreItems:i,onChange:o,onEnd:u}){const S=Pt(e);let y={controlDirection:Sp("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:_,boundaries:v,keepAspectRatio:l,resizeDirection:m,onResizeStart:x,onResize:b,onResizeEnd:C,shouldResize:f}){let p={...yg},d={...bC};y={boundaries:v,resizeDirection:m,keepAspectRatio:l,controlDirection:Sp(_)};let h,w=null,L=[],R,D,k,M=!1;const W=D_().on("start",z=>{const{nodeLookup:F,transform:N,snapGrid:I,snapToGrid:q,nodeOrigin:V,paneDomNode:K}=i();if(h=F.get(r),!h)return;w=(K==null?void 0:K.getBoundingClientRect())??null;const{xSnapped:U,ySnapped:A}=_s(z.sourceEvent,{transform:N,snapGrid:I,snapToGrid:q,containerBounds:w});p={width:h.measured.width??0,height:h.measured.height??0,x:h.position.x??0,y:h.position.y??0},d={...p,pointerX:U,pointerY:A,aspectRatio:p.width/p.height},R=void 0,h.parentId&&(h.extent==="parent"||h.expandParent)&&(R=F.get(h.parentId),D=R&&h.extent==="parent"?EC(R):void 0),L=[],k=void 0;for(const[B,P]of F)if(P.parentId===r&&(L.push({id:B,position:{...P.position},extent:P.extent}),P.extent==="parent"||P.expandParent)){const H=kC(P,h,P.origin??V);k?k=[[Math.min(H[0][0],k[0][0]),Math.min(H[0][1],k[0][1])],[Math.max(H[1][0],k[1][0]),Math.max(H[1][1],k[1][1])]]:k=H}x==null||x(z,{...p})}).on("drag",z=>{const{transform:F,snapGrid:N,snapToGrid:I,nodeOrigin:q}=i(),V=_s(z.sourceEvent,{transform:F,snapGrid:N,snapToGrid:I,containerBounds:w}),K=[];if(!h)return;const{x:U,y:A,width:B,height:P}=p,H={},G=h.origin??q,{width:Z,height:se,x:ee,y:X}=xC(d,y.controlDirection,V,y.boundaries,y.keepAspectRatio,G,D,k),O=Z!==B,re=se!==P,ne=ee!==U&&O,ce=X!==A&&re;if(!ne&&!ce&&!O&&!re)return;if((ne||ce||G[0]===1||G[1]===1)&&(H.x=ne?ee:p.x,H.y=ce?X:p.y,p.x=H.x,p.y=H.y,L.length>0)){const ye=ee-U,xe=X-A;for(const ge of L)ge.position={x:ge.position.x-ye+G[0]*(Z-B),y:ge.position.y-xe+G[1]*(se-P)},K.push(ge)}if((O||re)&&(H.width=O&&(!y.resizeDirection||y.resizeDirection==="horizontal")?Z:p.width,H.height=re&&(!y.resizeDirection||y.resizeDirection==="vertical")?se:p.height,p.width=H.width,p.height=H.height),R&&h.expandParent){const ye=G[0]*(H.width??0);H.x&&H.x<ye&&(p.x=ye,d.x=d.x-(H.x-ye));const xe=G[1]*(H.height??0);H.y&&H.y<xe&&(p.y=xe,d.y=d.y-(H.y-xe))}const le=CC({width:p.width,prevWidth:B,height:p.height,prevHeight:P,affectsX:y.controlDirection.affectsX,affectsY:y.controlDirection.affectsY}),fe={...p,direction:le};(f==null?void 0:f(z,fe))!==!1&&(M=!0,b==null||b(z,fe),o(H,K))}).on("end",z=>{M&&(C==null||C(z,{...p}),u==null||u({...p}),M=!1)});S.call(W)}function c(){S.on(".drag",null)}return{update:a,destroy:c}}var Jc={exports:{}},Zc={},eu={exports:{}},tu={};/**
|
|
41
|
+
* @license React
|
|
42
|
+
* use-sync-external-store-shim.production.js
|
|
43
|
+
*
|
|
44
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the MIT license found in the
|
|
47
|
+
* LICENSE file in the root directory of this source tree.
|
|
48
|
+
*/var xp;function RC(){if(xp)return tu;xp=1;var e=Es();function r(l,m){return l===m&&(l!==0||1/l===1/m)||l!==l&&m!==m}var i=typeof Object.is=="function"?Object.is:r,o=e.useState,u=e.useEffect,S=e.useLayoutEffect,y=e.useDebugValue;function a(l,m){var x=m(),b=o({inst:{value:x,getSnapshot:m}}),C=b[0].inst,f=b[1];return S(function(){C.value=x,C.getSnapshot=m,c(C)&&f({inst:C})},[l,x,m]),u(function(){return c(C)&&f({inst:C}),l(function(){c(C)&&f({inst:C})})},[l]),y(x),x}function c(l){var m=l.getSnapshot;l=l.value;try{var x=m();return!i(l,x)}catch{return!0}}function _(l,m){return m()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?_:a;return tu.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,tu}var bp;function DC(){return bp||(bp=1,eu.exports=RC()),eu.exports}/**
|
|
49
|
+
* @license React
|
|
50
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/var Ep;function TC(){if(Ep)return Zc;Ep=1;var e=Es(),r=DC();function i(_,v){return _===v&&(_!==0||1/_===1/v)||_!==_&&v!==v}var o=typeof Object.is=="function"?Object.is:i,u=r.useSyncExternalStore,S=e.useRef,y=e.useEffect,a=e.useMemo,c=e.useDebugValue;return Zc.useSyncExternalStoreWithSelector=function(_,v,l,m,x){var b=S(null);if(b.current===null){var C={hasValue:!1,value:null};b.current=C}else C=b.current;b=a(function(){function p(R){if(!d){if(d=!0,h=R,R=m(R),x!==void 0&&C.hasValue){var D=C.value;if(x(D,R))return w=D}return w=R}if(D=w,o(h,R))return D;var k=m(R);return x!==void 0&&x(D,k)?(h=R,D):(h=R,w=k)}var d=!1,h,w,L=l===void 0?null:l;return[function(){return p(v())},L===null?void 0:function(){return p(L())}]},[v,l,m,x]);var f=u(_,b[0],b[1]);return y(function(){C.hasValue=!0,C.value=f},[f]),c(f),f},Zc}var kp;function AC(){return kp||(kp=1,Jc.exports=TC()),Jc.exports}var MC=AC();const PC=Iu(MC),BC={},Lp=e=>{let r;const i=new Set,o=(v,l)=>{const m=typeof v=="function"?v(r):v;if(!Object.is(m,r)){const x=r;r=l??(typeof m!="object"||m===null)?m:Object.assign({},r,m),i.forEach(b=>b(r,x))}},u=()=>r,c={setState:o,getState:u,getInitialState:()=>_,subscribe:v=>(i.add(v),()=>i.delete(v)),destroy:()=>{(BC?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),i.clear()}},_=r=e(o,u,c);return c},NC=e=>e?Lp(e):Lp,{useDebugValue:IC}=Ou,{useSyncExternalStoreWithSelector:OC}=PC,HC=e=>e;function wg(e,r=HC,i){const o=OC(e.subscribe,e.getState,e.getServerState||e.getInitialState,r,i);return IC(o),o}const Rp=(e,r)=>{const i=NC(e),o=(u,S=r)=>wg(i,u,S);return Object.assign(o,i),o},FC=(e,r)=>e?Rp(e,r):Rp;function je(e,r){if(Object.is(e,r))return!0;if(typeof e!="object"||e===null||typeof r!="object"||r===null)return!1;if(e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(const[o,u]of e)if(!Object.is(u,r.get(o)))return!1;return!0}if(e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(const o of e)if(!r.has(o))return!1;return!0}const i=Object.keys(e);if(i.length!==Object.keys(r).length)return!1;for(const o of i)if(!Object.prototype.hasOwnProperty.call(r,o)||!Object.is(e[o],r[o]))return!1;return!0}t_();const $a=J.createContext(null),jC=$a.Provider,Sg=dr.error001();function Te(e,r){const i=J.useContext($a);if(i===null)throw new Error(Sg);return wg(i,e,r)}function ze(){const e=J.useContext($a);if(e===null)throw new Error(Sg);return J.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Dp={display:"none"},zC={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Cg="react-flow__node-desc",xg="react-flow__edge-desc",$C="react-flow__aria-live",WC=e=>e.ariaLiveMessage,UC=e=>e.ariaLabelConfig;function VC({rfId:e}){const r=Te(WC);return j.jsx("div",{id:`${$C}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:zC,children:r})}function qC({rfId:e,disableKeyboardA11y:r}){const i=Te(UC);return j.jsxs(j.Fragment,{children:[j.jsx("div",{id:`${Cg}-${e}`,style:Dp,children:r?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),j.jsx("div",{id:`${xg}-${e}`,style:Dp,children:i["edge.a11yDescription.default"]}),!r&&j.jsx(VC,{rfId:e})]})}const Wa=J.forwardRef(({position:e="top-left",children:r,className:i,style:o,...u},S)=>{const y=`${e}`.split("-");return j.jsx("div",{className:Ge(["react-flow__panel",i,...y]),style:o,ref:S,...u,children:r})});Wa.displayName="Panel";function KC({proOptions:e,position:r="bottom-right"}){return e!=null&&e.hideAttribution?null:j.jsx(Wa,{position:r,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:j.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const XC=e=>{const r=[],i=[];for(const[,o]of e.nodeLookup)o.selected&&r.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&i.push(o);return{selectedNodes:r,selectedEdges:i}},sa=e=>e.id;function YC(e,r){return je(e.selectedNodes.map(sa),r.selectedNodes.map(sa))&&je(e.selectedEdges.map(sa),r.selectedEdges.map(sa))}function GC({onSelectionChange:e}){const r=ze(),{selectedNodes:i,selectedEdges:o}=Te(XC,YC);return J.useEffect(()=>{const u={nodes:i,edges:o};e==null||e(u),r.getState().onSelectionChangeHandlers.forEach(S=>S(u))},[i,o,e]),null}const QC=e=>!!e.onSelectionChangeHandlers;function JC({onSelectionChange:e}){const r=Te(QC);return e||r?j.jsx(GC,{onSelectionChange:e}):null}const Tu=typeof window<"u"?J.useLayoutEffect:J.useEffect,bg=[0,0],ZC={x:0,y:0,zoom:1},ex=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Tp=[...ex,"rfId"],tx=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Ap={translateExtent:ws,nodeOrigin:bg,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function rx(e){const{setNodes:r,setEdges:i,setMinZoom:o,setMaxZoom:u,setTranslateExtent:S,setNodeExtent:y,reset:a,setDefaultNodesAndEdges:c}=Te(tx,je),_=ze();Tu(()=>(c(e.defaultNodes,e.defaultEdges),()=>{v.current=Ap,a()}),[]);const v=J.useRef(Ap);return Tu(()=>{for(const l of Tp){const m=e[l],x=v.current[l];m!==x&&(typeof e[l]>"u"||(l==="nodes"?r(m):l==="edges"?i(m):l==="minZoom"?o(m):l==="maxZoom"?u(m):l==="translateExtent"?S(m):l==="nodeExtent"?y(m):l==="ariaLabelConfig"?_.setState({ariaLabelConfig:FS(m)}):l==="fitView"?_.setState({fitViewQueued:m}):l==="fitViewOptions"?_.setState({fitViewOptions:m}):_.setState({[l]:m})))}v.current=e},Tp.map(l=>e[l])),null}function Mp(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function nx(e){var o;const[r,i]=J.useState(e==="system"?null:e);return J.useEffect(()=>{if(e!=="system"){i(e);return}const u=Mp(),S=()=>i(u!=null&&u.matches?"dark":"light");return S(),u==null||u.addEventListener("change",S),()=>{u==null||u.removeEventListener("change",S)}},[e]),r!==null?r:(o=Mp())!=null&&o.matches?"dark":"light"}const Pp=typeof document<"u"?document:null;function bs(e=null,r={target:Pp,actInsideInputWithModifier:!0}){const[i,o]=J.useState(!1),u=J.useRef(!1),S=J.useRef(new Set([])),[y,a]=J.useMemo(()=>{if(e!==null){const _=(Array.isArray(e)?e:[e]).filter(l=>typeof l=="string").map(l=>l.replace("+",`
|
|
57
|
+
`).replace(`
|
|
58
|
+
|
|
59
|
+
`,`
|
|
60
|
+
+`).split(`
|
|
61
|
+
`)),v=_.reduce((l,m)=>l.concat(...m),[]);return[_,v]}return[[],[]]},[e]);return J.useEffect(()=>{const c=(r==null?void 0:r.target)??Pp,_=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(e!==null){const v=x=>{var f,p;if(u.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!u.current||u.current&&!_)&&ng(x))return!1;const C=Np(x.code,a);if(S.current.add(x[C]),Bp(y,S.current,!1)){const d=((p=(f=x.composedPath)==null?void 0:f.call(x))==null?void 0:p[0])||x.target,h=(d==null?void 0:d.nodeName)==="BUTTON"||(d==null?void 0:d.nodeName)==="A";r.preventDefault!==!1&&(u.current||!h)&&x.preventDefault(),o(!0)}},l=x=>{const b=Np(x.code,a);Bp(y,S.current,!0)?(o(!1),S.current.clear()):S.current.delete(x[b]),x.key==="Meta"&&S.current.clear(),u.current=!1},m=()=>{S.current.clear(),o(!1)};return c==null||c.addEventListener("keydown",v),c==null||c.addEventListener("keyup",l),window.addEventListener("blur",m),window.addEventListener("contextmenu",m),()=>{c==null||c.removeEventListener("keydown",v),c==null||c.removeEventListener("keyup",l),window.removeEventListener("blur",m),window.removeEventListener("contextmenu",m)}}},[e,o]),i}function Bp(e,r,i){return e.filter(o=>i||o.length===r.size).some(o=>o.every(u=>r.has(u)))}function Np(e,r){return r.includes(e)?"code":"key"}const ix=()=>{const e=ze();return J.useMemo(()=>({zoomIn:r=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1.2,r):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1/1.2,r):Promise.resolve(!1)},zoomTo:(r,i)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(r,i):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(r,i)=>{const{transform:[o,u,S],panZoom:y}=e.getState();return y?(await y.setViewport({x:r.x??o,y:r.y??u,zoom:r.zoom??S},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,i,o]=e.getState().transform;return{x:r,y:i,zoom:o}},setCenter:async(r,i,o)=>e.getState().setCenter(r,i,o),fitBounds:async(r,i)=>{const{width:o,height:u,minZoom:S,maxZoom:y,panZoom:a}=e.getState(),c=Ju(r,o,u,S,y,(i==null?void 0:i.padding)??.1);return a?(await a.setViewport(c,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,i={})=>{const{transform:o,snapGrid:u,snapToGrid:S,domNode:y}=e.getState();if(!y)return r;const{x:a,y:c}=y.getBoundingClientRect(),_={x:r.x-a,y:r.y-c},v=i.snapGrid??u,l=i.snapToGrid??S;return As(_,o,l,v)},flowToScreenPosition:r=>{const{transform:i,domNode:o}=e.getState();if(!o)return r;const{x:u,y:S}=o.getBoundingClientRect(),y=Ra(r,i);return{x:y.x+u,y:y.y+S}}}),[])};function Eg(e,r){const i=[],o=new Map,u=[];for(const S of e)if(S.type==="add"){u.push(S);continue}else if(S.type==="remove"||S.type==="replace")o.set(S.id,[S]);else{const y=o.get(S.id);y?y.push(S):o.set(S.id,[S])}for(const S of r){const y=o.get(S.id);if(!y){i.push(S);continue}if(y[0].type==="remove")continue;if(y[0].type==="replace"){i.push({...y[0].item});continue}const a={...S};for(const c of y)sx(c,a);i.push(a)}return u.length&&u.forEach(S=>{S.index!==void 0?i.splice(S.index,0,{...S.item}):i.push({...S.item})}),i}function sx(e,r){switch(e.type){case"select":{r.selected=e.selected;break}case"position":{typeof e.position<"u"&&(r.position=e.position),typeof e.dragging<"u"&&(r.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(r.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(r.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(r.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(r.resizing=e.resizing);break}}}function ox(e,r){return Eg(e,r)}function ax(e,r){return Eg(e,r)}function yn(e,r){return{id:e,type:"select",selected:r}}function si(e,r=new Set,i=!1){const o=[];for(const[u,S]of e){const y=r.has(u);!(S.selected===void 0&&!y)&&S.selected!==y&&(i&&(S.selected=y),o.push(yn(S.id,y)))}return o}function Ip({items:e=[],lookup:r}){var u;const i=[],o=new Map(e.map(S=>[S.id,S]));for(const[S,y]of e.entries()){const a=r.get(y.id),c=((u=a==null?void 0:a.internals)==null?void 0:u.userNode)??a;c!==void 0&&c!==y&&i.push({id:y.id,item:y,type:"replace"}),c===void 0&&i.push({item:y,type:"add",index:S})}for(const[S]of r)o.get(S)===void 0&&i.push({id:S,type:"remove"});return i}function Op(e){return{id:e.id,type:"remove"}}const Hp=e=>DS(e),lx=e=>Y_(e);function kg(e){return J.forwardRef(e)}function Fp(e){const[r,i]=J.useState(BigInt(0)),[o]=J.useState(()=>cx(()=>i(u=>u+BigInt(1))));return Tu(()=>{const u=o.get();u.length&&(e(u),o.reset())},[r]),o}function cx(e){let r=[];return{get:()=>r,reset:()=>{r=[]},push:i=>{r.push(i),e()}}}const Lg=J.createContext(null);function ux({children:e}){const r=ze(),i=J.useCallback(a=>{const{nodes:c=[],setNodes:_,hasDefaultNodes:v,onNodesChange:l,nodeLookup:m,fitViewQueued:x,onNodesChangeMiddlewareMap:b}=r.getState();let C=c;for(const p of a)C=typeof p=="function"?p(C):p;let f=Ip({items:C,lookup:m});for(const p of b.values())f=p(f);v&&_(C),f.length>0?l==null||l(f):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:p,nodes:d,setNodes:h}=r.getState();p&&h(d)})},[]),o=Fp(i),u=J.useCallback(a=>{const{edges:c=[],setEdges:_,hasDefaultEdges:v,onEdgesChange:l,edgeLookup:m}=r.getState();let x=c;for(const b of a)x=typeof b=="function"?b(x):b;v?_(x):l&&l(Ip({items:x,lookup:m}))},[]),S=Fp(u),y=J.useMemo(()=>({nodeQueue:o,edgeQueue:S}),[]);return j.jsx(Lg.Provider,{value:y,children:e})}function hx(){const e=J.useContext(Lg);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const dx=e=>!!e.panZoom;function sh(){const e=ix(),r=ze(),i=hx(),o=Te(dx),u=J.useMemo(()=>{const S=l=>r.getState().nodeLookup.get(l),y=l=>{i.nodeQueue.push(l)},a=l=>{i.edgeQueue.push(l)},c=l=>{var p,d;const{nodeLookup:m,nodeOrigin:x}=r.getState(),b=Hp(l)?l:m.get(l.id),C=b.parentId?tg(b.position,b.measured,b.parentId,m,x):b.position,f={...b,position:C,width:((p=b.measured)==null?void 0:p.width)??b.width,height:((d=b.measured)==null?void 0:d.height)??b.height};return di(f)},_=(l,m,x={replace:!1})=>{y(b=>b.map(C=>{if(C.id===l){const f=typeof m=="function"?m(C):m;return x.replace&&Hp(f)?f:{...C,...f}}return C}))},v=(l,m,x={replace:!1})=>{a(b=>b.map(C=>{if(C.id===l){const f=typeof m=="function"?m(C):m;return x.replace&&lx(f)?f:{...C,...f}}return C}))};return{getNodes:()=>r.getState().nodes.map(l=>({...l})),getNode:l=>{var m;return(m=S(l))==null?void 0:m.internals.userNode},getInternalNode:S,getEdges:()=>{const{edges:l=[]}=r.getState();return l.map(m=>({...m}))},getEdge:l=>r.getState().edgeLookup.get(l),setNodes:y,setEdges:a,addNodes:l=>{const m=Array.isArray(l)?l:[l];i.nodeQueue.push(x=>[...x,...m])},addEdges:l=>{const m=Array.isArray(l)?l:[l];i.edgeQueue.push(x=>[...x,...m])},toObject:()=>{const{nodes:l=[],edges:m=[],transform:x}=r.getState(),[b,C,f]=x;return{nodes:l.map(p=>({...p})),edges:m.map(p=>({...p})),viewport:{x:b,y:C,zoom:f}}},deleteElements:async({nodes:l=[],edges:m=[]})=>{const{nodes:x,edges:b,onNodesDelete:C,onEdgesDelete:f,triggerNodeChanges:p,triggerEdgeChanges:d,onDelete:h,onBeforeDelete:w}=r.getState(),{nodes:L,edges:R}=await BS({nodesToRemove:l,edgesToRemove:m,nodes:x,edges:b,onBeforeDelete:w}),D=R.length>0,k=L.length>0;if(D){const M=R.map(Op);f==null||f(R),d(M)}if(k){const M=L.map(Op);C==null||C(L),p(M)}return(k||D)&&(h==null||h({nodes:L,edges:R})),{deletedNodes:L,deletedEdges:R}},getIntersectingNodes:(l,m=!0,x)=>{const b=up(l),C=b?l:c(l),f=x!==void 0;return C?(x||r.getState().nodes).filter(p=>{const d=r.getState().nodeLookup.get(p.id);if(d&&!b&&(p.id===l.id||!d.internals.positionAbsolute))return!1;const h=di(f?p:d),w=Cs(h,C);return m&&w>0||w>=h.width*h.height||w>=C.width*C.height}):[]},isNodeIntersecting:(l,m,x=!0)=>{const C=up(l)?l:c(l);if(!C)return!1;const f=Cs(C,m);return x&&f>0||f>=m.width*m.height||f>=C.width*C.height},updateNode:_,updateNodeData:(l,m,x={replace:!1})=>{_(l,b=>{const C=typeof m=="function"?m(b):m;return x.replace?{...b,data:C}:{...b,data:{...b.data,...C}}},x)},updateEdge:v,updateEdgeData:(l,m,x={replace:!1})=>{v(l,b=>{const C=typeof m=="function"?m(b):m;return x.replace?{...b,data:C}:{...b,data:{...b.data,...C}}},x)},getNodesBounds:l=>{const{nodeLookup:m,nodeOrigin:x}=r.getState();return TS(l,{nodeLookup:m,nodeOrigin:x})},getHandleConnections:({type:l,id:m,nodeId:x})=>{var b;return Array.from(((b=r.getState().connectionLookup.get(`${x}-${l}${m?`-${m}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:l,handleId:m,nodeId:x})=>{var b;return Array.from(((b=r.getState().connectionLookup.get(`${x}${l?m?`-${l}-${m}`:`-${l}`:""}`))==null?void 0:b.values())??[])},fitView:async l=>{const m=r.getState().fitViewResolver??HS();return r.setState({fitViewQueued:!0,fitViewOptions:l,fitViewResolver:m}),i.nodeQueue.push(x=>[...x]),m.promise}}},[]);return J.useMemo(()=>({...u,...e,viewportInitialized:o}),[o])}const jp=e=>e.selected,fx=typeof window<"u"?window:void 0;function px({deleteKeyCode:e,multiSelectionKeyCode:r}){const i=ze(),{deleteElements:o}=sh(),u=bs(e,{actInsideInputWithModifier:!1}),S=bs(r,{target:fx});J.useEffect(()=>{if(u){const{edges:y,nodes:a}=i.getState();o({nodes:a.filter(jp),edges:y.filter(jp)}),i.setState({nodesSelectionActive:!1})}},[u]),J.useEffect(()=>{i.setState({multiSelectionActive:S})},[S])}function _x(e){const r=ze();J.useEffect(()=>{const i=()=>{var u,S,y,a;if(!e.current||!(((S=(u=e.current).checkVisibility)==null?void 0:S.call(u))??!0))return!1;const o=Zu(e.current);(o.height===0||o.width===0)&&((a=(y=r.getState()).onError)==null||a.call(y,"004",dr.error004())),r.setState({width:o.width||500,height:o.height||500})};if(e.current){i(),window.addEventListener("resize",i);const o=new ResizeObserver(()=>i());return o.observe(e.current),()=>{window.removeEventListener("resize",i),o&&e.current&&o.unobserve(e.current)}}},[])}const Ua={position:"absolute",width:"100%",height:"100%",top:0,left:0},gx=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function mx({onPaneContextMenu:e,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:o=!1,panOnScrollSpeed:u=.5,panOnScrollMode:S=Cn.Free,zoomOnDoubleClick:y=!0,panOnDrag:a=!0,defaultViewport:c,translateExtent:_,minZoom:v,maxZoom:l,zoomActivationKeyCode:m,preventScrolling:x=!0,children:b,noWheelClassName:C,noPanClassName:f,onViewportChange:p,isControlledViewport:d,paneClickDistance:h,selectionOnDrag:w}){const L=ze(),R=J.useRef(null),{userSelectionActive:D,lib:k,connectionInProgress:M}=Te(gx,je),W=bs(m),z=J.useRef();_x(R);const F=J.useCallback(N=>{p==null||p({x:N[0],y:N[1],zoom:N[2]}),d||L.setState({transform:N})},[p,d]);return J.useEffect(()=>{if(R.current){z.current=SC({domNode:R.current,minZoom:v,maxZoom:l,translateExtent:_,viewport:c,onDraggingChange:V=>L.setState(K=>K.paneDragging===V?K:{paneDragging:V}),onPanZoomStart:(V,K)=>{const{onViewportChangeStart:U,onMoveStart:A}=L.getState();A==null||A(V,K),U==null||U(K)},onPanZoom:(V,K)=>{const{onViewportChange:U,onMove:A}=L.getState();A==null||A(V,K),U==null||U(K)},onPanZoomEnd:(V,K)=>{const{onViewportChangeEnd:U,onMoveEnd:A}=L.getState();A==null||A(V,K),U==null||U(K)}});const{x:N,y:I,zoom:q}=z.current.getViewport();return L.setState({panZoom:z.current,transform:[N,I,q],domNode:R.current.closest(".react-flow")}),()=>{var V;(V=z.current)==null||V.destroy()}}},[]),J.useEffect(()=>{var N;(N=z.current)==null||N.update({onPaneContextMenu:e,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:o,panOnScrollSpeed:u,panOnScrollMode:S,zoomOnDoubleClick:y,panOnDrag:a,zoomActivationKeyPressed:W,preventScrolling:x,noPanClassName:f,userSelectionActive:D,noWheelClassName:C,lib:k,onTransformChange:F,connectionInProgress:M,selectionOnDrag:w,paneClickDistance:h})},[e,r,i,o,u,S,y,a,W,x,f,D,C,k,F,M,w,h]),j.jsx("div",{className:"react-flow__renderer",ref:R,style:Ua,children:b})}const vx=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function yx(){const{userSelectionActive:e,userSelectionRect:r}=Te(vx,je);return e&&r?j.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:r.width,height:r.height,transform:`translate(${r.x}px, ${r.y}px)`}}):null}const ru=(e,r)=>i=>{i.target===r.current&&(e==null||e(i))},wx=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function Sx({isSelecting:e,selectionKeyPressed:r,selectionMode:i=Ss.Full,panOnDrag:o,paneClickDistance:u,selectionOnDrag:S,onSelectionStart:y,onSelectionEnd:a,onPaneClick:c,onPaneContextMenu:_,onPaneScroll:v,onPaneMouseEnter:l,onPaneMouseMove:m,onPaneMouseLeave:x,children:b}){const C=ze(),{userSelectionActive:f,elementsSelectable:p,dragging:d,connectionInProgress:h}=Te(wx,je),w=p&&(e||f),L=J.useRef(null),R=J.useRef(),D=J.useRef(new Set),k=J.useRef(new Set),M=J.useRef(!1),W=U=>{if(M.current||h){M.current=!1;return}c==null||c(U),C.getState().resetSelectedElements(),C.setState({nodesSelectionActive:!1})},z=U=>{if(Array.isArray(o)&&(o!=null&&o.includes(2))){U.preventDefault();return}_==null||_(U)},F=v?U=>v(U):void 0,N=U=>{M.current&&(U.stopPropagation(),M.current=!1)},I=U=>{var se,ee;const{domNode:A}=C.getState();if(R.current=A==null?void 0:A.getBoundingClientRect(),!R.current)return;const B=U.target===L.current;if(!B&&!!U.target.closest(".nokey")||!e||!(S&&B||r)||U.button!==0||!U.isPrimary)return;(ee=(se=U.target)==null?void 0:se.setPointerCapture)==null||ee.call(se,U.pointerId),M.current=!1;const{x:G,y:Z}=er(U.nativeEvent,R.current);C.setState({userSelectionRect:{width:0,height:0,startX:G,startY:Z,x:G,y:Z}}),B||(U.stopPropagation(),U.preventDefault())},q=U=>{const{userSelectionRect:A,transform:B,nodeLookup:P,edgeLookup:H,connectionLookup:G,triggerNodeChanges:Z,triggerEdgeChanges:se,defaultEdgeOptions:ee,resetSelectedElements:X}=C.getState();if(!R.current||!A)return;const{x:O,y:re}=er(U.nativeEvent,R.current),{startX:ne,startY:ce}=A;if(!M.current){const xe=r?0:u;if(Math.hypot(O-ne,re-ce)<=xe)return;X(),y==null||y(U)}M.current=!0;const le={startX:ne,startY:ce,x:O<ne?O:ne,y:re<ce?re:ce,width:Math.abs(O-ne),height:Math.abs(re-ce)},fe=D.current,we=k.current;D.current=new Set(Qu(P,le,B,i===Ss.Partial,!0).map(xe=>xe.id)),k.current=new Set;const ye=(ee==null?void 0:ee.selectable)??!0;for(const xe of D.current){const ge=G.get(xe);if(ge)for(const{edgeId:Ie}of ge.values()){const st=H.get(Ie);st&&(st.selectable??ye)&&k.current.add(Ie)}}if(!hp(fe,D.current)){const xe=si(P,D.current,!0);Z(xe)}if(!hp(we,k.current)){const xe=si(H,k.current);se(xe)}C.setState({userSelectionRect:le,userSelectionActive:!0,nodesSelectionActive:!1})},V=U=>{var A,B;U.button===0&&((B=(A=U.target)==null?void 0:A.releasePointerCapture)==null||B.call(A,U.pointerId),!f&&U.target===L.current&&C.getState().userSelectionRect&&(W==null||W(U)),C.setState({userSelectionActive:!1,userSelectionRect:null}),M.current&&(a==null||a(U),C.setState({nodesSelectionActive:D.current.size>0})))},K=o===!0||Array.isArray(o)&&o.includes(0);return j.jsxs("div",{className:Ge(["react-flow__pane",{draggable:K,dragging:d,selection:e}]),onClick:w?void 0:ru(W,L),onContextMenu:ru(z,L),onWheel:ru(F,L),onPointerEnter:w?void 0:l,onPointerMove:w?q:m,onPointerUp:w?V:void 0,onPointerDownCapture:w?I:void 0,onClickCapture:w?N:void 0,onPointerLeave:x,ref:L,style:Ua,children:[b,j.jsx(yx,{})]})}function Au({id:e,store:r,unselect:i=!1,nodeRef:o}){const{addSelectedNodes:u,unselectNodesAndEdges:S,multiSelectionActive:y,nodeLookup:a,onError:c}=r.getState(),_=a.get(e);if(!_){c==null||c("012",dr.error012(e));return}r.setState({nodesSelectionActive:!1}),_.selected?(i||_.selected&&y)&&(S({nodes:[_],edges:[]}),requestAnimationFrame(()=>{var v;return(v=o==null?void 0:o.current)==null?void 0:v.blur()})):u([e])}function Rg({nodeRef:e,disabled:r=!1,noDragClassName:i,handleSelector:o,nodeId:u,isSelectable:S,nodeClickDistance:y}){const a=ze(),[c,_]=J.useState(!1),v=J.useRef();return J.useEffect(()=>{v.current=aC({getStoreItems:()=>a.getState(),onNodeMouseDown:l=>{Au({id:l,store:a,nodeRef:e})},onDragStart:()=>{_(!0)},onDragStop:()=>{_(!1)}})},[]),J.useEffect(()=>{if(!(r||!e.current||!v.current))return v.current.update({noDragClassName:i,handleSelector:o,domNode:e.current,isSelectable:S,nodeId:u,nodeClickDistance:y}),()=>{var l;(l=v.current)==null||l.destroy()}},[i,o,r,S,e,u,y]),c}const Cx=e=>r=>r.selected&&(r.draggable||e&&typeof r.draggable>"u");function Dg(){const e=ze();return J.useCallback(i=>{const{nodeExtent:o,snapToGrid:u,snapGrid:S,nodesDraggable:y,onError:a,updateNodePositions:c,nodeLookup:_,nodeOrigin:v}=e.getState(),l=new Map,m=Cx(y),x=u?S[0]:5,b=u?S[1]:5,C=i.direction.x*x*i.factor,f=i.direction.y*b*i.factor;for(const[,p]of _){if(!m(p))continue;let d={x:p.internals.positionAbsolute.x+C,y:p.internals.positionAbsolute.y+f};u&&(d=Ts(d,S));const{position:h,positionAbsolute:w}=G_({nodeId:p.id,nextPosition:d,nodeLookup:_,nodeExtent:o,nodeOrigin:v,onError:a});p.position=h,p.internals.positionAbsolute=w,l.set(p.id,p)}c(l)},[])}const oh=J.createContext(null),xx=oh.Provider;oh.Consumer;const Tg=()=>J.useContext(oh),bx=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Ex=(e,r,i)=>o=>{const{connectionClickStartHandle:u,connectionMode:S,connection:y}=o,{fromHandle:a,toHandle:c,isValid:_}=y,v=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===r&&(c==null?void 0:c.type)===i;return{connectingFrom:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===r&&(a==null?void 0:a.type)===i,connectingTo:v,clickConnecting:(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===r&&(u==null?void 0:u.type)===i,isPossibleEndHandle:S===ui.Strict?(a==null?void 0:a.type)!==i:e!==(a==null?void 0:a.nodeId)||r!==(a==null?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!u,valid:v&&_}};function kx({type:e="source",position:r=be.Top,isValidConnection:i,isConnectable:o=!0,isConnectableStart:u=!0,isConnectableEnd:S=!0,id:y,onConnect:a,children:c,className:_,onMouseDown:v,onTouchStart:l,...m},x){var q,V;const b=y||null,C=e==="target",f=ze(),p=Tg(),{connectOnClick:d,noPanClassName:h,rfId:w}=Te(bx,je),{connectingFrom:L,connectingTo:R,clickConnecting:D,isPossibleEndHandle:k,connectionInProcess:M,clickConnectionInProcess:W,valid:z}=Te(Ex(p,b,e),je);p||(V=(q=f.getState()).onError)==null||V.call(q,"010",dr.error010());const F=K=>{const{defaultEdgeOptions:U,onConnect:A,hasDefaultEdges:B}=f.getState(),P={...U,...K};if(B){const{edges:H,setEdges:G}=f.getState();G(VS(P,H))}A==null||A(P),a==null||a(P)},N=K=>{if(!p)return;const U=ig(K.nativeEvent);if(u&&(U&&K.button===0||!U)){const A=f.getState();Du.onPointerDown(K.nativeEvent,{handleDomNode:K.currentTarget,autoPanOnConnect:A.autoPanOnConnect,connectionMode:A.connectionMode,connectionRadius:A.connectionRadius,domNode:A.domNode,nodeLookup:A.nodeLookup,lib:A.lib,isTarget:C,handleId:b,nodeId:p,flowId:A.rfId,panBy:A.panBy,cancelConnection:A.cancelConnection,onConnectStart:A.onConnectStart,onConnectEnd:(...B)=>{var P,H;return(H=(P=f.getState()).onConnectEnd)==null?void 0:H.call(P,...B)},updateConnection:A.updateConnection,onConnect:F,isValidConnection:i||((...B)=>{var P,H;return((H=(P=f.getState()).isValidConnection)==null?void 0:H.call(P,...B))??!0}),getTransform:()=>f.getState().transform,getFromHandle:()=>f.getState().connection.fromHandle,autoPanSpeed:A.autoPanSpeed,dragThreshold:A.connectionDragThreshold})}U?v==null||v(K):l==null||l(K)},I=K=>{const{onClickConnectStart:U,onClickConnectEnd:A,connectionClickStartHandle:B,connectionMode:P,isValidConnection:H,lib:G,rfId:Z,nodeLookup:se,connection:ee}=f.getState();if(!p||!B&&!u)return;if(!B){U==null||U(K.nativeEvent,{nodeId:p,handleId:b,handleType:e}),f.setState({connectionClickStartHandle:{nodeId:p,type:e,id:b}});return}const X=rg(K.target),O=i||H,{connection:re,isValid:ne}=Du.isValid(K.nativeEvent,{handle:{nodeId:p,id:b,type:e},connectionMode:P,fromNodeId:B.nodeId,fromHandleId:B.id||null,fromType:B.type,isValidConnection:O,flowId:Z,doc:X,lib:G,nodeLookup:se});ne&&re&&F(re);const ce=structuredClone(ee);delete ce.inProgress,ce.toPosition=ce.toHandle?ce.toHandle.position:null,A==null||A(K,ce),f.setState({connectionClickStartHandle:null})};return j.jsx("div",{"data-handleid":b,"data-nodeid":p,"data-handlepos":r,"data-id":`${w}-${p}-${b}-${e}`,className:Ge(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",h,_,{source:!C,target:C,connectable:o,connectablestart:u,connectableend:S,clickconnecting:D,connectingfrom:L,connectingto:R,valid:z,connectionindicator:o&&(!M||k)&&(M||W?S:u)}]),onMouseDown:N,onTouchStart:N,onClick:d?I:void 0,ref:x,...m,children:c})}const _i=J.memo(kg(kx));function Lx({data:e,isConnectable:r,sourcePosition:i=be.Bottom}){return j.jsxs(j.Fragment,{children:[e==null?void 0:e.label,j.jsx(_i,{type:"source",position:i,isConnectable:r})]})}function Rx({data:e,isConnectable:r,targetPosition:i=be.Top,sourcePosition:o=be.Bottom}){return j.jsxs(j.Fragment,{children:[j.jsx(_i,{type:"target",position:i,isConnectable:r}),e==null?void 0:e.label,j.jsx(_i,{type:"source",position:o,isConnectable:r})]})}function Dx(){return null}function Tx({data:e,isConnectable:r,targetPosition:i=be.Top}){return j.jsxs(j.Fragment,{children:[j.jsx(_i,{type:"target",position:i,isConnectable:r}),e==null?void 0:e.label]})}const Da={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},zp={input:Lx,default:Rx,output:Tx,group:Dx};function Ax(e){var r,i,o,u;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((r=e.style)==null?void 0:r.width),height:e.height??e.initialHeight??((i=e.style)==null?void 0:i.height)}:{width:e.width??((o=e.style)==null?void 0:o.width),height:e.height??((u=e.style)==null?void 0:u.height)}}const Mx=e=>{const{width:r,height:i,x:o,y:u}=Ds(e.nodeLookup,{filter:S=>!!S.selected});return{width:Zt(r)?r:null,height:Zt(i)?i:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${u}px)`}};function Px({onSelectionContextMenu:e,noPanClassName:r,disableKeyboardA11y:i}){const o=ze(),{width:u,height:S,transformString:y,userSelectionActive:a}=Te(Mx,je),c=Dg(),_=J.useRef(null);J.useEffect(()=>{var x;i||(x=_.current)==null||x.focus({preventScroll:!0})},[i]);const v=!a&&u!==null&&S!==null;if(Rg({nodeRef:_,disabled:!v}),!v)return null;const l=e?x=>{const b=o.getState().nodes.filter(C=>C.selected);e(x,b)}:void 0,m=x=>{Object.prototype.hasOwnProperty.call(Da,x.key)&&(x.preventDefault(),c({direction:Da[x.key],factor:x.shiftKey?4:1}))};return j.jsx("div",{className:Ge(["react-flow__nodesselection","react-flow__container",r]),style:{transform:y},children:j.jsx("div",{ref:_,className:"react-flow__nodesselection-rect",onContextMenu:l,tabIndex:i?void 0:-1,onKeyDown:i?void 0:m,style:{width:u,height:S}})})}const $p=typeof window<"u"?window:void 0,Bx=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Ag({children:e,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:o,onPaneMouseLeave:u,onPaneContextMenu:S,onPaneScroll:y,paneClickDistance:a,deleteKeyCode:c,selectionKeyCode:_,selectionOnDrag:v,selectionMode:l,onSelectionStart:m,onSelectionEnd:x,multiSelectionKeyCode:b,panActivationKeyCode:C,zoomActivationKeyCode:f,elementsSelectable:p,zoomOnScroll:d,zoomOnPinch:h,panOnScroll:w,panOnScrollSpeed:L,panOnScrollMode:R,zoomOnDoubleClick:D,panOnDrag:k,defaultViewport:M,translateExtent:W,minZoom:z,maxZoom:F,preventScrolling:N,onSelectionContextMenu:I,noWheelClassName:q,noPanClassName:V,disableKeyboardA11y:K,onViewportChange:U,isControlledViewport:A}){const{nodesSelectionActive:B,userSelectionActive:P}=Te(Bx,je),H=bs(_,{target:$p}),G=bs(C,{target:$p}),Z=G||k,se=G||w,ee=v&&Z!==!0,X=H||P||ee;return px({deleteKeyCode:c,multiSelectionKeyCode:b}),j.jsx(mx,{onPaneContextMenu:S,elementsSelectable:p,zoomOnScroll:d,zoomOnPinch:h,panOnScroll:se,panOnScrollSpeed:L,panOnScrollMode:R,zoomOnDoubleClick:D,panOnDrag:!H&&Z,defaultViewport:M,translateExtent:W,minZoom:z,maxZoom:F,zoomActivationKeyCode:f,preventScrolling:N,noWheelClassName:q,noPanClassName:V,onViewportChange:U,isControlledViewport:A,paneClickDistance:a,selectionOnDrag:ee,children:j.jsxs(Sx,{onSelectionStart:m,onSelectionEnd:x,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:o,onPaneMouseLeave:u,onPaneContextMenu:S,onPaneScroll:y,panOnDrag:Z,isSelecting:!!X,selectionMode:l,selectionKeyPressed:H,paneClickDistance:a,selectionOnDrag:ee,children:[e,B&&j.jsx(Px,{onSelectionContextMenu:I,noPanClassName:V,disableKeyboardA11y:K})]})})}Ag.displayName="FlowRenderer";const Nx=J.memo(Ag),Ix=e=>r=>e?Qu(r.nodeLookup,{x:0,y:0,width:r.width,height:r.height},r.transform,!0).map(i=>i.id):Array.from(r.nodeLookup.keys());function Ox(e){return Te(J.useCallback(Ix(e),[e]),je)}const Hx=e=>e.updateNodeInternals;function Fx(){const e=Te(Hx),[r]=J.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const o=new Map;i.forEach(u=>{const S=u.target.getAttribute("data-id");o.set(S,{id:S,nodeElement:u.target,force:!0})}),e(o)}));return J.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function jx({node:e,nodeType:r,hasDimensions:i,resizeObserver:o}){const u=ze(),S=J.useRef(null),y=J.useRef(null),a=J.useRef(e.sourcePosition),c=J.useRef(e.targetPosition),_=J.useRef(r),v=i&&!!e.internals.handleBounds;return J.useEffect(()=>{S.current&&!e.hidden&&(!v||y.current!==S.current)&&(y.current&&(o==null||o.unobserve(y.current)),o==null||o.observe(S.current),y.current=S.current)},[v,e.hidden]),J.useEffect(()=>()=>{y.current&&(o==null||o.unobserve(y.current),y.current=null)},[]),J.useEffect(()=>{if(S.current){const l=_.current!==r,m=a.current!==e.sourcePosition,x=c.current!==e.targetPosition;(l||m||x)&&(_.current=r,a.current=e.sourcePosition,c.current=e.targetPosition,u.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:S.current,force:!0}]])))}},[e.id,r,e.sourcePosition,e.targetPosition]),S}function zx({id:e,onClick:r,onMouseEnter:i,onMouseMove:o,onMouseLeave:u,onContextMenu:S,onDoubleClick:y,nodesDraggable:a,elementsSelectable:c,nodesConnectable:_,nodesFocusable:v,resizeObserver:l,noDragClassName:m,noPanClassName:x,disableKeyboardA11y:b,rfId:C,nodeTypes:f,nodeClickDistance:p,onError:d}){const{node:h,internals:w,isParent:L}=Te(O=>{const re=O.nodeLookup.get(e),ne=O.parentLookup.has(e);return{node:re,internals:re.internals,isParent:ne}},je);let R=h.type||"default",D=(f==null?void 0:f[R])||zp[R];D===void 0&&(d==null||d("003",dr.error003(R)),R="default",D=(f==null?void 0:f.default)||zp.default);const k=!!(h.draggable||a&&typeof h.draggable>"u"),M=!!(h.selectable||c&&typeof h.selectable>"u"),W=!!(h.connectable||_&&typeof h.connectable>"u"),z=!!(h.focusable||v&&typeof h.focusable>"u"),F=ze(),N=eg(h),I=jx({node:h,nodeType:R,hasDimensions:N,resizeObserver:l}),q=Rg({nodeRef:I,disabled:h.hidden||!k,noDragClassName:m,handleSelector:h.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:p}),V=Dg();if(h.hidden)return null;const K=Lr(h),U=Ax(h),A=M||k||r||i||o||u,B=i?O=>i(O,{...w.userNode}):void 0,P=o?O=>o(O,{...w.userNode}):void 0,H=u?O=>u(O,{...w.userNode}):void 0,G=S?O=>S(O,{...w.userNode}):void 0,Z=y?O=>y(O,{...w.userNode}):void 0,se=O=>{const{selectNodesOnDrag:re,nodeDragThreshold:ne}=F.getState();M&&(!re||!k||ne>0)&&Au({id:e,store:F,nodeRef:I}),r&&r(O,{...w.userNode})},ee=O=>{if(!(ng(O.nativeEvent)||b)){if(V_.includes(O.key)&&M){const re=O.key==="Escape";Au({id:e,store:F,unselect:re,nodeRef:I})}else if(k&&h.selected&&Object.prototype.hasOwnProperty.call(Da,O.key)){O.preventDefault();const{ariaLabelConfig:re}=F.getState();F.setState({ariaLiveMessage:re["node.a11yDescription.ariaLiveMessage"]({direction:O.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),V({direction:Da[O.key],factor:O.shiftKey?4:1})}}},X=()=>{var we;if(b||!((we=I.current)!=null&&we.matches(":focus-visible")))return;const{transform:O,width:re,height:ne,autoPanOnNodeFocus:ce,setCenter:le}=F.getState();if(!ce)return;Qu(new Map([[e,h]]),{x:0,y:0,width:re,height:ne},O,!0).length>0||le(h.position.x+K.width/2,h.position.y+K.height/2,{zoom:O[2]})};return j.jsx("div",{className:Ge(["react-flow__node",`react-flow__node-${R}`,{[x]:k},h.className,{selected:h.selected,selectable:M,parent:L,draggable:k,dragging:q}]),ref:I,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:A?"all":"none",visibility:N?"visible":"hidden",...h.style,...U},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:B,onMouseMove:P,onMouseLeave:H,onContextMenu:G,onClick:se,onDoubleClick:Z,onKeyDown:z?ee:void 0,tabIndex:z?0:void 0,onFocus:z?X:void 0,role:h.ariaRole??(z?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${Cg}-${C}`,"aria-label":h.ariaLabel,...h.domAttributes,children:j.jsx(xx,{value:e,children:j.jsx(D,{id:e,data:h.data,type:R,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:h.selected??!1,selectable:M,draggable:k,deletable:h.deletable??!0,isConnectable:W,sourcePosition:h.sourcePosition,targetPosition:h.targetPosition,dragging:q,dragHandle:h.dragHandle,zIndex:w.z,parentId:h.parentId,...K})})})}var $x=J.memo(zx);const Wx=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Mg(e){const{nodesDraggable:r,nodesConnectable:i,nodesFocusable:o,elementsSelectable:u,onError:S}=Te(Wx,je),y=Ox(e.onlyRenderVisibleElements),a=Fx();return j.jsx("div",{className:"react-flow__nodes",style:Ua,children:y.map(c=>j.jsx($x,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:r,nodesConnectable:i,nodesFocusable:o,elementsSelectable:u,nodeClickDistance:e.nodeClickDistance,onError:S},c))})}Mg.displayName="NodeRenderer";const Ux=J.memo(Mg);function Vx(e){return Te(J.useCallback(i=>{if(!e)return i.edges.map(u=>u.id);const o=[];if(i.width&&i.height)for(const u of i.edges){const S=i.nodeLookup.get(u.source),y=i.nodeLookup.get(u.target);S&&y&&$S({sourceNode:S,targetNode:y,width:i.width,height:i.height,transform:i.transform})&&o.push(u.id)}return o},[e]),je)}const qx=({color:e="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...e&&{stroke:e}};return j.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Kx=({color:e="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...e&&{stroke:e,fill:e}};return j.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Wp={[ka.Arrow]:qx,[ka.ArrowClosed]:Kx};function Xx(e){const r=ze();return J.useMemo(()=>{var u,S;return Object.prototype.hasOwnProperty.call(Wp,e)?Wp[e]:((S=(u=r.getState()).onError)==null||S.call(u,"009",dr.error009(e)),null)},[e])}const Yx=({id:e,type:r,color:i,width:o=12.5,height:u=12.5,markerUnits:S="strokeWidth",strokeWidth:y,orient:a="auto-start-reverse"})=>{const c=Xx(r);return c?j.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${u}`,viewBox:"-10 -10 20 20",markerUnits:S,orient:a,refX:"0",refY:"0",children:j.jsx(c,{color:i,strokeWidth:y})}):null},Pg=({defaultColor:e,rfId:r})=>{const i=Te(S=>S.edges),o=Te(S=>S.defaultEdgeOptions),u=J.useMemo(()=>GS(i,{id:r,defaultColor:e,defaultMarkerStart:o==null?void 0:o.markerStart,defaultMarkerEnd:o==null?void 0:o.markerEnd}),[i,o,r,e]);return u.length?j.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:j.jsx("defs",{children:u.map(S=>j.jsx(Yx,{id:S.id,type:S.type,color:S.color,width:S.width,height:S.height,markerUnits:S.markerUnits,strokeWidth:S.strokeWidth,orient:S.orient},S.id))})}):null};Pg.displayName="MarkerDefinitions";var Gx=J.memo(Pg);function Bg({x:e,y:r,label:i,labelStyle:o,labelShowBg:u=!0,labelBgStyle:S,labelBgPadding:y=[2,4],labelBgBorderRadius:a=2,children:c,className:_,...v}){const[l,m]=J.useState({x:1,y:0,width:0,height:0}),x=Ge(["react-flow__edge-textwrapper",_]),b=J.useRef(null);return J.useEffect(()=>{if(b.current){const C=b.current.getBBox();m({x:C.x,y:C.y,width:C.width,height:C.height})}},[i]),i?j.jsxs("g",{transform:`translate(${e-l.width/2} ${r-l.height/2})`,className:x,visibility:l.width?"visible":"hidden",...v,children:[u&&j.jsx("rect",{width:l.width+2*y[0],x:-y[0],y:-y[1],height:l.height+2*y[1],className:"react-flow__edge-textbg",style:S,rx:a,ry:a}),j.jsx("text",{className:"react-flow__edge-text",y:l.height/2,dy:"0.3em",ref:b,style:o,children:i}),c]}):null}Bg.displayName="EdgeText";const Qx=J.memo(Bg);function Va({path:e,labelX:r,labelY:i,label:o,labelStyle:u,labelShowBg:S,labelBgStyle:y,labelBgPadding:a,labelBgBorderRadius:c,interactionWidth:_=20,...v}){return j.jsxs(j.Fragment,{children:[j.jsx("path",{...v,d:e,fill:"none",className:Ge(["react-flow__edge-path",v.className])}),_?j.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:_,className:"react-flow__edge-interaction"}):null,o&&Zt(r)&&Zt(i)?j.jsx(Qx,{x:r,y:i,label:o,labelStyle:u,labelShowBg:S,labelBgStyle:y,labelBgPadding:a,labelBgBorderRadius:c}):null]})}function Up({pos:e,x1:r,y1:i,x2:o,y2:u}){return e===be.Left||e===be.Right?[.5*(r+o),i]:[r,.5*(i+u)]}function Ng({sourceX:e,sourceY:r,sourcePosition:i=be.Bottom,targetX:o,targetY:u,targetPosition:S=be.Top}){const[y,a]=Up({pos:i,x1:e,y1:r,x2:o,y2:u}),[c,_]=Up({pos:S,x1:o,y1:u,x2:e,y2:r}),[v,l,m,x]=sg({sourceX:e,sourceY:r,targetX:o,targetY:u,sourceControlX:y,sourceControlY:a,targetControlX:c,targetControlY:_});return[`M${e},${r} C${y},${a} ${c},${_} ${o},${u}`,v,l,m,x]}function Ig(e){return J.memo(({id:r,sourceX:i,sourceY:o,targetX:u,targetY:S,sourcePosition:y,targetPosition:a,label:c,labelStyle:_,labelShowBg:v,labelBgStyle:l,labelBgPadding:m,labelBgBorderRadius:x,style:b,markerEnd:C,markerStart:f,interactionWidth:p})=>{const[d,h,w]=Ng({sourceX:i,sourceY:o,sourcePosition:y,targetX:u,targetY:S,targetPosition:a}),L=e.isInternal?void 0:r;return j.jsx(Va,{id:L,path:d,labelX:h,labelY:w,label:c,labelStyle:_,labelShowBg:v,labelBgStyle:l,labelBgPadding:m,labelBgBorderRadius:x,style:b,markerEnd:C,markerStart:f,interactionWidth:p})})}const Jx=Ig({isInternal:!1}),Og=Ig({isInternal:!0});Jx.displayName="SimpleBezierEdge";Og.displayName="SimpleBezierEdgeInternal";function Hg(e){return J.memo(({id:r,sourceX:i,sourceY:o,targetX:u,targetY:S,label:y,labelStyle:a,labelShowBg:c,labelBgStyle:_,labelBgPadding:v,labelBgBorderRadius:l,style:m,sourcePosition:x=be.Bottom,targetPosition:b=be.Top,markerEnd:C,markerStart:f,pathOptions:p,interactionWidth:d})=>{const[h,w,L]=ku({sourceX:i,sourceY:o,sourcePosition:x,targetX:u,targetY:S,targetPosition:b,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset,stepPosition:p==null?void 0:p.stepPosition}),R=e.isInternal?void 0:r;return j.jsx(Va,{id:R,path:h,labelX:w,labelY:L,label:y,labelStyle:a,labelShowBg:c,labelBgStyle:_,labelBgPadding:v,labelBgBorderRadius:l,style:m,markerEnd:C,markerStart:f,interactionWidth:d})})}const Fg=Hg({isInternal:!1}),jg=Hg({isInternal:!0});Fg.displayName="SmoothStepEdge";jg.displayName="SmoothStepEdgeInternal";function zg(e){return J.memo(({id:r,...i})=>{var u;const o=e.isInternal?void 0:r;return j.jsx(Fg,{...i,id:o,pathOptions:J.useMemo(()=>{var S;return{borderRadius:0,offset:(S=i.pathOptions)==null?void 0:S.offset}},[(u=i.pathOptions)==null?void 0:u.offset])})})}const Zx=zg({isInternal:!1}),$g=zg({isInternal:!0});Zx.displayName="StepEdge";$g.displayName="StepEdgeInternal";function Wg(e){return J.memo(({id:r,sourceX:i,sourceY:o,targetX:u,targetY:S,label:y,labelStyle:a,labelShowBg:c,labelBgStyle:_,labelBgPadding:v,labelBgBorderRadius:l,style:m,markerEnd:x,markerStart:b,interactionWidth:C})=>{const[f,p,d]=lg({sourceX:i,sourceY:o,targetX:u,targetY:S}),h=e.isInternal?void 0:r;return j.jsx(Va,{id:h,path:f,labelX:p,labelY:d,label:y,labelStyle:a,labelShowBg:c,labelBgStyle:_,labelBgPadding:v,labelBgBorderRadius:l,style:m,markerEnd:x,markerStart:b,interactionWidth:C})})}const e2=Wg({isInternal:!1}),Ug=Wg({isInternal:!0});e2.displayName="StraightEdge";Ug.displayName="StraightEdgeInternal";function Vg(e){return J.memo(({id:r,sourceX:i,sourceY:o,targetX:u,targetY:S,sourcePosition:y=be.Bottom,targetPosition:a=be.Top,label:c,labelStyle:_,labelShowBg:v,labelBgStyle:l,labelBgPadding:m,labelBgBorderRadius:x,style:b,markerEnd:C,markerStart:f,pathOptions:p,interactionWidth:d})=>{const[h,w,L]=og({sourceX:i,sourceY:o,sourcePosition:y,targetX:u,targetY:S,targetPosition:a,curvature:p==null?void 0:p.curvature}),R=e.isInternal?void 0:r;return j.jsx(Va,{id:R,path:h,labelX:w,labelY:L,label:c,labelStyle:_,labelShowBg:v,labelBgStyle:l,labelBgPadding:m,labelBgBorderRadius:x,style:b,markerEnd:C,markerStart:f,interactionWidth:d})})}const t2=Vg({isInternal:!1}),qg=Vg({isInternal:!0});t2.displayName="BezierEdge";qg.displayName="BezierEdgeInternal";const Vp={default:qg,straight:Ug,step:$g,smoothstep:jg,simplebezier:Og},qp={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},r2=(e,r,i)=>i===be.Left?e-r:i===be.Right?e+r:e,n2=(e,r,i)=>i===be.Top?e-r:i===be.Bottom?e+r:e,Kp="react-flow__edgeupdater";function Xp({position:e,centerX:r,centerY:i,radius:o=10,onMouseDown:u,onMouseEnter:S,onMouseOut:y,type:a}){return j.jsx("circle",{onMouseDown:u,onMouseEnter:S,onMouseOut:y,className:Ge([Kp,`${Kp}-${a}`]),cx:r2(r,o,e),cy:n2(i,o,e),r:o,stroke:"transparent",fill:"transparent"})}function i2({isReconnectable:e,reconnectRadius:r,edge:i,sourceX:o,sourceY:u,targetX:S,targetY:y,sourcePosition:a,targetPosition:c,onReconnect:_,onReconnectStart:v,onReconnectEnd:l,setReconnecting:m,setUpdateHover:x}){const b=ze(),C=(w,L)=>{if(w.button!==0)return;const{autoPanOnConnect:R,domNode:D,connectionMode:k,connectionRadius:M,lib:W,onConnectStart:z,cancelConnection:F,nodeLookup:N,rfId:I,panBy:q,updateConnection:V}=b.getState(),K=L.type==="target",U=(P,H)=>{m(!1),l==null||l(P,i,L.type,H)},A=P=>_==null?void 0:_(i,P),B=(P,H)=>{m(!0),v==null||v(w,i,L.type),z==null||z(P,H)};Du.onPointerDown(w.nativeEvent,{autoPanOnConnect:R,connectionMode:k,connectionRadius:M,domNode:D,handleId:L.id,nodeId:L.nodeId,nodeLookup:N,isTarget:K,edgeUpdaterType:L.type,lib:W,flowId:I,cancelConnection:F,panBy:q,isValidConnection:(...P)=>{var H,G;return((G=(H=b.getState()).isValidConnection)==null?void 0:G.call(H,...P))??!0},onConnect:A,onConnectStart:B,onConnectEnd:(...P)=>{var H,G;return(G=(H=b.getState()).onConnectEnd)==null?void 0:G.call(H,...P)},onReconnectEnd:U,updateConnection:V,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},f=w=>C(w,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),p=w=>C(w,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),d=()=>x(!0),h=()=>x(!1);return j.jsxs(j.Fragment,{children:[(e===!0||e==="source")&&j.jsx(Xp,{position:a,centerX:o,centerY:u,radius:r,onMouseDown:f,onMouseEnter:d,onMouseOut:h,type:"source"}),(e===!0||e==="target")&&j.jsx(Xp,{position:c,centerX:S,centerY:y,radius:r,onMouseDown:p,onMouseEnter:d,onMouseOut:h,type:"target"})]})}function s2({id:e,edgesFocusable:r,edgesReconnectable:i,elementsSelectable:o,onClick:u,onDoubleClick:S,onContextMenu:y,onMouseEnter:a,onMouseMove:c,onMouseLeave:_,reconnectRadius:v,onReconnect:l,onReconnectStart:m,onReconnectEnd:x,rfId:b,edgeTypes:C,noPanClassName:f,onError:p,disableKeyboardA11y:d}){let h=Te(le=>le.edgeLookup.get(e));const w=Te(le=>le.defaultEdgeOptions);h=w?{...w,...h}:h;let L=h.type||"default",R=(C==null?void 0:C[L])||Vp[L];R===void 0&&(p==null||p("011",dr.error011(L)),L="default",R=(C==null?void 0:C.default)||Vp.default);const D=!!(h.focusable||r&&typeof h.focusable>"u"),k=typeof l<"u"&&(h.reconnectable||i&&typeof h.reconnectable>"u"),M=!!(h.selectable||o&&typeof h.selectable>"u"),W=J.useRef(null),[z,F]=J.useState(!1),[N,I]=J.useState(!1),q=ze(),{zIndex:V,sourceX:K,sourceY:U,targetX:A,targetY:B,sourcePosition:P,targetPosition:H}=Te(J.useCallback(le=>{const fe=le.nodeLookup.get(h.source),we=le.nodeLookup.get(h.target);if(!fe||!we)return{zIndex:h.zIndex,...qp};const ye=YS({id:e,sourceNode:fe,targetNode:we,sourceHandle:h.sourceHandle||null,targetHandle:h.targetHandle||null,connectionMode:le.connectionMode,onError:p});return{zIndex:zS({selected:h.selected,zIndex:h.zIndex,sourceNode:fe,targetNode:we,elevateOnSelect:le.elevateEdgesOnSelect,zIndexMode:le.zIndexMode}),...ye||qp}},[h.source,h.target,h.sourceHandle,h.targetHandle,h.selected,h.zIndex]),je),G=J.useMemo(()=>h.markerStart?`url('#${Lu(h.markerStart,b)}')`:void 0,[h.markerStart,b]),Z=J.useMemo(()=>h.markerEnd?`url('#${Lu(h.markerEnd,b)}')`:void 0,[h.markerEnd,b]);if(h.hidden||K===null||U===null||A===null||B===null)return null;const se=le=>{var xe;const{addSelectedEdges:fe,unselectNodesAndEdges:we,multiSelectionActive:ye}=q.getState();M&&(q.setState({nodesSelectionActive:!1}),h.selected&&ye?(we({nodes:[],edges:[h]}),(xe=W.current)==null||xe.blur()):fe([e])),u&&u(le,h)},ee=S?le=>{S(le,{...h})}:void 0,X=y?le=>{y(le,{...h})}:void 0,O=a?le=>{a(le,{...h})}:void 0,re=c?le=>{c(le,{...h})}:void 0,ne=_?le=>{_(le,{...h})}:void 0,ce=le=>{var fe;if(!d&&V_.includes(le.key)&&M){const{unselectNodesAndEdges:we,addSelectedEdges:ye}=q.getState();le.key==="Escape"?((fe=W.current)==null||fe.blur(),we({edges:[h]})):ye([e])}};return j.jsx("svg",{style:{zIndex:V},children:j.jsxs("g",{className:Ge(["react-flow__edge",`react-flow__edge-${L}`,h.className,f,{selected:h.selected,animated:h.animated,inactive:!M&&!u,updating:z,selectable:M}]),onClick:se,onDoubleClick:ee,onContextMenu:X,onMouseEnter:O,onMouseMove:re,onMouseLeave:ne,onKeyDown:D?ce:void 0,tabIndex:D?0:void 0,role:h.ariaRole??(D?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":h.ariaLabel===null?void 0:h.ariaLabel||`Edge from ${h.source} to ${h.target}`,"aria-describedby":D?`${xg}-${b}`:void 0,ref:W,...h.domAttributes,children:[!N&&j.jsx(R,{id:e,source:h.source,target:h.target,type:h.type,selected:h.selected,animated:h.animated,selectable:M,deletable:h.deletable??!0,label:h.label,labelStyle:h.labelStyle,labelShowBg:h.labelShowBg,labelBgStyle:h.labelBgStyle,labelBgPadding:h.labelBgPadding,labelBgBorderRadius:h.labelBgBorderRadius,sourceX:K,sourceY:U,targetX:A,targetY:B,sourcePosition:P,targetPosition:H,data:h.data,style:h.style,sourceHandleId:h.sourceHandle,targetHandleId:h.targetHandle,markerStart:G,markerEnd:Z,pathOptions:"pathOptions"in h?h.pathOptions:void 0,interactionWidth:h.interactionWidth}),k&&j.jsx(i2,{edge:h,isReconnectable:k,reconnectRadius:v,onReconnect:l,onReconnectStart:m,onReconnectEnd:x,sourceX:K,sourceY:U,targetX:A,targetY:B,sourcePosition:P,targetPosition:H,setUpdateHover:F,setReconnecting:I})]})})}var o2=J.memo(s2);const a2=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Kg({defaultMarkerColor:e,onlyRenderVisibleElements:r,rfId:i,edgeTypes:o,noPanClassName:u,onReconnect:S,onEdgeContextMenu:y,onEdgeMouseEnter:a,onEdgeMouseMove:c,onEdgeMouseLeave:_,onEdgeClick:v,reconnectRadius:l,onEdgeDoubleClick:m,onReconnectStart:x,onReconnectEnd:b,disableKeyboardA11y:C}){const{edgesFocusable:f,edgesReconnectable:p,elementsSelectable:d,onError:h}=Te(a2,je),w=Vx(r);return j.jsxs("div",{className:"react-flow__edges",children:[j.jsx(Gx,{defaultColor:e,rfId:i}),w.map(L=>j.jsx(o2,{id:L,edgesFocusable:f,edgesReconnectable:p,elementsSelectable:d,noPanClassName:u,onReconnect:S,onContextMenu:y,onMouseEnter:a,onMouseMove:c,onMouseLeave:_,onClick:v,reconnectRadius:l,onDoubleClick:m,onReconnectStart:x,onReconnectEnd:b,rfId:i,onError:h,edgeTypes:o,disableKeyboardA11y:C},L))]})}Kg.displayName="EdgeRenderer";const l2=J.memo(Kg),c2=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function u2({children:e}){const r=Te(c2);return j.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:e})}function h2(e){const r=sh(),i=J.useRef(!1);J.useEffect(()=>{!i.current&&r.viewportInitialized&&e&&(setTimeout(()=>e(r),1),i.current=!0)},[e,r.viewportInitialized])}const d2=e=>{var r;return(r=e.panZoom)==null?void 0:r.syncViewport};function f2(e){const r=Te(d2),i=ze();return J.useEffect(()=>{e&&(r==null||r(e),i.setState({transform:[e.x,e.y,e.zoom]}))},[e,r]),null}function p2(e){return e.connection.inProgress?{...e.connection,to:As(e.connection.to,e.transform)}:{...e.connection}}function _2(e){return p2}function g2(e){const r=_2();return Te(r,je)}const m2=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function v2({containerStyle:e,style:r,type:i,component:o}){const{nodesConnectable:u,width:S,height:y,isValid:a,inProgress:c}=Te(m2,je);return!(S&&u&&c)?null:j.jsx("svg",{style:e,width:S,height:y,className:"react-flow__connectionline react-flow__container",children:j.jsx("g",{className:Ge(["react-flow__connection",X_(a)]),children:j.jsx(Xg,{style:r,type:i,CustomComponent:o,isValid:a})})})}const Xg=({style:e,type:r=Jr.Bezier,CustomComponent:i,isValid:o})=>{const{inProgress:u,from:S,fromNode:y,fromHandle:a,fromPosition:c,to:_,toNode:v,toHandle:l,toPosition:m,pointer:x}=g2();if(!u)return;if(i)return j.jsx(i,{connectionLineType:r,connectionLineStyle:e,fromNode:y,fromHandle:a,fromX:S.x,fromY:S.y,toX:_.x,toY:_.y,fromPosition:c,toPosition:m,connectionStatus:X_(o),toNode:v,toHandle:l,pointer:x});let b="";const C={sourceX:S.x,sourceY:S.y,sourcePosition:c,targetX:_.x,targetY:_.y,targetPosition:m};switch(r){case Jr.Bezier:[b]=og(C);break;case Jr.SimpleBezier:[b]=Ng(C);break;case Jr.Step:[b]=ku({...C,borderRadius:0});break;case Jr.SmoothStep:[b]=ku(C);break;default:[b]=lg(C)}return j.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};Xg.displayName="ConnectionLine";const y2={};function Yp(e=y2){J.useRef(e),ze(),J.useEffect(()=>{},[e])}function w2(){ze(),J.useRef(!1),J.useEffect(()=>{},[])}function Yg({nodeTypes:e,edgeTypes:r,onInit:i,onNodeClick:o,onEdgeClick:u,onNodeDoubleClick:S,onEdgeDoubleClick:y,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:_,onNodeContextMenu:v,onSelectionContextMenu:l,onSelectionStart:m,onSelectionEnd:x,connectionLineType:b,connectionLineStyle:C,connectionLineComponent:f,connectionLineContainerStyle:p,selectionKeyCode:d,selectionOnDrag:h,selectionMode:w,multiSelectionKeyCode:L,panActivationKeyCode:R,zoomActivationKeyCode:D,deleteKeyCode:k,onlyRenderVisibleElements:M,elementsSelectable:W,defaultViewport:z,translateExtent:F,minZoom:N,maxZoom:I,preventScrolling:q,defaultMarkerColor:V,zoomOnScroll:K,zoomOnPinch:U,panOnScroll:A,panOnScrollSpeed:B,panOnScrollMode:P,zoomOnDoubleClick:H,panOnDrag:G,onPaneClick:Z,onPaneMouseEnter:se,onPaneMouseMove:ee,onPaneMouseLeave:X,onPaneScroll:O,onPaneContextMenu:re,paneClickDistance:ne,nodeClickDistance:ce,onEdgeContextMenu:le,onEdgeMouseEnter:fe,onEdgeMouseMove:we,onEdgeMouseLeave:ye,reconnectRadius:xe,onReconnect:ge,onReconnectStart:Ie,onReconnectEnd:st,noDragClassName:ot,noWheelClassName:ct,noPanClassName:vt,disableKeyboardA11y:qe,nodeExtent:Nt,rfId:et,viewport:_t,onViewportChange:kt}){return Yp(e),Yp(r),w2(),h2(i),f2(_t),j.jsx(Nx,{onPaneClick:Z,onPaneMouseEnter:se,onPaneMouseMove:ee,onPaneMouseLeave:X,onPaneContextMenu:re,onPaneScroll:O,paneClickDistance:ne,deleteKeyCode:k,selectionKeyCode:d,selectionOnDrag:h,selectionMode:w,onSelectionStart:m,onSelectionEnd:x,multiSelectionKeyCode:L,panActivationKeyCode:R,zoomActivationKeyCode:D,elementsSelectable:W,zoomOnScroll:K,zoomOnPinch:U,zoomOnDoubleClick:H,panOnScroll:A,panOnScrollSpeed:B,panOnScrollMode:P,panOnDrag:G,defaultViewport:z,translateExtent:F,minZoom:N,maxZoom:I,onSelectionContextMenu:l,preventScrolling:q,noDragClassName:ot,noWheelClassName:ct,noPanClassName:vt,disableKeyboardA11y:qe,onViewportChange:kt,isControlledViewport:!!_t,children:j.jsxs(u2,{children:[j.jsx(l2,{edgeTypes:r,onEdgeClick:u,onEdgeDoubleClick:y,onReconnect:ge,onReconnectStart:Ie,onReconnectEnd:st,onlyRenderVisibleElements:M,onEdgeContextMenu:le,onEdgeMouseEnter:fe,onEdgeMouseMove:we,onEdgeMouseLeave:ye,reconnectRadius:xe,defaultMarkerColor:V,noPanClassName:vt,disableKeyboardA11y:qe,rfId:et}),j.jsx(v2,{style:C,type:b,component:f,containerStyle:p}),j.jsx("div",{className:"react-flow__edgelabel-renderer"}),j.jsx(Ux,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:S,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:_,onNodeContextMenu:v,nodeClickDistance:ce,onlyRenderVisibleElements:M,noPanClassName:vt,noDragClassName:ot,disableKeyboardA11y:qe,nodeExtent:Nt,rfId:et}),j.jsx("div",{className:"react-flow__viewport-portal"})]})})}Yg.displayName="GraphView";const S2=J.memo(Yg),Gp=({nodes:e,edges:r,defaultNodes:i,defaultEdges:o,width:u,height:S,fitView:y,fitViewOptions:a,minZoom:c=.5,maxZoom:_=2,nodeOrigin:v,nodeExtent:l,zIndexMode:m="basic"}={})=>{const x=new Map,b=new Map,C=new Map,f=new Map,p=o??r??[],d=i??e??[],h=v??[0,0],w=l??ws;hg(C,f,p);const{nodesInitialized:L}=Ru(d,x,b,{nodeOrigin:h,nodeExtent:w,zIndexMode:m});let R=[0,0,1];if(y&&u&&S){const D=Ds(x,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:k,y:M,zoom:W}=Ju(D,u,S,c,_,(a==null?void 0:a.padding)??.1);R=[k,M,W]}return{rfId:"1",width:u??0,height:S??0,transform:R,nodes:d,nodesInitialized:L,nodeLookup:x,parentLookup:b,edges:p,edgeLookup:f,connectionLookup:C,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:c,maxZoom:_,translateExtent:ws,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ui.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:h,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:y??!1,fitViewOptions:a,fitViewResolver:null,connection:{...K_},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:NS,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:q_,zIndexMode:m,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},C2=({nodes:e,edges:r,defaultNodes:i,defaultEdges:o,width:u,height:S,fitView:y,fitViewOptions:a,minZoom:c,maxZoom:_,nodeOrigin:v,nodeExtent:l,zIndexMode:m})=>FC((x,b)=>{async function C(){const{nodeLookup:f,panZoom:p,fitViewOptions:d,fitViewResolver:h,width:w,height:L,minZoom:R,maxZoom:D}=b();p&&(await PS({nodes:f,width:w,height:L,panZoom:p,minZoom:R,maxZoom:D},d),h==null||h.resolve(!0),x({fitViewResolver:null}))}return{...Gp({nodes:e,edges:r,width:u,height:S,fitView:y,fitViewOptions:a,minZoom:c,maxZoom:_,nodeOrigin:v,nodeExtent:l,defaultNodes:i,defaultEdges:o,zIndexMode:m}),setNodes:f=>{const{nodeLookup:p,parentLookup:d,nodeOrigin:h,elevateNodesOnSelect:w,fitViewQueued:L,zIndexMode:R,nodesSelectionActive:D}=b(),{nodesInitialized:k,hasSelectedNodes:M}=Ru(f,p,d,{nodeOrigin:h,nodeExtent:l,elevateNodesOnSelect:w,checkEquality:!0,zIndexMode:R}),W=D&&M;L&&k?(C(),x({nodes:f,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:W})):x({nodes:f,nodesInitialized:k,nodesSelectionActive:W})},setEdges:f=>{const{connectionLookup:p,edgeLookup:d}=b();hg(p,d,f),x({edges:f})},setDefaultNodesAndEdges:(f,p)=>{if(f){const{setNodes:d}=b();d(f),x({hasDefaultNodes:!0})}if(p){const{setEdges:d}=b();d(p),x({hasDefaultEdges:!0})}},updateNodeInternals:f=>{const{triggerNodeChanges:p,nodeLookup:d,parentLookup:h,domNode:w,nodeOrigin:L,nodeExtent:R,debug:D,fitViewQueued:k,zIndexMode:M}=b(),{changes:W,updatedInternals:z}=nC(f,d,h,w,L,R,M);z&&(ZS(d,h,{nodeOrigin:L,nodeExtent:R,zIndexMode:M}),k?(C(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),(W==null?void 0:W.length)>0&&(D&&console.log("React Flow: trigger node changes",W),p==null||p(W)))},updateNodePositions:(f,p=!1)=>{const d=[];let h=[];const{nodeLookup:w,triggerNodeChanges:L,connection:R,updateConnection:D,onNodesChangeMiddlewareMap:k}=b();for(const[M,W]of f){const z=w.get(M),F=!!(z!=null&&z.expandParent&&(z!=null&&z.parentId)&&(W!=null&&W.position)),N={id:M,type:"position",position:F?{x:Math.max(0,W.position.x),y:Math.max(0,W.position.y)}:W.position,dragging:p};if(z&&R.inProgress&&R.fromNode.id===z.id){const I=kn(z,R.fromHandle,be.Left,!0);D({...R,from:I})}F&&z.parentId&&d.push({id:M,parentId:z.parentId,rect:{...W.internals.positionAbsolute,width:W.measured.width??0,height:W.measured.height??0}}),h.push(N)}if(d.length>0){const{parentLookup:M,nodeOrigin:W}=b(),z=ih(d,w,M,W);h.push(...z)}for(const M of k.values())h=M(h);L(h)},triggerNodeChanges:f=>{const{onNodesChange:p,setNodes:d,nodes:h,hasDefaultNodes:w,debug:L}=b();if(f!=null&&f.length){if(w){const R=ox(f,h);d(R)}L&&console.log("React Flow: trigger node changes",f),p==null||p(f)}},triggerEdgeChanges:f=>{const{onEdgesChange:p,setEdges:d,edges:h,hasDefaultEdges:w,debug:L}=b();if(f!=null&&f.length){if(w){const R=ax(f,h);d(R)}L&&console.log("React Flow: trigger edge changes",f),p==null||p(f)}},addSelectedNodes:f=>{const{multiSelectionActive:p,edgeLookup:d,nodeLookup:h,triggerNodeChanges:w,triggerEdgeChanges:L}=b();if(p){const R=f.map(D=>yn(D,!0));w(R);return}w(si(h,new Set([...f]),!0)),L(si(d))},addSelectedEdges:f=>{const{multiSelectionActive:p,edgeLookup:d,nodeLookup:h,triggerNodeChanges:w,triggerEdgeChanges:L}=b();if(p){const R=f.map(D=>yn(D,!0));L(R);return}L(si(d,new Set([...f]))),w(si(h,new Set,!0))},unselectNodesAndEdges:({nodes:f,edges:p}={})=>{const{edges:d,nodes:h,nodeLookup:w,triggerNodeChanges:L,triggerEdgeChanges:R}=b(),D=f||h,k=p||d,M=[];for(const z of D){if(!z.selected)continue;const F=w.get(z.id);F&&(F.selected=!1),M.push(yn(z.id,!1))}const W=[];for(const z of k)z.selected&&W.push(yn(z.id,!1));L(M),R(W)},setMinZoom:f=>{const{panZoom:p,maxZoom:d}=b();p==null||p.setScaleExtent([f,d]),x({minZoom:f})},setMaxZoom:f=>{const{panZoom:p,minZoom:d}=b();p==null||p.setScaleExtent([d,f]),x({maxZoom:f})},setTranslateExtent:f=>{var p;(p=b().panZoom)==null||p.setTranslateExtent(f),x({translateExtent:f})},resetSelectedElements:()=>{const{edges:f,nodes:p,triggerNodeChanges:d,triggerEdgeChanges:h,elementsSelectable:w}=b();if(!w)return;const L=p.reduce((D,k)=>k.selected?[...D,yn(k.id,!1)]:D,[]),R=f.reduce((D,k)=>k.selected?[...D,yn(k.id,!1)]:D,[]);d(L),h(R)},setNodeExtent:f=>{const{nodes:p,nodeLookup:d,parentLookup:h,nodeOrigin:w,elevateNodesOnSelect:L,nodeExtent:R,zIndexMode:D}=b();f[0][0]===R[0][0]&&f[0][1]===R[0][1]&&f[1][0]===R[1][0]&&f[1][1]===R[1][1]||(Ru(p,d,h,{nodeOrigin:w,nodeExtent:f,elevateNodesOnSelect:L,checkEquality:!1,zIndexMode:D}),x({nodeExtent:f}))},panBy:f=>{const{transform:p,width:d,height:h,panZoom:w,translateExtent:L}=b();return iC({delta:f,panZoom:w,transform:p,translateExtent:L,width:d,height:h})},setCenter:async(f,p,d)=>{const{width:h,height:w,maxZoom:L,panZoom:R}=b();if(!R)return Promise.resolve(!1);const D=typeof(d==null?void 0:d.zoom)<"u"?d.zoom:L;return await R.setViewport({x:h/2-f*D,y:w/2-p*D,zoom:D},{duration:d==null?void 0:d.duration,ease:d==null?void 0:d.ease,interpolate:d==null?void 0:d.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{x({connection:{...K_}})},updateConnection:f=>{x({connection:f})},reset:()=>x({...Gp()})}},Object.is);function x2({initialNodes:e,initialEdges:r,defaultNodes:i,defaultEdges:o,initialWidth:u,initialHeight:S,initialMinZoom:y,initialMaxZoom:a,initialFitViewOptions:c,fitView:_,nodeOrigin:v,nodeExtent:l,zIndexMode:m,children:x}){const[b]=J.useState(()=>C2({nodes:e,edges:r,defaultNodes:i,defaultEdges:o,width:u,height:S,fitView:_,minZoom:y,maxZoom:a,fitViewOptions:c,nodeOrigin:v,nodeExtent:l,zIndexMode:m}));return j.jsx(jC,{value:b,children:j.jsx(ux,{children:x})})}function b2({children:e,nodes:r,edges:i,defaultNodes:o,defaultEdges:u,width:S,height:y,fitView:a,fitViewOptions:c,minZoom:_,maxZoom:v,nodeOrigin:l,nodeExtent:m,zIndexMode:x}){return J.useContext($a)?j.jsx(j.Fragment,{children:e}):j.jsx(x2,{initialNodes:r,initialEdges:i,defaultNodes:o,defaultEdges:u,initialWidth:S,initialHeight:y,fitView:a,initialFitViewOptions:c,initialMinZoom:_,initialMaxZoom:v,nodeOrigin:l,nodeExtent:m,zIndexMode:x,children:e})}const E2={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function k2({nodes:e,edges:r,defaultNodes:i,defaultEdges:o,className:u,nodeTypes:S,edgeTypes:y,onNodeClick:a,onEdgeClick:c,onInit:_,onMove:v,onMoveStart:l,onMoveEnd:m,onConnect:x,onConnectStart:b,onConnectEnd:C,onClickConnectStart:f,onClickConnectEnd:p,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:w,onNodeContextMenu:L,onNodeDoubleClick:R,onNodeDragStart:D,onNodeDrag:k,onNodeDragStop:M,onNodesDelete:W,onEdgesDelete:z,onDelete:F,onSelectionChange:N,onSelectionDragStart:I,onSelectionDrag:q,onSelectionDragStop:V,onSelectionContextMenu:K,onSelectionStart:U,onSelectionEnd:A,onBeforeDelete:B,connectionMode:P,connectionLineType:H=Jr.Bezier,connectionLineStyle:G,connectionLineComponent:Z,connectionLineContainerStyle:se,deleteKeyCode:ee="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:O=!1,selectionMode:re=Ss.Full,panActivationKeyCode:ne="Space",multiSelectionKeyCode:ce=xs()?"Meta":"Control",zoomActivationKeyCode:le=xs()?"Meta":"Control",snapToGrid:fe,snapGrid:we,onlyRenderVisibleElements:ye=!1,selectNodesOnDrag:xe,nodesDraggable:ge,autoPanOnNodeFocus:Ie,nodesConnectable:st,nodesFocusable:ot,nodeOrigin:ct=bg,edgesFocusable:vt,edgesReconnectable:qe,elementsSelectable:Nt=!0,defaultViewport:et=ZC,minZoom:_t=.5,maxZoom:kt=2,translateExtent:ut=ws,preventScrolling:pr=!0,nodeExtent:tt,defaultMarkerColor:Lt="#b1b1b7",zoomOnScroll:Be=!0,zoomOnPinch:Ln=!0,panOnScroll:Ms=!1,panOnScrollSpeed:qa=.5,panOnScrollMode:mi=Cn.Free,zoomOnDoubleClick:vi=!0,panOnDrag:yi=!0,onPaneClick:wi,onPaneMouseEnter:Si,onPaneMouseMove:Rr,onPaneMouseLeave:Dr,onPaneScroll:Ps,onPaneContextMenu:Bs,paneClickDistance:Ns=1,nodeClickDistance:Is=0,children:Os,onReconnect:Ci,onReconnectStart:Hs,onReconnectEnd:tn,onEdgeContextMenu:xi,onEdgeDoubleClick:rn,onEdgeMouseEnter:Ka,onEdgeMouseMove:nn,onEdgeMouseLeave:Rn,reconnectRadius:Dn=10,onNodesChange:bi,onEdgesChange:Xa,noDragClassName:Ya="nodrag",noWheelClassName:Ga="nowheel",noPanClassName:rr="nopan",fitView:Ei,fitViewOptions:ki,connectOnClick:Qa,attributionPosition:Fs,proOptions:js,defaultEdgeOptions:zs,elevateNodesOnSelect:$s=!0,elevateEdgesOnSelect:Ja=!1,disableKeyboardA11y:Ws=!1,autoPanOnConnect:$e,autoPanOnNodeDrag:Za,autoPanSpeed:Li,connectionRadius:Us,isValidConnection:Tn,onError:el,style:Vs,id:sn,nodeDragThreshold:It,connectionDragThreshold:tl,viewport:Rt,onViewportChange:rl,width:nl,height:il,colorMode:An="light",debug:Mn,onScroll:nr,ariaLabelConfig:Pn,zIndexMode:qs="basic",...sl},Ri){const Bn=sn||"1",Di=nx(An),on=J.useCallback(Ks=>{Ks.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),nr==null||nr(Ks)},[nr]);return j.jsx("div",{"data-testid":"rf__wrapper",...sl,onScroll:on,style:{...Vs,...E2},ref:Ri,className:Ge(["react-flow",u,Di]),id:sn,role:"application",children:j.jsxs(b2,{nodes:e,edges:r,width:nl,height:il,fitView:Ei,fitViewOptions:ki,minZoom:_t,maxZoom:kt,nodeOrigin:ct,nodeExtent:tt,zIndexMode:qs,children:[j.jsx(rx,{nodes:e,edges:r,defaultNodes:i,defaultEdges:o,onConnect:x,onConnectStart:b,onConnectEnd:C,onClickConnectStart:f,onClickConnectEnd:p,nodesDraggable:ge,autoPanOnNodeFocus:Ie,nodesConnectable:st,nodesFocusable:ot,edgesFocusable:vt,edgesReconnectable:qe,elementsSelectable:Nt,elevateNodesOnSelect:$s,elevateEdgesOnSelect:Ja,minZoom:_t,maxZoom:kt,nodeExtent:tt,onNodesChange:bi,onEdgesChange:Xa,snapToGrid:fe,snapGrid:we,connectionMode:P,translateExtent:ut,connectOnClick:Qa,defaultEdgeOptions:zs,fitView:Ei,fitViewOptions:ki,onNodesDelete:W,onEdgesDelete:z,onDelete:F,onNodeDragStart:D,onNodeDrag:k,onNodeDragStop:M,onSelectionDrag:q,onSelectionDragStart:I,onSelectionDragStop:V,onMove:v,onMoveStart:l,onMoveEnd:m,noPanClassName:rr,nodeOrigin:ct,rfId:Bn,autoPanOnConnect:$e,autoPanOnNodeDrag:Za,autoPanSpeed:Li,onError:el,connectionRadius:Us,isValidConnection:Tn,selectNodesOnDrag:xe,nodeDragThreshold:It,connectionDragThreshold:tl,onBeforeDelete:B,debug:Mn,ariaLabelConfig:Pn,zIndexMode:qs}),j.jsx(S2,{onInit:_,onNodeClick:a,onEdgeClick:c,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:w,onNodeContextMenu:L,onNodeDoubleClick:R,nodeTypes:S,edgeTypes:y,connectionLineType:H,connectionLineStyle:G,connectionLineComponent:Z,connectionLineContainerStyle:se,selectionKeyCode:X,selectionOnDrag:O,selectionMode:re,deleteKeyCode:ee,multiSelectionKeyCode:ce,panActivationKeyCode:ne,zoomActivationKeyCode:le,onlyRenderVisibleElements:ye,defaultViewport:et,translateExtent:ut,minZoom:_t,maxZoom:kt,preventScrolling:pr,zoomOnScroll:Be,zoomOnPinch:Ln,zoomOnDoubleClick:vi,panOnScroll:Ms,panOnScrollSpeed:qa,panOnScrollMode:mi,panOnDrag:yi,onPaneClick:wi,onPaneMouseEnter:Si,onPaneMouseMove:Rr,onPaneMouseLeave:Dr,onPaneScroll:Ps,onPaneContextMenu:Bs,paneClickDistance:Ns,nodeClickDistance:Is,onSelectionContextMenu:K,onSelectionStart:U,onSelectionEnd:A,onReconnect:Ci,onReconnectStart:Hs,onReconnectEnd:tn,onEdgeContextMenu:xi,onEdgeDoubleClick:rn,onEdgeMouseEnter:Ka,onEdgeMouseMove:nn,onEdgeMouseLeave:Rn,reconnectRadius:Dn,defaultMarkerColor:Lt,noDragClassName:Ya,noWheelClassName:Ga,noPanClassName:rr,rfId:Bn,disableKeyboardA11y:Ws,nodeExtent:tt,viewport:Rt,onViewportChange:rl}),j.jsx(JC,{onSelectionChange:N}),Os,j.jsx(KC,{proOptions:js,position:Fs}),j.jsx(qC,{rfId:Bn,disableKeyboardA11y:Ws})]})})}var L2=kg(k2);function R2({dimensions:e,lineWidth:r,variant:i,className:o}){return j.jsx("path",{strokeWidth:r,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ge(["react-flow__background-pattern",i,o])})}function D2({radius:e,className:r}){return j.jsx("circle",{cx:e,cy:e,r:e,className:Ge(["react-flow__background-pattern","dots",r])})}var en;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(en||(en={}));const T2={[en.Dots]:1,[en.Lines]:1,[en.Cross]:6},A2=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Gg({id:e,variant:r=en.Dots,gap:i=20,size:o,lineWidth:u=1,offset:S=0,color:y,bgColor:a,style:c,className:_,patternClassName:v}){const l=J.useRef(null),{transform:m,patternId:x}=Te(A2,je),b=o||T2[r],C=r===en.Dots,f=r===en.Cross,p=Array.isArray(i)?i:[i,i],d=[p[0]*m[2]||1,p[1]*m[2]||1],h=b*m[2],w=Array.isArray(S)?S:[S,S],L=f?[h,h]:d,R=[w[0]*m[2]||1+L[0]/2,w[1]*m[2]||1+L[1]/2],D=`${x}${e||""}`;return j.jsxs("svg",{className:Ge(["react-flow__background",_]),style:{...c,...Ua,"--xy-background-color-props":a,"--xy-background-pattern-color-props":y},ref:l,"data-testid":"rf__background",children:[j.jsx("pattern",{id:D,x:m[0]%d[0],y:m[1]%d[1],width:d[0],height:d[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${R[0]},-${R[1]})`,children:C?j.jsx(D2,{radius:h/2,className:v}):j.jsx(R2,{dimensions:L,lineWidth:u,variant:r,className:v})}),j.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${D})`})]})}Gg.displayName="Background";const M2=J.memo(Gg);function P2(){return j.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:j.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function B2(){return j.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:j.jsx("path",{d:"M0 0h32v4.2H0z"})})}function N2(){return j.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:j.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function I2(){return j.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:j.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function O2(){return j.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:j.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function oa({children:e,className:r,...i}){return j.jsx("button",{type:"button",className:Ge(["react-flow__controls-button",r]),...i,children:e})}const H2=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Qg({style:e,showZoom:r=!0,showFitView:i=!0,showInteractive:o=!0,fitViewOptions:u,onZoomIn:S,onZoomOut:y,onFitView:a,onInteractiveChange:c,className:_,children:v,position:l="bottom-left",orientation:m="vertical","aria-label":x}){const b=ze(),{isInteractive:C,minZoomReached:f,maxZoomReached:p,ariaLabelConfig:d}=Te(H2,je),{zoomIn:h,zoomOut:w,fitView:L}=sh(),R=()=>{h(),S==null||S()},D=()=>{w(),y==null||y()},k=()=>{L(u),a==null||a()},M=()=>{b.setState({nodesDraggable:!C,nodesConnectable:!C,elementsSelectable:!C}),c==null||c(!C)},W=m==="horizontal"?"horizontal":"vertical";return j.jsxs(Wa,{className:Ge(["react-flow__controls",W,_]),position:l,style:e,"data-testid":"rf__controls","aria-label":x??d["controls.ariaLabel"],children:[r&&j.jsxs(j.Fragment,{children:[j.jsx(oa,{onClick:R,className:"react-flow__controls-zoomin",title:d["controls.zoomIn.ariaLabel"],"aria-label":d["controls.zoomIn.ariaLabel"],disabled:p,children:j.jsx(P2,{})}),j.jsx(oa,{onClick:D,className:"react-flow__controls-zoomout",title:d["controls.zoomOut.ariaLabel"],"aria-label":d["controls.zoomOut.ariaLabel"],disabled:f,children:j.jsx(B2,{})})]}),i&&j.jsx(oa,{className:"react-flow__controls-fitview",onClick:k,title:d["controls.fitView.ariaLabel"],"aria-label":d["controls.fitView.ariaLabel"],children:j.jsx(N2,{})}),o&&j.jsx(oa,{className:"react-flow__controls-interactive",onClick:M,title:d["controls.interactive.ariaLabel"],"aria-label":d["controls.interactive.ariaLabel"],children:C?j.jsx(O2,{}):j.jsx(I2,{})}),v]})}Qg.displayName="Controls";const F2=J.memo(Qg);function j2({id:e,x:r,y:i,width:o,height:u,style:S,color:y,strokeColor:a,strokeWidth:c,className:_,borderRadius:v,shapeRendering:l,selected:m,onClick:x}){const{background:b,backgroundColor:C}=S||{},f=y||b||C;return j.jsx("rect",{className:Ge(["react-flow__minimap-node",{selected:m},_]),x:r,y:i,rx:v,ry:v,width:o,height:u,style:{fill:f,stroke:a,strokeWidth:c},shapeRendering:l,onClick:x?p=>x(p,e):void 0})}const z2=J.memo(j2),$2=e=>e.nodes.map(r=>r.id),nu=e=>e instanceof Function?e:()=>e;function W2({nodeStrokeColor:e,nodeColor:r,nodeClassName:i="",nodeBorderRadius:o=5,nodeStrokeWidth:u,nodeComponent:S=z2,onClick:y}){const a=Te($2,je),c=nu(r),_=nu(e),v=nu(i),l=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return j.jsx(j.Fragment,{children:a.map(m=>j.jsx(V2,{id:m,nodeColorFunc:c,nodeStrokeColorFunc:_,nodeClassNameFunc:v,nodeBorderRadius:o,nodeStrokeWidth:u,NodeComponent:S,onClick:y,shapeRendering:l},m))})}function U2({id:e,nodeColorFunc:r,nodeStrokeColorFunc:i,nodeClassNameFunc:o,nodeBorderRadius:u,nodeStrokeWidth:S,shapeRendering:y,NodeComponent:a,onClick:c}){const{node:_,x:v,y:l,width:m,height:x}=Te(b=>{const C=b.nodeLookup.get(e);if(!C)return{node:void 0,x:0,y:0,width:0,height:0};const f=C.internals.userNode,{x:p,y:d}=C.internals.positionAbsolute,{width:h,height:w}=Lr(f);return{node:f,x:p,y:d,width:h,height:w}},je);return!_||_.hidden||!eg(_)?null:j.jsx(a,{x:v,y:l,width:m,height:x,style:_.style,selected:!!_.selected,className:o(_),color:r(_),borderRadius:u,strokeColor:i(_),strokeWidth:S,shapeRendering:y,onClick:c,id:_.id})}const V2=J.memo(U2);var q2=J.memo(W2);const K2=200,X2=150,Y2=e=>!e.hidden,G2=e=>{const r={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:r,boundingRect:e.nodeLookup.size>0?Z_(Ds(e.nodeLookup,{filter:Y2}),r):r,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Q2="react-flow__minimap-desc";function Jg({style:e,className:r,nodeStrokeColor:i,nodeColor:o,nodeClassName:u="",nodeBorderRadius:S=5,nodeStrokeWidth:y,nodeComponent:a,bgColor:c,maskColor:_,maskStrokeColor:v,maskStrokeWidth:l,position:m="bottom-right",onClick:x,onNodeClick:b,pannable:C=!1,zoomable:f=!1,ariaLabel:p,inversePan:d,zoomStep:h=1,offsetScale:w=5}){const L=ze(),R=J.useRef(null),{boundingRect:D,viewBB:k,rfId:M,panZoom:W,translateExtent:z,flowWidth:F,flowHeight:N,ariaLabelConfig:I}=Te(G2,je),q=(e==null?void 0:e.width)??K2,V=(e==null?void 0:e.height)??X2,K=D.width/q,U=D.height/V,A=Math.max(K,U),B=A*q,P=A*V,H=w*A,G=D.x-(B-D.width)/2-H,Z=D.y-(P-D.height)/2-H,se=B+H*2,ee=P+H*2,X=`${Q2}-${M}`,O=J.useRef(0),re=J.useRef();O.current=A,J.useEffect(()=>{if(R.current&&W)return re.current=fC({domNode:R.current,panZoom:W,getTransform:()=>L.getState().transform,getViewScale:()=>O.current}),()=>{var fe;(fe=re.current)==null||fe.destroy()}},[W]),J.useEffect(()=>{var fe;(fe=re.current)==null||fe.update({translateExtent:z,width:F,height:N,inversePan:d,pannable:C,zoomStep:h,zoomable:f})},[C,f,d,h,z,F,N]);const ne=x?fe=>{var xe;const[we,ye]=((xe=re.current)==null?void 0:xe.pointer(fe))||[0,0];x(fe,{x:we,y:ye})}:void 0,ce=b?J.useCallback((fe,we)=>{const ye=L.getState().nodeLookup.get(we).internals.userNode;b(fe,ye)},[]):void 0,le=p??I["minimap.ariaLabel"];return j.jsx(Wa,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof _=="string"?_:void 0,"--xy-minimap-mask-stroke-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-stroke-width-props":typeof l=="number"?l*A:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof y=="number"?y:void 0},className:Ge(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:j.jsxs("svg",{width:q,height:V,viewBox:`${G} ${Z} ${se} ${ee}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:R,onClick:ne,children:[le&&j.jsx("title",{id:X,children:le}),j.jsx(q2,{onClick:ce,nodeColor:o,nodeStrokeColor:i,nodeBorderRadius:S,nodeClassName:u,nodeStrokeWidth:y,nodeComponent:a}),j.jsx("path",{className:"react-flow__minimap-mask",d:`M${G-H},${Z-H}h${se+H*2}v${ee+H*2}h${-se-H*2}z
|
|
62
|
+
M${k.x},${k.y}h${k.width}v${k.height}h${-k.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Jg.displayName="MiniMap";J.memo(Jg);const J2=e=>r=>e?`${Math.max(1/r.transform[2],1)}`:void 0,Z2={[pi.Line]:"right",[pi.Handle]:"bottom-right"};function eb({nodeId:e,position:r,variant:i=pi.Handle,className:o,style:u=void 0,children:S,color:y,minWidth:a=10,minHeight:c=10,maxWidth:_=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:l=!1,resizeDirection:m,autoScale:x=!0,shouldResize:b,onResizeStart:C,onResize:f,onResizeEnd:p}){const d=Tg(),h=typeof e=="string"?e:d,w=ze(),L=J.useRef(null),R=i===pi.Handle,D=Te(J.useCallback(J2(R&&x),[R,x]),je),k=J.useRef(null),M=r??Z2[i];J.useEffect(()=>{if(!(!L.current||!h))return k.current||(k.current=LC({domNode:L.current,nodeId:h,getStoreItems:()=>{const{nodeLookup:z,transform:F,snapGrid:N,snapToGrid:I,nodeOrigin:q,domNode:V}=w.getState();return{nodeLookup:z,transform:F,snapGrid:N,snapToGrid:I,nodeOrigin:q,paneDomNode:V}},onChange:(z,F)=>{const{triggerNodeChanges:N,nodeLookup:I,parentLookup:q,nodeOrigin:V}=w.getState(),K=[],U={x:z.x,y:z.y},A=I.get(h);if(A&&A.expandParent&&A.parentId){const B=A.origin??V,P=z.width??A.measured.width??0,H=z.height??A.measured.height??0,G={id:A.id,parentId:A.parentId,rect:{width:P,height:H,...tg({x:z.x??A.position.x,y:z.y??A.position.y},{width:P,height:H},A.parentId,I,B)}},Z=ih([G],I,q,V);K.push(...Z),U.x=z.x?Math.max(B[0]*P,z.x):void 0,U.y=z.y?Math.max(B[1]*H,z.y):void 0}if(U.x!==void 0&&U.y!==void 0){const B={id:h,type:"position",position:{...U}};K.push(B)}if(z.width!==void 0&&z.height!==void 0){const P={id:h,type:"dimensions",resizing:!0,setAttributes:m?m==="horizontal"?"width":"height":!0,dimensions:{width:z.width,height:z.height}};K.push(P)}for(const B of F){const P={...B,type:"position"};K.push(P)}N(K)},onEnd:({width:z,height:F})=>{const N={id:h,type:"dimensions",resizing:!1,dimensions:{width:z,height:F}};w.getState().triggerNodeChanges([N])}})),k.current.update({controlPosition:M,boundaries:{minWidth:a,minHeight:c,maxWidth:_,maxHeight:v},keepAspectRatio:l,resizeDirection:m,onResizeStart:C,onResize:f,onResizeEnd:p,shouldResize:b}),()=>{var z;(z=k.current)==null||z.destroy()}},[M,a,c,_,v,l,C,f,p,b]);const W=M.split("-");return j.jsx("div",{className:Ge(["react-flow__resize-control","nodrag",...W,i,o]),ref:L,style:{...u,scale:D,...y&&{[R?"backgroundColor":"borderColor"]:y}},children:S})}J.memo(eb);const tb={running:"#4ade80",starting:"#fbbf24",idle:"#fbbf24",done:"#555",dead:"#f87171"};function rb({data:e}){const r=e,i=tb[r.status]||"#555",o=r.status==="running"||r.status==="starting";return j.jsxs("div",{style:{background:"#0a0a0a",border:`1px solid ${o?"#333":"#1e1e1e"}`,borderRadius:8,padding:"12px 16px",minWidth:160,position:"relative",transition:"border-color 180ms ease"},children:[j.jsx(_i,{type:"target",position:be.Left,style:{background:"#333",border:"none",width:6,height:6}}),j.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:5},children:[j.jsx("div",{style:{width:6,height:6,borderRadius:"50%",background:i,boxShadow:o?`0 0 6px ${i}40`:"none"}}),j.jsx("span",{style:{fontSize:13,fontWeight:500,color:"#e8e8e8",fontFamily:"'DM Sans', sans-serif"},children:r.label}),r.service&&r.service!=="claude"&&j.jsx("span",{style:{fontSize:9,fontWeight:600,color:r.service==="codex"?"#10b981":"#888",background:r.service==="codex"?"#10b98118":"#88888818",padding:"1px 5px",borderRadius:4,fontFamily:"'JetBrains Mono', monospace",textTransform:"uppercase",letterSpacing:"0.5px"},children:r.service})]}),j.jsx("div",{style:{fontSize:11,color:"#555",maxWidth:180,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"'DM Sans', sans-serif",lineHeight:1.4},children:r.task}),r.messageCount&&r.messageCount>0&&j.jsxs("div",{title:`${r.messageCount} message${r.messageCount>1?"s":""} received`,style:{position:"absolute",top:-6,right:-6,background:"#4ade80",color:"#000",borderRadius:8,padding:"2px 5px",display:"flex",alignItems:"center",justifyContent:"center",gap:2,fontSize:9,fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:"default"},children:[j.jsx("span",{style:{fontSize:8},children:"✉"}),r.messageCount]}),j.jsx(_i,{type:"source",position:be.Right,style:{background:"#333",border:"none",width:6,height:6}})]})}const nb={agent:rb};function ib({agents:e,messages:r,onSelectAgent:i}){const[o,u]=J.useState([]),S=J.useMemo(()=>{const _={};for(const v of r)v.to_agent&&v.to_agent!=="all"&&(_[v.to_agent]=(_[v.to_agent]||0)+1);return _},[r]),y=J.useMemo(()=>{const _=new Map,v=new Set(e.map(l=>l.id));for(const l of r){if(!v.has(l.from_agent)||!v.has(l.to_agent)||l.to_agent==="all")continue;const m=[l.from_agent,l.to_agent].sort().join("|");_.set(m,(_.get(m)||0)+1)}return Array.from(_.entries()).map(([l,m])=>{const[x,b]=l.split("|");return{id:`collab-${l}`,source:x,target:b,style:{stroke:"#333",strokeWidth:Math.min(1+m*.3,3)},label:`${m}`,labelStyle:{fill:"#666",fontSize:9},labelBgStyle:{fill:"#0a0a0a",fillOpacity:.9},labelBgPadding:[4,2]}})},[e,r]),a=J.useMemo(()=>{const _=Math.max(Math.ceil(Math.sqrt(e.length)),1);return e.map((v,l)=>({id:v.id,type:"agent",position:{x:80+l%_*240,y:80+Math.floor(l/_)*130},data:{label:v.name,status:v.status,task:v.task||"",service:v.service||"claude",messageCount:S[v.id]||0}}))},[e,S]);J.useEffect(()=>{if(r.length===0)return;const _=r[0];if(!_)return;const v=new Set(e.map(b=>b.id));if(!v.has(_.from_agent)||!v.has(_.to_agent))return;const l=`msg-${_.id}`,m={id:l,source:_.from_agent,target:_.to_agent,animated:!0,style:{stroke:"#4ade80",strokeWidth:1.5}};u(b=>[...b,m]);const x=setTimeout(()=>{u(b=>b.filter(C=>C.id!==l))},3e3);return()=>clearTimeout(x)},[r,e]);const c=J.useCallback((_,v)=>{const l=e.find(m=>m.id===v.id);l&&i(l)},[e,i]);return j.jsx("div",{style:{width:"100%",height:"100%"},children:j.jsxs(L2,{nodes:a,edges:[...y,...o],nodeTypes:nb,onNodeClick:c,fitView:!0,proOptions:{hideAttribution:!0},children:[j.jsx(M2,{color:"#1a1a1a",gap:24,size:1}),j.jsx(F2,{style:{background:"#0a0a0a",border:"1px solid #1e1e1e",borderRadius:6}})]})})}var iu={exports:{}},Qp;function sb(){return Qp||(Qp=1,(function(e,r){(function(i,o){e.exports=o()})(globalThis,(()=>(()=>{var i={4567:function(y,a,c){var _=this&&this.__decorate||function(d,h,w,L){var R,D=arguments.length,k=D<3?h:L===null?L=Object.getOwnPropertyDescriptor(h,w):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,h,w,L);else for(var M=d.length-1;M>=0;M--)(R=d[M])&&(k=(D<3?R(k):D>3?R(h,w,k):R(h,w))||k);return D>3&&k&&Object.defineProperty(h,w,k),k},v=this&&this.__param||function(d,h){return function(w,L){h(w,L,d)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const l=c(9042),m=c(9924),x=c(844),b=c(4725),C=c(2585),f=c(3656);let p=a.AccessibilityManager=class extends x.Disposable{constructor(d,h,w,L){super(),this._terminal=d,this._coreBrowserService=w,this._renderService=L,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 R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,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 m.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((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
63
|
+
`)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,f.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,x.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(d){for(let h=0;h<d;h++)this._handleChar(" ")}_handleChar(d){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==d&&(this._charsToAnnounce+=d):this._charsToAnnounce+=d,d===`
|
|
64
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=l.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,h){this._liveRegionDebouncer.refresh(d,h,this._terminal.rows)}_renderRows(d,h){const w=this._terminal.buffer,L=w.lines.length.toString();for(let R=d;R<=h;R++){const D=w.lines.get(w.ydisp+R),k=[],M=(D==null?void 0:D.translateToString(!0,void 0,void 0,k))||"",W=(w.ydisp+R+1).toString(),z=this._rowElements[R];z&&(M.length===0?(z.innerText=" ",this._rowColumns.set(z,[0,1])):(z.textContent=M,this._rowColumns.set(z,k)),z.setAttribute("aria-posinset",W),z.setAttribute("aria-setsize",L))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(d,h){const w=d.target,L=this._rowElements[h===0?1:this._rowElements.length-2];if(w.getAttribute("aria-posinset")===(h===0?"1":`${this._terminal.buffer.lines.length}`)||d.relatedTarget!==L)return;let R,D;if(h===0?(R=w,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(R=this._rowElements.shift(),D=w,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),h===0){const k=this._createAccessibilityTreeNode();this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)}else{const k=this._createAccessibilityTreeNode();this._rowElements.push(k),this._rowContainer.appendChild(k)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(h===0?-1:1),this._rowElements[h===0?1:this._rowElements.length-2].focus(),d.preventDefault(),d.stopImmediatePropagation()}_handleSelectionChange(){var M;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 h={node:d.anchorNode,offset:d.anchorOffset},w={node:d.focusNode,offset:d.focusOffset};if((h.node.compareDocumentPosition(w.node)&Node.DOCUMENT_POSITION_PRECEDING||h.node===w.node&&h.offset>w.offset)&&([h,w]=[w,h]),h.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(h={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(h.node))return;const L=this._rowElements.slice(-1)[0];if(w.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(w={node:L,offset:((M=L.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(w.node))return;const R=({node:W,offset:z})=>{const F=W instanceof Text?W.parentNode:W;let N=parseInt(F==null?void 0:F.getAttribute("aria-posinset"),10)-1;if(isNaN(N))return console.warn("row is invalid. Race condition?"),null;const I=this._rowColumns.get(F);if(!I)return console.warn("columns is null. Race condition?"),null;let q=z<I.length?I[z]:I.slice(-1)[0]+1;return q>=this._terminal.cols&&(++N,q=0),{row:N,column:q}},D=R(h),k=R(w);if(D&&k){if(D.row>k.row||D.row===k.row&&D.column>=k.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(k.row-D.row)*this._terminal.cols-D.column+k.column)}}_handleResize(d){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let h=this._rowContainer.children.length;h<this._terminal.rows;h++)this._rowElements[h]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[h]);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`}};a.AccessibilityManager=p=_([v(1,C.IInstantiationService),v(2,b.ICoreBrowserService),v(3,b.IRenderService)],p)},3614:(y,a)=>{function c(m){return m.replace(/\r?\n/g,"\r")}function _(m,x){return x?"\x1B[200~"+m+"\x1B[201~":m}function v(m,x,b,C){m=_(m=c(m),b.decPrivateModes.bracketedPasteMode&&C.rawOptions.ignoreBracketedPasteMode!==!0),b.triggerDataEvent(m,!0),x.value=""}function l(m,x,b){const C=b.getBoundingClientRect(),f=m.clientX-C.left-10,p=m.clientY-C.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${f}px`,x.style.top=`${p}px`,x.style.zIndex="1000",x.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=c,a.bracketTextForPaste=_,a.copyHandler=function(m,x){m.clipboardData&&m.clipboardData.setData("text/plain",x.selectionText),m.preventDefault()},a.handlePasteEvent=function(m,x,b,C){m.stopPropagation(),m.clipboardData&&v(m.clipboardData.getData("text/plain"),x,b,C)},a.paste=v,a.moveTextAreaUnderMouseCursor=l,a.rightClickHandler=function(m,x,b,C,f){l(m,x,b),f&&C.rightClickSelect(m),x.value=C.selectionText,x.select()}},7239:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const _=c(1505);a.ColorContrastCache=class{constructor(){this._color=new _.TwoKeyMap,this._css=new _.TwoKeyMap}setCss(v,l,m){this._css.set(v,l,m)}getCss(v,l){return this._css.get(v,l)}setColor(v,l,m){this._color.set(v,l,m)}getColor(v,l){return this._color.get(v,l)}clear(){this._color.clear(),this._css.clear()}}},3656:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(c,_,v,l){c.addEventListener(_,v,l);let m=!1;return{dispose:()=>{m||(m=!0,c.removeEventListener(_,v,l))}}}},3551:function(y,a,c){var _=this&&this.__decorate||function(p,d,h,w){var L,R=arguments.length,D=R<3?d:w===null?w=Object.getOwnPropertyDescriptor(d,h):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(p,d,h,w);else for(var k=p.length-1;k>=0;k--)(L=p[k])&&(D=(R<3?L(D):R>3?L(d,h,D):L(d,h))||D);return R>3&&D&&Object.defineProperty(d,h,D),D},v=this&&this.__param||function(p,d){return function(h,w){d(h,w,p)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const l=c(3656),m=c(8460),x=c(844),b=c(2585),C=c(4725);let f=a.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(p,d,h,w,L){super(),this._element=p,this._mouseService=d,this._renderService=h,this._bufferService=w,this._linkProviderService=L,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new m.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new m.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)((()=>{var R;this._lastMouseEvent=void 0,(R=this._activeProviderReplies)==null||R.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,l.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,l.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(p){this._lastMouseEvent=p;const d=this._positionFromMouseEvent(p,this._element,this._mouseService);if(!d)return;this._isMouseOut=!1;const h=p.composedPath();for(let w=0;w<h.length;w++){const L=h[w];if(L.classList.contains("xterm"))break;if(L.classList.contains("xterm-hover"))return}this._lastBufferCell&&d.x===this._lastBufferCell.x&&d.y===this._lastBufferCell.y||(this._handleHover(d),this._lastBufferCell=d)}_handleHover(p){if(this._activeLine!==p.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(p,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,p)||(this._clearCurrentLink(),this._askForLink(p,!0))}_askForLink(p,d){var w,L;this._activeProviderReplies&&d||((w=this._activeProviderReplies)==null||w.forEach((R=>{R==null||R.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=p.y);let h=!1;for(const[R,D]of this._linkProviderService.linkProviders.entries())d?(L=this._activeProviderReplies)!=null&&L.get(R)&&(h=this._checkLinkProviderResult(R,p,h)):D.provideLinks(p.y,(k=>{var W,z;if(this._isMouseOut)return;const M=k==null?void 0:k.map((F=>({link:F})));(W=this._activeProviderReplies)==null||W.set(R,M),h=this._checkLinkProviderResult(R,p,h),((z=this._activeProviderReplies)==null?void 0:z.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(p.y,this._activeProviderReplies)}))}_removeIntersectingLinks(p,d){const h=new Set;for(let w=0;w<d.size;w++){const L=d.get(w);if(L)for(let R=0;R<L.length;R++){const D=L[R],k=D.link.range.start.y<p?0:D.link.range.start.x,M=D.link.range.end.y>p?this._bufferService.cols:D.link.range.end.x;for(let W=k;W<=M;W++){if(h.has(W)){L.splice(R--,1);break}h.add(W)}}}}_checkLinkProviderResult(p,d,h){var R;if(!this._activeProviderReplies)return h;const w=this._activeProviderReplies.get(p);let L=!1;for(let D=0;D<p;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(L=!0);if(!L&&w){const D=w.find((k=>this._linkAtPosition(k.link,d)));D&&(h=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!h)for(let D=0;D<this._activeProviderReplies.size;D++){const k=(R=this._activeProviderReplies.get(D))==null?void 0:R.find((M=>this._linkAtPosition(M.link,d)));if(k){h=!0,this._handleNewLink(k);break}}return h}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(p){if(!this._currentLink)return;const d=this._positionFromMouseEvent(p,this._element,this._mouseService);d&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,d)&&this._currentLink.link.activate(p,this._currentLink.link.text)}_clearCurrentLink(p,d){this._currentLink&&this._lastMouseEvent&&(!p||!d||this._currentLink.link.range.start.y>=p&&this._currentLink.link.range.end.y<=d)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(p){if(!this._lastMouseEvent)return;const d=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);d&&this._linkAtPosition(p.link,d)&&(this._currentLink=p,this._currentLink.state={decorations:{underline:p.link.decorations===void 0||p.link.decorations.underline,pointerCursor:p.link.decorations===void 0||p.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,p.link,this._lastMouseEvent),p.link.decorations={},Object.defineProperties(p.link.decorations,{pointerCursor:{get:()=>{var h,w;return(w=(h=this._currentLink)==null?void 0:h.state)==null?void 0:w.decorations.pointerCursor},set:h=>{var w;(w=this._currentLink)!=null&&w.state&&this._currentLink.state.decorations.pointerCursor!==h&&(this._currentLink.state.decorations.pointerCursor=h,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",h))}},underline:{get:()=>{var h,w;return(w=(h=this._currentLink)==null?void 0:h.state)==null?void 0:w.decorations.underline},set:h=>{var w,L,R;(w=this._currentLink)!=null&&w.state&&((R=(L=this._currentLink)==null?void 0:L.state)==null?void 0:R.decorations.underline)!==h&&(this._currentLink.state.decorations.underline=h,this._currentLink.state.isHovered&&this._fireUnderlineEvent(p.link,h))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((h=>{if(!this._currentLink)return;const w=h.start===0?0:h.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+h.end;if(this._currentLink.link.range.start.y>=w&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(w,L),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(p,d,h){var w;(w=this._currentLink)!=null&&w.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!0),this._currentLink.state.decorations.pointerCursor&&p.classList.add("xterm-cursor-pointer")),d.hover&&d.hover(h,d.text)}_fireUnderlineEvent(p,d){const h=p.range,w=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(h.start.x-1,h.start.y-w-1,h.end.x,h.end.y-w-1,void 0);(d?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(p,d,h){var w;(w=this._currentLink)!=null&&w.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!1),this._currentLink.state.decorations.pointerCursor&&p.classList.remove("xterm-cursor-pointer")),d.leave&&d.leave(h,d.text)}_linkAtPosition(p,d){const h=p.range.start.y*this._bufferService.cols+p.range.start.x,w=p.range.end.y*this._bufferService.cols+p.range.end.x,L=d.y*this._bufferService.cols+d.x;return h<=L&&L<=w}_positionFromMouseEvent(p,d,h){const w=h.getCoords(p,d,this._bufferService.cols,this._bufferService.rows);if(w)return{x:w[0],y:w[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(p,d,h,w,L){return{x1:p,y1:d,x2:h,y2:w,cols:this._bufferService.cols,fg:L}}};a.Linkifier=f=_([v(1,C.IMouseService),v(2,C.IRenderService),v(3,b.IBufferService),v(4,C.ILinkProviderService)],f)},9042:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(y,a,c){var _=this&&this.__decorate||function(C,f,p,d){var h,w=arguments.length,L=w<3?f:d===null?d=Object.getOwnPropertyDescriptor(f,p):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(C,f,p,d);else for(var R=C.length-1;R>=0;R--)(h=C[R])&&(L=(w<3?h(L):w>3?h(f,p,L):h(f,p))||L);return w>3&&L&&Object.defineProperty(f,p,L),L},v=this&&this.__param||function(C,f){return function(p,d){f(p,d,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const l=c(511),m=c(2585);let x=a.OscLinkProvider=class{constructor(C,f,p){this._bufferService=C,this._optionsService=f,this._oscLinkService=p}provideLinks(C,f){var M;const p=this._bufferService.buffer.lines.get(C-1);if(!p)return void f(void 0);const d=[],h=this._optionsService.rawOptions.linkHandler,w=new l.CellData,L=p.getTrimmedLength();let R=-1,D=-1,k=!1;for(let W=0;W<L;W++)if(D!==-1||p.hasContent(W)){if(p.loadCell(W,w),w.hasExtendedAttrs()&&w.extended.urlId){if(D===-1){D=W,R=w.extended.urlId;continue}k=w.extended.urlId!==R}else D!==-1&&(k=!0);if(k||D!==-1&&W===L-1){const z=(M=this._oscLinkService.getLinkData(R))==null?void 0:M.uri;if(z){const F={start:{x:D+1,y:C},end:{x:W+(k||W!==L-1?0:1),y:C}};let N=!1;if(!(h!=null&&h.allowNonHttpProtocols))try{const I=new URL(z);["http:","https:"].includes(I.protocol)||(N=!0)}catch{N=!0}N||d.push({text:z,range:F,activate:(I,q)=>h?h.activate(I,q,F):b(0,q),hover:(I,q)=>{var V;return(V=h==null?void 0:h.hover)==null?void 0:V.call(h,I,q,F)},leave:(I,q)=>{var V;return(V=h==null?void 0:h.leave)==null?void 0:V.call(h,I,q,F)}})}k=!1,w.hasExtendedAttrs()&&w.extended.urlId?(D=W,R=w.extended.urlId):(D=-1,R=-1)}}f(d)}};function b(C,f){if(confirm(`Do you want to navigate to ${f}?
|
|
65
|
+
|
|
66
|
+
WARNING: This link could potentially be dangerous`)){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=f}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=x=_([v(0,m.IBufferService),v(1,m.IOptionsService),v(2,m.IOscLinkService)],x)},6193:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(c,_){this._renderCallback=c,this._coreBrowserService=_,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,_,v){this._rowCount=v,c=c!==void 0?c:0,_=_!==void 0?_:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,_):_,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 c=Math.max(this._rowStart,0),_=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,_),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const _=c(3614),v=c(3656),l=c(3551),m=c(9042),x=c(3730),b=c(1680),C=c(3107),f=c(5744),p=c(2950),d=c(1296),h=c(428),w=c(4269),L=c(5114),R=c(8934),D=c(3230),k=c(9312),M=c(4725),W=c(6731),z=c(8055),F=c(8969),N=c(8460),I=c(844),q=c(6114),V=c(8437),K=c(2584),U=c(7399),A=c(5941),B=c(9074),P=c(2585),H=c(5435),G=c(4567),Z=c(779);class se extends F.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(X={}){super(X),this.browser=q,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new I.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(B.DecorationService),this._instantiationService.setService(P.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Z.LinkProviderService),this._instantiationService.setService(M.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((O,re)=>this.refresh(O,re)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((O=>this._reportWindowsOptions(O)))),this.register(this._inputHandler.onColor((O=>this._handleColorEvent(O)))),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((O=>this._afterResize(O.cols,O.rows)))),this.register((0,I.toDisposable)((()=>{var O,re;this._customKeyEventHandler=void 0,(re=(O=this.element)==null?void 0:O.parentNode)==null||re.removeChild(this.element)})))}_handleColorEvent(X){if(this._themeService)for(const O of X){let re,ne="";switch(O.index){case 256:re="foreground",ne="10";break;case 257:re="background",ne="11";break;case 258:re="cursor",ne="12";break;default:re="ansi",ne="4;"+O.index}switch(O.type){case 0:const ce=z.color.toColorRGB(re==="ansi"?this._themeService.colors.ansi[O.index]:this._themeService.colors[re]);this.coreService.triggerDataEvent(`${K.C0.ESC}]${ne};${(0,A.toRgbString)(ce)}${K.C1_ESCAPED.ST}`);break;case 1:if(re==="ansi")this._themeService.modifyColors((le=>le.ansi[O.index]=z.channels.toColor(...O.color)));else{const le=re;this._themeService.modifyColors((fe=>fe[le]=z.channels.toColor(...O.color)))}break;case 2:this._themeService.restoreColor(O.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(X){X?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(G.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(X){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var X;return(X=this.textarea)==null?void 0:X.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.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 X=this.buffer.ybase+this.buffer.y,O=this.buffer.lines.get(X);if(!O)return;const re=Math.min(this.buffer.x,this.cols-1),ne=this._renderService.dimensions.css.cell.height,ce=O.getWidth(re),le=this._renderService.dimensions.css.cell.width*ce,fe=this.buffer.y*this._renderService.dimensions.css.cell.height,we=re*this._renderService.dimensions.css.cell.width;this.textarea.style.left=we+"px",this.textarea.style.top=fe+"px",this.textarea.style.width=le+"px",this.textarea.style.height=ne+"px",this.textarea.style.lineHeight=ne+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,v.addDisposableDomListener)(this.element,"copy",(O=>{this.hasSelection()&&(0,_.copyHandler)(O,this._selectionService)})));const X=O=>(0,_.handlePasteEvent)(O,this.textarea,this.coreService,this.optionsService);this.register((0,v.addDisposableDomListener)(this.textarea,"paste",X)),this.register((0,v.addDisposableDomListener)(this.element,"paste",X)),q.isFirefox?this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(O=>{O.button===2&&(0,_.rightClickHandler)(O,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,v.addDisposableDomListener)(this.element,"contextmenu",(O=>{(0,_.rightClickHandler)(O,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),q.isLinux&&this.register((0,v.addDisposableDomListener)(this.element,"auxclick",(O=>{O.button===1&&(0,_.moveTextAreaUnderMouseCursor)(O,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,v.addDisposableDomListener)(this.textarea,"keyup",(X=>this._keyUp(X)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keydown",(X=>this._keyDown(X)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keypress",(X=>this._keyPress(X)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionupdate",(X=>this._compositionHelper.compositionupdate(X)))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,v.addDisposableDomListener)(this.textarea,"input",(X=>this._inputEvent(X)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(X){var re;if(!X)throw new Error("Terminal requires a parent element.");if(X.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((re=this.element)==null?void 0:re.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=X.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"),X.appendChild(this.element);const O=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),O.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,v.addDisposableDomListener)(this.screenElement,"mousemove",(ne=>this.updateCursorStyle(ne)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),O.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",m.promptLabel),q.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(L.CoreBrowserService,this.textarea,X.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(M.ICoreBrowserService,this._coreBrowserService),this.register((0,v.addDisposableDomListener)(this.textarea,"focus",(ne=>this._handleTextAreaFocus(ne)))),this.register((0,v.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(h.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(M.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(W.ThemeService),this._instantiationService.setService(M.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(w.CharacterJoinerService),this._instantiationService.setService(M.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ne=>this._onRender.fire(ne)))),this.onResize((ne=>this._renderService.resize(ne.cols,ne.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(p.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(M.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(l.Linkifier,this.screenElement)),this.element.appendChild(O);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(b.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.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(k.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ne=>this._renderService.handleSelectionChanged(ne.start,ne.end,ne.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ne=>{this.textarea.value=ne,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ne=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,v.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(C.BufferDecorationRenderer,this.screenElement)),this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(ne=>this._selectionService.handleMouseDown(ne)))),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(G.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ne=>this._handleScreenReaderModeOptionChange(ne)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(f.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ne=>{!this._overviewRulerRenderer&&ne&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(f.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 X=this,O=this.element;function re(le){const fe=X._mouseService.getMouseReportCoords(le,X.screenElement);if(!fe)return!1;let we,ye;switch(le.overrideType||le.type){case"mousemove":ye=32,le.buttons===void 0?(we=3,le.button!==void 0&&(we=le.button<3?le.button:3)):we=1&le.buttons?0:4&le.buttons?1:2&le.buttons?2:3;break;case"mouseup":ye=0,we=le.button<3?le.button:3;break;case"mousedown":ye=1,we=le.button<3?le.button:3;break;case"wheel":if(X._customWheelEventHandler&&X._customWheelEventHandler(le)===!1||X.viewport.getLinesScrolled(le)===0)return!1;ye=le.deltaY<0?0:1,we=4;break;default:return!1}return!(ye===void 0||we===void 0||we>4)&&X.coreMouseService.triggerMouseEvent({col:fe.col,row:fe.row,x:fe.x,y:fe.y,button:we,action:ye,ctrl:le.ctrlKey,alt:le.altKey,shift:le.shiftKey})}const ne={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ce={mouseup:le=>(re(le),le.buttons||(this._document.removeEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.removeEventListener("mousemove",ne.mousedrag)),this.cancel(le)),wheel:le=>(re(le),this.cancel(le,!0)),mousedrag:le=>{le.buttons&&re(le)},mousemove:le=>{le.buttons||re(le)}};this.register(this.coreMouseService.onProtocolChange((le=>{le?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(le)),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&le?ne.mousemove||(O.addEventListener("mousemove",ce.mousemove),ne.mousemove=ce.mousemove):(O.removeEventListener("mousemove",ne.mousemove),ne.mousemove=null),16&le?ne.wheel||(O.addEventListener("wheel",ce.wheel,{passive:!1}),ne.wheel=ce.wheel):(O.removeEventListener("wheel",ne.wheel),ne.wheel=null),2&le?ne.mouseup||(ne.mouseup=ce.mouseup):(this._document.removeEventListener("mouseup",ne.mouseup),ne.mouseup=null),4&le?ne.mousedrag||(ne.mousedrag=ce.mousedrag):(this._document.removeEventListener("mousemove",ne.mousedrag),ne.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,v.addDisposableDomListener)(O,"mousedown",(le=>{if(le.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(le))return re(le),ne.mouseup&&this._document.addEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.addEventListener("mousemove",ne.mousedrag),this.cancel(le)}))),this.register((0,v.addDisposableDomListener)(O,"wheel",(le=>{if(!ne.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(le)===!1)return!1;if(!this.buffer.hasScrollback){const fe=this.viewport.getLinesScrolled(le);if(fe===0)return;const we=K.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(le.deltaY<0?"A":"B");let ye="";for(let xe=0;xe<Math.abs(fe);xe++)ye+=we;return this.coreService.triggerDataEvent(ye,!0),this.cancel(le,!0)}return this.viewport.handleWheel(le)?this.cancel(le):void 0}}),{passive:!1})),this.register((0,v.addDisposableDomListener)(O,"touchstart",(le=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(le),this.cancel(le)}),{passive:!0})),this.register((0,v.addDisposableDomListener)(O,"touchmove",(le=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(le)?void 0:this.cancel(le)}),{passive:!1}))}refresh(X,O){var re;(re=this._renderService)==null||re.refreshRows(X,O)}updateCursorStyle(X){var O;(O=this._selectionService)!=null&&O.shouldColumnSelect(X)?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(X,O,re=0){var ne;re===1?(super.scrollLines(X,O,re),this.refresh(0,this.rows-1)):(ne=this.viewport)==null||ne.scrollLines(X)}paste(X){(0,_.paste)(X,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(X){this._customKeyEventHandler=X}attachCustomWheelEventHandler(X){this._customWheelEventHandler=X}registerLinkProvider(X){return this._linkProviderService.registerLinkProvider(X)}registerCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const O=this._characterJoinerService.register(X);return this.refresh(0,this.rows-1),O}deregisterCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(X)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(X){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+X)}registerDecoration(X){return this._decorationService.registerDecoration(X)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(X,O,re){this._selectionService.setSelection(X,O,re)}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 X;(X=this._selectionService)==null||X.clearSelection()}selectAll(){var X;(X=this._selectionService)==null||X.selectAll()}selectLines(X,O){var re;(re=this._selectionService)==null||re.selectLines(X,O)}_keyDown(X){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;const O=this.browser.isMac&&this.options.macOptionIsMeta&&X.altKey;if(!O&&!this._compositionHelper.keydown(X))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;O||X.key!=="Dead"&&X.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const re=(0,U.evaluateKeyboardEvent)(X,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(X),re.type===3||re.type===2){const ne=this.rows-1;return this.scrollLines(re.type===2?-ne:ne),this.cancel(X,!0)}return re.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,X)||(re.cancel&&this.cancel(X,!0),!re.key||!!(X.key&&!X.ctrlKey&&!X.altKey&&!X.metaKey&&X.key.length===1&&X.key.charCodeAt(0)>=65&&X.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(re.key!==K.C0.ETX&&re.key!==K.C0.CR||(this.textarea.value=""),this._onKey.fire({key:re.key,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(re.key,!0),!this.optionsService.rawOptions.screenReaderMode||X.altKey||X.ctrlKey?this.cancel(X,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(X,O){const re=X.isMac&&!this.options.macOptionIsMeta&&O.altKey&&!O.ctrlKey&&!O.metaKey||X.isWindows&&O.altKey&&O.ctrlKey&&!O.metaKey||X.isWindows&&O.getModifierState("AltGraph");return O.type==="keypress"?re:re&&(!O.keyCode||O.keyCode>47)}_keyUp(X){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1||((function(O){return O.keyCode===16||O.keyCode===17||O.keyCode===18})(X)||this.focus(),this.updateCursorStyle(X),this._keyPressHandled=!1)}_keyPress(X){let O;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(this.cancel(X),X.charCode)O=X.charCode;else if(X.which===null||X.which===void 0)O=X.keyCode;else{if(X.which===0||X.charCode===0)return!1;O=X.which}return!(!O||(X.altKey||X.ctrlKey||X.metaKey)&&!this._isThirdLevelShift(this.browser,X)||(O=String.fromCharCode(O),this._onKey.fire({key:O,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(O,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(X){if(X.data&&X.inputType==="insertText"&&(!X.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const O=X.data;return this.coreService.triggerDataEvent(O,!0),this.cancel(X),!0}return!1}resize(X,O){X!==this.cols||O!==this.rows?super.resize(X,O):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(X,O){var re,ne;(re=this._charSizeService)==null||re.measure(),(ne=this.viewport)==null||ne.syncScrollArea(!0)}clear(){var X;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 O=1;O<this.rows;O++)this.buffer.lines.push(this.buffer.getBlankLine(V.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(X=this.viewport)==null||X.reset(),this.refresh(0,this.rows-1)}}reset(){var O,re;this.options.rows=this.rows,this.options.cols=this.cols;const X=this._customKeyEventHandler;this._setup(),super.reset(),(O=this._selectionService)==null||O.reset(),this._decorationService.reset(),(re=this.viewport)==null||re.reset(),this._customKeyEventHandler=X,this.refresh(0,this.rows-1)}clearTextureAtlas(){var X;(X=this._renderService)==null||X.clearTextureAtlas()}_reportFocus(){var X;(X=this.element)!=null&&X.classList.contains("focus")?this.coreService.triggerDataEvent(K.C0.ESC+"[I"):this.coreService.triggerDataEvent(K.C0.ESC+"[O")}_reportWindowsOptions(X){if(this._renderService)switch(X){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const O=this._renderService.dimensions.css.canvas.width.toFixed(0),re=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[4;${re};${O}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ne=this._renderService.dimensions.css.cell.width.toFixed(0),ce=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[6;${ce};${ne}t`)}}cancel(X,O){if(this.options.cancelEvents||O)return X.preventDefault(),X.stopPropagation(),!1}}a.Terminal=se},9924:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(c,_=1e3){this._renderCallback=c,this._debounceThresholdMS=_,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,_,v){this._rowCount=v,c=c!==void 0?c:0,_=_!==void 0?_:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,_):_;const l=Date.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){const m=l-this._lastRefreshMs,x=this._debounceThresholdMS-m;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),_=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,_)}}},1680:function(y,a,c){var _=this&&this.__decorate||function(p,d,h,w){var L,R=arguments.length,D=R<3?d:w===null?w=Object.getOwnPropertyDescriptor(d,h):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(p,d,h,w);else for(var k=p.length-1;k>=0;k--)(L=p[k])&&(D=(R<3?L(D):R>3?L(d,h,D):L(d,h))||D);return R>3&&D&&Object.defineProperty(d,h,D),D},v=this&&this.__param||function(p,d){return function(h,w){d(h,w,p)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const l=c(3656),m=c(4725),x=c(8460),b=c(844),C=c(2585);let f=a.Viewport=class extends b.Disposable{constructor(p,d,h,w,L,R,D,k){super(),this._viewportElement=p,this._scrollArea=d,this._bufferService=h,this._optionsService=w,this._charSizeService=L,this._renderService=R,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(k.colors),this.register(k.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(p){this._viewportElement.style.backgroundColor=p.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(p){if(p)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 p=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==p&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=p),this._refreshAnimationFrame=null}syncScrollArea(p=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(p);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(p)}_handleScroll(p){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 p=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(p*(this._smoothScrollState.target-this._smoothScrollState.origin)),p<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(p,d){const h=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(d<0&&this._viewportElement.scrollTop!==0||d>0&&h<this._lastRecordedBufferHeight)||(p.cancelable&&p.preventDefault(),!1)}handleWheel(p){const d=this._getPixelsScrolled(p);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(p,d))}scrollLines(p){if(p!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const d=p*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:p,suppressScrollEvent:!1})}_getPixelsScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let d=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_LINE?d*=this._currentRowHeight:p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._currentRowHeight*this._bufferService.rows),d}getBufferElements(p,d){var k;let h,w="";const L=[],R=d??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let M=p;M<R;M++){const W=D.get(M);if(!W)continue;const z=(k=D.get(M+1))==null?void 0:k.isWrapped;if(w+=W.translateToString(!z),!z||M===D.length-1){const F=document.createElement("div");F.textContent=w,L.push(F),w.length>0&&(h=F),w=""}}return{bufferElements:L,cursorElement:h}}getLinesScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let d=this._applyScrollModifier(p.deltaY,p);return p.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):p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._bufferService.rows),d}_applyScrollModifier(p,d){const h=this._optionsService.rawOptions.fastScrollModifier;return h==="alt"&&d.altKey||h==="ctrl"&&d.ctrlKey||h==="shift"&&d.shiftKey?p*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:p*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(p){this._lastTouchY=p.touches[0].pageY}handleTouchMove(p){const d=this._lastTouchY-p.touches[0].pageY;return this._lastTouchY=p.touches[0].pageY,d!==0&&(this._viewportElement.scrollTop+=d,this._bubbleScroll(p,d))}};a.Viewport=f=_([v(2,C.IBufferService),v(3,C.IOptionsService),v(4,m.ICharSizeService),v(5,m.IRenderService),v(6,m.ICoreBrowserService),v(7,m.IThemeService)],f)},3107:function(y,a,c){var _=this&&this.__decorate||function(C,f,p,d){var h,w=arguments.length,L=w<3?f:d===null?d=Object.getOwnPropertyDescriptor(f,p):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(C,f,p,d);else for(var R=C.length-1;R>=0;R--)(h=C[R])&&(L=(w<3?h(L):w>3?h(f,p,L):h(f,p))||L);return w>3&&L&&Object.defineProperty(f,p,L),L},v=this&&this.__param||function(C,f){return function(p,d){f(p,d,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const l=c(4725),m=c(844),x=c(2585);let b=a.BufferDecorationRenderer=class extends m.Disposable{constructor(C,f,p,d,h){super(),this._screenElement=C,this._bufferService=f,this._coreBrowserService=p,this._decorationService=d,this._renderService=h,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((w=>this._removeDecoration(w)))),this.register((0,m.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 C of this._decorationService.decorations)this._renderDecoration(C);this._dimensionsChanged=!1}_renderDecoration(C){this._refreshStyle(C),this._dimensionsChanged&&this._refreshXPosition(C)}_createElement(C){var d;const f=this._coreBrowserService.mainDocument.createElement("div");f.classList.add("xterm-decoration"),f.classList.toggle("xterm-decoration-top-layer",((d=C==null?void 0:C.options)==null?void 0:d.layer)==="top"),f.style.width=`${Math.round((C.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,f.style.height=(C.options.height||1)*this._renderService.dimensions.css.cell.height+"px",f.style.top=(C.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",f.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const p=C.options.x??0;return p&&p>this._bufferService.cols&&(f.style.display="none"),this._refreshXPosition(C,f),f}_refreshStyle(C){const f=C.marker.line-this._bufferService.buffers.active.ydisp;if(f<0||f>=this._bufferService.rows)C.element&&(C.element.style.display="none",C.onRenderEmitter.fire(C.element));else{let p=this._decorationElements.get(C);p||(p=this._createElement(C),C.element=p,this._decorationElements.set(C,p),this._container.appendChild(p),C.onDispose((()=>{this._decorationElements.delete(C),p.remove()}))),p.style.top=f*this._renderService.dimensions.css.cell.height+"px",p.style.display=this._altBufferIsActive?"none":"block",C.onRenderEmitter.fire(p)}}_refreshXPosition(C,f=C.element){if(!f)return;const p=C.options.x??0;(C.options.anchor||"left")==="right"?f.style.right=p?p*this._renderService.dimensions.css.cell.width+"px":"":f.style.left=p?p*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(C){var f;(f=this._decorationElements.get(C))==null||f.remove(),this._decorationElements.delete(C),C.dispose()}};a.BufferDecorationRenderer=b=_([v(1,x.IBufferService),v(2,l.ICoreBrowserService),v(3,x.IDecorationService),v(4,l.IRenderService)],b)},5871:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.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(c){if(c.options.overviewRulerOptions){for(const _ of this._zones)if(_.color===c.options.overviewRulerOptions.color&&_.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(_,c.marker.line))return;if(this._lineAdjacentToZone(_,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(_,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,_){return _>=c.startBufferLine&&_<=c.endBufferLine}_lineAdjacentToZone(c,_,v){return _>=c.startBufferLine-this._linePadding[v||"full"]&&_<=c.endBufferLine+this._linePadding[v||"full"]}_addLineToZone(c,_){c.startBufferLine=Math.min(c.startBufferLine,_),c.endBufferLine=Math.max(c.endBufferLine,_)}}},5744:function(y,a,c){var _=this&&this.__decorate||function(h,w,L,R){var D,k=arguments.length,M=k<3?w:R===null?R=Object.getOwnPropertyDescriptor(w,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(h,w,L,R);else for(var W=h.length-1;W>=0;W--)(D=h[W])&&(M=(k<3?D(M):k>3?D(w,L,M):D(w,L))||M);return k>3&&M&&Object.defineProperty(w,L,M),M},v=this&&this.__param||function(h,w){return function(L,R){w(L,R,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const l=c(5871),m=c(4725),x=c(844),b=c(2585),C={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0};let d=a.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(h,w,L,R,D,k,M){var z;super(),this._viewportElement=h,this._screenElement=w,this._bufferService=L,this._decorationService=R,this._renderService=D,this._optionsService=k,this._coreBrowserService=M,this._colorZoneStore=new l.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(),(z=this._viewportElement.parentElement)==null||z.insertBefore(this._canvas,this._viewportElement);const W=this._canvas.getContext("2d");if(!W)throw new Error("Ctx cannot be null");this._ctx=W,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.toDisposable)((()=>{var F;(F=this._canvas)==null||F.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 h=Math.floor(this._canvas.width/3),w=Math.ceil(this._canvas.width/3);f.full=this._canvas.width,f.left=h,f.center=w,f.right=h,this._refreshDrawHeightConstants(),p.full=0,p.left=0,p.center=f.left,p.right=f.left+f.center}_refreshDrawHeightConstants(){C.full=Math.round(2*this._coreBrowserService.dpr);const h=this._canvas.height/this._bufferService.buffer.lines.length,w=Math.round(Math.max(Math.min(h,12),6)*this._coreBrowserService.dpr);C.left=w,C.center=w,C.right=w}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.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 w of this._decorationService.decorations)this._colorZoneStore.addDecoration(w);this._ctx.lineWidth=1;const h=this._colorZoneStore.zones;for(const w of h)w.position!=="full"&&this._renderColorZone(w);for(const w of h)w.position==="full"&&this._renderColorZone(w);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(h){this._ctx.fillStyle=h.color,this._ctx.fillRect(p[h.position||"full"],Math.round((this._canvas.height-1)*(h.startBufferLine/this._bufferService.buffers.active.lines.length)-C[h.position||"full"]/2),f[h.position||"full"],Math.round((this._canvas.height-1)*((h.endBufferLine-h.startBufferLine)/this._bufferService.buffers.active.lines.length)+C[h.position||"full"]))}_queueRefresh(h,w){this._shouldUpdateDimensions=h||this._shouldUpdateDimensions,this._shouldUpdateAnchor=w||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=d=_([v(2,b.IBufferService),v(3,b.IDecorationService),v(4,m.IRenderService),v(5,b.IOptionsService),v(6,m.ICoreBrowserService)],d)},2950:function(y,a,c){var _=this&&this.__decorate||function(C,f,p,d){var h,w=arguments.length,L=w<3?f:d===null?d=Object.getOwnPropertyDescriptor(f,p):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(C,f,p,d);else for(var R=C.length-1;R>=0;R--)(h=C[R])&&(L=(w<3?h(L):w>3?h(f,p,L):h(f,p))||L);return w>3&&L&&Object.defineProperty(f,p,L),L},v=this&&this.__param||function(C,f){return function(p,d){f(p,d,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const l=c(4725),m=c(2585),x=c(2584);let b=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(C,f,p,d,h,w){this._textarea=C,this._compositionView=f,this._bufferService=p,this._optionsService=d,this._coreService=h,this._renderService=w,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(C){this._compositionView.textContent=C.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(C){if(this._isComposing||this._isSendingComposition){if(C.keyCode===229||C.keyCode===16||C.keyCode===17||C.keyCode===18)return!1;this._finalizeComposition(!1)}return C.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(C){if(this._compositionView.classList.remove("active"),this._isComposing=!1,C){const f={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let p;this._isSendingComposition=!1,f.start+=this._dataAlreadySent.length,p=this._isComposing?this._textarea.value.substring(f.start,f.end):this._textarea.value.substring(f.start),p.length>0&&this._coreService.triggerDataEvent(p,!0)}}),0)}else{this._isSendingComposition=!1;const f=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(f,!0)}}_handleAnyTextareaChanges(){const C=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const f=this._textarea.value,p=f.replace(C,"");this._dataAlreadySent=p,f.length>C.length?this._coreService.triggerDataEvent(p,!0):f.length<C.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):f.length===C.length&&f!==C&&this._coreService.triggerDataEvent(f,!0)}}),0)}updateCompositionElements(C){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const f=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),p=this._renderService.dimensions.css.cell.height,d=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,h=f*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=h+"px",this._compositionView.style.top=d+"px",this._compositionView.style.height=p+"px",this._compositionView.style.lineHeight=p+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const w=this._compositionView.getBoundingClientRect();this._textarea.style.left=h+"px",this._textarea.style.top=d+"px",this._textarea.style.width=Math.max(w.width,1)+"px",this._textarea.style.height=Math.max(w.height,1)+"px",this._textarea.style.lineHeight=w.height+"px"}C||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=b=_([v(2,m.IBufferService),v(3,m.IOptionsService),v(4,m.ICoreService),v(5,l.IRenderService)],b)},9806:(y,a)=>{function c(_,v,l){const m=l.getBoundingClientRect(),x=_.getComputedStyle(l),b=parseInt(x.getPropertyValue("padding-left")),C=parseInt(x.getPropertyValue("padding-top"));return[v.clientX-m.left-b,v.clientY-m.top-C]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=c,a.getCoords=function(_,v,l,m,x,b,C,f,p){if(!b)return;const d=c(_,v,l);return d?(d[0]=Math.ceil((d[0]+(p?C/2:0))/C),d[1]=Math.ceil(d[1]/f),d[0]=Math.min(Math.max(d[0],1),m+(p?1:0)),d[1]=Math.min(Math.max(d[1],1),x),d):void 0}},9504:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const _=c(2584);function v(f,p,d,h){const w=f-l(f,d),L=p-l(p,d),R=Math.abs(w-L)-(function(D,k,M){let W=0;const z=D-l(D,M),F=k-l(k,M);for(let N=0;N<Math.abs(z-F);N++){const I=m(D,k)==="A"?-1:1,q=M.buffer.lines.get(z+I*N);q!=null&&q.isWrapped&&W++}return W})(f,p,d);return C(R,b(m(f,p),h))}function l(f,p){let d=0,h=p.buffer.lines.get(f),w=h==null?void 0:h.isWrapped;for(;w&&f>=0&&f<p.rows;)d++,h=p.buffer.lines.get(--f),w=h==null?void 0:h.isWrapped;return d}function m(f,p){return f>p?"A":"B"}function x(f,p,d,h,w,L){let R=f,D=p,k="";for(;R!==d||D!==h;)R+=w?1:-1,w&&R>L.cols-1?(k+=L.buffer.translateBufferLineToString(D,!1,f,R),R=0,f=0,D++):!w&&R<0&&(k+=L.buffer.translateBufferLineToString(D,!1,0,f+1),R=L.cols-1,f=R,D--);return k+L.buffer.translateBufferLineToString(D,!1,f,R)}function b(f,p){const d=p?"O":"[";return _.C0.ESC+d+f}function C(f,p){f=Math.floor(f);let d="";for(let h=0;h<f;h++)d+=p;return d}a.moveToCellSequence=function(f,p,d,h){const w=d.buffer.x,L=d.buffer.y;if(!d.buffer.hasScrollback)return(function(k,M,W,z,F,N){return v(M,z,F,N).length===0?"":C(x(k,M,k,M-l(M,F),!1,F).length,b("D",N))})(w,L,0,p,d,h)+v(L,p,d,h)+(function(k,M,W,z,F,N){let I;I=v(M,z,F,N).length>0?z-l(z,F):M;const q=z,V=(function(K,U,A,B,P,H){let G;return G=v(A,B,P,H).length>0?B-l(B,P):U,K<A&&G<=B||K>=A&&G<B?"C":"D"})(k,M,W,z,F,N);return C(x(k,I,W,q,V==="C",F).length,b(V,N))})(w,L,f,p,d,h);let R;if(L===p)return R=w>f?"D":"C",C(Math.abs(w-f),b(R,h));R=L>p?"D":"C";const D=Math.abs(L-p);return C((function(k,M){return M.cols-k})(L>p?f:w,d)+(D-1)*d.cols+1+((L>p?w:f)-1),b(R,h))}},1296:function(y,a,c){var _=this&&this.__decorate||function(N,I,q,V){var K,U=arguments.length,A=U<3?I:V===null?V=Object.getOwnPropertyDescriptor(I,q):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(N,I,q,V);else for(var B=N.length-1;B>=0;B--)(K=N[B])&&(A=(U<3?K(A):U>3?K(I,q,A):K(I,q))||A);return U>3&&A&&Object.defineProperty(I,q,A),A},v=this&&this.__param||function(N,I){return function(q,V){I(q,V,N)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const l=c(3787),m=c(2550),x=c(2223),b=c(6171),C=c(6052),f=c(4725),p=c(8055),d=c(8460),h=c(844),w=c(2585),L="xterm-dom-renderer-owner-",R="xterm-rows",D="xterm-fg-",k="xterm-bg-",M="xterm-focus",W="xterm-selection";let z=1,F=a.DomRenderer=class extends h.Disposable{constructor(N,I,q,V,K,U,A,B,P,H,G,Z,se){super(),this._terminal=N,this._document=I,this._element=q,this._screenElement=V,this._viewportElement=K,this._helperContainer=U,this._linkifier2=A,this._charSizeService=P,this._optionsService=H,this._bufferService=G,this._coreBrowserService=Z,this._themeService=se,this._terminalClass=z++,this._rowElements=[],this._selectionRenderModel=(0,C.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new d.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(W),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,b.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ee=>this._injectCss(ee)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(l.DomRendererRowFactory,document),this._element.classList.add(L+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ee=>this._handleLinkHover(ee)))),this.register(this._linkifier2.onHideLinkUnderline((ee=>this._handleLinkLeave(ee)))),this.register((0,h.toDisposable)((()=>{this._element.classList.remove(L+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new m.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 q of this._rowElements)q.style.width=`${this.dimensions.css.canvas.width}px`,q.style.height=`${this.dimensions.css.cell.height}px`,q.style.lineHeight=`${this.dimensions.css.cell.height}px`,q.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const I=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=I,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 I=`${this._terminalSelector} .${R} { color: ${N.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;I+=`${this._terminalSelector} .${R} .xterm-dim { color: ${p.color.multiplyOpacity(N.foreground,.5).css};}`,I+=`${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 q=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,K=`blink_block_${this._terminalClass}`;I+=`@keyframes ${q} { 50% { border-bottom-style: hidden; }}`,I+=`@keyframes ${V} { 50% { box-shadow: none; }}`,I+=`@keyframes ${K} { 0% { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css}; } 50% { background-color: inherit; color: ${N.cursor.css}; }}`,I+=`${this._terminalSelector} .${R}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${R}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${R}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${N.cursor.css} !important; color: ${N.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${N.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${N.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${N.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,I+=`${this._terminalSelector} .${W} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${W} div { position: absolute; background-color: ${N.selectionBackgroundOpaque.css};}${this._terminalSelector} .${W} div { position: absolute; background-color: ${N.selectionInactiveBackgroundOpaque.css};}`;for(const[U,A]of N.ansi.entries())I+=`${this._terminalSelector} .${D}${U} { color: ${A.css}; }${this._terminalSelector} .${D}${U}.xterm-dim { color: ${p.color.multiplyOpacity(A,.5).css}; }${this._terminalSelector} .${k}${U} { background-color: ${A.css}; }`;I+=`${this._terminalSelector} .${D}${x.INVERTED_DEFAULT_COLOR} { color: ${p.color.opaque(N.background).css}; }${this._terminalSelector} .${D}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${p.color.multiplyOpacity(p.color.opaque(N.background),.5).css}; }${this._terminalSelector} .${k}${x.INVERTED_DEFAULT_COLOR} { background-color: ${N.foreground.css}; }`,this._themeStyleElement.textContent=I}_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,I){for(let q=this._rowElements.length;q<=I;q++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>I;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(N,I){this._refreshRowElements(N,I),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(M),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(M),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(N,I,q){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(N,I,q),this.renderRows(0,this._bufferService.rows-1),!N||!I)return;this._selectionRenderModel.update(this._terminal,N,I,q);const V=this._selectionRenderModel.viewportStartRow,K=this._selectionRenderModel.viewportEndRow,U=this._selectionRenderModel.viewportCappedStartRow,A=this._selectionRenderModel.viewportCappedEndRow;if(U>=this._bufferService.rows||A<0)return;const B=this._document.createDocumentFragment();if(q){const P=N[0]>I[0];B.appendChild(this._createSelectionElement(U,P?I[0]:N[0],P?N[0]:I[0],A-U+1))}else{const P=V===U?N[0]:0,H=U===K?I[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(U,P,H));const G=A-U-1;if(B.appendChild(this._createSelectionElement(U+1,0,this._bufferService.cols,G)),U!==A){const Z=K===A?I[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(A,0,Z))}}this._selectionContainer.appendChild(B)}_createSelectionElement(N,I,q,V=1){const K=this._document.createElement("div"),U=I*this.dimensions.css.cell.width;let A=this.dimensions.css.cell.width*(q-I);return U+A>this.dimensions.css.canvas.width&&(A=this.dimensions.css.canvas.width-U),K.style.height=V*this.dimensions.css.cell.height+"px",K.style.top=N*this.dimensions.css.cell.height+"px",K.style.left=`${U}px`,K.style.width=`${A}px`,K}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,I){const q=this._bufferService.buffer,V=q.ybase+q.y,K=Math.min(q.x,this._bufferService.cols-1),U=this._optionsService.rawOptions.cursorBlink,A=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let P=N;P<=I;P++){const H=P+q.ydisp,G=this._rowElements[P],Z=q.lines.get(H);if(!G||!Z)break;G.replaceChildren(...this._rowFactory.createRow(Z,H,H===V,A,B,K,U,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${L}${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,I,q,V,K,U){q<0&&(N=0),V<0&&(I=0);const A=this._bufferService.rows-1;q=Math.max(Math.min(q,A),0),V=Math.max(Math.min(V,A),0),K=Math.min(K,this._bufferService.cols);const B=this._bufferService.buffer,P=B.ybase+B.y,H=Math.min(B.x,K-1),G=this._optionsService.rawOptions.cursorBlink,Z=this._optionsService.rawOptions.cursorStyle,se=this._optionsService.rawOptions.cursorInactiveStyle;for(let ee=q;ee<=V;++ee){const X=ee+B.ydisp,O=this._rowElements[ee],re=B.lines.get(X);if(!O||!re)break;O.replaceChildren(...this._rowFactory.createRow(re,X,X===P,Z,se,H,G,this.dimensions.css.cell.width,this._widthCache,U?ee===q?N:0:-1,U?(ee===V?I:K)-1:-1))}}};a.DomRenderer=F=_([v(7,w.IInstantiationService),v(8,f.ICharSizeService),v(9,w.IOptionsService),v(10,w.IBufferService),v(11,f.ICoreBrowserService),v(12,f.IThemeService)],F)},3787:function(y,a,c){var _=this&&this.__decorate||function(R,D,k,M){var W,z=arguments.length,F=z<3?D:M===null?M=Object.getOwnPropertyDescriptor(D,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(R,D,k,M);else for(var N=R.length-1;N>=0;N--)(W=R[N])&&(F=(z<3?W(F):z>3?W(D,k,F):W(D,k))||F);return z>3&&F&&Object.defineProperty(D,k,F),F},v=this&&this.__param||function(R,D){return function(k,M){D(k,M,R)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const l=c(2223),m=c(643),x=c(511),b=c(2585),C=c(8055),f=c(4725),p=c(4269),d=c(6171),h=c(3734);let w=a.DomRendererRowFactory=class{constructor(R,D,k,M,W,z,F){this._document=R,this._characterJoinerService=D,this._optionsService=k,this._coreBrowserService=M,this._coreService=W,this._decorationService=z,this._themeService=F,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,D,k){this._selectionStart=R,this._selectionEnd=D,this._columnSelectMode=k}createRow(R,D,k,M,W,z,F,N,I,q,V){const K=[],U=this._characterJoinerService.getJoinedCharacters(D),A=this._themeService.colors;let B,P=R.getNoBgTrimmedLength();k&&P<z+1&&(P=z+1);let H=0,G="",Z=0,se=0,ee=0,X=!1,O=0,re=!1,ne=0;const ce=[],le=q!==-1&&V!==-1;for(let fe=0;fe<P;fe++){R.loadCell(fe,this._workCell);let we=this._workCell.getWidth();if(we===0)continue;let ye=!1,xe=fe,ge=this._workCell;if(U.length>0&&fe===U[0][0]){ye=!0;const Be=U.shift();ge=new p.JoinedCellData(this._workCell,R.translateToString(!0,Be[0],Be[1]),Be[1]-Be[0]),xe=Be[1]-1,we=ge.getWidth()}const Ie=this._isCellInSelection(fe,D),st=k&&fe===z,ot=le&&fe>=q&&fe<=V;let ct=!1;this._decorationService.forEachDecorationAtCell(fe,D,void 0,(Be=>{ct=!0}));let vt=ge.getChars()||m.WHITESPACE_CELL_CHAR;if(vt===" "&&(ge.isUnderline()||ge.isOverline())&&(vt=" "),ne=we*N-I.get(vt,ge.isBold(),ge.isItalic()),B){if(H&&(Ie&&re||!Ie&&!re&&ge.bg===Z)&&(Ie&&re&&A.selectionForeground||ge.fg===se)&&ge.extended.ext===ee&&ot===X&&ne===O&&!st&&!ye&&!ct){ge.isInvisible()?G+=m.WHITESPACE_CELL_CHAR:G+=vt,H++;continue}H&&(B.textContent=G),B=this._document.createElement("span"),H=0,G=""}else B=this._document.createElement("span");if(Z=ge.bg,se=ge.fg,ee=ge.extended.ext,X=ot,O=ne,re=Ie,ye&&z>=fe&&z<=xe&&(z=fe),!this._coreService.isCursorHidden&&st&&this._coreService.isCursorInitialized){if(ce.push("xterm-cursor"),this._coreBrowserService.isFocused)F&&ce.push("xterm-cursor-blink"),ce.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(W)switch(W){case"outline":ce.push("xterm-cursor-outline");break;case"block":ce.push("xterm-cursor-block");break;case"bar":ce.push("xterm-cursor-bar");break;case"underline":ce.push("xterm-cursor-underline")}}if(ge.isBold()&&ce.push("xterm-bold"),ge.isItalic()&&ce.push("xterm-italic"),ge.isDim()&&ce.push("xterm-dim"),G=ge.isInvisible()?m.WHITESPACE_CELL_CHAR:ge.getChars()||m.WHITESPACE_CELL_CHAR,ge.isUnderline()&&(ce.push(`xterm-underline-${ge.extended.underlineStyle}`),G===" "&&(G=" "),!ge.isUnderlineColorDefault()))if(ge.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${h.AttributeData.toColorRGB(ge.getUnderlineColor()).join(",")})`;else{let Be=ge.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ge.isBold()&&Be<8&&(Be+=8),B.style.textDecorationColor=A.ansi[Be].css}ge.isOverline()&&(ce.push("xterm-overline"),G===" "&&(G=" ")),ge.isStrikethrough()&&ce.push("xterm-strikethrough"),ot&&(B.style.textDecoration="underline");let qe=ge.getFgColor(),Nt=ge.getFgColorMode(),et=ge.getBgColor(),_t=ge.getBgColorMode();const kt=!!ge.isInverse();if(kt){const Be=qe;qe=et,et=Be;const Ln=Nt;Nt=_t,_t=Ln}let ut,pr,tt,Lt=!1;switch(this._decorationService.forEachDecorationAtCell(fe,D,void 0,(Be=>{Be.options.layer!=="top"&&Lt||(Be.backgroundColorRGB&&(_t=50331648,et=Be.backgroundColorRGB.rgba>>8&16777215,ut=Be.backgroundColorRGB),Be.foregroundColorRGB&&(Nt=50331648,qe=Be.foregroundColorRGB.rgba>>8&16777215,pr=Be.foregroundColorRGB),Lt=Be.options.layer==="top")})),!Lt&&Ie&&(ut=this._coreBrowserService.isFocused?A.selectionBackgroundOpaque:A.selectionInactiveBackgroundOpaque,et=ut.rgba>>8&16777215,_t=50331648,Lt=!0,A.selectionForeground&&(Nt=50331648,qe=A.selectionForeground.rgba>>8&16777215,pr=A.selectionForeground)),Lt&&ce.push("xterm-decoration-top"),_t){case 16777216:case 33554432:tt=A.ansi[et],ce.push(`xterm-bg-${et}`);break;case 50331648:tt=C.channels.toColor(et>>16,et>>8&255,255&et),this._addStyle(B,`background-color:#${L((et>>>0).toString(16),"0",6)}`);break;default:kt?(tt=A.foreground,ce.push(`xterm-bg-${l.INVERTED_DEFAULT_COLOR}`)):tt=A.background}switch(ut||ge.isDim()&&(ut=C.color.multiplyOpacity(tt,.5)),Nt){case 16777216:case 33554432:ge.isBold()&&qe<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(qe+=8),this._applyMinimumContrast(B,tt,A.ansi[qe],ge,ut,void 0)||ce.push(`xterm-fg-${qe}`);break;case 50331648:const Be=C.channels.toColor(qe>>16&255,qe>>8&255,255&qe);this._applyMinimumContrast(B,tt,Be,ge,ut,pr)||this._addStyle(B,`color:#${L(qe.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,tt,A.foreground,ge,ut,pr)||kt&&ce.push(`xterm-fg-${l.INVERTED_DEFAULT_COLOR}`)}ce.length&&(B.className=ce.join(" "),ce.length=0),st||ye||ct?B.textContent=G:H++,ne!==this.defaultSpacing&&(B.style.letterSpacing=`${ne}px`),K.push(B),fe=xe}return B&&H&&(B.textContent=G),K}_applyMinimumContrast(R,D,k,M,W,z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,d.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const F=this._getContrastCache(M);let N;if(W||z||(N=F.getColor(D.rgba,k.rgba)),N===void 0){const I=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);N=C.color.ensureContrastRatio(W||D,z||k,I),F.setColor((W||D).rgba,(z||k).rgba,N??null)}return!!N&&(this._addStyle(R,`color:${N.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,D){R.setAttribute("style",`${R.getAttribute("style")||""}${D};`)}_isCellInSelection(R,D){const k=this._selectionStart,M=this._selectionEnd;return!(!k||!M)&&(this._columnSelectMode?k[0]<=M[0]?R>=k[0]&&D>=k[1]&&R<M[0]&&D<=M[1]:R<k[0]&&D>=k[1]&&R>=M[0]&&D<=M[1]:D>k[1]&&D<M[1]||k[1]===M[1]&&D===k[1]&&R>=k[0]&&R<M[0]||k[1]<M[1]&&D===M[1]&&R<M[0]||k[1]<M[1]&&D===k[1]&&R>=k[0])}};function L(R,D,k){for(;R.length<k;)R=D+R;return R}a.DomRendererRowFactory=w=_([v(1,f.ICharacterJoinerService),v(2,b.IOptionsService),v(3,f.ICoreBrowserService),v(4,b.ICoreService),v(5,b.IDecorationService),v(6,f.IThemeService)],w)},2550:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(c,_){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.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 v=c.createElement("span");v.classList.add("xterm-char-measure-element");const l=c.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";const m=c.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontStyle="italic";const x=c.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[v,l,m,x],this._container.appendChild(v),this._container.appendChild(l),this._container.appendChild(m),this._container.appendChild(x),_.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(c,_,v,l){c===this._font&&_===this._fontSize&&v===this._weight&&l===this._weightBold||(this._font=c,this._fontSize=_,this._weight=v,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${v}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${v}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(c,_,v){let l=0;if(!_&&!v&&c.length===1&&(l=c.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];const b=this._measure(c,0);return b>0&&(this._flat[l]=b),b}let m=c;_&&(m+="B"),v&&(m+="I");let x=this._holey.get(m);if(x===void 0){let b=0;_&&(b|=1),v&&(b|=2),x=this._measure(c,b),x>0&&this._holey.set(m,x)}return x}_measure(c,_){const v=this._measureElements[_];return v.textContent=c.repeat(32),v.offsetWidth/32}}},2223:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const _=c(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=_.isFirefox||_.isLegacyEdge?"bottom":"ideographic"},6171:(y,a)=>{function c(v){return 57508<=v&&v<=57558}function _(v){return v>=128512&&v<=128591||v>=127744&&v<=128511||v>=128640&&v<=128767||v>=9728&&v<=9983||v>=9984&&v<=10175||v>=65024&&v<=65039||v>=129280&&v<=129535||v>=127462&&v<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(v){if(!v)throw new Error("value must not be falsy");return v},a.isPowerlineGlyph=c,a.isRestrictedPowerlineGlyph=function(v){return 57520<=v&&v<=57527},a.isEmoji=_,a.allowRescaling=function(v,l,m,x){return l===1&&m>Math.ceil(1.5*x)&&v!==void 0&&v>255&&!_(v)&&!c(v)&&!(function(b){return 57344<=b&&b<=63743})(v)},a.treatGlyphAsBackgroundColor=function(v){return c(v)||(function(l){return 9472<=l&&l<=9631})(v)},a.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}}}},a.computeNextVariantOffset=function(v,l,m=0){return(v-(2*Math.round(l)-m))%(2*Math.round(l))}},6052:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class c{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(v,l,m,x=!1){if(this.selectionStart=l,this.selectionEnd=m,!l||!m||l[0]===m[0]&&l[1]===m[1])return void this.clear();const b=v.buffers.active.ydisp,C=l[1]-b,f=m[1]-b,p=Math.max(C,0),d=Math.min(f,v.rows-1);p>=v.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=C,this.viewportEndRow=f,this.viewportCappedStartRow=p,this.viewportCappedEndRow=d,this.startCol=l[0],this.endCol=m[0])}isCellSelected(v,l,m){return!!this.hasSelection&&(m-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&m>=this.viewportCappedStartRow&&l<this.endCol&&m<=this.viewportCappedEndRow:l<this.startCol&&m>=this.viewportCappedStartRow&&l>=this.endCol&&m<=this.viewportCappedEndRow:m>this.viewportStartRow&&m<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&m===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportStartRow&&l>=this.startCol)}}a.createSelectionRenderModel=function(){return new c}},456:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(c){this._bufferService=c,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 c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,_=this.selectionEnd;return!(!c||!_)&&(c[1]>_[1]||c[1]===_[1]&&c[0]>_[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(y,a,c){var _=this&&this.__decorate||function(d,h,w,L){var R,D=arguments.length,k=D<3?h:L===null?L=Object.getOwnPropertyDescriptor(h,w):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,h,w,L);else for(var M=d.length-1;M>=0;M--)(R=d[M])&&(k=(D<3?R(k):D>3?R(h,w,k):R(h,w))||k);return D>3&&k&&Object.defineProperty(h,w,k),k},v=this&&this.__param||function(d,h){return function(w,L){h(w,L,d)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const l=c(2585),m=c(8460),x=c(844);let b=a.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(d,h,w){super(),this._optionsService=w,this.width=0,this.height=0,this._onCharSizeChange=this.register(new m.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new p(this._optionsService))}catch{this._measureStrategy=this.register(new f(d,h,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())}};a.CharSizeService=b=_([v(2,l.IOptionsService)],b);class C extends x.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(h,w){h!==void 0&&h>0&&w!==void 0&&w>0&&(this._result.width=h,this._result.height=w)}}class f extends C{constructor(h,w,L){super(),this._document=h,this._parentElement=w,this._optionsService=L,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 p extends C{constructor(h){super(),this._optionsService=h,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const w=this._ctx.measureText("W");if(!("width"in w&&"fontBoundingBoxAscent"in w&&"fontBoundingBoxDescent"in w))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const h=this._ctx.measureText("W");return this._validateAndSet(h.width,h.fontBoundingBoxAscent+h.fontBoundingBoxDescent),this._result}}},4269:function(y,a,c){var _=this&&this.__decorate||function(p,d,h,w){var L,R=arguments.length,D=R<3?d:w===null?w=Object.getOwnPropertyDescriptor(d,h):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(p,d,h,w);else for(var k=p.length-1;k>=0;k--)(L=p[k])&&(D=(R<3?L(D):R>3?L(d,h,D):L(d,h))||D);return R>3&&D&&Object.defineProperty(d,h,D),D},v=this&&this.__param||function(p,d){return function(h,w){d(h,w,p)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const l=c(3734),m=c(643),x=c(511),b=c(2585);class C extends l.AttributeData{constructor(d,h,w){super(),this.content=0,this.combinedData="",this.fg=d.fg,this.bg=d.bg,this.combinedData=h,this._width=w}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()]}}a.JoinedCellData=C;let f=a.CharacterJoinerService=class Zg{constructor(d){this._bufferService=d,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(d){const h={id:this._nextCharacterJoinerId++,handler:d};return this._characterJoiners.push(h),h.id}deregister(d){for(let h=0;h<this._characterJoiners.length;h++)if(this._characterJoiners[h].id===d)return this._characterJoiners.splice(h,1),!0;return!1}getJoinedCharacters(d){if(this._characterJoiners.length===0)return[];const h=this._bufferService.buffer.lines.get(d);if(!h||h.length===0)return[];const w=[],L=h.translateToString(!0);let R=0,D=0,k=0,M=h.getFg(0),W=h.getBg(0);for(let z=0;z<h.getTrimmedLength();z++)if(h.loadCell(z,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==M||this._workCell.bg!==W){if(z-R>1){const F=this._getJoinedRanges(L,k,D,h,R);for(let N=0;N<F.length;N++)w.push(F[N])}R=z,k=D,M=this._workCell.fg,W=this._workCell.bg}D+=this._workCell.getChars().length||m.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const z=this._getJoinedRanges(L,k,D,h,R);for(let F=0;F<z.length;F++)w.push(z[F])}return w}_getJoinedRanges(d,h,w,L,R){const D=d.substring(h,w);let k=[];try{k=this._characterJoiners[0].handler(D)}catch(M){console.error(M)}for(let M=1;M<this._characterJoiners.length;M++)try{const W=this._characterJoiners[M].handler(D);for(let z=0;z<W.length;z++)Zg._mergeRanges(k,W[z])}catch(W){console.error(W)}return this._stringRangesToCellRanges(k,L,R),k}_stringRangesToCellRanges(d,h,w){let L=0,R=!1,D=0,k=d[L];if(k){for(let M=w;M<this._bufferService.cols;M++){const W=h.getWidth(M),z=h.getString(M).length||m.WHITESPACE_CELL_CHAR.length;if(W!==0){if(!R&&k[0]<=D&&(k[0]=M,R=!0),k[1]<=D){if(k[1]=M,k=d[++L],!k)break;k[0]<=D?(k[0]=M,R=!0):R=!1}D+=z}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(d,h){let w=!1;for(let L=0;L<d.length;L++){const R=d[L];if(w){if(h[1]<=R[0])return d[L-1][1]=h[1],d;if(h[1]<=R[1])return d[L-1][1]=Math.max(h[1],R[1]),d.splice(L,1),d;d.splice(L,1),L--}else{if(h[1]<=R[0])return d.splice(L,0,h),d;if(h[1]<=R[1])return R[0]=Math.min(h[0],R[0]),d;h[0]<R[1]&&(R[0]=Math.min(h[0],R[0]),w=!0)}}return w?d[d.length-1][1]=h[1]:d.push(h),d}};a.CharacterJoinerService=f=_([v(0,b.IBufferService)],f)},5114:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const _=c(844),v=c(8460),l=c(3656);class m extends _.Disposable{constructor(C,f,p){super(),this._textarea=C,this._window=f,this.mainDocument=p,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(this._window),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new v.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((d=>this._screenDprMonitor.setWindow(d)))),this.register((0,v.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(C){this._window!==C&&(this._window=C,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}}a.CoreBrowserService=m;class x extends _.Disposable{constructor(C){super(),this._parentWindow=C,this._windowResizeListener=this.register(new _.MutableDisposable),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,_.toDisposable)((()=>this.clearListener())))}setWindow(C){this._parentWindow=C,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,l.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var C;this._outerListener&&((C=this._resolutionMediaMatchList)==null||C.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:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const _=c(844);class v extends _.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,_.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(m){return this.linkProviders.push(m),{dispose:()=>{const x=this.linkProviders.indexOf(m);x!==-1&&this.linkProviders.splice(x,1)}}}}a.LinkProviderService=v},8934:function(y,a,c){var _=this&&this.__decorate||function(b,C,f,p){var d,h=arguments.length,w=h<3?C:p===null?p=Object.getOwnPropertyDescriptor(C,f):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(b,C,f,p);else for(var L=b.length-1;L>=0;L--)(d=b[L])&&(w=(h<3?d(w):h>3?d(C,f,w):d(C,f))||w);return h>3&&w&&Object.defineProperty(C,f,w),w},v=this&&this.__param||function(b,C){return function(f,p){C(f,p,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const l=c(4725),m=c(9806);let x=a.MouseService=class{constructor(b,C){this._renderService=b,this._charSizeService=C}getCoords(b,C,f,p,d){return(0,m.getCoords)(window,b,C,f,p,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,d)}getMouseReportCoords(b,C){const f=(0,m.getCoordsRelativeToElement)(window,b,C);if(this._charSizeService.hasValidSize)return f[0]=Math.min(Math.max(f[0],0),this._renderService.dimensions.css.canvas.width-1),f[1]=Math.min(Math.max(f[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(f[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(f[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(f[0]),y:Math.floor(f[1])}}};a.MouseService=x=_([v(0,l.IRenderService),v(1,l.ICharSizeService)],x)},3230:function(y,a,c){var _=this&&this.__decorate||function(d,h,w,L){var R,D=arguments.length,k=D<3?h:L===null?L=Object.getOwnPropertyDescriptor(h,w):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,h,w,L);else for(var M=d.length-1;M>=0;M--)(R=d[M])&&(k=(D<3?R(k):D>3?R(h,w,k):R(h,w))||k);return D>3&&k&&Object.defineProperty(h,w,k),k},v=this&&this.__param||function(d,h){return function(w,L){h(w,L,d)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const l=c(6193),m=c(4725),x=c(8460),b=c(844),C=c(7226),f=c(2585);let p=a.RenderService=class extends b.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(d,h,w,L,R,D,k,M){super(),this._rowCount=d,this._charSizeService=L,this._renderer=this.register(new b.MutableDisposable),this._pausedResizeTask=new C.DebouncedIdleTask,this._observerDisposable=this.register(new b.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new l.RenderDebouncer(((W,z)=>this._renderRows(W,z)),k),this.register(this._renderDebouncer),this.register(k.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>{var W;return(W=this._renderer.value)==null?void 0:W.clear()}))),this.register(w.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(w.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(w.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(k.window,h),this.register(k.onWindowChange((W=>this._registerIntersectionObserver(W,h))))}_registerIntersectionObserver(d,h){if("IntersectionObserver"in d){const w=new d.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});w.observe(h),this._observerDisposable.value=(0,b.toDisposable)((()=>w.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,h,w=!1){this._isPaused?this._needsFullRefresh=!0:(w||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(d,h,this._rowCount))}_renderRows(d,h){this._renderer.value&&(d=Math.min(d,this._rowCount-1),h=Math.min(h,this._rowCount-1),this._renderer.value.renderRows(d,h),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:h}),this._onRender.fire({start:d,end:h}),this._isNextRenderRedrawOnly=!0)}resize(d,h){this._rowCount=h,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((h=>this.refreshRows(h.start,h.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,h;this._renderer.value&&((h=(d=this._renderer.value).clearTextureAtlas)==null||h.call(d),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(d,h){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var w;return(w=this._renderer.value)==null?void 0:w.handleResize(d,h)})):this._renderer.value.handleResize(d,h),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,h,w){var L;this._selectionState.start=d,this._selectionState.end=h,this._selectionState.columnSelectMode=w,(L=this._renderer.value)==null||L.handleSelectionChanged(d,h,w)}handleCursorMove(){var d;(d=this._renderer.value)==null||d.handleCursorMove()}clear(){var d;(d=this._renderer.value)==null||d.clear()}};a.RenderService=p=_([v(2,f.IOptionsService),v(3,m.ICharSizeService),v(4,f.IDecorationService),v(5,f.IBufferService),v(6,m.ICoreBrowserService),v(7,m.IThemeService)],p)},9312:function(y,a,c){var _=this&&this.__decorate||function(k,M,W,z){var F,N=arguments.length,I=N<3?M:z===null?z=Object.getOwnPropertyDescriptor(M,W):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(k,M,W,z);else for(var q=k.length-1;q>=0;q--)(F=k[q])&&(I=(N<3?F(I):N>3?F(M,W,I):F(M,W))||I);return N>3&&I&&Object.defineProperty(M,W,I),I},v=this&&this.__param||function(k,M){return function(W,z){M(W,z,k)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const l=c(9806),m=c(9504),x=c(456),b=c(4725),C=c(8460),f=c(844),p=c(6114),d=c(4841),h=c(511),w=c(2585),L=" ",R=new RegExp(L,"g");let D=a.SelectionService=class extends f.Disposable{constructor(k,M,W,z,F,N,I,q,V){super(),this._element=k,this._screenElement=M,this._linkifier=W,this._bufferService=z,this._coreService=F,this._mouseService=N,this._optionsService=I,this._renderService=q,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new h.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new C.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new C.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new C.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=K=>this._handleMouseMove(K),this._mouseUpListener=K=>this._handleMouseUp(K),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((K=>this._handleTrim(K))),this.register(this._bufferService.buffers.onBufferActivate((K=>this._handleBufferActivate(K)))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,f.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 k=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!k||!M||k[0]===M[0]&&k[1]===M[1])}get selectionText(){const k=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!k||!M)return"";const W=this._bufferService.buffer,z=[];if(this._activeSelectionMode===3){if(k[0]===M[0])return"";const F=k[0]<M[0]?k[0]:M[0],N=k[0]<M[0]?M[0]:k[0];for(let I=k[1];I<=M[1];I++){const q=W.translateBufferLineToString(I,!0,F,N);z.push(q)}}else{const F=k[1]===M[1]?M[0]:void 0;z.push(W.translateBufferLineToString(k[1],!0,k[0],F));for(let N=k[1]+1;N<=M[1]-1;N++){const I=W.lines.get(N),q=W.translateBufferLineToString(N,!0);I!=null&&I.isWrapped?z[z.length-1]+=q:z.push(q)}if(k[1]!==M[1]){const N=W.lines.get(M[1]),I=W.translateBufferLineToString(M[1],!0,0,M[0]);N&&N.isWrapped?z[z.length-1]+=I:z.push(I)}}return z.map((F=>F.replace(R," "))).join(p.isWindows?`\r
|
|
67
|
+
`:`
|
|
68
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(k){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),p.isLinux&&k&&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(k){const M=this._getMouseBufferCoords(k),W=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!!(W&&z&&M)&&this._areCoordsInSelection(M,W,z)}isCellInSelection(k,M){const W=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!(!W||!z)&&this._areCoordsInSelection([k,M],W,z)}_areCoordsInSelection(k,M,W){return k[1]>M[1]&&k[1]<W[1]||M[1]===W[1]&&k[1]===M[1]&&k[0]>=M[0]&&k[0]<W[0]||M[1]<W[1]&&k[1]===W[1]&&k[0]<W[0]||M[1]<W[1]&&k[1]===M[1]&&k[0]>=M[0]}_selectWordAtCursor(k,M){var F,N;const W=(N=(F=this._linkifier.currentLink)==null?void 0:F.link)==null?void 0:N.range;if(W)return this._model.selectionStart=[W.start.x-1,W.start.y-1],this._model.selectionStartLength=(0,d.getRangeLength)(W,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const z=this._getMouseBufferCoords(k);return!!z&&(this._selectWordAt(z,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(k,M){this._model.clearSelection(),k=Math.max(k,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,k],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(k){this._model.handleTrim(k)&&this.refresh()}_getMouseBufferCoords(k){const M=this._mouseService.getCoords(k,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(k){let M=(0,l.getCoordsRelativeToElement)(this._coreBrowserService.window,k,this._screenElement)[1];const W=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=W?0:(M>W&&(M-=W),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(k){return p.isMac?k.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:k.shiftKey}handleMouseDown(k){if(this._mouseDownTimeStamp=k.timeStamp,(k.button!==2||!this.hasSelection)&&k.button===0){if(!this._enabled){if(!this.shouldForceSelection(k))return;k.stopPropagation()}k.preventDefault(),this._dragScrollAmount=0,this._enabled&&k.shiftKey?this._handleIncrementalClick(k):k.detail===1?this._handleSingleClick(k):k.detail===2?this._handleDoubleClick(k):k.detail===3&&this._handleTripleClick(k),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(k){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(k))}_handleSingleClick(k){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(k)?3:0,this._model.selectionStart=this._getMouseBufferCoords(k),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(k){this._selectWordAtCursor(k,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(k){const M=this._getMouseBufferCoords(k);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(k){return k.altKey&&!(p.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(k){if(k.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(k),!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(k),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const W=this._bufferService.buffer;if(this._model.selectionEnd[1]<W.lines.length){const z=W.lines.get(this._model.selectionEnd[1]);z&&z.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}M&&M[0]===this._model.selectionEnd[0]&&M[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 k=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(k.ydisp+this._bufferService.rows,k.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=k.ydisp),this.refresh()}}_handleMouseUp(k){const M=k.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&k.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const W=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(W&&W[0]!==void 0&&W[1]!==void 0){const z=(0,m.moveToCellSequence)(W[0]-1,W[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(z,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const k=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,W=!(!k||!M||k[0]===M[0]&&k[1]===M[1]);W?k&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&k[0]===this._oldSelectionStart[0]&&k[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(k,M,W)):this._oldHasSelection&&this._fireOnSelectionChange(k,M,W)}_fireOnSelectionChange(k,M,W){this._oldSelectionStart=k,this._oldSelectionEnd=M,this._oldHasSelection=W,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(k,M){let W=M;for(let z=0;M>=z;z++){const F=k.loadCell(z,this._workCell).getChars().length;this._workCell.getWidth()===0?W--:F>1&&M!==z&&(W+=F-1)}return W}setSelection(k,M,W){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,M],this._model.selectionStartLength=W,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,M,W=!0,z=!0){if(k[0]>=this._bufferService.cols)return;const F=this._bufferService.buffer,N=F.lines.get(k[1]);if(!N)return;const I=F.translateBufferLineToString(k[1],!1);let q=this._convertViewportColToCharacterIndex(N,k[0]),V=q;const K=k[0]-q;let U=0,A=0,B=0,P=0;if(I.charAt(q)===" "){for(;q>0&&I.charAt(q-1)===" ";)q--;for(;V<I.length&&I.charAt(V+1)===" ";)V++}else{let Z=k[0],se=k[0];N.getWidth(Z)===0&&(U++,Z--),N.getWidth(se)===2&&(A++,se++);const ee=N.getString(se).length;for(ee>1&&(P+=ee-1,V+=ee-1);Z>0&&q>0&&!this._isCharWordSeparator(N.loadCell(Z-1,this._workCell));){N.loadCell(Z-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(U++,Z--):X>1&&(B+=X-1,q-=X-1),q--,Z--}for(;se<N.length&&V+1<I.length&&!this._isCharWordSeparator(N.loadCell(se+1,this._workCell));){N.loadCell(se+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(A++,se++):X>1&&(P+=X-1,V+=X-1),V++,se++}}V++;let H=q+K-U+B,G=Math.min(this._bufferService.cols,V-q+U+A-B-P);if(M||I.slice(q,V).trim()!==""){if(W&&H===0&&N.getCodePoint(0)!==32){const Z=F.lines.get(k[1]-1);if(Z&&N.isWrapped&&Z.getCodePoint(this._bufferService.cols-1)!==32){const se=this._getWordAt([this._bufferService.cols-1,k[1]-1],!1,!0,!1);if(se){const ee=this._bufferService.cols-se.start;H-=ee,G+=ee}}}if(z&&H+G===this._bufferService.cols&&N.getCodePoint(this._bufferService.cols-1)!==32){const Z=F.lines.get(k[1]+1);if(Z!=null&&Z.isWrapped&&Z.getCodePoint(0)!==32){const se=this._getWordAt([0,k[1]+1],!1,!1,!0);se&&(G+=se.length)}}return{start:H,length:G}}}_selectWordAt(k,M){const W=this._getWordAt(k,M);if(W){for(;W.start<0;)W.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[W.start,k[1]],this._model.selectionStartLength=W.length}}_selectToWordAt(k){const M=this._getWordAt(k,!0);if(M){let W=k[1];for(;M.start<0;)M.start+=this._bufferService.cols,W--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,W++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,W]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const M=this._bufferService.buffer.getWrappedRangeForLine(k),W={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,d.getRangeLength)(W,this._bufferService.cols)}};a.SelectionService=D=_([v(3,w.IBufferService),v(4,w.ICoreService),v(5,b.IMouseService),v(6,w.IOptionsService),v(7,b.IRenderService),v(8,b.ICoreBrowserService)],D)},4725:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const _=c(8343);a.ICharSizeService=(0,_.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,_.createDecorator)("CoreBrowserService"),a.IMouseService=(0,_.createDecorator)("MouseService"),a.IRenderService=(0,_.createDecorator)("RenderService"),a.ISelectionService=(0,_.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,_.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,_.createDecorator)("ThemeService"),a.ILinkProviderService=(0,_.createDecorator)("LinkProviderService")},6731:function(y,a,c){var _=this&&this.__decorate||function(D,k,M,W){var z,F=arguments.length,N=F<3?k:W===null?W=Object.getOwnPropertyDescriptor(k,M):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(D,k,M,W);else for(var I=D.length-1;I>=0;I--)(z=D[I])&&(N=(F<3?z(N):F>3?z(k,M,N):z(k,M))||N);return F>3&&N&&Object.defineProperty(k,M,N),N},v=this&&this.__param||function(D,k){return function(M,W){k(M,W,D)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const l=c(7239),m=c(8055),x=c(8460),b=c(844),C=c(2585),f=m.css.toColor("#ffffff"),p=m.css.toColor("#000000"),d=m.css.toColor("#ffffff"),h=m.css.toColor("#000000"),w={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[m.css.toColor("#2e3436"),m.css.toColor("#cc0000"),m.css.toColor("#4e9a06"),m.css.toColor("#c4a000"),m.css.toColor("#3465a4"),m.css.toColor("#75507b"),m.css.toColor("#06989a"),m.css.toColor("#d3d7cf"),m.css.toColor("#555753"),m.css.toColor("#ef2929"),m.css.toColor("#8ae234"),m.css.toColor("#fce94f"),m.css.toColor("#729fcf"),m.css.toColor("#ad7fa8"),m.css.toColor("#34e2e2"),m.css.toColor("#eeeeec")],k=[0,95,135,175,215,255];for(let M=0;M<216;M++){const W=k[M/36%6|0],z=k[M/6%6|0],F=k[M%6];D.push({css:m.channels.toCss(W,z,F),rgba:m.channels.toRgba(W,z,F)})}for(let M=0;M<24;M++){const W=8+10*M;D.push({css:m.channels.toCss(W,W,W),rgba:m.channels.toRgba(W,W,W)})}return D})());let L=a.ThemeService=class extends b.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new l.ColorContrastCache,this._halfContrastCache=new l.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:f,background:p,cursor:d,cursorAccent:h,selectionForeground:void 0,selectionBackgroundTransparent:w,selectionBackgroundOpaque:m.color.blend(p,w),selectionInactiveBackgroundTransparent:w,selectionInactiveBackgroundOpaque:m.color.blend(p,w),ansi:a.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const k=this._colors;if(k.foreground=R(D.foreground,f),k.background=R(D.background,p),k.cursor=R(D.cursor,d),k.cursorAccent=R(D.cursorAccent,h),k.selectionBackgroundTransparent=R(D.selectionBackground,w),k.selectionBackgroundOpaque=m.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=R(D.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=m.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=D.selectionForeground?R(D.selectionForeground,m.NULL_COLOR):void 0,k.selectionForeground===m.NULL_COLOR&&(k.selectionForeground=void 0),m.color.isOpaque(k.selectionBackgroundTransparent)&&(k.selectionBackgroundTransparent=m.color.opacity(k.selectionBackgroundTransparent,.3)),m.color.isOpaque(k.selectionInactiveBackgroundTransparent)&&(k.selectionInactiveBackgroundTransparent=m.color.opacity(k.selectionInactiveBackgroundTransparent,.3)),k.ansi=a.DEFAULT_ANSI_COLORS.slice(),k.ansi[0]=R(D.black,a.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=R(D.red,a.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=R(D.green,a.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=R(D.yellow,a.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=R(D.blue,a.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=R(D.magenta,a.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=R(D.cyan,a.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=R(D.white,a.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=R(D.brightBlack,a.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=R(D.brightRed,a.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=R(D.brightGreen,a.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=R(D.brightYellow,a.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=R(D.brightBlue,a.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=R(D.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=R(D.brightCyan,a.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=R(D.brightWhite,a.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const M=Math.min(k.ansi.length-16,D.extendedAnsi.length);for(let W=0;W<M;W++)k.ansi[W+16]=R(D.extendedAnsi[W],a.DEFAULT_ANSI_COLORS[W+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[D]=this._restoreColors.ansi[D]}else for(let k=0;k<this._restoreColors.ansi.length;++k)this._colors.ansi[k]=this._restoreColors.ansi[k]}modifyColors(D){D(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function R(D,k){if(D!==void 0)try{return m.css.toColor(D)}catch{}return k}a.ThemeService=L=_([v(0,C.IOptionsService)],L)},6349:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const _=c(8460),v=c(844);class l extends v.Disposable{constructor(x){super(),this._maxLength=x,this.onDeleteEmitter=this.register(new _.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new _.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new _.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(x){if(this._maxLength===x)return;const b=new Array(x);for(let C=0;C<Math.min(x,this.length);C++)b[C]=this._array[this._getCyclicIndex(C)];this._array=b,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let b=this._length;b<x;b++)this._array[b]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,b){this._array[this._getCyclicIndex(x)]=b}push(x){this._array[this._getCyclicIndex(this._length)]=x,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(x,b,...C){if(b){for(let f=x;f<this._length-b;f++)this._array[this._getCyclicIndex(f)]=this._array[this._getCyclicIndex(f+b)];this._length-=b,this.onDeleteEmitter.fire({index:x,amount:b})}for(let f=this._length-1;f>=x;f--)this._array[this._getCyclicIndex(f+C.length)]=this._array[this._getCyclicIndex(f)];for(let f=0;f<C.length;f++)this._array[this._getCyclicIndex(x+f)]=C[f];if(C.length&&this.onInsertEmitter.fire({index:x,amount:C.length}),this._length+C.length>this._maxLength){const f=this._length+C.length-this._maxLength;this._startIndex+=f,this._length=this._maxLength,this.onTrimEmitter.fire(f)}else this._length+=C.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,b,C){if(!(b<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+C<0)throw new Error("Cannot shift elements in list beyond index 0");if(C>0){for(let p=b-1;p>=0;p--)this.set(x+p+C,this.get(x+p));const f=x+b+C-this._length;if(f>0)for(this._length+=f;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let f=0;f<b;f++)this.set(x+f+C,this.get(x+f))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}a.CircularList=l},1439:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function c(_,v=5){if(typeof _!="object")return _;const l=Array.isArray(_)?[]:{};for(const m in _)l[m]=v<=1?_[m]:_[m]&&c(_[m],v-1);return l}},8055:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let c=0,_=0,v=0,l=0;var m,x,b,C,f;function p(h){const w=h.toString(16);return w.length<2?"0"+w:w}function d(h,w){return h<w?(w+.05)/(h+.05):(h+.05)/(w+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(h){h.toCss=function(w,L,R,D){return D!==void 0?`#${p(w)}${p(L)}${p(R)}${p(D)}`:`#${p(w)}${p(L)}${p(R)}`},h.toRgba=function(w,L,R,D=255){return(w<<24|L<<16|R<<8|D)>>>0},h.toColor=function(w,L,R,D){return{css:h.toCss(w,L,R,D),rgba:h.toRgba(w,L,R,D)}}})(m||(a.channels=m={})),(function(h){function w(L,R){return l=Math.round(255*R),[c,_,v]=f.toChannels(L.rgba),{css:m.toCss(c,_,v,l),rgba:m.toRgba(c,_,v,l)}}h.blend=function(L,R){if(l=(255&R.rgba)/255,l===1)return{css:R.css,rgba:R.rgba};const D=R.rgba>>24&255,k=R.rgba>>16&255,M=R.rgba>>8&255,W=L.rgba>>24&255,z=L.rgba>>16&255,F=L.rgba>>8&255;return c=W+Math.round((D-W)*l),_=z+Math.round((k-z)*l),v=F+Math.round((M-F)*l),{css:m.toCss(c,_,v),rgba:m.toRgba(c,_,v)}},h.isOpaque=function(L){return(255&L.rgba)==255},h.ensureContrastRatio=function(L,R,D){const k=f.ensureContrastRatio(L.rgba,R.rgba,D);if(k)return m.toColor(k>>24&255,k>>16&255,k>>8&255)},h.opaque=function(L){const R=(255|L.rgba)>>>0;return[c,_,v]=f.toChannels(R),{css:m.toCss(c,_,v),rgba:R}},h.opacity=w,h.multiplyOpacity=function(L,R){return l=255&L.rgba,w(L,l*R/255)},h.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(x||(a.color=x={})),(function(h){let w,L;try{const R=document.createElement("canvas");R.width=1,R.height=1;const D=R.getContext("2d",{willReadFrequently:!0});D&&(w=D,w.globalCompositeOperation="copy",L=w.createLinearGradient(0,0,1,1))}catch{}h.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return c=parseInt(R.slice(1,2).repeat(2),16),_=parseInt(R.slice(2,3).repeat(2),16),v=parseInt(R.slice(3,4).repeat(2),16),m.toColor(c,_,v);case 5:return c=parseInt(R.slice(1,2).repeat(2),16),_=parseInt(R.slice(2,3).repeat(2),16),v=parseInt(R.slice(3,4).repeat(2),16),l=parseInt(R.slice(4,5).repeat(2),16),m.toColor(c,_,v,l);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const D=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return c=parseInt(D[1]),_=parseInt(D[2]),v=parseInt(D[3]),l=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),m.toColor(c,_,v,l);if(!w||!L)throw new Error("css.toColor: Unsupported css format");if(w.fillStyle=L,w.fillStyle=R,typeof w.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(w.fillRect(0,0,1,1),[c,_,v,l]=w.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:m.toRgba(c,_,v,l),css:R}}})(b||(a.css=b={})),(function(h){function w(L,R,D){const k=L/255,M=R/255,W=D/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(W<=.03928?W/12.92:Math.pow((W+.055)/1.055,2.4))}h.relativeLuminance=function(L){return w(L>>16&255,L>>8&255,255&L)},h.relativeLuminance2=w})(C||(a.rgb=C={})),(function(h){function w(R,D,k){const M=R>>24&255,W=R>>16&255,z=R>>8&255;let F=D>>24&255,N=D>>16&255,I=D>>8&255,q=d(C.relativeLuminance2(F,N,I),C.relativeLuminance2(M,W,z));for(;q<k&&(F>0||N>0||I>0);)F-=Math.max(0,Math.ceil(.1*F)),N-=Math.max(0,Math.ceil(.1*N)),I-=Math.max(0,Math.ceil(.1*I)),q=d(C.relativeLuminance2(F,N,I),C.relativeLuminance2(M,W,z));return(F<<24|N<<16|I<<8|255)>>>0}function L(R,D,k){const M=R>>24&255,W=R>>16&255,z=R>>8&255;let F=D>>24&255,N=D>>16&255,I=D>>8&255,q=d(C.relativeLuminance2(F,N,I),C.relativeLuminance2(M,W,z));for(;q<k&&(F<255||N<255||I<255);)F=Math.min(255,F+Math.ceil(.1*(255-F))),N=Math.min(255,N+Math.ceil(.1*(255-N))),I=Math.min(255,I+Math.ceil(.1*(255-I))),q=d(C.relativeLuminance2(F,N,I),C.relativeLuminance2(M,W,z));return(F<<24|N<<16|I<<8|255)>>>0}h.blend=function(R,D){if(l=(255&D)/255,l===1)return D;const k=D>>24&255,M=D>>16&255,W=D>>8&255,z=R>>24&255,F=R>>16&255,N=R>>8&255;return c=z+Math.round((k-z)*l),_=F+Math.round((M-F)*l),v=N+Math.round((W-N)*l),m.toRgba(c,_,v)},h.ensureContrastRatio=function(R,D,k){const M=C.relativeLuminance(R>>8),W=C.relativeLuminance(D>>8);if(d(M,W)<k){if(W<M){const N=w(R,D,k),I=d(M,C.relativeLuminance(N>>8));if(I<k){const q=L(R,D,k);return I>d(M,C.relativeLuminance(q>>8))?N:q}return N}const z=L(R,D,k),F=d(M,C.relativeLuminance(z>>8));if(F<k){const N=w(R,D,k);return F>d(M,C.relativeLuminance(N>>8))?z:N}return z}},h.reduceLuminance=w,h.increaseLuminance=L,h.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(f||(a.rgba=f={})),a.toPaddedHex=p,a.contrastRatio=d},8969:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const _=c(844),v=c(2585),l=c(4348),m=c(7866),x=c(744),b=c(7302),C=c(6975),f=c(8460),p=c(1753),d=c(1480),h=c(7994),w=c(9282),L=c(5435),R=c(5981),D=c(2660);let k=!1;class M extends _.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new f.EventEmitter),this._onScroll.event((z=>{var F;(F=this._onScrollApi)==null||F.fire(z.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(z){for(const F in z)this.optionsService.options[F]=z[F]}constructor(z){super(),this._windowsWrappingHeuristics=this.register(new _.MutableDisposable),this._onBinary=this.register(new f.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new f.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new f.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new f.EventEmitter),this._instantiationService=new l.InstantiationService,this.optionsService=this.register(new b.OptionsService(z)),this._instantiationService.setService(v.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(v.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(m.LogService)),this._instantiationService.setService(v.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(C.CoreService)),this._instantiationService.setService(v.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(p.CoreMouseService)),this._instantiationService.setService(v.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(d.UnicodeService)),this._instantiationService.setService(v.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(h.CharsetService),this._instantiationService.setService(v.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(v.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new L.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,f.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,f.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,f.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,f.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((F=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((F=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new R.WriteBuffer(((F,N)=>this._inputHandler.parse(F,N)))),this.register((0,f.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(z,F){this._writeBuffer.write(z,F)}writeSync(z,F){this._logService.logLevel<=v.LogLevelEnum.WARN&&!k&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k=!0),this._writeBuffer.writeSync(z,F)}input(z,F=!0){this.coreService.triggerDataEvent(z,F)}resize(z,F){isNaN(z)||isNaN(F)||(z=Math.max(z,x.MINIMUM_COLS),F=Math.max(F,x.MINIMUM_ROWS),this._bufferService.resize(z,F))}scroll(z,F=!1){this._bufferService.scroll(z,F)}scrollLines(z,F,N){this._bufferService.scrollLines(z,F,N)}scrollPages(z){this.scrollLines(z*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(z){const F=z-this._bufferService.buffer.ydisp;F!==0&&this.scrollLines(F)}registerEscHandler(z,F){return this._inputHandler.registerEscHandler(z,F)}registerDcsHandler(z,F){return this._inputHandler.registerDcsHandler(z,F)}registerCsiHandler(z,F){return this._inputHandler.registerCsiHandler(z,F)}registerOscHandler(z,F){return this._inputHandler.registerOscHandler(z,F)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let z=!1;const F=this.optionsService.rawOptions.windowsPty;F&&F.buildNumber!==void 0&&F.buildNumber!==void 0?z=F.backend==="conpty"&&F.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(z=!0),z?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const z=[];z.push(this.onLineFeed(w.updateWindowsModeWrappedState.bind(null,this._bufferService))),z.push(this.registerCsiHandler({final:"H"},(()=>((0,w.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,_.toDisposable)((()=>{for(const F of z)F.dispose()}))}}}a.CoreTerminal=M},8460:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let _=0;_<this._listeners.length;_++)if(this._listeners[_]===c)return void this._listeners.splice(_,1)}}})),this._event}fire(c,_){const v=[];for(let l=0;l<this._listeners.length;l++)v.push(this._listeners[l]);for(let l=0;l<v.length;l++)v[l].call(void 0,c,_)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(c,_){return c((v=>_.fire(v)))},a.runAndSubscribe=function(c,_){return _(void 0),c((v=>_(v)))}},5435:function(y,a,c){var _=this&&this.__decorate||function(U,A,B,P){var H,G=arguments.length,Z=G<3?A:P===null?P=Object.getOwnPropertyDescriptor(A,B):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(U,A,B,P);else for(var se=U.length-1;se>=0;se--)(H=U[se])&&(Z=(G<3?H(Z):G>3?H(A,B,Z):H(A,B))||Z);return G>3&&Z&&Object.defineProperty(A,B,Z),Z},v=this&&this.__param||function(U,A){return function(B,P){A(B,P,U)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const l=c(2584),m=c(7116),x=c(2015),b=c(844),C=c(482),f=c(8437),p=c(8460),d=c(643),h=c(511),w=c(3734),L=c(2585),R=c(1480),D=c(6242),k=c(6351),M=c(5941),W={"(":0,")":1,"*":2,"+":3,"-":1,".":2},z=131072;function F(U,A){if(U>24)return A.setWinLines||!1;switch(U){case 1:return!!A.restoreWin;case 2:return!!A.minimizeWin;case 3:return!!A.setWinPosition;case 4:return!!A.setWinSizePixels;case 5:return!!A.raiseWin;case 6:return!!A.lowerWin;case 7:return!!A.refreshWin;case 8:return!!A.setWinSizeChars;case 9:return!!A.maximizeWin;case 10:return!!A.fullscreenWin;case 11:return!!A.getWinState;case 13:return!!A.getWinPosition;case 14:return!!A.getWinSizePixels;case 15:return!!A.getScreenSizePixels;case 16:return!!A.getCellSizePixels;case 18:return!!A.getWinSizeChars;case 19:return!!A.getScreenSizeChars;case 20:return!!A.getIconTitle;case 21:return!!A.getWinTitle;case 22:return!!A.pushTitle;case 23:return!!A.popTitle;case 24:return!!A.setWinLines}return!1}var N;(function(U){U[U.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",U[U.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(N||(a.WindowsOptionsReportType=N={}));let I=0;class q extends b.Disposable{getAttrData(){return this._curAttrData}constructor(A,B,P,H,G,Z,se,ee,X=new x.EscapeSequenceParser){super(),this._bufferService=A,this._charsetService=B,this._coreService=P,this._logService=H,this._optionsService=G,this._oscLinkService=Z,this._coreMouseService=se,this._unicodeService=ee,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new C.StringToUtf32,this._utf8Decoder=new C.Utf8ToUtf32,this._workCell=new h.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new p.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new p.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new p.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new p.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new p.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new p.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new p.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new p.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new p.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new p.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new p.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 V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((O=>this._activeBuffer=O.activeBuffer))),this._parser.setCsiHandlerFallback(((O,re)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(O),params:re.toArray()})})),this._parser.setEscHandlerFallback((O=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(O)})})),this._parser.setExecuteHandlerFallback((O=>{this._logService.debug("Unknown EXECUTE code: ",{code:O})})),this._parser.setOscHandlerFallback(((O,re,ne)=>{this._logService.debug("Unknown OSC code: ",{identifier:O,action:re,data:ne})})),this._parser.setDcsHandlerFallback(((O,re,ne)=>{re==="HOOK"&&(ne=ne.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(O),action:re,payload:ne})})),this._parser.setPrintHandler(((O,re,ne)=>this.print(O,re,ne))),this._parser.registerCsiHandler({final:"@"},(O=>this.insertChars(O))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(O=>this.scrollLeft(O))),this._parser.registerCsiHandler({final:"A"},(O=>this.cursorUp(O))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(O=>this.scrollRight(O))),this._parser.registerCsiHandler({final:"B"},(O=>this.cursorDown(O))),this._parser.registerCsiHandler({final:"C"},(O=>this.cursorForward(O))),this._parser.registerCsiHandler({final:"D"},(O=>this.cursorBackward(O))),this._parser.registerCsiHandler({final:"E"},(O=>this.cursorNextLine(O))),this._parser.registerCsiHandler({final:"F"},(O=>this.cursorPrecedingLine(O))),this._parser.registerCsiHandler({final:"G"},(O=>this.cursorCharAbsolute(O))),this._parser.registerCsiHandler({final:"H"},(O=>this.cursorPosition(O))),this._parser.registerCsiHandler({final:"I"},(O=>this.cursorForwardTab(O))),this._parser.registerCsiHandler({final:"J"},(O=>this.eraseInDisplay(O,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(O=>this.eraseInDisplay(O,!0))),this._parser.registerCsiHandler({final:"K"},(O=>this.eraseInLine(O,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(O=>this.eraseInLine(O,!0))),this._parser.registerCsiHandler({final:"L"},(O=>this.insertLines(O))),this._parser.registerCsiHandler({final:"M"},(O=>this.deleteLines(O))),this._parser.registerCsiHandler({final:"P"},(O=>this.deleteChars(O))),this._parser.registerCsiHandler({final:"S"},(O=>this.scrollUp(O))),this._parser.registerCsiHandler({final:"T"},(O=>this.scrollDown(O))),this._parser.registerCsiHandler({final:"X"},(O=>this.eraseChars(O))),this._parser.registerCsiHandler({final:"Z"},(O=>this.cursorBackwardTab(O))),this._parser.registerCsiHandler({final:"`"},(O=>this.charPosAbsolute(O))),this._parser.registerCsiHandler({final:"a"},(O=>this.hPositionRelative(O))),this._parser.registerCsiHandler({final:"b"},(O=>this.repeatPrecedingCharacter(O))),this._parser.registerCsiHandler({final:"c"},(O=>this.sendDeviceAttributesPrimary(O))),this._parser.registerCsiHandler({prefix:">",final:"c"},(O=>this.sendDeviceAttributesSecondary(O))),this._parser.registerCsiHandler({final:"d"},(O=>this.linePosAbsolute(O))),this._parser.registerCsiHandler({final:"e"},(O=>this.vPositionRelative(O))),this._parser.registerCsiHandler({final:"f"},(O=>this.hVPosition(O))),this._parser.registerCsiHandler({final:"g"},(O=>this.tabClear(O))),this._parser.registerCsiHandler({final:"h"},(O=>this.setMode(O))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(O=>this.setModePrivate(O))),this._parser.registerCsiHandler({final:"l"},(O=>this.resetMode(O))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(O=>this.resetModePrivate(O))),this._parser.registerCsiHandler({final:"m"},(O=>this.charAttributes(O))),this._parser.registerCsiHandler({final:"n"},(O=>this.deviceStatus(O))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(O=>this.deviceStatusPrivate(O))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(O=>this.softReset(O))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(O=>this.setCursorStyle(O))),this._parser.registerCsiHandler({final:"r"},(O=>this.setScrollRegion(O))),this._parser.registerCsiHandler({final:"s"},(O=>this.saveCursor(O))),this._parser.registerCsiHandler({final:"t"},(O=>this.windowOptions(O))),this._parser.registerCsiHandler({final:"u"},(O=>this.restoreCursor(O))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(O=>this.insertColumns(O))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(O=>this.deleteColumns(O))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(O=>this.selectProtected(O))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(O=>this.requestMode(O,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(O=>this.requestMode(O,!1))),this._parser.setExecuteHandler(l.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(l.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(l.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(l.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(l.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(l.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(l.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(l.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(l.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((O=>(this.setTitle(O),this.setIconName(O),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((O=>this.setIconName(O)))),this._parser.registerOscHandler(2,new D.OscHandler((O=>this.setTitle(O)))),this._parser.registerOscHandler(4,new D.OscHandler((O=>this.setOrReportIndexedColor(O)))),this._parser.registerOscHandler(8,new D.OscHandler((O=>this.setHyperlink(O)))),this._parser.registerOscHandler(10,new D.OscHandler((O=>this.setOrReportFgColor(O)))),this._parser.registerOscHandler(11,new D.OscHandler((O=>this.setOrReportBgColor(O)))),this._parser.registerOscHandler(12,new D.OscHandler((O=>this.setOrReportCursorColor(O)))),this._parser.registerOscHandler(104,new D.OscHandler((O=>this.restoreIndexedColor(O)))),this._parser.registerOscHandler(110,new D.OscHandler((O=>this.restoreFgColor(O)))),this._parser.registerOscHandler(111,new D.OscHandler((O=>this.restoreBgColor(O)))),this._parser.registerOscHandler(112,new D.OscHandler((O=>this.restoreCursorColor(O)))),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 O in m.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:O},(()=>this.selectCharset("("+O))),this._parser.registerEscHandler({intermediates:")",final:O},(()=>this.selectCharset(")"+O))),this._parser.registerEscHandler({intermediates:"*",final:O},(()=>this.selectCharset("*"+O))),this._parser.registerEscHandler({intermediates:"+",final:O},(()=>this.selectCharset("+"+O))),this._parser.registerEscHandler({intermediates:"-",final:O},(()=>this.selectCharset("-"+O))),this._parser.registerEscHandler({intermediates:".",final:O},(()=>this.selectCharset("."+O))),this._parser.registerEscHandler({intermediates:"/",final:O},(()=>this.selectCharset("/"+O)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((O=>(this._logService.error("Parsing error: ",O),O))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new k.DcsHandler(((O,re)=>this.requestStatusString(O,re))))}_preserveStack(A,B,P,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=A,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=P,this._parseStack.position=H}_logSlowResolvingAsync(A){this._logService.logLevel<=L.LogLevelEnum.WARN&&Promise.race([A,new Promise(((B,P)=>setTimeout((()=>P("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(A,B){let P,H=this._activeBuffer.x,G=this._activeBuffer.y,Z=0;const se=this._parseStack.paused;if(se){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(P),P;H=this._parseStack.cursorStartX,G=this._parseStack.cursorStartY,this._parseStack.paused=!1,A.length>z&&(Z=this._parseStack.position+z)}if(this._logService.logLevel<=L.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof A=="string"?` "${A}"`:` "${Array.prototype.map.call(A,(O=>String.fromCharCode(O))).join("")}"`),typeof A=="string"?A.split("").map((O=>O.charCodeAt(0))):A),this._parseBuffer.length<A.length&&this._parseBuffer.length<z&&(this._parseBuffer=new Uint32Array(Math.min(A.length,z))),se||this._dirtyRowTracker.clearRange(),A.length>z)for(let O=Z;O<A.length;O+=z){const re=O+z<A.length?O+z:A.length,ne=typeof A=="string"?this._stringDecoder.decode(A.substring(O,re),this._parseBuffer):this._utf8Decoder.decode(A.subarray(O,re),this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,ne))return this._preserveStack(H,G,ne,O),this._logSlowResolvingAsync(P),P}else if(!se){const O=typeof A=="string"?this._stringDecoder.decode(A,this._parseBuffer):this._utf8Decoder.decode(A,this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,O))return this._preserveStack(H,G,O,0),this._logSlowResolvingAsync(P),P}this._activeBuffer.x===H&&this._activeBuffer.y===G||this._onCursorMove.fire();const ee=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),X=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);X<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(X,this._bufferService.rows-1),Math.min(ee,this._bufferService.rows-1))}print(A,B,P){let H,G;const Z=this._charsetService.charset,se=this._optionsService.rawOptions.screenReaderMode,ee=this._bufferService.cols,X=this._coreService.decPrivateModes.wraparound,O=this._coreService.modes.insertMode,re=this._curAttrData;let ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&P-B>0&&ne.getWidth(this._activeBuffer.x-1)===2&&ne.setCellFromCodepoint(this._activeBuffer.x-1,0,1,re);let ce=this._parser.precedingJoinState;for(let le=B;le<P;++le){if(H=A[le],H<127&&Z){const xe=Z[String.fromCharCode(H)];xe&&(H=xe.charCodeAt(0))}const fe=this._unicodeService.charProperties(H,ce);G=R.UnicodeService.extractWidth(fe);const we=R.UnicodeService.extractShouldJoin(fe),ye=we?R.UnicodeService.extractWidth(ce):0;if(ce=fe,se&&this._onA11yChar.fire((0,C.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+G-ye>ee){if(X){const xe=ne;let ge=this._activeBuffer.x-ye;for(this._activeBuffer.x=ye,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),ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ye>0&&ne instanceof f.BufferLine&&ne.copyCellsFrom(xe,ge,0,ye,!1);ge<ee;)xe.setCellFromCodepoint(ge++,0,1,re)}else if(this._activeBuffer.x=ee-1,G===2)continue}if(we&&this._activeBuffer.x){const xe=ne.getWidth(this._activeBuffer.x-1)?1:2;ne.addCodepointToCell(this._activeBuffer.x-xe,H,G);for(let ge=G-ye;--ge>=0;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,re)}else if(O&&(ne.insertCells(this._activeBuffer.x,G-ye,this._activeBuffer.getNullCell(re)),ne.getWidth(ee-1)===2&&ne.setCellFromCodepoint(ee-1,d.NULL_CELL_CODE,d.NULL_CELL_WIDTH,re)),ne.setCellFromCodepoint(this._activeBuffer.x++,H,G,re),G>0)for(;--G;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,re)}this._parser.precedingJoinState=ce,this._activeBuffer.x<ee&&P-B>0&&ne.getWidth(this._activeBuffer.x)===0&&!ne.hasContent(this._activeBuffer.x)&&ne.setCellFromCodepoint(this._activeBuffer.x,0,1,re),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(A,B){return A.final!=="t"||A.prefix||A.intermediates?this._parser.registerCsiHandler(A,B):this._parser.registerCsiHandler(A,(P=>!F(P.params[0],this._optionsService.rawOptions.windowOptions)||B(P)))}registerDcsHandler(A,B){return this._parser.registerDcsHandler(A,new k.DcsHandler(B))}registerEscHandler(A,B){return this._parser.registerEscHandler(A,B)}registerOscHandler(A,B){return this._parser.registerOscHandler(A,new D.OscHandler(B))}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 A;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&&((A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&A.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const A=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-A),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(A=this._bufferService.cols-1){this._activeBuffer.x=Math.min(A,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(A,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=A,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=A,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(A,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+A,this._activeBuffer.y+B)}cursorUp(A){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,A.params[0]||1)):this._moveCursor(0,-(A.params[0]||1)),!0}cursorDown(A){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,A.params[0]||1)):this._moveCursor(0,A.params[0]||1),!0}cursorForward(A){return this._moveCursor(A.params[0]||1,0),!0}cursorBackward(A){return this._moveCursor(-(A.params[0]||1),0),!0}cursorNextLine(A){return this.cursorDown(A),this._activeBuffer.x=0,!0}cursorPrecedingLine(A){return this.cursorUp(A),this._activeBuffer.x=0,!0}cursorCharAbsolute(A){return this._setCursor((A.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(A){return this._setCursor(A.length>=2?(A.params[1]||1)-1:0,(A.params[0]||1)-1),!0}charPosAbsolute(A){return this._setCursor((A.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(A){return this._moveCursor(A.params[0]||1,0),!0}linePosAbsolute(A){return this._setCursor(this._activeBuffer.x,(A.params[0]||1)-1),!0}vPositionRelative(A){return this._moveCursor(0,A.params[0]||1),!0}hVPosition(A){return this.cursorPosition(A),!0}tabClear(A){const B=A.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=A.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=A.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(A){const B=A.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(A,B,P,H=!1,G=!1){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);Z.replaceCells(B,P,this._activeBuffer.getNullCell(this._eraseAttrData()),G),H&&(Z.isWrapped=!1)}_resetBufferLine(A,B=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+A),P.isWrapped=!1)}eraseInDisplay(A,B=!1){let P;switch(this._restrictCursor(this._bufferService.cols),A.params[0]){case 0:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);P<this._bufferService.rows;P++)this._resetBufferLine(P,B);this._dirtyRowTracker.markDirty(P);break;case 1:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P,0,this._activeBuffer.x+1,!0,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,B);this._dirtyRowTracker.markDirty(0);break;case 3:const H=this._activeBuffer.lines.length-this._bufferService.rows;H>0&&(this._activeBuffer.lines.trimStart(H),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-H,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-H,0),this._onScroll.fire(0))}return!0}eraseInLine(A,B=!1){switch(this._restrictCursor(this._bufferService.cols),A.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(A){this._restrictCursor();let B=A.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y,H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,G=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;B--;)this._activeBuffer.lines.splice(G-1,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(A){this._restrictCursor();let B=A.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y;let H;for(H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-H;B--;)this._activeBuffer.lines.splice(P,1),this._activeBuffer.lines.splice(H,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(A){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,A.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(A){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,A.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(A){let B=A.params[0]||1;for(;B--;)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(A){let B=A.params[0]||1;for(;B--;)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(f.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=A.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);H.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=A.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);H.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=A.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);H.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=A.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);H.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(A){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(A.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(A){const B=this._parser.precedingJoinState;if(!B)return!0;const P=A.params[0]||1,H=R.UnicodeService.extractWidth(B),G=this._activeBuffer.x-H,Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(G),se=new Uint32Array(Z.length*P);let ee=0;for(let O=0;O<Z.length;){const re=Z.codePointAt(O)||0;se[ee++]=re,O+=re>65535?2:1}let X=ee;for(let O=1;O<P;++O)se.copyWithin(X,0,ee),X+=ee;return this.print(se,0,X),!0}sendDeviceAttributesPrimary(A){return A.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(l.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(l.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(A){return A.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(l.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(l.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(A.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(l.C0.ESC+"[>83;40003;0c")),!0}_is(A){return(this._optionsService.rawOptions.termName+"").indexOf(A)===0}setMode(A){for(let B=0;B<A.length;B++)switch(A.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(A){for(let B=0;B<A.length;B++)switch(A.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),this._charsetService.setgCharset(1,m.DEFAULT_CHARSET),this._charsetService.setgCharset(2,m.DEFAULT_CHARSET),this._charsetService.setgCharset(3,m.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(A){for(let B=0;B<A.length;B++)switch(A.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(A){for(let B=0;B<A.length;B++)switch(A.params[B]){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(),A.params[B]===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(A,B){const P=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:G}=this._coreMouseService,Z=this._coreService,{buffers:se,cols:ee}=this._bufferService,{active:X,alt:O}=se,re=this._optionsService.rawOptions,ne=we=>we?1:2,ce=A.params[0];return le=ce,fe=B?ce===2?4:ce===4?ne(Z.modes.insertMode):ce===12?3:ce===20?ne(re.convertEol):0:ce===1?ne(P.applicationCursorKeys):ce===3?re.windowOptions.setWinLines?ee===80?2:ee===132?1:0:0:ce===6?ne(P.origin):ce===7?ne(P.wraparound):ce===8?3:ce===9?ne(H==="X10"):ce===12?ne(re.cursorBlink):ce===25?ne(!Z.isCursorHidden):ce===45?ne(P.reverseWraparound):ce===66?ne(P.applicationKeypad):ce===67?4:ce===1e3?ne(H==="VT200"):ce===1002?ne(H==="DRAG"):ce===1003?ne(H==="ANY"):ce===1004?ne(P.sendFocus):ce===1005?4:ce===1006?ne(G==="SGR"):ce===1015?4:ce===1016?ne(G==="SGR_PIXELS"):ce===1048?1:ce===47||ce===1047||ce===1049?ne(X===O):ce===2004?ne(P.bracketedPasteMode):0,Z.triggerDataEvent(`${l.C0.ESC}[${B?"":"?"}${le};${fe}$y`),!0;var le,fe}_updateAttrColor(A,B,P,H,G){return B===2?(A|=50331648,A&=-16777216,A|=w.AttributeData.fromColorRGB([P,H,G])):B===5&&(A&=-50331904,A|=33554432|255&P),A}_extractColor(A,B,P){const H=[0,0,-1,0,0,0];let G=0,Z=0;do{if(H[Z+G]=A.params[B+Z],A.hasSubParams(B+Z)){const se=A.getSubParams(B+Z);let ee=0;do H[1]===5&&(G=1),H[Z+ee+1+G]=se[ee];while(++ee<se.length&&ee+Z+1+G<H.length);break}if(H[1]===5&&Z+G>=2||H[1]===2&&Z+G>=5)break;H[1]&&(G=1)}while(++Z+B<A.length&&Z+G<H.length);for(let se=2;se<H.length;++se)H[se]===-1&&(H[se]=0);switch(H[0]){case 38:P.fg=this._updateAttrColor(P.fg,H[1],H[3],H[4],H[5]);break;case 48:P.bg=this._updateAttrColor(P.bg,H[1],H[3],H[4],H[5]);break;case 58:P.extended=P.extended.clone(),P.extended.underlineColor=this._updateAttrColor(P.extended.underlineColor,H[1],H[3],H[4],H[5])}return Z}_processUnderline(A,B){B.extended=B.extended.clone(),(!~A||A>5)&&(A=1),B.extended.underlineStyle=A,B.fg|=268435456,A===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(A){A.fg=f.DEFAULT_ATTR_DATA.fg,A.bg=f.DEFAULT_ATTR_DATA.bg,A.extended=A.extended.clone(),A.extended.underlineStyle=0,A.extended.underlineColor&=-67108864,A.updateExtended()}charAttributes(A){if(A.length===1&&A.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=A.length;let P;const H=this._curAttrData;for(let G=0;G<B;G++)P=A.params[G],P>=30&&P<=37?(H.fg&=-50331904,H.fg|=16777216|P-30):P>=40&&P<=47?(H.bg&=-50331904,H.bg|=16777216|P-40):P>=90&&P<=97?(H.fg&=-50331904,H.fg|=16777224|P-90):P>=100&&P<=107?(H.bg&=-50331904,H.bg|=16777224|P-100):P===0?this._processSGR0(H):P===1?H.fg|=134217728:P===3?H.bg|=67108864:P===4?(H.fg|=268435456,this._processUnderline(A.hasSubParams(G)?A.getSubParams(G)[0]:1,H)):P===5?H.fg|=536870912:P===7?H.fg|=67108864:P===8?H.fg|=1073741824:P===9?H.fg|=2147483648:P===2?H.bg|=134217728:P===21?this._processUnderline(2,H):P===22?(H.fg&=-134217729,H.bg&=-134217729):P===23?H.bg&=-67108865:P===24?(H.fg&=-268435457,this._processUnderline(0,H)):P===25?H.fg&=-536870913:P===27?H.fg&=-67108865:P===28?H.fg&=-1073741825:P===29?H.fg&=2147483647:P===39?(H.fg&=-67108864,H.fg|=16777215&f.DEFAULT_ATTR_DATA.fg):P===49?(H.bg&=-67108864,H.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?G+=this._extractColor(A,G,H):P===53?H.bg|=1073741824:P===55?H.bg&=-1073741825:P===59?(H.extended=H.extended.clone(),H.extended.underlineColor=-1,H.updateExtended()):P===100?(H.fg&=-67108864,H.fg|=16777215&f.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",P);return!0}deviceStatus(A){switch(A.params[0]){case 5:this._coreService.triggerDataEvent(`${l.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[${B};${P}R`)}return!0}deviceStatusPrivate(A){if(A.params[0]===6){const B=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[?${B};${P}R`)}return!0}softReset(A){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=f.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(A){const B=A.params[0]||1;switch(B){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 P=B%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(A){const B=A.params[0]||1;let P;return(A.length<2||(P=A.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(A){if(!F(A.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=A.length>1?A.params[1]:0;switch(A.params[0]){case 14:B!==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(`${l.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(A){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(A){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(A){return this._windowTitle=A,this._onTitleChange.fire(A),!0}setIconName(A){return this._iconName=A,!0}setOrReportIndexedColor(A){const B=[],P=A.split(";");for(;P.length>1;){const H=P.shift(),G=P.shift();if(/^\d+$/.exec(H)){const Z=parseInt(H);if(K(Z))if(G==="?")B.push({type:0,index:Z});else{const se=(0,M.parseColor)(G);se&&B.push({type:1,index:Z,color:se})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(A){const B=A.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(A,B){this._getCurrentLinkId()&&this._finishHyperlink();const P=A.split(":");let H;const G=P.findIndex((Z=>Z.startsWith("id=")));return G!==-1&&(H=P[G].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(A,B){const P=A.split(";");for(let H=0;H<P.length&&!(B>=this._specialColors.length);++H,++B)if(P[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const G=(0,M.parseColor)(P[H]);G&&this._onColor.fire([{type:1,index:this._specialColors[B],color:G}])}return!0}setOrReportFgColor(A){return this._setOrReportSpecialColor(A,0)}setOrReportBgColor(A){return this._setOrReportSpecialColor(A,1)}setOrReportCursorColor(A){return this._setOrReportSpecialColor(A,2)}restoreIndexedColor(A){if(!A)return this._onColor.fire([{type:2}]),!0;const B=[],P=A.split(";");for(let H=0;H<P.length;++H)if(/^\d+$/.exec(P[H])){const G=parseInt(P[H]);K(G)&&B.push({type:2,index:G})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(A){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(A){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(A){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,m.DEFAULT_CHARSET),!0}selectCharset(A){return A.length!==2?(this.selectDefaultCharset(),!0):(A[0]==="/"||this._charsetService.setgCharset(W[A[0]],m.CHARSETS[A[1]]||m.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 A=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,A,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=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(A){return this._charsetService.setgLevel(A),!0}screenAlignmentPattern(){const A=new h.CellData;A.content=4194373,A.fg=this._curAttrData.fg,A.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const P=this._activeBuffer.ybase+this._activeBuffer.y+B,H=this._activeBuffer.lines.get(P);H&&(H.fill(A),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(A,B){const P=this._bufferService.buffer,H=this._optionsService.rawOptions;return(G=>(this._coreService.triggerDataEvent(`${l.C0.ESC}${G}${l.C0.ESC}\\`),!0))(A==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:A==='"p'?'P1$r61;1"p':A==="r"?`P1$r${P.scrollTop+1};${P.scrollBottom+1}r`:A==="m"?"P1$r0m":A===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(A,B){this._dirtyRowTracker.markRangeDirty(A,B)}}a.InputHandler=q;let V=class{constructor(U){this._bufferService=U,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(U){U<this.start?this.start=U:U>this.end&&(this.end=U)}markRangeDirty(U,A){U>A&&(I=U,U=A,A=I),U<this.start&&(this.start=U),A>this.end&&(this.end=A)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function K(U){return 0<=U&&U<256}V=_([v(0,L.IBufferService)],V)},844:(y,a)=>{function c(_){for(const v of _)v.dispose();_.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const _ of this._disposables)_.dispose();this._disposables.length=0}register(_){return this._disposables.push(_),_}unregister(_){const v=this._disposables.indexOf(_);v!==-1&&this._disposables.splice(v,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(_){var v;this._isDisposed||_===this._value||((v=this._value)==null||v.dispose(),this._value=_)}clear(){this.value=void 0}dispose(){var _;this._isDisposed=!0,(_=this._value)==null||_.dispose(),this._value=void 0}},a.toDisposable=function(_){return{dispose:_}},a.disposeArray=c,a.getDisposeArrayDisposable=function(_){return{dispose:()=>c(_)}}},1505:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(v,l,m){this._data[v]||(this._data[v]={}),this._data[v][l]=m}get(v,l){return this._data[v]?this._data[v][l]:void 0}clear(){this._data={}}}a.TwoKeyMap=c,a.FourKeyMap=class{constructor(){this._data=new c}set(_,v,l,m,x){this._data.get(_,v)||this._data.set(_,v,new c),this._data.get(_,v).set(l,m,x)}get(_,v,l,m){var x;return(x=this._data.get(_,v))==null?void 0:x.get(l,m)}clear(){this._data.clear()}}},6114:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const c=a.isNode?"node":navigator.userAgent,_=a.isNode?"node":navigator.platform;a.isFirefox=c.includes("Firefox"),a.isLegacyEdge=c.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(c),a.getSafariVersion=function(){if(!a.isSafari)return 0;const v=c.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(_),a.isIpad=_==="iPad",a.isIphone=_==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(_),a.isLinux=_.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(c)},6106:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let c=0;a.SortedList=class{constructor(_){this._getKey=_,this._array=[]}clear(){this._array.length=0}insert(_){this._array.length!==0?(c=this._search(this._getKey(_)),this._array.splice(c,0,_)):this._array.push(_)}delete(_){if(this._array.length===0)return!1;const v=this._getKey(_);if(v===void 0||(c=this._search(v),c===-1)||this._getKey(this._array[c])!==v)return!1;do if(this._array[c]===_)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===v);return!1}*getKeyIterator(_){if(this._array.length!==0&&(c=this._search(_),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===_))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===_)}forEachByKey(_,v){if(this._array.length!==0&&(c=this._search(_),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===_))do v(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===_)}values(){return[...this._array].values()}_search(_){let v=0,l=this._array.length-1;for(;l>=v;){let m=v+l>>1;const x=this._getKey(this._array[m]);if(x>_)l=m-1;else{if(!(x<_)){for(;m>0&&this._getKey(this._array[m-1])===_;)m--;return m}v=m+1}}return v}}},7226:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const _=c(6114);class v{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(x){this._idleCallback=void 0;let b=0,C=0,f=x.timeRemaining(),p=0;for(;this._i<this._tasks.length;){if(b=Date.now(),this._tasks[this._i]()||this._i++,b=Math.max(1,Date.now()-b),C=Math.max(b,C),p=x.timeRemaining(),1.5*C>p)return f-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(f-b))}ms`),void this._start();f=p}this.clear()}}class l extends v{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const b=Date.now()+x;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}a.PriorityTaskQueue=l,a.IdleTaskQueue=!_.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:l,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},9282:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const _=c(643);a.updateWindowsModeWrappedState=function(v){const l=v.buffer.lines.get(v.buffer.ybase+v.buffer.y-1),m=l==null?void 0:l.get(v.cols-1),x=v.buffer.lines.get(v.buffer.ybase+v.buffer.y);x&&m&&(x.isWrapped=m[_.CHAR_DATA_CODE_INDEX]!==_.NULL_CELL_CODE&&m[_.CHAR_DATA_CODE_INDEX]!==_.WHITESPACE_CELL_CODE)}},3734:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new _}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new c;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}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}}a.AttributeData=c;class _{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,m=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=m}clone(){return new _(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=_},9092:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const _=c(6349),v=c(7226),l=c(3734),m=c(8437),x=c(4634),b=c(511),C=c(643),f=c(4863),p=c(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(d,h,w){this._hasScrollback=d,this._optionsService=h,this._bufferService=w,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=m.DEFAULT_ATTR_DATA.clone(),this.savedCharset=p.DEFAULT_CHARSET,this.markers=[],this._nullCell=b.CellData.fromCharData([0,C.NULL_CELL_CHAR,C.NULL_CELL_WIDTH,C.NULL_CELL_CODE]),this._whitespaceCell=b.CellData.fromCharData([0,C.WHITESPACE_CELL_CHAR,C.WHITESPACE_CELL_WIDTH,C.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new v.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new _.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 l.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 l.ExtendedAttrs),this._whitespaceCell}getBlankLine(d,h){return new m.BufferLine(this._bufferService.cols,this.getNullCell(d),h)}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 h=d+this._optionsService.rawOptions.scrollback;return h>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:h}fillViewportRows(d){if(this.lines.length===0){d===void 0&&(d=m.DEFAULT_ATTR_DATA);let h=this._rows;for(;h--;)this.lines.push(this.getBlankLine(d))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new _.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(d,h){const w=this.getNullCell(m.DEFAULT_ATTR_DATA);let L=0;const R=this._getCorrectBufferLength(h);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<d)for(let k=0;k<this.lines.length;k++)L+=+this.lines.get(k).resize(d,w);let D=0;if(this._rows<h)for(let k=this._rows;k<h;k++)this.lines.length<h+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new m.BufferLine(d,w)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new m.BufferLine(d,w)));else for(let k=this._rows;k>h;k--)this.lines.length>h+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const k=this.lines.length-R;k>0&&(this.lines.trimStart(k),this.ybase=Math.max(this.ybase-k,0),this.ydisp=Math.max(this.ydisp-k,0),this.savedY=Math.max(this.savedY-k,0)),this.lines.maxLength=R}this.x=Math.min(this.x,d-1),this.y=Math.min(this.y,h-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,d-1),this.scrollTop=0}if(this.scrollBottom=h-1,this._isReflowEnabled&&(this._reflow(d,h),this._cols>d))for(let D=0;D<this.lines.length;D++)L+=+this.lines.get(D).resize(d,w);this._cols=d,this._rows=h,this._memoryCleanupQueue.clear(),L>.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 h=0;for(;this._memoryCleanupPosition<this.lines.length;)if(h+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),h>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,h){this._cols!==d&&(d>this._cols?this._reflowLarger(d,h):this._reflowSmaller(d,h))}_reflowLarger(d,h){const w=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,d,this.ybase+this.y,this.getNullCell(m.DEFAULT_ATTR_DATA));if(w.length>0){const L=(0,x.reflowLargerCreateNewLayout)(this.lines,w);(0,x.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(d,h,L.countRemoved)}}_reflowLargerAdjustViewport(d,h,w){const L=this.getNullCell(m.DEFAULT_ATTR_DATA);let R=w;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<h&&this.lines.push(new m.BufferLine(d,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-w,0)}_reflowSmaller(d,h){const w=this.getNullCell(m.DEFAULT_ATTR_DATA),L=[];let R=0;for(let D=this.lines.length-1;D>=0;D--){let k=this.lines.get(D);if(!k||!k.isWrapped&&k.getTrimmedLength()<=d)continue;const M=[k];for(;k.isWrapped&&D>0;)k=this.lines.get(--D),M.unshift(k);const W=this.ybase+this.y;if(W>=D&&W<D+M.length)continue;const z=M[M.length-1].getTrimmedLength(),F=(0,x.reflowSmallerGetNewLineLengths)(M,this._cols,d),N=F.length-M.length;let I;I=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 q=[];for(let P=0;P<N;P++){const H=this.getBlankLine(m.DEFAULT_ATTR_DATA,!0);q.push(H)}q.length>0&&(L.push({start:D+M.length+R,newLines:q}),R+=q.length),M.push(...q);let V=F.length-1,K=F[V];K===0&&(V--,K=F[V]);let U=M.length-N-1,A=z;for(;U>=0;){const P=Math.min(A,K);if(M[V]===void 0)break;if(M[V].copyCellsFrom(M[U],A-P,K-P,P,!0),K-=P,K===0&&(V--,K=F[V]),A-=P,A===0){U--;const H=Math.max(U,0);A=(0,x.getWrappedLineTrimmedLength)(M,H,this._cols)}}for(let P=0;P<M.length;P++)F[P]<d&&M[P].setCell(F[P],w);let B=N-I;for(;B-- >0;)this.ybase===0?this.y<h-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-h&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+N,this.ybase+h-1)}if(L.length>0){const D=[],k=[];for(let V=0;V<this.lines.length;V++)k.push(this.lines.get(V));const M=this.lines.length;let W=M-1,z=0,F=L[z];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let N=0;for(let V=Math.min(this.lines.maxLength-1,M+R-1);V>=0;V--)if(F&&F.start>W+N){for(let K=F.newLines.length-1;K>=0;K--)this.lines.set(V--,F.newLines[K]);V++,D.push({index:W+1,amount:F.newLines.length}),N+=F.newLines.length,F=L[++z]}else this.lines.set(V,k[W--]);let I=0;for(let V=D.length-1;V>=0;V--)D[V].index+=I,this.lines.onInsertEmitter.fire(D[V]),I+=D[V].amount;const q=Math.max(0,M+R-this.lines.maxLength);q>0&&this.lines.onTrimEmitter.fire(q)}}translateBufferLineToString(d,h,w=0,L){const R=this.lines.get(d);return R?R.translateToString(h,w,L):""}getWrappedRangeForLine(d){let h=d,w=d;for(;h>0&&this.lines.get(h).isWrapped;)h--;for(;w+1<this.lines.length&&this.lines.get(w+1).isWrapped;)w++;return{first:h,last:w}}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 h=0;h<this.markers.length;h++)this.markers[h].line===d&&(this.markers[h].dispose(),this.markers.splice(h--,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 h=new f.Marker(d);return this.markers.push(h),h.register(this.lines.onTrim((w=>{h.line-=w,h.line<0&&h.dispose()}))),h.register(this.lines.onInsert((w=>{h.line>=w.index&&(h.line+=w.amount)}))),h.register(this.lines.onDelete((w=>{h.line>=w.index&&h.line<w.index+w.amount&&h.dispose(),h.line>w.index&&(h.line-=w.amount)}))),h.register(h.onDispose((()=>this._removeMarker(h)))),h}_removeMarker(d){this._isClearing||this.markers.splice(this.markers.indexOf(d),1)}}},8437:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const _=c(3734),v=c(511),l=c(643),m=c(482);a.DEFAULT_ATTR_DATA=Object.freeze(new _.AttributeData);let x=0;class b{constructor(f,p,d=!1){this.isWrapped=d,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*f);const h=p||v.CellData.fromCharData([0,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]);for(let w=0;w<f;++w)this.setCell(w,h);this.length=f}get(f){const p=this._data[3*f+0],d=2097151&p;return[this._data[3*f+1],2097152&p?this._combined[f]:d?(0,m.stringFromCodePoint)(d):"",p>>22,2097152&p?this._combined[f].charCodeAt(this._combined[f].length-1):d]}set(f,p){this._data[3*f+1]=p[l.CHAR_DATA_ATTR_INDEX],p[l.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[f]=p[1],this._data[3*f+0]=2097152|f|p[l.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*f+0]=p[l.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|p[l.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(f){return this._data[3*f+0]>>22}hasWidth(f){return 12582912&this._data[3*f+0]}getFg(f){return this._data[3*f+1]}getBg(f){return this._data[3*f+2]}hasContent(f){return 4194303&this._data[3*f+0]}getCodePoint(f){const p=this._data[3*f+0];return 2097152&p?this._combined[f].charCodeAt(this._combined[f].length-1):2097151&p}isCombined(f){return 2097152&this._data[3*f+0]}getString(f){const p=this._data[3*f+0];return 2097152&p?this._combined[f]:2097151&p?(0,m.stringFromCodePoint)(2097151&p):""}isProtected(f){return 536870912&this._data[3*f+2]}loadCell(f,p){return x=3*f,p.content=this._data[x+0],p.fg=this._data[x+1],p.bg=this._data[x+2],2097152&p.content&&(p.combinedData=this._combined[f]),268435456&p.bg&&(p.extended=this._extendedAttrs[f]),p}setCell(f,p){2097152&p.content&&(this._combined[f]=p.combinedData),268435456&p.bg&&(this._extendedAttrs[f]=p.extended),this._data[3*f+0]=p.content,this._data[3*f+1]=p.fg,this._data[3*f+2]=p.bg}setCellFromCodepoint(f,p,d,h){268435456&h.bg&&(this._extendedAttrs[f]=h.extended),this._data[3*f+0]=p|d<<22,this._data[3*f+1]=h.fg,this._data[3*f+2]=h.bg}addCodepointToCell(f,p,d){let h=this._data[3*f+0];2097152&h?this._combined[f]+=(0,m.stringFromCodePoint)(p):2097151&h?(this._combined[f]=(0,m.stringFromCodePoint)(2097151&h)+(0,m.stringFromCodePoint)(p),h&=-2097152,h|=2097152):h=p|4194304,d&&(h&=-12582913,h|=d<<22),this._data[3*f+0]=h}insertCells(f,p,d){if((f%=this.length)&&this.getWidth(f-1)===2&&this.setCellFromCodepoint(f-1,0,1,d),p<this.length-f){const h=new v.CellData;for(let w=this.length-f-p-1;w>=0;--w)this.setCell(f+p+w,this.loadCell(f+w,h));for(let w=0;w<p;++w)this.setCell(f+w,d)}else for(let h=f;h<this.length;++h)this.setCell(h,d);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,d)}deleteCells(f,p,d){if(f%=this.length,p<this.length-f){const h=new v.CellData;for(let w=0;w<this.length-f-p;++w)this.setCell(f+w,this.loadCell(f+p+w,h));for(let w=this.length-p;w<this.length;++w)this.setCell(w,d)}else for(let h=f;h<this.length;++h)this.setCell(h,d);f&&this.getWidth(f-1)===2&&this.setCellFromCodepoint(f-1,0,1,d),this.getWidth(f)!==0||this.hasContent(f)||this.setCellFromCodepoint(f,0,1,d)}replaceCells(f,p,d,h=!1){if(h)for(f&&this.getWidth(f-1)===2&&!this.isProtected(f-1)&&this.setCellFromCodepoint(f-1,0,1,d),p<this.length&&this.getWidth(p-1)===2&&!this.isProtected(p)&&this.setCellFromCodepoint(p,0,1,d);f<p&&f<this.length;)this.isProtected(f)||this.setCell(f,d),f++;else for(f&&this.getWidth(f-1)===2&&this.setCellFromCodepoint(f-1,0,1,d),p<this.length&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p,0,1,d);f<p&&f<this.length;)this.setCell(f++,d)}resize(f,p){if(f===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const d=3*f;if(f>this.length){if(this._data.buffer.byteLength>=4*d)this._data=new Uint32Array(this._data.buffer,0,d);else{const h=new Uint32Array(d);h.set(this._data),this._data=h}for(let h=this.length;h<f;++h)this.setCell(h,p)}else{this._data=this._data.subarray(0,d);const h=Object.keys(this._combined);for(let L=0;L<h.length;L++){const R=parseInt(h[L],10);R>=f&&delete this._combined[R]}const w=Object.keys(this._extendedAttrs);for(let L=0;L<w.length;L++){const R=parseInt(w[L],10);R>=f&&delete this._extendedAttrs[R]}}return this.length=f,4*d*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const f=new Uint32Array(this._data.length);return f.set(this._data),this._data=f,1}return 0}fill(f,p=!1){if(p)for(let d=0;d<this.length;++d)this.isProtected(d)||this.setCell(d,f);else{this._combined={},this._extendedAttrs={};for(let d=0;d<this.length;++d)this.setCell(d,f)}}copyFrom(f){this.length!==f.length?this._data=new Uint32Array(f._data):this._data.set(f._data),this.length=f.length,this._combined={};for(const p in f._combined)this._combined[p]=f._combined[p];this._extendedAttrs={};for(const p in f._extendedAttrs)this._extendedAttrs[p]=f._extendedAttrs[p];this.isWrapped=f.isWrapped}clone(){const f=new b(0);f._data=new Uint32Array(this._data),f.length=this.length;for(const p in this._combined)f._combined[p]=this._combined[p];for(const p in this._extendedAttrs)f._extendedAttrs[p]=this._extendedAttrs[p];return f.isWrapped=this.isWrapped,f}getTrimmedLength(){for(let f=this.length-1;f>=0;--f)if(4194303&this._data[3*f+0])return f+(this._data[3*f+0]>>22);return 0}getNoBgTrimmedLength(){for(let f=this.length-1;f>=0;--f)if(4194303&this._data[3*f+0]||50331648&this._data[3*f+2])return f+(this._data[3*f+0]>>22);return 0}copyCellsFrom(f,p,d,h,w){const L=f._data;if(w)for(let D=h-1;D>=0;D--){for(let k=0;k<3;k++)this._data[3*(d+D)+k]=L[3*(p+D)+k];268435456&L[3*(p+D)+2]&&(this._extendedAttrs[d+D]=f._extendedAttrs[p+D])}else for(let D=0;D<h;D++){for(let k=0;k<3;k++)this._data[3*(d+D)+k]=L[3*(p+D)+k];268435456&L[3*(p+D)+2]&&(this._extendedAttrs[d+D]=f._extendedAttrs[p+D])}const R=Object.keys(f._combined);for(let D=0;D<R.length;D++){const k=parseInt(R[D],10);k>=p&&(this._combined[k-p+d]=f._combined[k])}}translateToString(f,p,d,h){p=p??0,d=d??this.length,f&&(d=Math.min(d,this.getTrimmedLength())),h&&(h.length=0);let w="";for(;p<d;){const L=this._data[3*p+0],R=2097151&L,D=2097152&L?this._combined[p]:R?(0,m.stringFromCodePoint)(R):l.WHITESPACE_CELL_CHAR;if(w+=D,h)for(let k=0;k<D.length;++k)h.push(p);p+=L>>22||1}return h&&h.push(p),w}}a.BufferLine=b},4841:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(c,_){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return _*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(y,a)=>{function c(_,v,l){if(v===_.length-1)return _[v].getTrimmedLength();const m=!_[v].hasContent(l-1)&&_[v].getWidth(l-1)===1,x=_[v+1].getWidth(0)===2;return m&&x?l-1:l}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(_,v,l,m,x){const b=[];for(let C=0;C<_.length-1;C++){let f=C,p=_.get(++f);if(!p.isWrapped)continue;const d=[_.get(C)];for(;f<_.length&&p.isWrapped;)d.push(p),p=_.get(++f);if(m>=C&&m<f){C+=d.length-1;continue}let h=0,w=c(d,h,v),L=1,R=0;for(;L<d.length;){const k=c(d,L,v),M=k-R,W=l-w,z=Math.min(M,W);d[h].copyCellsFrom(d[L],R,w,z,!1),w+=z,w===l&&(h++,w=0),R+=z,R===k&&(L++,R=0),w===0&&h!==0&&d[h-1].getWidth(l-1)===2&&(d[h].copyCellsFrom(d[h-1],l-1,w++,1,!1),d[h-1].setCell(l-1,x))}d[h].replaceCells(w,l,x);let D=0;for(let k=d.length-1;k>0&&(k>h||d[k].getTrimmedLength()===0);k--)D++;D>0&&(b.push(C+d.length-D),b.push(D)),C+=d.length-1}return b},a.reflowLargerCreateNewLayout=function(_,v){const l=[];let m=0,x=v[m],b=0;for(let C=0;C<_.length;C++)if(x===C){const f=v[++m];_.onDeleteEmitter.fire({index:C-b,amount:f}),C+=f-1,b+=f,x=v[++m]}else l.push(C);return{layout:l,countRemoved:b}},a.reflowLargerApplyNewLayout=function(_,v){const l=[];for(let m=0;m<v.length;m++)l.push(_.get(v[m]));for(let m=0;m<l.length;m++)_.set(m,l[m]);_.length=v.length},a.reflowSmallerGetNewLineLengths=function(_,v,l){const m=[],x=_.map(((p,d)=>c(_,d,v))).reduce(((p,d)=>p+d));let b=0,C=0,f=0;for(;f<x;){if(x-f<l){m.push(x-f);break}b+=l;const p=c(_,C,v);b>p&&(b-=p,C++);const d=_[C].getWidth(b-1)===2;d&&b--;const h=d?l-1:l;m.push(h),f+=h}return m},a.getWrappedLineTrimmedLength=c},5295:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const _=c(8460),v=c(844),l=c(9092);class m extends v.Disposable{constructor(b,C){super(),this._optionsService=b,this._bufferService=C,this._onBufferActivate=this.register(new _.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 l.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new l.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(b){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(b),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(b,C){this._normal.resize(b,C),this._alt.resize(b,C),this.setupTabStops(b)}setupTabStops(b){this._normal.setupTabStops(b),this._alt.setupTabStops(b)}}a.BufferSet=m},511:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const _=c(482),v=c(643),l=c(3734);class m extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const C=new m;return C.setFromCharData(b),C}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,_.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(b){this.fg=b[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let C=!1;if(b[v.CHAR_DATA_CHAR_INDEX].length>2)C=!0;else if(b[v.CHAR_DATA_CHAR_INDEX].length===2){const f=b[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=f&&f<=56319){const p=b[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=p&&p<=57343?this.content=1024*(f-55296)+p-56320+65536|b[v.CHAR_DATA_WIDTH_INDEX]<<22:C=!0}else C=!0}else this.content=b[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[v.CHAR_DATA_WIDTH_INDEX]<<22;C&&(this.combinedData=b[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=m},643:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const _=c(8460),v=c(844);class l{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=l._nextId++,this._onDispose=this.register(new _.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,v.disposeArray)(this._disposables),this._disposables.length=0)}register(x){return this._disposables.push(x),x}}a.Marker=l,l._nextId=1},7116:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.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:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(y,a)=>{var c,_,v;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,(function(l){l.NUL="\0",l.SOH="",l.STX="",l.ETX="",l.EOT="",l.ENQ="",l.ACK="",l.BEL="\x07",l.BS="\b",l.HT=" ",l.LF=`
|
|
69
|
+
`,l.VT="\v",l.FF="\f",l.CR="\r",l.SO="",l.SI="",l.DLE="",l.DC1="",l.DC2="",l.DC3="",l.DC4="",l.NAK="",l.SYN="",l.ETB="",l.CAN="",l.EM="",l.SUB="",l.ESC="\x1B",l.FS="",l.GS="",l.RS="",l.US="",l.SP=" ",l.DEL=""})(c||(a.C0=c={})),(function(l){l.PAD="",l.HOP="",l.BPH="",l.NBH="",l.IND="",l.NEL="
",l.SSA="",l.ESA="",l.HTS="",l.HTJ="",l.VTS="",l.PLD="",l.PLU="",l.RI="",l.SS2="",l.SS3="",l.DCS="",l.PU1="",l.PU2="",l.STS="",l.CCH="",l.MW="",l.SPA="",l.EPA="",l.SOS="",l.SGCI="",l.SCI="",l.CSI="",l.ST="",l.OSC="",l.PM="",l.APC=""})(_||(a.C1=_={})),(function(l){l.ST=`${c.ESC}\\`})(v||(a.C1_ESCAPED=v={}))},7399:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const _=c(2584),v={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:["'",'"']};a.evaluateKeyboardEvent=function(l,m,x,b){const C={type:0,cancel:!1,key:void 0},f=(l.shiftKey?1:0)|(l.altKey?2:0)|(l.ctrlKey?4:0)|(l.metaKey?8:0);switch(l.keyCode){case 0:l.key==="UIKeyInputUpArrow"?C.key=m?_.C0.ESC+"OA":_.C0.ESC+"[A":l.key==="UIKeyInputLeftArrow"?C.key=m?_.C0.ESC+"OD":_.C0.ESC+"[D":l.key==="UIKeyInputRightArrow"?C.key=m?_.C0.ESC+"OC":_.C0.ESC+"[C":l.key==="UIKeyInputDownArrow"&&(C.key=m?_.C0.ESC+"OB":_.C0.ESC+"[B");break;case 8:C.key=l.ctrlKey?"\b":_.C0.DEL,l.altKey&&(C.key=_.C0.ESC+C.key);break;case 9:if(l.shiftKey){C.key=_.C0.ESC+"[Z";break}C.key=_.C0.HT,C.cancel=!0;break;case 13:C.key=l.altKey?_.C0.ESC+_.C0.CR:_.C0.CR,C.cancel=!0;break;case 27:C.key=_.C0.ESC,l.altKey&&(C.key=_.C0.ESC+_.C0.ESC),C.cancel=!0;break;case 37:if(l.metaKey)break;f?(C.key=_.C0.ESC+"[1;"+(f+1)+"D",C.key===_.C0.ESC+"[1;3D"&&(C.key=_.C0.ESC+(x?"b":"[1;5D"))):C.key=m?_.C0.ESC+"OD":_.C0.ESC+"[D";break;case 39:if(l.metaKey)break;f?(C.key=_.C0.ESC+"[1;"+(f+1)+"C",C.key===_.C0.ESC+"[1;3C"&&(C.key=_.C0.ESC+(x?"f":"[1;5C"))):C.key=m?_.C0.ESC+"OC":_.C0.ESC+"[C";break;case 38:if(l.metaKey)break;f?(C.key=_.C0.ESC+"[1;"+(f+1)+"A",x||C.key!==_.C0.ESC+"[1;3A"||(C.key=_.C0.ESC+"[1;5A")):C.key=m?_.C0.ESC+"OA":_.C0.ESC+"[A";break;case 40:if(l.metaKey)break;f?(C.key=_.C0.ESC+"[1;"+(f+1)+"B",x||C.key!==_.C0.ESC+"[1;3B"||(C.key=_.C0.ESC+"[1;5B")):C.key=m?_.C0.ESC+"OB":_.C0.ESC+"[B";break;case 45:l.shiftKey||l.ctrlKey||(C.key=_.C0.ESC+"[2~");break;case 46:C.key=f?_.C0.ESC+"[3;"+(f+1)+"~":_.C0.ESC+"[3~";break;case 36:C.key=f?_.C0.ESC+"[1;"+(f+1)+"H":m?_.C0.ESC+"OH":_.C0.ESC+"[H";break;case 35:C.key=f?_.C0.ESC+"[1;"+(f+1)+"F":m?_.C0.ESC+"OF":_.C0.ESC+"[F";break;case 33:l.shiftKey?C.type=2:l.ctrlKey?C.key=_.C0.ESC+"[5;"+(f+1)+"~":C.key=_.C0.ESC+"[5~";break;case 34:l.shiftKey?C.type=3:l.ctrlKey?C.key=_.C0.ESC+"[6;"+(f+1)+"~":C.key=_.C0.ESC+"[6~";break;case 112:C.key=f?_.C0.ESC+"[1;"+(f+1)+"P":_.C0.ESC+"OP";break;case 113:C.key=f?_.C0.ESC+"[1;"+(f+1)+"Q":_.C0.ESC+"OQ";break;case 114:C.key=f?_.C0.ESC+"[1;"+(f+1)+"R":_.C0.ESC+"OR";break;case 115:C.key=f?_.C0.ESC+"[1;"+(f+1)+"S":_.C0.ESC+"OS";break;case 116:C.key=f?_.C0.ESC+"[15;"+(f+1)+"~":_.C0.ESC+"[15~";break;case 117:C.key=f?_.C0.ESC+"[17;"+(f+1)+"~":_.C0.ESC+"[17~";break;case 118:C.key=f?_.C0.ESC+"[18;"+(f+1)+"~":_.C0.ESC+"[18~";break;case 119:C.key=f?_.C0.ESC+"[19;"+(f+1)+"~":_.C0.ESC+"[19~";break;case 120:C.key=f?_.C0.ESC+"[20;"+(f+1)+"~":_.C0.ESC+"[20~";break;case 121:C.key=f?_.C0.ESC+"[21;"+(f+1)+"~":_.C0.ESC+"[21~";break;case 122:C.key=f?_.C0.ESC+"[23;"+(f+1)+"~":_.C0.ESC+"[23~";break;case 123:C.key=f?_.C0.ESC+"[24;"+(f+1)+"~":_.C0.ESC+"[24~";break;default:if(!l.ctrlKey||l.shiftKey||l.altKey||l.metaKey)if(x&&!b||!l.altKey||l.metaKey)!x||l.altKey||l.ctrlKey||l.shiftKey||!l.metaKey?l.key&&!l.ctrlKey&&!l.altKey&&!l.metaKey&&l.keyCode>=48&&l.key.length===1?C.key=l.key:l.key&&l.ctrlKey&&(l.key==="_"&&(C.key=_.C0.US),l.key==="@"&&(C.key=_.C0.NUL)):l.keyCode===65&&(C.type=1);else{const p=v[l.keyCode],d=p==null?void 0:p[l.shiftKey?1:0];if(d)C.key=_.C0.ESC+d;else if(l.keyCode>=65&&l.keyCode<=90){const h=l.ctrlKey?l.keyCode-64:l.keyCode+32;let w=String.fromCharCode(h);l.shiftKey&&(w=w.toUpperCase()),C.key=_.C0.ESC+w}else if(l.keyCode===32)C.key=_.C0.ESC+(l.ctrlKey?_.C0.NUL:" ");else if(l.key==="Dead"&&l.code.startsWith("Key")){let h=l.code.slice(3,4);l.shiftKey||(h=h.toLowerCase()),C.key=_.C0.ESC+h,C.cancel=!0}}else l.keyCode>=65&&l.keyCode<=90?C.key=String.fromCharCode(l.keyCode-64):l.keyCode===32?C.key=_.C0.NUL:l.keyCode>=51&&l.keyCode<=55?C.key=String.fromCharCode(l.keyCode-51+27):l.keyCode===56?C.key=_.C0.DEL:l.keyCode===219?C.key=_.C0.ESC:l.keyCode===220?C.key=_.C0.FS:l.keyCode===221&&(C.key=_.C0.GS)}return C}},482:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},a.utf32ToString=function(c,_=0,v=c.length){let l="";for(let m=_;m<v;++m){let x=c[m];x>65535?(x-=65536,l+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):l+=String.fromCharCode(x)}return l},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,_){const v=c.length;if(!v)return 0;let l=0,m=0;if(this._interim){const x=c.charCodeAt(m++);56320<=x&&x<=57343?_[l++]=1024*(this._interim-55296)+x-56320+65536:(_[l++]=this._interim,_[l++]=x),this._interim=0}for(let x=m;x<v;++x){const b=c.charCodeAt(x);if(55296<=b&&b<=56319){if(++x>=v)return this._interim=b,l;const C=c.charCodeAt(x);56320<=C&&C<=57343?_[l++]=1024*(b-55296)+C-56320+65536:(_[l++]=b,_[l++]=C)}else b!==65279&&(_[l++]=b)}return l}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,_){const v=c.length;if(!v)return 0;let l,m,x,b,C=0,f=0,p=0;if(this.interim[0]){let w=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let R,D=0;for(;(R=63&this.interim[++D])&&D<4;)L<<=6,L|=R;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=k-D;for(;p<M;){if(p>=v)return 0;if(R=c[p++],(192&R)!=128){p--,w=!0;break}this.interim[D++]=R,L<<=6,L|=63&R}w||(k===2?L<128?p--:_[C++]=L:k===3?L<2048||L>=55296&&L<=57343||L===65279||(_[C++]=L):L<65536||L>1114111||(_[C++]=L)),this.interim.fill(0)}const d=v-4;let h=p;for(;h<v;){for(;!(!(h<d)||128&(l=c[h])||128&(m=c[h+1])||128&(x=c[h+2])||128&(b=c[h+3]));)_[C++]=l,_[C++]=m,_[C++]=x,_[C++]=b,h+=4;if(l=c[h++],l<128)_[C++]=l;else if((224&l)==192){if(h>=v)return this.interim[0]=l,C;if(m=c[h++],(192&m)!=128){h--;continue}if(f=(31&l)<<6|63&m,f<128){h--;continue}_[C++]=f}else if((240&l)==224){if(h>=v)return this.interim[0]=l,C;if(m=c[h++],(192&m)!=128){h--;continue}if(h>=v)return this.interim[0]=l,this.interim[1]=m,C;if(x=c[h++],(192&x)!=128){h--;continue}if(f=(15&l)<<12|(63&m)<<6|63&x,f<2048||f>=55296&&f<=57343||f===65279)continue;_[C++]=f}else if((248&l)==240){if(h>=v)return this.interim[0]=l,C;if(m=c[h++],(192&m)!=128){h--;continue}if(h>=v)return this.interim[0]=l,this.interim[1]=m,C;if(x=c[h++],(192&x)!=128){h--;continue}if(h>=v)return this.interim[0]=l,this.interim[1]=m,this.interim[2]=x,C;if(b=c[h++],(192&b)!=128){h--;continue}if(f=(7&l)<<18|(63&m)<<12|(63&x)<<6|63&b,f<65536||f>1114111)continue;_[C++]=f}}return C}}},225:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const _=c(1480),v=[[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]],l=[[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 m;a.UnicodeV6=class{constructor(){if(this.version="6",!m){m=new Uint8Array(65536),m.fill(1),m[0]=0,m.fill(0,1,32),m.fill(0,127,160),m.fill(2,4352,4448),m[9001]=2,m[9002]=2,m.fill(2,11904,42192),m[12351]=1,m.fill(2,44032,55204),m.fill(2,63744,64256),m.fill(2,65040,65050),m.fill(2,65072,65136),m.fill(2,65280,65377),m.fill(2,65504,65511);for(let x=0;x<v.length;++x)m.fill(0,v[x][0],v[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?m[x]:(function(b,C){let f,p=0,d=C.length-1;if(b<C[0][0]||b>C[d][1])return!1;for(;d>=p;)if(f=p+d>>1,b>C[f][1])p=f+1;else{if(!(b<C[f][0]))return!0;d=f-1}return!1})(x,l)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,b){let C=this.wcwidth(x),f=C===0&&b!==0;if(f){const p=_.UnicodeService.extractWidth(b);p===0?f=!1:p>C&&(C=p)}return _.UnicodeService.createPropertyValue(0,C,f)}}},5981:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const _=c(8460),v=c(844);class l extends v.Disposable{constructor(x){super(),this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new _.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(x,b){if(b!==void 0&&this._syncCalls>b)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let C;for(this._isSyncWriting=!0;C=this._writeBuffer.shift();){this._action(C);const f=this._callbacks.shift();f&&f()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,b){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(b),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(b)}_innerWrite(x=0,b=!0){const C=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const f=this._writeBuffer[this._bufferOffset],p=this._action(f,b);if(p){const h=w=>Date.now()-C>=12?setTimeout((()=>this._innerWrite(0,w))):this._innerWrite(C,w);return void p.catch((w=>(queueMicrotask((()=>{throw w})),Promise.resolve(!1)))).then(h)}const d=this._callbacks[this._bufferOffset];if(d&&d(),this._bufferOffset++,this._pendingData-=f.length,Date.now()-C>=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()}}a.WriteBuffer=l},5941:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const c=/^([\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})$/,_=/^[\da-f]+$/;function v(l,m){const x=l.toString(16),b=x.length<2?"0"+x:x;switch(m){case 4:return x[0];case 8:return b;case 12:return(b+b).slice(0,3);default:return b+b}}a.parseColor=function(l){if(!l)return;let m=l.toLowerCase();if(m.indexOf("rgb:")===0){m=m.slice(4);const x=c.exec(m);if(x){const b=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/b*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/b*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/b*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),_.exec(m)&&[3,6,9,12].includes(m.length))){const x=m.length/3,b=[0,0,0];for(let C=0;C<3;++C){const f=parseInt(m.slice(x*C,x*C+x),16);b[C]=x===1?f<<4:x===2?f:x===3?f>>4:f>>8}return b}},a.toRgbString=function(l,m=16){const[x,b,C]=l;return`rgb:${v(x,m)}/${v(b,m)}/${v(C,m)}`}},5770:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const _=c(482),v=c(8742),l=c(5770),m=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=m,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}registerHandler(b,C){this._handlers[b]===void 0&&(this._handlers[b]=[]);const f=this._handlers[b];return f.push(C),{dispose:()=>{const p=f.indexOf(C);p!==-1&&f.splice(p,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}reset(){if(this._active.length)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].unhook(!1);this._stack.paused=!1,this._active=m,this._ident=0}hook(b,C){if(this.reset(),this._ident=b,this._active=this._handlers[b]||m,this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].hook(C);else this._handlerFb(this._ident,"HOOK",C)}put(b,C,f){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(b,C,f);else this._handlerFb(this._ident,"PUT",(0,_.utf32ToString)(b,C,f))}unhook(b,C=!0){if(this._active.length){let f=!1,p=this._active.length-1,d=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,f=C,d=this._stack.fallThrough,this._stack.paused=!1),!d&&f===!1){for(;p>=0&&(f=this._active[p].unhook(b),f!==!0);p--)if(f instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,f;p--}for(;p>=0;p--)if(f=this._active[p].unhook(!1),f instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,f}else this._handlerFb(this._ident,"UNHOOK",b);this._active=m,this._ident=0}};const x=new v.Params;x.addParam(0),a.DcsHandler=class{constructor(b){this._handler=b,this._data="",this._params=x,this._hitLimit=!1}hook(b){this._params=b.length>1||b.params[0]?b.clone():x,this._data="",this._hitLimit=!1}put(b,C,f){this._hitLimit||(this._data+=(0,_.utf32ToString)(b,C,f),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(b){let C=!1;if(this._hitLimit)C=!1;else if(b&&(C=this._handler(this._data,this._params),C instanceof Promise))return C.then((f=>(this._params=x,this._data="",this._hitLimit=!1,f)));return this._params=x,this._data="",this._hitLimit=!1,C}}},2015:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const _=c(844),v=c(8742),l=c(6242),m=c(6351);class x{constructor(p){this.table=new Uint8Array(p)}setDefault(p,d){this.table.fill(p<<4|d)}add(p,d,h,w){this.table[d<<8|p]=h<<4|w}addMany(p,d,h,w){for(let L=0;L<p.length;L++)this.table[d<<8|p[L]]=h<<4|w}}a.TransitionTable=x;const b=160;a.VT500_TRANSITION_TABLE=(function(){const f=new x(4095),p=Array.apply(null,Array(256)).map(((D,k)=>k)),d=(D,k)=>p.slice(D,k),h=d(32,127),w=d(0,24);w.push(25),w.push.apply(w,d(28,32));const L=d(0,14);let R;for(R in f.setDefault(1,0),f.addMany(h,0,2,0),L)f.addMany([24,26,153,154],R,3,0),f.addMany(d(128,144),R,3,0),f.addMany(d(144,152),R,3,0),f.add(156,R,0,0),f.add(27,R,11,1),f.add(157,R,4,8),f.addMany([152,158,159],R,0,7),f.add(155,R,11,3),f.add(144,R,11,9);return f.addMany(w,0,3,0),f.addMany(w,1,3,1),f.add(127,1,0,1),f.addMany(w,8,0,8),f.addMany(w,3,3,3),f.add(127,3,0,3),f.addMany(w,4,3,4),f.add(127,4,0,4),f.addMany(w,6,3,6),f.addMany(w,5,3,5),f.add(127,5,0,5),f.addMany(w,2,3,2),f.add(127,2,0,2),f.add(93,1,4,8),f.addMany(h,8,5,8),f.add(127,8,5,8),f.addMany([156,27,24,26,7],8,6,0),f.addMany(d(28,32),8,0,8),f.addMany([88,94,95],1,0,7),f.addMany(h,7,0,7),f.addMany(w,7,0,7),f.add(156,7,0,0),f.add(127,7,0,7),f.add(91,1,11,3),f.addMany(d(64,127),3,7,0),f.addMany(d(48,60),3,8,4),f.addMany([60,61,62,63],3,9,4),f.addMany(d(48,60),4,8,4),f.addMany(d(64,127),4,7,0),f.addMany([60,61,62,63],4,0,6),f.addMany(d(32,64),6,0,6),f.add(127,6,0,6),f.addMany(d(64,127),6,0,0),f.addMany(d(32,48),3,9,5),f.addMany(d(32,48),5,9,5),f.addMany(d(48,64),5,0,6),f.addMany(d(64,127),5,7,0),f.addMany(d(32,48),4,9,5),f.addMany(d(32,48),1,9,2),f.addMany(d(32,48),2,9,2),f.addMany(d(48,127),2,10,0),f.addMany(d(48,80),1,10,0),f.addMany(d(81,88),1,10,0),f.addMany([89,90,92],1,10,0),f.addMany(d(96,127),1,10,0),f.add(80,1,11,9),f.addMany(w,9,0,9),f.add(127,9,0,9),f.addMany(d(28,32),9,0,9),f.addMany(d(32,48),9,9,12),f.addMany(d(48,60),9,8,10),f.addMany([60,61,62,63],9,9,10),f.addMany(w,11,0,11),f.addMany(d(32,128),11,0,11),f.addMany(d(28,32),11,0,11),f.addMany(w,10,0,10),f.add(127,10,0,10),f.addMany(d(28,32),10,0,10),f.addMany(d(48,60),10,8,10),f.addMany([60,61,62,63],10,0,11),f.addMany(d(32,48),10,9,12),f.addMany(w,12,0,12),f.add(127,12,0,12),f.addMany(d(28,32),12,0,12),f.addMany(d(32,48),12,9,12),f.addMany(d(48,64),12,0,11),f.addMany(d(64,127),12,12,13),f.addMany(d(64,127),10,12,13),f.addMany(d(64,127),9,12,13),f.addMany(w,13,13,13),f.addMany(h,13,13,13),f.add(127,13,0,13),f.addMany([27,156,24,26],13,14,0),f.add(b,0,2,0),f.add(b,8,5,8),f.add(b,6,0,6),f.add(b,11,0,11),f.add(b,13,13,13),f})();class C extends _.Disposable{constructor(p=a.VT500_TRANSITION_TABLE){super(),this._transitions=p,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new v.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(d,h,w)=>{},this._executeHandlerFb=d=>{},this._csiHandlerFb=(d,h)=>{},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,_.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new l.OscParser),this._dcsParser=this.register(new m.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(p,d=[64,126]){let h=0;if(p.prefix){if(p.prefix.length>1)throw new Error("only one byte as prefix supported");if(h=p.prefix.charCodeAt(0),h&&60>h||h>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(p.intermediates){if(p.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let L=0;L<p.intermediates.length;++L){const R=p.intermediates.charCodeAt(L);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");h<<=8,h|=R}}if(p.final.length!==1)throw new Error("final must be a single byte");const w=p.final.charCodeAt(0);if(d[0]>w||w>d[1])throw new Error(`final must be in range ${d[0]} .. ${d[1]}`);return h<<=8,h|=w,h}identToString(p){const d=[];for(;p;)d.push(String.fromCharCode(255&p)),p>>=8;return d.reverse().join("")}setPrintHandler(p){this._printHandler=p}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(p,d){const h=this._identifier(p,[48,126]);this._escHandlers[h]===void 0&&(this._escHandlers[h]=[]);const w=this._escHandlers[h];return w.push(d),{dispose:()=>{const L=w.indexOf(d);L!==-1&&w.splice(L,1)}}}clearEscHandler(p){this._escHandlers[this._identifier(p,[48,126])]&&delete this._escHandlers[this._identifier(p,[48,126])]}setEscHandlerFallback(p){this._escHandlerFb=p}setExecuteHandler(p,d){this._executeHandlers[p.charCodeAt(0)]=d}clearExecuteHandler(p){this._executeHandlers[p.charCodeAt(0)]&&delete this._executeHandlers[p.charCodeAt(0)]}setExecuteHandlerFallback(p){this._executeHandlerFb=p}registerCsiHandler(p,d){const h=this._identifier(p);this._csiHandlers[h]===void 0&&(this._csiHandlers[h]=[]);const w=this._csiHandlers[h];return w.push(d),{dispose:()=>{const L=w.indexOf(d);L!==-1&&w.splice(L,1)}}}clearCsiHandler(p){this._csiHandlers[this._identifier(p)]&&delete this._csiHandlers[this._identifier(p)]}setCsiHandlerFallback(p){this._csiHandlerFb=p}registerDcsHandler(p,d){return this._dcsParser.registerHandler(this._identifier(p),d)}clearDcsHandler(p){this._dcsParser.clearHandler(this._identifier(p))}setDcsHandlerFallback(p){this._dcsParser.setHandlerFallback(p)}registerOscHandler(p,d){return this._oscParser.registerHandler(p,d)}clearOscHandler(p){this._oscParser.clearHandler(p)}setOscHandlerFallback(p){this._oscParser.setHandlerFallback(p)}setErrorHandler(p){this._errorHandler=p}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(p,d,h,w,L){this._parseStack.state=p,this._parseStack.handlers=d,this._parseStack.handlerPos=h,this._parseStack.transition=w,this._parseStack.chunkPos=L}parse(p,d,h){let w,L=0,R=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(h===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const k=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(h===!1&&M>-1){for(;M>=0&&(w=k[M](this._params),w!==!0);M--)if(w instanceof Promise)return this._parseStack.handlerPos=M,w}this._parseStack.handlers=[];break;case 4:if(h===!1&&M>-1){for(;M>=0&&(w=k[M](),w!==!0);M--)if(w instanceof Promise)return this._parseStack.handlerPos=M,w}this._parseStack.handlers=[];break;case 6:if(L=p[this._parseStack.chunkPos],w=this._dcsParser.unhook(L!==24&&L!==26,h),w)return w;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(L=p[this._parseStack.chunkPos],w=this._oscParser.end(L!==24&&L!==26,h),w)return w;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let k=D;k<d;++k){switch(L=p[k],R=this._transitions.table[this.currentState<<8|(L<160?L:b)],R>>4){case 2:for(let N=k+1;;++N){if(N>=d||(L=p[N])<32||L>126&&L<b){this._printHandler(p,k,N),k=N-1;break}if(++N>=d||(L=p[N])<32||L>126&&L<b){this._printHandler(p,k,N),k=N-1;break}if(++N>=d||(L=p[N])<32||L>126&&L<b){this._printHandler(p,k,N),k=N-1;break}if(++N>=d||(L=p[N])<32||L>126&&L<b){this._printHandler(p,k,N),k=N-1;break}}break;case 3:this._executeHandlers[L]?this._executeHandlers[L]():this._executeHandlerFb(L),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:k,code:L,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const M=this._csiHandlers[this._collect<<8|L];let W=M?M.length-1:-1;for(;W>=0&&(w=M[W](this._params),w!==!0);W--)if(w instanceof Promise)return this._preserveStack(3,M,W,R,k),w;W<0&&this._csiHandlerFb(this._collect<<8|L,this._params),this.precedingJoinState=0;break;case 8:do switch(L){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(L-48)}while(++k<d&&(L=p[k])>47&&L<60);k--;break;case 9:this._collect<<=8,this._collect|=L;break;case 10:const z=this._escHandlers[this._collect<<8|L];let F=z?z.length-1:-1;for(;F>=0&&(w=z[F](),w!==!0);F--)if(w instanceof Promise)return this._preserveStack(4,z,F,R,k),w;F<0&&this._escHandlerFb(this._collect<<8|L),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|L,this._params);break;case 13:for(let N=k+1;;++N)if(N>=d||(L=p[N])===24||L===26||L===27||L>127&&L<b){this._dcsParser.put(p,k,N),k=N-1;break}break;case 14:if(w=this._dcsParser.unhook(L!==24&&L!==26),w)return this._preserveStack(6,[],0,R,k),w;L===27&&(R|=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=k+1;;N++)if(N>=d||(L=p[N])<32||L>127&&L<b){this._oscParser.put(p,k,N),k=N-1;break}break;case 6:if(w=this._oscParser.end(L!==24&&L!==26),w)return this._preserveStack(5,[],0,R,k),w;L===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}a.EscapeSequenceParser=C},6242:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const _=c(5770),v=c(482),l=[];a.OscParser=class{constructor(){this._state=0,this._active=l,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(m,x){this._handlers[m]===void 0&&(this._handlers[m]=[]);const b=this._handlers[m];return b.push(x),{dispose:()=>{const C=b.indexOf(x);C!==-1&&b.splice(C,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=l}reset(){if(this._state===2)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].end(!1);this._stack.paused=!1,this._active=l,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||l,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].start();else this._handlerFb(this._id,"START")}_put(m,x,b){if(this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].put(m,x,b);else this._handlerFb(this._id,"PUT",(0,v.utf32ToString)(m,x,b))}start(){this.reset(),this._state=1}put(m,x,b){if(this._state!==3){if(this._state===1)for(;x<b;){const C=m[x++];if(C===59){this._state=2,this._start();break}if(C<48||57<C)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+C-48}this._state===2&&b-x>0&&this._put(m,x,b)}}end(m,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let b=!1,C=this._active.length-1,f=!1;if(this._stack.paused&&(C=this._stack.loopPosition-1,b=x,f=this._stack.fallThrough,this._stack.paused=!1),!f&&b===!1){for(;C>=0&&(b=this._active[C].end(m),b!==!0);C--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=C,this._stack.fallThrough=!1,b;C--}for(;C>=0;C--)if(b=this._active[C].end(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=C,this._stack.fallThrough=!0,b}else this._handlerFb(this._id,"END",m);this._active=l,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(m){this._handler=m,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(m,x,b){this._hitLimit||(this._data+=(0,v.utf32ToString)(m,x,b),this._data.length>_.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let x=!1;if(this._hitLimit)x=!1;else if(m&&(x=this._handler(this._data),x instanceof Promise))return x.then((b=>(this._data="",this._hitLimit=!1,b)));return this._data="",this._hitLimit=!1,x}}},8742:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const c=2147483647;class _{static fromArray(l){const m=new _;if(!l.length)return m;for(let x=Array.isArray(l[0])?1:0;x<l.length;++x){const b=l[x];if(Array.isArray(b))for(let C=0;C<b.length;++C)m.addSubParam(b[C]);else m.addParam(b)}return m}constructor(l=32,m=32){if(this.maxLength=l,this.maxSubParamsLength=m,m>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(l),this.length=0,this._subParams=new Int32Array(m),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(l),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const l=new _(this.maxLength,this.maxSubParamsLength);return l.params.set(this.params),l.length=this.length,l._subParams.set(this._subParams),l._subParamsLength=this._subParamsLength,l._subParamsIdx.set(this._subParamsIdx),l._rejectDigits=this._rejectDigits,l._rejectSubDigits=this._rejectSubDigits,l._digitIsSub=this._digitIsSub,l}toArray(){const l=[];for(let m=0;m<this.length;++m){l.push(this.params[m]);const x=this._subParamsIdx[m]>>8,b=255&this._subParamsIdx[m];b-x>0&&l.push(Array.prototype.slice.call(this._subParams,x,b))}return l}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(l){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=l>c?c:l}}addSubParam(l){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=l>c?c:l,this._subParamsIdx[this.length-1]++}}hasSubParams(l){return(255&this._subParamsIdx[l])-(this._subParamsIdx[l]>>8)>0}getSubParams(l){const m=this._subParamsIdx[l]>>8,x=255&this._subParamsIdx[l];return x-m>0?this._subParams.subarray(m,x):null}getSubParamsAll(){const l={};for(let m=0;m<this.length;++m){const x=this._subParamsIdx[m]>>8,b=255&this._subParamsIdx[m];b-x>0&&(l[m]=this._subParams.slice(x,b))}return l}addDigit(l){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,b=x[m-1];x[m-1]=~b?Math.min(10*b+l,c):l}}a.Params=_},5741:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,_){const v={instance:_,dispose:_.dispose,isDisposed:!1};this._addons.push(v),_.dispose=()=>this._wrappedAddonDispose(v),_.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let _=-1;for(let v=0;v<this._addons.length;v++)if(this._addons[v]===c){_=v;break}if(_===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(_,1)}}},8771:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const _=c(3785),v=c(511);a.BufferApiView=class{constructor(l,m){this._buffer=l,this.type=m}init(l){return this._buffer=l,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(l){const m=this._buffer.lines.get(l);if(m)return new _.BufferLineApiView(m)}getNullCell(){return new v.CellData}}},3785:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const _=c(511);a.BufferLineApiView=class{constructor(v){this._line=v}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(v,l){if(!(v<0||v>=this._line.length))return l?(this._line.loadCell(v,l),l):this._line.loadCell(v,new _.CellData)}translateToString(v,l,m){return this._line.translateToString(v,l,m)}}},8285:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const _=c(8771),v=c(8460),l=c(844);class m extends l.Disposable{constructor(b){super(),this._core=b,this._onBufferChange=this.register(new v.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new _.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new _.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)}}a.BufferNamespaceApi=m},7975:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,_){return this._core.registerCsiHandler(c,(v=>_(v.toArray())))}addCsiHandler(c,_){return this.registerCsiHandler(c,_)}registerDcsHandler(c,_){return this._core.registerDcsHandler(c,((v,l)=>_(v,l.toArray())))}addDcsHandler(c,_){return this.registerDcsHandler(c,_)}registerEscHandler(c,_){return this._core.registerEscHandler(c,_)}addEscHandler(c,_){return this.registerEscHandler(c,_)}registerOscHandler(c,_){return this._core.registerOscHandler(c,_)}addOscHandler(c,_){return this.registerOscHandler(c,_)}}},7090:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(y,a,c){var _=this&&this.__decorate||function(f,p,d,h){var w,L=arguments.length,R=L<3?p:h===null?h=Object.getOwnPropertyDescriptor(p,d):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,p,d,h);else for(var D=f.length-1;D>=0;D--)(w=f[D])&&(R=(L<3?w(R):L>3?w(p,d,R):w(p,d))||R);return L>3&&R&&Object.defineProperty(p,d,R),R},v=this&&this.__param||function(f,p){return function(d,h){p(d,h,f)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const l=c(8460),m=c(844),x=c(5295),b=c(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let C=a.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(f){super(),this.isUserScrolling=!1,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(f.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(f.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(f,this))}resize(f,p){this.cols=f,this.rows=p,this.buffers.resize(f,p),this._onResize.fire({cols:f,rows:p})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(f,p=!1){const d=this.buffer;let h;h=this._cachedBlankLine,h&&h.length===this.cols&&h.getFg(0)===f.fg&&h.getBg(0)===f.bg||(h=d.getBlankLine(f,p),this._cachedBlankLine=h),h.isWrapped=p;const w=d.ybase+d.scrollTop,L=d.ybase+d.scrollBottom;if(d.scrollTop===0){const R=d.lines.isFull;L===d.lines.length-1?R?d.lines.recycle().copyFrom(h):d.lines.push(h.clone()):d.lines.splice(L+1,0,h.clone()),R?this.isUserScrolling&&(d.ydisp=Math.max(d.ydisp-1,0)):(d.ybase++,this.isUserScrolling||d.ydisp++)}else{const R=L-w+1;d.lines.shiftElements(w+1,R-1,-1),d.lines.set(L,h.clone())}this.isUserScrolling||(d.ydisp=d.ybase),this._onScroll.fire(d.ydisp)}scrollLines(f,p,d){const h=this.buffer;if(f<0){if(h.ydisp===0)return;this.isUserScrolling=!0}else f+h.ydisp>=h.ybase&&(this.isUserScrolling=!1);const w=h.ydisp;h.ydisp=Math.max(Math.min(h.ydisp+f,h.ybase),0),w!==h.ydisp&&(p||this._onScroll.fire(h.ydisp))}};a.BufferService=C=_([v(0,b.IOptionsService)],C)},7994:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,_){this._charsets[c]=_,this.glevel===c&&(this.charset=_)}}},1753:function(y,a,c){var _=this&&this.__decorate||function(h,w,L,R){var D,k=arguments.length,M=k<3?w:R===null?R=Object.getOwnPropertyDescriptor(w,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(h,w,L,R);else for(var W=h.length-1;W>=0;W--)(D=h[W])&&(M=(k<3?D(M):k>3?D(w,L,M):D(w,L))||M);return k>3&&M&&Object.defineProperty(w,L,M),M},v=this&&this.__param||function(h,w){return function(L,R){w(L,R,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const l=c(2585),m=c(8460),x=c(844),b={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:h=>h.button!==4&&h.action===1&&(h.ctrl=!1,h.alt=!1,h.shift=!1,!0)},VT200:{events:19,restrict:h=>h.action!==32},DRAG:{events:23,restrict:h=>h.action!==32||h.button!==3},ANY:{events:31,restrict:h=>!0}};function C(h,w){let L=(h.ctrl?16:0)|(h.shift?4:0)|(h.alt?8:0);return h.button===4?(L|=64,L|=h.action):(L|=3&h.button,4&h.button&&(L|=64),8&h.button&&(L|=128),h.action===32?L|=32:h.action!==0||w||(L|=3)),L}const f=String.fromCharCode,p={DEFAULT:h=>{const w=[C(h,!1)+32,h.col+32,h.row+32];return w[0]>255||w[1]>255||w[2]>255?"":`\x1B[M${f(w[0])}${f(w[1])}${f(w[2])}`},SGR:h=>{const w=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${C(h,!0)};${h.col};${h.row}${w}`},SGR_PIXELS:h=>{const w=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${C(h,!0)};${h.x};${h.y}${w}`}};let d=a.CoreMouseService=class extends x.Disposable{constructor(h,w){super(),this._bufferService=h,this._coreService=w,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new m.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const L of Object.keys(b))this.addProtocol(L,b[L]);for(const L of Object.keys(p))this.addEncoding(L,p[L]);this.reset()}addProtocol(h,w){this._protocols[h]=w}addEncoding(h,w){this._encodings[h]=w}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(h){if(!this._protocols[h])throw new Error(`unknown protocol "${h}"`);this._activeProtocol=h,this._onProtocolChange.fire(this._protocols[h].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(h){if(!this._encodings[h])throw new Error(`unknown encoding "${h}"`);this._activeEncoding=h}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(h){if(h.col<0||h.col>=this._bufferService.cols||h.row<0||h.row>=this._bufferService.rows||h.button===4&&h.action===32||h.button===3&&h.action!==32||h.button!==4&&(h.action===2||h.action===3)||(h.col++,h.row++,h.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,h,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(h))return!1;const w=this._encodings[this._activeEncoding](h);return w&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(w):this._coreService.triggerDataEvent(w,!0)),this._lastEvent=h,!0}explainEvents(h){return{down:!!(1&h),up:!!(2&h),drag:!!(4&h),move:!!(8&h),wheel:!!(16&h)}}_equalEvents(h,w,L){if(L){if(h.x!==w.x||h.y!==w.y)return!1}else if(h.col!==w.col||h.row!==w.row)return!1;return h.button===w.button&&h.action===w.action&&h.ctrl===w.ctrl&&h.alt===w.alt&&h.shift===w.shift}};a.CoreMouseService=d=_([v(0,l.IBufferService),v(1,l.ICoreService)],d)},6975:function(y,a,c){var _=this&&this.__decorate||function(d,h,w,L){var R,D=arguments.length,k=D<3?h:L===null?L=Object.getOwnPropertyDescriptor(h,w):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,h,w,L);else for(var M=d.length-1;M>=0;M--)(R=d[M])&&(k=(D<3?R(k):D>3?R(h,w,k):R(h,w))||k);return D>3&&k&&Object.defineProperty(h,w,k),k},v=this&&this.__param||function(d,h){return function(w,L){h(w,L,d)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const l=c(1439),m=c(8460),x=c(844),b=c(2585),C=Object.freeze({insertMode:!1}),f=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let p=a.CoreService=class extends x.Disposable{constructor(d,h,w){super(),this._bufferService=d,this._logService=h,this._optionsService=w,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new m.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new m.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,l.clone)(C),this.decPrivateModes=(0,l.clone)(f)}reset(){this.modes=(0,l.clone)(C),this.decPrivateModes=(0,l.clone)(f)}triggerDataEvent(d,h=!1){if(this._optionsService.rawOptions.disableStdin)return;const w=this._bufferService.buffer;h&&this._optionsService.rawOptions.scrollOnUserInput&&w.ybase!==w.ydisp&&this._onRequestScrollToBottom.fire(),h&&this._onUserInput.fire(),this._logService.debug(`sending data "${d}"`,(()=>d.split("").map((L=>L.charCodeAt(0))))),this._onData.fire(d)}triggerBinaryEvent(d){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${d}"`,(()=>d.split("").map((h=>h.charCodeAt(0))))),this._onBinary.fire(d))}};a.CoreService=p=_([v(0,b.IBufferService),v(1,b.ILogService),v(2,b.IOptionsService)],p)},9074:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const _=c(8055),v=c(8460),l=c(844),m=c(6106);let x=0,b=0;class C extends l.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new m.SortedList((d=>d==null?void 0:d.marker.line)),this._onDecorationRegistered=this.register(new v.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new v.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,l.toDisposable)((()=>this.reset())))}registerDecoration(d){if(d.marker.isDisposed)return;const h=new f(d);if(h){const w=h.marker.onDispose((()=>h.dispose()));h.onDispose((()=>{h&&(this._decorations.delete(h)&&this._onDecorationRemoved.fire(h),w.dispose())})),this._decorations.insert(h),this._onDecorationRegistered.fire(h)}return h}reset(){for(const d of this._decorations.values())d.dispose();this._decorations.clear()}*getDecorationsAtCell(d,h,w){let L=0,R=0;for(const D of this._decorations.getKeyIterator(h))L=D.options.x??0,R=L+(D.options.width??1),d>=L&&d<R&&(!w||(D.options.layer??"bottom")===w)&&(yield D)}forEachDecorationAtCell(d,h,w,L){this._decorations.forEachByKey(h,(R=>{x=R.options.x??0,b=x+(R.options.width??1),d>=x&&d<b&&(!w||(R.options.layer??"bottom")===w)&&L(R)}))}}a.DecorationService=C;class f extends l.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=_.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=_.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(d){super(),this.options=d,this.onRenderEmitter=this.register(new v.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new v.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:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const _=c(2585),v=c(8343);class l{constructor(...x){this._entries=new Map;for(const[b,C]of x)this.set(b,C)}set(x,b){const C=this._entries.get(x);return this._entries.set(x,b),C}forEach(x){for(const[b,C]of this._entries.entries())x(b,C)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}a.ServiceCollection=l,a.InstantiationService=class{constructor(){this._services=new l,this._services.set(_.IInstantiationService,this)}setService(m,x){this._services.set(m,x)}getService(m){return this._services.get(m)}createInstance(m,...x){const b=(0,v.getServiceDependencies)(m).sort(((p,d)=>p.index-d.index)),C=[];for(const p of b){const d=this._services.get(p.id);if(!d)throw new Error(`[createInstance] ${m.name} depends on UNKNOWN service ${p.id}.`);C.push(d)}const f=b.length>0?b[0].index:x.length;if(x.length!==f)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${f+1} conflicts with ${x.length} static arguments`);return new m(...x,...C)}}},7866:function(y,a,c){var _=this&&this.__decorate||function(f,p,d,h){var w,L=arguments.length,R=L<3?p:h===null?h=Object.getOwnPropertyDescriptor(p,d):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,p,d,h);else for(var D=f.length-1;D>=0;D--)(w=f[D])&&(R=(L<3?w(R):L>3?w(p,d,R):w(p,d))||R);return L>3&&R&&Object.defineProperty(p,d,R),R},v=this&&this.__param||function(f,p){return function(d,h){p(d,h,f)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const l=c(844),m=c(2585),x={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let b,C=a.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(f){super(),this._optionsService=f,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),b=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(f){for(let p=0;p<f.length;p++)typeof f[p]=="function"&&(f[p]=f[p]())}_log(f,p,d){this._evalLazyOptionalParams(d),f.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+p,...d)}trace(f,...p){var d;this._logLevel<=m.LogLevelEnum.TRACE&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.trace.bind(this._optionsService.options.logger))??console.log,f,p)}debug(f,...p){var d;this._logLevel<=m.LogLevelEnum.DEBUG&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.debug.bind(this._optionsService.options.logger))??console.log,f,p)}info(f,...p){var d;this._logLevel<=m.LogLevelEnum.INFO&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.info.bind(this._optionsService.options.logger))??console.info,f,p)}warn(f,...p){var d;this._logLevel<=m.LogLevelEnum.WARN&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.warn.bind(this._optionsService.options.logger))??console.warn,f,p)}error(f,...p){var d;this._logLevel<=m.LogLevelEnum.ERROR&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.error.bind(this._optionsService.options.logger))??console.error,f,p)}};a.LogService=C=_([v(0,m.IOptionsService)],C),a.setTraceLogger=function(f){b=f},a.traceCall=function(f,p,d){if(typeof d.value!="function")throw new Error("not supported");const h=d.value;d.value=function(...w){if(b.logLevel!==m.LogLevelEnum.TRACE)return h.apply(this,w);b.trace(`GlyphRenderer#${h.name}(${w.map((R=>JSON.stringify(R))).join(", ")})`);const L=h.apply(this,w);return b.trace(`GlyphRenderer#${h.name} return`,L),L}}},7302:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const _=c(8460),v=c(844),l=c(6114);a.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:l.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const m=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends v.Disposable{constructor(C){super(),this._onOptionChange=this.register(new _.EventEmitter),this.onOptionChange=this._onOptionChange.event;const f={...a.DEFAULT_OPTIONS};for(const p in C)if(p in f)try{const d=C[p];f[p]=this._sanitizeAndValidateOption(p,d)}catch(d){console.error(d)}this.rawOptions=f,this.options={...f},this._setupOptions(),this.register((0,v.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(C,f){return this.onOptionChange((p=>{p===C&&f(this.rawOptions[C])}))}onMultipleOptionChange(C,f){return this.onOptionChange((p=>{C.indexOf(p)!==-1&&f()}))}_setupOptions(){const C=p=>{if(!(p in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);return this.rawOptions[p]},f=(p,d)=>{if(!(p in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);d=this._sanitizeAndValidateOption(p,d),this.rawOptions[p]!==d&&(this.rawOptions[p]=d,this._onOptionChange.fire(p))};for(const p in this.rawOptions){const d={get:C.bind(this,p),set:f.bind(this,p)};Object.defineProperty(this.options,p,d)}}_sanitizeAndValidateOption(C,f){switch(C){case"cursorStyle":if(f||(f=a.DEFAULT_OPTIONS[C]),!(function(p){return p==="block"||p==="underline"||p==="bar"})(f))throw new Error(`"${f}" is not a valid value for ${C}`);break;case"wordSeparator":f||(f=a.DEFAULT_OPTIONS[C]);break;case"fontWeight":case"fontWeightBold":if(typeof f=="number"&&1<=f&&f<=1e3)break;f=m.includes(f)?f:a.DEFAULT_OPTIONS[C];break;case"cursorWidth":f=Math.floor(f);case"lineHeight":case"tabStopWidth":if(f<1)throw new Error(`${C} cannot be less than 1, value: ${f}`);break;case"minimumContrastRatio":f=Math.max(1,Math.min(21,Math.round(10*f)/10));break;case"scrollback":if((f=Math.min(f,4294967295))<0)throw new Error(`${C} cannot be less than 0, value: ${f}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(f<=0)throw new Error(`${C} cannot be less than or equal to 0, value: ${f}`);break;case"rows":case"cols":if(!f&&f!==0)throw new Error(`${C} must be numeric, value: ${f}`);break;case"windowsPty":f=f??{}}return f}}a.OptionsService=x},2660:function(y,a,c){var _=this&&this.__decorate||function(x,b,C,f){var p,d=arguments.length,h=d<3?b:f===null?f=Object.getOwnPropertyDescriptor(b,C):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(x,b,C,f);else for(var w=x.length-1;w>=0;w--)(p=x[w])&&(h=(d<3?p(h):d>3?p(b,C,h):p(b,C))||h);return d>3&&h&&Object.defineProperty(b,C,h),h},v=this&&this.__param||function(x,b){return function(C,f){b(C,f,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const l=c(2585);let m=a.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const b=this._bufferService.buffer;if(x.id===void 0){const w=b.addMarker(b.ybase+b.y),L={data:x,id:this._nextId++,lines:[w]};return w.onDispose((()=>this._removeMarkerFromLink(L,w))),this._dataByLinkId.set(L.id,L),L.id}const C=x,f=this._getEntryIdKey(C),p=this._entriesWithId.get(f);if(p)return this.addLineToLink(p.id,b.ybase+b.y),p.id;const d=b.addMarker(b.ybase+b.y),h={id:this._nextId++,key:this._getEntryIdKey(C),data:C,lines:[d]};return d.onDispose((()=>this._removeMarkerFromLink(h,d))),this._entriesWithId.set(h.key,h),this._dataByLinkId.set(h.id,h),h.id}addLineToLink(x,b){const C=this._dataByLinkId.get(x);if(C&&C.lines.every((f=>f.line!==b))){const f=this._bufferService.buffer.addMarker(b);C.lines.push(f),f.onDispose((()=>this._removeMarkerFromLink(C,f)))}}getLinkData(x){var b;return(b=this._dataByLinkId.get(x))==null?void 0:b.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,b){const C=x.lines.indexOf(b);C!==-1&&(x.lines.splice(C,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};a.OscLinkService=m=_([v(0,l.IBufferService)],m)},8343:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const c="di$target",_="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(v){return v[_]||[]},a.createDecorator=function(v){if(a.serviceRegistry.has(v))return a.serviceRegistry.get(v);const l=function(m,x,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(C,f,p){f[c]===f?f[_].push({id:C,index:p}):(f[_]=[{id:C,index:p}],f[c]=f)})(l,m,b)};return l.toString=()=>v,a.serviceRegistry.set(v,l),l}},2585:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const _=c(8343);var v;a.IBufferService=(0,_.createDecorator)("BufferService"),a.ICoreMouseService=(0,_.createDecorator)("CoreMouseService"),a.ICoreService=(0,_.createDecorator)("CoreService"),a.ICharsetService=(0,_.createDecorator)("CharsetService"),a.IInstantiationService=(0,_.createDecorator)("InstantiationService"),(function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"})(v||(a.LogLevelEnum=v={})),a.ILogService=(0,_.createDecorator)("LogService"),a.IOptionsService=(0,_.createDecorator)("OptionsService"),a.IOscLinkService=(0,_.createDecorator)("OscLinkService"),a.IUnicodeService=(0,_.createDecorator)("UnicodeService"),a.IDecorationService=(0,_.createDecorator)("DecorationService")},1480:(y,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const _=c(8460),v=c(225);class l{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,b,C=!1){return(16777215&x)<<3|(3&b)<<1|(C?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new _.EventEmitter,this.onChange=this._onChange.event;const x=new v.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let b=0,C=0;const f=x.length;for(let p=0;p<f;++p){let d=x.charCodeAt(p);if(55296<=d&&d<=56319){if(++p>=f)return b+this.wcwidth(d);const L=x.charCodeAt(p);56320<=L&&L<=57343?d=1024*(d-55296)+L-56320+65536:b+=this.wcwidth(L)}const h=this.charProperties(d,C);let w=l.extractWidth(h);l.extractShouldJoin(h)&&(w-=l.extractWidth(C)),b+=w,C=h}return b}charProperties(x,b){return this._activeProvider.charProperties(x,b)}}a.UnicodeService=l}},o={};function u(y){var a=o[y];if(a!==void 0)return a.exports;var c=o[y]={exports:{}};return i[y].call(c.exports,c,c.exports,u),c.exports}var S={};return(()=>{var y=S;Object.defineProperty(y,"__esModule",{value:!0}),y.Terminal=void 0;const a=u(9042),c=u(3236),_=u(844),v=u(5741),l=u(8285),m=u(7975),x=u(7090),b=["cols","rows"];class C extends _.Disposable{constructor(p){super(),this._core=this.register(new c.Terminal(p)),this._addonManager=this.register(new v.AddonManager),this._publicOptions={...this._core.options};const d=w=>this._core.options[w],h=(w,L)=>{this._checkReadonlyOptions(w),this._core.options[w]=L};for(const w in this._core.options){const L={get:d.bind(this,w),set:h.bind(this,w)};Object.defineProperty(this._publicOptions,w,L)}}_checkReadonlyOptions(p){if(b.includes(p))throw new Error(`Option "${p}" 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 m.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new l.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const p=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:p.applicationCursorKeys,applicationKeypadMode:p.applicationKeypad,bracketedPasteMode:p.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:d,originMode:p.origin,reverseWraparoundMode:p.reverseWraparound,sendFocusMode:p.sendFocus,wraparoundMode:p.wraparound}}get options(){return this._publicOptions}set options(p){for(const d in p)this._publicOptions[d]=p[d]}blur(){this._core.blur()}focus(){this._core.focus()}input(p,d=!0){this._core.input(p,d)}resize(p,d){this._verifyIntegers(p,d),this._core.resize(p,d)}open(p){this._core.open(p)}attachCustomKeyEventHandler(p){this._core.attachCustomKeyEventHandler(p)}attachCustomWheelEventHandler(p){this._core.attachCustomWheelEventHandler(p)}registerLinkProvider(p){return this._core.registerLinkProvider(p)}registerCharacterJoiner(p){return this._checkProposedApi(),this._core.registerCharacterJoiner(p)}deregisterCharacterJoiner(p){this._checkProposedApi(),this._core.deregisterCharacterJoiner(p)}registerMarker(p=0){return this._verifyIntegers(p),this._core.registerMarker(p)}registerDecoration(p){return this._checkProposedApi(),this._verifyPositiveIntegers(p.x??0,p.width??0,p.height??0),this._core.registerDecoration(p)}hasSelection(){return this._core.hasSelection()}select(p,d,h){this._verifyIntegers(p,d,h),this._core.select(p,d,h)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(p,d){this._verifyIntegers(p,d),this._core.selectLines(p,d)}dispose(){super.dispose()}scrollLines(p){this._verifyIntegers(p),this._core.scrollLines(p)}scrollPages(p){this._verifyIntegers(p),this._core.scrollPages(p)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(p){this._verifyIntegers(p),this._core.scrollToLine(p)}clear(){this._core.clear()}write(p,d){this._core.write(p,d)}writeln(p,d){this._core.write(p),this._core.write(`\r
|
|
70
|
+
`,d)}paste(p){this._core.paste(p)}refresh(p,d){this._verifyIntegers(p,d),this._core.refresh(p,d)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(p){this._addonManager.loadAddon(this,p)}static get strings(){return a}_verifyIntegers(...p){for(const d of p)if(d===1/0||isNaN(d)||d%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...p){for(const d of p)if(d&&(d===1/0||isNaN(d)||d%1!=0||d<0))throw new Error("This API only accepts positive integers")}}y.Terminal=C})(),S})()))})(iu)),iu.exports}var em=sb(),su={exports:{}},Jp;function ob(){return Jp||(Jp=1,(function(e,r){(function(i,o){e.exports=o()})(self,(()=>(()=>{var i={};return(()=>{var o=i;Object.defineProperty(o,"__esModule",{value:!0}),o.FitAddon=void 0,o.FitAddon=class{activate(u){this._terminal=u}dispose(){}fit(){const u=this.proposeDimensions();if(!u||!this._terminal||isNaN(u.cols)||isNaN(u.rows))return;const S=this._terminal._core;this._terminal.rows===u.rows&&this._terminal.cols===u.cols||(S._renderService.clear(),this._terminal.resize(u.cols,u.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const u=this._terminal._core,S=u._renderService.dimensions;if(S.css.cell.width===0||S.css.cell.height===0)return;const y=this._terminal.options.scrollback===0?0:u.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(a.getPropertyValue("height")),_=Math.max(0,parseInt(a.getPropertyValue("width"))),v=window.getComputedStyle(this._terminal.element),l=c-(parseInt(v.getPropertyValue("padding-top"))+parseInt(v.getPropertyValue("padding-bottom"))),m=_-(parseInt(v.getPropertyValue("padding-right"))+parseInt(v.getPropertyValue("padding-left")))-y;return{cols:Math.max(2,Math.floor(m/S.css.cell.width)),rows:Math.max(1,Math.floor(l/S.css.cell.height))}}}})(),i})()))})(su)),su.exports}var tm=ob();/**
|
|
71
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
72
|
+
* @license MIT
|
|
73
|
+
*
|
|
74
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
75
|
+
* @license MIT
|
|
76
|
+
*
|
|
77
|
+
* Originally forked from (with the author's permission):
|
|
78
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
79
|
+
* http://bellard.org/jslinux/
|
|
80
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
81
|
+
*/var ou=[[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]],ab=[[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]],Ze;function lb(e,r){let i=0,o=r.length-1,u;if(e<r[0][0]||e>r[o][1])return!1;for(;o>=i;)if(u=i+o>>1,e>r[u][1])i=u+1;else if(e<r[u][0])o=u-1;else return!0;return!1}var cb=class{constructor(){if(this.version="6",!Ze){Ze=new Uint8Array(65536),Ze.fill(1),Ze[0]=0,Ze.fill(0,1,32),Ze.fill(0,127,160),Ze.fill(2,4352,4448),Ze[9001]=2,Ze[9002]=2,Ze.fill(2,11904,42192),Ze[12351]=1,Ze.fill(2,44032,55204),Ze.fill(2,63744,64256),Ze.fill(2,65040,65050),Ze.fill(2,65072,65136),Ze.fill(2,65280,65377),Ze.fill(2,65504,65511);for(let e=0;e<ou.length;++e)Ze.fill(0,ou[e][0],ou[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Ze[e]:lb(e,ab)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,r){let i=this.wcwidth(e),o=i===0&&r!==0;if(o){let u=Aa.extractWidth(r);u===0?o=!1:u>i&&(i=u)}return Aa.createPropertyValue(0,i,o)}},ub=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Zp.isErrorNoTelemetry(e)?new Zp(e.message+`
|
|
82
|
+
|
|
83
|
+
`+e.stack):new Error(e.message+`
|
|
84
|
+
|
|
85
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(r=>{r(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},hb=new ub;function au(e){db(e)||hb.onUnexpectedError(e)}var Mu="Canceled";function db(e){return e instanceof fb?!0:e instanceof Error&&e.name===Mu&&e.message===Mu}var fb=class extends Error{constructor(){super(Mu),this.name=this.message}},Zp=class Pu extends Error{constructor(r){super(r),this.name="CodeExpectedError"}static fromError(r){if(r instanceof Pu)return r;let i=new Pu;return i.message=r.message,i.stack=r.stack,i}static isErrorNoTelemetry(r){return r.name==="CodeExpectedError"}};function pb(e,r){let i=this,o=!1,u;return function(){return o||(o=!0,r||(u=e.apply(i,arguments))),u}}var _b;(e=>{function r(S){return S<0}e.isLessThan=r;function i(S){return S<=0}e.isLessThanOrEqual=i;function o(S){return S>0}e.isGreaterThan=o;function u(S){return S===0}e.isNeitherLessOrGreaterThan=u,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(_b||(_b={}));var rm;(e=>{function r(w){return w&&typeof w=="object"&&typeof w[Symbol.iterator]=="function"}e.is=r;let i=Object.freeze([]);function o(){return i}e.empty=o;function*u(w){yield w}e.single=u;function S(w){return r(w)?w:u(w)}e.wrap=S;function y(w){return w||i}e.from=y;function*a(w){for(let L=w.length-1;L>=0;L--)yield w[L]}e.reverse=a;function c(w){return!w||w[Symbol.iterator]().next().done===!0}e.isEmpty=c;function _(w){return w[Symbol.iterator]().next().value}e.first=_;function v(w,L){let R=0;for(let D of w)if(L(D,R++))return!0;return!1}e.some=v;function l(w,L){for(let R of w)if(L(R))return R}e.find=l;function*m(w,L){for(let R of w)L(R)&&(yield R)}e.filter=m;function*x(w,L){let R=0;for(let D of w)yield L(D,R++)}e.map=x;function*b(w,L){let R=0;for(let D of w)yield*L(D,R++)}e.flatMap=b;function*C(...w){for(let L of w)yield*L}e.concat=C;function f(w,L,R){let D=R;for(let k of w)D=L(D,k);return D}e.reduce=f;function*p(w,L,R=w.length){for(L<0&&(L+=w.length),R<0?R+=w.length:R>w.length&&(R=w.length);L<R;L++)yield w[L]}e.slice=p;function d(w,L=Number.POSITIVE_INFINITY){let R=[];if(L===0)return[R,w];let D=w[Symbol.iterator]();for(let k=0;k<L;k++){let M=D.next();if(M.done)return[R,e.empty()];R.push(M.value)}return[R,{[Symbol.iterator](){return D}}]}e.consume=d;async function h(w){let L=[];for await(let R of w)L.push(R);return Promise.resolve(L)}e.asyncToArray=h})(rm||(rm={}));function nm(e){if(rm.is(e)){let r=[];for(let i of e)if(i)try{i.dispose()}catch(o){r.push(o)}if(r.length===1)throw r[0];if(r.length>1)throw new AggregateError(r,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function gb(...e){return im(()=>nm(e))}function im(e){return{dispose:pb(()=>{e()})}}var sm=class om{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{nm(this._toDispose)}finally{this._toDispose.clear()}}add(r){if(!r)return r;if(r===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?om.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(r),r}delete(r){if(r){if(r===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(r),r.dispose()}}deleteAndLeak(r){r&&this._toDispose.has(r)&&(this._toDispose.delete(r),void 0)}};sm.DISABLE_DISPOSED_WARNING=!1;var ah=sm,Ta=class{constructor(){this._store=new ah,this._store}dispose(){this._store.dispose()}_register(r){if(r===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(r)}};Ta.None=Object.freeze({dispose(){}});var mb=globalThis.performance&&typeof globalThis.performance.now=="function",vb=class am{static create(r){return new am(r)}constructor(r){this._now=mb&&r===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},yb;(e=>{e.None=()=>Ta.None;function r(F,N){return l(F,()=>{},0,void 0,!0,void 0,N)}e.defer=r;function i(F){return(N,I=null,q)=>{let V=!1,K;return K=F(U=>{if(!V)return K?K.dispose():V=!0,N.call(I,U)},null,q),V&&K.dispose(),K}}e.once=i;function o(F,N,I){return _((q,V=null,K)=>F(U=>q.call(V,N(U)),null,K),I)}e.map=o;function u(F,N,I){return _((q,V=null,K)=>F(U=>{N(U),q.call(V,U)},null,K),I)}e.forEach=u;function S(F,N,I){return _((q,V=null,K)=>F(U=>N(U)&&q.call(V,U),null,K),I)}e.filter=S;function y(F){return F}e.signal=y;function a(...F){return(N,I=null,q)=>{let V=gb(...F.map(K=>K(U=>N.call(I,U))));return v(V,q)}}e.any=a;function c(F,N,I,q){let V=I;return o(F,K=>(V=N(V,K),V),q)}e.reduce=c;function _(F,N){let I,q={onWillAddFirstListener(){I=F(V.fire,V)},onDidRemoveLastListener(){I==null||I.dispose()}},V=new Qr(q);return N==null||N.add(V),V.event}function v(F,N){return N instanceof Array?N.push(F):N&&N.add(F),F}function l(F,N,I=100,q=!1,V=!1,K,U){let A,B,P,H=0,G,Z={leakWarningThreshold:K,onWillAddFirstListener(){A=F(ee=>{H++,B=N(B,ee),q&&!P&&(se.fire(B),B=void 0),G=()=>{let X=B;B=void 0,P=void 0,(!q||H>1)&&se.fire(X),H=0},typeof I=="number"?(clearTimeout(P),P=setTimeout(G,I)):P===void 0&&(P=0,queueMicrotask(G))})},onWillRemoveListener(){V&&H>0&&(G==null||G())},onDidRemoveLastListener(){G=void 0,A.dispose()}},se=new Qr(Z);return U==null||U.add(se),se.event}e.debounce=l;function m(F,N=0,I){return e.debounce(F,(q,V)=>q?(q.push(V),q):[V],N,void 0,!0,void 0,I)}e.accumulate=m;function x(F,N=(q,V)=>q===V,I){let q=!0,V;return S(F,K=>{let U=q||!N(K,V);return q=!1,V=K,U},I)}e.latch=x;function b(F,N,I){return[e.filter(F,N,I),e.filter(F,q=>!N(q),I)]}e.split=b;function C(F,N=!1,I=[],q){let V=I.slice(),K=F(B=>{V?V.push(B):A.fire(B)});q&&q.add(K);let U=()=>{V==null||V.forEach(B=>A.fire(B)),V=null},A=new Qr({onWillAddFirstListener(){K||(K=F(B=>A.fire(B)),q&&q.add(K))},onDidAddFirstListener(){V&&(N?setTimeout(U):U())},onDidRemoveLastListener(){K&&K.dispose(),K=null}});return q&&q.add(A),A.event}e.buffer=C;function f(F,N){return(I,q,V)=>{let K=N(new d);return F(function(U){let A=K.evaluate(U);A!==p&&I.call(q,A)},void 0,V)}}e.chain=f;let p=Symbol("HaltChainable");class d{constructor(){this.steps=[]}map(N){return this.steps.push(N),this}forEach(N){return this.steps.push(I=>(N(I),I)),this}filter(N){return this.steps.push(I=>N(I)?I:p),this}reduce(N,I){let q=I;return this.steps.push(V=>(q=N(q,V),q)),this}latch(N=(I,q)=>I===q){let I=!0,q;return this.steps.push(V=>{let K=I||!N(V,q);return I=!1,q=V,K?V:p}),this}evaluate(N){for(let I of this.steps)if(N=I(N),N===p)break;return N}}function h(F,N,I=q=>q){let q=(...A)=>U.fire(I(...A)),V=()=>F.on(N,q),K=()=>F.removeListener(N,q),U=new Qr({onWillAddFirstListener:V,onDidRemoveLastListener:K});return U.event}e.fromNodeEventEmitter=h;function w(F,N,I=q=>q){let q=(...A)=>U.fire(I(...A)),V=()=>F.addEventListener(N,q),K=()=>F.removeEventListener(N,q),U=new Qr({onWillAddFirstListener:V,onDidRemoveLastListener:K});return U.event}e.fromDOMEventEmitter=w;function L(F){return new Promise(N=>i(F)(N))}e.toPromise=L;function R(F){let N=new Qr;return F.then(I=>{N.fire(I)},()=>{N.fire(void 0)}).finally(()=>{N.dispose()}),N.event}e.fromPromise=R;function D(F,N){return F(I=>N.fire(I))}e.forward=D;function k(F,N,I){return N(I),F(q=>N(q))}e.runAndSubscribe=k;class M{constructor(N,I){this._observable=N,this._counter=0,this._hasChanged=!1;let q={onWillAddFirstListener:()=>{N.addObserver(this)},onDidRemoveLastListener:()=>{N.removeObserver(this)}};this.emitter=new Qr(q),I&&I.add(this.emitter)}beginUpdate(N){this._counter++}handlePossibleChange(N){}handleChange(N,I){this._hasChanged=!0}endUpdate(N){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function W(F,N){return new M(F,N).emitter.event}e.fromObservable=W;function z(F){return(N,I,q)=>{let V=0,K=!1,U={beginUpdate(){V++},endUpdate(){V--,V===0&&(F.reportChanges(),K&&(K=!1,N.call(I)))},handlePossibleChange(){},handleChange(){K=!0}};F.addObserver(U),F.reportChanges();let A={dispose(){F.removeObserver(U)}};return q instanceof ah?q.add(A):Array.isArray(q)&&q.push(A),A}}e.fromObservableLight=z})(yb||(yb={}));var Bu=class Nu{constructor(r){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${r}_${Nu._idPool++}`,Nu.all.add(this)}start(r){this._stopWatch=new vb,this.listenerCount=r}stop(){if(this._stopWatch){let r=this._stopWatch.elapsed();this.durations.push(r),this.elapsedOverall+=r,this.invocationCount+=1,this._stopWatch=void 0}}};Bu.all=new Set,Bu._idPool=0;var wb=Bu,Sb=-1,lm=class cm{constructor(r,i,o=(cm._idPool++).toString(16).padStart(3,"0")){this._errorHandler=r,this.threshold=i,this.name=o,this._warnCountdown=0}dispose(){var r;(r=this._stacks)==null||r.clear()}check(r,i){let o=this.threshold;if(o<=0||i<o)return;this._stacks||(this._stacks=new Map);let u=this._stacks.get(r.value)||0;if(this._stacks.set(r.value,u+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=o*.5;let[S,y]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${y}):`;console.warn(a),console.warn(S);let c=new bb(a,S);this._errorHandler(c)}return()=>{let S=this._stacks.get(r.value)||0;this._stacks.set(r.value,S-1)}}getMostFrequentStack(){if(!this._stacks)return;let r,i=0;for(let[o,u]of this._stacks)(!r||i<u)&&(r=[o,u],i=u);return r}};lm._idPool=1;var Cb=lm,xb=class um{constructor(r){this.value=r}static create(){let r=new Error;return new um(r.stack??"")}print(){console.warn(this.value.split(`
|
|
86
|
+
`).slice(2).join(`
|
|
87
|
+
`))}},bb=class extends Error{constructor(e,r){super(e),this.name="ListenerLeakError",this.stack=r}},Eb=class extends Error{constructor(e,r){super(e),this.name="ListenerRefusalError",this.stack=r}},kb=0,lu=class{constructor(e){this.value=e,this.id=kb++}},Lb=2,Rb,Qr=class{constructor(e){var r,i,o,u;this._size=0,this._options=e,this._leakageMon=(r=this._options)!=null&&r.leakWarningThreshold?new Cb((e==null?void 0:e.onListenerError)??au,((i=this._options)==null?void 0:i.leakWarningThreshold)??Sb):void 0,this._perfMon=(o=this._options)!=null&&o._profName?new wb(this._options._profName):void 0,this._deliveryQueue=(u=this._options)==null?void 0:u.deliveryQueue}dispose(){var e,r,i,o;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(i=(r=this._options)==null?void 0:r.onDidRemoveLastListener)==null||i.call(r),(o=this._leakageMon)==null||o.dispose())}get event(){return this._event??(this._event=(e,r,i)=>{var y,a,c,_,v;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let l=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l);let m=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],x=new Eb(`${l}. HINT: Stack shows most frequent listener (${m[1]}-times)`,m[0]);return(((y=this._options)==null?void 0:y.onListenerError)||au)(x),Ta.None}if(this._disposed)return Ta.None;r&&(e=e.bind(r));let o=new lu(e),u;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=xb.create(),u=this._leakageMon.check(o.stack,this._size+1)),this._listeners?this._listeners instanceof lu?(this._deliveryQueue??(this._deliveryQueue=new Db),this._listeners=[this._listeners,o]):this._listeners.push(o):((c=(a=this._options)==null?void 0:a.onWillAddFirstListener)==null||c.call(a,this),this._listeners=o,(v=(_=this._options)==null?void 0:_.onDidAddFirstListener)==null||v.call(_,this)),this._size++;let S=im(()=>{u==null||u(),this._removeListener(o)});return i instanceof ah?i.add(S):Array.isArray(i)&&i.push(S),S}),this._event}_removeListener(e){var u,S,y,a;if((S=(u=this._options)==null?void 0:u.onWillRemoveListener)==null||S.call(u,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(a=(y=this._options)==null?void 0:y.onDidRemoveLastListener)==null||a.call(y,this),this._size=0;return}let r=this._listeners,i=r.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[i]=void 0;let o=this._deliveryQueue.current===this;if(this._size*Lb<=r.length){let c=0;for(let _=0;_<r.length;_++)r[_]?r[c++]=r[_]:o&&(this._deliveryQueue.end--,c<this._deliveryQueue.i&&this._deliveryQueue.i--);r.length=c}}_deliver(e,r){var o;if(!e)return;let i=((o=this._options)==null?void 0:o.onListenerError)||au;if(!i){e.value(r);return}try{e.value(r)}catch(u){i(u)}}_deliverQueue(e){let r=e.current._listeners;for(;e.i<e.end;)this._deliver(r[e.i++],e.value);e.reset()}fire(e){var r,i,o,u;if((r=this._deliveryQueue)!=null&&r.current&&(this._deliverQueue(this._deliveryQueue),(i=this._perfMon)==null||i.stop()),(o=this._perfMon)==null||o.start(this._size),this._listeners)if(this._listeners instanceof lu)this._deliver(this._listeners,e);else{let S=this._deliveryQueue;S.enqueue(this,e,this._listeners.length),this._deliverQueue(S)}(u=this._perfMon)==null||u.stop()}hasListeners(){return this._size>0}},Db=class{constructor(){this.i=-1,this.end=0}enqueue(e,r,i){this.i=0,this.end=i,this.current=e,this.value=r}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Aa=class ma{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Qr,this.onChange=this._onChange.event;let r=new cb;this.register(r),this._active=r.version,this._activeProvider=r}static extractShouldJoin(r){return(r&1)!==0}static extractWidth(r){return r>>1&3}static extractCharKind(r){return r>>3}static createPropertyValue(r,i,o=!1){return(r&16777215)<<3|(i&3)<<1|(o?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(r){if(!this._providers[r])throw new Error(`unknown Unicode version "${r}"`);this._active=r,this._activeProvider=this._providers[r],this._onChange.fire(r)}register(r){this._providers[r.version]=r}wcwidth(r){return this._activeProvider.wcwidth(r)}getStringCellWidth(r){let i=0,o=0,u=r.length;for(let S=0;S<u;++S){let y=r.charCodeAt(S);if(55296<=y&&y<=56319){if(++S>=u)return i+this.wcwidth(y);let _=r.charCodeAt(S);56320<=_&&_<=57343?y=(y-55296)*1024+_-56320+65536:i+=this.wcwidth(_)}let a=this.charProperties(y,o),c=ma.extractWidth(a);ma.extractShouldJoin(a)&&(c-=ma.extractWidth(o)),i+=c,o=a}return i}charProperties(r,i){return this._activeProvider.charProperties(r,i)}},cu=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],Tb=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],uu=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],Ab=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],br;function e_(e,r){let i=0,o=r.length-1,u;if(e<r[0][0]||e>r[o][1])return!1;for(;o>=i;)if(u=i+o>>1,e>r[u][1])i=u+1;else if(e<r[u][0])o=u-1;else return!0;return!1}var Mb=class{constructor(){if(this.version="11",!br){br=new Uint8Array(65536),br.fill(1),br[0]=0,br.fill(0,1,32),br.fill(0,127,160);for(let e=0;e<cu.length;++e)br.fill(0,cu[e][0],cu[e][1]+1);for(let e=0;e<uu.length;++e)br.fill(2,uu[e][0],uu[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?br[e]:e_(e,Tb)?0:e_(e,Ab)?2:1}charProperties(e,r){let i=this.wcwidth(e),o=i===0&&r!==0;if(o){let u=Aa.extractWidth(r);u===0?o=!1:u>i&&(i=u)}return Aa.createPropertyValue(0,i,o)}},hm=class{activate(e){e.unicode.register(new Mb)}dispose(){}};/**
|
|
88
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
89
|
+
* @license MIT
|
|
90
|
+
*
|
|
91
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
92
|
+
* @license MIT
|
|
93
|
+
*
|
|
94
|
+
* Originally forked from (with the author's permission):
|
|
95
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
96
|
+
* http://bellard.org/jslinux/
|
|
97
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
98
|
+
*/var Pb=class{constructor(e,r,i,o={}){this._terminal=e,this._regex=r,this._handler=i,this._options=o}provideLinks(e,r){let i=Nb.computeLink(e,this._regex,this._terminal,this._handler);r(this._addCallbacks(i))}_addCallbacks(e){return e.map(r=>(r.leave=this._options.leave,r.hover=(i,o)=>{if(this._options.hover){let{range:u}=r;this._options.hover(i,o,u)}},r))}};function Bb(e){try{let r=new URL(e),i=r.password&&r.username?`${r.protocol}//${r.username}:${r.password}@${r.host}`:r.username?`${r.protocol}//${r.username}@${r.host}`:`${r.protocol}//${r.host}`;return e.toLocaleLowerCase().startsWith(i.toLocaleLowerCase())}catch{return!1}}var Nb=class va{static computeLink(r,i,o,u){let S=new RegExp(i.source,(i.flags||"")+"g"),[y,a]=va._getWindowedLineStrings(r-1,o),c=y.join(""),_,v=[];for(;_=S.exec(c);){let l=_[0];if(!Bb(l))continue;let[m,x]=va._mapStrIdx(o,a,0,_.index),[b,C]=va._mapStrIdx(o,m,x,l.length);if(m===-1||x===-1||b===-1||C===-1)continue;let f={start:{x:x+1,y:m+1},end:{x:C,y:b+1}};v.push({range:f,text:l,activate:u})}return v}static _getWindowedLineStrings(r,i){let o,u=r,S=r,y=0,a="",c=[];if(o=i.buffer.active.getLine(r)){let _=o.translateToString(!0);if(o.isWrapped&&_[0]!==" "){for(y=0;(o=i.buffer.active.getLine(--u))&&y<2048&&(a=o.translateToString(!0),y+=a.length,c.push(a),!(!o.isWrapped||a.indexOf(" ")!==-1)););c.reverse()}for(c.push(_),y=0;(o=i.buffer.active.getLine(++S))&&o.isWrapped&&y<2048&&(a=o.translateToString(!0),y+=a.length,c.push(a),a.indexOf(" ")===-1););}return[c,u]}static _mapStrIdx(r,i,o,u){let S=r.buffer.active,y=S.getNullCell(),a=o;for(;u;){let c=S.getLine(i);if(!c)return[-1,-1];for(let _=a;_<c.length;++_){c.getCell(_,y);let v=y.getChars();if(y.getWidth()&&(u-=v.length||1,_===c.length-1&&v==="")){let l=S.getLine(i+1);l&&l.isWrapped&&(l.getCell(0,y),y.getWidth()===2&&(u+=1))}if(u<0)return[i,_]}i++,a=0}return[i,a]}},Ib=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function Ob(e,r){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=r}else console.warn("Opening link blocked as opener could not be cleared")}var dm=class{constructor(e=Ob,r={}){this._handler=e,this._options=r}activate(e){this._terminal=e;let r=this._options,i=r.urlRegex||Ib;this._linkProvider=this._terminal.registerLinkProvider(new Pb(this._terminal,i,this._handler,r))}dispose(){var e;(e=this._linkProvider)==null||e.dispose()}};async function Hb(e){try{const r=await e.arrayBuffer(),i=new Uint8Array(r);let o="";const u=8192;for(let c=0;c<i.length;c+=u)o+=String.fromCharCode(...i.subarray(c,c+u));const S=btoa(o);return(await(await fetch("/api/upload-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:S,mimeType:e.type})})).json()).path||null}catch{return null}}function Fb({agent:e,socket:r}){const i=J.useRef(null),o=J.useRef(null),u=J.useRef(null),S=J.useRef(null),y=J.useRef(!1),a=()=>{if(o.current||!i.current||y.current)return;y.current=!0;const _=new em.Terminal({theme:{background:"#000000",foreground:"#b0b0b0",cursor:"#e8e8e8",cursorAccent:"#000000",selectionBackground:"rgba(255, 255, 255, 0.1)",selectionForeground:"#e8e8e8",black:"#0a0a0a",red:"#f87171",green:"#4ade80",yellow:"#fbbf24",blue:"#93c5fd",magenta:"#c4b5fd",cyan:"#67e8f9",white:"#b0b0b0",brightBlack:"#444444",brightRed:"#fca5a5",brightGreen:"#86efac",brightYellow:"#fde68a",brightBlue:"#bfdbfe",brightMagenta:"#ddd6fe",brightCyan:"#a5f3fc",brightWhite:"#e8e8e8"},fontSize:13,fontFamily:'"JetBrains Mono", "SF Mono", "Fira Code", "Cascadia Code", monospace',fontWeight:"400",fontWeightBold:"500",lineHeight:1.3,cursorBlink:!0,cursorStyle:"bar",cursorWidth:1,scrollback:15e3,allowProposedApi:!0,minimumContrastRatio:1,drawBoldTextInBrightColors:!0}),v=new tm.FitAddon;_.loadAddon(v);try{const l=new hm;_.loadAddon(l),_.unicode.activeVersion="11"}catch{}try{const l=new dm;_.loadAddon(l)}catch{}_.open(i.current);try{v.fit()}catch{}o.current=_,u.current=v};J.useEffect(()=>{a();const _=i.current;if(!_)return;const v=new ResizeObserver(()=>{var m;try{(m=u.current)==null||m.fit()}catch{}const l=S.current;if(l&&r.current){const x=o.current;x&&r.current.emit("agent:resize",l,x.cols,x.rows)}});return v.observe(_),()=>{var l;v.disconnect(),(l=o.current)==null||l.dispose(),o.current=null,u.current=null,y.current=!1}},[]),J.useEffect(()=>{var R;a();const _=o.current,v=r.current;if(!e||!_||!v){S.current=null;return}const l=S.current;S.current=e.id,l!==e.id&&_.write("\x1B[2J\x1B[3J\x1B[H");let m=!1;fetch(`/api/agents/${e.id}/scrollback`).then(D=>D.ok?D.json():null).then(D=>{if(D!=null&&D.scrollback&&S.current===e.id&&_){const M=D.scrollback;let W=0;const z=()=>{if(W>=M.length){m=!0,_.scrollToBottom(),setTimeout(()=>_.scrollToBottom(),50);return}const F=M.slice(W,W+16384);W+=16384,_.write(F,z)};z()}else m=!0}).catch(()=>{m=!0});const x=`agent:pty:${e.id}`,b=D=>{if(S.current===e.id&&_){const k=_.buffer.active,M=k.viewportY>=k.baseY-1;_.write(D),m&&M&&_.scrollToBottom()}};v.on(x,b);const C=_.onData(D=>{v.emit("agent:input",e.id,D)});try{(R=u.current)==null||R.fit(),v.emit("agent:resize",e.id,_.cols,_.rows)}catch{}const f=i.current,p=e.id,d=async D=>{_.write(`\r
|
|
99
|
+
\x1B[33mUploading image...\x1B[0m`);const k=await Hb(D);k&&S.current===p?(v.emit("agent:input",p,k+"\r"),_.write(`\r
|
|
100
|
+
\x1B[32mImage ready: `+k+`\x1B[0m\r
|
|
101
|
+
`)):_.write(`\r
|
|
102
|
+
\x1B[31mFailed to upload image\x1B[0m\r
|
|
103
|
+
`)},h=D=>{var M;const k=(M=D.clipboardData)==null?void 0:M.items;if(k){for(const W of k)if(W.type.startsWith("image/")){D.preventDefault(),D.stopPropagation();const z=W.getAsFile();z&&d(z);return}}},w=D=>{var k,M;(M=(k=D.dataTransfer)==null?void 0:k.types)!=null&&M.includes("Files")&&(D.preventDefault(),D.stopPropagation())},L=D=>{var M;const k=(M=D.dataTransfer)==null?void 0:M.files;if(!(!k||k.length===0)){for(const W of k)if(W.type.startsWith("image/")){D.preventDefault(),D.stopPropagation(),d(W);return}}};return f==null||f.addEventListener("paste",h,!0),f==null||f.addEventListener("dragover",w,!0),f==null||f.addEventListener("drop",L,!0),_.focus(),()=>{v.off(x,b),C.dispose(),f==null||f.removeEventListener("paste",h,!0),f==null||f.removeEventListener("dragover",w,!0),f==null||f.removeEventListener("drop",L,!0)}},[e,r]);const c=()=>{var _;(_=o.current)==null||_.focus()};return j.jsxs("div",{style:{width:"100%",height:"100%",position:"relative"},children:[j.jsx("div",{ref:i,onClick:c,style:{width:"100%",height:"100%",display:e?"block":"none",padding:"2px 0",overscrollBehavior:"contain"}}),!e&&j.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:12,color:"#333"},children:[j.jsx("div",{style:{fontSize:28,fontFamily:"'JetBrains Mono', monospace",fontWeight:400,letterSpacing:"0.05em"},children:"_"}),j.jsx("div",{style:{fontSize:12,color:"#444",fontFamily:"'DM Sans', sans-serif",letterSpacing:"0.02em"},children:"Select an agent to view its terminal"})]})]})}async function jb(e){try{const r=await e.arrayBuffer(),i=new Uint8Array(r);let o="";const u=8192;for(let c=0;c<i.length;c+=u)o+=String.fromCharCode(...i.subarray(c,c+u));const S=btoa(o);return(await(await fetch("/api/upload-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:S,mimeType:e.type})})).json()).path||null}catch{return null}}const zb={background:"#0a0a0a",foreground:"#b0b0b0",cursor:"#e8e8e8",cursorAccent:"#000000",selectionBackground:"rgba(255, 255, 255, 0.1)",selectionForeground:"#e8e8e8",black:"#0a0a0a",red:"#f87171",green:"#4ade80",yellow:"#fbbf24",blue:"#93c5fd",magenta:"#c4b5fd",cyan:"#67e8f9",white:"#b0b0b0",brightBlack:"#444444",brightRed:"#fca5a5",brightGreen:"#86efac",brightYellow:"#fde68a",brightBlue:"#bfdbfe",brightMagenta:"#ddd6fe",brightCyan:"#a5f3fc",brightWhite:"#e8e8e8"};function $b(e){switch(e){case"running":return"#4ade80";case"starting":return"#fbbf24";case"done":return"#666";case"dead":return"#f87171";default:return"#666"}}function Wb({orientation:e,onDrag:r}){const i=J.useCallback(o=>{o.preventDefault();let u=e==="horizontal"?o.clientX:o.clientY;const S=a=>{const c=e==="horizontal"?a.clientX:a.clientY,_=c-u;u=c,r(_)},y=()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",y),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",S),document.addEventListener("mouseup",y),document.body.style.cursor=e==="horizontal"?"col-resize":"row-resize",document.body.style.userSelect="none"},[e,r]);return j.jsx("div",{className:`multi-term-divider ${e}`,onMouseDown:i})}function Ub({agents:e,socket:r,onSelectAgent:i}){const o=J.useRef(new Map),u=J.useRef(new Map),S=J.useRef(null),[y,a]=J.useState(null),[c,_]=J.useState([]),v=J.useRef(""),l=e.filter(d=>d.status==="running"||d.status==="starting"),m=l.map(d=>d.id).join(",");J.useEffect(()=>{if(m!==v.current){v.current=m;const d=l.length;d>0&&_(Array(d).fill(100/d))}},[m,l.length]);const x=J.useCallback(d=>h=>{h?u.current.set(d,h):u.current.delete(d)},[]);J.useEffect(()=>{var L,R;const d=r.current;if(!d)return;const h=new Set(l.map(D=>D.id)),w=o.current;for(const[D,k]of w)h.has(D)||((L=k.cleanup)==null||L.call(k),k.term.dispose(),w.delete(D));for(const D of l){const k=u.current.get(D.id);if(!k)continue;if(w.has(D.id)){const G=w.get(D.id);try{G.fit.fit()}catch{}continue}const M=new em.Terminal({theme:zb,fontSize:12,fontFamily:'"JetBrains Mono", "SF Mono", "Fira Code", "Cascadia Code", monospace',fontWeight:"400",fontWeightBold:"500",lineHeight:1.25,cursorBlink:!0,cursorStyle:"bar",cursorWidth:1,scrollback:1e4,allowProposedApi:!0,minimumContrastRatio:1,drawBoldTextInBrightColors:!0}),W=new tm.FitAddon;M.loadAddon(W);try{const G=new hm;M.loadAddon(G),M.unicode.activeVersion="11"}catch{}try{M.loadAddon(new dm)}catch{}M.open(k);try{W.fit()}catch{}let z=!1;fetch(`/api/agents/${D.id}/scrollback`).then(G=>G.ok?G.json():null).then(G=>{if(G!=null&&G.scrollback&&M){const se=G.scrollback;let ee=0;const X=()=>{if(ee>=se.length){z=!0,M.scrollToBottom(),setTimeout(()=>M.scrollToBottom(),50);return}const O=se.slice(ee,ee+16384);ee+=16384,M.write(O,X)};X()}else z=!0}).catch(()=>{z=!0});const F=`agent:pty:${D.id}`,N=G=>{const Z=M.buffer.active,se=Z.viewportY>=Z.baseY-1;M.write(G),z&&se&&M.scrollToBottom()};d.on(F,N);const I=M.onData(G=>{d.emit("agent:input",D.id,G)}),q=new ResizeObserver(()=>{try{W.fit(),d.emit("agent:resize",D.id,M.cols,M.rows)}catch{}});q.observe(k);const V=(R=u.current.get(D.id))==null?void 0:R.parentElement,K=D.id,U=async G=>{M.write(`\r
|
|
104
|
+
\x1B[33mUploading image...\x1B[0m`);const Z=await jb(G);Z?(d.emit("agent:input",K,Z+"\r"),M.write(`\r
|
|
105
|
+
\x1B[32mImage ready: `+Z+`\x1B[0m\r
|
|
106
|
+
`)):M.write(`\r
|
|
107
|
+
\x1B[31mFailed to upload image\x1B[0m\r
|
|
108
|
+
`)},A=G=>{var se;const Z=(se=G.clipboardData)==null?void 0:se.items;if(Z){for(const ee of Z)if(ee.type.startsWith("image/")){G.preventDefault(),G.stopPropagation();const X=ee.getAsFile();X&&U(X);return}}},B=G=>{var Z,se;(se=(Z=G.dataTransfer)==null?void 0:Z.types)!=null&&se.includes("Files")&&(G.preventDefault(),G.stopPropagation())},P=G=>{var se;const Z=(se=G.dataTransfer)==null?void 0:se.files;if(!(!Z||Z.length===0)){for(const ee of Z)if(ee.type.startsWith("image/")){G.preventDefault(),G.stopPropagation(),U(ee);return}}};V==null||V.addEventListener("paste",A,!0),V==null||V.addEventListener("dragover",B,!0),V==null||V.addEventListener("drop",P,!0);const H=()=>{d.off(F,N),I.dispose(),q.disconnect(),V==null||V.removeEventListener("paste",A,!0),V==null||V.removeEventListener("dragover",B,!0),V==null||V.removeEventListener("drop",P,!0)};w.set(D.id,{term:M,fit:W,cleanup:H})}return()=>{var D;for(const[,k]of w)(D=k.cleanup)==null||D.call(k),k.term.dispose();w.clear()}},[l.map(d=>d.id).join(","),r.current]);const b=J.useCallback(d=>{a(d.id);const h=o.current.get(d.id);h&&h.term.focus(),i==null||i(d)},[i]),C=J.useCallback((d,h)=>{if(!S.current)return;const w=S.current.offsetWidth,L=h/w*100;_(R=>{const D=[...R],k=10,M=D[d]+L,W=D[d+1]-L;return M>=k&&W>=k&&(D[d]=M,D[d+1]=W),D})},[]),f=l.length;if(f===0)return j.jsxs("div",{className:"multi-term-empty",children:[j.jsx("div",{className:"multi-term-empty-icon",children:"_"}),j.jsx("div",{className:"multi-term-empty-text",children:"No running agents"})]});const p=c.length===f?c:Array(f).fill(100/f);return j.jsx("div",{className:"multi-term-container",ref:S,children:l.map((d,h)=>j.jsxs(Ou.Fragment,{children:[j.jsxs("div",{className:`multi-term-pane ${y===d.id?"focused":""}`,style:{flexBasis:`${p[h]}%`},onClick:()=>b(d),children:[j.jsxs("div",{className:"multi-term-pane-header",children:[j.jsx("span",{className:"multi-term-status-dot",style:{background:$b(d.status)}}),j.jsx("span",{className:"multi-term-pane-name",children:d.name}),j.jsx("span",{className:"multi-term-pane-task",children:d.task})]}),j.jsx("div",{className:"multi-term-pane-body",ref:x(d.id)})]}),h<f-1&&j.jsx(Wb,{orientation:"horizontal",onDrag:w=>C(h,w)})]},d.id))})}function Vb({messages:e,agents:r,selectedAgentId:i,onClear:o}){const u=J.useRef(null),S=J.useMemo(()=>{const a={user:"User"};return r.forEach(c=>{a[c.id]=c.name}),a},[r]),y=J.useMemo(()=>i?e.filter(a=>a.from_agent===i||a.to_agent===i):e,[e,i]);return J.useEffect(()=>{var a;(a=u.current)==null||a.scrollIntoView({behavior:"smooth"})},[y]),j.jsxs("div",{className:"message-feed",children:[j.jsxs("div",{className:"message-feed-header",children:[j.jsx("span",{children:i?`Messages for ${S[i]||i}`:"All Messages"}),y.length>0&&j.jsx("button",{className:"clear-messages-btn",onClick:o,children:"Clear All"})]}),j.jsxs("div",{className:"message-feed-list",children:[y.length===0&&j.jsx("div",{className:"message-feed-empty",children:"No messages yet"}),[...y].reverse().map(a=>j.jsxs("div",{className:"message-item",children:[j.jsxs("div",{className:"message-meta",children:[j.jsx("span",{className:"message-from",children:S[a.from_agent]||a.from_agent.slice(0,8)}),j.jsx("span",{className:"message-arrow",children:" → "}),j.jsx("span",{className:"message-to",children:a.to_agent==="all"?"All":S[a.to_agent]||a.to_agent.slice(0,8)}),j.jsx("span",{className:"message-time",children:new Date(a.created_at).toLocaleTimeString()})]}),j.jsx("div",{className:"message-content",children:a.content})]},a.id)),j.jsx("div",{ref:u})]})]})}function qb({entries:e,onRemove:r}){return j.jsxs("div",{className:"context-viewer",children:[j.jsx("div",{className:"context-header",children:"Shared Context"}),e.length===0&&j.jsx("div",{className:"context-empty",children:"No context entries yet"}),j.jsxs("table",{className:"context-table",children:[j.jsx("thead",{children:j.jsxs("tr",{children:[j.jsx("th",{children:"Key"}),j.jsx("th",{children:"Value"}),j.jsx("th",{children:"Updated By"}),j.jsx("th",{children:"Updated At"}),j.jsx("th",{})]})}),j.jsx("tbody",{children:e.map(i=>j.jsxs("tr",{children:[j.jsx("td",{className:"context-key",children:i.key}),j.jsx("td",{className:"context-value",children:i.value}),j.jsx("td",{children:i.updated_by||"—"}),j.jsx("td",{className:"context-time",children:i.updated_at?new Date(i.updated_at).toLocaleTimeString():"—"}),j.jsx("td",{children:j.jsx("button",{className:"context-remove-btn",onClick:()=>r(i.key),title:`Remove "${i.key}"`,children:"✕"})})]},i.key))})]})]})}function Kb({diff:e,fileName:r}){const i=e.split(`
|
|
109
|
+
`);return j.jsxs("div",{className:"diff-viewer",children:[r&&j.jsx("div",{className:"diff-filename",children:r}),j.jsx("pre",{className:"diff-content",children:i.map((o,u)=>{let S="diff-line";return o.startsWith("+")&&!o.startsWith("+++")?S+=" diff-add":o.startsWith("-")&&!o.startsWith("---")?S+=" diff-del":o.startsWith("@@")?S+=" diff-hunk":o.startsWith("\\")&&(S+=" diff-meta"),j.jsx("div",{className:S,children:o},u)})})]})}function Xb(e){switch(e){case"add":return"A";case"change":return"M";case"unlink":return"D";default:return"?"}}function Yb(e){switch(e){case"add":return"#4ade80";case"change":return"#fbbf24";case"unlink":return"#f87171";default:return"#666"}}function Gb({changes:e,agents:r,onClear:i}){const[o,u]=J.useState(null),S=J.useMemo(()=>{const y=new Map;for(const a of r)y.set(a.id,a.name);return y},[r]);return j.jsxs("div",{className:"file-changes",children:[j.jsxs("div",{className:"file-changes-header",children:[j.jsxs("span",{children:["File Changes (",e.length,")"]}),e.length>0&&j.jsx("button",{className:"file-changes-clear-btn",onClick:i,children:"Clear"})]}),j.jsxs("div",{className:"file-changes-list",children:[e.length===0&&j.jsx("div",{className:"file-changes-empty",children:"No file changes detected yet. Changes will appear here as agents edit files."}),e.map(y=>{const a=y.agent_id?S.get(y.agent_id):null;return j.jsxs("div",{className:"file-change-item",children:[j.jsxs("div",{className:"file-change-row",onClick:()=>u(o===y.id?null:y.id),children:[j.jsx("span",{className:"file-change-type",style:{color:Yb(y.change_type)},children:Xb(y.change_type)}),j.jsx("span",{className:"file-change-path",children:y.file_path}),a&&j.jsx("span",{className:"file-change-agent",title:"Agent that made this change",children:a}),j.jsx("span",{className:"file-change-time",children:new Date(y.created_at).toLocaleTimeString()}),j.jsx("span",{className:"file-change-expand",children:y.diff_text?o===y.id?"▼":"▶":""})]}),o===y.id&&y.diff_text&&j.jsx(Kb,{diff:y.diff_text})]},y.id)})]})]})}function aa(e){const r=Date.now()-new Date(e).getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);if(o<24)return`${o}h ago`;const u=Math.floor(o/24);return u<30?`${u}d ago`:`${Math.floor(u/30)}mo ago`}function Qb(e){return!e||e.length===0?{icon:"",cls:""}:e.some(o=>o.conclusion==="FAILURE"||o.conclusion==="failure")?{icon:"✗",cls:"failure"}:e.some(o=>!o.conclusion||o.status==="IN_PROGRESS"||o.status==="QUEUED")?{icon:"○",cls:"pending"}:{icon:"✓",cls:"success"}}function Jb(e){switch(e){case"APPROVED":return{text:"Approved",cls:"approved"};case"CHANGES_REQUESTED":return{text:"Changes",cls:"changes_requested"};case"REVIEW_REQUIRED":return{text:"Review",cls:"review_required"};default:return null}}function Zb({prs:e,branches:r,currentBranch:i,ghAvailable:o,repoInfo:u,agents:S,fetchPRDetail:y}){const[a,c]=J.useState("all"),[_,v]=J.useState(null),[l,m]=J.useState(null),[x,b]=J.useState(!1),[C,f]=J.useState(!0),p=J.useMemo(()=>a==="all"?e:e.filter(L=>L.state.toUpperCase()===a.toUpperCase()),[e,a]),d=J.useMemo(()=>new Set(S.map(L=>L.name.toLowerCase())),[S]),h=async L=>{if(_===L){v(null),m(null);return}v(L),m(null),b(!0);const R=await y(L);m(R),b(!1)},w=L=>{const R=L.name.toLowerCase();for(const k of d)if(R.includes(k))return k;const D=L.author.toLowerCase();for(const k of d)if(D.includes(k))return k;return null};return j.jsxs("div",{className:"prs-tab",children:[j.jsxs("div",{className:"prs-header",children:[j.jsxs("div",{className:"prs-header-left",children:[j.jsxs("span",{children:["Pull Requests (",p.length,")"]}),j.jsxs("select",{className:"prs-filter",value:a,onChange:L=>c(L.target.value),children:[j.jsx("option",{value:"all",children:"All"}),j.jsx("option",{value:"open",children:"Open"}),j.jsx("option",{value:"closed",children:"Closed"}),j.jsx("option",{value:"merged",children:"Merged"})]})]}),u&&j.jsx("a",{className:"prs-repo-link",href:u.url,target:"_blank",rel:"noopener noreferrer",onClick:L=>{L.preventDefault(),window.open(u.url,"_blank")},children:u.nameWithOwner})]}),j.jsxs("div",{className:"prs-list",children:[o===!1&&j.jsxs("div",{className:"prs-unavailable",children:["GitHub CLI not available.",j.jsx("br",{}),"Install ",j.jsx("code",{children:"gh"})," and run ",j.jsx("code",{children:"gh auth login"})," to see PRs."]}),o!==!1&&p.length===0&&j.jsx("div",{className:"prs-empty",children:"No pull requests found."}),p.map(L=>{const R=L.isDraft?"draft":L.state.toLowerCase(),D=Qb(L.statusCheckRollup),k=Jb(L.reviewDecision),M=_===L.number;return j.jsxs("div",{className:"pr-item",children:[j.jsxs("div",{className:"pr-row",onClick:()=>h(L.number),children:[j.jsx("span",{className:"pr-expand",children:M?"▼":"▶"}),j.jsx("span",{className:`pr-status-badge ${R}`}),j.jsxs("span",{className:"pr-number",children:["#",L.number]}),j.jsx("span",{className:"pr-title",children:L.title}),k&&j.jsx("span",{className:`pr-review ${k.cls}`,children:k.text}),D.icon&&j.jsx("span",{className:`pr-ci ${D.cls}`,children:D.icon}),j.jsx("span",{className:"pr-branch",title:L.headRefName,children:L.headRefName}),j.jsx("span",{className:"pr-author",children:L.author.login}),j.jsx("span",{className:"pr-time",children:aa(L.createdAt)}),j.jsx("button",{className:"pr-link-btn",title:"Open in GitHub",onClick:W=>{W.stopPropagation(),window.open(L.url,"_blank")},children:"↗"})]}),M&&j.jsxs("div",{className:"pr-detail",children:[x&&j.jsx("div",{className:"pr-detail-loading",children:"Loading..."}),l&&l.number===L.number&&j.jsxs(j.Fragment,{children:[l.body&&j.jsx("div",{className:"pr-detail-body",children:l.body}),l.statusCheckRollup&&l.statusCheckRollup.length>0&&j.jsxs(j.Fragment,{children:[j.jsx("div",{className:"pr-detail-section-title",children:"Checks"}),j.jsx("div",{className:"pr-detail-checks",children:l.statusCheckRollup.map((W,z)=>{var F,N,I,q;return j.jsxs("span",{className:`pr-check ${((F=W.conclusion)==null?void 0:F.toLowerCase())==="success"?"success":((N=W.conclusion)==null?void 0:N.toLowerCase())==="failure"?"failure":"pending"}`,children:[((I=W.conclusion)==null?void 0:I.toLowerCase())==="success"?"✓":((q=W.conclusion)==null?void 0:q.toLowerCase())==="failure"?"✗":"○"," ",W.name]},z)})})]}),l.reviews&&l.reviews.length>0&&j.jsxs(j.Fragment,{children:[j.jsx("div",{className:"pr-detail-section-title",children:"Reviews"}),l.reviews.map((W,z)=>j.jsxs("div",{className:"pr-comment",children:[j.jsxs("div",{className:"pr-comment-header",children:[j.jsx("strong",{children:W.author.login})," ",W.state.toLowerCase().replace("_"," ")," ",aa(W.submittedAt)]}),W.body&&j.jsx("div",{className:"pr-comment-body",children:W.body})]},z))]}),l.comments&&l.comments.length>0&&j.jsxs(j.Fragment,{children:[j.jsx("div",{className:"pr-detail-section-title",children:"Comments"}),l.comments.map((W,z)=>j.jsxs("div",{className:"pr-comment",children:[j.jsxs("div",{className:"pr-comment-header",children:[j.jsx("strong",{children:W.author.login})," ",aa(W.createdAt)]}),j.jsx("div",{className:"pr-comment-body",children:W.body})]},z))]}),(!l.reviews||l.reviews.length===0)&&(!l.comments||l.comments.length===0)&&!l.body&&j.jsx("div",{className:"pr-detail-loading",children:"No details available."})]})]})]},L.number)})]}),j.jsxs("div",{className:"branches-section",children:[j.jsxs("div",{className:"branches-header",onClick:()=>f(L=>!L),children:[j.jsxs("span",{children:["Branches (",r.length,")",i?` — ${i}`:""]}),j.jsx("span",{className:"branches-toggle",children:C?"▼":"▶"})]}),C&&j.jsxs("div",{className:"branches-list",children:[r.length===0&&j.jsx("div",{className:"prs-empty",children:"No branches found."}),r.map(L=>{const R=w(L);return j.jsxs("div",{className:`branch-item ${L.isCurrent?"current":""}`,children:[j.jsx("span",{className:"branch-current-marker",children:L.isCurrent?"●":""}),j.jsx("span",{className:`branch-name ${L.isCurrent?"current":""}`,title:L.name,children:L.name}),j.jsx("span",{className:"branch-message",children:L.lastCommitMessage}),R&&j.jsx("span",{className:"pr-branch",children:R}),j.jsx("span",{className:"branch-author",children:L.author}),j.jsxs("div",{className:"branch-ahead-behind",children:[L.ahead>0&&j.jsxs("span",{className:"branch-badge ahead",children:[L.ahead,"\\u2191"]}),L.behind>0&&j.jsxs("span",{className:"branch-badge behind",children:[L.behind,"\\u2193"]})]}),j.jsx("span",{className:"branch-time",children:L.lastCommitDate?aa(L.lastCommitDate):""})]},L.name)})]})]})]})}function eE({content:e,onChange:r}){const[i,o]=J.useState(e),[u,S]=J.useState(!1),[y,a]=J.useState(!1),c=J.useRef(null);J.useEffect(()=>{y||o(e)},[e,y]);const _=m=>{o(m),a(!0)},v=async()=>{S(!0);try{await fetch("/api/crewmd",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:i})}),r(i),a(!1)}catch{}S(!1)},l=m=>{(m.metaKey||m.ctrlKey)&&m.key==="s"&&(m.preventDefault(),y&&v())};return j.jsxs("div",{className:"crewmd-editor",children:[j.jsxs("div",{className:"crewmd-header",children:[j.jsx("span",{className:"crewmd-title",children:"Rules"}),j.jsxs("div",{className:"crewmd-actions",children:[y&&j.jsx("span",{className:"crewmd-dirty",children:"unsaved"}),j.jsx("button",{className:"crewmd-save-btn",onClick:v,disabled:!y||u,children:u?"Saving...":"Save"})]})]}),j.jsx("textarea",{ref:c,className:"crewmd-textarea",value:i,onChange:m=>_(m.target.value),onKeyDown:l,spellCheck:!1,placeholder:"Write global instructions for all agents..."})]})}function tE(e){const[r,i]=J.useState([]),[o,u]=J.useState([]),[S,y]=J.useState(""),[a,c]=J.useState(null),[_,v]=J.useState(null),[l,m]=J.useState(!0);J.useEffect(()=>{fetch("/api/github/status").then(b=>b.json()).then(b=>{c(b.available),v(b.repo||null)}).catch(()=>c(!1)),fetch("/api/github/prs?state=all").then(b=>b.json()).then(b=>{Array.isArray(b)&&i(b)}).catch(()=>{}),fetch("/api/git/branches").then(b=>b.json()).then(b=>{b.current&&y(b.current),Array.isArray(b.branches)&&u(b.branches)}).catch(()=>{}).finally(()=>m(!1))},[]),J.useEffect(()=>{const b=e.current;if(!b)return;const C=p=>{Array.isArray(p)&&i(p)},f=p=>{p.current&&y(p.current),Array.isArray(p.branches)&&u(p.branches)};return b.on("github:prs:updated",C),b.on("git:branches:updated",f),()=>{b.off("github:prs:updated",C),b.off("git:branches:updated",f)}},[e]);const x=J.useCallback(async b=>{try{const C=await fetch(`/api/github/prs/${b}`);return C.ok?await C.json():null}catch{return null}},[]);return{prs:r,branches:o,currentBranch:S,ghAvailable:a,repoInfo:_,loading:l,fetchPRDetail:x}}function rE({onSpawn:e,onClose:r,initialMode:i="spawn"}){const[o,u]=J.useState(i),[S,y]=J.useState(""),[a,c]=J.useState(""),[_,v]=J.useState(""),[l,m]=J.useState("claude"),[x,b]=J.useState(!1),C=async()=>{b(!0);try{const d=await(await fetch("/api/pick-folder",{method:"POST"})).json();d.path&&v(d.path)}catch{}b(!1)},f=()=>{if(o==="open"){if(!_.trim())return;const p=_.trim().split("/").filter(Boolean).pop()||"project";e(S.trim()||p,a.trim()||`Work on the project at ${_.trim()}. Explore the codebase and wait for instructions.`,_.trim(),l)}else{if(!S.trim()||!a.trim())return;e(S.trim(),a.trim(),_.trim()||void 0,l)}};return j.jsx("div",{className:"dialog-overlay",onClick:r,children:j.jsxs("div",{className:"dialog",onClick:p=>p.stopPropagation(),children:[j.jsxs("div",{className:"dialog-mode-tabs",children:[j.jsx("button",{className:`dialog-mode-tab ${o==="spawn"?"active":""}`,onClick:()=>u("spawn"),children:"Spawn Agent"}),j.jsx("button",{className:`dialog-mode-tab ${o==="open"?"active":""}`,onClick:()=>u("open"),children:"Open Project"})]}),j.jsxs("label",{children:["Agent Service",j.jsxs("div",{className:"service-selector",children:[j.jsx("button",{type:"button",className:`service-btn ${l==="claude"?"active":""}`,onClick:()=>m("claude"),children:"Claude"}),j.jsx("button",{type:"button",className:`service-btn ${l==="codex"?"active":""}`,onClick:()=>m("codex"),children:"Codex"})]})]}),o==="open"?j.jsxs(j.Fragment,{children:[j.jsxs("label",{children:["Project Directory",j.jsxs("div",{className:"browse-row",children:[j.jsx("input",{type:"text",value:_,onChange:p=>v(p.target.value),placeholder:"/Users/you/your-project",autoFocus:!0}),j.jsx("button",{type:"button",className:"browse-btn",onClick:C,disabled:x,children:x?"...":"Browse"})]})]}),j.jsxs("label",{children:["Agent Name ",j.jsx("span",{className:"optional",children:"(optional)"}),j.jsx("input",{type:"text",value:S,onChange:p=>y(p.target.value),placeholder:"Auto-detected from path"})]}),j.jsxs("label",{children:["Initial Task ",j.jsx("span",{className:"optional",children:"(optional)"}),j.jsx("textarea",{value:a,onChange:p=>c(p.target.value),placeholder:"Explore the codebase and wait for instructions...",rows:3})]})]}):j.jsxs(j.Fragment,{children:[j.jsxs("label",{children:["Name",j.jsx("input",{type:"text",value:S,onChange:p=>y(p.target.value),placeholder:"e.g. researcher",autoFocus:!0})]}),j.jsxs("label",{children:["Task",j.jsx("textarea",{value:a,onChange:p=>c(p.target.value),placeholder:"Describe what this agent should do...",rows:4})]}),j.jsxs("label",{children:["Working Directory ",j.jsx("span",{className:"optional",children:"(optional)"}),j.jsxs("div",{className:"browse-row",children:[j.jsx("input",{type:"text",value:_,onChange:p=>v(p.target.value),placeholder:"e.g. /Users/you/project (leave blank for server cwd)"}),j.jsx("button",{type:"button",className:"browse-btn",onClick:C,disabled:x,children:x?"...":"Browse"})]})]})]}),j.jsxs("div",{className:"dialog-actions",children:[j.jsx("button",{onClick:r,children:"Cancel"}),j.jsx("button",{className:"primary",onClick:f,children:o==="open"?"Open":"Spawn"})]})]})})}function nE({size:e=28}){return j.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[j.jsx("path",{d:"M50 5 A45 45 0 1 1 15 75",stroke:"currentColor",strokeWidth:"6",strokeLinecap:"round",fill:"none"}),j.jsx("path",{d:"M30 18 Q55 45 78 30",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round",fill:"none"}),j.jsx("path",{d:"M20 55 Q50 35 75 65",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round",fill:"none"}),j.jsx("path",{d:"M22 72 Q50 60 50 90",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round",fill:"none"}),j.jsx("circle",{cx:"30",cy:"18",r:"6",fill:"currentColor"}),j.jsx("circle",{cx:"78",cy:"30",r:"6",fill:"currentColor"}),j.jsx("circle",{cx:"75",cy:"65",r:"6",fill:"currentColor"}),j.jsx("circle",{cx:"22",cy:"72",r:"6",fill:"currentColor"}),j.jsx("circle",{cx:"50",cy:"90",r:"5.5",fill:"currentColor"})]})}function iE(){var se;const{socket:e,agents:r,messages:i,contextEntries:o,crewMd:u,setCrewMd:S,fileChanges:y}=Kv(),{prs:a,branches:c,currentBranch:_,ghAvailable:v,repoInfo:l,fetchPRDetail:m}=tE(e),[x,b]=J.useState(null),[C,f]=J.useState("graph"),[p,d]=J.useState(!1),[h,w]=J.useState("spawn"),[L,R]=J.useState(""),[D,k]=J.useState("all"),[M,W]=J.useState("multi"),[z,F]=J.useState(!0),N=J.useCallback(async(ee,X,O,re)=>{await fetch("/api/spawn",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ee,task:X,cwd:O,service:re||"claude"})}),d(!1)},[]),I=J.useCallback(async ee=>{await fetch(`/api/agents/${ee}`,{method:"DELETE"})},[]),q=J.useCallback(async ee=>{await fetch(`/api/agents/${ee}/remove`,{method:"DELETE"}),(x==null?void 0:x.id)===ee&&b(null)},[x]),V=J.useCallback(async ee=>{await fetch(`/api/agents/${ee}/rollback`,{method:"POST"})},[]),K=J.useCallback(async ee=>{await fetch(`/api/agents/${ee.id}/remove`,{method:"DELETE"});const O=await(await fetch("/api/spawn",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ee.name,task:ee.task,cwd:ee.agent_cwd||void 0,service:ee.service||"claude"})})).json();O.id&&(b({...ee,id:O.id,status:"starting",pid:null}),f("terminal"))},[]),U=J.useCallback(async ee=>{await fetch(`/api/context/${encodeURIComponent(ee)}`,{method:"DELETE"})},[]),A=J.useCallback(async()=>{if(!L.trim())return;const ee=D,X=L;if(R(""),ee!=="all")await fetch(`/api/agents/${ee}/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:X})}).catch(()=>{}),await fetch("/api/messages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:"user",to:ee,content:X})});else{const O=r.filter(re=>re.status==="running");await Promise.all(O.map(re=>fetch(`/api/agents/${re.id}/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:X})}).catch(()=>{}))),await fetch("/api/messages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:"user",to:"all",content:X})})}},[L,D,r]),B=J.useCallback(async()=>{await fetch("/api/messages",{method:"DELETE"})},[]),P=J.useCallback(async()=>{await fetch("/api/file-changes",{method:"DELETE"})},[]),H=J.useCallback(ee=>{b(ee),f("terminal")},[]),G=J.useCallback(ee=>{w(ee),d(!0)},[]);J.useEffect(()=>{const ee=["graph","terminal","files","prs","messages","context","crewmd"],X=O=>{const re=O.target,ne=re.tagName==="INPUT"||re.tagName==="TEXTAREA"||re.tagName==="SELECT",ce=re.closest(".xterm"),le=O.metaKey||O.ctrlKey;if(O.key==="Escape"){d(!1);return}const fe=le&&(O.key==="["||O.key==="]"||O.key==="\\");if(ce&&fe)O.stopPropagation();else if(ne||ce)return;if(!le)return;const we=parseInt(O.key);if(we>=1&&we<=ee.length){O.preventDefault(),f(ee[we-1]);return}switch(O.key){case"n":O.preventDefault(),w("spawn"),d(!0);break;case"o":O.preventDefault(),w("open"),d(!0);break;case"[":{O.preventDefault();const ye=r.filter(Ie=>Ie.status!=="dead");if(ye.length===0)break;const xe=ye.findIndex(Ie=>Ie.id===(x==null?void 0:x.id)),ge=xe<=0?ye.length-1:xe-1;b(ye[ge]),f("terminal");break}case"]":{O.preventDefault();const ye=r.filter(Ie=>Ie.status!=="dead");if(ye.length===0)break;const xe=ye.findIndex(Ie=>Ie.id===(x==null?void 0:x.id)),ge=xe>=ye.length-1?0:xe+1;b(ye[ge]),f("terminal");break}case"\\":O.preventDefault(),W(ye=>ye==="multi"?"single":"multi");break}};return document.addEventListener("keydown",X,!0),()=>document.removeEventListener("keydown",X,!0)},[r,x]);const Z=[{key:"graph",label:"Graph"},{key:"terminal",label:"Terminal"},{key:"files",label:"Files"},{key:"prs",label:"PRs"},{key:"messages",label:"Messages"},{key:"context",label:"Context"},{key:"crewmd",label:"Rules"}];return j.jsxs("div",{className:"app",children:[j.jsxs("header",{className:"app-header",children:[j.jsxs("div",{className:"header-brand",children:[j.jsx(nE,{size:26}),j.jsx("h1",{children:"Clustr"})]}),(()=>{const ee=r.reduce((X,O)=>X+(O.total_cost||0),0);return ee>0?j.jsxs("span",{className:"header-total-cost",children:["Total: $",ee.toFixed(4)]}):null})(),j.jsxs("div",{className:"header-actions",children:[j.jsx("button",{onClick:()=>G("open"),children:"Open Project"}),j.jsx("button",{className:"primary",onClick:()=>G("spawn"),children:"New Agent"})]})]}),j.jsxs("div",{className:"app-body",children:[j.jsxs("aside",{className:`sidebar ${z?"":"collapsed"}`,children:[j.jsx("button",{className:"sidebar-toggle",onClick:()=>F(ee=>!ee),title:z?"Collapse sidebar":"Expand sidebar",children:z?"‹":"›"}),z&&j.jsx(Yv,{agents:r,selectedId:(x==null?void 0:x.id)??null,onSelect:ee=>{b(ee),f("terminal")},onKill:I,onRemove:q,onRollback:V,onRestart:K})]}),j.jsxs("main",{className:"main-content",children:[j.jsxs("nav",{className:"tabs",children:[Z.map(ee=>j.jsx("button",{className:C===ee.key?"tab active":"tab",onClick:()=>f(ee.key),children:ee.label},ee.key)),C==="terminal"&&j.jsxs("div",{className:"terminal-view-toggle",children:[j.jsx("button",{className:`view-toggle-btn ${M==="multi"?"active":""}`,onClick:()=>W("multi"),title:"Split view — all agents",children:"⊞"}),j.jsx("button",{className:`view-toggle-btn ${M==="single"?"active":""}`,onClick:()=>W("single"),title:"Single view — selected agent",children:"☐"})]})]}),j.jsxs("div",{className:"tab-content",children:[C==="graph"&&j.jsx(ib,{agents:r,messages:i,onSelectAgent:H}),C==="terminal"&&M==="multi"&&j.jsx(Ub,{agents:r,socket:e,onSelectAgent:ee=>b(ee)}),C==="terminal"&&M==="single"&&j.jsx(Fb,{agent:x,socket:e}),C==="messages"&&j.jsx(Vb,{messages:i,agents:r,selectedAgentId:(x==null?void 0:x.id)??null,onClear:B}),C==="context"&&j.jsx(qb,{entries:o,onRemove:U}),C==="files"&&j.jsx(Gb,{changes:y,agents:r,onClear:P}),C==="prs"&&j.jsx(Zb,{prs:a,branches:c,currentBranch:_,ghAvailable:v,repoInfo:l,agents:r,fetchPRDetail:m}),C==="crewmd"&&j.jsx(eE,{content:u,onChange:S})]})]})]}),j.jsxs("footer",{className:"app-footer",children:[j.jsxs("select",{value:D,onChange:ee=>k(ee.target.value),children:[j.jsx("option",{value:"all",children:"All Agents"}),r.filter(ee=>ee.status==="running").map(ee=>j.jsx("option",{value:ee.id,children:ee.name},ee.id))]}),j.jsx("input",{type:"text",placeholder:D==="all"?"Broadcast message to all agents...":`Send message to ${((se=r.find(ee=>ee.id===D))==null?void 0:se.name)||"agent"}...`,value:L,onChange:ee=>R(ee.target.value),onKeyDown:ee=>ee.key==="Enter"&&A()}),j.jsx("button",{className:"primary",onClick:A,disabled:!L.trim(),children:"Send"})]}),p&&j.jsx(rE,{onSpawn:N,onClose:()=>d(!1),initialMode:h})]})}Z0.createRoot(document.getElementById("root")).render(j.jsx(Ou.StrictMode,{children:j.jsx(iE,{})}));
|