clustr-ai 0.1.21 → 0.1.22
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/dist/client/assets/index-ce7F3zpI.js +111 -0
- package/dist/client/assets/index-pgRSUOTG.css +32 -0
- package/dist/client/index.html +2 -2
- package/dist/server/index.js +58 -55
- package/package.json +1 -1
- package/dist/client/assets/index-637qjQWP.js +0 -111
- package/dist/client/assets/index-DGsuwoi9.css +0 -32
|
@@ -0,0 +1,111 @@
|
|
|
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 w of S.addedNodes)w.tagName==="LINK"&&w.rel==="modulepreload"&&o(w)}).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 zu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fc={exports:{}},ls={},zc={exports:{}},De={};/**
|
|
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 If;function rv(){if(If)return De;If=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"),w=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),c=Symbol.iterator;function m(P){return P===null||typeof P!="object"?null:(P=c&&P[c]||P["@@iterator"],typeof P=="function"?P:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,x={};function f(P,j,Y){this.props=P,this.context=j,this.refs=x,this.updater=Y||C}f.prototype.isReactComponent={},f.prototype.setState=function(P,j){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,j,"setState")},f.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function _(){}_.prototype=f.prototype;function d(P,j,Y){this.props=P,this.context=j,this.refs=x,this.updater=Y||C}var h=d.prototype=new _;h.constructor=d,b(h,f.prototype),h.isPureReactComponent=!0;var y=Array.isArray,k=Object.prototype.hasOwnProperty,R={current:null},D={key:!0,ref:!0,__self:!0,__source:!0};function L(P,j,Y){var Z,ie={},ae=null,X=null;if(j!=null)for(Z in j.ref!==void 0&&(X=j.ref),j.key!==void 0&&(ae=""+j.key),j)k.call(j,Z)&&!D.hasOwnProperty(Z)&&(ie[Z]=j[Z]);var H=arguments.length-2;if(H===1)ie.children=Y;else if(1<H){for(var re=Array(H),te=0;te<H;te++)re[te]=arguments[te+2];ie.children=re}if(P&&P.defaultProps)for(Z in H=P.defaultProps,H)ie[Z]===void 0&&(ie[Z]=H[Z]);return{$$typeof:e,type:P,key:ae,ref:X,props:ie,_owner:R.current}}function M(P,j){return{$$typeof:e,type:P.type,key:j,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 j={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(Y){return j[Y]})}var F=/\/+/g;function B(P,j){return typeof P=="object"&&P!==null&&P.key!=null?z(""+P.key):j.toString(36)}function O(P,j,Y,Z,ie){var ae=typeof P;(ae==="undefined"||ae==="boolean")&&(P=null);var X=!1;if(P===null)X=!0;else switch(ae){case"string":case"number":X=!0;break;case"object":switch(P.$$typeof){case e:case r:X=!0}}if(X)return X=P,ie=ie(X),P=Z===""?"."+B(X,0):Z,y(ie)?(Y="",P!=null&&(Y=P.replace(F,"$&/")+"/"),O(ie,j,Y,"",function(te){return te})):ie!=null&&(W(ie)&&(ie=M(ie,Y+(!ie.key||X&&X.key===ie.key?"":(""+ie.key).replace(F,"$&/")+"/")+P)),j.push(ie)),1;if(X=0,Z=Z===""?".":Z+":",y(P))for(var H=0;H<P.length;H++){ae=P[H];var re=Z+B(ae,H);X+=O(ae,j,Y,re,ie)}else if(re=m(P),typeof re=="function")for(P=re.call(P),H=0;!(ae=P.next()).done;)ae=ae.value,re=Z+B(ae,H++),X+=O(ae,j,Y,re,ie);else if(ae==="object")throw j=String(P),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.");return X}function q(P,j,Y){if(P==null)return P;var Z=[],ie=0;return O(P,Z,"","",function(ae){return j.call(Y,ae,ie++)}),Z}function U(P){if(P._status===-1){var j=P._result;j=j(),j.then(function(Y){(P._status===0||P._status===-1)&&(P._status=1,P._result=Y)},function(Y){(P._status===0||P._status===-1)&&(P._status=2,P._result=Y)}),P._status===-1&&(P._status=0,P._result=j)}if(P._status===1)return P._result.default;throw P._result}var K={current:null},V={transition:null},A={ReactCurrentDispatcher:K,ReactCurrentBatchConfig:V,ReactCurrentOwner:R};function I(){throw Error("act(...) is not supported in production builds of React.")}return De.Children={map:q,forEach:function(P,j,Y){q(P,function(){j.apply(this,arguments)},Y)},count:function(P){var j=0;return q(P,function(){j++}),j},toArray:function(P){return q(P,function(j){return j})||[]},only:function(P){if(!W(P))throw Error("React.Children.only expected to receive a single React element child.");return P}},De.Component=f,De.Fragment=i,De.Profiler=u,De.PureComponent=d,De.StrictMode=o,De.Suspense=l,De.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=A,De.act=I,De.cloneElement=function(P,j,Y){if(P==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+P+".");var Z=b({},P.props),ie=P.key,ae=P.ref,X=P._owner;if(j!=null){if(j.ref!==void 0&&(ae=j.ref,X=R.current),j.key!==void 0&&(ie=""+j.key),P.type&&P.type.defaultProps)var H=P.type.defaultProps;for(re in j)k.call(j,re)&&!D.hasOwnProperty(re)&&(Z[re]=j[re]===void 0&&H!==void 0?H[re]:j[re])}var re=arguments.length-2;if(re===1)Z.children=Y;else if(1<re){H=Array(re);for(var te=0;te<re;te++)H[te]=arguments[te+2];Z.children=H}return{$$typeof:e,type:P.type,key:ie,ref:ae,props:Z,_owner:X}},De.createContext=function(P){return P={$$typeof:w,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},P.Provider={$$typeof:S,_context:P},P.Consumer=P},De.createElement=L,De.createFactory=function(P){var j=L.bind(null,P);return j.type=P,j},De.createRef=function(){return{current:null}},De.forwardRef=function(P){return{$$typeof:a,render:P}},De.isValidElement=W,De.lazy=function(P){return{$$typeof:v,_payload:{_status:-1,_result:P},_init:U}},De.memo=function(P,j){return{$$typeof:p,type:P,compare:j===void 0?null:j}},De.startTransition=function(P){var j=V.transition;V.transition={};try{P()}finally{V.transition=j}},De.unstable_act=I,De.useCallback=function(P,j){return K.current.useCallback(P,j)},De.useContext=function(P){return K.current.useContext(P)},De.useDebugValue=function(){},De.useDeferredValue=function(P){return K.current.useDeferredValue(P)},De.useEffect=function(P,j){return K.current.useEffect(P,j)},De.useId=function(){return K.current.useId()},De.useImperativeHandle=function(P,j,Y){return K.current.useImperativeHandle(P,j,Y)},De.useInsertionEffect=function(P,j){return K.current.useInsertionEffect(P,j)},De.useLayoutEffect=function(P,j){return K.current.useLayoutEffect(P,j)},De.useMemo=function(P,j){return K.current.useMemo(P,j)},De.useReducer=function(P,j,Y){return K.current.useReducer(P,j,Y)},De.useRef=function(P){return K.current.useRef(P)},De.useState=function(P){return K.current.useState(P)},De.useSyncExternalStore=function(P,j,Y){return K.current.useSyncExternalStore(P,j,Y)},De.useTransition=function(){return K.current.useTransition()},De.version="18.3.1",De}var Of;function ks(){return Of||(Of=1,zc.exports=rv()),zc.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 Hf;function nv(){if(Hf)return ls;Hf=1;var e=ks(),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 w(a,l,p){var v,c={},m=null,C=null;p!==void 0&&(m=""+p),l.key!==void 0&&(m=""+l.key),l.ref!==void 0&&(C=l.ref);for(v in l)o.call(l,v)&&!S.hasOwnProperty(v)&&(c[v]=l[v]);if(a&&a.defaultProps)for(v in l=a.defaultProps,l)c[v]===void 0&&(c[v]=l[v]);return{$$typeof:r,type:a,key:m,ref:C,props:c,_owner:u.current}}return ls.Fragment=i,ls.jsx=w,ls.jsxs=w,ls}var jf;function iv(){return jf||(jf=1,Fc.exports=nv()),Fc.exports}var N=iv(),Q=ks();const $u=zu(Q);var Go={},$c={exports:{}},kt={},Wc={exports:{}},Uc={};/**
|
|
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 Ff;function sv(){return Ff||(Ff=1,(function(e){function r(V,A){var I=V.length;V.push(A);e:for(;0<I;){var P=I-1>>>1,j=V[P];if(0<u(j,A))V[P]=A,V[I]=j,I=P;else break e}}function i(V){return V.length===0?null:V[0]}function o(V){if(V.length===0)return null;var A=V[0],I=V.pop();if(I!==A){V[0]=I;e:for(var P=0,j=V.length,Y=j>>>1;P<Y;){var Z=2*(P+1)-1,ie=V[Z],ae=Z+1,X=V[ae];if(0>u(ie,I))ae<j&&0>u(X,ie)?(V[P]=X,V[ae]=I,P=ae):(V[P]=ie,V[Z]=I,P=Z);else if(ae<j&&0>u(X,I))V[P]=X,V[ae]=I,P=ae;else break e}}return A}function u(V,A){var I=V.sortIndex-A.sortIndex;return I!==0?I:V.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var S=performance;e.unstable_now=function(){return S.now()}}else{var w=Date,a=w.now();e.unstable_now=function(){return w.now()-a}}var l=[],p=[],v=1,c=null,m=3,C=!1,b=!1,x=!1,f=typeof setTimeout=="function"?setTimeout:null,_=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(V){for(var A=i(p);A!==null;){if(A.callback===null)o(p);else if(A.startTime<=V)o(p),A.sortIndex=A.expirationTime,r(l,A);else break;A=i(p)}}function y(V){if(x=!1,h(V),!b)if(i(l)!==null)b=!0,U(k);else{var A=i(p);A!==null&&K(y,A.startTime-V)}}function k(V,A){b=!1,x&&(x=!1,_(L),L=-1),C=!0;var I=m;try{for(h(A),c=i(l);c!==null&&(!(c.expirationTime>A)||V&&!z());){var P=c.callback;if(typeof P=="function"){c.callback=null,m=c.priorityLevel;var j=P(c.expirationTime<=A);A=e.unstable_now(),typeof j=="function"?c.callback=j:c===i(l)&&o(l),h(A)}else o(l);c=i(l)}if(c!==null)var Y=!0;else{var Z=i(p);Z!==null&&K(y,Z.startTime-A),Y=!1}return Y}finally{c=null,m=I,C=!1}}var R=!1,D=null,L=-1,M=5,W=-1;function z(){return!(e.unstable_now()-W<M)}function F(){if(D!==null){var V=e.unstable_now();W=V;var A=!0;try{A=D(!0,V)}finally{A?B():(R=!1,D=null)}}else R=!1}var B;if(typeof d=="function")B=function(){d(F)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,q=O.port2;O.port1.onmessage=F,B=function(){q.postMessage(null)}}else B=function(){f(F,0)};function U(V){D=V,R||(R=!0,B())}function K(V,A){L=f(function(){V(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(V){V.callback=null},e.unstable_continueExecution=function(){b||C||(b=!0,U(k))},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return i(l)},e.unstable_next=function(V){switch(m){case 1:case 2:case 3:var A=3;break;default:A=m}var I=m;m=A;try{return V()}finally{m=I}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(V,A){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var I=m;m=V;try{return A()}finally{m=I}},e.unstable_scheduleCallback=function(V,A,I){var P=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?P+I:P):I=P,V){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=I+j,V={id:v++,callback:A,priorityLevel:V,startTime:I,expirationTime:j,sortIndex:-1},I>P?(V.sortIndex=I,r(p,V),i(l)===null&&V===i(p)&&(x?(_(L),L=-1):x=!0,K(y,I-P))):(V.sortIndex=j,r(l,V),b||C||(b=!0,U(k))),V},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(V){var A=m;return function(){var I=m;m=A;try{return V.apply(this,arguments)}finally{m=I}}}})(Uc)),Uc}var zf;function ov(){return zf||(zf=1,Wc.exports=sv()),Wc.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 $f;function av(){if($f)return kt;$f=1;var e=ks(),r=ov();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){w(t,n),w(t+"Capture",n)}function w(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"),l=Object.prototype.hasOwnProperty,p=/^[: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={},c={};function m(t){return l.call(c,t)?!0:l.call(v,t)?!1:p.test(t)?c[t]=!0:(v[t]=!0,!1)}function C(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"||C(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 x(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 x(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 x(n,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){f[t]=new x(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){f[t]=new x(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 x(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){f[t]=new x(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){f[t]=new x(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){f[t]=new x(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){f[t]=new x(t,5,!1,t.toLowerCase(),null,!1,!1)});var _=/[\-:]([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(_,d);f[n]=new x(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(_,d);f[n]=new x(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(_,d);f[n]=new x(n,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){f[t]=new x(t,1,!1,t.toLowerCase(),null,!1,!1)}),f.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){f[t]=new x(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 y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,k=Symbol.for("react.element"),R=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),L=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"),B=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),K=Symbol.for("react.offscreen"),V=Symbol.iterator;function A(t){return t===null||typeof t!="object"?null:(t=V&&t[V]||t["@@iterator"],typeof t=="function"?t:null)}var I=Object.assign,P;function j(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 Y=!1;function Z(t,n){if(!t||Y)return"";Y=!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(oe){var g=oe}Reflect.construct(t,[],n)}else{try{n.call()}catch(oe){g=oe}t.call(n.prototype)}else{try{throw Error()}catch(oe){g=oe}t()}}catch(oe){if(oe&&g&&typeof oe.stack=="string"){for(var E=oe.stack.split(`
|
|
35
|
+
`),T=g.stack.split(`
|
|
36
|
+
`),$=E.length-1,G=T.length-1;1<=$&&0<=G&&E[$]!==T[G];)G--;for(;1<=$&&0<=G;$--,G--)if(E[$]!==T[G]){if($!==1||G!==1)do if($--,G--,0>G||E[$]!==T[G]){var J=`
|
|
37
|
+
`+E[$].replace(" at new "," at ");return t.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",t.displayName)),J}while(1<=$&&0<=G);break}}}finally{Y=!1,Error.prepareStackTrace=s}return(t=t?t.displayName||t.name:"")?j(t):""}function ie(t){switch(t.tag){case 5:return j(t.type);case 16:return j("Lazy");case 13:return j("Suspense");case 19:return j("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 ae(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 L:return"StrictMode";case B:return"Suspense";case O: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:ae(t.type)||"Memo";case U:n=t._payload,t=t._init;try{return ae(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 ae(n);case 8:return n===L?"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 H(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 te(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 ue(t){t._valueTracker||(t._valueTracker=te(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 pe(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 Se(t,n){var s=n.checked;return I({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??t._wrapperState.initialChecked})}function be(t,n){var s=n.defaultValue==null?"":n.defaultValue,g=n.checked!=null?n.checked:n.defaultChecked;s=H(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 ce(t,n){n=n.checked,n!=null&&h(t,"checked",n,!1)}function ge(t,n){ce(t,n);var s=H(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")?Ie(t,n.type,s):n.hasOwnProperty("defaultValue")&&Ie(t,n.type,H(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(t.defaultChecked=!!n.defaultChecked)}function Re(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 Ie(t,n,s){(n!=="number"||pe(t.ownerDocument)!==t)&&(s==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+s&&(t.defaultValue=""+s))}var ze=Array.isArray;function Qe(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=""+H(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 ut(t,n){if(n.dangerouslySetInnerHTML!=null)throw Error(i(91));return I({},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(ze(s)){if(1<s.length)throw Error(i(93));s=s[0]}n=s}n==null&&(n=""),s=n}t._wrapperState={initialValue:H(s)}}function pt(t,n){var s=H(n.value),g=H(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 Ne(t){var n=t.textContent;n===t._wrapperState.initialValue&&n!==""&&n!==null&&(t.value=n)}function Je(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 ht(t,n){return t==null||t==="http://www.w3.org/1999/xhtml"?Je(n):t==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var $e,_r=(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($e=$e||document.createElement("div"),$e.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=$e.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;n.firstChild;)t.appendChild(n.firstChild)}});function ot(t,n){if(n){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=n;return}}t.textContent=n}var Rt={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},Oe=["Webkit","ms","Moz","O"];Object.keys(Rt).forEach(function(t){Oe.forEach(function(n){n=n+t.charAt(0).toUpperCase()+t.substring(1),Rt[n]=Rt[t]})});function Rn(t,n,s){return n==null||typeof n=="boolean"||n===""?"":s||typeof n!="number"||n===0||Rt.hasOwnProperty(t)&&Rt[t]?(""+n).trim():n+"px"}function Ps(t,n){t=t.style;for(var s in n)if(n.hasOwnProperty(s)){var g=s.indexOf("--")===0,E=Rn(s,n[s],g);s==="float"&&(s="cssFloat"),g?t.setProperty(s,E):t[s]=E}}var Ya=I({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 vi(t,n){if(n){if(Ya[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 yi(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 wi=null;function Si(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ci=null,Dr=null,Tr=null;function Ns(t){if(t=Ki(t)){if(typeof Ci!="function")throw Error(i(280));var n=t.stateNode;n&&(n=uo(n),Ci(t.stateNode,t.type,n))}}function Bs(t){Dr?Tr?Tr.push(t):Tr=[t]:Dr=t}function Is(){if(Dr){var t=Dr,n=Tr;if(Tr=Dr=null,Ns(t),n)for(t=0;t<n.length;t++)Ns(n[t])}}function Os(t,n){return t(n)}function Hs(){}var xi=!1;function js(t,n,s){if(xi)return t(n,s);xi=!0;try{return Os(t,n,s)}finally{xi=!1,(Dr!==null||Tr!==null)&&(Hs(),Is())}}function rn(t,n){var s=t.stateNode;if(s===null)return null;var g=uo(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 bi=!1;if(a)try{var nn={};Object.defineProperty(nn,"passive",{get:function(){bi=!0}}),window.addEventListener("test",nn,nn),window.removeEventListener("test",nn,nn)}catch{bi=!1}function Ga(t,n,s,g,E,T,$,G,J){var oe=Array.prototype.slice.call(arguments,3);try{n.apply(s,oe)}catch(de){this.onError(de)}}var sn=!1,Dn=null,Tn=!1,Ei=null,Qa={onError:function(t){sn=!0,Dn=t}};function Ja(t,n,s,g,E,T,$,G,J){sn=!1,Dn=null,Ga.apply(Qa,arguments)}function Za(t,n,s,g,E,T,$,G,J){if(Ja.apply(this,arguments),sn){if(sn){var oe=Dn;sn=!1,Dn=null}else throw Error(i(198));Tn||(Tn=!0,Ei=oe)}}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 ki(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 Li(t){if(rr(t)!==t)throw Error(i(188))}function el(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 Li(E),t;if(T===g)return Li(E),n;T=T.sibling}throw Error(i(188))}if(s.return!==g.return)s=E,g=T;else{for(var $=!1,G=E.child;G;){if(G===s){$=!0,s=E,g=T;break}if(G===g){$=!0,g=E,s=T;break}G=G.sibling}if(!$){for(G=T.child;G;){if(G===s){$=!0,s=T,g=E;break}if(G===g){$=!0,g=T,s=E;break}G=G.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=el(t),t!==null?zs(t):null}function zs(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var n=zs(t);if(n!==null)return n;t=t.sibling}return null}var $s=r.unstable_scheduleCallback,Ws=r.unstable_cancelCallback,tl=r.unstable_shouldYield,Us=r.unstable_requestPaint,Ke=r.unstable_now,rl=r.unstable_getCurrentPriorityLevel,Ri=r.unstable_ImmediatePriority,Vs=r.unstable_UserBlockingPriority,An=r.unstable_NormalPriority,nl=r.unstable_LowPriority,qs=r.unstable_IdlePriority,on=null,It=null;function il(t){if(It&&typeof It.onCommitFiberRoot=="function")try{It.onCommitFiberRoot(on,t,void 0,(t.current.flags&128)===128)}catch{}}var Dt=Math.clz32?Math.clz32:al,sl=Math.log,ol=Math.LN2;function al(t){return t>>>=0,t===0?32:31-(sl(t)/ol|0)|0}var Mn=64,Pn=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 Nn(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 G=$&~E;G!==0?g=nr(G):(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-Dt(n),E=1<<s,g|=t[s],n&=~E;return g}function Ks(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 ll(t,n){for(var s=t.suspendedLanes,g=t.pingedLanes,E=t.expirationTimes,T=t.pendingLanes;0<T;){var $=31-Dt(T),G=1<<$,J=E[$];J===-1?((G&s)===0||(G&g)!==0)&&(E[$]=Ks(G,n)):J<=n&&(t.expiredLanes|=G),T&=~G}}function Di(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Bn(){var t=Mn;return Mn<<=1,(Mn&4194240)===0&&(Mn=64),t}function Ti(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function an(t,n,s){t.pendingLanes|=n,n!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,n=31-Dt(n),t[n]=s}function Xs(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-Dt(s),T=1<<E;n[E]=0,g[E]=-1,t[E]=-1,s&=~T}}function cl(t,n){var s=t.entangledLanes|=n;for(t=t.entanglements;s;){var g=31-Dt(s),E=1<<g;E&n|t[g]&n&&(t[g]|=n),s&=~E}}var Be=0;function fh(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var ph,ul,_h,gh,mh,hl=!1,Ys=[],Ar=null,Mr=null,Pr=null,Ai=new Map,Mi=new Map,Nr=[],bm="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 vh(t,n){switch(t){case"focusin":case"focusout":Ar=null;break;case"dragenter":case"dragleave":Mr=null;break;case"mouseover":case"mouseout":Pr=null;break;case"pointerover":case"pointerout":Ai.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Mi.delete(n.pointerId)}}function Pi(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=Ki(n),n!==null&&ul(n)),t):(t.eventSystemFlags|=g,n=t.targetContainers,E!==null&&n.indexOf(E)===-1&&n.push(E),t)}function Em(t,n,s,g,E){switch(n){case"focusin":return Ar=Pi(Ar,t,n,s,g,E),!0;case"dragenter":return Mr=Pi(Mr,t,n,s,g,E),!0;case"mouseover":return Pr=Pi(Pr,t,n,s,g,E),!0;case"pointerover":var T=E.pointerId;return Ai.set(T,Pi(Ai.get(T)||null,t,n,s,g,E)),!0;case"gotpointercapture":return T=E.pointerId,Mi.set(T,Pi(Mi.get(T)||null,t,n,s,g,E)),!0}return!1}function yh(t){var n=ln(t.target);if(n!==null){var s=rr(n);if(s!==null){if(n=s.tag,n===13){if(n=ki(s),n!==null){t.blockedOn=n,mh(t.priority,function(){_h(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 Gs(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var s=fl(t.domEventName,t.eventSystemFlags,n[0],t.nativeEvent);if(s===null){s=t.nativeEvent;var g=new s.constructor(s.type,s);wi=g,s.target.dispatchEvent(g),wi=null}else return n=Ki(s),n!==null&&ul(n),t.blockedOn=s,!1;n.shift()}return!0}function wh(t,n,s){Gs(t)&&s.delete(n)}function km(){hl=!1,Ar!==null&&Gs(Ar)&&(Ar=null),Mr!==null&&Gs(Mr)&&(Mr=null),Pr!==null&&Gs(Pr)&&(Pr=null),Ai.forEach(wh),Mi.forEach(wh)}function Ni(t,n){t.blockedOn===n&&(t.blockedOn=null,hl||(hl=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,km)))}function Bi(t){function n(E){return Ni(E,t)}if(0<Ys.length){Ni(Ys[0],t);for(var s=1;s<Ys.length;s++){var g=Ys[s];g.blockedOn===t&&(g.blockedOn=null)}}for(Ar!==null&&Ni(Ar,t),Mr!==null&&Ni(Mr,t),Pr!==null&&Ni(Pr,t),Ai.forEach(n),Mi.forEach(n),s=0;s<Nr.length;s++)g=Nr[s],g.blockedOn===t&&(g.blockedOn=null);for(;0<Nr.length&&(s=Nr[0],s.blockedOn===null);)yh(s),s.blockedOn===null&&Nr.shift()}var In=y.ReactCurrentBatchConfig,Qs=!0;function Lm(t,n,s,g){var E=Be,T=In.transition;In.transition=null;try{Be=1,dl(t,n,s,g)}finally{Be=E,In.transition=T}}function Rm(t,n,s,g){var E=Be,T=In.transition;In.transition=null;try{Be=4,dl(t,n,s,g)}finally{Be=E,In.transition=T}}function dl(t,n,s,g){if(Qs){var E=fl(t,n,s,g);if(E===null)Tl(t,n,g,Js,s),vh(t,g);else if(Em(E,t,n,s,g))g.stopPropagation();else if(vh(t,g),n&4&&-1<bm.indexOf(t)){for(;E!==null;){var T=Ki(E);if(T!==null&&ph(T),T=fl(t,n,s,g),T===null&&Tl(t,n,g,Js,s),T===E)break;E=T}E!==null&&g.stopPropagation()}else Tl(t,n,g,null,s)}}var Js=null;function fl(t,n,s,g){if(Js=null,t=Si(g),t=ln(t),t!==null)if(n=rr(t),n===null)t=null;else if(s=n.tag,s===13){if(t=ki(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 Js=t,null}function Sh(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(rl()){case Ri:return 1;case Vs:return 4;case An:case nl:return 16;case qs:return 536870912;default:return 16}default:return 16}}var Br=null,pl=null,Zs=null;function Ch(){if(Zs)return Zs;var t,n=pl,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 Zs=E.slice(t,1<g?1-g:void 0)}function eo(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 to(){return!0}function xh(){return!1}function Tt(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 G in t)t.hasOwnProperty(G)&&(s=t[G],this[G]=s?s(T):T[G]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?to:xh,this.isPropagationStopped=xh,this}return I(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=to)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=to)},persist:function(){},isPersistent:to}),n}var On={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_l=Tt(On),Ii=I({},On,{view:0,detail:0}),Dm=Tt(Ii),gl,ml,Oi,ro=I({},Ii,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yl,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!==Oi&&(Oi&&t.type==="mousemove"?(gl=t.screenX-Oi.screenX,ml=t.screenY-Oi.screenY):ml=gl=0,Oi=t),gl)},movementY:function(t){return"movementY"in t?t.movementY:ml}}),bh=Tt(ro),Tm=I({},ro,{dataTransfer:0}),Am=Tt(Tm),Mm=I({},Ii,{relatedTarget:0}),vl=Tt(Mm),Pm=I({},On,{animationName:0,elapsedTime:0,pseudoElement:0}),Nm=Tt(Pm),Bm=I({},On,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Im=Tt(Bm),Om=I({},On,{data:0}),Eh=Tt(Om),Hm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jm={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"},Fm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zm(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=Fm[t])?!!n[t]:!1}function yl(){return zm}var $m=I({},Ii,{key:function(t){if(t.key){var n=Hm[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=eo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?jm[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yl,charCode:function(t){return t.type==="keypress"?eo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?eo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Wm=Tt($m),Um=I({},ro,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kh=Tt(Um),Vm=I({},Ii,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yl}),qm=Tt(Vm),Km=I({},On,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xm=Tt(Km),Ym=I({},ro,{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}),Gm=Tt(Ym),Qm=[9,13,27,32],wl=a&&"CompositionEvent"in window,Hi=null;a&&"documentMode"in document&&(Hi=document.documentMode);var Jm=a&&"TextEvent"in window&&!Hi,Lh=a&&(!wl||Hi&&8<Hi&&11>=Hi),Rh=" ",Dh=!1;function Th(t,n){switch(t){case"keyup":return Qm.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ah(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Hn=!1;function Zm(t,n){switch(t){case"compositionend":return Ah(n);case"keypress":return n.which!==32?null:(Dh=!0,Rh);case"textInput":return t=n.data,t===Rh&&Dh?null:t;default:return null}}function e0(t,n){if(Hn)return t==="compositionend"||!wl&&Th(t,n)?(t=Ch(),Zs=pl=Br=null,Hn=!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 Lh&&n.locale!=="ko"?null:n.data;default:return null}}var t0={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 Mh(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!t0[t.type]:n==="textarea"}function Ph(t,n,s,g){Bs(g),n=ao(n,"onChange"),0<n.length&&(s=new _l("onChange","change",null,s,g),t.push({event:s,listeners:n}))}var ji=null,Fi=null;function r0(t){Qh(t,0)}function no(t){var n=Wn(t);if(le(n))return t}function n0(t,n){if(t==="change")return n}var Nh=!1;if(a){var Sl;if(a){var Cl="oninput"in document;if(!Cl){var Bh=document.createElement("div");Bh.setAttribute("oninput","return;"),Cl=typeof Bh.oninput=="function"}Sl=Cl}else Sl=!1;Nh=Sl&&(!document.documentMode||9<document.documentMode)}function Ih(){ji&&(ji.detachEvent("onpropertychange",Oh),Fi=ji=null)}function Oh(t){if(t.propertyName==="value"&&no(Fi)){var n=[];Ph(n,Fi,t,Si(t)),js(r0,n)}}function i0(t,n,s){t==="focusin"?(Ih(),ji=n,Fi=s,ji.attachEvent("onpropertychange",Oh)):t==="focusout"&&Ih()}function s0(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return no(Fi)}function o0(t,n){if(t==="click")return no(n)}function a0(t,n){if(t==="input"||t==="change")return no(n)}function l0(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Ut=typeof Object.is=="function"?Object.is:l0;function zi(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(!l.call(n,E)||!Ut(t[E],n[E]))return!1}return!0}function Hh(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function jh(t,n){var s=Hh(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=Hh(s)}}function Fh(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Fh(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function zh(){for(var t=window,n=pe();n instanceof t.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)t=n.contentWindow;else break;n=pe(t.document)}return n}function xl(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 c0(t){var n=zh(),s=t.focusedElem,g=t.selectionRange;if(n!==s&&s&&s.ownerDocument&&Fh(s.ownerDocument.documentElement,s)){if(g!==null&&xl(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=jh(s,T);var $=jh(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 u0=a&&"documentMode"in document&&11>=document.documentMode,jn=null,bl=null,$i=null,El=!1;function $h(t,n,s){var g=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;El||jn==null||jn!==pe(g)||(g=jn,"selectionStart"in g&&xl(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}),$i&&zi($i,g)||($i=g,g=ao(bl,"onSelect"),0<g.length&&(n=new _l("onSelect","select",null,n,s),t.push({event:n,listeners:g}),n.target=jn)))}function io(t,n){var s={};return s[t.toLowerCase()]=n.toLowerCase(),s["Webkit"+t]="webkit"+n,s["Moz"+t]="moz"+n,s}var Fn={animationend:io("Animation","AnimationEnd"),animationiteration:io("Animation","AnimationIteration"),animationstart:io("Animation","AnimationStart"),transitionend:io("Transition","TransitionEnd")},kl={},Wh={};a&&(Wh=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 so(t){if(kl[t])return kl[t];if(!Fn[t])return t;var n=Fn[t],s;for(s in n)if(n.hasOwnProperty(s)&&s in Wh)return kl[t]=n[s];return t}var Uh=so("animationend"),Vh=so("animationiteration"),qh=so("animationstart"),Kh=so("transitionend"),Xh=new Map,Yh="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 Ir(t,n){Xh.set(t,n),S(n,[t])}for(var Ll=0;Ll<Yh.length;Ll++){var Rl=Yh[Ll],h0=Rl.toLowerCase(),d0=Rl[0].toUpperCase()+Rl.slice(1);Ir(h0,"on"+d0)}Ir(Uh,"onAnimationEnd"),Ir(Vh,"onAnimationIteration"),Ir(qh,"onAnimationStart"),Ir("dblclick","onDoubleClick"),Ir("focusin","onFocus"),Ir("focusout","onBlur"),Ir(Kh,"onTransitionEnd"),w("onMouseEnter",["mouseout","mouseover"]),w("onMouseLeave",["mouseout","mouseover"]),w("onPointerEnter",["pointerout","pointerover"]),w("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 Wi="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(" "),f0=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wi));function Gh(t,n,s){var g=t.type||"unknown-event";t.currentTarget=s,Za(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 G=g[$],J=G.instance,oe=G.currentTarget;if(G=G.listener,J!==T&&E.isPropagationStopped())break e;Gh(E,G,oe),T=J}else for($=0;$<g.length;$++){if(G=g[$],J=G.instance,oe=G.currentTarget,G=G.listener,J!==T&&E.isPropagationStopped())break e;Gh(E,G,oe),T=J}}}if(Tn)throw t=Ei,Tn=!1,Ei=null,t}function je(t,n){var s=n[Il];s===void 0&&(s=n[Il]=new Set);var g=t+"__bubble";s.has(g)||(Jh(n,t,2,!1),s.add(g))}function Dl(t,n,s){var g=0;n&&(g|=4),Jh(s,t,g,n)}var oo="_reactListening"+Math.random().toString(36).slice(2);function Ui(t){if(!t[oo]){t[oo]=!0,o.forEach(function(s){s!=="selectionchange"&&(f0.has(s)||Dl(s,!1,t),Dl(s,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[oo]||(n[oo]=!0,Dl("selectionchange",!1,n))}}function Jh(t,n,s,g){switch(Sh(n)){case 1:var E=Lm;break;case 4:E=Rm;break;default:E=dl}s=E.bind(null,n,s,t),E=void 0,!bi||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 Tl(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 G=g.stateNode.containerInfo;if(G===E||G.nodeType===8&&G.parentNode===E)break;if($===4)for($=g.return;$!==null;){var J=$.tag;if((J===3||J===4)&&(J=$.stateNode.containerInfo,J===E||J.nodeType===8&&J.parentNode===E))return;$=$.return}for(;G!==null;){if($=ln(G),$===null)return;if(J=$.tag,J===5||J===6){g=T=$;continue e}G=G.parentNode}}g=g.return}js(function(){var oe=T,de=Si(s),fe=[];e:{var he=Xh.get(t);if(he!==void 0){var me=_l,ye=t;switch(t){case"keypress":if(eo(s)===0)break e;case"keydown":case"keyup":me=Wm;break;case"focusin":ye="focus",me=vl;break;case"focusout":ye="blur",me=vl;break;case"beforeblur":case"afterblur":me=vl;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":me=bh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=Am;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=qm;break;case Uh:case Vh:case qh:me=Nm;break;case Kh:me=Xm;break;case"scroll":me=Dm;break;case"wheel":me=Gm;break;case"copy":case"cut":case"paste":me=Im;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=kh}var we=(n&4)!==0,Ze=!we&&t==="scroll",ne=we?he!==null?he+"Capture":null:he;we=[];for(var ee=oe,se;ee!==null;){se=ee;var _e=se.stateNode;if(se.tag===5&&_e!==null&&(se=_e,ne!==null&&(_e=rn(ee,ne),_e!=null&&we.push(Vi(ee,_e,se)))),Ze)break;ee=ee.return}0<we.length&&(he=new me(he,ye,null,s,de),fe.push({event:he,listeners:we}))}}if((n&7)===0){e:{if(he=t==="mouseover"||t==="pointerover",me=t==="mouseout"||t==="pointerout",he&&s!==wi&&(ye=s.relatedTarget||s.fromElement)&&(ln(ye)||ye[gr]))break e;if((me||he)&&(he=de.window===de?de:(he=de.ownerDocument)?he.defaultView||he.parentWindow:window,me?(ye=s.relatedTarget||s.toElement,me=oe,ye=ye?ln(ye):null,ye!==null&&(Ze=rr(ye),ye!==Ze||ye.tag!==5&&ye.tag!==6)&&(ye=null)):(me=null,ye=oe),me!==ye)){if(we=bh,_e="onMouseLeave",ne="onMouseEnter",ee="mouse",(t==="pointerout"||t==="pointerover")&&(we=kh,_e="onPointerLeave",ne="onPointerEnter",ee="pointer"),Ze=me==null?he:Wn(me),se=ye==null?he:Wn(ye),he=new we(_e,ee+"leave",me,s,de),he.target=Ze,he.relatedTarget=se,_e=null,ln(de)===oe&&(we=new we(ne,ee+"enter",ye,s,de),we.target=se,we.relatedTarget=Ze,_e=we),Ze=_e,me&&ye)t:{for(we=me,ne=ye,ee=0,se=we;se;se=zn(se))ee++;for(se=0,_e=ne;_e;_e=zn(_e))se++;for(;0<ee-se;)we=zn(we),ee--;for(;0<se-ee;)ne=zn(ne),se--;for(;ee--;){if(we===ne||ne!==null&&we===ne.alternate)break t;we=zn(we),ne=zn(ne)}we=null}else we=null;me!==null&&Zh(fe,he,me,we,!1),ye!==null&&Ze!==null&&Zh(fe,Ze,ye,we,!0)}}e:{if(he=oe?Wn(oe):window,me=he.nodeName&&he.nodeName.toLowerCase(),me==="select"||me==="input"&&he.type==="file")var Ce=n0;else if(Mh(he))if(Nh)Ce=a0;else{Ce=s0;var Ee=i0}else(me=he.nodeName)&&me.toLowerCase()==="input"&&(he.type==="checkbox"||he.type==="radio")&&(Ce=o0);if(Ce&&(Ce=Ce(t,oe))){Ph(fe,Ce,s,de);break e}Ee&&Ee(t,he,oe),t==="focusout"&&(Ee=he._wrapperState)&&Ee.controlled&&he.type==="number"&&Ie(he,"number",he.value)}switch(Ee=oe?Wn(oe):window,t){case"focusin":(Mh(Ee)||Ee.contentEditable==="true")&&(jn=Ee,bl=oe,$i=null);break;case"focusout":$i=bl=jn=null;break;case"mousedown":El=!0;break;case"contextmenu":case"mouseup":case"dragend":El=!1,$h(fe,s,de);break;case"selectionchange":if(u0)break;case"keydown":case"keyup":$h(fe,s,de)}var ke;if(wl)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 Hn?Th(t,s)&&(Le="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(Le="onCompositionStart");Le&&(Lh&&s.locale!=="ko"&&(Hn||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&Hn&&(ke=Ch()):(Br=de,pl="value"in Br?Br.value:Br.textContent,Hn=!0)),Ee=ao(oe,Le),0<Ee.length&&(Le=new Eh(Le,t,null,s,de),fe.push({event:Le,listeners:Ee}),ke?Le.data=ke:(ke=Ah(s),ke!==null&&(Le.data=ke)))),(ke=Jm?Zm(t,s):e0(t,s))&&(oe=ao(oe,"onBeforeInput"),0<oe.length&&(de=new Eh("onBeforeInput","beforeinput",null,s,de),fe.push({event:de,listeners:oe}),de.data=ke))}Qh(fe,n)})}function Vi(t,n,s){return{instance:t,listener:n,currentTarget:s}}function ao(t,n){for(var s=n+"Capture",g=[];t!==null;){var E=t,T=E.stateNode;E.tag===5&&T!==null&&(E=T,T=rn(t,s),T!=null&&g.unshift(Vi(t,T,E)),T=rn(t,n),T!=null&&g.push(Vi(t,T,E))),t=t.return}return g}function zn(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Zh(t,n,s,g,E){for(var T=n._reactName,$=[];s!==null&&s!==g;){var G=s,J=G.alternate,oe=G.stateNode;if(J!==null&&J===g)break;G.tag===5&&oe!==null&&(G=oe,E?(J=rn(s,T),J!=null&&$.unshift(Vi(s,J,G))):E||(J=rn(s,T),J!=null&&$.push(Vi(s,J,G)))),s=s.return}$.length!==0&&t.push({event:n,listeners:$})}var p0=/\r\n?/g,_0=/\u0000|\uFFFD/g;function ed(t){return(typeof t=="string"?t:""+t).replace(p0,`
|
|
38
|
+
`).replace(_0,"")}function lo(t,n,s){if(n=ed(n),ed(t)!==n&&s)throw Error(i(425))}function co(){}var Al=null,Ml=null;function Pl(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 Nl=typeof setTimeout=="function"?setTimeout:void 0,g0=typeof clearTimeout=="function"?clearTimeout:void 0,td=typeof Promise=="function"?Promise:void 0,m0=typeof queueMicrotask=="function"?queueMicrotask:typeof td<"u"?function(t){return td.resolve(null).then(t).catch(v0)}:Nl;function v0(t){setTimeout(function(){throw t})}function Bl(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 Or(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 rd(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 $n=Math.random().toString(36).slice(2),ir="__reactFiber$"+$n,qi="__reactProps$"+$n,gr="__reactContainer$"+$n,Il="__reactEvents$"+$n,y0="__reactListeners$"+$n,w0="__reactHandles$"+$n;function ln(t){var n=t[ir];if(n)return n;for(var s=t.parentNode;s;){if(n=s[gr]||s[ir]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(t=rd(t);t!==null;){if(s=t[ir])return s;t=rd(t)}return n}t=s,s=t.parentNode}return null}function Ki(t){return t=t[ir]||t[gr],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Wn(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(i(33))}function uo(t){return t[qi]||null}var Ol=[],Un=-1;function Hr(t){return{current:t}}function Fe(t){0>Un||(t.current=Ol[Un],Ol[Un]=null,Un--)}function He(t,n){Un++,Ol[Un]=t.current,t.current=n}var jr={},_t=Hr(jr),St=Hr(!1),cn=jr;function Vn(t,n){var s=t.type.contextTypes;if(!s)return jr;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 Ct(t){return t=t.childContextTypes,t!=null}function ho(){Fe(St),Fe(_t)}function nd(t,n,s){if(_t.current!==jr)throw Error(i(168));He(_t,n),He(St,s)}function id(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 I({},s,g)}function fo(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||jr,cn=_t.current,He(_t,t),He(St,St.current),!0}function sd(t,n,s){var g=t.stateNode;if(!g)throw Error(i(169));s?(t=id(t,n,cn),g.__reactInternalMemoizedMergedChildContext=t,Fe(St),Fe(_t),He(_t,t)):Fe(St),He(St,s)}var mr=null,po=!1,Hl=!1;function od(t){mr===null?mr=[t]:mr.push(t)}function S0(t){po=!0,od(t)}function Fr(){if(!Hl&&mr!==null){Hl=!0;var t=0,n=Be;try{var s=mr;for(Be=1;t<s.length;t++){var g=s[t];do g=g(!0);while(g!==null)}mr=null,po=!1}catch(E){throw mr!==null&&(mr=mr.slice(t+1)),$s(Ri,Fr),E}finally{Be=n,Hl=!1}}return null}var qn=[],Kn=0,_o=null,go=0,Ot=[],Ht=0,un=null,vr=1,yr="";function hn(t,n){qn[Kn++]=go,qn[Kn++]=_o,_o=t,go=n}function ad(t,n,s){Ot[Ht++]=vr,Ot[Ht++]=yr,Ot[Ht++]=un,un=t;var g=vr;t=yr;var E=32-Dt(g)-1;g&=~(1<<E),s+=1;var T=32-Dt(n)+E;if(30<T){var $=E-E%5;T=(g&(1<<$)-1).toString(32),g>>=$,E-=$,vr=1<<32-Dt(n)+E|s<<E|g,yr=T+t}else vr=1<<T|s<<E|g,yr=t}function jl(t){t.return!==null&&(hn(t,1),ad(t,1,0))}function Fl(t){for(;t===_o;)_o=qn[--Kn],qn[Kn]=null,go=qn[--Kn],qn[Kn]=null;for(;t===un;)un=Ot[--Ht],Ot[Ht]=null,yr=Ot[--Ht],Ot[Ht]=null,vr=Ot[--Ht],Ot[Ht]=null}var At=null,Mt=null,We=!1,Vt=null;function ld(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 cd(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,At=t,Mt=Or(n.firstChild),!0):!1;case 6:return n=t.pendingProps===""||n.nodeType!==3?null:n,n!==null?(t.stateNode=n,At=t,Mt=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(s=un!==null?{id:vr,overflow:yr}:null,t.memoizedState={dehydrated:n,treeContext:s,retryLane:1073741824},s=$t(18,null,null,0),s.stateNode=n,s.return=t,t.child=s,At=t,Mt=null,!0):!1;default:return!1}}function zl(t){return(t.mode&1)!==0&&(t.flags&128)===0}function $l(t){if(We){var n=Mt;if(n){var s=n;if(!cd(t,n)){if(zl(t))throw Error(i(418));n=Or(s.nextSibling);var g=At;n&&cd(t,n)?ld(g,s):(t.flags=t.flags&-4097|2,We=!1,At=t)}}else{if(zl(t))throw Error(i(418));t.flags=t.flags&-4097|2,We=!1,At=t}}}function ud(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;At=t}function mo(t){if(t!==At)return!1;if(!We)return ud(t),We=!0,!1;var n;if((n=t.tag!==3)&&!(n=t.tag!==5)&&(n=t.type,n=n!=="head"&&n!=="body"&&!Pl(t.type,t.memoizedProps)),n&&(n=Mt)){if(zl(t))throw hd(),Error(i(418));for(;n;)ld(t,n),n=Or(n.nextSibling)}if(ud(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){Mt=Or(t.nextSibling);break e}n--}else s!=="$"&&s!=="$!"&&s!=="$?"||n++}t=t.nextSibling}Mt=null}}else Mt=At?Or(t.stateNode.nextSibling):null;return!0}function hd(){for(var t=Mt;t;)t=Or(t.nextSibling)}function Xn(){Mt=At=null,We=!1}function Wl(t){Vt===null?Vt=[t]:Vt.push(t)}var C0=y.ReactCurrentBatchConfig;function Xi(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 G=E.refs;$===null?delete G[T]:G[T]=$},n._stringRef=T,n)}if(typeof t!="string")throw Error(i(284));if(!s._owner)throw Error(i(290,t))}return t}function vo(t,n){throw t=Object.prototype.toString.call(n),Error(i(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t))}function dd(t){var n=t._init;return n(t._payload)}function fd(t){function n(ne,ee){if(t){var se=ne.deletions;se===null?(ne.deletions=[ee],ne.flags|=16):se.push(ee)}}function s(ne,ee){if(!t)return null;for(;ee!==null;)n(ne,ee),ee=ee.sibling;return null}function g(ne,ee){for(ne=new Map;ee!==null;)ee.key!==null?ne.set(ee.key,ee):ne.set(ee.index,ee),ee=ee.sibling;return ne}function E(ne,ee){return ne=Xr(ne,ee),ne.index=0,ne.sibling=null,ne}function T(ne,ee,se){return ne.index=se,t?(se=ne.alternate,se!==null?(se=se.index,se<ee?(ne.flags|=2,ee):se):(ne.flags|=2,ee)):(ne.flags|=1048576,ee)}function $(ne){return t&&ne.alternate===null&&(ne.flags|=2),ne}function G(ne,ee,se,_e){return ee===null||ee.tag!==6?(ee=Nc(se,ne.mode,_e),ee.return=ne,ee):(ee=E(ee,se),ee.return=ne,ee)}function J(ne,ee,se,_e){var Ce=se.type;return Ce===D?de(ne,ee,se.props.children,_e,se.key):ee!==null&&(ee.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===U&&dd(Ce)===ee.type)?(_e=E(ee,se.props),_e.ref=Xi(ne,ee,se),_e.return=ne,_e):(_e=$o(se.type,se.key,se.props,null,ne.mode,_e),_e.ref=Xi(ne,ee,se),_e.return=ne,_e)}function oe(ne,ee,se,_e){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==se.containerInfo||ee.stateNode.implementation!==se.implementation?(ee=Bc(se,ne.mode,_e),ee.return=ne,ee):(ee=E(ee,se.children||[]),ee.return=ne,ee)}function de(ne,ee,se,_e,Ce){return ee===null||ee.tag!==7?(ee=yn(se,ne.mode,_e,Ce),ee.return=ne,ee):(ee=E(ee,se),ee.return=ne,ee)}function fe(ne,ee,se){if(typeof ee=="string"&&ee!==""||typeof ee=="number")return ee=Nc(""+ee,ne.mode,se),ee.return=ne,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case k:return se=$o(ee.type,ee.key,ee.props,null,ne.mode,se),se.ref=Xi(ne,null,ee),se.return=ne,se;case R:return ee=Bc(ee,ne.mode,se),ee.return=ne,ee;case U:var _e=ee._init;return fe(ne,_e(ee._payload),se)}if(ze(ee)||A(ee))return ee=yn(ee,ne.mode,se,null),ee.return=ne,ee;vo(ne,ee)}return null}function he(ne,ee,se,_e){var Ce=ee!==null?ee.key:null;if(typeof se=="string"&&se!==""||typeof se=="number")return Ce!==null?null:G(ne,ee,""+se,_e);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case k:return se.key===Ce?J(ne,ee,se,_e):null;case R:return se.key===Ce?oe(ne,ee,se,_e):null;case U:return Ce=se._init,he(ne,ee,Ce(se._payload),_e)}if(ze(se)||A(se))return Ce!==null?null:de(ne,ee,se,_e,null);vo(ne,se)}return null}function me(ne,ee,se,_e,Ce){if(typeof _e=="string"&&_e!==""||typeof _e=="number")return ne=ne.get(se)||null,G(ee,ne,""+_e,Ce);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case k:return ne=ne.get(_e.key===null?se:_e.key)||null,J(ee,ne,_e,Ce);case R:return ne=ne.get(_e.key===null?se:_e.key)||null,oe(ee,ne,_e,Ce);case U:var Ee=_e._init;return me(ne,ee,se,Ee(_e._payload),Ce)}if(ze(_e)||A(_e))return ne=ne.get(se)||null,de(ee,ne,_e,Ce,null);vo(ee,_e)}return null}function ye(ne,ee,se,_e){for(var Ce=null,Ee=null,ke=ee,Le=ee=0,ct=null;ke!==null&&Le<se.length;Le++){ke.index>Le?(ct=ke,ke=null):ct=ke.sibling;var Pe=he(ne,ke,se[Le],_e);if(Pe===null){ke===null&&(ke=ct);break}t&&ke&&Pe.alternate===null&&n(ne,ke),ee=T(Pe,ee,Le),Ee===null?Ce=Pe:Ee.sibling=Pe,Ee=Pe,ke=ct}if(Le===se.length)return s(ne,ke),We&&hn(ne,Le),Ce;if(ke===null){for(;Le<se.length;Le++)ke=fe(ne,se[Le],_e),ke!==null&&(ee=T(ke,ee,Le),Ee===null?Ce=ke:Ee.sibling=ke,Ee=ke);return We&&hn(ne,Le),Ce}for(ke=g(ne,ke);Le<se.length;Le++)ct=me(ke,ne,Le,se[Le],_e),ct!==null&&(t&&ct.alternate!==null&&ke.delete(ct.key===null?Le:ct.key),ee=T(ct,ee,Le),Ee===null?Ce=ct:Ee.sibling=ct,Ee=ct);return t&&ke.forEach(function(Yr){return n(ne,Yr)}),We&&hn(ne,Le),Ce}function we(ne,ee,se,_e){var Ce=A(se);if(typeof Ce!="function")throw Error(i(150));if(se=Ce.call(se),se==null)throw Error(i(151));for(var Ee=Ce=null,ke=ee,Le=ee=0,ct=null,Pe=se.next();ke!==null&&!Pe.done;Le++,Pe=se.next()){ke.index>Le?(ct=ke,ke=null):ct=ke.sibling;var Yr=he(ne,ke,Pe.value,_e);if(Yr===null){ke===null&&(ke=ct);break}t&&ke&&Yr.alternate===null&&n(ne,ke),ee=T(Yr,ee,Le),Ee===null?Ce=Yr:Ee.sibling=Yr,Ee=Yr,ke=ct}if(Pe.done)return s(ne,ke),We&&hn(ne,Le),Ce;if(ke===null){for(;!Pe.done;Le++,Pe=se.next())Pe=fe(ne,Pe.value,_e),Pe!==null&&(ee=T(Pe,ee,Le),Ee===null?Ce=Pe:Ee.sibling=Pe,Ee=Pe);return We&&hn(ne,Le),Ce}for(ke=g(ne,ke);!Pe.done;Le++,Pe=se.next())Pe=me(ke,ne,Le,Pe.value,_e),Pe!==null&&(t&&Pe.alternate!==null&&ke.delete(Pe.key===null?Le:Pe.key),ee=T(Pe,ee,Le),Ee===null?Ce=Pe:Ee.sibling=Pe,Ee=Pe);return t&&ke.forEach(function(tv){return n(ne,tv)}),We&&hn(ne,Le),Ce}function Ze(ne,ee,se,_e){if(typeof se=="object"&&se!==null&&se.type===D&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case k:e:{for(var Ce=se.key,Ee=ee;Ee!==null;){if(Ee.key===Ce){if(Ce=se.type,Ce===D){if(Ee.tag===7){s(ne,Ee.sibling),ee=E(Ee,se.props.children),ee.return=ne,ne=ee;break e}}else if(Ee.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===U&&dd(Ce)===Ee.type){s(ne,Ee.sibling),ee=E(Ee,se.props),ee.ref=Xi(ne,Ee,se),ee.return=ne,ne=ee;break e}s(ne,Ee);break}else n(ne,Ee);Ee=Ee.sibling}se.type===D?(ee=yn(se.props.children,ne.mode,_e,se.key),ee.return=ne,ne=ee):(_e=$o(se.type,se.key,se.props,null,ne.mode,_e),_e.ref=Xi(ne,ee,se),_e.return=ne,ne=_e)}return $(ne);case R:e:{for(Ee=se.key;ee!==null;){if(ee.key===Ee)if(ee.tag===4&&ee.stateNode.containerInfo===se.containerInfo&&ee.stateNode.implementation===se.implementation){s(ne,ee.sibling),ee=E(ee,se.children||[]),ee.return=ne,ne=ee;break e}else{s(ne,ee);break}else n(ne,ee);ee=ee.sibling}ee=Bc(se,ne.mode,_e),ee.return=ne,ne=ee}return $(ne);case U:return Ee=se._init,Ze(ne,ee,Ee(se._payload),_e)}if(ze(se))return ye(ne,ee,se,_e);if(A(se))return we(ne,ee,se,_e);vo(ne,se)}return typeof se=="string"&&se!==""||typeof se=="number"?(se=""+se,ee!==null&&ee.tag===6?(s(ne,ee.sibling),ee=E(ee,se),ee.return=ne,ne=ee):(s(ne,ee),ee=Nc(se,ne.mode,_e),ee.return=ne,ne=ee),$(ne)):s(ne,ee)}return Ze}var Yn=fd(!0),pd=fd(!1),yo=Hr(null),wo=null,Gn=null,Ul=null;function Vl(){Ul=Gn=wo=null}function ql(t){var n=yo.current;Fe(yo),t._currentValue=n}function Kl(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 Qn(t,n){wo=t,Ul=Gn=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&n)!==0&&(xt=!0),t.firstContext=null)}function jt(t){var n=t._currentValue;if(Ul!==t)if(t={context:t,memoizedValue:n,next:null},Gn===null){if(wo===null)throw Error(i(308));Gn=t,wo.dependencies={lanes:0,firstContext:t}}else Gn=Gn.next=t;return n}var dn=null;function Xl(t){dn===null?dn=[t]:dn.push(t)}function _d(t,n,s,g){var E=n.interleaved;return E===null?(s.next=s,Xl(n)):(s.next=E.next,E.next=s),n.interleaved=s,wr(t,g)}function wr(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 zr=!1;function Yl(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function gd(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 Sr(t,n){return{eventTime:t,lane:n,tag:0,payload:null,callback:null,next:null}}function $r(t,n,s){var g=t.updateQueue;if(g===null)return null;if(g=g.shared,(Me&2)!==0){var E=g.pending;return E===null?n.next=n:(n.next=E.next,E.next=n),g.pending=n,wr(t,s)}return E=g.interleaved,E===null?(n.next=n,Xl(g)):(n.next=E.next,E.next=n),g.interleaved=n,wr(t,s)}function So(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,cl(t,s)}}function md(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 Co(t,n,s,g){var E=t.updateQueue;zr=!1;var T=E.firstBaseUpdate,$=E.lastBaseUpdate,G=E.shared.pending;if(G!==null){E.shared.pending=null;var J=G,oe=J.next;J.next=null,$===null?T=oe:$.next=oe,$=J;var de=t.alternate;de!==null&&(de=de.updateQueue,G=de.lastBaseUpdate,G!==$&&(G===null?de.firstBaseUpdate=oe:G.next=oe,de.lastBaseUpdate=J))}if(T!==null){var fe=E.baseState;$=0,de=oe=J=null,G=T;do{var he=G.lane,me=G.eventTime;if((g&he)===he){de!==null&&(de=de.next={eventTime:me,lane:0,tag:G.tag,payload:G.payload,callback:G.callback,next:null});e:{var ye=t,we=G;switch(he=n,me=s,we.tag){case 1:if(ye=we.payload,typeof ye=="function"){fe=ye.call(me,fe,he);break e}fe=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=we.payload,he=typeof ye=="function"?ye.call(me,fe,he):ye,he==null)break e;fe=I({},fe,he);break e;case 2:zr=!0}}G.callback!==null&&G.lane!==0&&(t.flags|=64,he=E.effects,he===null?E.effects=[G]:he.push(G))}else me={eventTime:me,lane:he,tag:G.tag,payload:G.payload,callback:G.callback,next:null},de===null?(oe=de=me,J=fe):de=de.next=me,$|=he;if(G=G.next,G===null){if(G=E.shared.pending,G===null)break;he=G,G=he.next,he.next=null,E.lastBaseUpdate=he,E.shared.pending=null}}while(!0);if(de===null&&(J=fe),E.baseState=J,E.firstBaseUpdate=oe,E.lastBaseUpdate=de,n=E.shared.interleaved,n!==null){E=n;do $|=E.lane,E=E.next;while(E!==n)}else T===null&&(E.shared.lanes=0);_n|=$,t.lanes=$,t.memoizedState=fe}}function vd(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 Yi={},sr=Hr(Yi),Gi=Hr(Yi),Qi=Hr(Yi);function fn(t){if(t===Yi)throw Error(i(174));return t}function Gl(t,n){switch(He(Qi,n),He(Gi,t),He(sr,Yi),t=n.nodeType,t){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:ht(null,"");break;default:t=t===8?n.parentNode:n,n=t.namespaceURI||null,t=t.tagName,n=ht(n,t)}Fe(sr),He(sr,n)}function Jn(){Fe(sr),Fe(Gi),Fe(Qi)}function yd(t){fn(Qi.current);var n=fn(sr.current),s=ht(n,t.type);n!==s&&(He(Gi,t),He(sr,s))}function Ql(t){Gi.current===t&&(Fe(sr),Fe(Gi))}var Xe=Hr(0);function xo(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 Jl=[];function Zl(){for(var t=0;t<Jl.length;t++)Jl[t]._workInProgressVersionPrimary=null;Jl.length=0}var bo=y.ReactCurrentDispatcher,ec=y.ReactCurrentBatchConfig,pn=0,Ye=null,nt=null,at=null,Eo=!1,Ji=!1,Zi=0,x0=0;function gt(){throw Error(i(321))}function tc(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 rc(t,n,s,g,E,T){if(pn=T,Ye=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,bo.current=t===null||t.memoizedState===null?L0:R0,t=s(g,E),Ji){T=0;do{if(Ji=!1,Zi=0,25<=T)throw Error(i(301));T+=1,at=nt=null,n.updateQueue=null,bo.current=D0,t=s(g,E)}while(Ji)}if(bo.current=Ro,n=nt!==null&&nt.next!==null,pn=0,at=nt=Ye=null,Eo=!1,n)throw Error(i(300));return t}function nc(){var t=Zi!==0;return Zi=0,t}function or(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return at===null?Ye.memoizedState=at=t:at=at.next=t,at}function Ft(){if(nt===null){var t=Ye.alternate;t=t!==null?t.memoizedState:null}else t=nt.next;var n=at===null?Ye.memoizedState:at.next;if(n!==null)at=n,nt=t;else{if(t===null)throw Error(i(310));nt=t,t={memoizedState:nt.memoizedState,baseState:nt.baseState,baseQueue:nt.baseQueue,queue:nt.queue,next:null},at===null?Ye.memoizedState=at=t:at=at.next=t}return at}function es(t,n){return typeof n=="function"?n(t):n}function ic(t){var n=Ft(),s=n.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=t;var g=nt,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 G=$=null,J=null,oe=T;do{var de=oe.lane;if((pn&de)===de)J!==null&&(J=J.next={lane:0,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),g=oe.hasEagerState?oe.eagerState:t(g,oe.action);else{var fe={lane:de,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null};J===null?(G=J=fe,$=g):J=J.next=fe,Ye.lanes|=de,_n|=de}oe=oe.next}while(oe!==null&&oe!==T);J===null?$=g:J.next=G,Ut(g,n.memoizedState)||(xt=!0),n.memoizedState=g,n.baseState=$,n.baseQueue=J,s.lastRenderedState=g}if(t=s.interleaved,t!==null){E=t;do T=E.lane,Ye.lanes|=T,_n|=T,E=E.next;while(E!==t)}else E===null&&(s.lanes=0);return[n.memoizedState,s.dispatch]}function sc(t){var n=Ft(),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)||(xt=!0),n.memoizedState=T,n.baseQueue===null&&(n.baseState=T),s.lastRenderedState=T}return[T,g]}function wd(){}function Sd(t,n){var s=Ye,g=Ft(),E=n(),T=!Ut(g.memoizedState,E);if(T&&(g.memoizedState=E,xt=!0),g=g.queue,oc(bd.bind(null,s,g,t),[t]),g.getSnapshot!==n||T||at!==null&&at.memoizedState.tag&1){if(s.flags|=2048,ts(9,xd.bind(null,s,g,E,n),void 0,null),lt===null)throw Error(i(349));(pn&30)!==0||Cd(s,n,E)}return E}function Cd(t,n,s){t.flags|=16384,t={getSnapshot:n,value:s},n=Ye.updateQueue,n===null?(n={lastEffect:null,stores:null},Ye.updateQueue=n,n.stores=[t]):(s=n.stores,s===null?n.stores=[t]:s.push(t))}function xd(t,n,s,g){n.value=s,n.getSnapshot=g,Ed(n)&&kd(t)}function bd(t,n,s){return s(function(){Ed(n)&&kd(t)})}function Ed(t){var n=t.getSnapshot;t=t.value;try{var s=n();return!Ut(t,s)}catch{return!0}}function kd(t){var n=wr(t,1);n!==null&&Yt(n,t,1,-1)}function Ld(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:es,lastRenderedState:t},n.queue=t,t=t.dispatch=k0.bind(null,Ye,t),[n.memoizedState,t]}function ts(t,n,s,g){return t={tag:t,create:n,destroy:s,deps:g,next:null},n=Ye.updateQueue,n===null?(n={lastEffect:null,stores:null},Ye.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 Rd(){return Ft().memoizedState}function ko(t,n,s,g){var E=or();Ye.flags|=t,E.memoizedState=ts(1|n,s,void 0,g===void 0?null:g)}function Lo(t,n,s,g){var E=Ft();g=g===void 0?null:g;var T=void 0;if(nt!==null){var $=nt.memoizedState;if(T=$.destroy,g!==null&&tc(g,$.deps)){E.memoizedState=ts(n,s,T,g);return}}Ye.flags|=t,E.memoizedState=ts(1|n,s,T,g)}function Dd(t,n){return ko(8390656,8,t,n)}function oc(t,n){return Lo(2048,8,t,n)}function Td(t,n){return Lo(4,2,t,n)}function Ad(t,n){return Lo(4,4,t,n)}function Md(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 Pd(t,n,s){return s=s!=null?s.concat([t]):null,Lo(4,4,Md.bind(null,n,t),s)}function ac(){}function Nd(t,n){var s=Ft();n=n===void 0?null:n;var g=s.memoizedState;return g!==null&&n!==null&&tc(n,g[1])?g[0]:(s.memoizedState=[t,n],t)}function Bd(t,n){var s=Ft();n=n===void 0?null:n;var g=s.memoizedState;return g!==null&&n!==null&&tc(n,g[1])?g[0]:(t=t(),s.memoizedState=[t,n],t)}function Id(t,n,s){return(pn&21)===0?(t.baseState&&(t.baseState=!1,xt=!0),t.memoizedState=s):(Ut(s,n)||(s=Bn(),Ye.lanes|=s,_n|=s,t.baseState=!0),n)}function b0(t,n){var s=Be;Be=s!==0&&4>s?s:4,t(!0);var g=ec.transition;ec.transition={};try{t(!1),n()}finally{Be=s,ec.transition=g}}function Od(){return Ft().memoizedState}function E0(t,n,s){var g=qr(t);if(s={lane:g,action:s,hasEagerState:!1,eagerState:null,next:null},Hd(t))jd(n,s);else if(s=_d(t,n,s,g),s!==null){var E=wt();Yt(s,t,g,E),Fd(s,n,g)}}function k0(t,n,s){var g=qr(t),E={lane:g,action:s,hasEagerState:!1,eagerState:null,next:null};if(Hd(t))jd(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,G=T($,s);if(E.hasEagerState=!0,E.eagerState=G,Ut(G,$)){var J=n.interleaved;J===null?(E.next=E,Xl(n)):(E.next=J.next,J.next=E),n.interleaved=E;return}}catch{}finally{}s=_d(t,n,E,g),s!==null&&(E=wt(),Yt(s,t,g,E),Fd(s,n,g))}}function Hd(t){var n=t.alternate;return t===Ye||n!==null&&n===Ye}function jd(t,n){Ji=Eo=!0;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}function Fd(t,n,s){if((s&4194240)!==0){var g=n.lanes;g&=t.pendingLanes,s|=g,n.lanes=s,cl(t,s)}}var Ro={readContext:jt,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useInsertionEffect:gt,useLayoutEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useMutableSource:gt,useSyncExternalStore:gt,useId:gt,unstable_isNewReconciler:!1},L0={readContext:jt,useCallback:function(t,n){return or().memoizedState=[t,n===void 0?null:n],t},useContext:jt,useEffect:Dd,useImperativeHandle:function(t,n,s){return s=s!=null?s.concat([t]):null,ko(4194308,4,Md.bind(null,n,t),s)},useLayoutEffect:function(t,n){return ko(4194308,4,t,n)},useInsertionEffect:function(t,n){return ko(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=E0.bind(null,Ye,t),[g.memoizedState,t]},useRef:function(t){var n=or();return t={current:t},n.memoizedState=t},useState:Ld,useDebugValue:ac,useDeferredValue:function(t){return or().memoizedState=t},useTransition:function(){var t=Ld(!1),n=t[0];return t=b0.bind(null,t[1]),or().memoizedState=t,[n,t]},useMutableSource:function(){},useSyncExternalStore:function(t,n,s){var g=Ye,E=or();if(We){if(s===void 0)throw Error(i(407));s=s()}else{if(s=n(),lt===null)throw Error(i(349));(pn&30)!==0||Cd(g,n,s)}E.memoizedState=s;var T={value:s,getSnapshot:n};return E.queue=T,Dd(bd.bind(null,g,T,t),[t]),g.flags|=2048,ts(9,xd.bind(null,g,T,s,n),void 0,null),s},useId:function(){var t=or(),n=lt.identifierPrefix;if(We){var s=yr,g=vr;s=(g&~(1<<32-Dt(g)-1)).toString(32)+s,n=":"+n+"R"+s,s=Zi++,0<s&&(n+="H"+s.toString(32)),n+=":"}else s=x0++,n=":"+n+"r"+s.toString(32)+":";return t.memoizedState=n},unstable_isNewReconciler:!1},R0={readContext:jt,useCallback:Nd,useContext:jt,useEffect:oc,useImperativeHandle:Pd,useInsertionEffect:Td,useLayoutEffect:Ad,useMemo:Bd,useReducer:ic,useRef:Rd,useState:function(){return ic(es)},useDebugValue:ac,useDeferredValue:function(t){var n=Ft();return Id(n,nt.memoizedState,t)},useTransition:function(){var t=ic(es)[0],n=Ft().memoizedState;return[t,n]},useMutableSource:wd,useSyncExternalStore:Sd,useId:Od,unstable_isNewReconciler:!1},D0={readContext:jt,useCallback:Nd,useContext:jt,useEffect:oc,useImperativeHandle:Pd,useInsertionEffect:Td,useLayoutEffect:Ad,useMemo:Bd,useReducer:sc,useRef:Rd,useState:function(){return sc(es)},useDebugValue:ac,useDeferredValue:function(t){var n=Ft();return nt===null?n.memoizedState=t:Id(n,nt.memoizedState,t)},useTransition:function(){var t=sc(es)[0],n=Ft().memoizedState;return[t,n]},useMutableSource:wd,useSyncExternalStore:Sd,useId:Od,unstable_isNewReconciler:!1};function qt(t,n){if(t&&t.defaultProps){n=I({},n),t=t.defaultProps;for(var s in t)n[s]===void 0&&(n[s]=t[s]);return n}return n}function lc(t,n,s,g){n=t.memoizedState,s=s(g,n),s=s==null?n:I({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var Do={isMounted:function(t){return(t=t._reactInternals)?rr(t)===t:!1},enqueueSetState:function(t,n,s){t=t._reactInternals;var g=wt(),E=qr(t),T=Sr(g,E);T.payload=n,s!=null&&(T.callback=s),n=$r(t,T,E),n!==null&&(Yt(n,t,E,g),So(n,t,E))},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var g=wt(),E=qr(t),T=Sr(g,E);T.tag=1,T.payload=n,s!=null&&(T.callback=s),n=$r(t,T,E),n!==null&&(Yt(n,t,E,g),So(n,t,E))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=wt(),g=qr(t),E=Sr(s,g);E.tag=2,n!=null&&(E.callback=n),n=$r(t,E,g),n!==null&&(Yt(n,t,g,s),So(n,t,g))}};function zd(t,n,s,g,E,T,$){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(g,T,$):n.prototype&&n.prototype.isPureReactComponent?!zi(s,g)||!zi(E,T):!0}function $d(t,n,s){var g=!1,E=jr,T=n.contextType;return typeof T=="object"&&T!==null?T=jt(T):(E=Ct(n)?cn:_t.current,g=n.contextTypes,T=(g=g!=null)?Vn(t,E):jr),n=new n(s,T),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Do,t.stateNode=n,n._reactInternals=t,g&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=E,t.__reactInternalMemoizedMaskedChildContext=T),n}function Wd(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&&Do.enqueueReplaceState(n,n.state,null)}function cc(t,n,s,g){var E=t.stateNode;E.props=s,E.state=t.memoizedState,E.refs={},Yl(t);var T=n.contextType;typeof T=="object"&&T!==null?E.context=jt(T):(T=Ct(n)?cn:_t.current,E.context=Vn(t,T)),E.state=t.memoizedState,T=n.getDerivedStateFromProps,typeof T=="function"&&(lc(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&&Do.enqueueReplaceState(E,E.state,null),Co(t,s,E,g),E.state=t.memoizedState),typeof E.componentDidMount=="function"&&(t.flags|=4194308)}function Zn(t,n){try{var s="",g=n;do s+=ie(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 uc(t,n,s){return{value:t,source:null,stack:s??null,digest:n??null}}function hc(t,n){try{console.error(n.value)}catch(s){setTimeout(function(){throw s})}}var T0=typeof WeakMap=="function"?WeakMap:Map;function Ud(t,n,s){s=Sr(-1,s),s.tag=3,s.payload={element:null};var g=n.value;return s.callback=function(){Io||(Io=!0,kc=g),hc(t,n)},s}function Vd(t,n,s){s=Sr(-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(){hc(t,n)}}var T=t.stateNode;return T!==null&&typeof T.componentDidCatch=="function"&&(s.callback=function(){hc(t,n),typeof g!="function"&&(Ur===null?Ur=new Set([this]):Ur.add(this));var $=n.stack;this.componentDidCatch(n.value,{componentStack:$!==null?$:""})}),s}function qd(t,n,s){var g=t.pingCache;if(g===null){g=t.pingCache=new T0;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=U0.bind(null,t,n,s),n.then(t,t))}function Kd(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 Xd(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=Sr(-1,1),n.tag=2,$r(s,n,1))),s.lanes|=1),t):(t.flags|=65536,t.lanes=E,t)}var A0=y.ReactCurrentOwner,xt=!1;function yt(t,n,s,g){n.child=t===null?pd(n,null,s,g):Yn(n,t.child,s,g)}function Yd(t,n,s,g,E){s=s.render;var T=n.ref;return Qn(n,E),g=rc(t,n,s,g,T,E),s=nc(),t!==null&&!xt?(n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~E,Cr(t,n,E)):(We&&s&&jl(n),n.flags|=1,yt(t,n,g,E),n.child)}function Gd(t,n,s,g,E){if(t===null){var T=s.type;return typeof T=="function"&&!Pc(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=$o(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:zi,s($,g)&&t.ref===n.ref)return Cr(t,n,E)}return n.flags|=1,t=Xr(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(zi(T,g)&&t.ref===n.ref)if(xt=!1,n.pendingProps=g=T,(t.lanes&E)!==0)(t.flags&131072)!==0&&(xt=!0);else return n.lanes=t.lanes,Cr(t,n,E)}return dc(t,n,s,g,E)}function Jd(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},He(ti,Pt),Pt|=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,He(ti,Pt),Pt|=t,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=T!==null?T.baseLanes:s,He(ti,Pt),Pt|=g}else T!==null?(g=T.baseLanes|s,n.memoizedState=null):g=s,He(ti,Pt),Pt|=g;return yt(t,n,E,s),n.child}function Zd(t,n){var s=n.ref;(t===null&&s!==null||t!==null&&t.ref!==s)&&(n.flags|=512,n.flags|=2097152)}function dc(t,n,s,g,E){var T=Ct(s)?cn:_t.current;return T=Vn(n,T),Qn(n,E),s=rc(t,n,s,g,T,E),g=nc(),t!==null&&!xt?(n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~E,Cr(t,n,E)):(We&&g&&jl(n),n.flags|=1,yt(t,n,s,E),n.child)}function ef(t,n,s,g,E){if(Ct(s)){var T=!0;fo(n)}else T=!1;if(Qn(n,E),n.stateNode===null)Ao(t,n),$d(n,s,g),cc(n,s,g,E),g=!0;else if(t===null){var $=n.stateNode,G=n.memoizedProps;$.props=G;var J=$.context,oe=s.contextType;typeof oe=="object"&&oe!==null?oe=jt(oe):(oe=Ct(s)?cn:_t.current,oe=Vn(n,oe));var de=s.getDerivedStateFromProps,fe=typeof de=="function"||typeof $.getSnapshotBeforeUpdate=="function";fe||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(G!==g||J!==oe)&&Wd(n,$,g,oe),zr=!1;var he=n.memoizedState;$.state=he,Co(n,g,$,E),J=n.memoizedState,G!==g||he!==J||St.current||zr?(typeof de=="function"&&(lc(n,s,de,g),J=n.memoizedState),(G=zr||zd(n,s,G,g,he,J,oe))?(fe||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=J),$.props=g,$.state=J,$.context=oe,g=G):(typeof $.componentDidMount=="function"&&(n.flags|=4194308),g=!1)}else{$=n.stateNode,gd(t,n),G=n.memoizedProps,oe=n.type===n.elementType?G:qt(n.type,G),$.props=oe,fe=n.pendingProps,he=$.context,J=s.contextType,typeof J=="object"&&J!==null?J=jt(J):(J=Ct(s)?cn:_t.current,J=Vn(n,J));var me=s.getDerivedStateFromProps;(de=typeof me=="function"||typeof $.getSnapshotBeforeUpdate=="function")||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(G!==fe||he!==J)&&Wd(n,$,g,J),zr=!1,he=n.memoizedState,$.state=he,Co(n,g,$,E);var ye=n.memoizedState;G!==fe||he!==ye||St.current||zr?(typeof me=="function"&&(lc(n,s,me,g),ye=n.memoizedState),(oe=zr||zd(n,s,oe,g,he,ye,J)||!1)?(de||typeof $.UNSAFE_componentWillUpdate!="function"&&typeof $.componentWillUpdate!="function"||(typeof $.componentWillUpdate=="function"&&$.componentWillUpdate(g,ye,J),typeof $.UNSAFE_componentWillUpdate=="function"&&$.UNSAFE_componentWillUpdate(g,ye,J)),typeof $.componentDidUpdate=="function"&&(n.flags|=4),typeof $.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof $.componentDidUpdate!="function"||G===t.memoizedProps&&he===t.memoizedState||(n.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||G===t.memoizedProps&&he===t.memoizedState||(n.flags|=1024),n.memoizedProps=g,n.memoizedState=ye),$.props=g,$.state=ye,$.context=J,g=oe):(typeof $.componentDidUpdate!="function"||G===t.memoizedProps&&he===t.memoizedState||(n.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||G===t.memoizedProps&&he===t.memoizedState||(n.flags|=1024),g=!1)}return fc(t,n,s,g,T,E)}function fc(t,n,s,g,E,T){Zd(t,n);var $=(n.flags&128)!==0;if(!g&&!$)return E&&sd(n,s,!1),Cr(t,n,T);g=n.stateNode,A0.current=n;var G=$&&typeof s.getDerivedStateFromError!="function"?null:g.render();return n.flags|=1,t!==null&&$?(n.child=Yn(n,t.child,null,T),n.child=Yn(n,null,G,T)):yt(t,n,G,T),n.memoizedState=g.state,E&&sd(n,s,!0),n.child}function tf(t){var n=t.stateNode;n.pendingContext?nd(t,n.pendingContext,n.pendingContext!==n.context):n.context&&nd(t,n.context,!1),Gl(t,n.containerInfo)}function rf(t,n,s,g,E){return Xn(),Wl(E),n.flags|=256,yt(t,n,s,g),n.child}var pc={dehydrated:null,treeContext:null,retryLane:0};function _c(t){return{baseLanes:t,cachePool:null,transitions:null}}function nf(t,n,s){var g=n.pendingProps,E=Xe.current,T=!1,$=(n.flags&128)!==0,G;if((G=$)||(G=t!==null&&t.memoizedState===null?!1:(E&2)!==0),G?(T=!0,n.flags&=-129):(t===null||t.memoizedState!==null)&&(E|=1),He(Xe,E&1),t===null)return $l(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=Wo($,g,0,null),t=yn(t,g,s,null),T.return=n,t.return=n,T.sibling=t,n.child=T,n.child.memoizedState=_c(s),n.memoizedState=pc,t):gc(n,$));if(E=t.memoizedState,E!==null&&(G=E.dehydrated,G!==null))return M0(t,n,$,g,G,E,s);if(T){T=g.fallback,$=n.mode,E=t.child,G=E.sibling;var J={mode:"hidden",children:g.children};return($&1)===0&&n.child!==E?(g=n.child,g.childLanes=0,g.pendingProps=J,n.deletions=null):(g=Xr(E,J),g.subtreeFlags=E.subtreeFlags&14680064),G!==null?T=Xr(G,T):(T=yn(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?_c(s):{baseLanes:$.baseLanes|s,cachePool:null,transitions:$.transitions},T.memoizedState=$,T.childLanes=t.childLanes&~s,n.memoizedState=pc,g}return T=t.child,t=T.sibling,g=Xr(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 gc(t,n){return n=Wo({mode:"visible",children:n},t.mode,0,null),n.return=t,t.child=n}function To(t,n,s,g){return g!==null&&Wl(g),Yn(n,t.child,null,s),t=gc(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function M0(t,n,s,g,E,T,$){if(s)return n.flags&256?(n.flags&=-257,g=uc(Error(i(422))),To(t,n,$,g)):n.memoizedState!==null?(n.child=t.child,n.flags|=128,null):(T=g.fallback,E=n.mode,g=Wo({mode:"visible",children:g.children},E,0,null),T=yn(T,E,$,null),T.flags|=2,g.return=n,T.return=n,g.sibling=T,n.child=g,(n.mode&1)!==0&&Yn(n,t.child,null,$),n.child.memoizedState=_c($),n.memoizedState=pc,T);if((n.mode&1)===0)return To(t,n,$,null);if(E.data==="$!"){if(g=E.nextSibling&&E.nextSibling.dataset,g)var G=g.dgst;return g=G,T=Error(i(419)),g=uc(T,g,void 0),To(t,n,$,g)}if(G=($&t.childLanes)!==0,xt||G){if(g=lt,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,wr(t,E),Yt(g,t,E,-1))}return Mc(),g=uc(Error(i(421))),To(t,n,$,g)}return E.data==="$?"?(n.flags|=128,n.child=t.child,n=V0.bind(null,t),E._reactRetry=n,null):(t=T.treeContext,Mt=Or(E.nextSibling),At=n,We=!0,Vt=null,t!==null&&(Ot[Ht++]=vr,Ot[Ht++]=yr,Ot[Ht++]=un,vr=t.id,yr=t.overflow,un=n),n=gc(n,g.children),n.flags|=4096,n)}function sf(t,n,s){t.lanes|=n;var g=t.alternate;g!==null&&(g.lanes|=n),Kl(t.return,n,s)}function mc(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 of(t,n,s){var g=n.pendingProps,E=g.revealOrder,T=g.tail;if(yt(t,n,g.children,s),g=Xe.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&&sf(t,s,n);else if(t.tag===19)sf(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(He(Xe,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&&xo(t)===null&&(E=s),s=s.sibling;s=E,s===null?(E=n.child,n.child=null):(E=s.sibling,s.sibling=null),mc(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&&xo(t)===null){n.child=E;break}t=E.sibling,E.sibling=s,s=E,E=t}mc(n,!0,s,null,T);break;case"together":mc(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function Ao(t,n){(n.mode&1)===0&&t!==null&&(t.alternate=null,n.alternate=null,n.flags|=2)}function Cr(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),_n|=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=Xr(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=Xr(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}function P0(t,n,s){switch(n.tag){case 3:tf(n),Xn();break;case 5:yd(n);break;case 1:Ct(n.type)&&fo(n);break;case 4:Gl(n,n.stateNode.containerInfo);break;case 10:var g=n.type._context,E=n.memoizedProps.value;He(yo,g._currentValue),g._currentValue=E;break;case 13:if(g=n.memoizedState,g!==null)return g.dehydrated!==null?(He(Xe,Xe.current&1),n.flags|=128,null):(s&n.child.childLanes)!==0?nf(t,n,s):(He(Xe,Xe.current&1),t=Cr(t,n,s),t!==null?t.sibling:null);He(Xe,Xe.current&1);break;case 19:if(g=(s&n.childLanes)!==0,(t.flags&128)!==0){if(g)return of(t,n,s);n.flags|=128}if(E=n.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),He(Xe,Xe.current),g)break;return null;case 22:case 23:return n.lanes=0,Jd(t,n,s)}return Cr(t,n,s)}var af,vc,lf,cf;af=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}},vc=function(){},lf=function(t,n,s,g){var E=t.memoizedProps;if(E!==g){t=n.stateNode,fn(sr.current);var T=null;switch(s){case"input":E=Se(t,E),g=Se(t,g),T=[];break;case"select":E=I({},E,{value:void 0}),g=I({},g,{value:void 0}),T=[];break;case"textarea":E=ut(t,E),g=ut(t,g),T=[];break;default:typeof E.onClick!="function"&&typeof g.onClick=="function"&&(t.onclick=co)}vi(s,g);var $;s=null;for(oe in E)if(!g.hasOwnProperty(oe)&&E.hasOwnProperty(oe)&&E[oe]!=null)if(oe==="style"){var G=E[oe];for($ in G)G.hasOwnProperty($)&&(s||(s={}),s[$]="")}else oe!=="dangerouslySetInnerHTML"&&oe!=="children"&&oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&oe!=="autoFocus"&&(u.hasOwnProperty(oe)?T||(T=[]):(T=T||[]).push(oe,null));for(oe in g){var J=g[oe];if(G=E!=null?E[oe]:void 0,g.hasOwnProperty(oe)&&J!==G&&(J!=null||G!=null))if(oe==="style")if(G){for($ in G)!G.hasOwnProperty($)||J&&J.hasOwnProperty($)||(s||(s={}),s[$]="");for($ in J)J.hasOwnProperty($)&&G[$]!==J[$]&&(s||(s={}),s[$]=J[$])}else s||(T||(T=[]),T.push(oe,s)),s=J;else oe==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,G=G?G.__html:void 0,J!=null&&G!==J&&(T=T||[]).push(oe,J)):oe==="children"?typeof J!="string"&&typeof J!="number"||(T=T||[]).push(oe,""+J):oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&(u.hasOwnProperty(oe)?(J!=null&&oe==="onScroll"&&je("scroll",t),T||G===J||(T=[])):(T=T||[]).push(oe,J))}s&&(T=T||[]).push("style",s);var oe=T;(n.updateQueue=oe)&&(n.flags|=4)}},cf=function(t,n,s,g){s!==g&&(n.flags|=4)};function rs(t,n){if(!We)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 mt(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 N0(t,n,s){var g=n.pendingProps;switch(Fl(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(n),null;case 1:return Ct(n.type)&&ho(),mt(n),null;case 3:return g=n.stateNode,Jn(),Fe(St),Fe(_t),Zl(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(t===null||t.child===null)&&(mo(n)?n.flags|=4:t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Vt!==null&&(Dc(Vt),Vt=null))),vc(t,n),mt(n),null;case 5:Ql(n);var E=fn(Qi.current);if(s=n.type,t!==null&&n.stateNode!=null)lf(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 mt(n),null}if(t=fn(sr.current),mo(n)){g=n.stateNode,s=n.type;var T=n.memoizedProps;switch(g[ir]=n,g[qi]=T,t=(n.mode&1)!==0,s){case"dialog":je("cancel",g),je("close",g);break;case"iframe":case"object":case"embed":je("load",g);break;case"video":case"audio":for(E=0;E<Wi.length;E++)je(Wi[E],g);break;case"source":je("error",g);break;case"img":case"image":case"link":je("error",g),je("load",g);break;case"details":je("toggle",g);break;case"input":be(g,T),je("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!T.multiple},je("invalid",g);break;case"textarea":qe(g,T),je("invalid",g)}vi(s,T),E=null;for(var $ in T)if(T.hasOwnProperty($)){var G=T[$];$==="children"?typeof G=="string"?g.textContent!==G&&(T.suppressHydrationWarning!==!0&&lo(g.textContent,G,t),E=["children",G]):typeof G=="number"&&g.textContent!==""+G&&(T.suppressHydrationWarning!==!0&&lo(g.textContent,G,t),E=["children",""+G]):u.hasOwnProperty($)&&G!=null&&$==="onScroll"&&je("scroll",g)}switch(s){case"input":ue(g),Re(g,T,!0);break;case"textarea":ue(g),Ne(g);break;case"select":case"option":break;default:typeof T.onClick=="function"&&(g.onclick=co)}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=Je(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[qi]=g,af(t,n,!1,!1),n.stateNode=t;e:{switch($=yi(s,g),s){case"dialog":je("cancel",t),je("close",t),E=g;break;case"iframe":case"object":case"embed":je("load",t),E=g;break;case"video":case"audio":for(E=0;E<Wi.length;E++)je(Wi[E],t);E=g;break;case"source":je("error",t),E=g;break;case"img":case"image":case"link":je("error",t),je("load",t),E=g;break;case"details":je("toggle",t),E=g;break;case"input":be(t,g),E=Se(t,g),je("invalid",t);break;case"option":E=g;break;case"select":t._wrapperState={wasMultiple:!!g.multiple},E=I({},g,{value:void 0}),je("invalid",t);break;case"textarea":qe(t,g),E=ut(t,g),je("invalid",t);break;default:E=g}vi(s,E),G=E;for(T in G)if(G.hasOwnProperty(T)){var J=G[T];T==="style"?Ps(t,J):T==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&_r(t,J)):T==="children"?typeof J=="string"?(s!=="textarea"||J!=="")&&ot(t,J):typeof J=="number"&&ot(t,""+J):T!=="suppressContentEditableWarning"&&T!=="suppressHydrationWarning"&&T!=="autoFocus"&&(u.hasOwnProperty(T)?J!=null&&T==="onScroll"&&je("scroll",t):J!=null&&h(t,T,J,$))}switch(s){case"input":ue(t),Re(t,g,!1);break;case"textarea":ue(t),Ne(t);break;case"option":g.value!=null&&t.setAttribute("value",""+H(g.value));break;case"select":t.multiple=!!g.multiple,T=g.value,T!=null?Qe(t,!!g.multiple,T,!1):g.defaultValue!=null&&Qe(t,!!g.multiple,g.defaultValue,!0);break;default:typeof E.onClick=="function"&&(t.onclick=co)}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 mt(n),null;case 6:if(t&&n.stateNode!=null)cf(t,n,t.memoizedProps,g);else{if(typeof g!="string"&&n.stateNode===null)throw Error(i(166));if(s=fn(Qi.current),fn(sr.current),mo(n)){if(g=n.stateNode,s=n.memoizedProps,g[ir]=n,(T=g.nodeValue!==s)&&(t=At,t!==null))switch(t.tag){case 3:lo(g.nodeValue,s,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&lo(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 mt(n),null;case 13:if(Fe(Xe),g=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(We&&Mt!==null&&(n.mode&1)!==0&&(n.flags&128)===0)hd(),Xn(),n.flags|=98560,T=!1;else if(T=mo(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 Xn(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;mt(n),T=!1}else Vt!==null&&(Dc(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||(Xe.current&1)!==0?it===0&&(it=3):Mc())),n.updateQueue!==null&&(n.flags|=4),mt(n),null);case 4:return Jn(),vc(t,n),t===null&&Ui(n.stateNode.containerInfo),mt(n),null;case 10:return ql(n.type._context),mt(n),null;case 17:return Ct(n.type)&&ho(),mt(n),null;case 19:if(Fe(Xe),T=n.memoizedState,T===null)return mt(n),null;if(g=(n.flags&128)!==0,$=T.rendering,$===null)if(g)rs(T,!1);else{if(it!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if($=xo(t),$!==null){for(n.flags|=128,rs(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 He(Xe,Xe.current&1|2),n.child}t=t.sibling}T.tail!==null&&Ke()>ri&&(n.flags|=128,g=!0,rs(T,!1),n.lanes=4194304)}else{if(!g)if(t=xo($),t!==null){if(n.flags|=128,g=!0,s=t.updateQueue,s!==null&&(n.updateQueue=s,n.flags|=4),rs(T,!0),T.tail===null&&T.tailMode==="hidden"&&!$.alternate&&!We)return mt(n),null}else 2*Ke()-T.renderingStartTime>ri&&s!==1073741824&&(n.flags|=128,g=!0,rs(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=Ke(),n.sibling=null,s=Xe.current,He(Xe,g?s&1|2:s&1),n):(mt(n),null);case 22:case 23:return Ac(),g=n.memoizedState!==null,t!==null&&t.memoizedState!==null!==g&&(n.flags|=8192),g&&(n.mode&1)!==0?(Pt&1073741824)!==0&&(mt(n),n.subtreeFlags&6&&(n.flags|=8192)):mt(n),null;case 24:return null;case 25:return null}throw Error(i(156,n.tag))}function B0(t,n){switch(Fl(n),n.tag){case 1:return Ct(n.type)&&ho(),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Jn(),Fe(St),Fe(_t),Zl(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 5:return Ql(n),null;case 13:if(Fe(Xe),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(i(340));Xn()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return Fe(Xe),null;case 4:return Jn(),null;case 10:return ql(n.type._context),null;case 22:case 23:return Ac(),null;case 24:return null;default:return null}}var Mo=!1,vt=!1,I0=typeof WeakSet=="function"?WeakSet:Set,ve=null;function ei(t,n){var s=t.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(g){Ge(t,n,g)}else s.current=null}function yc(t,n,s){try{s()}catch(g){Ge(t,n,g)}}var uf=!1;function O0(t,n){if(Al=Qs,t=zh(),xl(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,G=-1,J=-1,oe=0,de=0,fe=t,he=null;t:for(;;){for(var me;fe!==s||E!==0&&fe.nodeType!==3||(G=$+E),fe!==T||g!==0&&fe.nodeType!==3||(J=$+g),fe.nodeType===3&&($+=fe.nodeValue.length),(me=fe.firstChild)!==null;)he=fe,fe=me;for(;;){if(fe===t)break t;if(he===s&&++oe===E&&(G=$),he===T&&++de===g&&(J=$),(me=fe.nextSibling)!==null)break;fe=he,he=fe.parentNode}fe=me}s=G===-1||J===-1?null:{start:G,end:J}}else s=null}s=s||{start:0,end:0}}else s=null;for(Ml={focusedElem:t,selectionRange:s},Qs=!1,ve=n;ve!==null;)if(n=ve,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,ve=t;else for(;ve!==null;){n=ve;try{var ye=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(ye!==null){var we=ye.memoizedProps,Ze=ye.memoizedState,ne=n.stateNode,ee=ne.getSnapshotBeforeUpdate(n.elementType===n.type?we:qt(n.type,we),Ze);ne.__reactInternalSnapshotBeforeUpdate=ee}break;case 3:var se=n.stateNode.containerInfo;se.nodeType===1?se.textContent="":se.nodeType===9&&se.documentElement&&se.removeChild(se.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(_e){Ge(n,n.return,_e)}if(t=n.sibling,t!==null){t.return=n.return,ve=t;break}ve=n.return}return ye=uf,uf=!1,ye}function ns(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&&yc(n,s,T)}E=E.next}while(E!==g)}}function Po(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 wc(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 hf(t){var n=t.alternate;n!==null&&(t.alternate=null,hf(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&(delete n[ir],delete n[qi],delete n[Il],delete n[y0],delete n[w0])),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 df(t){return t.tag===5||t.tag===3||t.tag===4}function ff(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||df(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 Sc(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=co));else if(g!==4&&(t=t.child,t!==null))for(Sc(t,n,s),t=t.sibling;t!==null;)Sc(t,n,s),t=t.sibling}function Cc(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(Cc(t,n,s),t=t.sibling;t!==null;)Cc(t,n,s),t=t.sibling}var dt=null,Kt=!1;function Wr(t,n,s){for(s=s.child;s!==null;)pf(t,n,s),s=s.sibling}function pf(t,n,s){if(It&&typeof It.onCommitFiberUnmount=="function")try{It.onCommitFiberUnmount(on,s)}catch{}switch(s.tag){case 5:vt||ei(s,n);case 6:var g=dt,E=Kt;dt=null,Wr(t,n,s),dt=g,Kt=E,dt!==null&&(Kt?(t=dt,s=s.stateNode,t.nodeType===8?t.parentNode.removeChild(s):t.removeChild(s)):dt.removeChild(s.stateNode));break;case 18:dt!==null&&(Kt?(t=dt,s=s.stateNode,t.nodeType===8?Bl(t.parentNode,s):t.nodeType===1&&Bl(t,s),Bi(t)):Bl(dt,s.stateNode));break;case 4:g=dt,E=Kt,dt=s.stateNode.containerInfo,Kt=!0,Wr(t,n,s),dt=g,Kt=E;break;case 0:case 11:case 14:case 15:if(!vt&&(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)&&yc(s,n,$),E=E.next}while(E!==g)}Wr(t,n,s);break;case 1:if(!vt&&(ei(s,n),g=s.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=s.memoizedProps,g.state=s.memoizedState,g.componentWillUnmount()}catch(G){Ge(s,n,G)}Wr(t,n,s);break;case 21:Wr(t,n,s);break;case 22:s.mode&1?(vt=(g=vt)||s.memoizedState!==null,Wr(t,n,s),vt=g):Wr(t,n,s);break;default:Wr(t,n,s)}}function _f(t){var n=t.updateQueue;if(n!==null){t.updateQueue=null;var s=t.stateNode;s===null&&(s=t.stateNode=new I0),n.forEach(function(g){var E=q0.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,G=$;e:for(;G!==null;){switch(G.tag){case 5:dt=G.stateNode,Kt=!1;break e;case 3:dt=G.stateNode.containerInfo,Kt=!0;break e;case 4:dt=G.stateNode.containerInfo,Kt=!0;break e}G=G.return}if(dt===null)throw Error(i(160));pf(T,$,E),dt=null,Kt=!1;var J=E.alternate;J!==null&&(J.return=null),E.return=null}catch(oe){Ge(E,n,oe)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)gf(n,t),n=n.sibling}function gf(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{ns(3,t,t.return),Po(3,t)}catch(we){Ge(t,t.return,we)}try{ns(5,t,t.return)}catch(we){Ge(t,t.return,we)}}break;case 1:Xt(n,t),ar(t),g&512&&s!==null&&ei(s,s.return);break;case 5:if(Xt(n,t),ar(t),g&512&&s!==null&&ei(s,s.return),t.flags&32){var E=t.stateNode;try{ot(E,"")}catch(we){Ge(t,t.return,we)}}if(g&4&&(E=t.stateNode,E!=null)){var T=t.memoizedProps,$=s!==null?s.memoizedProps:T,G=t.type,J=t.updateQueue;if(t.updateQueue=null,J!==null)try{G==="input"&&T.type==="radio"&&T.name!=null&&ce(E,T),yi(G,$);var oe=yi(G,T);for($=0;$<J.length;$+=2){var de=J[$],fe=J[$+1];de==="style"?Ps(E,fe):de==="dangerouslySetInnerHTML"?_r(E,fe):de==="children"?ot(E,fe):h(E,de,fe,oe)}switch(G){case"input":ge(E,T);break;case"textarea":pt(E,T);break;case"select":var he=E._wrapperState.wasMultiple;E._wrapperState.wasMultiple=!!T.multiple;var me=T.value;me!=null?Qe(E,!!T.multiple,me,!1):he!==!!T.multiple&&(T.defaultValue!=null?Qe(E,!!T.multiple,T.defaultValue,!0):Qe(E,!!T.multiple,T.multiple?[]:"",!1))}E[qi]=T}catch(we){Ge(t,t.return,we)}}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(we){Ge(t,t.return,we)}}break;case 3:if(Xt(n,t),ar(t),g&4&&s!==null&&s.memoizedState.isDehydrated)try{Bi(n.containerInfo)}catch(we){Ge(t,t.return,we)}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||(Ec=Ke())),g&4&&_f(t);break;case 22:if(de=s!==null&&s.memoizedState!==null,t.mode&1?(vt=(oe=vt)||de,Xt(n,t),vt=oe):Xt(n,t),ar(t),g&8192){if(oe=t.memoizedState!==null,(t.stateNode.isHidden=oe)&&!de&&(t.mode&1)!==0)for(ve=t,de=t.child;de!==null;){for(fe=ve=de;ve!==null;){switch(he=ve,me=he.child,he.tag){case 0:case 11:case 14:case 15:ns(4,he,he.return);break;case 1:ei(he,he.return);var ye=he.stateNode;if(typeof ye.componentWillUnmount=="function"){g=he,s=he.return;try{n=g,ye.props=n.memoizedProps,ye.state=n.memoizedState,ye.componentWillUnmount()}catch(we){Ge(g,s,we)}}break;case 5:ei(he,he.return);break;case 22:if(he.memoizedState!==null){yf(fe);continue}}me!==null?(me.return=he,ve=me):yf(fe)}de=de.sibling}e:for(de=null,fe=t;;){if(fe.tag===5){if(de===null){de=fe;try{E=fe.stateNode,oe?(T=E.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none"):(G=fe.stateNode,J=fe.memoizedProps.style,$=J!=null&&J.hasOwnProperty("display")?J.display:null,G.style.display=Rn("display",$))}catch(we){Ge(t,t.return,we)}}}else if(fe.tag===6){if(de===null)try{fe.stateNode.nodeValue=oe?"":fe.memoizedProps}catch(we){Ge(t,t.return,we)}}else if((fe.tag!==22&&fe.tag!==23||fe.memoizedState===null||fe===t)&&fe.child!==null){fe.child.return=fe,fe=fe.child;continue}if(fe===t)break e;for(;fe.sibling===null;){if(fe.return===null||fe.return===t)break e;de===fe&&(de=null),fe=fe.return}de===fe&&(de=null),fe.sibling.return=fe.return,fe=fe.sibling}}break;case 19:Xt(n,t),ar(t),g&4&&_f(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(df(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&&(ot(E,""),g.flags&=-33);var T=ff(t);Cc(t,T,E);break;case 3:case 4:var $=g.stateNode.containerInfo,G=ff(t);Sc(t,G,$);break;default:throw Error(i(161))}}catch(J){Ge(t,t.return,J)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function H0(t,n,s){ve=t,mf(t)}function mf(t,n,s){for(var g=(t.mode&1)!==0;ve!==null;){var E=ve,T=E.child;if(E.tag===22&&g){var $=E.memoizedState!==null||Mo;if(!$){var G=E.alternate,J=G!==null&&G.memoizedState!==null||vt;G=Mo;var oe=vt;if(Mo=$,(vt=J)&&!oe)for(ve=E;ve!==null;)$=ve,J=$.child,$.tag===22&&$.memoizedState!==null?wf(E):J!==null?(J.return=$,ve=J):wf(E);for(;T!==null;)ve=T,mf(T),T=T.sibling;ve=E,Mo=G,vt=oe}vf(t)}else(E.subtreeFlags&8772)!==0&&T!==null?(T.return=E,ve=T):vf(t)}}function vf(t){for(;ve!==null;){var n=ve;if((n.flags&8772)!==0){var s=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:vt||Po(5,n);break;case 1:var g=n.stateNode;if(n.flags&4&&!vt)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&&vd(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}vd(n,$,s)}break;case 5:var G=n.stateNode;if(s===null&&n.flags&4){s=G;var J=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":J.autoFocus&&s.focus();break;case"img":J.src&&(s.src=J.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var oe=n.alternate;if(oe!==null){var de=oe.memoizedState;if(de!==null){var fe=de.dehydrated;fe!==null&&Bi(fe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}vt||n.flags&512&&wc(n)}catch(he){Ge(n,n.return,he)}}if(n===t){ve=null;break}if(s=n.sibling,s!==null){s.return=n.return,ve=s;break}ve=n.return}}function yf(t){for(;ve!==null;){var n=ve;if(n===t){ve=null;break}var s=n.sibling;if(s!==null){s.return=n.return,ve=s;break}ve=n.return}}function wf(t){for(;ve!==null;){var n=ve;try{switch(n.tag){case 0:case 11:case 15:var s=n.return;try{Po(4,n)}catch(J){Ge(n,s,J)}break;case 1:var g=n.stateNode;if(typeof g.componentDidMount=="function"){var E=n.return;try{g.componentDidMount()}catch(J){Ge(n,E,J)}}var T=n.return;try{wc(n)}catch(J){Ge(n,T,J)}break;case 5:var $=n.return;try{wc(n)}catch(J){Ge(n,$,J)}}}catch(J){Ge(n,n.return,J)}if(n===t){ve=null;break}var G=n.sibling;if(G!==null){G.return=n.return,ve=G;break}ve=n.return}}var j0=Math.ceil,No=y.ReactCurrentDispatcher,xc=y.ReactCurrentOwner,zt=y.ReactCurrentBatchConfig,Me=0,lt=null,et=null,ft=0,Pt=0,ti=Hr(0),it=0,is=null,_n=0,Bo=0,bc=0,ss=null,bt=null,Ec=0,ri=1/0,xr=null,Io=!1,kc=null,Ur=null,Oo=!1,Vr=null,Ho=0,os=0,Lc=null,jo=-1,Fo=0;function wt(){return(Me&6)!==0?Ke():jo!==-1?jo:jo=Ke()}function qr(t){return(t.mode&1)===0?1:(Me&2)!==0&&ft!==0?ft&-ft:C0.transition!==null?(Fo===0&&(Fo=Bn()),Fo):(t=Be,t!==0||(t=window.event,t=t===void 0?16:Sh(t.type)),t)}function Yt(t,n,s,g){if(50<os)throw os=0,Lc=null,Error(i(185));an(t,s,g),((Me&2)===0||t!==lt)&&(t===lt&&((Me&2)===0&&(Bo|=s),it===4&&Kr(t,ft)),Et(t,g),s===1&&Me===0&&(n.mode&1)===0&&(ri=Ke()+500,po&&Fr()))}function Et(t,n){var s=t.callbackNode;ll(t,n);var g=Nn(t,t===lt?ft:0);if(g===0)s!==null&&Ws(s),t.callbackNode=null,t.callbackPriority=0;else if(n=g&-g,t.callbackPriority!==n){if(s!=null&&Ws(s),n===1)t.tag===0?S0(Cf.bind(null,t)):od(Cf.bind(null,t)),m0(function(){(Me&6)===0&&Fr()}),s=null;else{switch(fh(g)){case 1:s=Ri;break;case 4:s=Vs;break;case 16:s=An;break;case 536870912:s=qs;break;default:s=An}s=Tf(s,Sf.bind(null,t))}t.callbackPriority=n,t.callbackNode=s}}function Sf(t,n){if(jo=-1,Fo=0,(Me&6)!==0)throw Error(i(327));var s=t.callbackNode;if(ni()&&t.callbackNode!==s)return null;var g=Nn(t,t===lt?ft:0);if(g===0)return null;if((g&30)!==0||(g&t.expiredLanes)!==0||n)n=zo(t,g);else{n=g;var E=Me;Me|=2;var T=bf();(lt!==t||ft!==n)&&(xr=null,ri=Ke()+500,mn(t,n));do try{$0();break}catch(G){xf(t,G)}while(!0);Vl(),No.current=T,Me=E,et!==null?n=0:(lt=null,ft=0,n=it)}if(n!==0){if(n===2&&(E=Di(t),E!==0&&(g=E,n=Rc(t,E))),n===1)throw s=is,mn(t,0),Kr(t,g),Et(t,Ke()),s;if(n===6)Kr(t,g);else{if(E=t.current.alternate,(g&30)===0&&!F0(E)&&(n=zo(t,g),n===2&&(T=Di(t),T!==0&&(g=T,n=Rc(t,T))),n===1))throw s=is,mn(t,0),Kr(t,g),Et(t,Ke()),s;switch(t.finishedWork=E,t.finishedLanes=g,n){case 0:case 1:throw Error(i(345));case 2:vn(t,bt,xr);break;case 3:if(Kr(t,g),(g&130023424)===g&&(n=Ec+500-Ke(),10<n)){if(Nn(t,0)!==0)break;if(E=t.suspendedLanes,(E&g)!==g){wt(),t.pingedLanes|=t.suspendedLanes&E;break}t.timeoutHandle=Nl(vn.bind(null,t,bt,xr),n);break}vn(t,bt,xr);break;case 4:if(Kr(t,g),(g&4194240)===g)break;for(n=t.eventTimes,E=-1;0<g;){var $=31-Dt(g);T=1<<$,$=n[$],$>E&&(E=$),g&=~T}if(g=E,g=Ke()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*j0(g/1960))-g,10<g){t.timeoutHandle=Nl(vn.bind(null,t,bt,xr),g);break}vn(t,bt,xr);break;case 5:vn(t,bt,xr);break;default:throw Error(i(329))}}}return Et(t,Ke()),t.callbackNode===s?Sf.bind(null,t):null}function Rc(t,n){var s=ss;return t.current.memoizedState.isDehydrated&&(mn(t,n).flags|=256),t=zo(t,n),t!==2&&(n=bt,bt=s,n!==null&&Dc(n)),t}function Dc(t){bt===null?bt=t:bt.push.apply(bt,t)}function F0(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 Kr(t,n){for(n&=~bc,n&=~Bo,t.suspendedLanes|=n,t.pingedLanes&=~n,t=t.expirationTimes;0<n;){var s=31-Dt(n),g=1<<s;t[s]=-1,n&=~g}}function Cf(t){if((Me&6)!==0)throw Error(i(327));ni();var n=Nn(t,0);if((n&1)===0)return Et(t,Ke()),null;var s=zo(t,n);if(t.tag!==0&&s===2){var g=Di(t);g!==0&&(n=g,s=Rc(t,g))}if(s===1)throw s=is,mn(t,0),Kr(t,n),Et(t,Ke()),s;if(s===6)throw Error(i(345));return t.finishedWork=t.current.alternate,t.finishedLanes=n,vn(t,bt,xr),Et(t,Ke()),null}function Tc(t,n){var s=Me;Me|=1;try{return t(n)}finally{Me=s,Me===0&&(ri=Ke()+500,po&&Fr())}}function gn(t){Vr!==null&&Vr.tag===0&&(Me&6)===0&&ni();var n=Me;Me|=1;var s=zt.transition,g=Be;try{if(zt.transition=null,Be=1,t)return t()}finally{Be=g,zt.transition=s,Me=n,(Me&6)===0&&Fr()}}function Ac(){Pt=ti.current,Fe(ti)}function mn(t,n){t.finishedWork=null,t.finishedLanes=0;var s=t.timeoutHandle;if(s!==-1&&(t.timeoutHandle=-1,g0(s)),et!==null)for(s=et.return;s!==null;){var g=s;switch(Fl(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&ho();break;case 3:Jn(),Fe(St),Fe(_t),Zl();break;case 5:Ql(g);break;case 4:Jn();break;case 13:Fe(Xe);break;case 19:Fe(Xe);break;case 10:ql(g.type._context);break;case 22:case 23:Ac()}s=s.return}if(lt=t,et=t=Xr(t.current,null),ft=Pt=n,it=0,is=null,bc=Bo=_n=0,bt=ss=null,dn!==null){for(n=0;n<dn.length;n++)if(s=dn[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}dn=null}return t}function xf(t,n){do{var s=et;try{if(Vl(),bo.current=Ro,Eo){for(var g=Ye.memoizedState;g!==null;){var E=g.queue;E!==null&&(E.pending=null),g=g.next}Eo=!1}if(pn=0,at=nt=Ye=null,Ji=!1,Zi=0,xc.current=null,s===null||s.return===null){it=1,is=n,et=null;break}e:{var T=t,$=s.return,G=s,J=n;if(n=ft,G.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var oe=J,de=G,fe=de.tag;if((de.mode&1)===0&&(fe===0||fe===11||fe===15)){var he=de.alternate;he?(de.updateQueue=he.updateQueue,de.memoizedState=he.memoizedState,de.lanes=he.lanes):(de.updateQueue=null,de.memoizedState=null)}var me=Kd($);if(me!==null){me.flags&=-257,Xd(me,$,G,T,n),me.mode&1&&qd(T,oe,n),n=me,J=oe;var ye=n.updateQueue;if(ye===null){var we=new Set;we.add(J),n.updateQueue=we}else ye.add(J);break e}else{if((n&1)===0){qd(T,oe,n),Mc();break e}J=Error(i(426))}}else if(We&&G.mode&1){var Ze=Kd($);if(Ze!==null){(Ze.flags&65536)===0&&(Ze.flags|=256),Xd(Ze,$,G,T,n),Wl(Zn(J,G));break e}}T=J=Zn(J,G),it!==4&&(it=2),ss===null?ss=[T]:ss.push(T),T=$;do{switch(T.tag){case 3:T.flags|=65536,n&=-n,T.lanes|=n;var ne=Ud(T,J,n);md(T,ne);break e;case 1:G=J;var ee=T.type,se=T.stateNode;if((T.flags&128)===0&&(typeof ee.getDerivedStateFromError=="function"||se!==null&&typeof se.componentDidCatch=="function"&&(Ur===null||!Ur.has(se)))){T.flags|=65536,n&=-n,T.lanes|=n;var _e=Vd(T,G,n);md(T,_e);break e}}T=T.return}while(T!==null)}kf(s)}catch(Ce){n=Ce,et===s&&s!==null&&(et=s=s.return);continue}break}while(!0)}function bf(){var t=No.current;return No.current=Ro,t===null?Ro:t}function Mc(){(it===0||it===3||it===2)&&(it=4),lt===null||(_n&268435455)===0&&(Bo&268435455)===0||Kr(lt,ft)}function zo(t,n){var s=Me;Me|=2;var g=bf();(lt!==t||ft!==n)&&(xr=null,mn(t,n));do try{z0();break}catch(E){xf(t,E)}while(!0);if(Vl(),Me=s,No.current=g,et!==null)throw Error(i(261));return lt=null,ft=0,it}function z0(){for(;et!==null;)Ef(et)}function $0(){for(;et!==null&&!tl();)Ef(et)}function Ef(t){var n=Df(t.alternate,t,Pt);t.memoizedProps=t.pendingProps,n===null?kf(t):et=n,xc.current=null}function kf(t){var n=t;do{var s=n.alternate;if(t=n.return,(n.flags&32768)===0){if(s=N0(s,n,Pt),s!==null){et=s;return}}else{if(s=B0(s,n),s!==null){s.flags&=32767,et=s;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{it=6,et=null;return}}if(n=n.sibling,n!==null){et=n;return}et=n=t}while(n!==null);it===0&&(it=5)}function vn(t,n,s){var g=Be,E=zt.transition;try{zt.transition=null,Be=1,W0(t,n,s,g)}finally{zt.transition=E,Be=g}return null}function W0(t,n,s,g){do ni();while(Vr!==null);if((Me&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(Xs(t,T),t===lt&&(et=lt=null,ft=0),(s.subtreeFlags&2064)===0&&(s.flags&2064)===0||Oo||(Oo=!0,Tf(An,function(){return ni(),null})),T=(s.flags&15990)!==0,(s.subtreeFlags&15990)!==0||T){T=zt.transition,zt.transition=null;var $=Be;Be=1;var G=Me;Me|=4,xc.current=null,O0(t,s),gf(s,t),c0(Ml),Qs=!!Al,Ml=Al=null,t.current=s,H0(s),Us(),Me=G,Be=$,zt.transition=T}else t.current=s;if(Oo&&(Oo=!1,Vr=t,Ho=E),T=t.pendingLanes,T===0&&(Ur=null),il(s.stateNode),Et(t,Ke()),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(Io)throw Io=!1,t=kc,kc=null,t;return(Ho&1)!==0&&t.tag!==0&&ni(),T=t.pendingLanes,(T&1)!==0?t===Lc?os++:(os=0,Lc=t):os=0,Fr(),null}function ni(){if(Vr!==null){var t=fh(Ho),n=zt.transition,s=Be;try{if(zt.transition=null,Be=16>t?16:t,Vr===null)var g=!1;else{if(t=Vr,Vr=null,Ho=0,(Me&6)!==0)throw Error(i(331));var E=Me;for(Me|=4,ve=t.current;ve!==null;){var T=ve,$=T.child;if((ve.flags&16)!==0){var G=T.deletions;if(G!==null){for(var J=0;J<G.length;J++){var oe=G[J];for(ve=oe;ve!==null;){var de=ve;switch(de.tag){case 0:case 11:case 15:ns(8,de,T)}var fe=de.child;if(fe!==null)fe.return=de,ve=fe;else for(;ve!==null;){de=ve;var he=de.sibling,me=de.return;if(hf(de),de===oe){ve=null;break}if(he!==null){he.return=me,ve=he;break}ve=me}}}var ye=T.alternate;if(ye!==null){var we=ye.child;if(we!==null){ye.child=null;do{var Ze=we.sibling;we.sibling=null,we=Ze}while(we!==null)}}ve=T}}if((T.subtreeFlags&2064)!==0&&$!==null)$.return=T,ve=$;else e:for(;ve!==null;){if(T=ve,(T.flags&2048)!==0)switch(T.tag){case 0:case 11:case 15:ns(9,T,T.return)}var ne=T.sibling;if(ne!==null){ne.return=T.return,ve=ne;break e}ve=T.return}}var ee=t.current;for(ve=ee;ve!==null;){$=ve;var se=$.child;if(($.subtreeFlags&2064)!==0&&se!==null)se.return=$,ve=se;else e:for($=ee;ve!==null;){if(G=ve,(G.flags&2048)!==0)try{switch(G.tag){case 0:case 11:case 15:Po(9,G)}}catch(Ce){Ge(G,G.return,Ce)}if(G===$){ve=null;break e}var _e=G.sibling;if(_e!==null){_e.return=G.return,ve=_e;break e}ve=G.return}}if(Me=E,Fr(),It&&typeof It.onPostCommitFiberRoot=="function")try{It.onPostCommitFiberRoot(on,t)}catch{}g=!0}return g}finally{Be=s,zt.transition=n}}return!1}function Lf(t,n,s){n=Zn(s,n),n=Ud(t,n,1),t=$r(t,n,1),n=wt(),t!==null&&(an(t,1,n),Et(t,n))}function Ge(t,n,s){if(t.tag===3)Lf(t,t,s);else for(;n!==null;){if(n.tag===3){Lf(n,t,s);break}else if(n.tag===1){var g=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Ur===null||!Ur.has(g))){t=Zn(s,t),t=Vd(n,t,1),n=$r(n,t,1),t=wt(),n!==null&&(an(n,1,t),Et(n,t));break}}n=n.return}}function U0(t,n,s){var g=t.pingCache;g!==null&&g.delete(n),n=wt(),t.pingedLanes|=t.suspendedLanes&s,lt===t&&(ft&s)===s&&(it===4||it===3&&(ft&130023424)===ft&&500>Ke()-Ec?mn(t,0):bc|=s),Et(t,n)}function Rf(t,n){n===0&&((t.mode&1)===0?n=1:(n=Pn,Pn<<=1,(Pn&130023424)===0&&(Pn=4194304)));var s=wt();t=wr(t,n),t!==null&&(an(t,n,s),Et(t,s))}function V0(t){var n=t.memoizedState,s=0;n!==null&&(s=n.retryLane),Rf(t,s)}function q0(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),Rf(t,s)}var Df;Df=function(t,n,s){if(t!==null)if(t.memoizedProps!==n.pendingProps||St.current)xt=!0;else{if((t.lanes&s)===0&&(n.flags&128)===0)return xt=!1,P0(t,n,s);xt=(t.flags&131072)!==0}else xt=!1,We&&(n.flags&1048576)!==0&&ad(n,go,n.index);switch(n.lanes=0,n.tag){case 2:var g=n.type;Ao(t,n),t=n.pendingProps;var E=Vn(n,_t.current);Qn(n,s),E=rc(null,n,g,t,E,s);var T=nc();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,Ct(g)?(T=!0,fo(n)):T=!1,n.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,Yl(n),E.updater=Do,n.stateNode=E,E._reactInternals=n,cc(n,g,t,s),n=fc(null,n,g,!0,T,s)):(n.tag=0,We&&T&&jl(n),yt(null,n,E,s),n=n.child),n;case 16:g=n.elementType;e:{switch(Ao(t,n),t=n.pendingProps,E=g._init,g=E(g._payload),n.type=g,E=n.tag=X0(g),t=qt(g,t),E){case 0:n=dc(null,n,g,t,s);break e;case 1:n=ef(null,n,g,t,s);break e;case 11:n=Yd(null,n,g,t,s);break e;case 14:n=Gd(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),dc(t,n,g,E,s);case 1:return g=n.type,E=n.pendingProps,E=n.elementType===g?E:qt(g,E),ef(t,n,g,E,s);case 3:e:{if(tf(n),t===null)throw Error(i(387));g=n.pendingProps,T=n.memoizedState,E=T.element,gd(t,n),Co(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=Zn(Error(i(423)),n),n=rf(t,n,g,s,E);break e}else if(g!==E){E=Zn(Error(i(424)),n),n=rf(t,n,g,s,E);break e}else for(Mt=Or(n.stateNode.containerInfo.firstChild),At=n,We=!0,Vt=null,s=pd(n,null,g,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Xn(),g===E){n=Cr(t,n,s);break e}yt(t,n,g,s)}n=n.child}return n;case 5:return yd(n),t===null&&$l(n),g=n.type,E=n.pendingProps,T=t!==null?t.memoizedProps:null,$=E.children,Pl(g,E)?$=null:T!==null&&Pl(g,T)&&(n.flags|=32),Zd(t,n),yt(t,n,$,s),n.child;case 6:return t===null&&$l(n),null;case 13:return nf(t,n,s);case 4:return Gl(n,n.stateNode.containerInfo),g=n.pendingProps,t===null?n.child=Yn(n,null,g,s):yt(t,n,g,s),n.child;case 11:return g=n.type,E=n.pendingProps,E=n.elementType===g?E:qt(g,E),Yd(t,n,g,E,s);case 7:return yt(t,n,n.pendingProps,s),n.child;case 8:return yt(t,n,n.pendingProps.children,s),n.child;case 12:return yt(t,n,n.pendingProps.children,s),n.child;case 10:e:{if(g=n.type._context,E=n.pendingProps,T=n.memoizedProps,$=E.value,He(yo,g._currentValue),g._currentValue=$,T!==null)if(Ut(T.value,$)){if(T.children===E.children&&!St.current){n=Cr(t,n,s);break e}}else for(T=n.child,T!==null&&(T.return=n);T!==null;){var G=T.dependencies;if(G!==null){$=T.child;for(var J=G.firstContext;J!==null;){if(J.context===g){if(T.tag===1){J=Sr(-1,s&-s),J.tag=2;var oe=T.updateQueue;if(oe!==null){oe=oe.shared;var de=oe.pending;de===null?J.next=J:(J.next=de.next,de.next=J),oe.pending=J}}T.lanes|=s,J=T.alternate,J!==null&&(J.lanes|=s),Kl(T.return,s,n),G.lanes|=s;break}J=J.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,G=$.alternate,G!==null&&(G.lanes|=s),Kl($,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=$}yt(t,n,E.children,s),n=n.child}return n;case 9:return E=n.type,g=n.pendingProps.children,Qn(n,s),E=jt(E),g=g(E),n.flags|=1,yt(t,n,g,s),n.child;case 14:return g=n.type,E=qt(g,n.pendingProps),E=qt(g.type,E),Gd(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),Ao(t,n),n.tag=1,Ct(g)?(t=!0,fo(n)):t=!1,Qn(n,s),$d(n,g,E),cc(n,g,E,s),fc(null,n,g,!0,t,s);case 19:return of(t,n,s);case 22:return Jd(t,n,s)}throw Error(i(156,n.tag))};function Tf(t,n){return $s(t,n)}function K0(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 K0(t,n,s,g)}function Pc(t){return t=t.prototype,!(!t||!t.isReactComponent)}function X0(t){if(typeof t=="function")return Pc(t)?1:0;if(t!=null){if(t=t.$$typeof,t===F)return 11;if(t===q)return 14}return 2}function Xr(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 $o(t,n,s,g,E,T){var $=2;if(g=t,typeof t=="function")Pc(t)&&($=1);else if(typeof t=="string")$=5;else e:switch(t){case D:return yn(s.children,E,T,n);case L:$=8,E|=8;break;case M:return t=$t(12,s,n,E|2),t.elementType=M,t.lanes=T,t;case B:return t=$t(13,s,n,E),t.elementType=B,t.lanes=T,t;case O:return t=$t(19,s,n,E),t.elementType=O,t.lanes=T,t;case K:return Wo(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 U:$=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 yn(t,n,s,g){return t=$t(7,t,g,n),t.lanes=s,t}function Wo(t,n,s,g){return t=$t(22,t,g,n),t.elementType=K,t.lanes=s,t.stateNode={isHidden:!1},t}function Nc(t,n,s){return t=$t(6,t,null,n),t.lanes=s,t}function Bc(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 Y0(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=Ti(0),this.expirationTimes=Ti(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ti(0),this.identifierPrefix=g,this.onRecoverableError=E,this.mutableSourceEagerHydrationData=null}function Ic(t,n,s,g,E,T,$,G,J){return t=new Y0(t,n,s,G,J),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},Yl(T),t}function G0(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 Af(t){if(!t)return jr;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(Ct(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(Ct(s))return id(t,s,n)}return n}function Mf(t,n,s,g,E,T,$,G,J){return t=Ic(s,g,!0,t,E,T,$,G,J),t.context=Af(null),s=t.current,g=wt(),E=qr(s),T=Sr(g,E),T.callback=n??null,$r(s,T,E),t.current.lanes=E,an(t,E,g),Et(t,g),t}function Uo(t,n,s,g){var E=n.current,T=wt(),$=qr(E);return s=Af(s),n.context===null?n.context=s:n.pendingContext=s,n=Sr(T,$),n.payload={element:t},g=g===void 0?null:g,g!==null&&(n.callback=g),t=$r(E,n,$),t!==null&&(Yt(t,E,$,T),So(t,E,$)),$}function Vo(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 Pf(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function Oc(t,n){Pf(t,n),(t=t.alternate)&&Pf(t,n)}function Q0(){return null}var Nf=typeof reportError=="function"?reportError:function(t){console.error(t)};function Hc(t){this._internalRoot=t}qo.prototype.render=Hc.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(i(409));Uo(t,n,null,null)},qo.prototype.unmount=Hc.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;gn(function(){Uo(null,t,null,null)}),n[gr]=null}};function qo(t){this._internalRoot=t}qo.prototype.unstable_scheduleHydration=function(t){if(t){var n=gh();t={blockedOn:null,target:t,priority:n};for(var s=0;s<Nr.length&&n!==0&&n<Nr[s].priority;s++);Nr.splice(s,0,t),s===0&&yh(t)}};function jc(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Ko(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Bf(){}function J0(t,n,s,g,E){if(E){if(typeof g=="function"){var T=g;g=function(){var oe=Vo($);T.call(oe)}}var $=Mf(n,g,t,0,null,!1,!1,"",Bf);return t._reactRootContainer=$,t[gr]=$.current,Ui(t.nodeType===8?t.parentNode:t),gn(),$}for(;E=t.lastChild;)t.removeChild(E);if(typeof g=="function"){var G=g;g=function(){var oe=Vo(J);G.call(oe)}}var J=Ic(t,0,!1,null,null,!1,!1,"",Bf);return t._reactRootContainer=J,t[gr]=J.current,Ui(t.nodeType===8?t.parentNode:t),gn(function(){Uo(n,J,s,g)}),J}function Xo(t,n,s,g,E){var T=s._reactRootContainer;if(T){var $=T;if(typeof E=="function"){var G=E;E=function(){var J=Vo($);G.call(J)}}Uo(n,$,t,E)}else $=J0(s,n,t,E,g);return Vo($)}ph=function(t){switch(t.tag){case 3:var n=t.stateNode;if(n.current.memoizedState.isDehydrated){var s=nr(n.pendingLanes);s!==0&&(cl(n,s|1),Et(n,Ke()),(Me&6)===0&&(ri=Ke()+500,Fr()))}break;case 13:gn(function(){var g=wr(t,1);if(g!==null){var E=wt();Yt(g,t,1,E)}}),Oc(t,1)}},ul=function(t){if(t.tag===13){var n=wr(t,134217728);if(n!==null){var s=wt();Yt(n,t,134217728,s)}Oc(t,134217728)}},_h=function(t){if(t.tag===13){var n=qr(t),s=wr(t,n);if(s!==null){var g=wt();Yt(s,t,n,g)}Oc(t,n)}},gh=function(){return Be},mh=function(t,n){var s=Be;try{return Be=t,n()}finally{Be=s}},Ci=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=uo(g);if(!E)throw Error(i(90));le(g),ge(g,E)}}}break;case"textarea":pt(t,s);break;case"select":n=s.value,n!=null&&Qe(t,!!s.multiple,n,!1)}},Os=Tc,Hs=gn;var Z0={usingClientEntryPoint:!1,Events:[Ki,Wn,uo,Bs,Is,Tc]},as={findFiberByHostInstance:ln,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ev={bundleType:as.bundleType,version:as.version,rendererPackageName:as.rendererPackageName,rendererConfig:as.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:y.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Fs(t),t===null?null:t.stateNode},findFiberByHostInstance:as.findFiberByHostInstance||Q0,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 Yo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yo.isDisabled&&Yo.supportsFiber)try{on=Yo.inject(ev),It=Yo}catch{}}return kt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z0,kt.createPortal=function(t,n){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!jc(n))throw Error(i(200));return G0(t,n,null,s)},kt.createRoot=function(t,n){if(!jc(t))throw Error(i(299));var s=!1,g="",E=Nf;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(g=n.identifierPrefix),n.onRecoverableError!==void 0&&(E=n.onRecoverableError)),n=Ic(t,1,!1,null,null,s,!1,g,E),t[gr]=n.current,Ui(t.nodeType===8?t.parentNode:t),new Hc(n)},kt.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},kt.flushSync=function(t){return gn(t)},kt.hydrate=function(t,n,s){if(!Ko(n))throw Error(i(200));return Xo(null,t,n,!0,s)},kt.hydrateRoot=function(t,n,s){if(!jc(t))throw Error(i(405));var g=s!=null&&s.hydratedSources||null,E=!1,T="",$=Nf;if(s!=null&&(s.unstable_strictMode===!0&&(E=!0),s.identifierPrefix!==void 0&&(T=s.identifierPrefix),s.onRecoverableError!==void 0&&($=s.onRecoverableError)),n=Mf(n,null,t,1,s??null,E,!1,T,$),t[gr]=n.current,Ui(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 qo(n)},kt.render=function(t,n,s){if(!Ko(n))throw Error(i(200));return Xo(null,t,n,!1,s)},kt.unmountComponentAtNode=function(t){if(!Ko(t))throw Error(i(40));return t._reactRootContainer?(gn(function(){Xo(null,null,t,!1,function(){t._reactRootContainer=null,t[gr]=null})}),!0):!1},kt.unstable_batchedUpdates=Tc,kt.unstable_renderSubtreeIntoContainer=function(t,n,s,g){if(!Ko(s))throw Error(i(200));if(t==null||t._reactInternals===void 0)throw Error(i(38));return Xo(t,n,s,!1,g)},kt.version="18.3.1-next-f1338f8080-20240426",kt}var Wf;function l_(){if(Wf)return $c.exports;Wf=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(),$c.exports=av(),$c.exports}var Uf;function lv(){if(Uf)return Go;Uf=1;var e=l_();return Go.createRoot=e.createRoot,Go.hydrateRoot=e.hydrateRoot,Go}var cv=lv();const uv=zu(cv),dr=Object.create(null);dr.open="0";dr.close="1";dr.ping="2";dr.pong="3";dr.message="4";dr.upgrade="5";dr.noop="6";const ua=Object.create(null);Object.keys(dr).forEach(e=>{ua[dr[e]]=e});const gu={type:"error",data:"parser error"},c_=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",u_=typeof ArrayBuffer=="function",h_=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Wu=({type:e,data:r},i,o)=>c_&&r instanceof Blob?i?o(r):Vf(r,o):u_&&(r instanceof ArrayBuffer||h_(r))?i?o(r):Vf(new Blob([r]),o):o(dr[e]+(r||"")),Vf=(e,r)=>{const i=new FileReader;return i.onload=function(){const o=i.result.split(",")[1];r("b"+(o||""))},i.readAsDataURL(e)};function qf(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Vc;function hv(e,r){if(c_&&e.data instanceof Blob)return e.data.arrayBuffer().then(qf).then(r);if(u_&&(e.data instanceof ArrayBuffer||h_(e.data)))return r(qf(e.data));Wu(e,!1,i=>{Vc||(Vc=new TextEncoder),r(Vc.encode(i))})}const Kf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ds=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Kf.length;e++)ds[Kf.charCodeAt(e)]=e;const dv=e=>{let r=e.length*.75,i=e.length,o,u=0,S,w,a,l;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);const p=new ArrayBuffer(r),v=new Uint8Array(p);for(o=0;o<i;o+=4)S=ds[e.charCodeAt(o)],w=ds[e.charCodeAt(o+1)],a=ds[e.charCodeAt(o+2)],l=ds[e.charCodeAt(o+3)],v[u++]=S<<2|w>>4,v[u++]=(w&15)<<4|a>>2,v[u++]=(a&3)<<6|l&63;return p},fv=typeof ArrayBuffer=="function",Uu=(e,r)=>{if(typeof e!="string")return{type:"message",data:d_(e,r)};const i=e.charAt(0);return i==="b"?{type:"message",data:pv(e.substring(1),r)}:ua[i]?e.length>1?{type:ua[i],data:e.substring(1)}:{type:ua[i]}:gu},pv=(e,r)=>{if(fv){const i=dv(e);return d_(i,r)}else return{base64:!0,data:e}},d_=(e,r)=>{switch(r){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},f_="",_v=(e,r)=>{const i=e.length,o=new Array(i);let u=0;e.forEach((S,w)=>{Wu(S,!1,a=>{o[w]=a,++u===i&&r(o.join(f_))})})},gv=(e,r)=>{const i=e.split(f_),o=[];for(let u=0;u<i.length;u++){const S=Uu(i[u],r);if(o.push(S),S.type==="error")break}return o};function mv(){return new TransformStream({transform(e,r){hv(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 qc;function Qo(e){return e.reduce((r,i)=>r+i.length,0)}function Jo(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 vv(e,r){qc||(qc=new TextDecoder);const i=[];let o=0,u=-1,S=!1;return new TransformStream({transform(w,a){for(i.push(w);;){if(o===0){if(Qo(i)<1)break;const l=Jo(i,1);S=(l[0]&128)===128,u=l[0]&127,u<126?o=3:u===126?o=1:o=2}else if(o===1){if(Qo(i)<2)break;const l=Jo(i,2);u=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),o=3}else if(o===2){if(Qo(i)<8)break;const l=Jo(i,8),p=new DataView(l.buffer,l.byteOffset,l.length),v=p.getUint32(0);if(v>Math.pow(2,21)-1){a.enqueue(gu);break}u=v*Math.pow(2,32)+p.getUint32(4),o=3}else{if(Qo(i)<u)break;const l=Jo(i,u);a.enqueue(Uu(S?l:qc.decode(l),r)),o=0}if(u===0||u>e){a.enqueue(gu);break}}}})}const p_=4;function tt(e){if(e)return yv(e)}function yv(e){for(var r in tt.prototype)e[r]=tt.prototype[r];return e}tt.prototype.on=tt.prototype.addEventListener=function(e,r){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(r),this};tt.prototype.once=function(e,r){function i(){this.off(e,i),r.apply(this,arguments)}return i.fn=r,this.on(e,i),this};tt.prototype.off=tt.prototype.removeListener=tt.prototype.removeAllListeners=tt.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};tt.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};tt.prototype.emitReserved=tt.prototype.emit;tt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};tt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Na=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")(),wv="arraybuffer";function __(e,...r){return r.reduce((i,o)=>(e.hasOwnProperty(o)&&(i[o]=e[o]),i),{})}const Sv=Wt.setTimeout,Cv=Wt.clearTimeout;function Ba(e,r){r.useNativeTimers?(e.setTimeoutFn=Sv.bind(Wt),e.clearTimeoutFn=Cv.bind(Wt)):(e.setTimeoutFn=Wt.setTimeout.bind(Wt),e.clearTimeoutFn=Wt.clearTimeout.bind(Wt))}const xv=1.33;function bv(e){return typeof e=="string"?Ev(e):Math.ceil((e.byteLength||e.size)*xv)}function Ev(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 g_(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function kv(e){let r="";for(let i in e)e.hasOwnProperty(i)&&(r.length&&(r+="&"),r+=encodeURIComponent(i)+"="+encodeURIComponent(e[i]));return r}function Lv(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 Rv extends Error{constructor(r,i,o){super(r),this.description=i,this.context=o,this.type="TransportError"}}class Vu extends tt{constructor(r){super(),this.writable=!1,Ba(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 Rv(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=Uu(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=kv(r);return i.length?"?"+i:""}}class Dv extends Vu{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)};gv(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,_v(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]=g_()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(r,i)}}let m_=!1;try{m_=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Tv=m_;function Av(){}class Mv extends Dv{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 ur extends tt{constructor(r,i,o){super(),this.createRequest=r,Ba(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=__(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=ur.requestsCount++,ur.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=Av,r)try{this._xhr.abort()}catch{}typeof document<"u"&&delete ur.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()}}ur.requestsCount=0;ur.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Xf);else if(typeof addEventListener=="function"){const e="onpagehide"in Wt?"pagehide":"unload";addEventListener(e,Xf,!1)}}function Xf(){for(let e in ur.requests)ur.requests.hasOwnProperty(e)&&ur.requests[e].abort()}const Pv=(function(){const e=v_({xdomain:!1});return e&&e.responseType!==null})();class Nv extends Mv{constructor(r){super(r);const i=r&&r.forceBase64;this.supportsBinary=Pv&&!i}request(r={}){return Object.assign(r,{xd:this.xd},this.opts),new ur(v_,this.uri(),r)}}function v_(e){const r=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!r||Tv))return new XMLHttpRequest}catch{}if(!r)try{return new Wt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const y_=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Bv extends Vu{get name(){return"websocket"}doOpen(){const r=this.uri(),i=this.opts.protocols,o=y_?{}:__(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;Wu(o,this.supportsBinary,S=>{try{this.doWrite(o,S)}catch{}u&&Na(()=>{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]=g_()),this.supportsBinary||(i.b64=1),this.createUri(r,i)}}const Kc=Wt.WebSocket||Wt.MozWebSocket;class Iv extends Bv{createSocket(r,i,o){return y_?new Kc(r,i,o):i?new Kc(r,i):new Kc(r)}doWrite(r,i){this.ws.send(i)}}class Ov extends Vu{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=vv(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=r.readable.pipeThrough(i).getReader(),u=mv();u.readable.pipeTo(r.writable),this._writer=u.writable.getWriter();const S=()=>{o.read().then(({done:a,value:l})=>{a||(this.onPacket(l),S())}).catch(a=>{})};S();const w={type:"open"};this.query.sid&&(w.data=`{"sid":"${this.query.sid}"}`),this._writer.write(w).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&&Na(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var r;(r=this._transport)===null||r===void 0||r.close()}}const Hv={websocket:Iv,webtransport:Ov,polling:Nv},jv=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Fv=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function mu(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=jv.exec(e||""),S={},w=14;for(;w--;)S[Fv[w]]=u[w]||"";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=zv(S,S.path),S.queryKey=$v(S,S.query),S}function zv(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 $v(e,r){const i={};return r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,u,S){u&&(i[u]=S)}),i}const vu=typeof addEventListener=="function"&&typeof removeEventListener=="function",ha=[];vu&&addEventListener("offline",()=>{ha.forEach(e=>e())},!1);class en extends tt{constructor(r,i){if(super(),this.binaryType=wv,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=mu(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=mu(i.host).host);Ba(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=Lv(this.opts.query)),vu&&(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"})},ha.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(r){const i=Object.assign({},this.opts.query);i.EIO=p_,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&&en.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",en.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+=bv(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,Na(()=>{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(en.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(),vu&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const o=ha.indexOf(this._offlineEventListener);o!==-1&&ha.splice(o,1)}this.readyState="closed",this.id=null,this.emitReserved("close",r,i),this.writeBuffer=[],this._prevBufferLen=0}}}en.protocol=p_;class Wv extends en{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;en.priorWebsocketSuccess=!1;const u=()=>{o||(i.send([{type:"ping",data:"probe"}]),i.once("packet",c=>{if(!o)if(c.type==="pong"&&c.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;en.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 w=c=>{const m=new Error("probe error: "+c);m.transport=i.name,S(),this.emitReserved("upgradeError",m)};function a(){w("transport closed")}function l(){w("socket closed")}function p(c){i&&c.name!==i.name&&S()}const v=()=>{i.removeListener("open",u),i.removeListener("error",w),i.removeListener("close",a),this.off("close",l),this.off("upgrading",p)};i.once("open",u),i.once("error",w),i.once("close",a),this.once("close",l),this.once("upgrading",p),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 Uv=class extends Wv{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=>Hv[u]).filter(u=>!!u)),super(r,o)}};function Vv(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=mu(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 qv=typeof ArrayBuffer=="function",Kv=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,w_=Object.prototype.toString,Xv=typeof Blob=="function"||typeof Blob<"u"&&w_.call(Blob)==="[object BlobConstructor]",Yv=typeof File=="function"||typeof File<"u"&&w_.call(File)==="[object FileConstructor]";function qu(e){return qv&&(e instanceof ArrayBuffer||Kv(e))||Xv&&e instanceof Blob||Yv&&e instanceof File}function da(e,r){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let i=0,o=e.length;i<o;i++)if(da(e[i]))return!0;return!1}if(qu(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return da(e.toJSON(),!0);for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&da(e[i]))return!0;return!1}function Gv(e){const r=[],i=e.data,o=e;return o.data=yu(i,r),o.attachments=r.length,{packet:o,buffers:r}}function yu(e,r){if(!e)return e;if(qu(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]=yu(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]=yu(e[o],r));return i}return e}function Qv(e,r){return e.data=wu(e.data,r),delete e.attachments,e}function wu(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]=wu(e[i],r);else if(typeof e=="object")for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(e[i]=wu(e[i],r));return e}const Jv=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Te;(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"})(Te||(Te={}));class Zv{constructor(r){this.replacer=r}encode(r){return(r.type===Te.EVENT||r.type===Te.ACK)&&da(r)?this.encodeAsBinary({type:r.type===Te.EVENT?Te.BINARY_EVENT:Te.BINARY_ACK,nsp:r.nsp,data:r.data,id:r.id}):[this.encodeAsString(r)]}encodeAsString(r){let i=""+r.type;return(r.type===Te.BINARY_EVENT||r.type===Te.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=Gv(r),o=this.encodeAsString(i.packet),u=i.buffers;return u.unshift(o),u}}class Ku extends tt{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===Te.BINARY_EVENT;o||i.type===Te.BINARY_ACK?(i.type=o?Te.EVENT:Te.ACK,this.reconstructor=new ey(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(qu(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(Te[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===Te.BINARY_EVENT||o.type===Te.BINARY_ACK){const S=i+1;for(;r.charAt(++i)!=="-"&&i!=r.length;);const w=r.substring(S,i);if(w!=Number(w)||r.charAt(i)!=="-")throw new Error("Illegal attachments");const a=Number(w);if(!ty(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 w=r.charAt(i);if(w==null||Number(w)!=w){--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(Ku.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 Te.CONNECT:return Yf(i);case Te.DISCONNECT:return i===void 0;case Te.CONNECT_ERROR:return typeof i=="string"||Yf(i);case Te.EVENT:case Te.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&Jv.indexOf(i[0])===-1);case Te.ACK:case Te.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class ey{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=Qv(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const ty=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function Yf(e){return Object.prototype.toString.call(e)==="[object Object]"}const ry=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ku,Encoder:Zv,get PacketType(){return Te}},Symbol.toStringTag,{value:"Module"}));function Gt(e,r,i){return e.on(r,i),function(){e.off(r,i)}}const ny=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class S_ extends tt{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(ny.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 w={type:Te.EVENT,data:i};if(w.options={},w.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const v=this.ids++,c=i.pop();this._registerAckCallback(v,c),w.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,l=this.connected&&!(!((S=this.io.engine)===null||S===void 0)&&S._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(w),this.packet(w)):this.sendBuffer.push(w)),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),w=(...a)=>{this.io.clearTimeoutFn(S),i.apply(this,a)};w.withError=!0,this.acks[r]=w}emitWithAck(r,...i){return new Promise((o,u)=>{const S=(w,a)=>w?u(w):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:Te.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 Te.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 Te.EVENT:case Te.BINARY_EVENT:this.onevent(r);break;case Te.ACK:case Te.BINARY_ACK:this.onack(r);break;case Te.DISCONNECT:this.ondisconnect();break;case Te.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:Te.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:Te.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 mi(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}mi.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};mi.prototype.reset=function(){this.attempts=0};mi.prototype.setMin=function(e){this.ms=e};mi.prototype.setMax=function(e){this.max=e};mi.prototype.setJitter=function(e){this.jitter=e};class Su extends tt{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,Ba(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 mi({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||ry;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 Uv(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()},w=Gt(i,"error",S);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{u(),S(new Error("timeout")),i.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(u),this.subs.push(w),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){Na(()=>{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 S_(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 cs={};function fa(e,r){typeof e=="object"&&(r=e,e=void 0),r=r||{};const i=Vv(e,r.path||"/socket.io"),o=i.source,u=i.id,S=i.path,w=cs[u]&&S in cs[u].nsps,a=r.forceNew||r["force new connection"]||r.multiplex===!1||w;let l;return a?l=new Su(o,r):(cs[u]||(cs[u]=new Su(o,r)),l=cs[u]),i.query&&!r.query&&(r.query=i.queryKey),l.socket(i.path,r)}Object.assign(fa,{Manager:Su,Socket:S_,io:fa,connect:fa});function C_(){return new URLSearchParams(window.location.search).get("token")||""}function lr(e,r){const i=C_(),o=e.includes("?")?"&":"?";return fetch(i?`${e}${o}token=${encodeURIComponent(i)}`:e,r)}function iy(){const e=Q.useRef(null),[r,i]=Q.useState([]),[o,u]=Q.useState([]),[S,w]=Q.useState([]),[a,l]=Q.useState(""),[p,v]=Q.useState([]);return Q.useEffect(()=>{const c=C_(),m=fa(window.location.origin,{path:"/socket.io",auth:c?{token:c}:void 0,query:c?{token:c}:void 0});return e.current=m,m.on("agents:updated",C=>{Array.isArray(C)&&i(C)}),m.on("messages:new",C=>{u(b=>[C,...b])}),m.on("messages:all",C=>{Array.isArray(C)&&u(C)}),m.on("context:updated",C=>{w(b=>{const x=b.findIndex(f=>f.key===C.key);if(x>=0){const f=[...b];return f[x]=C,f}return[...b,C]})}),m.on("context:removed",({key:C})=>{w(b=>b.filter(x=>x.key!==C))}),m.on("crewmd:updated",C=>{typeof C=="string"&&l(C)}),m.on("agent:cost",C=>{i(b=>b.map(x=>x.id===C.id?{...x,total_cost:C.total_cost,total_tokens:C.total_tokens}:x))}),m.on("file:changed",C=>{v(b=>[C,...b].slice(0,500))}),m.on("file:changes:cleared",()=>{v([])}),lr("/api/agents").then(C=>C.json()).then(C=>{Array.isArray(C)&&i(C)}).catch(()=>{}),lr("/api/file-changes").then(C=>C.json()).then(C=>{Array.isArray(C)&&v(C)}).catch(()=>{}),lr("/api/context").then(C=>C.json()).then(C=>{Array.isArray(C)&&w(C)}).catch(()=>{}),()=>{m.disconnect()}},[]),{socket:e,agents:r,messages:o,contextEntries:S,crewMd:a,setCrewMd:l,fileChanges:p,setFileChanges:v}}const sy={running:"var(--green)",starting:"var(--yellow)",idle:"var(--yellow)",done:"var(--text-muted)",dead:"var(--red)"};function oy({agents:e,selectedId:r,onSelect:i,onKill:o,onRemove:u,onRollback:S,onRestart:w}){return N.jsxs("div",{className:"agent-list",children:[N.jsxs("div",{className:"agent-list-header",children:["Agents (",e.length,")"]}),e.length===0&&N.jsx("div",{className:"agent-list-empty",children:"No agents running"}),e.map(a=>N.jsxs("div",{className:`agent-item ${a.id===r?"selected":""}`,onClick:()=>i(a),children:[N.jsxs("div",{className:"agent-item-header",children:[N.jsx("span",{className:"status-dot",style:{background:sy[a.status]||"var(--text-muted)"}}),N.jsx("span",{className:"agent-name",children:a.name}),N.jsx("span",{className:`agent-service-badge service-${a.service||"claude"}`,children:a.service||"claude"}),a.total_cost>0&&N.jsxs("span",{className:"agent-cost",children:["$",a.total_cost.toFixed(4)]}),N.jsx("span",{className:"agent-status",children:a.status})]}),N.jsx("div",{className:"agent-task",children:a.task}),(a.status==="running"||a.status==="starting")&&N.jsx("div",{className:"agent-running-actions",children:N.jsx("button",{className:"stop-btn",onClick:l=>{l.stopPropagation(),o(a.id)},children:"Stop"})}),(a.status==="done"||a.status==="dead")&&N.jsxs("div",{className:"agent-done-actions",children:[N.jsx("button",{className:"restart-btn",onClick:l=>{l.stopPropagation(),w(a)},children:"Restart"}),a.checkpoint_hash&&N.jsx("button",{className:"rollback-btn",onClick:l=>{l.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"}),N.jsx("button",{className:"remove-btn",onClick:l=>{l.stopPropagation(),u(a.id)},children:"Remove"})]})]},a.id))]})}function rt(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=rt(e[i]))!==""&&(r+=(r&&" ")+o);else for(let i in e)e[i]&&(r+=(r&&" ")+i);return r}var ay={value:()=>{}};function Ia(){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 pa(i)}function pa(e){this._=e}function ly(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}})}pa.prototype=Ia.prototype={constructor:pa,on:function(e,r){var i=this._,o=ly(e+"",i),u,S=-1,w=o.length;if(arguments.length<2){for(;++S<w;)if((u=(e=o[S]).type)&&(u=cy(i[u],e.name)))return u;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++S<w;)if(u=(e=o[S]).type)i[u]=Gf(i[u],e.name,r);else if(r==null)for(u in i)i[u]=Gf(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 pa(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 cy(e,r){for(var i=0,o=e.length,u;i<o;++i)if((u=e[i]).name===r)return u.value}function Gf(e,r,i){for(var o=0,u=e.length;o<u;++o)if(e[o].name===r){e[o]=ay,e=e.slice(0,o).concat(e.slice(o+1));break}return i!=null&&e.push({name:r,value:i}),e}var Cu="http://www.w3.org/1999/xhtml";const Qf={svg:"http://www.w3.org/2000/svg",xhtml:Cu,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Oa(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 uy(e){return function(){var r=this.ownerDocument,i=this.namespaceURI;return i===Cu&&r.documentElement.namespaceURI===Cu?r.createElement(e):r.createElementNS(i,e)}}function hy(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function x_(e){var r=Oa(e);return(r.local?hy:uy)(r)}function dy(){}function Xu(e){return e==null?dy:function(){return this.querySelector(e)}}function fy(e){typeof e!="function"&&(e=Xu(e));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var S=r[u],w=S.length,a=o[u]=new Array(w),l,p,v=0;v<w;++v)(l=S[v])&&(p=e.call(l,l.__data__,v,S))&&("__data__"in l&&(p.__data__=l.__data__),a[v]=p);return new Bt(o,this._parents)}function py(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function _y(){return[]}function b_(e){return e==null?_y:function(){return this.querySelectorAll(e)}}function gy(e){return function(){return py(e.apply(this,arguments))}}function my(e){typeof e=="function"?e=gy(e):e=b_(e);for(var r=this._groups,i=r.length,o=[],u=[],S=0;S<i;++S)for(var w=r[S],a=w.length,l,p=0;p<a;++p)(l=w[p])&&(o.push(e.call(l,l.__data__,p,w)),u.push(l));return new Bt(o,u)}function E_(e){return function(){return this.matches(e)}}function k_(e){return function(r){return r.matches(e)}}var vy=Array.prototype.find;function yy(e){return function(){return vy.call(this.children,e)}}function wy(){return this.firstElementChild}function Sy(e){return this.select(e==null?wy:yy(typeof e=="function"?e:k_(e)))}var Cy=Array.prototype.filter;function xy(){return Array.from(this.children)}function by(e){return function(){return Cy.call(this.children,e)}}function Ey(e){return this.selectAll(e==null?xy:by(typeof e=="function"?e:k_(e)))}function ky(e){typeof e!="function"&&(e=E_(e));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var S=r[u],w=S.length,a=o[u]=[],l,p=0;p<w;++p)(l=S[p])&&e.call(l,l.__data__,p,S)&&a.push(l);return new Bt(o,this._parents)}function L_(e){return new Array(e.length)}function Ly(){return new Bt(this._enter||this._groups.map(L_),this._parents)}function Sa(e,r){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=r}Sa.prototype={constructor:Sa,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 Ry(e){return function(){return e}}function Dy(e,r,i,o,u,S){for(var w=0,a,l=r.length,p=S.length;w<p;++w)(a=r[w])?(a.__data__=S[w],o[w]=a):i[w]=new Sa(e,S[w]);for(;w<l;++w)(a=r[w])&&(u[w]=a)}function Ty(e,r,i,o,u,S,w){var a,l,p=new Map,v=r.length,c=S.length,m=new Array(v),C;for(a=0;a<v;++a)(l=r[a])&&(m[a]=C=w.call(l,l.__data__,a,r)+"",p.has(C)?u[a]=l:p.set(C,l));for(a=0;a<c;++a)C=w.call(e,S[a],a,S)+"",(l=p.get(C))?(o[a]=l,l.__data__=S[a],p.delete(C)):i[a]=new Sa(e,S[a]);for(a=0;a<v;++a)(l=r[a])&&p.get(m[a])===l&&(u[a]=l)}function Ay(e){return e.__data__}function My(e,r){if(!arguments.length)return Array.from(this,Ay);var i=r?Ty:Dy,o=this._parents,u=this._groups;typeof e!="function"&&(e=Ry(e));for(var S=u.length,w=new Array(S),a=new Array(S),l=new Array(S),p=0;p<S;++p){var v=o[p],c=u[p],m=c.length,C=Py(e.call(v,v&&v.__data__,p,o)),b=C.length,x=a[p]=new Array(b),f=w[p]=new Array(b),_=l[p]=new Array(m);i(v,c,x,f,_,C,r);for(var d=0,h=0,y,k;d<b;++d)if(y=x[d]){for(d>=h&&(h=d+1);!(k=f[h])&&++h<b;);y._next=k||null}}return w=new Bt(w,o),w._enter=a,w._exit=l,w}function Py(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ny(){return new Bt(this._exit||this._groups.map(L_),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 Iy(e){for(var r=e.selection?e.selection():e,i=this._groups,o=r._groups,u=i.length,S=o.length,w=Math.min(u,S),a=new Array(u),l=0;l<w;++l)for(var p=i[l],v=o[l],c=p.length,m=a[l]=new Array(c),C,b=0;b<c;++b)(C=p[b]||v[b])&&(m[b]=C);for(;l<u;++l)a[l]=i[l];return new Bt(a,this._parents)}function Oy(){for(var e=this._groups,r=-1,i=e.length;++r<i;)for(var o=e[r],u=o.length-1,S=o[u],w;--u>=0;)(w=o[u])&&(S&&w.compareDocumentPosition(S)^4&&S.parentNode.insertBefore(w,S),S=w);return this}function Hy(e){e||(e=jy);function r(c,m){return c&&m?e(c.__data__,m.__data__):!c-!m}for(var i=this._groups,o=i.length,u=new Array(o),S=0;S<o;++S){for(var w=i[S],a=w.length,l=u[S]=new Array(a),p,v=0;v<a;++v)(p=w[v])&&(l[v]=p);l.sort(r)}return new Bt(u,this._parents).order()}function jy(e,r){return e<r?-1:e>r?1:e>=r?0:NaN}function Fy(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function zy(){return Array.from(this)}function $y(){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 w=o[u];if(w)return w}return null}function Wy(){let e=0;for(const r of this)++e;return e}function Uy(){return!this.node()}function Vy(e){for(var r=this._groups,i=0,o=r.length;i<o;++i)for(var u=r[i],S=0,w=u.length,a;S<w;++S)(a=u[S])&&e.call(a,a.__data__,S,u);return this}function qy(e){return function(){this.removeAttribute(e)}}function Ky(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Xy(e,r){return function(){this.setAttribute(e,r)}}function Yy(e,r){return function(){this.setAttributeNS(e.space,e.local,r)}}function Gy(e,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function Qy(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 Jy(e,r){var i=Oa(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?Ky:qy:typeof r=="function"?i.local?Qy:Gy:i.local?Yy:Xy)(i,r))}function R_(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Zy(e){return function(){this.style.removeProperty(e)}}function e1(e,r,i){return function(){this.style.setProperty(e,r,i)}}function t1(e,r,i){return function(){var o=r.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,i)}}function r1(e,r,i){return arguments.length>1?this.each((r==null?Zy:typeof r=="function"?t1:e1)(e,r,i??"")):ci(this.node(),e)}function ci(e,r){return e.style.getPropertyValue(r)||R_(e).getComputedStyle(e,null).getPropertyValue(r)}function n1(e){return function(){delete this[e]}}function i1(e,r){return function(){this[e]=r}}function s1(e,r){return function(){var i=r.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function o1(e,r){return arguments.length>1?this.each((r==null?n1:typeof r=="function"?s1:i1)(e,r)):this.node()[e]}function D_(e){return e.trim().split(/^|\s+/)}function Yu(e){return e.classList||new T_(e)}function T_(e){this._node=e,this._names=D_(e.getAttribute("class")||"")}T_.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 A_(e,r){for(var i=Yu(e),o=-1,u=r.length;++o<u;)i.add(r[o])}function M_(e,r){for(var i=Yu(e),o=-1,u=r.length;++o<u;)i.remove(r[o])}function a1(e){return function(){A_(this,e)}}function l1(e){return function(){M_(this,e)}}function c1(e,r){return function(){(r.apply(this,arguments)?A_:M_)(this,e)}}function u1(e,r){var i=D_(e+"");if(arguments.length<2){for(var o=Yu(this.node()),u=-1,S=i.length;++u<S;)if(!o.contains(i[u]))return!1;return!0}return this.each((typeof r=="function"?c1:r?a1:l1)(i,r))}function h1(){this.textContent=""}function d1(e){return function(){this.textContent=e}}function f1(e){return function(){var r=e.apply(this,arguments);this.textContent=r??""}}function p1(e){return arguments.length?this.each(e==null?h1:(typeof e=="function"?f1:d1)(e)):this.node().textContent}function _1(){this.innerHTML=""}function g1(e){return function(){this.innerHTML=e}}function m1(e){return function(){var r=e.apply(this,arguments);this.innerHTML=r??""}}function v1(e){return arguments.length?this.each(e==null?_1:(typeof e=="function"?m1:g1)(e)):this.node().innerHTML}function y1(){this.nextSibling&&this.parentNode.appendChild(this)}function w1(){return this.each(y1)}function S1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function C1(){return this.each(S1)}function x1(e){var r=typeof e=="function"?e:x_(e);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function b1(){return null}function E1(e,r){var i=typeof e=="function"?e:x_(e),o=r==null?b1:typeof r=="function"?r:Xu(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),o.apply(this,arguments)||null)})}function k1(){var e=this.parentNode;e&&e.removeChild(this)}function L1(){return this.each(k1)}function R1(){var e=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(e,this.nextSibling):e}function D1(){var e=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(e,this.nextSibling):e}function T1(e){return this.select(e?D1:R1)}function A1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function M1(e){return function(r){e.call(this,r,this.__data__)}}function P1(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 N1(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=M1(r);if(o){for(var w=0,a=o.length;w<a;++w)if((u=o[w]).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 I1(e,r,i){var o=P1(e+""),u,S=o.length,w;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,p=a.length,v;l<p;++l)for(u=0,v=a[l];u<S;++u)if((w=o[u]).type===v.type&&w.name===v.name)return v.value}return}for(a=r?B1:N1,u=0;u<S;++u)this.each(a(o[u],r,i));return this}function P_(e,r,i){var o=R_(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 O1(e,r){return function(){return P_(this,e,r)}}function H1(e,r){return function(){return P_(this,e,r.apply(this,arguments))}}function j1(e,r){return this.each((typeof r=="function"?H1:O1)(e,r))}function*F1(){for(var e=this._groups,r=0,i=e.length;r<i;++r)for(var o=e[r],u=0,S=o.length,w;u<S;++u)(w=o[u])&&(yield w)}var N_=[null];function Bt(e,r){this._groups=e,this._parents=r}function Ls(){return new Bt([[document.documentElement]],N_)}function z1(){return this}Bt.prototype=Ls.prototype={constructor:Bt,select:fy,selectAll:my,selectChild:Sy,selectChildren:Ey,filter:ky,data:My,enter:Ly,exit:Ny,join:By,merge:Iy,selection:z1,order:Oy,sort:Hy,call:Fy,nodes:zy,node:$y,size:Wy,empty:Uy,each:Vy,attr:Jy,style:r1,property:o1,classed:u1,text:p1,html:v1,raise:w1,lower:C1,append:x1,insert:E1,remove:L1,clone:T1,datum:A1,on:I1,dispatch:j1,[Symbol.iterator]:F1};function Nt(e){return typeof e=="string"?new Bt([[document.querySelector(e)]],[document.documentElement]):new Bt([[e]],N_)}function $1(e){let r;for(;r=e.sourceEvent;)e=r;return e}function Qt(e,r){if(e=$1(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 W1={passive:!1},ms={capture:!0,passive:!1};function Xc(e){e.stopImmediatePropagation()}function ai(e){e.preventDefault(),e.stopImmediatePropagation()}function B_(e){var r=e.document.documentElement,i=Nt(e).on("dragstart.drag",ai,ms);"onselectstart"in r?i.on("selectstart.drag",ai,ms):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function I_(e,r){var i=e.document.documentElement,o=Nt(e).on("dragstart.drag",null);r&&(o.on("click.drag",ai,ms),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 Zo=e=>()=>e;function xu(e,{sourceEvent:r,subject:i,target:o,identifier:u,active:S,x:w,y:a,dx:l,dy:p,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:w,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:v}})}xu.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function U1(e){return!e.ctrlKey&&!e.button}function V1(){return this.parentNode}function q1(e,r){return r??{x:e.x,y:e.y}}function K1(){return navigator.maxTouchPoints||"ontouchstart"in this}function O_(){var e=U1,r=V1,i=q1,o=K1,u={},S=Ia("start","drag","end"),w=0,a,l,p,v,c=0;function m(y){y.on("mousedown.drag",C).filter(o).on("touchstart.drag",f).on("touchmove.drag",_,W1).on("touchend.drag touchcancel.drag",d).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function C(y,k){if(!(v||!e.call(this,y,k))){var R=h(this,r.call(this,y,k),y,k,"mouse");R&&(Nt(y.view).on("mousemove.drag",b,ms).on("mouseup.drag",x,ms),B_(y.view),Xc(y),p=!1,a=y.clientX,l=y.clientY,R("start",y))}}function b(y){if(ai(y),!p){var k=y.clientX-a,R=y.clientY-l;p=k*k+R*R>c}u.mouse("drag",y)}function x(y){Nt(y.view).on("mousemove.drag mouseup.drag",null),I_(y.view,p),ai(y),u.mouse("end",y)}function f(y,k){if(e.call(this,y,k)){var R=y.changedTouches,D=r.call(this,y,k),L=R.length,M,W;for(M=0;M<L;++M)(W=h(this,D,y,k,R[M].identifier,R[M]))&&(Xc(y),W("start",y,R[M]))}}function _(y){var k=y.changedTouches,R=k.length,D,L;for(D=0;D<R;++D)(L=u[k[D].identifier])&&(ai(y),L("drag",y,k[D]))}function d(y){var k=y.changedTouches,R=k.length,D,L;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),D=0;D<R;++D)(L=u[k[D].identifier])&&(Xc(y),L("end",y,k[D]))}function h(y,k,R,D,L,M){var W=S.copy(),z=Qt(M||R,k),F,B,O;if((O=i.call(y,new xu("beforestart",{sourceEvent:R,target:m,identifier:L,active:w,x:z[0],y:z[1],dx:0,dy:0,dispatch:W}),D))!=null)return F=O.x-z[0]||0,B=O.y-z[1]||0,function q(U,K,V){var A=z,I;switch(U){case"start":u[L]=q,I=w++;break;case"end":delete u[L],--w;case"drag":z=Qt(V||K,k),I=w;break}W.call(U,y,new xu(U,{sourceEvent:K,subject:O,target:m,identifier:L,active:I,x:z[0]+F,y:z[1]+B,dx:z[0]-A[0],dy:z[1]-A[1],dispatch:W}),D)}}return m.filter=function(y){return arguments.length?(e=typeof y=="function"?y:Zo(!!y),m):e},m.container=function(y){return arguments.length?(r=typeof y=="function"?y:Zo(y),m):r},m.subject=function(y){return arguments.length?(i=typeof y=="function"?y:Zo(y),m):i},m.touchable=function(y){return arguments.length?(o=typeof y=="function"?y:Zo(!!y),m):o},m.on=function(){var y=S.on.apply(S,arguments);return y===S?m:y},m.clickDistance=function(y){return arguments.length?(c=(y=+y)*y,m):Math.sqrt(c)},m}function Gu(e,r,i){e.prototype=r.prototype=i,i.constructor=e}function H_(e,r){var i=Object.create(e.prototype);for(var o in r)i[o]=r[o];return i}function Rs(){}var vs=.7,Ca=1/vs,li="\\s*([+-]?\\d+)\\s*",ys="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",hr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",X1=/^#([0-9a-f]{3,8})$/,Y1=new RegExp(`^rgb\\(${li},${li},${li}\\)$`),G1=new RegExp(`^rgb\\(${hr},${hr},${hr}\\)$`),Q1=new RegExp(`^rgba\\(${li},${li},${li},${ys}\\)$`),J1=new RegExp(`^rgba\\(${hr},${hr},${hr},${ys}\\)$`),Z1=new RegExp(`^hsl\\(${ys},${hr},${hr}\\)$`),ew=new RegExp(`^hsla\\(${ys},${hr},${hr},${ys}\\)$`),Jf={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};Gu(Rs,bn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Zf,formatHex:Zf,formatHex8:tw,formatHsl:rw,formatRgb:ep,toString:ep});function Zf(){return this.rgb().formatHex()}function tw(){return this.rgb().formatHex8()}function rw(){return j_(this).formatHsl()}function ep(){return this.rgb().formatRgb()}function bn(e){var r,i;return e=(e+"").trim().toLowerCase(),(r=X1.exec(e))?(i=r[1].length,r=parseInt(r[1],16),i===6?tp(r):i===3?new Lt(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):i===8?ea(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):i===4?ea(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=Y1.exec(e))?new Lt(r[1],r[2],r[3],1):(r=G1.exec(e))?new Lt(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=Q1.exec(e))?ea(r[1],r[2],r[3],r[4]):(r=J1.exec(e))?ea(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=Z1.exec(e))?ip(r[1],r[2]/100,r[3]/100,1):(r=ew.exec(e))?ip(r[1],r[2]/100,r[3]/100,r[4]):Jf.hasOwnProperty(e)?tp(Jf[e]):e==="transparent"?new Lt(NaN,NaN,NaN,0):null}function tp(e){return new Lt(e>>16&255,e>>8&255,e&255,1)}function ea(e,r,i,o){return o<=0&&(e=r=i=NaN),new Lt(e,r,i,o)}function nw(e){return e instanceof Rs||(e=bn(e)),e?(e=e.rgb(),new Lt(e.r,e.g,e.b,e.opacity)):new Lt}function bu(e,r,i,o){return arguments.length===1?nw(e):new Lt(e,r,i,o??1)}function Lt(e,r,i,o){this.r=+e,this.g=+r,this.b=+i,this.opacity=+o}Gu(Lt,bu,H_(Rs,{brighter(e){return e=e==null?Ca:Math.pow(Ca,e),new Lt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?vs:Math.pow(vs,e),new Lt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Lt(Cn(this.r),Cn(this.g),Cn(this.b),xa(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:rp,formatHex:rp,formatHex8:iw,formatRgb:np,toString:np}));function rp(){return`#${Sn(this.r)}${Sn(this.g)}${Sn(this.b)}`}function iw(){return`#${Sn(this.r)}${Sn(this.g)}${Sn(this.b)}${Sn((isNaN(this.opacity)?1:this.opacity)*255)}`}function np(){const e=xa(this.opacity);return`${e===1?"rgb(":"rgba("}${Cn(this.r)}, ${Cn(this.g)}, ${Cn(this.b)}${e===1?")":`, ${e})`}`}function xa(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Cn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Sn(e){return e=Cn(e),(e<16?"0":"")+e.toString(16)}function ip(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 j_(e){if(e instanceof Jt)return new Jt(e.h,e.s,e.l,e.opacity);if(e instanceof Rs||(e=bn(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),w=NaN,a=S-u,l=(S+u)/2;return a?(r===S?w=(i-o)/a+(i<o)*6:i===S?w=(o-r)/a+2:w=(r-i)/a+4,a/=l<.5?S+u:2-S-u,w*=60):a=l>0&&l<1?0:w,new Jt(w,a,l,e.opacity)}function sw(e,r,i,o){return arguments.length===1?j_(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}Gu(Jt,sw,H_(Rs,{brighter(e){return e=e==null?Ca:Math.pow(Ca,e),new Jt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?vs:Math.pow(vs,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 Lt(Yc(e>=240?e-240:e+120,u,o),Yc(e,u,o),Yc(e<120?e+240:e-120,u,o),this.opacity)},clamp(){return new Jt(sp(this.h),ta(this.s),ta(this.l),xa(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=xa(this.opacity);return`${e===1?"hsl(":"hsla("}${sp(this.h)}, ${ta(this.s)*100}%, ${ta(this.l)*100}%${e===1?")":`, ${e})`}`}}));function sp(e){return e=(e||0)%360,e<0?e+360:e}function ta(e){return Math.max(0,Math.min(1,e||0))}function Yc(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 ow(e,r){return function(i){return e+i*r}}function aw(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 lw(e){return(e=+e)==1?F_:function(r,i){return i-r?aw(r,i,e):Qu(isNaN(r)?i:r)}}function F_(e,r){var i=r-e;return i?ow(e,i):Qu(isNaN(e)?r:e)}const ba=(function e(r){var i=lw(r);function o(u,S){var w=i((u=bu(u)).r,(S=bu(S)).r),a=i(u.g,S.g),l=i(u.b,S.b),p=F_(u.opacity,S.opacity);return function(v){return u.r=w(v),u.g=a(v),u.b=l(v),u.opacity=p(v),u+""}}return o.gamma=e,o})(1);function cw(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 uw(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function hw(e,r){var i=r?r.length:0,o=e?Math.min(i,e.length):0,u=new Array(o),S=new Array(i),w;for(w=0;w<o;++w)u[w]=_s(e[w],r[w]);for(;w<i;++w)S[w]=r[w];return function(a){for(w=0;w<o;++w)S[w]=u[w](a);return S}}function dw(e,r){var i=new Date;return e=+e,r=+r,function(o){return i.setTime(e*(1-o)+r*o),i}}function cr(e,r){return e=+e,r=+r,function(i){return e*(1-i)+r*i}}function fw(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]=_s(e[u],r[u]):o[u]=r[u];return function(S){for(u in i)o[u]=i[u](S);return o}}var Eu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Gc=new RegExp(Eu.source,"g");function pw(e){return function(){return e}}function _w(e){return function(r){return e(r)+""}}function z_(e,r){var i=Eu.lastIndex=Gc.lastIndex=0,o,u,S,w=-1,a=[],l=[];for(e=e+"",r=r+"";(o=Eu.exec(e))&&(u=Gc.exec(r));)(S=u.index)>i&&(S=r.slice(i,S),a[w]?a[w]+=S:a[++w]=S),(o=o[0])===(u=u[0])?a[w]?a[w]+=u:a[++w]=u:(a[++w]=null,l.push({i:w,x:cr(o,u)})),i=Gc.lastIndex;return i<r.length&&(S=r.slice(i),a[w]?a[w]+=S:a[++w]=S),a.length<2?l[0]?_w(l[0].x):pw(r):(r=l.length,function(p){for(var v=0,c;v<r;++v)a[(c=l[v]).i]=c.x(p);return a.join("")})}function _s(e,r){var i=typeof r,o;return r==null||i==="boolean"?Qu(r):(i==="number"?cr:i==="string"?(o=bn(r))?(r=o,ba):z_:r instanceof bn?ba:r instanceof Date?dw:uw(r)?cw:Array.isArray(r)?hw:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?fw:cr)(e,r)}var op=180/Math.PI,ku={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function $_(e,r,i,o,u,S){var w,a,l;return(w=Math.sqrt(e*e+r*r))&&(e/=w,r/=w),(l=e*i+r*o)&&(i-=e*l,o-=r*l),(a=Math.sqrt(i*i+o*o))&&(i/=a,o/=a,l/=a),e*o<r*i&&(e=-e,r=-r,l=-l,w=-w),{translateX:u,translateY:S,rotate:Math.atan2(r,e)*op,skewX:Math.atan(l)*op,scaleX:w,scaleY:a}}var ra;function gw(e){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return r.isIdentity?ku:$_(r.a,r.b,r.c,r.d,r.e,r.f)}function mw(e){return e==null||(ra||(ra=document.createElementNS("http://www.w3.org/2000/svg","g")),ra.setAttribute("transform",e),!(e=ra.transform.baseVal.consolidate()))?ku:(e=e.matrix,$_(e.a,e.b,e.c,e.d,e.e,e.f))}function W_(e,r,i,o){function u(p){return p.length?p.pop()+" ":""}function S(p,v,c,m,C,b){if(p!==c||v!==m){var x=C.push("translate(",null,r,null,i);b.push({i:x-4,x:cr(p,c)},{i:x-2,x:cr(v,m)})}else(c||m)&&C.push("translate("+c+r+m+i)}function w(p,v,c,m){p!==v?(p-v>180?v+=360:v-p>180&&(p+=360),m.push({i:c.push(u(c)+"rotate(",null,o)-2,x:cr(p,v)})):v&&c.push(u(c)+"rotate("+v+o)}function a(p,v,c,m){p!==v?m.push({i:c.push(u(c)+"skewX(",null,o)-2,x:cr(p,v)}):v&&c.push(u(c)+"skewX("+v+o)}function l(p,v,c,m,C,b){if(p!==c||v!==m){var x=C.push(u(C)+"scale(",null,",",null,")");b.push({i:x-4,x:cr(p,c)},{i:x-2,x:cr(v,m)})}else(c!==1||m!==1)&&C.push(u(C)+"scale("+c+","+m+")")}return function(p,v){var c=[],m=[];return p=e(p),v=e(v),S(p.translateX,p.translateY,v.translateX,v.translateY,c,m),w(p.rotate,v.rotate,c,m),a(p.skewX,v.skewX,c,m),l(p.scaleX,p.scaleY,v.scaleX,v.scaleY,c,m),p=v=null,function(C){for(var b=-1,x=m.length,f;++b<x;)c[(f=m[b]).i]=f.x(C);return c.join("")}}}var vw=W_(gw,"px, ","px)","deg)"),yw=W_(mw,", ",")",")"),ww=1e-12;function ap(e){return((e=Math.exp(e))+1/e)/2}function Sw(e){return((e=Math.exp(e))-1/e)/2}function Cw(e){return((e=Math.exp(2*e))-1)/(e+1)}const _a=(function e(r,i,o){function u(S,w){var a=S[0],l=S[1],p=S[2],v=w[0],c=w[1],m=w[2],C=v-a,b=c-l,x=C*C+b*b,f,_;if(x<ww)_=Math.log(m/p)/r,f=function(D){return[a+D*C,l+D*b,p*Math.exp(r*D*_)]};else{var d=Math.sqrt(x),h=(m*m-p*p+o*x)/(2*p*i*d),y=(m*m-p*p-o*x)/(2*m*i*d),k=Math.log(Math.sqrt(h*h+1)-h),R=Math.log(Math.sqrt(y*y+1)-y);_=(R-k)/r,f=function(D){var L=D*_,M=ap(k),W=p/(i*d)*(M*Cw(r*L+k)-Sw(k));return[a+W*C,l+W*b,p*M/ap(r*L+k)]}}return f.duration=_*1e3*r/Math.SQRT2,f}return u.rho=function(S){var w=Math.max(.001,+S),a=w*w,l=a*a;return e(w,a,l)},u})(Math.SQRT2,2,4);var ui=0,fs=0,us=0,U_=1e3,Ea,ps,ka=0,En=0,Ha=0,ws=typeof performance=="object"&&performance.now?performance:Date,V_=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ju(){return En||(V_(xw),En=ws.now()+Ha)}function xw(){En=0}function La(){this._call=this._time=this._next=null}La.prototype=q_.prototype={constructor:La,restart:function(e,r,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?Ju():+i)+(r==null?0:+r),!this._next&&ps!==this&&(ps?ps._next=this:Ea=this,ps=this),this._call=e,this._time=i,Lu()},stop:function(){this._call&&(this._call=null,this._time=1/0,Lu())}};function q_(e,r,i){var o=new La;return o.restart(e,r,i),o}function bw(){Ju(),++ui;for(var e=Ea,r;e;)(r=En-e._time)>=0&&e._call.call(void 0,r),e=e._next;--ui}function lp(){En=(ka=ws.now())+Ha,ui=fs=0;try{bw()}finally{ui=0,kw(),En=0}}function Ew(){var e=ws.now(),r=e-ka;r>U_&&(Ha-=r,ka=e)}function kw(){for(var e,r=Ea,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:Ea=i);ps=e,Lu(o)}function Lu(e){if(!ui){fs&&(fs=clearTimeout(fs));var r=e-En;r>24?(e<1/0&&(fs=setTimeout(lp,e-ws.now()-Ha)),us&&(us=clearInterval(us))):(us||(ka=ws.now(),us=setInterval(Ew,U_)),ui=1,V_(lp))}}function cp(e,r,i){var o=new La;return r=r==null?0:+r,o.restart(u=>{o.stop(),e(u+r)},r,i),o}var Lw=Ia("start","end","cancel","interrupt"),Rw=[],K_=0,up=1,Ru=2,ga=3,hp=4,Du=5,ma=6;function ja(e,r,i,o,u,S){var w=e.__transition;if(!w)e.__transition={};else if(i in w)return;Dw(e,i,{name:r,index:o,group:u,on:Lw,tween:Rw,time:S.time,delay:S.delay,duration:S.duration,ease:S.ease,timer:null,state:K_})}function Zu(e,r){var i=tr(e,r);if(i.state>K_)throw new Error("too late; already scheduled");return i}function pr(e,r){var i=tr(e,r);if(i.state>ga)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 Dw(e,r,i){var o=e.__transition,u;o[r]=i,i.timer=q_(S,0,i.time);function S(p){i.state=up,i.timer.restart(w,i.delay,i.time),i.delay<=p&&w(p-i.delay)}function w(p){var v,c,m,C;if(i.state!==up)return l();for(v in o)if(C=o[v],C.name===i.name){if(C.state===ga)return cp(w);C.state===hp?(C.state=ma,C.timer.stop(),C.on.call("interrupt",e,e.__data__,C.index,C.group),delete o[v]):+v<r&&(C.state=ma,C.timer.stop(),C.on.call("cancel",e,e.__data__,C.index,C.group),delete o[v])}if(cp(function(){i.state===ga&&(i.state=hp,i.timer.restart(a,i.delay,i.time),a(p))}),i.state=Ru,i.on.call("start",e,e.__data__,i.index,i.group),i.state===Ru){for(i.state=ga,u=new Array(m=i.tween.length),v=0,c=-1;v<m;++v)(C=i.tween[v].value.call(e,e.__data__,i.index,i.group))&&(u[++c]=C);u.length=c+1}}function a(p){for(var v=p<i.duration?i.ease.call(null,p/i.duration):(i.timer.restart(l),i.state=Du,1),c=-1,m=u.length;++c<m;)u[c].call(e,v);i.state===Du&&(i.on.call("end",e,e.__data__,i.index,i.group),l())}function l(){i.state=ma,i.timer.stop(),delete o[r];for(var p in o)return;delete e.__transition}}function va(e,r){var i=e.__transition,o,u,S=!0,w;if(i){r=r==null?null:r+"";for(w in i){if((o=i[w]).name!==r){S=!1;continue}u=o.state>Ru&&o.state<Du,o.state=ma,o.timer.stop(),o.on.call(u?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete i[w]}S&&delete e.__transition}}function Tw(e){return this.each(function(){va(this,e)})}function Aw(e,r){var i,o;return function(){var u=pr(this,e),S=u.tween;if(S!==i){o=i=S;for(var w=0,a=o.length;w<a;++w)if(o[w].name===r){o=o.slice(),o.splice(w,1);break}}u.tween=o}}function Mw(e,r,i){var o,u;if(typeof i!="function")throw new Error;return function(){var S=pr(this,e),w=S.tween;if(w!==o){u=(o=w).slice();for(var a={name:r,value:i},l=0,p=u.length;l<p;++l)if(u[l].name===r){u[l]=a;break}l===p&&u.push(a)}S.tween=u}}function Pw(e,r){var i=this._id;if(e+="",arguments.length<2){for(var o=tr(this.node(),i).tween,u=0,S=o.length,w;u<S;++u)if((w=o[u]).name===e)return w.value;return null}return this.each((r==null?Aw:Mw)(i,e,r))}function eh(e,r,i){var o=e._id;return e.each(function(){var u=pr(this,o);(u.value||(u.value={}))[r]=i.apply(this,arguments)}),function(u){return tr(u,o).value[r]}}function X_(e,r){var i;return(typeof r=="number"?cr:r instanceof bn?ba:(i=bn(r))?(r=i,ba):z_)(e,r)}function Nw(e){return function(){this.removeAttribute(e)}}function Bw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Iw(e,r,i){var o,u=i+"",S;return function(){var w=this.getAttribute(e);return w===u?null:w===o?S:S=r(o=w,i)}}function Ow(e,r,i){var o,u=i+"",S;return function(){var w=this.getAttributeNS(e.space,e.local);return w===u?null:w===o?S:S=r(o=w,i)}}function Hw(e,r,i){var o,u,S;return function(){var w,a=i(this),l;return a==null?void this.removeAttribute(e):(w=this.getAttribute(e),l=a+"",w===l?null:w===o&&l===u?S:(u=l,S=r(o=w,a)))}}function jw(e,r,i){var o,u,S;return function(){var w,a=i(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(w=this.getAttributeNS(e.space,e.local),l=a+"",w===l?null:w===o&&l===u?S:(u=l,S=r(o=w,a)))}}function Fw(e,r){var i=Oa(e),o=i==="transform"?yw:X_;return this.attrTween(e,typeof r=="function"?(i.local?jw:Hw)(i,o,eh(this,"attr."+e,r)):r==null?(i.local?Bw:Nw)(i):(i.local?Ow:Iw)(i,o,r))}function zw(e,r){return function(i){this.setAttribute(e,r.call(this,i))}}function $w(e,r){return function(i){this.setAttributeNS(e.space,e.local,r.call(this,i))}}function Ww(e,r){var i,o;function u(){var S=r.apply(this,arguments);return S!==o&&(i=(o=S)&&$w(e,S)),i}return u._value=r,u}function Uw(e,r){var i,o;function u(){var S=r.apply(this,arguments);return S!==o&&(i=(o=S)&&zw(e,S)),i}return u._value=r,u}function Vw(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=Oa(e);return this.tween(i,(o.local?Ww:Uw)(o,r))}function qw(e,r){return function(){Zu(this,e).delay=+r.apply(this,arguments)}}function Kw(e,r){return r=+r,function(){Zu(this,e).delay=r}}function Xw(e){var r=this._id;return arguments.length?this.each((typeof e=="function"?qw:Kw)(r,e)):tr(this.node(),r).delay}function Yw(e,r){return function(){pr(this,e).duration=+r.apply(this,arguments)}}function Gw(e,r){return r=+r,function(){pr(this,e).duration=r}}function Qw(e){var r=this._id;return arguments.length?this.each((typeof e=="function"?Yw:Gw)(r,e)):tr(this.node(),r).duration}function Jw(e,r){if(typeof r!="function")throw new Error;return function(){pr(this,e).ease=r}}function Zw(e){var r=this._id;return arguments.length?this.each(Jw(r,e)):tr(this.node(),r).ease}function eS(e,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;pr(this,e).ease=i}}function tS(e){if(typeof e!="function")throw new Error;return this.each(eS(this._id,e))}function rS(e){typeof e!="function"&&(e=E_(e));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var S=r[u],w=S.length,a=o[u]=[],l,p=0;p<w;++p)(l=S[p])&&e.call(l,l.__data__,p,S)&&a.push(l);return new Lr(o,this._parents,this._name,this._id)}function nS(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),w=new Array(o),a=0;a<S;++a)for(var l=r[a],p=i[a],v=l.length,c=w[a]=new Array(v),m,C=0;C<v;++C)(m=l[C]||p[C])&&(c[C]=m);for(;a<o;++a)w[a]=r[a];return new Lr(w,this._parents,this._name,this._id)}function iS(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 sS(e,r,i){var o,u,S=iS(r)?Zu:pr;return function(){var w=S(this,e),a=w.on;a!==o&&(u=(o=a).copy()).on(r,i),w.on=u}}function oS(e,r){var i=this._id;return arguments.length<2?tr(this.node(),i).on.on(e):this.each(sS(i,e,r))}function aS(e){return function(){var r=this.parentNode;for(var i in this.__transition)if(+i!==e)return;r&&r.removeChild(this)}}function lS(){return this.on("end.remove",aS(this._id))}function cS(e){var r=this._name,i=this._id;typeof e!="function"&&(e=Xu(e));for(var o=this._groups,u=o.length,S=new Array(u),w=0;w<u;++w)for(var a=o[w],l=a.length,p=S[w]=new Array(l),v,c,m=0;m<l;++m)(v=a[m])&&(c=e.call(v,v.__data__,m,a))&&("__data__"in v&&(c.__data__=v.__data__),p[m]=c,ja(p[m],r,i,m,p,tr(v,i)));return new Lr(S,this._parents,r,i)}function uS(e){var r=this._name,i=this._id;typeof e!="function"&&(e=b_(e));for(var o=this._groups,u=o.length,S=[],w=[],a=0;a<u;++a)for(var l=o[a],p=l.length,v,c=0;c<p;++c)if(v=l[c]){for(var m=e.call(v,v.__data__,c,l),C,b=tr(v,i),x=0,f=m.length;x<f;++x)(C=m[x])&&ja(C,r,i,x,m,b);S.push(m),w.push(v)}return new Lr(S,w,r,i)}var hS=Ls.prototype.constructor;function dS(){return new hS(this._groups,this._parents)}function fS(e,r){var i,o,u;return function(){var S=ci(this,e),w=(this.style.removeProperty(e),ci(this,e));return S===w?null:S===i&&w===o?u:u=r(i=S,o=w)}}function Y_(e){return function(){this.style.removeProperty(e)}}function pS(e,r,i){var o,u=i+"",S;return function(){var w=ci(this,e);return w===u?null:w===o?S:S=r(o=w,i)}}function _S(e,r,i){var o,u,S;return function(){var w=ci(this,e),a=i(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),ci(this,e))),w===l?null:w===o&&l===u?S:(u=l,S=r(o=w,a))}}function gS(e,r){var i,o,u,S="style."+r,w="end."+S,a;return function(){var l=pr(this,e),p=l.on,v=l.value[S]==null?a||(a=Y_(r)):void 0;(p!==i||u!==v)&&(o=(i=p).copy()).on(w,u=v),l.on=o}}function mS(e,r,i){var o=(e+="")=="transform"?vw:X_;return r==null?this.styleTween(e,fS(e,o)).on("end.style."+e,Y_(e)):typeof r=="function"?this.styleTween(e,_S(e,o,eh(this,"style."+e,r))).each(gS(this._id,e)):this.styleTween(e,pS(e,o,r),i).on("end.style."+e,null)}function vS(e,r,i){return function(o){this.style.setProperty(e,r.call(this,o),i)}}function yS(e,r,i){var o,u;function S(){var w=r.apply(this,arguments);return w!==u&&(o=(u=w)&&vS(e,w,i)),o}return S._value=r,S}function wS(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,yS(e,r,i??""))}function SS(e){return function(){this.textContent=e}}function CS(e){return function(){var r=e(this);this.textContent=r??""}}function xS(e){return this.tween("text",typeof e=="function"?CS(eh(this,"text",e)):SS(e==null?"":e+""))}function bS(e){return function(r){this.textContent=e.call(this,r)}}function ES(e){var r,i;function o(){var u=e.apply(this,arguments);return u!==i&&(r=(i=u)&&bS(u)),r}return o._value=e,o}function kS(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,ES(e))}function LS(){for(var e=this._name,r=this._id,i=G_(),o=this._groups,u=o.length,S=0;S<u;++S)for(var w=o[S],a=w.length,l,p=0;p<a;++p)if(l=w[p]){var v=tr(l,r);ja(l,e,i,p,w,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new Lr(o,this._parents,e,i)}function RS(){var e,r,i=this,o=i._id,u=i.size();return new Promise(function(S,w){var a={value:w},l={value:function(){--u===0&&S()}};i.each(function(){var p=pr(this,o),v=p.on;v!==e&&(r=(e=v).copy(),r._.cancel.push(a),r._.interrupt.push(a),r._.end.push(l)),p.on=r}),u===0&&S()})}var DS=0;function Lr(e,r,i,o){this._groups=e,this._parents=r,this._name=i,this._id=o}function G_(){return++DS}var br=Ls.prototype;Lr.prototype={constructor:Lr,select:cS,selectAll:uS,selectChild:br.selectChild,selectChildren:br.selectChildren,filter:rS,merge:nS,selection:dS,transition:LS,call:br.call,nodes:br.nodes,node:br.node,size:br.size,empty:br.empty,each:br.each,on:oS,attr:Fw,attrTween:Vw,style:mS,styleTween:wS,text:xS,textTween:kS,remove:lS,tween:Pw,delay:Xw,duration:Qw,ease:Zw,easeVarying:tS,end:RS,[Symbol.iterator]:br[Symbol.iterator]};function TS(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var AS={time:null,delay:0,duration:250,ease:TS};function MS(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 PS(e){var r,i;e instanceof Lr?(r=e._id,e=e._name):(r=G_(),(i=AS).time=Ju(),e=e==null?null:e+"");for(var o=this._groups,u=o.length,S=0;S<u;++S)for(var w=o[S],a=w.length,l,p=0;p<a;++p)(l=w[p])&&ja(l,e,r,p,w,i||MS(l,r));return new Lr(o,this._parents,e,r)}Ls.prototype.interrupt=Tw;Ls.prototype.transition=PS;const na=e=>()=>e;function NS(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 kr(e,r,i){this.k=e,this.x=r,this.y=i}kr.prototype={constructor:kr,scale:function(e){return e===1?this:new kr(this.k*e,this.x,this.y)},translate:function(e,r){return e===0&r===0?this:new kr(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 Fa=new kr(1,0,0);Q_.prototype=kr.prototype;function Q_(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Fa;return e.__zoom}function Qc(e){e.stopImmediatePropagation()}function hs(e){e.preventDefault(),e.stopImmediatePropagation()}function BS(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function IS(){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 dp(){return this.__zoom||Fa}function OS(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function HS(){return navigator.maxTouchPoints||"ontouchstart"in this}function jS(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],w=e.invertY(r[1][1])-i[1][1];return e.translate(u>o?(o+u)/2:Math.min(0,o)||Math.max(0,u),w>S?(S+w)/2:Math.min(0,S)||Math.max(0,w))}function J_(){var e=BS,r=IS,i=jS,o=OS,u=HS,S=[0,1/0],w=[[-1/0,-1/0],[1/0,1/0]],a=250,l=_a,p=Ia("start","zoom","end"),v,c,m,C=500,b=150,x=0,f=10;function _(O){O.property("__zoom",dp).on("wheel.zoom",L,{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",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(O,q,U,K){var V=O.selection?O.selection():O;V.property("__zoom",dp),O!==V?k(O,q,U,K):V.interrupt().each(function(){R(this,arguments).event(K).start().zoom(null,typeof q=="function"?q.apply(this,arguments):q).end()})},_.scaleBy=function(O,q,U,K){_.scaleTo(O,function(){var V=this.__zoom.k,A=typeof q=="function"?q.apply(this,arguments):q;return V*A},U,K)},_.scaleTo=function(O,q,U,K){_.transform(O,function(){var V=r.apply(this,arguments),A=this.__zoom,I=U==null?y(V):typeof U=="function"?U.apply(this,arguments):U,P=A.invert(I),j=typeof q=="function"?q.apply(this,arguments):q;return i(h(d(A,j),I,P),V,w)},U,K)},_.translateBy=function(O,q,U,K){_.transform(O,function(){return i(this.__zoom.translate(typeof q=="function"?q.apply(this,arguments):q,typeof U=="function"?U.apply(this,arguments):U),r.apply(this,arguments),w)},null,K)},_.translateTo=function(O,q,U,K,V){_.transform(O,function(){var A=r.apply(this,arguments),I=this.__zoom,P=K==null?y(A):typeof K=="function"?K.apply(this,arguments):K;return i(Fa.translate(P[0],P[1]).scale(I.k).translate(typeof q=="function"?-q.apply(this,arguments):-q,typeof U=="function"?-U.apply(this,arguments):-U),A,w)},K,V)};function d(O,q){return q=Math.max(S[0],Math.min(S[1],q)),q===O.k?O:new kr(q,O.x,O.y)}function h(O,q,U){var K=q[0]-U[0]*O.k,V=q[1]-U[1]*O.k;return K===O.x&&V===O.y?O:new kr(O.k,K,V)}function y(O){return[(+O[0][0]+ +O[1][0])/2,(+O[0][1]+ +O[1][1])/2]}function k(O,q,U,K){O.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 V=this,A=arguments,I=R(V,A).event(K),P=r.apply(V,A),j=U==null?y(P):typeof U=="function"?U.apply(V,A):U,Y=Math.max(P[1][0]-P[0][0],P[1][1]-P[0][1]),Z=V.__zoom,ie=typeof q=="function"?q.apply(V,A):q,ae=l(Z.invert(j).concat(Y/Z.k),ie.invert(j).concat(Y/ie.k));return function(X){if(X===1)X=ie;else{var H=ae(X),re=Y/H[2];X=new kr(re,j[0]-H[0]*re,j[1]-H[1]*re)}I.zoom(null,X)}})}function R(O,q,U){return!U&&O.__zooming||new D(O,q)}function D(O,q){this.that=O,this.args=q,this.active=0,this.sourceEvent=null,this.extent=r.apply(O,q),this.taps=0}D.prototype={event:function(O){return O&&(this.sourceEvent=O),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(O,q){return this.mouse&&O!=="mouse"&&(this.mouse[1]=q.invert(this.mouse[0])),this.touch0&&O!=="touch"&&(this.touch0[1]=q.invert(this.touch0[0])),this.touch1&&O!=="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(O){var q=Nt(this.that).datum();p.call(O,this.that,new NS(O,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:p}),q)}};function L(O,...q){if(!e.apply(this,arguments))return;var U=R(this,q).event(O),K=this.__zoom,V=Math.max(S[0],Math.min(S[1],K.k*Math.pow(2,o.apply(this,arguments)))),A=Qt(O);if(U.wheel)(U.mouse[0][0]!==A[0]||U.mouse[0][1]!==A[1])&&(U.mouse[1]=K.invert(U.mouse[0]=A)),clearTimeout(U.wheel);else{if(K.k===V)return;U.mouse=[A,K.invert(A)],va(this),U.start()}hs(O),U.wheel=setTimeout(I,b),U.zoom("mouse",i(h(d(K,V),U.mouse[0],U.mouse[1]),U.extent,w));function I(){U.wheel=null,U.end()}}function M(O,...q){if(m||!e.apply(this,arguments))return;var U=O.currentTarget,K=R(this,q,!0).event(O),V=Nt(O.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",Y,!0),A=Qt(O,U),I=O.clientX,P=O.clientY;B_(O.view),Qc(O),K.mouse=[A,this.__zoom.invert(A)],va(this),K.start();function j(Z){if(hs(Z),!K.moved){var ie=Z.clientX-I,ae=Z.clientY-P;K.moved=ie*ie+ae*ae>x}K.event(Z).zoom("mouse",i(h(K.that.__zoom,K.mouse[0]=Qt(Z,U),K.mouse[1]),K.extent,w))}function Y(Z){V.on("mousemove.zoom mouseup.zoom",null),I_(Z.view,K.moved),hs(Z),K.event(Z).end()}}function W(O,...q){if(e.apply(this,arguments)){var U=this.__zoom,K=Qt(O.changedTouches?O.changedTouches[0]:O,this),V=U.invert(K),A=U.k*(O.shiftKey?.5:2),I=i(h(d(U,A),K,V),r.apply(this,q),w);hs(O),a>0?Nt(this).transition().duration(a).call(k,I,K,O):Nt(this).call(_.transform,I,K,O)}}function z(O,...q){if(e.apply(this,arguments)){var U=O.touches,K=U.length,V=R(this,q,O.changedTouches.length===K).event(O),A,I,P,j;for(Qc(O),I=0;I<K;++I)P=U[I],j=Qt(P,this),j=[j,this.__zoom.invert(j),P.identifier],V.touch0?!V.touch1&&V.touch0[2]!==j[2]&&(V.touch1=j,V.taps=0):(V.touch0=j,A=!0,V.taps=1+!!v);v&&(v=clearTimeout(v)),A&&(V.taps<2&&(c=j[0],v=setTimeout(function(){v=null},C)),va(this),V.start())}}function F(O,...q){if(this.__zooming){var U=R(this,q).event(O),K=O.changedTouches,V=K.length,A,I,P,j;for(hs(O),A=0;A<V;++A)I=K[A],P=Qt(I,this),U.touch0&&U.touch0[2]===I.identifier?U.touch0[0]=P:U.touch1&&U.touch1[2]===I.identifier&&(U.touch1[0]=P);if(I=U.that.__zoom,U.touch1){var Y=U.touch0[0],Z=U.touch0[1],ie=U.touch1[0],ae=U.touch1[1],X=(X=ie[0]-Y[0])*X+(X=ie[1]-Y[1])*X,H=(H=ae[0]-Z[0])*H+(H=ae[1]-Z[1])*H;I=d(I,Math.sqrt(X/H)),P=[(Y[0]+ie[0])/2,(Y[1]+ie[1])/2],j=[(Z[0]+ae[0])/2,(Z[1]+ae[1])/2]}else if(U.touch0)P=U.touch0[0],j=U.touch0[1];else return;U.zoom("touch",i(h(I,P,j),U.extent,w))}}function B(O,...q){if(this.__zooming){var U=R(this,q).event(O),K=O.changedTouches,V=K.length,A,I;for(Qc(O),m&&clearTimeout(m),m=setTimeout(function(){m=null},C),A=0;A<V;++A)I=K[A],U.touch0&&U.touch0[2]===I.identifier?delete U.touch0:U.touch1&&U.touch1[2]===I.identifier&&delete U.touch1;if(U.touch1&&!U.touch0&&(U.touch0=U.touch1,delete U.touch1),U.touch0)U.touch0[1]=this.__zoom.invert(U.touch0[0]);else if(U.end(),U.taps===2&&(I=Qt(I,this),Math.hypot(c[0]-I[0],c[1]-I[1])<f)){var P=Nt(this).on("dblclick.zoom");P&&P.apply(this,arguments)}}}return _.wheelDelta=function(O){return arguments.length?(o=typeof O=="function"?O:na(+O),_):o},_.filter=function(O){return arguments.length?(e=typeof O=="function"?O:na(!!O),_):e},_.touchable=function(O){return arguments.length?(u=typeof O=="function"?O:na(!!O),_):u},_.extent=function(O){return arguments.length?(r=typeof O=="function"?O:na([[+O[0][0],+O[0][1]],[+O[1][0],+O[1][1]]]),_):r},_.scaleExtent=function(O){return arguments.length?(S[0]=+O[0],S[1]=+O[1],_):[S[0],S[1]]},_.translateExtent=function(O){return arguments.length?(w[0][0]=+O[0][0],w[1][0]=+O[1][0],w[0][1]=+O[0][1],w[1][1]=+O[1][1],_):[[w[0][0],w[0][1]],[w[1][0],w[1][1]]]},_.constrain=function(O){return arguments.length?(i=O,_):i},_.duration=function(O){return arguments.length?(a=+O,_):a},_.interpolate=function(O){return arguments.length?(l=O,_):l},_.on=function(){var O=p.on.apply(p,arguments);return O===p?_:O},_.clickDistance=function(O){return arguments.length?(x=(O=+O)*O,_):Math.sqrt(x)},_.tapDistance=function(O){return arguments.length?(f=+O,_):f},_}const fr={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."},Ss=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Z_=["Enter"," ","Escape"],eg={"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 hi;(function(e){e.Strict="strict",e.Loose="loose"})(hi||(hi={}));var xn;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(xn||(xn={}));var Cs;(function(e){e.Partial="partial",e.Full="full"})(Cs||(Cs={}));const tg={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Zr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Zr||(Zr={}));var Ra;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ra||(Ra={}));var xe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(xe||(xe={}));const fp={[xe.Left]:xe.Right,[xe.Right]:xe.Left,[xe.Top]:xe.Bottom,[xe.Bottom]:xe.Top};function rg(e){return e===null?null:e?"valid":"invalid"}const ng=e=>"id"in e&&"source"in e&&"target"in e,FS=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),th=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ds=(e,r=[0,0])=>{const{width:i,height:o}=Rr(e),u=e.origin??r,S=i*u[0],w=o*u[1];return{x:e.position.x-S,y:e.position.y-w}},zS=(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 w=!r.nodeLookup&&!S?u:void 0;r.nodeLookup&&(w=S?r.nodeLookup.get(u):th(u)?u:r.nodeLookup.get(u.id));const a=w?Da(w,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return za(o,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return $a(i)},Ts=(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=za(i,Da(u)),o=!0)}),o?$a(i):{x:0,y:0,width:0,height:0}},rh=(e,r,[i,o,u]=[0,0,1],S=!1,w=!1)=>{const a={...Ms(r,[i,o,u]),width:r.width/u,height:r.height/u},l=[];for(const p of e.values()){const{measured:v,selectable:c=!0,hidden:m=!1}=p;if(w&&!c||m)continue;const C=v.width??p.width??p.initialWidth??null,b=v.height??p.height??p.initialHeight??null,x=xs(a,fi(p)),f=(C??0)*(b??0),_=S&&x>0;(!p.internals.handleBounds||_||x>=f||p.dragging)&&l.push(p)}return l},$S=(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 WS(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 US({nodes:e,width:r,height:i,panZoom:o,minZoom:u,maxZoom:S},w){if(e.size===0)return Promise.resolve(!0);const a=WS(e,w),l=Ts(a),p=nh(l,r,i,(w==null?void 0:w.minZoom)??u,(w==null?void 0:w.maxZoom)??S,(w==null?void 0:w.padding)??.1);return await o.setViewport(p,{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),Promise.resolve(!0)}function ig({nodeId:e,nextPosition:r,nodeLookup:i,nodeOrigin:o=[0,0],nodeExtent:u,onError:S}){const w=i.get(e),a=w.parentId?i.get(w.parentId):void 0,{x:l,y:p}=a?a.internals.positionAbsolute:{x:0,y:0},v=w.origin??o;let c=w.extent||u;if(w.extent==="parent"&&!w.expandParent)if(!a)S==null||S("005",fr.error005());else{const C=a.measured.width,b=a.measured.height;C&&b&&(c=[[l,p],[l+C,p+b]])}else a&&pi(w.extent)&&(c=[[w.extent[0][0]+l,w.extent[0][1]+p],[w.extent[1][0]+l,w.extent[1][1]+p]]);const m=pi(c)?kn(r,c,w.measured):r;return(w.measured.width===void 0||w.measured.height===void 0)&&(S==null||S("015",fr.error015())),{position:{x:m.x-l+(w.measured.width??0)*v[0],y:m.y-p+(w.measured.height??0)*v[1]},positionAbsolute:m}}async function VS({nodesToRemove:e=[],edgesToRemove:r=[],nodes:i,edges:o,onBeforeDelete:u}){const S=new Set(e.map(m=>m.id)),w=[];for(const m of i){if(m.deletable===!1)continue;const C=S.has(m.id),b=!C&&m.parentId&&w.find(x=>x.id===m.parentId);(C||b)&&w.push(m)}const a=new Set(r.map(m=>m.id)),l=o.filter(m=>m.deletable!==!1),v=$S(w,l);for(const m of l)a.has(m.id)&&!v.find(b=>b.id===m.id)&&v.push(m);if(!u)return{edges:v,nodes:w};const c=await u({nodes:w,edges:v});return typeof c=="boolean"?c?{edges:v,nodes:w}:{edges:[],nodes:[]}:c}const di=(e,r=0,i=1)=>Math.min(Math.max(e,r),i),kn=(e={x:0,y:0},r,i)=>({x:di(e.x,r[0][0],r[1][0]-((i==null?void 0:i.width)??0)),y:di(e.y,r[0][1],r[1][1]-((i==null?void 0:i.height)??0))});function sg(e,r,i){const{width:o,height:u}=Rr(i),{x:S,y:w}=i.internals.positionAbsolute;return kn(e,[[S,w],[S+o,w+u]],r)}const pp=(e,r,i)=>e<r?di(Math.abs(e-r),1,r)/r:e>i?-di(Math.abs(e-i),1,r)/r:0,og=(e,r,i=15,o=40)=>{const u=pp(e.x,o,r.width-o)*i,S=pp(e.y,o,r.height-o)*i;return[u,S]},za=(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)}),Tu=({x:e,y:r,width:i,height:o})=>({x:e,y:r,x2:e+i,y2:r+o}),$a=({x:e,y:r,x2:i,y2:o})=>({x:e,y:r,width:i-e,height:o-r}),fi=(e,r=[0,0])=>{var u,S;const{x:i,y:o}=th(e)?e.internals.positionAbsolute:Ds(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}},Da=(e,r=[0,0])=>{var u,S;const{x:i,y:o}=th(e)?e.internals.positionAbsolute:Ds(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)}},ag=(e,r)=>$a(za(Tu(e),Tu(r))),xs=(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)},_p=e=>Zt(e.width)&&Zt(e.height)&&Zt(e.x)&&Zt(e.y),Zt=e=>!isNaN(e)&&isFinite(e),qS=(e,r)=>{},As=(e,r=[1,1])=>({x:r[0]*Math.round(e.x/r[0]),y:r[1]*Math.round(e.y/r[1])}),Ms=({x:e,y:r},[i,o,u],S=!1,w=[1,1])=>{const a={x:(e-i)/u,y:(r-o)/u};return S?As(a,w):a},Ta=({x:e,y:r},[i,o,u])=>({x:e*u+i,y:r*u+o});function ii(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 KS(e,r,i){if(typeof e=="string"||typeof e=="number"){const o=ii(e,i),u=ii(e,r);return{top:o,right:u,bottom:o,left:u,x:u*2,y:o*2}}if(typeof e=="object"){const o=ii(e.top??e.y??0,i),u=ii(e.bottom??e.y??0,i),S=ii(e.left??e.x??0,r),w=ii(e.right??e.x??0,r);return{top:o,right:w,bottom:u,left:S,x:S+w,y:o+u}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function XS(e,r,i,o,u,S){const{x:w,y:a}=Ta(e,[r,i,o]),{x:l,y:p}=Ta({x:e.x+e.width,y:e.y+e.height},[r,i,o]),v=u-l,c=S-p;return{left:Math.floor(w),top:Math.floor(a),right:Math.floor(v),bottom:Math.floor(c)}}const nh=(e,r,i,o,u,S)=>{const w=KS(S,r,i),a=(r-w.x)/e.width,l=(i-w.y)/e.height,p=Math.min(a,l),v=di(p,o,u),c=e.x+e.width/2,m=e.y+e.height/2,C=r/2-c*v,b=i/2-m*v,x=XS(e,C,b,v,r,i),f={left:Math.min(x.left-w.left,0),top:Math.min(x.top-w.top,0),right:Math.min(x.right-w.right,0),bottom:Math.min(x.bottom-w.bottom,0)};return{x:C-f.left+f.right,y:b-f.top+f.bottom,zoom:v}},bs=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function pi(e){return e!=null&&e!=="parent"}function Rr(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 lg(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 cg(e,r={width:0,height:0},i,o,u){const S={...e},w=o.get(i);if(w){const a=w.origin||u;S.x+=w.internals.positionAbsolute.x-(r.width??0)*a[0],S.y+=w.internals.positionAbsolute.y-(r.height??0)*a[1]}return S}function gp(e,r){if(e.size!==r.size)return!1;for(const i of e)if(!r.has(i))return!1;return!0}function YS(){let e,r;return{promise:new Promise((o,u)=>{e=o,r=u}),resolve:e,reject:r}}function GS(e){return{...eg,...e||{}}}function gs(e,{snapGrid:r=[0,0],snapToGrid:i=!1,transform:o,containerBounds:u}){const{x:S,y:w}=er(e),a=Ms({x:S-((u==null?void 0:u.left)??0),y:w-((u==null?void 0:u.top)??0)},o),{x:l,y:p}=i?As(a,r):a;return{xSnapped:l,ySnapped:p,...a}}const ih=e=>({width:e.offsetWidth,height:e.offsetHeight}),ug=e=>{var r;return((r=e==null?void 0:e.getRootNode)==null?void 0:r.call(e))||(window==null?void 0:window.document)},QS=["INPUT","SELECT","TEXTAREA"];function hg(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:QS.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const dg=e=>"clientX"in e,er=(e,r)=>{var S,w;const i=dg(e),o=i?e.clientX:(S=e.touches)==null?void 0:S[0].clientX,u=i?e.clientY:(w=e.touches)==null?void 0:w[0].clientY;return{x:o-((r==null?void 0:r.left)??0),y:u-((r==null?void 0:r.top)??0)}},mp=(e,r,i,o,u)=>{const S=r.querySelectorAll(`.${e}`);return!S||!S.length?null:Array.from(S).map(w=>{const a=w.getBoundingClientRect();return{id:w.getAttribute("data-handleid"),type:e,nodeId:u,position:w.getAttribute("data-handlepos"),x:(a.left-i.left)/o,y:(a.top-i.top)/o,...ih(w)}})};function fg({sourceX:e,sourceY:r,targetX:i,targetY:o,sourceControlX:u,sourceControlY:S,targetControlX:w,targetControlY:a}){const l=e*.125+u*.375+w*.375+i*.125,p=r*.125+S*.375+a*.375+o*.125,v=Math.abs(l-e),c=Math.abs(p-r);return[l,p,v,c]}function ia(e,r){return e>=0?.5*e:r*25*Math.sqrt(-e)}function vp({pos:e,x1:r,y1:i,x2:o,y2:u,c:S}){switch(e){case xe.Left:return[r-ia(r-o,S),i];case xe.Right:return[r+ia(o-r,S),i];case xe.Top:return[r,i-ia(i-u,S)];case xe.Bottom:return[r,i+ia(u-i,S)]}}function pg({sourceX:e,sourceY:r,sourcePosition:i=xe.Bottom,targetX:o,targetY:u,targetPosition:S=xe.Top,curvature:w=.25}){const[a,l]=vp({pos:i,x1:e,y1:r,x2:o,y2:u,c:w}),[p,v]=vp({pos:S,x1:o,y1:u,x2:e,y2:r,c:w}),[c,m,C,b]=fg({sourceX:e,sourceY:r,targetX:o,targetY:u,sourceControlX:a,sourceControlY:l,targetControlX:p,targetControlY:v});return[`M${e},${r} C${a},${l} ${p},${v} ${o},${u}`,c,m,C,b]}function _g({sourceX:e,sourceY:r,targetX:i,targetY:o}){const u=Math.abs(i-e)/2,S=i<e?i+u:i-u,w=Math.abs(o-r)/2,a=o<r?o+w:o-w;return[S,a,u,w]}function JS({sourceNode:e,targetNode:r,selected:i=!1,zIndex:o=0,elevateOnSelect:u=!1,zIndexMode:S="basic"}){if(S==="manual")return o;const w=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 w+a}function ZS({sourceNode:e,targetNode:r,width:i,height:o,transform:u}){const S=za(Da(e),Da(r));S.x===S.x2&&(S.x2+=1),S.y===S.y2&&(S.y2+=1);const w={x:-u[0]/u[2],y:-u[1]/u[2],width:i/u[2],height:o/u[2]};return xs(w,$a(S))>0}const eC=({source:e,sourceHandle:r,target:i,targetHandle:o})=>`xy-edge__${e}${r||""}-${i}${o||""}`,tC=(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)),rC=(e,r,i={})=>{if(!e.source||!e.target)return r;const o=i.getEdgeId||eC;let u;return ng(e)?u={...e}:u={...e,id:o(e)},tC(u,r)?r:(u.sourceHandle===null&&delete u.sourceHandle,u.targetHandle===null&&delete u.targetHandle,r.concat(u))};function gg({sourceX:e,sourceY:r,targetX:i,targetY:o}){const[u,S,w,a]=_g({sourceX:e,sourceY:r,targetX:i,targetY:o});return[`M ${e},${r}L ${i},${o}`,u,S,w,a]}const yp={[xe.Left]:{x:-1,y:0},[xe.Right]:{x:1,y:0},[xe.Top]:{x:0,y:-1},[xe.Bottom]:{x:0,y:1}},nC=({source:e,sourcePosition:r=xe.Bottom,target:i})=>r===xe.Left||r===xe.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},wp=(e,r)=>Math.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2));function iC({source:e,sourcePosition:r=xe.Bottom,target:i,targetPosition:o=xe.Top,center:u,offset:S,stepPosition:w}){const a=yp[r],l=yp[o],p={x:e.x+a.x*S,y:e.y+a.y*S},v={x:i.x+l.x*S,y:i.y+l.y*S},c=nC({source:p,sourcePosition:r,target:v}),m=c.x!==0?"x":"y",C=c[m];let b=[],x,f;const _={x:0,y:0},d={x:0,y:0},[,,h,y]=_g({sourceX:e.x,sourceY:e.y,targetX:i.x,targetY:i.y});if(a[m]*l[m]===-1){m==="x"?(x=u.x??p.x+(v.x-p.x)*w,f=u.y??(p.y+v.y)/2):(x=u.x??(p.x+v.x)/2,f=u.y??p.y+(v.y-p.y)*w);const L=[{x,y:p.y},{x,y:v.y}],M=[{x:p.x,y:f},{x:v.x,y:f}];a[m]===C?b=m==="x"?L:M:b=m==="x"?M:L}else{const L=[{x:p.x,y:v.y}],M=[{x:v.x,y:p.y}];if(m==="x"?b=a.x===C?M:L:b=a.y===C?L:M,r===o){const O=Math.abs(e[m]-i[m]);if(O<=S){const q=Math.min(S-1,S-O);a[m]===C?_[m]=(p[m]>e[m]?-1:1)*q:d[m]=(v[m]>i[m]?-1:1)*q}}if(r!==o){const O=m==="x"?"y":"x",q=a[m]===l[O],U=p[O]>v[O],K=p[O]<v[O];(a[m]===1&&(!q&&U||q&&K)||a[m]!==1&&(!q&&K||q&&U))&&(b=m==="x"?L:M)}const W={x:p.x+_.x,y:p.y+_.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)),B=Math.max(Math.abs(W.y-b[0].y),Math.abs(z.y-b[0].y));F>=B?(x=(W.x+z.x)/2,f=b[0].y):(x=b[0].x,f=(W.y+z.y)/2)}const k={x:p.x+_.x,y:p.y+_.y},R={x:v.x+d.x,y:v.y+d.y};return[[e,...k.x!==b[0].x||k.y!==b[0].y?[k]:[],...b,...R.x!==b[b.length-1].x||R.y!==b[b.length-1].y?[R]:[],i],x,f,h,y]}function sC(e,r,i,o){const u=Math.min(wp(e,r)/2,wp(r,i)/2,o),{x:S,y:w}=r;if(e.x===S&&S===i.x||e.y===w&&w===i.y)return`L${S} ${w}`;if(e.y===w){const p=e.x<i.x?-1:1,v=e.y<i.y?1:-1;return`L ${S+u*p},${w}Q ${S},${w} ${S},${w+u*v}`}const a=e.x<i.x?1:-1,l=e.y<i.y?-1:1;return`L ${S},${w+u*l}Q ${S},${w} ${S+u*a},${w}`}function Au({sourceX:e,sourceY:r,sourcePosition:i=xe.Bottom,targetX:o,targetY:u,targetPosition:S=xe.Top,borderRadius:w=5,centerX:a,centerY:l,offset:p=20,stepPosition:v=.5}){const[c,m,C,b,x]=iC({source:{x:e,y:r},sourcePosition:i,target:{x:o,y:u},targetPosition:S,center:{x:a,y:l},offset:p,stepPosition:v});let f=`M${c[0].x} ${c[0].y}`;for(let _=1;_<c.length-1;_++)f+=sC(c[_-1],c[_],c[_+1],w);return f+=`L${c[c.length-1].x} ${c[c.length-1].y}`,[f,m,C,b,x]}function Sp(e){var r;return e&&!!(e.internals.handleBounds||(r=e.handles)!=null&&r.length)&&!!(e.measured.width||e.width||e.initialWidth)}function oC(e){var c;const{sourceNode:r,targetNode:i}=e;if(!Sp(r)||!Sp(i))return null;const o=r.internals.handleBounds||Cp(r.handles),u=i.internals.handleBounds||Cp(i.handles),S=xp((o==null?void 0:o.source)??[],e.sourceHandle),w=xp(e.connectionMode===hi.Strict?(u==null?void 0:u.target)??[]:((u==null?void 0:u.target)??[]).concat((u==null?void 0:u.source)??[]),e.targetHandle);if(!S||!w)return(c=e.onError)==null||c.call(e,"008",fr.error008(S?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(S==null?void 0:S.position)||xe.Bottom,l=(w==null?void 0:w.position)||xe.Top,p=Ln(r,S,a),v=Ln(i,w,l);return{sourceX:p.x,sourceY:p.y,targetX:v.x,targetY:v.y,sourcePosition:a,targetPosition:l}}function Cp(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 Ln(e,r,i=xe.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:w,height:a}=r??Rr(e);if(o)return{x:u+w/2,y:S+a/2};switch((r==null?void 0:r.position)??i){case xe.Top:return{x:u+w/2,y:S};case xe.Right:return{x:u+w,y:S+a/2};case xe.Bottom:return{x:u+w/2,y:S+a};case xe.Left:return{x:u,y:S+a/2}}}function xp(e,r){return e&&(r?e.find(i=>i.id===r):e[0])||null}function Mu(e,r){return e?typeof e=="string"?e:`${r?`${r}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function aC(e,{id:r,defaultColor:i,defaultMarkerStart:o,defaultMarkerEnd:u}){const S=new Set;return e.reduce((w,a)=>([a.markerStart||o,a.markerEnd||u].forEach(l=>{if(l&&typeof l=="object"){const p=Mu(l,r);S.has(p)||(w.push({id:p,color:l.color||i,...l}),S.add(p))}}),w),[]).sort((w,a)=>w.id.localeCompare(a.id))}const mg=1e3,lC=10,sh={nodeOrigin:[0,0],nodeExtent:Ss,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},cC={...sh,checkEquality:!0};function oh(e,r){const i={...e};for(const o in r)r[o]!==void 0&&(i[o]=r[o]);return i}function uC(e,r,i){const o=oh(sh,i);for(const u of e.values())if(u.parentId)lh(u,e,r,o);else{const S=Ds(u,o.nodeOrigin),w=pi(u.extent)?u.extent:o.nodeExtent,a=kn(S,w,Rr(u));u.internals.positionAbsolute=a}}function hC(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 ah(e){return e==="manual"}function Pu(e,r,i,o={}){var v,c;const u=oh(cC,o),S={i:0},w=new Map(r),a=u!=null&&u.elevateNodesOnSelect&&!ah(u.zIndexMode)?mg:0;let l=e.length>0,p=!1;r.clear(),i.clear();for(const m of e){let C=w.get(m.id);if(u.checkEquality&&m===(C==null?void 0:C.internals.userNode))r.set(m.id,C);else{const b=Ds(m,u.nodeOrigin),x=pi(m.extent)?m.extent:u.nodeExtent,f=kn(b,x,Rr(m));C={...u.defaults,...m,measured:{width:(v=m.measured)==null?void 0:v.width,height:(c=m.measured)==null?void 0:c.height},internals:{positionAbsolute:f,handleBounds:hC(m,C),z:vg(m,a,u.zIndexMode),userNode:m}},r.set(m.id,C)}(C.measured===void 0||C.measured.width===void 0||C.measured.height===void 0)&&!C.hidden&&(l=!1),m.parentId&&lh(C,r,i,o,S),p||(p=m.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:p}}function dC(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 lh(e,r,i,o,u){const{elevateNodesOnSelect:S,nodeOrigin:w,nodeExtent:a,zIndexMode:l}=oh(sh,o),p=e.parentId,v=r.get(p);if(!v){console.warn(`Parent node ${p} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}dC(e,i),u&&!v.parentId&&v.internals.rootParentIndex===void 0&&l==="auto"&&(v.internals.rootParentIndex=++u.i,v.internals.z=v.internals.z+u.i*lC),u&&v.internals.rootParentIndex!==void 0&&(u.i=v.internals.rootParentIndex);const c=S&&!ah(l)?mg:0,{x:m,y:C,z:b}=fC(e,v,w,a,c,l),{positionAbsolute:x}=e.internals,f=m!==x.x||C!==x.y;(f||b!==e.internals.z)&&r.set(e.id,{...e,internals:{...e.internals,positionAbsolute:f?{x:m,y:C}:x,z:b}})}function vg(e,r,i){const o=Zt(e.zIndex)?e.zIndex:0;return ah(i)?o:o+(e.selected?r:0)}function fC(e,r,i,o,u,S){const{x:w,y:a}=r.internals.positionAbsolute,l=Rr(e),p=Ds(e,i),v=pi(e.extent)?kn(p,e.extent,l):p;let c=kn({x:w+v.x,y:a+v.y},o,l);e.extent==="parent"&&(c=sg(c,l,r));const m=vg(e,u,S),C=r.internals.z??0;return{x:c.x,y:c.y,z:C>=m?C+1:m}}function ch(e,r,i,o=[0,0]){var w;const u=[],S=new Map;for(const a of e){const l=r.get(a.parentId);if(!l)continue;const p=((w=S.get(a.parentId))==null?void 0:w.expandedRect)??fi(l),v=ag(p,a.rect);S.set(a.parentId,{expandedRect:v,parent:l})}return S.size>0&&S.forEach(({expandedRect:a,parent:l},p)=>{var h;const v=l.internals.positionAbsolute,c=Rr(l),m=l.origin??o,C=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,x=Math.max(c.width,Math.round(a.width)),f=Math.max(c.height,Math.round(a.height)),_=(x-c.width)*m[0],d=(f-c.height)*m[1];(C>0||b>0||_||d)&&(u.push({id:p,type:"position",position:{x:l.position.x-C+_,y:l.position.y-b+d}}),(h=i.get(p))==null||h.forEach(y=>{e.some(k=>k.id===y.id)||u.push({id:y.id,type:"position",position:{x:y.position.x+C,y:y.position.y+b}})})),(c.width<a.width||c.height<a.height||C||b)&&u.push({id:p,type:"dimensions",setAttributes:!0,dimensions:{width:x+(C?m[0]*C-_:0),height:f+(b?m[1]*b-d:0)}})}),u}function pC(e,r,i,o,u,S,w){const a=o==null?void 0:o.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const p=[],v=window.getComputedStyle(a),{m22:c}=new window.DOMMatrixReadOnly(v.transform),m=[];for(const C of e.values()){const b=r.get(C.id);if(!b)continue;if(b.hidden){r.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),l=!0;continue}const x=ih(C.nodeElement),f=b.measured.width!==x.width||b.measured.height!==x.height;if(!!(x.width&&x.height&&(f||!b.internals.handleBounds||C.force))){const d=C.nodeElement.getBoundingClientRect(),h=pi(b.extent)?b.extent:S;let{positionAbsolute:y}=b.internals;b.parentId&&b.extent==="parent"?y=sg(y,x,r.get(b.parentId)):h&&(y=kn(y,h,x));const k={...b,measured:x,internals:{...b.internals,positionAbsolute:y,handleBounds:{source:mp("source",C.nodeElement,d,c,b.id),target:mp("target",C.nodeElement,d,c,b.id)}}};r.set(b.id,k),b.parentId&&lh(k,r,i,{nodeOrigin:u,zIndexMode:w}),l=!0,f&&(p.push({id:b.id,type:"dimensions",dimensions:x}),b.expandParent&&b.parentId&&m.push({id:b.id,parentId:b.parentId,rect:fi(k,u)}))}}if(m.length>0){const C=ch(m,r,i,u);p.push(...C)}return{changes:p,updatedInternals:l}}async function _C({delta:e,panZoom:r,transform:i,translateExtent:o,width:u,height:S}){if(!r||!e.x&&!e.y)return Promise.resolve(!1);const w=await r.setViewportConstrained({x:i[0]+e.x,y:i[1]+e.y,zoom:i[2]},[[0,0],[u,S]],o),a=!!w&&(w.x!==i[0]||w.y!==i[1]||w.k!==i[2]);return Promise.resolve(a)}function bp(e,r,i,o,u,S){let w=u;const a=o.get(w)||new Map;o.set(w,a.set(i,r)),w=`${u}-${e}`;const l=o.get(w)||new Map;if(o.set(w,l.set(i,r)),S){w=`${u}-${e}-${S}`;const p=o.get(w)||new Map;o.set(w,p.set(i,r))}}function yg(e,r,i){e.clear(),r.clear();for(const o of i){const{source:u,target:S,sourceHandle:w=null,targetHandle:a=null}=o,l={edgeId:o.id,source:u,target:S,sourceHandle:w,targetHandle:a},p=`${u}-${w}--${S}-${a}`,v=`${S}-${a}--${u}-${w}`;bp("source",l,v,e,u,w),bp("target",l,p,e,S,a),r.set(o.id,o)}}function wg(e,r){if(!e.parentId)return!1;const i=r.get(e.parentId);return i?i.selected?!0:wg(i,r):!1}function Ep(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 gC(e,r,i,o){const u=new Map;for(const[S,w]of e)if((w.selected||w.id===o)&&(!w.parentId||!wg(w,e))&&(w.draggable||r&&typeof w.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 Jc({nodeId:e,dragItems:r,nodeLookup:i,dragging:o=!0}){var w,a,l;const u=[];for(const[p,v]of r){const c=(w=i.get(p))==null?void 0:w.internals.userNode;c&&u.push({...c,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:((l=r.get(e))==null?void 0:l.position)||S.position,dragging:o}:u[0],u]}function mC({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},w=As(S,r);return{x:w.x-S.x,y:w.y-S.y}}function vC({onNodeMouseDown:e,getStoreItems:r,onDragStart:i,onDrag:o,onDragStop:u}){let S={x:null,y:null},w=0,a=new Map,l=!1,p={x:0,y:0},v=null,c=!1,m=null,C=!1,b=!1,x=null;function f({noDragClassName:d,handleSelector:h,domNode:y,isSelectable:k,nodeId:R,nodeClickDistance:D=0}){m=Nt(y);function L({x:F,y:B}){const{nodeLookup:O,nodeExtent:q,snapGrid:U,snapToGrid:K,nodeOrigin:V,onNodeDrag:A,onSelectionDrag:I,onError:P,updateNodePositions:j}=r();S={x:F,y:B};let Y=!1;const Z=a.size>1,ie=Z&&q?Tu(Ts(a)):null,ae=Z&&K?mC({dragItems:a,snapGrid:U,x:F,y:B}):null;for(const[X,H]of a){if(!O.has(X))continue;let re={x:F-H.distance.x,y:B-H.distance.y};K&&(re=ae?{x:Math.round(re.x+ae.x),y:Math.round(re.y+ae.y)}:As(re,U));let te=null;if(Z&&q&&!H.extent&&ie){const{positionAbsolute:pe}=H.internals,Se=pe.x-ie.x+q[0][0],be=pe.x+H.measured.width-ie.x2+q[1][0],ce=pe.y-ie.y+q[0][1],ge=pe.y+H.measured.height-ie.y2+q[1][1];te=[[Se,ce],[be,ge]]}const{position:ue,positionAbsolute:le}=ig({nodeId:X,nextPosition:re,nodeLookup:O,nodeExtent:te||q,nodeOrigin:V,onError:P});Y=Y||H.position.x!==ue.x||H.position.y!==ue.y,H.position=ue,H.internals.positionAbsolute=le}if(b=b||Y,!!Y&&(j(a,!0),x&&(o||A||!R&&I))){const[X,H]=Jc({nodeId:R,dragItems:a,nodeLookup:O});o==null||o(x,a,X,H),A==null||A(x,X,H),R||I==null||I(x,H)}}async function M(){if(!v)return;const{transform:F,panBy:B,autoPanSpeed:O,autoPanOnNodeDrag:q}=r();if(!q){l=!1,cancelAnimationFrame(w);return}const[U,K]=og(p,v,O);(U!==0||K!==0)&&(S.x=(S.x??0)-U/F[2],S.y=(S.y??0)-K/F[2],await B({x:U,y:K})&&L(S)),w=requestAnimationFrame(M)}function W(F){var Z;const{nodeLookup:B,multiSelectionActive:O,nodesDraggable:q,transform:U,snapGrid:K,snapToGrid:V,selectNodesOnDrag:A,onNodeDragStart:I,onSelectionDragStart:P,unselectNodesAndEdges:j}=r();c=!0,(!A||!k)&&!O&&R&&((Z=B.get(R))!=null&&Z.selected||j()),k&&A&&R&&(e==null||e(R));const Y=gs(F.sourceEvent,{transform:U,snapGrid:K,snapToGrid:V,containerBounds:v});if(S=Y,a=gC(B,q,Y,R),a.size>0&&(i||I||!R&&P)){const[ie,ae]=Jc({nodeId:R,dragItems:a,nodeLookup:B});i==null||i(F.sourceEvent,a,ie,ae),I==null||I(F.sourceEvent,ie,ae),R||P==null||P(F.sourceEvent,ae)}}const z=O_().clickDistance(D).on("start",F=>{const{domNode:B,nodeDragThreshold:O,transform:q,snapGrid:U,snapToGrid:K}=r();v=(B==null?void 0:B.getBoundingClientRect())||null,C=!1,b=!1,x=F.sourceEvent,O===0&&W(F),S=gs(F.sourceEvent,{transform:q,snapGrid:U,snapToGrid:K,containerBounds:v}),p=er(F.sourceEvent,v)}).on("drag",F=>{const{autoPanOnNodeDrag:B,transform:O,snapGrid:q,snapToGrid:U,nodeDragThreshold:K,nodeLookup:V}=r(),A=gs(F.sourceEvent,{transform:O,snapGrid:q,snapToGrid:U,containerBounds:v});if(x=F.sourceEvent,(F.sourceEvent.type==="touchmove"&&F.sourceEvent.touches.length>1||R&&!V.has(R))&&(C=!0),!C){if(!l&&B&&c&&(l=!0,M()),!c){const I=er(F.sourceEvent,v),P=I.x-p.x,j=I.y-p.y;Math.sqrt(P*P+j*j)>K&&W(F)}(S.x!==A.xSnapped||S.y!==A.ySnapped)&&a&&c&&(p=er(F.sourceEvent,v),L(A))}}).on("end",F=>{if(!(!c||C)&&(l=!1,c=!1,cancelAnimationFrame(w),a.size>0)){const{nodeLookup:B,updateNodePositions:O,onNodeDragStop:q,onSelectionDragStop:U}=r();if(b&&(O(a,!1),b=!1),u||q||!R&&U){const[K,V]=Jc({nodeId:R,dragItems:a,nodeLookup:B,dragging:!1});u==null||u(F.sourceEvent,a,K,V),q==null||q(F.sourceEvent,K,V),R||U==null||U(F.sourceEvent,V)}}}).filter(F=>{const B=F.target;return!F.button&&(!d||!Ep(B,`.${d}`,y))&&(!h||Ep(B,h,y))});m.call(z)}function _(){m==null||m.on(".drag",null)}return{update:f,destroy:_}}function yC(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())xs(u,fi(S))>0&&o.push(S);return o}const wC=250;function SC(e,r,i,o){var a,l;let u=[],S=1/0;const w=yC(e,i,r+wC);for(const p of w){const v=[...((a=p.internals.handleBounds)==null?void 0:a.source)??[],...((l=p.internals.handleBounds)==null?void 0:l.target)??[]];for(const c of v){if(o.nodeId===c.nodeId&&o.type===c.type&&o.id===c.id)continue;const{x:m,y:C}=Ln(p,c,c.position,!0),b=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(C-e.y,2));b>r||(b<S?(u=[{...c,x:m,y:C}],S=b):b===S&&u.push({...c,x:m,y:C}))}}if(!u.length)return null;if(u.length>1){const p=o.type==="source"?"target":"source";return u.find(v=>v.type===p)??u[0]}return u[0]}function Sg(e,r,i,o,u,S=!1){var p,v,c;const w=o.get(e);if(!w)return null;const a=u==="strict"?(p=w.internals.handleBounds)==null?void 0:p[r]:[...((v=w.internals.handleBounds)==null?void 0:v.source)??[],...((c=w.internals.handleBounds)==null?void 0:c.target)??[]],l=(i?a==null?void 0:a.find(m=>m.id===i):a==null?void 0:a[0])??null;return l&&S?{...l,...Ln(w,l,l.position,!0)}:l}function Cg(e,r){return e||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function CC(e,r){let i=null;return r?i=!0:e&&!r&&(i=!1),i}const xg=()=>!0;function xC(e,{connectionMode:r,connectionRadius:i,handleId:o,nodeId:u,edgeUpdaterType:S,isTarget:w,domNode:a,nodeLookup:l,lib:p,autoPanOnConnect:v,flowId:c,panBy:m,cancelConnection:C,onConnectStart:b,onConnect:x,onConnectEnd:f,isValidConnection:_=xg,onReconnectEnd:d,updateConnection:h,getTransform:y,getFromHandle:k,autoPanSpeed:R,dragThreshold:D=1,handleDomNode:L}){const M=ug(e.target);let W=0,z;const{x:F,y:B}=er(e),O=Cg(S,L),q=a==null?void 0:a.getBoundingClientRect();let U=!1;if(!q||!O)return;const K=Sg(u,O,o,l,r);if(!K)return;let V=er(e,q),A=!1,I=null,P=!1,j=null;function Y(){if(!v||!q)return;const[ue,le]=og(V,q,R);m({x:ue,y:le}),W=requestAnimationFrame(Y)}const Z={...K,nodeId:u,type:O,position:K.position},ie=l.get(u);let X={inProgress:!0,isValid:null,from:Ln(ie,Z,xe.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:ie,to:V,toHandle:null,toPosition:fp[Z.position],toNode:null,pointer:V};function H(){U=!0,h(X),b==null||b(e,{nodeId:u,handleId:o,handleType:O})}D===0&&H();function re(ue){if(!U){const{x:ge,y:Re}=er(ue),Ie=ge-F,ze=Re-B;if(!(Ie*Ie+ze*ze>D*D))return;H()}if(!k()||!Z){te(ue);return}const le=y();V=er(ue,q),z=SC(Ms(V,le,!1,[1,1]),i,l,Z),A||(Y(),A=!0);const pe=bg(ue,{handle:z,connectionMode:r,fromNodeId:u,fromHandleId:o,fromType:w?"target":"source",isValidConnection:_,doc:M,lib:p,flowId:c,nodeLookup:l});j=pe.handleDomNode,I=pe.connection,P=CC(!!z,pe.isValid);const Se=l.get(u),be=Se?Ln(Se,Z,xe.Left,!0):X.from,ce={...X,from:be,isValid:P,to:pe.toHandle&&P?Ta({x:pe.toHandle.x,y:pe.toHandle.y},le):V,toHandle:pe.toHandle,toPosition:P&&pe.toHandle?pe.toHandle.position:fp[Z.position],toNode:pe.toHandle?l.get(pe.toHandle.nodeId):null,pointer:V};h(ce),X=ce}function te(ue){if(!("touches"in ue&&ue.touches.length>0)){if(U){(z||j)&&I&&P&&(x==null||x(I));const{inProgress:le,...pe}=X,Se={...pe,toPosition:X.toHandle?X.toPosition:null};f==null||f(ue,Se),S&&(d==null||d(ue,Se))}C(),cancelAnimationFrame(W),A=!1,P=!1,I=null,j=null,M.removeEventListener("mousemove",re),M.removeEventListener("mouseup",te),M.removeEventListener("touchmove",re),M.removeEventListener("touchend",te)}}M.addEventListener("mousemove",re),M.addEventListener("mouseup",te),M.addEventListener("touchmove",re),M.addEventListener("touchend",te)}function bg(e,{handle:r,connectionMode:i,fromNodeId:o,fromHandleId:u,fromType:S,doc:w,lib:a,flowId:l,isValidConnection:p=xg,nodeLookup:v}){const c=S==="target",m=r?w.querySelector(`.${a}-flow__handle[data-id="${l}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:C,y:b}=er(e),x=w.elementFromPoint(C,b),f=x!=null&&x.classList.contains(`${a}-flow__handle`)?x:m,_={handleDomNode:f,isValid:!1,connection:null,toHandle:null};if(f){const d=Cg(void 0,f),h=f.getAttribute("data-nodeid"),y=f.getAttribute("data-handleid"),k=f.classList.contains("connectable"),R=f.classList.contains("connectableend");if(!h||!d)return _;const D={source:c?h:o,sourceHandle:c?y:u,target:c?o:h,targetHandle:c?u:y};_.connection=D;const M=k&&R&&(i===hi.Strict?c&&d==="source"||!c&&d==="target":h!==o||y!==u);_.isValid=M&&p(D),_.toHandle=Sg(h,d,y,v,i,!0)}return _}const Nu={onPointerDown:xC,isValid:bg};function bC({domNode:e,panZoom:r,getTransform:i,getViewScale:o}){const u=Nt(e);function S({translateExtent:a,width:l,height:p,zoomStep:v=1,pannable:c=!0,zoomable:m=!0,inversePan:C=!1}){const b=h=>{if(h.sourceEvent.type!=="wheel"||!r)return;const y=i(),k=h.sourceEvent.ctrlKey&&bs()?10:1,R=-h.sourceEvent.deltaY*(h.sourceEvent.deltaMode===1?.05:h.sourceEvent.deltaMode?1:.002)*v,D=y[2]*Math.pow(2,R*k);r.scaleTo(D)};let x=[0,0];const f=h=>{(h.sourceEvent.type==="mousedown"||h.sourceEvent.type==="touchstart")&&(x=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY])},_=h=>{const y=i();if(h.sourceEvent.type!=="mousemove"&&h.sourceEvent.type!=="touchmove"||!r)return;const k=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY],R=[k[0]-x[0],k[1]-x[1]];x=k;const D=o()*Math.max(y[2],Math.log(y[2]))*(C?-1:1),L={x:y[0]-R[0]*D,y:y[1]-R[1]*D},M=[[0,0],[l,p]];r.setViewportConstrained({x:L.x,y:L.y,zoom:y[2]},M,a)},d=J_().on("start",f).on("zoom",c?_:null).on("zoom.wheel",m?b:null);u.call(d,{})}function w(){u.on("zoom",null)}return{update:S,destroy:w,pointer:Qt}}const Wa=e=>({x:e.x,y:e.y,zoom:e.k}),Zc=({x:e,y:r,zoom:i})=>Fa.translate(e,r).scale(i),si=(e,r)=>e.target.closest(`.${r}`),Eg=(e,r)=>r===2&&Array.isArray(e)&&e.includes(2),EC=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,eu=(e,r=0,i=EC,o=()=>{})=>{const u=typeof r=="number"&&r>0;return u||o(),u?e.transition().duration(r).ease(i).on("end",o):e},kg=e=>{const r=e.ctrlKey&&bs()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*r};function kC({zoomPanValues:e,noWheelClassName:r,d3Selection:i,d3Zoom:o,panOnScrollMode:u,panOnScrollSpeed:S,zoomOnPinch:w,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:p}){return v=>{if(si(v,r))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const c=i.property("__zoom").k||1;if(v.ctrlKey&&w){const f=Qt(v),_=kg(v),d=c*Math.pow(2,_);o.scaleTo(i,d,f,v);return}const m=v.deltaMode===1?20:1;let C=u===xn.Vertical?0:v.deltaX*m,b=u===xn.Horizontal?0:v.deltaY*m;!bs()&&v.shiftKey&&u!==xn.Vertical&&(C=v.deltaY*m,b=0),o.translateBy(i,-(C/c)*S,-(b/c)*S,{internal:!0});const x=Wa(i.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(v,x),e.panScrollTimeout=setTimeout(()=>{p==null||p(v,x),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a==null||a(v,x))}}function LC({noWheelClassName:e,preventScrolling:r,d3ZoomHandler:i}){return function(o,u){const S=o.type==="wheel",w=!r&&S&&!o.ctrlKey,a=si(o,e);if(o.ctrlKey&&S&&a&&o.preventDefault(),w||a)return null;o.preventDefault(),i.call(this,o,u)}}function RC({zoomPanValues:e,onDraggingChange:r,onPanZoomStart:i}){return o=>{var S,w,a;if((S=o.sourceEvent)!=null&&S.internal)return;const u=Wa(o.transform);e.mouseButton=((w=o.sourceEvent)==null?void 0:w.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 DC({zoomPanValues:e,panOnDrag:r,onPaneContextMenu:i,onTransformChange:o,onPanZoom:u}){return S=>{var w,a;e.usedRightMouseButton=!!(i&&Eg(r,e.mouseButton??0)),(w=S.sourceEvent)!=null&&w.sync||o([S.transform.x,S.transform.y,S.transform.k]),u&&!((a=S.sourceEvent)!=null&&a.internal)&&(u==null||u(S.sourceEvent,Wa(S.transform)))}}function TC({zoomPanValues:e,panOnDrag:r,panOnScroll:i,onDraggingChange:o,onPanZoomEnd:u,onPaneContextMenu:S}){return w=>{var a;if(!((a=w.sourceEvent)!=null&&a.internal)&&(e.isZoomingOrPanning=!1,S&&Eg(r,e.mouseButton??0)&&!e.usedRightMouseButton&&w.sourceEvent&&S(w.sourceEvent),e.usedRightMouseButton=!1,o(!1),u)){const l=Wa(w.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{u==null||u(w.sourceEvent,l)},i?150:0)}}}function AC({zoomActivationKeyPressed:e,zoomOnScroll:r,zoomOnPinch:i,panOnDrag:o,panOnScroll:u,zoomOnDoubleClick:S,userSelectionActive:w,noWheelClassName:a,noPanClassName:l,lib:p,connectionInProgress:v}){return c=>{var f;const m=e||r,C=i&&c.ctrlKey,b=c.type==="wheel";if(c.button===1&&c.type==="mousedown"&&(si(c,`${p}-flow__node`)||si(c,`${p}-flow__edge`)))return!0;if(!o&&!m&&!u&&!S&&!i||w||v&&!b||si(c,a)&&b||si(c,l)&&(!b||u&&b&&!e)||!i&&c.ctrlKey&&b)return!1;if(!i&&c.type==="touchstart"&&((f=c.touches)==null?void 0:f.length)>1)return c.preventDefault(),!1;if(!m&&!u&&!C&&b||!o&&(c.type==="mousedown"||c.type==="touchstart")||Array.isArray(o)&&!o.includes(c.button)&&c.type==="mousedown")return!1;const x=Array.isArray(o)&&o.includes(c.button)||!c.button||c.button<=1;return(!c.ctrlKey||b)&&x}}function MC({domNode:e,minZoom:r,maxZoom:i,translateExtent:o,viewport:u,onPanZoom:S,onPanZoomStart:w,onPanZoomEnd:a,onDraggingChange:l}){const p={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},v=e.getBoundingClientRect(),c=J_().scaleExtent([r,i]).translateExtent(o),m=Nt(e).call(c);d({x:u.x,y:u.y,zoom:di(u.zoom,r,i)},[[0,0],[v.width,v.height]],o);const C=m.on("wheel.zoom"),b=m.on("dblclick.zoom");c.wheelDelta(kg);function x(z,F){return m?new Promise(B=>{c==null||c.interpolate((F==null?void 0:F.interpolate)==="linear"?_s:_a).transform(eu(m,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>B(!0)),z)}):Promise.resolve(!1)}function f({noWheelClassName:z,noPanClassName:F,onPaneContextMenu:B,userSelectionActive:O,panOnScroll:q,panOnDrag:U,panOnScrollMode:K,panOnScrollSpeed:V,preventScrolling:A,zoomOnPinch:I,zoomOnScroll:P,zoomOnDoubleClick:j,zoomActivationKeyPressed:Y,lib:Z,onTransformChange:ie,connectionInProgress:ae,paneClickDistance:X,selectionOnDrag:H}){O&&!p.isZoomingOrPanning&&_();const re=q&&!Y&&!O;c.clickDistance(H?1/0:!Zt(X)||X<0?0:X);const te=re?kC({zoomPanValues:p,noWheelClassName:z,d3Selection:m,d3Zoom:c,panOnScrollMode:K,panOnScrollSpeed:V,zoomOnPinch:I,onPanZoomStart:w,onPanZoom:S,onPanZoomEnd:a}):LC({noWheelClassName:z,preventScrolling:A,d3ZoomHandler:C});if(m.on("wheel.zoom",te,{passive:!1}),!O){const le=RC({zoomPanValues:p,onDraggingChange:l,onPanZoomStart:w});c.on("start",le);const pe=DC({zoomPanValues:p,panOnDrag:U,onPaneContextMenu:!!B,onPanZoom:S,onTransformChange:ie});c.on("zoom",pe);const Se=TC({zoomPanValues:p,panOnDrag:U,panOnScroll:q,onPaneContextMenu:B,onPanZoomEnd:a,onDraggingChange:l});c.on("end",Se)}const ue=AC({zoomActivationKeyPressed:Y,panOnDrag:U,zoomOnScroll:P,panOnScroll:q,zoomOnDoubleClick:j,zoomOnPinch:I,userSelectionActive:O,noPanClassName:F,noWheelClassName:z,lib:Z,connectionInProgress:ae});c.filter(ue),j?m.on("dblclick.zoom",b):m.on("dblclick.zoom",null)}function _(){c.on("zoom",null)}async function d(z,F,B){const O=Zc(z),q=c==null?void 0:c.constrain()(O,F,B);return q&&await x(q),new Promise(U=>U(q))}async function h(z,F){const B=Zc(z);return await x(B,F),new Promise(O=>O(B))}function y(z){if(m){const F=Zc(z),B=m.property("__zoom");(B.k!==z.zoom||B.x!==z.x||B.y!==z.y)&&(c==null||c.transform(m,F,null,{sync:!0}))}}function k(){const z=m?Q_(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(B=>{c==null||c.interpolate((F==null?void 0:F.interpolate)==="linear"?_s:_a).scaleTo(eu(m,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>B(!0)),z)}):Promise.resolve(!1)}function D(z,F){return m?new Promise(B=>{c==null||c.interpolate((F==null?void 0:F.interpolate)==="linear"?_s:_a).scaleBy(eu(m,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>B(!0)),z)}):Promise.resolve(!1)}function L(z){c==null||c.scaleExtent(z)}function M(z){c==null||c.translateExtent(z)}function W(z){const F=!Zt(z)||z<0?0:z;c==null||c.clickDistance(F)}return{update:f,destroy:_,setViewport:h,setViewportConstrained:d,getViewport:k,scaleTo:R,scaleBy:D,setScaleExtent:L,setTranslateExtent:M,syncViewport:y,setClickDistance:W}}var _i;(function(e){e.Line="line",e.Handle="handle"})(_i||(_i={}));function PC({width:e,prevWidth:r,height:i,prevHeight:o,affectsX:u,affectsY:S}){const w=e-r,a=i-o,l=[w>0?1:w<0?-1:0,a>0?1:a<0?-1:0];return w&&u&&(l[0]=l[0]*-1),a&&S&&(l[1]=l[1]*-1),l}function kp(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 Gr(e,r){return Math.max(0,r-e)}function Qr(e,r){return Math.max(0,e-r)}function sa(e,r,i){return Math.max(0,r-e,e-i)}function Lp(e,r){return e?!r:r}function NC(e,r,i,o,u,S,w,a){let{affectsX:l,affectsY:p}=r;const{isHorizontal:v,isVertical:c}=r,m=v&&c,{xSnapped:C,ySnapped:b}=i,{minWidth:x,maxWidth:f,minHeight:_,maxHeight:d}=o,{x:h,y,width:k,height:R,aspectRatio:D}=e;let L=Math.floor(v?C-e.pointerX:0),M=Math.floor(c?b-e.pointerY:0);const W=k+(l?-L:L),z=R+(p?-M:M),F=-S[0]*k,B=-S[1]*R;let O=sa(W,x,f),q=sa(z,_,d);if(w){let V=0,A=0;l&&L<0?V=Gr(h+L+F,w[0][0]):!l&&L>0&&(V=Qr(h+W+F,w[1][0])),p&&M<0?A=Gr(y+M+B,w[0][1]):!p&&M>0&&(A=Qr(y+z+B,w[1][1])),O=Math.max(O,V),q=Math.max(q,A)}if(a){let V=0,A=0;l&&L>0?V=Qr(h+L,a[0][0]):!l&&L<0&&(V=Gr(h+W,a[1][0])),p&&M>0?A=Qr(y+M,a[0][1]):!p&&M<0&&(A=Gr(y+z,a[1][1])),O=Math.max(O,V),q=Math.max(q,A)}if(u){if(v){const V=sa(W/D,_,d)*D;if(O=Math.max(O,V),w){let A=0;!l&&!p||l&&!p&&m?A=Qr(y+B+W/D,w[1][1])*D:A=Gr(y+B+(l?L:-L)/D,w[0][1])*D,O=Math.max(O,A)}if(a){let A=0;!l&&!p||l&&!p&&m?A=Gr(y+W/D,a[1][1])*D:A=Qr(y+(l?L:-L)/D,a[0][1])*D,O=Math.max(O,A)}}if(c){const V=sa(z*D,x,f)/D;if(q=Math.max(q,V),w){let A=0;!l&&!p||p&&!l&&m?A=Qr(h+z*D+F,w[1][0])/D:A=Gr(h+(p?M:-M)*D+F,w[0][0])/D,q=Math.max(q,A)}if(a){let A=0;!l&&!p||p&&!l&&m?A=Gr(h+z*D,a[1][0])/D:A=Qr(h+(p?M:-M)*D,a[0][0])/D,q=Math.max(q,A)}}}M=M+(M<0?q:-q),L=L+(L<0?O:-O),u&&(m?W>z*D?M=(Lp(l,p)?-L:L)/D:L=(Lp(l,p)?-M:M)*D:v?(M=L/D,p=l):(L=M*D,l=p));const U=l?h+L:h,K=p?y+M:y;return{width:k+(l?-L:L),height:R+(p?-M:M),x:S[0]*L*(l?-1:1)+U,y:S[1]*M*(p?-1:1)+K}}const Lg={width:0,height:0,x:0,y:0},BC={...Lg,pointerX:0,pointerY:0,aspectRatio:1};function IC(e){return[[0,0],[e.measured.width,e.measured.height]]}function OC(e,r,i){const o=r.position.x+e.position.x,u=r.position.y+e.position.y,S=e.measured.width??0,w=e.measured.height??0,a=i[0]*S,l=i[1]*w;return[[o-a,u-l],[o+S-a,u+w-l]]}function HC({domNode:e,nodeId:r,getStoreItems:i,onChange:o,onEnd:u}){const S=Nt(e);let w={controlDirection:kp("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:p,boundaries:v,keepAspectRatio:c,resizeDirection:m,onResizeStart:C,onResize:b,onResizeEnd:x,shouldResize:f}){let _={...Lg},d={...BC};w={boundaries:v,resizeDirection:m,keepAspectRatio:c,controlDirection:kp(p)};let h,y=null,k=[],R,D,L,M=!1;const W=O_().on("start",z=>{const{nodeLookup:F,transform:B,snapGrid:O,snapToGrid:q,nodeOrigin:U,paneDomNode:K}=i();if(h=F.get(r),!h)return;y=(K==null?void 0:K.getBoundingClientRect())??null;const{xSnapped:V,ySnapped:A}=gs(z.sourceEvent,{transform:B,snapGrid:O,snapToGrid:q,containerBounds:y});_={width:h.measured.width??0,height:h.measured.height??0,x:h.position.x??0,y:h.position.y??0},d={..._,pointerX:V,pointerY:A,aspectRatio:_.width/_.height},R=void 0,h.parentId&&(h.extent==="parent"||h.expandParent)&&(R=F.get(h.parentId),D=R&&h.extent==="parent"?IC(R):void 0),k=[],L=void 0;for(const[I,P]of F)if(P.parentId===r&&(k.push({id:I,position:{...P.position},extent:P.extent}),P.extent==="parent"||P.expandParent)){const j=OC(P,h,P.origin??U);L?L=[[Math.min(j[0][0],L[0][0]),Math.min(j[0][1],L[0][1])],[Math.max(j[1][0],L[1][0]),Math.max(j[1][1],L[1][1])]]:L=j}C==null||C(z,{..._})}).on("drag",z=>{const{transform:F,snapGrid:B,snapToGrid:O,nodeOrigin:q}=i(),U=gs(z.sourceEvent,{transform:F,snapGrid:B,snapToGrid:O,containerBounds:y}),K=[];if(!h)return;const{x:V,y:A,width:I,height:P}=_,j={},Y=h.origin??q,{width:Z,height:ie,x:ae,y:X}=NC(d,w.controlDirection,U,w.boundaries,w.keepAspectRatio,Y,D,L),H=Z!==I,re=ie!==P,te=ae!==V&&H,ue=X!==A&&re;if(!te&&!ue&&!H&&!re)return;if((te||ue||Y[0]===1||Y[1]===1)&&(j.x=te?ae:_.x,j.y=ue?X:_.y,_.x=j.x,_.y=j.y,k.length>0)){const be=ae-V,ce=X-A;for(const ge of k)ge.position={x:ge.position.x-be+Y[0]*(Z-I),y:ge.position.y-ce+Y[1]*(ie-P)},K.push(ge)}if((H||re)&&(j.width=H&&(!w.resizeDirection||w.resizeDirection==="horizontal")?Z:_.width,j.height=re&&(!w.resizeDirection||w.resizeDirection==="vertical")?ie:_.height,_.width=j.width,_.height=j.height),R&&h.expandParent){const be=Y[0]*(j.width??0);j.x&&j.x<be&&(_.x=be,d.x=d.x-(j.x-be));const ce=Y[1]*(j.height??0);j.y&&j.y<ce&&(_.y=ce,d.y=d.y-(j.y-ce))}const le=PC({width:_.width,prevWidth:I,height:_.height,prevHeight:P,affectsX:w.controlDirection.affectsX,affectsY:w.controlDirection.affectsY}),pe={..._,direction:le};(f==null?void 0:f(z,pe))!==!1&&(M=!0,b==null||b(z,pe),o(j,K))}).on("end",z=>{M&&(x==null||x(z,{..._}),u==null||u({..._}),M=!1)});S.call(W)}function l(){S.on(".drag",null)}return{update:a,destroy:l}}var tu={exports:{}},ru={},nu={exports:{}},iu={};/**
|
|
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 Rp;function jC(){if(Rp)return iu;Rp=1;var e=ks();function r(c,m){return c===m&&(c!==0||1/c===1/m)||c!==c&&m!==m}var i=typeof Object.is=="function"?Object.is:r,o=e.useState,u=e.useEffect,S=e.useLayoutEffect,w=e.useDebugValue;function a(c,m){var C=m(),b=o({inst:{value:C,getSnapshot:m}}),x=b[0].inst,f=b[1];return S(function(){x.value=C,x.getSnapshot=m,l(x)&&f({inst:x})},[c,C,m]),u(function(){return l(x)&&f({inst:x}),c(function(){l(x)&&f({inst:x})})},[c]),w(C),C}function l(c){var m=c.getSnapshot;c=c.value;try{var C=m();return!i(c,C)}catch{return!0}}function p(c,m){return m()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:a;return iu.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,iu}var Dp;function FC(){return Dp||(Dp=1,nu.exports=jC()),nu.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 Tp;function zC(){if(Tp)return ru;Tp=1;var e=ks(),r=FC();function i(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var o=typeof Object.is=="function"?Object.is:i,u=r.useSyncExternalStore,S=e.useRef,w=e.useEffect,a=e.useMemo,l=e.useDebugValue;return ru.useSyncExternalStoreWithSelector=function(p,v,c,m,C){var b=S(null);if(b.current===null){var x={hasValue:!1,value:null};b.current=x}else x=b.current;b=a(function(){function _(R){if(!d){if(d=!0,h=R,R=m(R),C!==void 0&&x.hasValue){var D=x.value;if(C(D,R))return y=D}return y=R}if(D=y,o(h,R))return D;var L=m(R);return C!==void 0&&C(D,L)?(h=R,D):(h=R,y=L)}var d=!1,h,y,k=c===void 0?null:c;return[function(){return _(v())},k===null?void 0:function(){return _(k())}]},[v,c,m,C]);var f=u(p,b[0],b[1]);return w(function(){x.hasValue=!0,x.value=f},[f]),l(f),f},ru}var Ap;function $C(){return Ap||(Ap=1,tu.exports=zC()),tu.exports}var WC=$C();const UC=zu(WC),VC={},Mp=e=>{let r;const i=new Set,o=(v,c)=>{const m=typeof v=="function"?v(r):v;if(!Object.is(m,r)){const C=r;r=c??(typeof m!="object"||m===null)?m:Object.assign({},r,m),i.forEach(b=>b(r,C))}},u=()=>r,l={setState:o,getState:u,getInitialState:()=>p,subscribe:v=>(i.add(v),()=>i.delete(v)),destroy:()=>{(VC?"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()}},p=r=e(o,u,l);return l},qC=e=>e?Mp(e):Mp,{useDebugValue:KC}=$u,{useSyncExternalStoreWithSelector:XC}=UC,YC=e=>e;function Rg(e,r=YC,i){const o=XC(e.subscribe,e.getState,e.getServerState||e.getInitialState,r,i);return KC(o),o}const Pp=(e,r)=>{const i=qC(e),o=(u,S=r)=>Rg(i,u,S);return Object.assign(o,i),o},GC=(e,r)=>e?Pp(e,r):Pp;function Ue(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}l_();const Ua=Q.createContext(null),QC=Ua.Provider,Dg=fr.error001();function Ae(e,r){const i=Q.useContext(Ua);if(i===null)throw new Error(Dg);return Rg(i,e,r)}function Ve(){const e=Q.useContext(Ua);if(e===null)throw new Error(Dg);return Q.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Np={display:"none"},JC={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Tg="react-flow__node-desc",Ag="react-flow__edge-desc",ZC="react-flow__aria-live",ex=e=>e.ariaLiveMessage,tx=e=>e.ariaLabelConfig;function rx({rfId:e}){const r=Ae(ex);return N.jsx("div",{id:`${ZC}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:JC,children:r})}function nx({rfId:e,disableKeyboardA11y:r}){const i=Ae(tx);return N.jsxs(N.Fragment,{children:[N.jsx("div",{id:`${Tg}-${e}`,style:Np,children:r?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),N.jsx("div",{id:`${Ag}-${e}`,style:Np,children:i["edge.a11yDescription.default"]}),!r&&N.jsx(rx,{rfId:e})]})}const Va=Q.forwardRef(({position:e="top-left",children:r,className:i,style:o,...u},S)=>{const w=`${e}`.split("-");return N.jsx("div",{className:rt(["react-flow__panel",i,...w]),style:o,ref:S,...u,children:r})});Va.displayName="Panel";function ix({proOptions:e,position:r="bottom-right"}){return e!=null&&e.hideAttribution?null:N.jsx(Va,{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:N.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const sx=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}},oa=e=>e.id;function ox(e,r){return Ue(e.selectedNodes.map(oa),r.selectedNodes.map(oa))&&Ue(e.selectedEdges.map(oa),r.selectedEdges.map(oa))}function ax({onSelectionChange:e}){const r=Ve(),{selectedNodes:i,selectedEdges:o}=Ae(sx,ox);return Q.useEffect(()=>{const u={nodes:i,edges:o};e==null||e(u),r.getState().onSelectionChangeHandlers.forEach(S=>S(u))},[i,o,e]),null}const lx=e=>!!e.onSelectionChangeHandlers;function cx({onSelectionChange:e}){const r=Ae(lx);return e||r?N.jsx(ax,{onSelectionChange:e}):null}const Bu=typeof window<"u"?Q.useLayoutEffect:Q.useEffect,Mg=[0,0],ux={x:0,y:0,zoom:1},hx=["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"],Bp=[...hx,"rfId"],dx=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}),Ip={translateExtent:Ss,nodeOrigin:Mg,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function fx(e){const{setNodes:r,setEdges:i,setMinZoom:o,setMaxZoom:u,setTranslateExtent:S,setNodeExtent:w,reset:a,setDefaultNodesAndEdges:l}=Ae(dx,Ue),p=Ve();Bu(()=>(l(e.defaultNodes,e.defaultEdges),()=>{v.current=Ip,a()}),[]);const v=Q.useRef(Ip);return Bu(()=>{for(const c of Bp){const m=e[c],C=v.current[c];m!==C&&(typeof e[c]>"u"||(c==="nodes"?r(m):c==="edges"?i(m):c==="minZoom"?o(m):c==="maxZoom"?u(m):c==="translateExtent"?S(m):c==="nodeExtent"?w(m):c==="ariaLabelConfig"?p.setState({ariaLabelConfig:GS(m)}):c==="fitView"?p.setState({fitViewQueued:m}):c==="fitViewOptions"?p.setState({fitViewOptions:m}):p.setState({[c]:m})))}v.current=e},Bp.map(c=>e[c])),null}function Op(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function px(e){var o;const[r,i]=Q.useState(e==="system"?null:e);return Q.useEffect(()=>{if(e!=="system"){i(e);return}const u=Op(),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=Op())!=null&&o.matches?"dark":"light"}const Hp=typeof document<"u"?document:null;function Es(e=null,r={target:Hp,actInsideInputWithModifier:!0}){const[i,o]=Q.useState(!1),u=Q.useRef(!1),S=Q.useRef(new Set([])),[w,a]=Q.useMemo(()=>{if(e!==null){const p=(Array.isArray(e)?e:[e]).filter(c=>typeof c=="string").map(c=>c.replace("+",`
|
|
57
|
+
`).replace(`
|
|
58
|
+
|
|
59
|
+
`,`
|
|
60
|
+
+`).split(`
|
|
61
|
+
`)),v=p.reduce((c,m)=>c.concat(...m),[]);return[p,v]}return[[],[]]},[e]);return Q.useEffect(()=>{const l=(r==null?void 0:r.target)??Hp,p=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(e!==null){const v=C=>{var f,_;if(u.current=C.ctrlKey||C.metaKey||C.shiftKey||C.altKey,(!u.current||u.current&&!p)&&hg(C))return!1;const x=Fp(C.code,a);if(S.current.add(C[x]),jp(w,S.current,!1)){const d=((_=(f=C.composedPath)==null?void 0:f.call(C))==null?void 0:_[0])||C.target,h=(d==null?void 0:d.nodeName)==="BUTTON"||(d==null?void 0:d.nodeName)==="A";r.preventDefault!==!1&&(u.current||!h)&&C.preventDefault(),o(!0)}},c=C=>{const b=Fp(C.code,a);jp(w,S.current,!0)?(o(!1),S.current.clear()):S.current.delete(C[b]),C.key==="Meta"&&S.current.clear(),u.current=!1},m=()=>{S.current.clear(),o(!1)};return l==null||l.addEventListener("keydown",v),l==null||l.addEventListener("keyup",c),window.addEventListener("blur",m),window.addEventListener("contextmenu",m),()=>{l==null||l.removeEventListener("keydown",v),l==null||l.removeEventListener("keyup",c),window.removeEventListener("blur",m),window.removeEventListener("contextmenu",m)}}},[e,o]),i}function jp(e,r,i){return e.filter(o=>i||o.length===r.size).some(o=>o.every(u=>r.has(u)))}function Fp(e,r){return r.includes(e)?"code":"key"}const _x=()=>{const e=Ve();return Q.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:w}=e.getState();return w?(await w.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:w,panZoom:a}=e.getState(),l=nh(r,o,u,S,w,(i==null?void 0:i.padding)??.1);return a?(await a.setViewport(l,{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:w}=e.getState();if(!w)return r;const{x:a,y:l}=w.getBoundingClientRect(),p={x:r.x-a,y:r.y-l},v=i.snapGrid??u,c=i.snapToGrid??S;return Ms(p,o,c,v)},flowToScreenPosition:r=>{const{transform:i,domNode:o}=e.getState();if(!o)return r;const{x:u,y:S}=o.getBoundingClientRect(),w=Ta(r,i);return{x:w.x+u,y:w.y+S}}}),[])};function Pg(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 w=o.get(S.id);w?w.push(S):o.set(S.id,[S])}for(const S of r){const w=o.get(S.id);if(!w){i.push(S);continue}if(w[0].type==="remove")continue;if(w[0].type==="replace"){i.push({...w[0].item});continue}const a={...S};for(const l of w)gx(l,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 gx(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 mx(e,r){return Pg(e,r)}function vx(e,r){return Pg(e,r)}function wn(e,r){return{id:e,type:"select",selected:r}}function oi(e,r=new Set,i=!1){const o=[];for(const[u,S]of e){const w=r.has(u);!(S.selected===void 0&&!w)&&S.selected!==w&&(i&&(S.selected=w),o.push(wn(S.id,w)))}return o}function zp({items:e=[],lookup:r}){var u;const i=[],o=new Map(e.map(S=>[S.id,S]));for(const[S,w]of e.entries()){const a=r.get(w.id),l=((u=a==null?void 0:a.internals)==null?void 0:u.userNode)??a;l!==void 0&&l!==w&&i.push({id:w.id,item:w,type:"replace"}),l===void 0&&i.push({item:w,type:"add",index:S})}for(const[S]of r)o.get(S)===void 0&&i.push({id:S,type:"remove"});return i}function $p(e){return{id:e.id,type:"remove"}}const Wp=e=>FS(e),yx=e=>ng(e);function Ng(e){return Q.forwardRef(e)}function Up(e){const[r,i]=Q.useState(BigInt(0)),[o]=Q.useState(()=>wx(()=>i(u=>u+BigInt(1))));return Bu(()=>{const u=o.get();u.length&&(e(u),o.reset())},[r]),o}function wx(e){let r=[];return{get:()=>r,reset:()=>{r=[]},push:i=>{r.push(i),e()}}}const Bg=Q.createContext(null);function Sx({children:e}){const r=Ve(),i=Q.useCallback(a=>{const{nodes:l=[],setNodes:p,hasDefaultNodes:v,onNodesChange:c,nodeLookup:m,fitViewQueued:C,onNodesChangeMiddlewareMap:b}=r.getState();let x=l;for(const _ of a)x=typeof _=="function"?_(x):_;let f=zp({items:x,lookup:m});for(const _ of b.values())f=_(f);v&&p(x),f.length>0?c==null||c(f):C&&window.requestAnimationFrame(()=>{const{fitViewQueued:_,nodes:d,setNodes:h}=r.getState();_&&h(d)})},[]),o=Up(i),u=Q.useCallback(a=>{const{edges:l=[],setEdges:p,hasDefaultEdges:v,onEdgesChange:c,edgeLookup:m}=r.getState();let C=l;for(const b of a)C=typeof b=="function"?b(C):b;v?p(C):c&&c(zp({items:C,lookup:m}))},[]),S=Up(u),w=Q.useMemo(()=>({nodeQueue:o,edgeQueue:S}),[]);return N.jsx(Bg.Provider,{value:w,children:e})}function Cx(){const e=Q.useContext(Bg);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const xx=e=>!!e.panZoom;function uh(){const e=_x(),r=Ve(),i=Cx(),o=Ae(xx),u=Q.useMemo(()=>{const S=c=>r.getState().nodeLookup.get(c),w=c=>{i.nodeQueue.push(c)},a=c=>{i.edgeQueue.push(c)},l=c=>{var _,d;const{nodeLookup:m,nodeOrigin:C}=r.getState(),b=Wp(c)?c:m.get(c.id),x=b.parentId?cg(b.position,b.measured,b.parentId,m,C):b.position,f={...b,position:x,width:((_=b.measured)==null?void 0:_.width)??b.width,height:((d=b.measured)==null?void 0:d.height)??b.height};return fi(f)},p=(c,m,C={replace:!1})=>{w(b=>b.map(x=>{if(x.id===c){const f=typeof m=="function"?m(x):m;return C.replace&&Wp(f)?f:{...x,...f}}return x}))},v=(c,m,C={replace:!1})=>{a(b=>b.map(x=>{if(x.id===c){const f=typeof m=="function"?m(x):m;return C.replace&&yx(f)?f:{...x,...f}}return x}))};return{getNodes:()=>r.getState().nodes.map(c=>({...c})),getNode:c=>{var m;return(m=S(c))==null?void 0:m.internals.userNode},getInternalNode:S,getEdges:()=>{const{edges:c=[]}=r.getState();return c.map(m=>({...m}))},getEdge:c=>r.getState().edgeLookup.get(c),setNodes:w,setEdges:a,addNodes:c=>{const m=Array.isArray(c)?c:[c];i.nodeQueue.push(C=>[...C,...m])},addEdges:c=>{const m=Array.isArray(c)?c:[c];i.edgeQueue.push(C=>[...C,...m])},toObject:()=>{const{nodes:c=[],edges:m=[],transform:C}=r.getState(),[b,x,f]=C;return{nodes:c.map(_=>({..._})),edges:m.map(_=>({..._})),viewport:{x:b,y:x,zoom:f}}},deleteElements:async({nodes:c=[],edges:m=[]})=>{const{nodes:C,edges:b,onNodesDelete:x,onEdgesDelete:f,triggerNodeChanges:_,triggerEdgeChanges:d,onDelete:h,onBeforeDelete:y}=r.getState(),{nodes:k,edges:R}=await VS({nodesToRemove:c,edgesToRemove:m,nodes:C,edges:b,onBeforeDelete:y}),D=R.length>0,L=k.length>0;if(D){const M=R.map($p);f==null||f(R),d(M)}if(L){const M=k.map($p);x==null||x(k),_(M)}return(L||D)&&(h==null||h({nodes:k,edges:R})),{deletedNodes:k,deletedEdges:R}},getIntersectingNodes:(c,m=!0,C)=>{const b=_p(c),x=b?c:l(c),f=C!==void 0;return x?(C||r.getState().nodes).filter(_=>{const d=r.getState().nodeLookup.get(_.id);if(d&&!b&&(_.id===c.id||!d.internals.positionAbsolute))return!1;const h=fi(f?_:d),y=xs(h,x);return m&&y>0||y>=h.width*h.height||y>=x.width*x.height}):[]},isNodeIntersecting:(c,m,C=!0)=>{const x=_p(c)?c:l(c);if(!x)return!1;const f=xs(x,m);return C&&f>0||f>=m.width*m.height||f>=x.width*x.height},updateNode:p,updateNodeData:(c,m,C={replace:!1})=>{p(c,b=>{const x=typeof m=="function"?m(b):m;return C.replace?{...b,data:x}:{...b,data:{...b.data,...x}}},C)},updateEdge:v,updateEdgeData:(c,m,C={replace:!1})=>{v(c,b=>{const x=typeof m=="function"?m(b):m;return C.replace?{...b,data:x}:{...b,data:{...b.data,...x}}},C)},getNodesBounds:c=>{const{nodeLookup:m,nodeOrigin:C}=r.getState();return zS(c,{nodeLookup:m,nodeOrigin:C})},getHandleConnections:({type:c,id:m,nodeId:C})=>{var b;return Array.from(((b=r.getState().connectionLookup.get(`${C}-${c}${m?`-${m}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:c,handleId:m,nodeId:C})=>{var b;return Array.from(((b=r.getState().connectionLookup.get(`${C}${c?m?`-${c}-${m}`:`-${c}`:""}`))==null?void 0:b.values())??[])},fitView:async c=>{const m=r.getState().fitViewResolver??YS();return r.setState({fitViewQueued:!0,fitViewOptions:c,fitViewResolver:m}),i.nodeQueue.push(C=>[...C]),m.promise}}},[]);return Q.useMemo(()=>({...u,...e,viewportInitialized:o}),[o])}const Vp=e=>e.selected,bx=typeof window<"u"?window:void 0;function Ex({deleteKeyCode:e,multiSelectionKeyCode:r}){const i=Ve(),{deleteElements:o}=uh(),u=Es(e,{actInsideInputWithModifier:!1}),S=Es(r,{target:bx});Q.useEffect(()=>{if(u){const{edges:w,nodes:a}=i.getState();o({nodes:a.filter(Vp),edges:w.filter(Vp)}),i.setState({nodesSelectionActive:!1})}},[u]),Q.useEffect(()=>{i.setState({multiSelectionActive:S})},[S])}function kx(e){const r=Ve();Q.useEffect(()=>{const i=()=>{var u,S,w,a;if(!e.current||!(((S=(u=e.current).checkVisibility)==null?void 0:S.call(u))??!0))return!1;const o=ih(e.current);(o.height===0||o.width===0)&&((a=(w=r.getState()).onError)==null||a.call(w,"004",fr.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 qa={position:"absolute",width:"100%",height:"100%",top:0,left:0},Lx=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Rx({onPaneContextMenu:e,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:o=!1,panOnScrollSpeed:u=.5,panOnScrollMode:S=xn.Free,zoomOnDoubleClick:w=!0,panOnDrag:a=!0,defaultViewport:l,translateExtent:p,minZoom:v,maxZoom:c,zoomActivationKeyCode:m,preventScrolling:C=!0,children:b,noWheelClassName:x,noPanClassName:f,onViewportChange:_,isControlledViewport:d,paneClickDistance:h,selectionOnDrag:y}){const k=Ve(),R=Q.useRef(null),{userSelectionActive:D,lib:L,connectionInProgress:M}=Ae(Lx,Ue),W=Es(m),z=Q.useRef();kx(R);const F=Q.useCallback(B=>{_==null||_({x:B[0],y:B[1],zoom:B[2]}),d||k.setState({transform:B})},[_,d]);return Q.useEffect(()=>{if(R.current){z.current=MC({domNode:R.current,minZoom:v,maxZoom:c,translateExtent:p,viewport:l,onDraggingChange:U=>k.setState(K=>K.paneDragging===U?K:{paneDragging:U}),onPanZoomStart:(U,K)=>{const{onViewportChangeStart:V,onMoveStart:A}=k.getState();A==null||A(U,K),V==null||V(K)},onPanZoom:(U,K)=>{const{onViewportChange:V,onMove:A}=k.getState();A==null||A(U,K),V==null||V(K)},onPanZoomEnd:(U,K)=>{const{onViewportChangeEnd:V,onMoveEnd:A}=k.getState();A==null||A(U,K),V==null||V(K)}});const{x:B,y:O,zoom:q}=z.current.getViewport();return k.setState({panZoom:z.current,transform:[B,O,q],domNode:R.current.closest(".react-flow")}),()=>{var U;(U=z.current)==null||U.destroy()}}},[]),Q.useEffect(()=>{var B;(B=z.current)==null||B.update({onPaneContextMenu:e,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:o,panOnScrollSpeed:u,panOnScrollMode:S,zoomOnDoubleClick:w,panOnDrag:a,zoomActivationKeyPressed:W,preventScrolling:C,noPanClassName:f,userSelectionActive:D,noWheelClassName:x,lib:L,onTransformChange:F,connectionInProgress:M,selectionOnDrag:y,paneClickDistance:h})},[e,r,i,o,u,S,w,a,W,C,f,D,x,L,F,M,y,h]),N.jsx("div",{className:"react-flow__renderer",ref:R,style:qa,children:b})}const Dx=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Tx(){const{userSelectionActive:e,userSelectionRect:r}=Ae(Dx,Ue);return e&&r?N.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 su=(e,r)=>i=>{i.target===r.current&&(e==null||e(i))},Ax=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function Mx({isSelecting:e,selectionKeyPressed:r,selectionMode:i=Cs.Full,panOnDrag:o,paneClickDistance:u,selectionOnDrag:S,onSelectionStart:w,onSelectionEnd:a,onPaneClick:l,onPaneContextMenu:p,onPaneScroll:v,onPaneMouseEnter:c,onPaneMouseMove:m,onPaneMouseLeave:C,children:b}){const x=Ve(),{userSelectionActive:f,elementsSelectable:_,dragging:d,connectionInProgress:h}=Ae(Ax,Ue),y=_&&(e||f),k=Q.useRef(null),R=Q.useRef(),D=Q.useRef(new Set),L=Q.useRef(new Set),M=Q.useRef(!1),W=V=>{if(M.current||h){M.current=!1;return}l==null||l(V),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},z=V=>{if(Array.isArray(o)&&(o!=null&&o.includes(2))){V.preventDefault();return}p==null||p(V)},F=v?V=>v(V):void 0,B=V=>{M.current&&(V.stopPropagation(),M.current=!1)},O=V=>{var ie,ae;const{domNode:A}=x.getState();if(R.current=A==null?void 0:A.getBoundingClientRect(),!R.current)return;const I=V.target===k.current;if(!I&&!!V.target.closest(".nokey")||!e||!(S&&I||r)||V.button!==0||!V.isPrimary)return;(ae=(ie=V.target)==null?void 0:ie.setPointerCapture)==null||ae.call(ie,V.pointerId),M.current=!1;const{x:Y,y:Z}=er(V.nativeEvent,R.current);x.setState({userSelectionRect:{width:0,height:0,startX:Y,startY:Z,x:Y,y:Z}}),I||(V.stopPropagation(),V.preventDefault())},q=V=>{const{userSelectionRect:A,transform:I,nodeLookup:P,edgeLookup:j,connectionLookup:Y,triggerNodeChanges:Z,triggerEdgeChanges:ie,defaultEdgeOptions:ae,resetSelectedElements:X}=x.getState();if(!R.current||!A)return;const{x:H,y:re}=er(V.nativeEvent,R.current),{startX:te,startY:ue}=A;if(!M.current){const ce=r?0:u;if(Math.hypot(H-te,re-ue)<=ce)return;X(),w==null||w(V)}M.current=!0;const le={startX:te,startY:ue,x:H<te?H:te,y:re<ue?re:ue,width:Math.abs(H-te),height:Math.abs(re-ue)},pe=D.current,Se=L.current;D.current=new Set(rh(P,le,I,i===Cs.Partial,!0).map(ce=>ce.id)),L.current=new Set;const be=(ae==null?void 0:ae.selectable)??!0;for(const ce of D.current){const ge=Y.get(ce);if(ge)for(const{edgeId:Re}of ge.values()){const Ie=j.get(Re);Ie&&(Ie.selectable??be)&&L.current.add(Re)}}if(!gp(pe,D.current)){const ce=oi(P,D.current,!0);Z(ce)}if(!gp(Se,L.current)){const ce=oi(j,L.current);ie(ce)}x.setState({userSelectionRect:le,userSelectionActive:!0,nodesSelectionActive:!1})},U=V=>{var A,I;V.button===0&&((I=(A=V.target)==null?void 0:A.releasePointerCapture)==null||I.call(A,V.pointerId),!f&&V.target===k.current&&x.getState().userSelectionRect&&(W==null||W(V)),x.setState({userSelectionActive:!1,userSelectionRect:null}),M.current&&(a==null||a(V),x.setState({nodesSelectionActive:D.current.size>0})))},K=o===!0||Array.isArray(o)&&o.includes(0);return N.jsxs("div",{className:rt(["react-flow__pane",{draggable:K,dragging:d,selection:e}]),onClick:y?void 0:su(W,k),onContextMenu:su(z,k),onWheel:su(F,k),onPointerEnter:y?void 0:c,onPointerMove:y?q:m,onPointerUp:y?U:void 0,onPointerDownCapture:y?O:void 0,onClickCapture:y?B:void 0,onPointerLeave:C,ref:k,style:qa,children:[b,N.jsx(Tx,{})]})}function Iu({id:e,store:r,unselect:i=!1,nodeRef:o}){const{addSelectedNodes:u,unselectNodesAndEdges:S,multiSelectionActive:w,nodeLookup:a,onError:l}=r.getState(),p=a.get(e);if(!p){l==null||l("012",fr.error012(e));return}r.setState({nodesSelectionActive:!1}),p.selected?(i||p.selected&&w)&&(S({nodes:[p],edges:[]}),requestAnimationFrame(()=>{var v;return(v=o==null?void 0:o.current)==null?void 0:v.blur()})):u([e])}function Ig({nodeRef:e,disabled:r=!1,noDragClassName:i,handleSelector:o,nodeId:u,isSelectable:S,nodeClickDistance:w}){const a=Ve(),[l,p]=Q.useState(!1),v=Q.useRef();return Q.useEffect(()=>{v.current=vC({getStoreItems:()=>a.getState(),onNodeMouseDown:c=>{Iu({id:c,store:a,nodeRef:e})},onDragStart:()=>{p(!0)},onDragStop:()=>{p(!1)}})},[]),Q.useEffect(()=>{if(!(r||!e.current||!v.current))return v.current.update({noDragClassName:i,handleSelector:o,domNode:e.current,isSelectable:S,nodeId:u,nodeClickDistance:w}),()=>{var c;(c=v.current)==null||c.destroy()}},[i,o,r,S,e,u,w]),l}const Px=e=>r=>r.selected&&(r.draggable||e&&typeof r.draggable>"u");function Og(){const e=Ve();return Q.useCallback(i=>{const{nodeExtent:o,snapToGrid:u,snapGrid:S,nodesDraggable:w,onError:a,updateNodePositions:l,nodeLookup:p,nodeOrigin:v}=e.getState(),c=new Map,m=Px(w),C=u?S[0]:5,b=u?S[1]:5,x=i.direction.x*C*i.factor,f=i.direction.y*b*i.factor;for(const[,_]of p){if(!m(_))continue;let d={x:_.internals.positionAbsolute.x+x,y:_.internals.positionAbsolute.y+f};u&&(d=As(d,S));const{position:h,positionAbsolute:y}=ig({nodeId:_.id,nextPosition:d,nodeLookup:p,nodeExtent:o,nodeOrigin:v,onError:a});_.position=h,_.internals.positionAbsolute=y,c.set(_.id,_)}l(c)},[])}const hh=Q.createContext(null),Nx=hh.Provider;hh.Consumer;const Hg=()=>Q.useContext(hh),Bx=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Ix=(e,r,i)=>o=>{const{connectionClickStartHandle:u,connectionMode:S,connection:w}=o,{fromHandle:a,toHandle:l,isValid:p}=w,v=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===r&&(l==null?void 0:l.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===hi.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&&p}};function Ox({type:e="source",position:r=xe.Top,isValidConnection:i,isConnectable:o=!0,isConnectableStart:u=!0,isConnectableEnd:S=!0,id:w,onConnect:a,children:l,className:p,onMouseDown:v,onTouchStart:c,...m},C){var q,U;const b=w||null,x=e==="target",f=Ve(),_=Hg(),{connectOnClick:d,noPanClassName:h,rfId:y}=Ae(Bx,Ue),{connectingFrom:k,connectingTo:R,clickConnecting:D,isPossibleEndHandle:L,connectionInProcess:M,clickConnectionInProcess:W,valid:z}=Ae(Ix(_,b,e),Ue);_||(U=(q=f.getState()).onError)==null||U.call(q,"010",fr.error010());const F=K=>{const{defaultEdgeOptions:V,onConnect:A,hasDefaultEdges:I}=f.getState(),P={...V,...K};if(I){const{edges:j,setEdges:Y}=f.getState();Y(rC(P,j))}A==null||A(P),a==null||a(P)},B=K=>{if(!_)return;const V=dg(K.nativeEvent);if(u&&(V&&K.button===0||!V)){const A=f.getState();Nu.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:x,handleId:b,nodeId:_,flowId:A.rfId,panBy:A.panBy,cancelConnection:A.cancelConnection,onConnectStart:A.onConnectStart,onConnectEnd:(...I)=>{var P,j;return(j=(P=f.getState()).onConnectEnd)==null?void 0:j.call(P,...I)},updateConnection:A.updateConnection,onConnect:F,isValidConnection:i||((...I)=>{var P,j;return((j=(P=f.getState()).isValidConnection)==null?void 0:j.call(P,...I))??!0}),getTransform:()=>f.getState().transform,getFromHandle:()=>f.getState().connection.fromHandle,autoPanSpeed:A.autoPanSpeed,dragThreshold:A.connectionDragThreshold})}V?v==null||v(K):c==null||c(K)},O=K=>{const{onClickConnectStart:V,onClickConnectEnd:A,connectionClickStartHandle:I,connectionMode:P,isValidConnection:j,lib:Y,rfId:Z,nodeLookup:ie,connection:ae}=f.getState();if(!_||!I&&!u)return;if(!I){V==null||V(K.nativeEvent,{nodeId:_,handleId:b,handleType:e}),f.setState({connectionClickStartHandle:{nodeId:_,type:e,id:b}});return}const X=ug(K.target),H=i||j,{connection:re,isValid:te}=Nu.isValid(K.nativeEvent,{handle:{nodeId:_,id:b,type:e},connectionMode:P,fromNodeId:I.nodeId,fromHandleId:I.id||null,fromType:I.type,isValidConnection:H,flowId:Z,doc:X,lib:Y,nodeLookup:ie});te&&re&&F(re);const ue=structuredClone(ae);delete ue.inProgress,ue.toPosition=ue.toHandle?ue.toHandle.position:null,A==null||A(K,ue),f.setState({connectionClickStartHandle:null})};return N.jsx("div",{"data-handleid":b,"data-nodeid":_,"data-handlepos":r,"data-id":`${y}-${_}-${b}-${e}`,className:rt(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",h,p,{source:!x,target:x,connectable:o,connectablestart:u,connectableend:S,clickconnecting:D,connectingfrom:k,connectingto:R,valid:z,connectionindicator:o&&(!M||L)&&(M||W?S:u)}]),onMouseDown:B,onTouchStart:B,onClick:d?O:void 0,ref:C,...m,children:l})}const gi=Q.memo(Ng(Ox));function Hx({data:e,isConnectable:r,sourcePosition:i=xe.Bottom}){return N.jsxs(N.Fragment,{children:[e==null?void 0:e.label,N.jsx(gi,{type:"source",position:i,isConnectable:r})]})}function jx({data:e,isConnectable:r,targetPosition:i=xe.Top,sourcePosition:o=xe.Bottom}){return N.jsxs(N.Fragment,{children:[N.jsx(gi,{type:"target",position:i,isConnectable:r}),e==null?void 0:e.label,N.jsx(gi,{type:"source",position:o,isConnectable:r})]})}function Fx(){return null}function zx({data:e,isConnectable:r,targetPosition:i=xe.Top}){return N.jsxs(N.Fragment,{children:[N.jsx(gi,{type:"target",position:i,isConnectable:r}),e==null?void 0:e.label]})}const Aa={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},qp={input:Hx,default:jx,output:zx,group:Fx};function $x(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 Wx=e=>{const{width:r,height:i,x:o,y:u}=Ts(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 Ux({onSelectionContextMenu:e,noPanClassName:r,disableKeyboardA11y:i}){const o=Ve(),{width:u,height:S,transformString:w,userSelectionActive:a}=Ae(Wx,Ue),l=Og(),p=Q.useRef(null);Q.useEffect(()=>{var C;i||(C=p.current)==null||C.focus({preventScroll:!0})},[i]);const v=!a&&u!==null&&S!==null;if(Ig({nodeRef:p,disabled:!v}),!v)return null;const c=e?C=>{const b=o.getState().nodes.filter(x=>x.selected);e(C,b)}:void 0,m=C=>{Object.prototype.hasOwnProperty.call(Aa,C.key)&&(C.preventDefault(),l({direction:Aa[C.key],factor:C.shiftKey?4:1}))};return N.jsx("div",{className:rt(["react-flow__nodesselection","react-flow__container",r]),style:{transform:w},children:N.jsx("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:c,tabIndex:i?void 0:-1,onKeyDown:i?void 0:m,style:{width:u,height:S}})})}const Kp=typeof window<"u"?window:void 0,Vx=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function jg({children:e,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:o,onPaneMouseLeave:u,onPaneContextMenu:S,onPaneScroll:w,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:p,selectionOnDrag:v,selectionMode:c,onSelectionStart:m,onSelectionEnd:C,multiSelectionKeyCode:b,panActivationKeyCode:x,zoomActivationKeyCode:f,elementsSelectable:_,zoomOnScroll:d,zoomOnPinch:h,panOnScroll:y,panOnScrollSpeed:k,panOnScrollMode:R,zoomOnDoubleClick:D,panOnDrag:L,defaultViewport:M,translateExtent:W,minZoom:z,maxZoom:F,preventScrolling:B,onSelectionContextMenu:O,noWheelClassName:q,noPanClassName:U,disableKeyboardA11y:K,onViewportChange:V,isControlledViewport:A}){const{nodesSelectionActive:I,userSelectionActive:P}=Ae(Vx,Ue),j=Es(p,{target:Kp}),Y=Es(x,{target:Kp}),Z=Y||L,ie=Y||y,ae=v&&Z!==!0,X=j||P||ae;return Ex({deleteKeyCode:l,multiSelectionKeyCode:b}),N.jsx(Rx,{onPaneContextMenu:S,elementsSelectable:_,zoomOnScroll:d,zoomOnPinch:h,panOnScroll:ie,panOnScrollSpeed:k,panOnScrollMode:R,zoomOnDoubleClick:D,panOnDrag:!j&&Z,defaultViewport:M,translateExtent:W,minZoom:z,maxZoom:F,zoomActivationKeyCode:f,preventScrolling:B,noWheelClassName:q,noPanClassName:U,onViewportChange:V,isControlledViewport:A,paneClickDistance:a,selectionOnDrag:ae,children:N.jsxs(Mx,{onSelectionStart:m,onSelectionEnd:C,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:o,onPaneMouseLeave:u,onPaneContextMenu:S,onPaneScroll:w,panOnDrag:Z,isSelecting:!!X,selectionMode:c,selectionKeyPressed:j,paneClickDistance:a,selectionOnDrag:ae,children:[e,I&&N.jsx(Ux,{onSelectionContextMenu:O,noPanClassName:U,disableKeyboardA11y:K})]})})}jg.displayName="FlowRenderer";const qx=Q.memo(jg),Kx=e=>r=>e?rh(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 Xx(e){return Ae(Q.useCallback(Kx(e),[e]),Ue)}const Yx=e=>e.updateNodeInternals;function Gx(){const e=Ae(Yx),[r]=Q.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 Q.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function Qx({node:e,nodeType:r,hasDimensions:i,resizeObserver:o}){const u=Ve(),S=Q.useRef(null),w=Q.useRef(null),a=Q.useRef(e.sourcePosition),l=Q.useRef(e.targetPosition),p=Q.useRef(r),v=i&&!!e.internals.handleBounds;return Q.useEffect(()=>{S.current&&!e.hidden&&(!v||w.current!==S.current)&&(w.current&&(o==null||o.unobserve(w.current)),o==null||o.observe(S.current),w.current=S.current)},[v,e.hidden]),Q.useEffect(()=>()=>{w.current&&(o==null||o.unobserve(w.current),w.current=null)},[]),Q.useEffect(()=>{if(S.current){const c=p.current!==r,m=a.current!==e.sourcePosition,C=l.current!==e.targetPosition;(c||m||C)&&(p.current=r,a.current=e.sourcePosition,l.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 Jx({id:e,onClick:r,onMouseEnter:i,onMouseMove:o,onMouseLeave:u,onContextMenu:S,onDoubleClick:w,nodesDraggable:a,elementsSelectable:l,nodesConnectable:p,nodesFocusable:v,resizeObserver:c,noDragClassName:m,noPanClassName:C,disableKeyboardA11y:b,rfId:x,nodeTypes:f,nodeClickDistance:_,onError:d}){const{node:h,internals:y,isParent:k}=Ae(H=>{const re=H.nodeLookup.get(e),te=H.parentLookup.has(e);return{node:re,internals:re.internals,isParent:te}},Ue);let R=h.type||"default",D=(f==null?void 0:f[R])||qp[R];D===void 0&&(d==null||d("003",fr.error003(R)),R="default",D=(f==null?void 0:f.default)||qp.default);const L=!!(h.draggable||a&&typeof h.draggable>"u"),M=!!(h.selectable||l&&typeof h.selectable>"u"),W=!!(h.connectable||p&&typeof h.connectable>"u"),z=!!(h.focusable||v&&typeof h.focusable>"u"),F=Ve(),B=lg(h),O=Qx({node:h,nodeType:R,hasDimensions:B,resizeObserver:c}),q=Ig({nodeRef:O,disabled:h.hidden||!L,noDragClassName:m,handleSelector:h.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:_}),U=Og();if(h.hidden)return null;const K=Rr(h),V=$x(h),A=M||L||r||i||o||u,I=i?H=>i(H,{...y.userNode}):void 0,P=o?H=>o(H,{...y.userNode}):void 0,j=u?H=>u(H,{...y.userNode}):void 0,Y=S?H=>S(H,{...y.userNode}):void 0,Z=w?H=>w(H,{...y.userNode}):void 0,ie=H=>{const{selectNodesOnDrag:re,nodeDragThreshold:te}=F.getState();M&&(!re||!L||te>0)&&Iu({id:e,store:F,nodeRef:O}),r&&r(H,{...y.userNode})},ae=H=>{if(!(hg(H.nativeEvent)||b)){if(Z_.includes(H.key)&&M){const re=H.key==="Escape";Iu({id:e,store:F,unselect:re,nodeRef:O})}else if(L&&h.selected&&Object.prototype.hasOwnProperty.call(Aa,H.key)){H.preventDefault();const{ariaLabelConfig:re}=F.getState();F.setState({ariaLiveMessage:re["node.a11yDescription.ariaLiveMessage"]({direction:H.key.replace("Arrow","").toLowerCase(),x:~~y.positionAbsolute.x,y:~~y.positionAbsolute.y})}),U({direction:Aa[H.key],factor:H.shiftKey?4:1})}}},X=()=>{var Se;if(b||!((Se=O.current)!=null&&Se.matches(":focus-visible")))return;const{transform:H,width:re,height:te,autoPanOnNodeFocus:ue,setCenter:le}=F.getState();if(!ue)return;rh(new Map([[e,h]]),{x:0,y:0,width:re,height:te},H,!0).length>0||le(h.position.x+K.width/2,h.position.y+K.height/2,{zoom:H[2]})};return N.jsx("div",{className:rt(["react-flow__node",`react-flow__node-${R}`,{[C]:L},h.className,{selected:h.selected,selectable:M,parent:k,draggable:L,dragging:q}]),ref:O,style:{zIndex:y.z,transform:`translate(${y.positionAbsolute.x}px,${y.positionAbsolute.y}px)`,pointerEvents:A?"all":"none",visibility:B?"visible":"hidden",...h.style,...V},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:P,onMouseLeave:j,onContextMenu:Y,onClick:ie,onDoubleClick:Z,onKeyDown:z?ae: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:`${Tg}-${x}`,"aria-label":h.ariaLabel,...h.domAttributes,children:N.jsx(Nx,{value:e,children:N.jsx(D,{id:e,data:h.data,type:R,positionAbsoluteX:y.positionAbsolute.x,positionAbsoluteY:y.positionAbsolute.y,selected:h.selected??!1,selectable:M,draggable:L,deletable:h.deletable??!0,isConnectable:W,sourcePosition:h.sourcePosition,targetPosition:h.targetPosition,dragging:q,dragHandle:h.dragHandle,zIndex:y.z,parentId:h.parentId,...K})})})}var Zx=Q.memo(Jx);const e2=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Fg(e){const{nodesDraggable:r,nodesConnectable:i,nodesFocusable:o,elementsSelectable:u,onError:S}=Ae(e2,Ue),w=Xx(e.onlyRenderVisibleElements),a=Gx();return N.jsx("div",{className:"react-flow__nodes",style:qa,children:w.map(l=>N.jsx(Zx,{id:l,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},l))})}Fg.displayName="NodeRenderer";const t2=Q.memo(Fg);function r2(e){return Ae(Q.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),w=i.nodeLookup.get(u.target);S&&w&&ZS({sourceNode:S,targetNode:w,width:i.width,height:i.height,transform:i.transform})&&o.push(u.id)}return o},[e]),Ue)}const n2=({color:e="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...e&&{stroke:e}};return N.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},i2=({color:e="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...e&&{stroke:e,fill:e}};return N.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Xp={[Ra.Arrow]:n2,[Ra.ArrowClosed]:i2};function s2(e){const r=Ve();return Q.useMemo(()=>{var u,S;return Object.prototype.hasOwnProperty.call(Xp,e)?Xp[e]:((S=(u=r.getState()).onError)==null||S.call(u,"009",fr.error009(e)),null)},[e])}const o2=({id:e,type:r,color:i,width:o=12.5,height:u=12.5,markerUnits:S="strokeWidth",strokeWidth:w,orient:a="auto-start-reverse"})=>{const l=s2(r);return l?N.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:N.jsx(l,{color:i,strokeWidth:w})}):null},zg=({defaultColor:e,rfId:r})=>{const i=Ae(S=>S.edges),o=Ae(S=>S.defaultEdgeOptions),u=Q.useMemo(()=>aC(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?N.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:N.jsx("defs",{children:u.map(S=>N.jsx(o2,{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};zg.displayName="MarkerDefinitions";var a2=Q.memo(zg);function $g({x:e,y:r,label:i,labelStyle:o,labelShowBg:u=!0,labelBgStyle:S,labelBgPadding:w=[2,4],labelBgBorderRadius:a=2,children:l,className:p,...v}){const[c,m]=Q.useState({x:1,y:0,width:0,height:0}),C=rt(["react-flow__edge-textwrapper",p]),b=Q.useRef(null);return Q.useEffect(()=>{if(b.current){const x=b.current.getBBox();m({x:x.x,y:x.y,width:x.width,height:x.height})}},[i]),i?N.jsxs("g",{transform:`translate(${e-c.width/2} ${r-c.height/2})`,className:C,visibility:c.width?"visible":"hidden",...v,children:[u&&N.jsx("rect",{width:c.width+2*w[0],x:-w[0],y:-w[1],height:c.height+2*w[1],className:"react-flow__edge-textbg",style:S,rx:a,ry:a}),N.jsx("text",{className:"react-flow__edge-text",y:c.height/2,dy:"0.3em",ref:b,style:o,children:i}),l]}):null}$g.displayName="EdgeText";const l2=Q.memo($g);function Ka({path:e,labelX:r,labelY:i,label:o,labelStyle:u,labelShowBg:S,labelBgStyle:w,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:p=20,...v}){return N.jsxs(N.Fragment,{children:[N.jsx("path",{...v,d:e,fill:"none",className:rt(["react-flow__edge-path",v.className])}),p?N.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}):null,o&&Zt(r)&&Zt(i)?N.jsx(l2,{x:r,y:i,label:o,labelStyle:u,labelShowBg:S,labelBgStyle:w,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function Yp({pos:e,x1:r,y1:i,x2:o,y2:u}){return e===xe.Left||e===xe.Right?[.5*(r+o),i]:[r,.5*(i+u)]}function Wg({sourceX:e,sourceY:r,sourcePosition:i=xe.Bottom,targetX:o,targetY:u,targetPosition:S=xe.Top}){const[w,a]=Yp({pos:i,x1:e,y1:r,x2:o,y2:u}),[l,p]=Yp({pos:S,x1:o,y1:u,x2:e,y2:r}),[v,c,m,C]=fg({sourceX:e,sourceY:r,targetX:o,targetY:u,sourceControlX:w,sourceControlY:a,targetControlX:l,targetControlY:p});return[`M${e},${r} C${w},${a} ${l},${p} ${o},${u}`,v,c,m,C]}function Ug(e){return Q.memo(({id:r,sourceX:i,sourceY:o,targetX:u,targetY:S,sourcePosition:w,targetPosition:a,label:l,labelStyle:p,labelShowBg:v,labelBgStyle:c,labelBgPadding:m,labelBgBorderRadius:C,style:b,markerEnd:x,markerStart:f,interactionWidth:_})=>{const[d,h,y]=Wg({sourceX:i,sourceY:o,sourcePosition:w,targetX:u,targetY:S,targetPosition:a}),k=e.isInternal?void 0:r;return N.jsx(Ka,{id:k,path:d,labelX:h,labelY:y,label:l,labelStyle:p,labelShowBg:v,labelBgStyle:c,labelBgPadding:m,labelBgBorderRadius:C,style:b,markerEnd:x,markerStart:f,interactionWidth:_})})}const c2=Ug({isInternal:!1}),Vg=Ug({isInternal:!0});c2.displayName="SimpleBezierEdge";Vg.displayName="SimpleBezierEdgeInternal";function qg(e){return Q.memo(({id:r,sourceX:i,sourceY:o,targetX:u,targetY:S,label:w,labelStyle:a,labelShowBg:l,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:c,style:m,sourcePosition:C=xe.Bottom,targetPosition:b=xe.Top,markerEnd:x,markerStart:f,pathOptions:_,interactionWidth:d})=>{const[h,y,k]=Au({sourceX:i,sourceY:o,sourcePosition:C,targetX:u,targetY:S,targetPosition:b,borderRadius:_==null?void 0:_.borderRadius,offset:_==null?void 0:_.offset,stepPosition:_==null?void 0:_.stepPosition}),R=e.isInternal?void 0:r;return N.jsx(Ka,{id:R,path:h,labelX:y,labelY:k,label:w,labelStyle:a,labelShowBg:l,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:c,style:m,markerEnd:x,markerStart:f,interactionWidth:d})})}const Kg=qg({isInternal:!1}),Xg=qg({isInternal:!0});Kg.displayName="SmoothStepEdge";Xg.displayName="SmoothStepEdgeInternal";function Yg(e){return Q.memo(({id:r,...i})=>{var u;const o=e.isInternal?void 0:r;return N.jsx(Kg,{...i,id:o,pathOptions:Q.useMemo(()=>{var S;return{borderRadius:0,offset:(S=i.pathOptions)==null?void 0:S.offset}},[(u=i.pathOptions)==null?void 0:u.offset])})})}const u2=Yg({isInternal:!1}),Gg=Yg({isInternal:!0});u2.displayName="StepEdge";Gg.displayName="StepEdgeInternal";function Qg(e){return Q.memo(({id:r,sourceX:i,sourceY:o,targetX:u,targetY:S,label:w,labelStyle:a,labelShowBg:l,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:c,style:m,markerEnd:C,markerStart:b,interactionWidth:x})=>{const[f,_,d]=gg({sourceX:i,sourceY:o,targetX:u,targetY:S}),h=e.isInternal?void 0:r;return N.jsx(Ka,{id:h,path:f,labelX:_,labelY:d,label:w,labelStyle:a,labelShowBg:l,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:c,style:m,markerEnd:C,markerStart:b,interactionWidth:x})})}const h2=Qg({isInternal:!1}),Jg=Qg({isInternal:!0});h2.displayName="StraightEdge";Jg.displayName="StraightEdgeInternal";function Zg(e){return Q.memo(({id:r,sourceX:i,sourceY:o,targetX:u,targetY:S,sourcePosition:w=xe.Bottom,targetPosition:a=xe.Top,label:l,labelStyle:p,labelShowBg:v,labelBgStyle:c,labelBgPadding:m,labelBgBorderRadius:C,style:b,markerEnd:x,markerStart:f,pathOptions:_,interactionWidth:d})=>{const[h,y,k]=pg({sourceX:i,sourceY:o,sourcePosition:w,targetX:u,targetY:S,targetPosition:a,curvature:_==null?void 0:_.curvature}),R=e.isInternal?void 0:r;return N.jsx(Ka,{id:R,path:h,labelX:y,labelY:k,label:l,labelStyle:p,labelShowBg:v,labelBgStyle:c,labelBgPadding:m,labelBgBorderRadius:C,style:b,markerEnd:x,markerStart:f,interactionWidth:d})})}const d2=Zg({isInternal:!1}),em=Zg({isInternal:!0});d2.displayName="BezierEdge";em.displayName="BezierEdgeInternal";const Gp={default:em,straight:Jg,step:Gg,smoothstep:Xg,simplebezier:Vg},Qp={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},f2=(e,r,i)=>i===xe.Left?e-r:i===xe.Right?e+r:e,p2=(e,r,i)=>i===xe.Top?e-r:i===xe.Bottom?e+r:e,Jp="react-flow__edgeupdater";function Zp({position:e,centerX:r,centerY:i,radius:o=10,onMouseDown:u,onMouseEnter:S,onMouseOut:w,type:a}){return N.jsx("circle",{onMouseDown:u,onMouseEnter:S,onMouseOut:w,className:rt([Jp,`${Jp}-${a}`]),cx:f2(r,o,e),cy:p2(i,o,e),r:o,stroke:"transparent",fill:"transparent"})}function _2({isReconnectable:e,reconnectRadius:r,edge:i,sourceX:o,sourceY:u,targetX:S,targetY:w,sourcePosition:a,targetPosition:l,onReconnect:p,onReconnectStart:v,onReconnectEnd:c,setReconnecting:m,setUpdateHover:C}){const b=Ve(),x=(y,k)=>{if(y.button!==0)return;const{autoPanOnConnect:R,domNode:D,connectionMode:L,connectionRadius:M,lib:W,onConnectStart:z,cancelConnection:F,nodeLookup:B,rfId:O,panBy:q,updateConnection:U}=b.getState(),K=k.type==="target",V=(P,j)=>{m(!1),c==null||c(P,i,k.type,j)},A=P=>p==null?void 0:p(i,P),I=(P,j)=>{m(!0),v==null||v(y,i,k.type),z==null||z(P,j)};Nu.onPointerDown(y.nativeEvent,{autoPanOnConnect:R,connectionMode:L,connectionRadius:M,domNode:D,handleId:k.id,nodeId:k.nodeId,nodeLookup:B,isTarget:K,edgeUpdaterType:k.type,lib:W,flowId:O,cancelConnection:F,panBy:q,isValidConnection:(...P)=>{var j,Y;return((Y=(j=b.getState()).isValidConnection)==null?void 0:Y.call(j,...P))??!0},onConnect:A,onConnectStart:I,onConnectEnd:(...P)=>{var j,Y;return(Y=(j=b.getState()).onConnectEnd)==null?void 0:Y.call(j,...P)},onReconnectEnd:V,updateConnection:U,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:y.currentTarget})},f=y=>x(y,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),_=y=>x(y,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),d=()=>C(!0),h=()=>C(!1);return N.jsxs(N.Fragment,{children:[(e===!0||e==="source")&&N.jsx(Zp,{position:a,centerX:o,centerY:u,radius:r,onMouseDown:f,onMouseEnter:d,onMouseOut:h,type:"source"}),(e===!0||e==="target")&&N.jsx(Zp,{position:l,centerX:S,centerY:w,radius:r,onMouseDown:_,onMouseEnter:d,onMouseOut:h,type:"target"})]})}function g2({id:e,edgesFocusable:r,edgesReconnectable:i,elementsSelectable:o,onClick:u,onDoubleClick:S,onContextMenu:w,onMouseEnter:a,onMouseMove:l,onMouseLeave:p,reconnectRadius:v,onReconnect:c,onReconnectStart:m,onReconnectEnd:C,rfId:b,edgeTypes:x,noPanClassName:f,onError:_,disableKeyboardA11y:d}){let h=Ae(le=>le.edgeLookup.get(e));const y=Ae(le=>le.defaultEdgeOptions);h=y?{...y,...h}:h;let k=h.type||"default",R=(x==null?void 0:x[k])||Gp[k];R===void 0&&(_==null||_("011",fr.error011(k)),k="default",R=(x==null?void 0:x.default)||Gp.default);const D=!!(h.focusable||r&&typeof h.focusable>"u"),L=typeof c<"u"&&(h.reconnectable||i&&typeof h.reconnectable>"u"),M=!!(h.selectable||o&&typeof h.selectable>"u"),W=Q.useRef(null),[z,F]=Q.useState(!1),[B,O]=Q.useState(!1),q=Ve(),{zIndex:U,sourceX:K,sourceY:V,targetX:A,targetY:I,sourcePosition:P,targetPosition:j}=Ae(Q.useCallback(le=>{const pe=le.nodeLookup.get(h.source),Se=le.nodeLookup.get(h.target);if(!pe||!Se)return{zIndex:h.zIndex,...Qp};const be=oC({id:e,sourceNode:pe,targetNode:Se,sourceHandle:h.sourceHandle||null,targetHandle:h.targetHandle||null,connectionMode:le.connectionMode,onError:_});return{zIndex:JS({selected:h.selected,zIndex:h.zIndex,sourceNode:pe,targetNode:Se,elevateOnSelect:le.elevateEdgesOnSelect,zIndexMode:le.zIndexMode}),...be||Qp}},[h.source,h.target,h.sourceHandle,h.targetHandle,h.selected,h.zIndex]),Ue),Y=Q.useMemo(()=>h.markerStart?`url('#${Mu(h.markerStart,b)}')`:void 0,[h.markerStart,b]),Z=Q.useMemo(()=>h.markerEnd?`url('#${Mu(h.markerEnd,b)}')`:void 0,[h.markerEnd,b]);if(h.hidden||K===null||V===null||A===null||I===null)return null;const ie=le=>{var ce;const{addSelectedEdges:pe,unselectNodesAndEdges:Se,multiSelectionActive:be}=q.getState();M&&(q.setState({nodesSelectionActive:!1}),h.selected&&be?(Se({nodes:[],edges:[h]}),(ce=W.current)==null||ce.blur()):pe([e])),u&&u(le,h)},ae=S?le=>{S(le,{...h})}:void 0,X=w?le=>{w(le,{...h})}:void 0,H=a?le=>{a(le,{...h})}:void 0,re=l?le=>{l(le,{...h})}:void 0,te=p?le=>{p(le,{...h})}:void 0,ue=le=>{var pe;if(!d&&Z_.includes(le.key)&&M){const{unselectNodesAndEdges:Se,addSelectedEdges:be}=q.getState();le.key==="Escape"?((pe=W.current)==null||pe.blur(),Se({edges:[h]})):be([e])}};return N.jsx("svg",{style:{zIndex:U},children:N.jsxs("g",{className:rt(["react-flow__edge",`react-flow__edge-${k}`,h.className,f,{selected:h.selected,animated:h.animated,inactive:!M&&!u,updating:z,selectable:M}]),onClick:ie,onDoubleClick:ae,onContextMenu:X,onMouseEnter:H,onMouseMove:re,onMouseLeave:te,onKeyDown:D?ue: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?`${Ag}-${b}`:void 0,ref:W,...h.domAttributes,children:[!B&&N.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:V,targetX:A,targetY:I,sourcePosition:P,targetPosition:j,data:h.data,style:h.style,sourceHandleId:h.sourceHandle,targetHandleId:h.targetHandle,markerStart:Y,markerEnd:Z,pathOptions:"pathOptions"in h?h.pathOptions:void 0,interactionWidth:h.interactionWidth}),L&&N.jsx(_2,{edge:h,isReconnectable:L,reconnectRadius:v,onReconnect:c,onReconnectStart:m,onReconnectEnd:C,sourceX:K,sourceY:V,targetX:A,targetY:I,sourcePosition:P,targetPosition:j,setUpdateHover:F,setReconnecting:O})]})})}var m2=Q.memo(g2);const v2=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function tm({defaultMarkerColor:e,onlyRenderVisibleElements:r,rfId:i,edgeTypes:o,noPanClassName:u,onReconnect:S,onEdgeContextMenu:w,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:p,onEdgeClick:v,reconnectRadius:c,onEdgeDoubleClick:m,onReconnectStart:C,onReconnectEnd:b,disableKeyboardA11y:x}){const{edgesFocusable:f,edgesReconnectable:_,elementsSelectable:d,onError:h}=Ae(v2,Ue),y=r2(r);return N.jsxs("div",{className:"react-flow__edges",children:[N.jsx(a2,{defaultColor:e,rfId:i}),y.map(k=>N.jsx(m2,{id:k,edgesFocusable:f,edgesReconnectable:_,elementsSelectable:d,noPanClassName:u,onReconnect:S,onContextMenu:w,onMouseEnter:a,onMouseMove:l,onMouseLeave:p,onClick:v,reconnectRadius:c,onDoubleClick:m,onReconnectStart:C,onReconnectEnd:b,rfId:i,onError:h,edgeTypes:o,disableKeyboardA11y:x},k))]})}tm.displayName="EdgeRenderer";const y2=Q.memo(tm),w2=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function S2({children:e}){const r=Ae(w2);return N.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:e})}function C2(e){const r=uh(),i=Q.useRef(!1);Q.useEffect(()=>{!i.current&&r.viewportInitialized&&e&&(setTimeout(()=>e(r),1),i.current=!0)},[e,r.viewportInitialized])}const x2=e=>{var r;return(r=e.panZoom)==null?void 0:r.syncViewport};function b2(e){const r=Ae(x2),i=Ve();return Q.useEffect(()=>{e&&(r==null||r(e),i.setState({transform:[e.x,e.y,e.zoom]}))},[e,r]),null}function E2(e){return e.connection.inProgress?{...e.connection,to:Ms(e.connection.to,e.transform)}:{...e.connection}}function k2(e){return E2}function L2(e){const r=k2();return Ae(r,Ue)}const R2=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function D2({containerStyle:e,style:r,type:i,component:o}){const{nodesConnectable:u,width:S,height:w,isValid:a,inProgress:l}=Ae(R2,Ue);return!(S&&u&&l)?null:N.jsx("svg",{style:e,width:S,height:w,className:"react-flow__connectionline react-flow__container",children:N.jsx("g",{className:rt(["react-flow__connection",rg(a)]),children:N.jsx(rm,{style:r,type:i,CustomComponent:o,isValid:a})})})}const rm=({style:e,type:r=Zr.Bezier,CustomComponent:i,isValid:o})=>{const{inProgress:u,from:S,fromNode:w,fromHandle:a,fromPosition:l,to:p,toNode:v,toHandle:c,toPosition:m,pointer:C}=L2();if(!u)return;if(i)return N.jsx(i,{connectionLineType:r,connectionLineStyle:e,fromNode:w,fromHandle:a,fromX:S.x,fromY:S.y,toX:p.x,toY:p.y,fromPosition:l,toPosition:m,connectionStatus:rg(o),toNode:v,toHandle:c,pointer:C});let b="";const x={sourceX:S.x,sourceY:S.y,sourcePosition:l,targetX:p.x,targetY:p.y,targetPosition:m};switch(r){case Zr.Bezier:[b]=pg(x);break;case Zr.SimpleBezier:[b]=Wg(x);break;case Zr.Step:[b]=Au({...x,borderRadius:0});break;case Zr.SmoothStep:[b]=Au(x);break;default:[b]=gg(x)}return N.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};rm.displayName="ConnectionLine";const T2={};function e_(e=T2){Q.useRef(e),Ve(),Q.useEffect(()=>{},[e])}function A2(){Ve(),Q.useRef(!1),Q.useEffect(()=>{},[])}function nm({nodeTypes:e,edgeTypes:r,onInit:i,onNodeClick:o,onEdgeClick:u,onNodeDoubleClick:S,onEdgeDoubleClick:w,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:p,onNodeContextMenu:v,onSelectionContextMenu:c,onSelectionStart:m,onSelectionEnd:C,connectionLineType:b,connectionLineStyle:x,connectionLineComponent:f,connectionLineContainerStyle:_,selectionKeyCode:d,selectionOnDrag:h,selectionMode:y,multiSelectionKeyCode:k,panActivationKeyCode:R,zoomActivationKeyCode:D,deleteKeyCode:L,onlyRenderVisibleElements:M,elementsSelectable:W,defaultViewport:z,translateExtent:F,minZoom:B,maxZoom:O,preventScrolling:q,defaultMarkerColor:U,zoomOnScroll:K,zoomOnPinch:V,panOnScroll:A,panOnScrollSpeed:I,panOnScrollMode:P,zoomOnDoubleClick:j,panOnDrag:Y,onPaneClick:Z,onPaneMouseEnter:ie,onPaneMouseMove:ae,onPaneMouseLeave:X,onPaneScroll:H,onPaneContextMenu:re,paneClickDistance:te,nodeClickDistance:ue,onEdgeContextMenu:le,onEdgeMouseEnter:pe,onEdgeMouseMove:Se,onEdgeMouseLeave:be,reconnectRadius:ce,onReconnect:ge,onReconnectStart:Re,onReconnectEnd:Ie,noDragClassName:ze,noWheelClassName:Qe,noPanClassName:ut,disableKeyboardA11y:qe,nodeExtent:pt,rfId:Ne,viewport:Je,onViewportChange:ht}){return e_(e),e_(r),A2(),C2(i),b2(Je),N.jsx(qx,{onPaneClick:Z,onPaneMouseEnter:ie,onPaneMouseMove:ae,onPaneMouseLeave:X,onPaneContextMenu:re,onPaneScroll:H,paneClickDistance:te,deleteKeyCode:L,selectionKeyCode:d,selectionOnDrag:h,selectionMode:y,onSelectionStart:m,onSelectionEnd:C,multiSelectionKeyCode:k,panActivationKeyCode:R,zoomActivationKeyCode:D,elementsSelectable:W,zoomOnScroll:K,zoomOnPinch:V,zoomOnDoubleClick:j,panOnScroll:A,panOnScrollSpeed:I,panOnScrollMode:P,panOnDrag:Y,defaultViewport:z,translateExtent:F,minZoom:B,maxZoom:O,onSelectionContextMenu:c,preventScrolling:q,noDragClassName:ze,noWheelClassName:Qe,noPanClassName:ut,disableKeyboardA11y:qe,onViewportChange:ht,isControlledViewport:!!Je,children:N.jsxs(S2,{children:[N.jsx(y2,{edgeTypes:r,onEdgeClick:u,onEdgeDoubleClick:w,onReconnect:ge,onReconnectStart:Re,onReconnectEnd:Ie,onlyRenderVisibleElements:M,onEdgeContextMenu:le,onEdgeMouseEnter:pe,onEdgeMouseMove:Se,onEdgeMouseLeave:be,reconnectRadius:ce,defaultMarkerColor:U,noPanClassName:ut,disableKeyboardA11y:qe,rfId:Ne}),N.jsx(D2,{style:x,type:b,component:f,containerStyle:_}),N.jsx("div",{className:"react-flow__edgelabel-renderer"}),N.jsx(t2,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:S,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:p,onNodeContextMenu:v,nodeClickDistance:ue,onlyRenderVisibleElements:M,noPanClassName:ut,noDragClassName:ze,disableKeyboardA11y:qe,nodeExtent:pt,rfId:Ne}),N.jsx("div",{className:"react-flow__viewport-portal"})]})})}nm.displayName="GraphView";const M2=Q.memo(nm),t_=({nodes:e,edges:r,defaultNodes:i,defaultEdges:o,width:u,height:S,fitView:w,fitViewOptions:a,minZoom:l=.5,maxZoom:p=2,nodeOrigin:v,nodeExtent:c,zIndexMode:m="basic"}={})=>{const C=new Map,b=new Map,x=new Map,f=new Map,_=o??r??[],d=i??e??[],h=v??[0,0],y=c??Ss;yg(x,f,_);const{nodesInitialized:k}=Pu(d,C,b,{nodeOrigin:h,nodeExtent:y,zIndexMode:m});let R=[0,0,1];if(w&&u&&S){const D=Ts(C,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:L,y:M,zoom:W}=nh(D,u,S,l,p,(a==null?void 0:a.padding)??.1);R=[L,M,W]}return{rfId:"1",width:u??0,height:S??0,transform:R,nodes:d,nodesInitialized:k,nodeLookup:C,parentLookup:b,edges:_,edgeLookup:f,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:l,maxZoom:p,translateExtent:Ss,nodeExtent:y,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:hi.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:w??!1,fitViewOptions:a,fitViewResolver:null,connection:{...tg},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:qS,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:eg,zIndexMode:m,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},P2=({nodes:e,edges:r,defaultNodes:i,defaultEdges:o,width:u,height:S,fitView:w,fitViewOptions:a,minZoom:l,maxZoom:p,nodeOrigin:v,nodeExtent:c,zIndexMode:m})=>GC((C,b)=>{async function x(){const{nodeLookup:f,panZoom:_,fitViewOptions:d,fitViewResolver:h,width:y,height:k,minZoom:R,maxZoom:D}=b();_&&(await US({nodes:f,width:y,height:k,panZoom:_,minZoom:R,maxZoom:D},d),h==null||h.resolve(!0),C({fitViewResolver:null}))}return{...t_({nodes:e,edges:r,width:u,height:S,fitView:w,fitViewOptions:a,minZoom:l,maxZoom:p,nodeOrigin:v,nodeExtent:c,defaultNodes:i,defaultEdges:o,zIndexMode:m}),setNodes:f=>{const{nodeLookup:_,parentLookup:d,nodeOrigin:h,elevateNodesOnSelect:y,fitViewQueued:k,zIndexMode:R,nodesSelectionActive:D}=b(),{nodesInitialized:L,hasSelectedNodes:M}=Pu(f,_,d,{nodeOrigin:h,nodeExtent:c,elevateNodesOnSelect:y,checkEquality:!0,zIndexMode:R}),W=D&&M;k&&L?(x(),C({nodes:f,nodesInitialized:L,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:W})):C({nodes:f,nodesInitialized:L,nodesSelectionActive:W})},setEdges:f=>{const{connectionLookup:_,edgeLookup:d}=b();yg(_,d,f),C({edges:f})},setDefaultNodesAndEdges:(f,_)=>{if(f){const{setNodes:d}=b();d(f),C({hasDefaultNodes:!0})}if(_){const{setEdges:d}=b();d(_),C({hasDefaultEdges:!0})}},updateNodeInternals:f=>{const{triggerNodeChanges:_,nodeLookup:d,parentLookup:h,domNode:y,nodeOrigin:k,nodeExtent:R,debug:D,fitViewQueued:L,zIndexMode:M}=b(),{changes:W,updatedInternals:z}=pC(f,d,h,y,k,R,M);z&&(uC(d,h,{nodeOrigin:k,nodeExtent:R,zIndexMode:M}),L?(x(),C({fitViewQueued:!1,fitViewOptions:void 0})):C({}),(W==null?void 0:W.length)>0&&(D&&console.log("React Flow: trigger node changes",W),_==null||_(W)))},updateNodePositions:(f,_=!1)=>{const d=[];let h=[];const{nodeLookup:y,triggerNodeChanges:k,connection:R,updateConnection:D,onNodesChangeMiddlewareMap:L}=b();for(const[M,W]of f){const z=y.get(M),F=!!(z!=null&&z.expandParent&&(z!=null&&z.parentId)&&(W!=null&&W.position)),B={id:M,type:"position",position:F?{x:Math.max(0,W.position.x),y:Math.max(0,W.position.y)}:W.position,dragging:_};if(z&&R.inProgress&&R.fromNode.id===z.id){const O=Ln(z,R.fromHandle,xe.Left,!0);D({...R,from:O})}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(B)}if(d.length>0){const{parentLookup:M,nodeOrigin:W}=b(),z=ch(d,y,M,W);h.push(...z)}for(const M of L.values())h=M(h);k(h)},triggerNodeChanges:f=>{const{onNodesChange:_,setNodes:d,nodes:h,hasDefaultNodes:y,debug:k}=b();if(f!=null&&f.length){if(y){const R=mx(f,h);d(R)}k&&console.log("React Flow: trigger node changes",f),_==null||_(f)}},triggerEdgeChanges:f=>{const{onEdgesChange:_,setEdges:d,edges:h,hasDefaultEdges:y,debug:k}=b();if(f!=null&&f.length){if(y){const R=vx(f,h);d(R)}k&&console.log("React Flow: trigger edge changes",f),_==null||_(f)}},addSelectedNodes:f=>{const{multiSelectionActive:_,edgeLookup:d,nodeLookup:h,triggerNodeChanges:y,triggerEdgeChanges:k}=b();if(_){const R=f.map(D=>wn(D,!0));y(R);return}y(oi(h,new Set([...f]),!0)),k(oi(d))},addSelectedEdges:f=>{const{multiSelectionActive:_,edgeLookup:d,nodeLookup:h,triggerNodeChanges:y,triggerEdgeChanges:k}=b();if(_){const R=f.map(D=>wn(D,!0));k(R);return}k(oi(d,new Set([...f]))),y(oi(h,new Set,!0))},unselectNodesAndEdges:({nodes:f,edges:_}={})=>{const{edges:d,nodes:h,nodeLookup:y,triggerNodeChanges:k,triggerEdgeChanges:R}=b(),D=f||h,L=_||d,M=[];for(const z of D){if(!z.selected)continue;const F=y.get(z.id);F&&(F.selected=!1),M.push(wn(z.id,!1))}const W=[];for(const z of L)z.selected&&W.push(wn(z.id,!1));k(M),R(W)},setMinZoom:f=>{const{panZoom:_,maxZoom:d}=b();_==null||_.setScaleExtent([f,d]),C({minZoom:f})},setMaxZoom:f=>{const{panZoom:_,minZoom:d}=b();_==null||_.setScaleExtent([d,f]),C({maxZoom:f})},setTranslateExtent:f=>{var _;(_=b().panZoom)==null||_.setTranslateExtent(f),C({translateExtent:f})},resetSelectedElements:()=>{const{edges:f,nodes:_,triggerNodeChanges:d,triggerEdgeChanges:h,elementsSelectable:y}=b();if(!y)return;const k=_.reduce((D,L)=>L.selected?[...D,wn(L.id,!1)]:D,[]),R=f.reduce((D,L)=>L.selected?[...D,wn(L.id,!1)]:D,[]);d(k),h(R)},setNodeExtent:f=>{const{nodes:_,nodeLookup:d,parentLookup:h,nodeOrigin:y,elevateNodesOnSelect:k,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]||(Pu(_,d,h,{nodeOrigin:y,nodeExtent:f,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:D}),C({nodeExtent:f}))},panBy:f=>{const{transform:_,width:d,height:h,panZoom:y,translateExtent:k}=b();return _C({delta:f,panZoom:y,transform:_,translateExtent:k,width:d,height:h})},setCenter:async(f,_,d)=>{const{width:h,height:y,maxZoom:k,panZoom:R}=b();if(!R)return Promise.resolve(!1);const D=typeof(d==null?void 0:d.zoom)<"u"?d.zoom:k;return await R.setViewport({x:h/2-f*D,y:y/2-_*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:()=>{C({connection:{...tg}})},updateConnection:f=>{C({connection:f})},reset:()=>C({...t_()})}},Object.is);function N2({initialNodes:e,initialEdges:r,defaultNodes:i,defaultEdges:o,initialWidth:u,initialHeight:S,initialMinZoom:w,initialMaxZoom:a,initialFitViewOptions:l,fitView:p,nodeOrigin:v,nodeExtent:c,zIndexMode:m,children:C}){const[b]=Q.useState(()=>P2({nodes:e,edges:r,defaultNodes:i,defaultEdges:o,width:u,height:S,fitView:p,minZoom:w,maxZoom:a,fitViewOptions:l,nodeOrigin:v,nodeExtent:c,zIndexMode:m}));return N.jsx(QC,{value:b,children:N.jsx(Sx,{children:C})})}function B2({children:e,nodes:r,edges:i,defaultNodes:o,defaultEdges:u,width:S,height:w,fitView:a,fitViewOptions:l,minZoom:p,maxZoom:v,nodeOrigin:c,nodeExtent:m,zIndexMode:C}){return Q.useContext(Ua)?N.jsx(N.Fragment,{children:e}):N.jsx(N2,{initialNodes:r,initialEdges:i,defaultNodes:o,defaultEdges:u,initialWidth:S,initialHeight:w,fitView:a,initialFitViewOptions:l,initialMinZoom:p,initialMaxZoom:v,nodeOrigin:c,nodeExtent:m,zIndexMode:C,children:e})}const I2={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function O2({nodes:e,edges:r,defaultNodes:i,defaultEdges:o,className:u,nodeTypes:S,edgeTypes:w,onNodeClick:a,onEdgeClick:l,onInit:p,onMove:v,onMoveStart:c,onMoveEnd:m,onConnect:C,onConnectStart:b,onConnectEnd:x,onClickConnectStart:f,onClickConnectEnd:_,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:y,onNodeContextMenu:k,onNodeDoubleClick:R,onNodeDragStart:D,onNodeDrag:L,onNodeDragStop:M,onNodesDelete:W,onEdgesDelete:z,onDelete:F,onSelectionChange:B,onSelectionDragStart:O,onSelectionDrag:q,onSelectionDragStop:U,onSelectionContextMenu:K,onSelectionStart:V,onSelectionEnd:A,onBeforeDelete:I,connectionMode:P,connectionLineType:j=Zr.Bezier,connectionLineStyle:Y,connectionLineComponent:Z,connectionLineContainerStyle:ie,deleteKeyCode:ae="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:H=!1,selectionMode:re=Cs.Full,panActivationKeyCode:te="Space",multiSelectionKeyCode:ue=bs()?"Meta":"Control",zoomActivationKeyCode:le=bs()?"Meta":"Control",snapToGrid:pe,snapGrid:Se,onlyRenderVisibleElements:be=!1,selectNodesOnDrag:ce,nodesDraggable:ge,autoPanOnNodeFocus:Re,nodesConnectable:Ie,nodesFocusable:ze,nodeOrigin:Qe=Mg,edgesFocusable:ut,edgesReconnectable:qe,elementsSelectable:pt=!0,defaultViewport:Ne=ux,minZoom:Je=.5,maxZoom:ht=2,translateExtent:$e=Ss,preventScrolling:_r=!0,nodeExtent:ot,defaultMarkerColor:Rt="#b1b1b7",zoomOnScroll:Oe=!0,zoomOnPinch:Rn=!0,panOnScroll:Ps=!1,panOnScrollSpeed:Ya=.5,panOnScrollMode:vi=xn.Free,zoomOnDoubleClick:yi=!0,panOnDrag:wi=!0,onPaneClick:Si,onPaneMouseEnter:Ci,onPaneMouseMove:Dr,onPaneMouseLeave:Tr,onPaneScroll:Ns,onPaneContextMenu:Bs,paneClickDistance:Is=1,nodeClickDistance:Os=0,children:Hs,onReconnect:xi,onReconnectStart:js,onReconnectEnd:rn,onEdgeContextMenu:bi,onEdgeDoubleClick:nn,onEdgeMouseEnter:Ga,onEdgeMouseMove:sn,onEdgeMouseLeave:Dn,reconnectRadius:Tn=10,onNodesChange:Ei,onEdgesChange:Qa,noDragClassName:Ja="nodrag",noWheelClassName:Za="nowheel",noPanClassName:rr="nopan",fitView:ki,fitViewOptions:Li,connectOnClick:el,attributionPosition:Fs,proOptions:zs,defaultEdgeOptions:$s,elevateNodesOnSelect:Ws=!0,elevateEdgesOnSelect:tl=!1,disableKeyboardA11y:Us=!1,autoPanOnConnect:Ke,autoPanOnNodeDrag:rl,autoPanSpeed:Ri,connectionRadius:Vs,isValidConnection:An,onError:nl,style:qs,id:on,nodeDragThreshold:It,connectionDragThreshold:il,viewport:Dt,onViewportChange:sl,width:ol,height:al,colorMode:Mn="light",debug:Pn,onScroll:nr,ariaLabelConfig:Nn,zIndexMode:Ks="basic",...ll},Di){const Bn=on||"1",Ti=px(Mn),an=Q.useCallback(Xs=>{Xs.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),nr==null||nr(Xs)},[nr]);return N.jsx("div",{"data-testid":"rf__wrapper",...ll,onScroll:an,style:{...qs,...I2},ref:Di,className:rt(["react-flow",u,Ti]),id:on,role:"application",children:N.jsxs(B2,{nodes:e,edges:r,width:ol,height:al,fitView:ki,fitViewOptions:Li,minZoom:Je,maxZoom:ht,nodeOrigin:Qe,nodeExtent:ot,zIndexMode:Ks,children:[N.jsx(fx,{nodes:e,edges:r,defaultNodes:i,defaultEdges:o,onConnect:C,onConnectStart:b,onConnectEnd:x,onClickConnectStart:f,onClickConnectEnd:_,nodesDraggable:ge,autoPanOnNodeFocus:Re,nodesConnectable:Ie,nodesFocusable:ze,edgesFocusable:ut,edgesReconnectable:qe,elementsSelectable:pt,elevateNodesOnSelect:Ws,elevateEdgesOnSelect:tl,minZoom:Je,maxZoom:ht,nodeExtent:ot,onNodesChange:Ei,onEdgesChange:Qa,snapToGrid:pe,snapGrid:Se,connectionMode:P,translateExtent:$e,connectOnClick:el,defaultEdgeOptions:$s,fitView:ki,fitViewOptions:Li,onNodesDelete:W,onEdgesDelete:z,onDelete:F,onNodeDragStart:D,onNodeDrag:L,onNodeDragStop:M,onSelectionDrag:q,onSelectionDragStart:O,onSelectionDragStop:U,onMove:v,onMoveStart:c,onMoveEnd:m,noPanClassName:rr,nodeOrigin:Qe,rfId:Bn,autoPanOnConnect:Ke,autoPanOnNodeDrag:rl,autoPanSpeed:Ri,onError:nl,connectionRadius:Vs,isValidConnection:An,selectNodesOnDrag:ce,nodeDragThreshold:It,connectionDragThreshold:il,onBeforeDelete:I,debug:Pn,ariaLabelConfig:Nn,zIndexMode:Ks}),N.jsx(M2,{onInit:p,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:y,onNodeContextMenu:k,onNodeDoubleClick:R,nodeTypes:S,edgeTypes:w,connectionLineType:j,connectionLineStyle:Y,connectionLineComponent:Z,connectionLineContainerStyle:ie,selectionKeyCode:X,selectionOnDrag:H,selectionMode:re,deleteKeyCode:ae,multiSelectionKeyCode:ue,panActivationKeyCode:te,zoomActivationKeyCode:le,onlyRenderVisibleElements:be,defaultViewport:Ne,translateExtent:$e,minZoom:Je,maxZoom:ht,preventScrolling:_r,zoomOnScroll:Oe,zoomOnPinch:Rn,zoomOnDoubleClick:yi,panOnScroll:Ps,panOnScrollSpeed:Ya,panOnScrollMode:vi,panOnDrag:wi,onPaneClick:Si,onPaneMouseEnter:Ci,onPaneMouseMove:Dr,onPaneMouseLeave:Tr,onPaneScroll:Ns,onPaneContextMenu:Bs,paneClickDistance:Is,nodeClickDistance:Os,onSelectionContextMenu:K,onSelectionStart:V,onSelectionEnd:A,onReconnect:xi,onReconnectStart:js,onReconnectEnd:rn,onEdgeContextMenu:bi,onEdgeDoubleClick:nn,onEdgeMouseEnter:Ga,onEdgeMouseMove:sn,onEdgeMouseLeave:Dn,reconnectRadius:Tn,defaultMarkerColor:Rt,noDragClassName:Ja,noWheelClassName:Za,noPanClassName:rr,rfId:Bn,disableKeyboardA11y:Us,nodeExtent:ot,viewport:Dt,onViewportChange:sl}),N.jsx(cx,{onSelectionChange:B}),Hs,N.jsx(ix,{proOptions:zs,position:Fs}),N.jsx(nx,{rfId:Bn,disableKeyboardA11y:Us})]})})}var H2=Ng(O2);function j2({dimensions:e,lineWidth:r,variant:i,className:o}){return N.jsx("path",{strokeWidth:r,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:rt(["react-flow__background-pattern",i,o])})}function F2({radius:e,className:r}){return N.jsx("circle",{cx:e,cy:e,r:e,className:rt(["react-flow__background-pattern","dots",r])})}var tn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(tn||(tn={}));const z2={[tn.Dots]:1,[tn.Lines]:1,[tn.Cross]:6},$2=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function im({id:e,variant:r=tn.Dots,gap:i=20,size:o,lineWidth:u=1,offset:S=0,color:w,bgColor:a,style:l,className:p,patternClassName:v}){const c=Q.useRef(null),{transform:m,patternId:C}=Ae($2,Ue),b=o||z2[r],x=r===tn.Dots,f=r===tn.Cross,_=Array.isArray(i)?i:[i,i],d=[_[0]*m[2]||1,_[1]*m[2]||1],h=b*m[2],y=Array.isArray(S)?S:[S,S],k=f?[h,h]:d,R=[y[0]*m[2]||1+k[0]/2,y[1]*m[2]||1+k[1]/2],D=`${C}${e||""}`;return N.jsxs("svg",{className:rt(["react-flow__background",p]),style:{...l,...qa,"--xy-background-color-props":a,"--xy-background-pattern-color-props":w},ref:c,"data-testid":"rf__background",children:[N.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:x?N.jsx(F2,{radius:h/2,className:v}):N.jsx(j2,{dimensions:k,lineWidth:u,variant:r,className:v})}),N.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${D})`})]})}im.displayName="Background";const W2=Q.memo(im);function U2(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:N.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function V2(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:N.jsx("path",{d:"M0 0h32v4.2H0z"})})}function q2(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:N.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 K2(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:N.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 X2(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:N.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 aa({children:e,className:r,...i}){return N.jsx("button",{type:"button",className:rt(["react-flow__controls-button",r]),...i,children:e})}const Y2=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function sm({style:e,showZoom:r=!0,showFitView:i=!0,showInteractive:o=!0,fitViewOptions:u,onZoomIn:S,onZoomOut:w,onFitView:a,onInteractiveChange:l,className:p,children:v,position:c="bottom-left",orientation:m="vertical","aria-label":C}){const b=Ve(),{isInteractive:x,minZoomReached:f,maxZoomReached:_,ariaLabelConfig:d}=Ae(Y2,Ue),{zoomIn:h,zoomOut:y,fitView:k}=uh(),R=()=>{h(),S==null||S()},D=()=>{y(),w==null||w()},L=()=>{k(u),a==null||a()},M=()=>{b.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),l==null||l(!x)},W=m==="horizontal"?"horizontal":"vertical";return N.jsxs(Va,{className:rt(["react-flow__controls",W,p]),position:c,style:e,"data-testid":"rf__controls","aria-label":C??d["controls.ariaLabel"],children:[r&&N.jsxs(N.Fragment,{children:[N.jsx(aa,{onClick:R,className:"react-flow__controls-zoomin",title:d["controls.zoomIn.ariaLabel"],"aria-label":d["controls.zoomIn.ariaLabel"],disabled:_,children:N.jsx(U2,{})}),N.jsx(aa,{onClick:D,className:"react-flow__controls-zoomout",title:d["controls.zoomOut.ariaLabel"],"aria-label":d["controls.zoomOut.ariaLabel"],disabled:f,children:N.jsx(V2,{})})]}),i&&N.jsx(aa,{className:"react-flow__controls-fitview",onClick:L,title:d["controls.fitView.ariaLabel"],"aria-label":d["controls.fitView.ariaLabel"],children:N.jsx(q2,{})}),o&&N.jsx(aa,{className:"react-flow__controls-interactive",onClick:M,title:d["controls.interactive.ariaLabel"],"aria-label":d["controls.interactive.ariaLabel"],children:x?N.jsx(X2,{}):N.jsx(K2,{})}),v]})}sm.displayName="Controls";const G2=Q.memo(sm);function Q2({id:e,x:r,y:i,width:o,height:u,style:S,color:w,strokeColor:a,strokeWidth:l,className:p,borderRadius:v,shapeRendering:c,selected:m,onClick:C}){const{background:b,backgroundColor:x}=S||{},f=w||b||x;return N.jsx("rect",{className:rt(["react-flow__minimap-node",{selected:m},p]),x:r,y:i,rx:v,ry:v,width:o,height:u,style:{fill:f,stroke:a,strokeWidth:l},shapeRendering:c,onClick:C?_=>C(_,e):void 0})}const J2=Q.memo(Q2),Z2=e=>e.nodes.map(r=>r.id),ou=e=>e instanceof Function?e:()=>e;function eb({nodeStrokeColor:e,nodeColor:r,nodeClassName:i="",nodeBorderRadius:o=5,nodeStrokeWidth:u,nodeComponent:S=J2,onClick:w}){const a=Ae(Z2,Ue),l=ou(r),p=ou(e),v=ou(i),c=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return N.jsx(N.Fragment,{children:a.map(m=>N.jsx(rb,{id:m,nodeColorFunc:l,nodeStrokeColorFunc:p,nodeClassNameFunc:v,nodeBorderRadius:o,nodeStrokeWidth:u,NodeComponent:S,onClick:w,shapeRendering:c},m))})}function tb({id:e,nodeColorFunc:r,nodeStrokeColorFunc:i,nodeClassNameFunc:o,nodeBorderRadius:u,nodeStrokeWidth:S,shapeRendering:w,NodeComponent:a,onClick:l}){const{node:p,x:v,y:c,width:m,height:C}=Ae(b=>{const x=b.nodeLookup.get(e);if(!x)return{node:void 0,x:0,y:0,width:0,height:0};const f=x.internals.userNode,{x:_,y:d}=x.internals.positionAbsolute,{width:h,height:y}=Rr(f);return{node:f,x:_,y:d,width:h,height:y}},Ue);return!p||p.hidden||!lg(p)?null:N.jsx(a,{x:v,y:c,width:m,height:C,style:p.style,selected:!!p.selected,className:o(p),color:r(p),borderRadius:u,strokeColor:i(p),strokeWidth:S,shapeRendering:w,onClick:l,id:p.id})}const rb=Q.memo(tb);var nb=Q.memo(eb);const ib=200,sb=150,ob=e=>!e.hidden,ab=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?ag(Ts(e.nodeLookup,{filter:ob}),r):r,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},lb="react-flow__minimap-desc";function om({style:e,className:r,nodeStrokeColor:i,nodeColor:o,nodeClassName:u="",nodeBorderRadius:S=5,nodeStrokeWidth:w,nodeComponent:a,bgColor:l,maskColor:p,maskStrokeColor:v,maskStrokeWidth:c,position:m="bottom-right",onClick:C,onNodeClick:b,pannable:x=!1,zoomable:f=!1,ariaLabel:_,inversePan:d,zoomStep:h=1,offsetScale:y=5}){const k=Ve(),R=Q.useRef(null),{boundingRect:D,viewBB:L,rfId:M,panZoom:W,translateExtent:z,flowWidth:F,flowHeight:B,ariaLabelConfig:O}=Ae(ab,Ue),q=(e==null?void 0:e.width)??ib,U=(e==null?void 0:e.height)??sb,K=D.width/q,V=D.height/U,A=Math.max(K,V),I=A*q,P=A*U,j=y*A,Y=D.x-(I-D.width)/2-j,Z=D.y-(P-D.height)/2-j,ie=I+j*2,ae=P+j*2,X=`${lb}-${M}`,H=Q.useRef(0),re=Q.useRef();H.current=A,Q.useEffect(()=>{if(R.current&&W)return re.current=bC({domNode:R.current,panZoom:W,getTransform:()=>k.getState().transform,getViewScale:()=>H.current}),()=>{var pe;(pe=re.current)==null||pe.destroy()}},[W]),Q.useEffect(()=>{var pe;(pe=re.current)==null||pe.update({translateExtent:z,width:F,height:B,inversePan:d,pannable:x,zoomStep:h,zoomable:f})},[x,f,d,h,z,F,B]);const te=C?pe=>{var ce;const[Se,be]=((ce=re.current)==null?void 0:ce.pointer(pe))||[0,0];C(pe,{x:Se,y:be})}:void 0,ue=b?Q.useCallback((pe,Se)=>{const be=k.getState().nodeLookup.get(Se).internals.userNode;b(pe,be)},[]):void 0,le=_??O["minimap.ariaLabel"];return N.jsx(Va,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-stroke-width-props":typeof c=="number"?c*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 w=="number"?w:void 0},className:rt(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:N.jsxs("svg",{width:q,height:U,viewBox:`${Y} ${Z} ${ie} ${ae}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:R,onClick:te,children:[le&&N.jsx("title",{id:X,children:le}),N.jsx(nb,{onClick:ue,nodeColor:o,nodeStrokeColor:i,nodeBorderRadius:S,nodeClassName:u,nodeStrokeWidth:w,nodeComponent:a}),N.jsx("path",{className:"react-flow__minimap-mask",d:`M${Y-j},${Z-j}h${ie+j*2}v${ae+j*2}h${-ie-j*2}z
|
|
62
|
+
M${L.x},${L.y}h${L.width}v${L.height}h${-L.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}om.displayName="MiniMap";Q.memo(om);const cb=e=>r=>e?`${Math.max(1/r.transform[2],1)}`:void 0,ub={[_i.Line]:"right",[_i.Handle]:"bottom-right"};function hb({nodeId:e,position:r,variant:i=_i.Handle,className:o,style:u=void 0,children:S,color:w,minWidth:a=10,minHeight:l=10,maxWidth:p=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:c=!1,resizeDirection:m,autoScale:C=!0,shouldResize:b,onResizeStart:x,onResize:f,onResizeEnd:_}){const d=Hg(),h=typeof e=="string"?e:d,y=Ve(),k=Q.useRef(null),R=i===_i.Handle,D=Ae(Q.useCallback(cb(R&&C),[R,C]),Ue),L=Q.useRef(null),M=r??ub[i];Q.useEffect(()=>{if(!(!k.current||!h))return L.current||(L.current=HC({domNode:k.current,nodeId:h,getStoreItems:()=>{const{nodeLookup:z,transform:F,snapGrid:B,snapToGrid:O,nodeOrigin:q,domNode:U}=y.getState();return{nodeLookup:z,transform:F,snapGrid:B,snapToGrid:O,nodeOrigin:q,paneDomNode:U}},onChange:(z,F)=>{const{triggerNodeChanges:B,nodeLookup:O,parentLookup:q,nodeOrigin:U}=y.getState(),K=[],V={x:z.x,y:z.y},A=O.get(h);if(A&&A.expandParent&&A.parentId){const I=A.origin??U,P=z.width??A.measured.width??0,j=z.height??A.measured.height??0,Y={id:A.id,parentId:A.parentId,rect:{width:P,height:j,...cg({x:z.x??A.position.x,y:z.y??A.position.y},{width:P,height:j},A.parentId,O,I)}},Z=ch([Y],O,q,U);K.push(...Z),V.x=z.x?Math.max(I[0]*P,z.x):void 0,V.y=z.y?Math.max(I[1]*j,z.y):void 0}if(V.x!==void 0&&V.y!==void 0){const I={id:h,type:"position",position:{...V}};K.push(I)}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 I of F){const P={...I,type:"position"};K.push(P)}B(K)},onEnd:({width:z,height:F})=>{const B={id:h,type:"dimensions",resizing:!1,dimensions:{width:z,height:F}};y.getState().triggerNodeChanges([B])}})),L.current.update({controlPosition:M,boundaries:{minWidth:a,minHeight:l,maxWidth:p,maxHeight:v},keepAspectRatio:c,resizeDirection:m,onResizeStart:x,onResize:f,onResizeEnd:_,shouldResize:b}),()=>{var z;(z=L.current)==null||z.destroy()}},[M,a,l,p,v,c,x,f,_,b]);const W=M.split("-");return N.jsx("div",{className:rt(["react-flow__resize-control","nodrag",...W,i,o]),ref:k,style:{...u,scale:D,...w&&{[R?"backgroundColor":"borderColor"]:w}},children:S})}Q.memo(hb);const db={running:"#4ade80",starting:"#fbbf24",idle:"#fbbf24",done:"#555",dead:"#f87171"};function fb({data:e}){const r=e,i=db[r.status]||"#555",o=r.status==="running"||r.status==="starting";return N.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:[N.jsx(gi,{type:"target",position:xe.Left,style:{background:"#333",border:"none",width:6,height:6}}),N.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:5},children:[N.jsx("div",{style:{width:6,height:6,borderRadius:"50%",background:i,boxShadow:o?`0 0 6px ${i}40`:"none"}}),N.jsx("span",{style:{fontSize:13,fontWeight:500,color:"#e8e8e8",fontFamily:"'DM Sans', sans-serif"},children:r.label}),r.service&&r.service!=="claude"&&N.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})]}),N.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&&N.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:[N.jsx("span",{style:{fontSize:8},children:"✉"}),r.messageCount]}),N.jsx(gi,{type:"source",position:xe.Right,style:{background:"#333",border:"none",width:6,height:6}})]})}const pb={agent:fb};function _b({agents:e,messages:r,onSelectAgent:i}){const[o,u]=Q.useState([]),S=Q.useMemo(()=>{const p={};for(const v of r)v.to_agent&&v.to_agent!=="all"&&(p[v.to_agent]=(p[v.to_agent]||0)+1);return p},[r]),w=Q.useMemo(()=>{const p=new Map,v=new Set(e.map(c=>c.id));for(const c of r){if(!v.has(c.from_agent)||!v.has(c.to_agent)||c.to_agent==="all")continue;const m=[c.from_agent,c.to_agent].sort().join("|");p.set(m,(p.get(m)||0)+1)}return Array.from(p.entries()).map(([c,m])=>{const[C,b]=c.split("|");return{id:`collab-${c}`,source:C,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=Q.useMemo(()=>{const p=Math.max(Math.ceil(Math.sqrt(e.length)),1);return e.map((v,c)=>({id:v.id,type:"agent",position:{x:80+c%p*240,y:80+Math.floor(c/p)*130},data:{label:v.name,status:v.status,task:v.task||"",service:v.service||"claude",messageCount:S[v.id]||0}}))},[e,S]);Q.useEffect(()=>{if(r.length===0)return;const p=r[0];if(!p)return;const v=new Set(e.map(b=>b.id));if(!v.has(p.from_agent)||!v.has(p.to_agent))return;const c=`msg-${p.id}`,m={id:c,source:p.from_agent,target:p.to_agent,animated:!0,style:{stroke:"#4ade80",strokeWidth:1.5}};u(b=>[...b,m]);const C=setTimeout(()=>{u(b=>b.filter(x=>x.id!==c))},3e3);return()=>clearTimeout(C)},[r,e]);const l=Q.useCallback((p,v)=>{const c=e.find(m=>m.id===v.id);c&&i(c)},[e,i]);return N.jsx("div",{style:{width:"100%",height:"100%"},children:N.jsxs(H2,{nodes:a,edges:[...w,...o],nodeTypes:pb,onNodeClick:l,fitView:!0,proOptions:{hideAttribution:!0},children:[N.jsx(W2,{color:"#1a1a1a",gap:24,size:1}),N.jsx(G2,{style:{background:"#0a0a0a",border:"1px solid #1e1e1e",borderRadius:6}})]})})}var au={exports:{}},r_;function gb(){return r_||(r_=1,(function(e,r){(function(i,o){e.exports=o()})(globalThis,(()=>(()=>{var i={4567:function(w,a,l){var p=this&&this.__decorate||function(d,h,y,k){var R,D=arguments.length,L=D<3?h:k===null?k=Object.getOwnPropertyDescriptor(h,y):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(d,h,y,k);else for(var M=d.length-1;M>=0;M--)(R=d[M])&&(L=(D<3?R(L):D>3?R(h,y,L):R(h,y))||L);return D>3&&L&&Object.defineProperty(h,y,L),L},v=this&&this.__param||function(d,h){return function(y,k){h(y,k,d)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const c=l(9042),m=l(9924),C=l(844),b=l(4725),x=l(2585),f=l(3656);let _=a.AccessibilityManager=class extends C.Disposable{constructor(d,h,y,k){super(),this._terminal=d,this._coreBrowserService=y,this._renderService=k,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,C.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+=c.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 y=this._terminal.buffer,k=y.lines.length.toString();for(let R=d;R<=h;R++){const D=y.lines.get(y.ydisp+R),L=[],M=(D==null?void 0:D.translateToString(!0,void 0,void 0,L))||"",W=(y.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,L)),z.setAttribute("aria-posinset",W),z.setAttribute("aria-setsize",k))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(d,h){const y=d.target,k=this._rowElements[h===0?1:this._rowElements.length-2];if(y.getAttribute("aria-posinset")===(h===0?"1":`${this._terminal.buffer.lines.length}`)||d.relatedTarget!==k)return;let R,D;if(h===0?(R=y,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(R=this._rowElements.shift(),D=y,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),h===0){const L=this._createAccessibilityTreeNode();this._rowElements.unshift(L),this._rowContainer.insertAdjacentElement("afterbegin",L)}else{const L=this._createAccessibilityTreeNode();this._rowElements.push(L),this._rowContainer.appendChild(L)}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},y={node:d.focusNode,offset:d.focusOffset};if((h.node.compareDocumentPosition(y.node)&Node.DOCUMENT_POSITION_PRECEDING||h.node===y.node&&h.offset>y.offset)&&([h,y]=[y,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 k=this._rowElements.slice(-1)[0];if(y.node.compareDocumentPosition(k)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(y={node:k,offset:((M=k.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(y.node))return;const R=({node:W,offset:z})=>{const F=W instanceof Text?W.parentNode:W;let B=parseInt(F==null?void 0:F.getAttribute("aria-posinset"),10)-1;if(isNaN(B))return console.warn("row is invalid. Race condition?"),null;const O=this._rowColumns.get(F);if(!O)return console.warn("columns is null. Race condition?"),null;let q=z<O.length?O[z]:O.slice(-1)[0]+1;return q>=this._terminal.cols&&(++B,q=0),{row:B,column:q}},D=R(h),L=R(y);if(D&&L){if(D.row>L.row||D.row===L.row&&D.column>=L.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(L.row-D.row)*this._terminal.cols-D.column+L.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,x.IInstantiationService),v(2,b.ICoreBrowserService),v(3,b.IRenderService)],_)},3614:(w,a)=>{function l(m){return m.replace(/\r?\n/g,"\r")}function p(m,C){return C?"\x1B[200~"+m+"\x1B[201~":m}function v(m,C,b,x){m=p(m=l(m),b.decPrivateModes.bracketedPasteMode&&x.rawOptions.ignoreBracketedPasteMode!==!0),b.triggerDataEvent(m,!0),C.value=""}function c(m,C,b){const x=b.getBoundingClientRect(),f=m.clientX-x.left-10,_=m.clientY-x.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${f}px`,C.style.top=`${_}px`,C.style.zIndex="1000",C.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=l,a.bracketTextForPaste=p,a.copyHandler=function(m,C){m.clipboardData&&m.clipboardData.setData("text/plain",C.selectionText),m.preventDefault()},a.handlePasteEvent=function(m,C,b,x){m.stopPropagation(),m.clipboardData&&v(m.clipboardData.getData("text/plain"),C,b,x)},a.paste=v,a.moveTextAreaUnderMouseCursor=c,a.rightClickHandler=function(m,C,b,x,f){c(m,C,b),f&&x.rightClickSelect(m),C.value=x.selectionText,C.select()}},7239:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const p=l(1505);a.ColorContrastCache=class{constructor(){this._color=new p.TwoKeyMap,this._css=new p.TwoKeyMap}setCss(v,c,m){this._css.set(v,c,m)}getCss(v,c){return this._css.get(v,c)}setColor(v,c,m){this._color.set(v,c,m)}getColor(v,c){return this._color.get(v,c)}clear(){this._color.clear(),this._css.clear()}}},3656:(w,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(l,p,v,c){l.addEventListener(p,v,c);let m=!1;return{dispose:()=>{m||(m=!0,l.removeEventListener(p,v,c))}}}},3551:function(w,a,l){var p=this&&this.__decorate||function(_,d,h,y){var k,R=arguments.length,D=R<3?d:y===null?y=Object.getOwnPropertyDescriptor(d,h):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(_,d,h,y);else for(var L=_.length-1;L>=0;L--)(k=_[L])&&(D=(R<3?k(D):R>3?k(d,h,D):k(d,h))||D);return R>3&&D&&Object.defineProperty(d,h,D),D},v=this&&this.__param||function(_,d){return function(h,y){d(h,y,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const c=l(3656),m=l(8460),C=l(844),b=l(2585),x=l(4725);let f=a.Linkifier=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(_,d,h,y,k){super(),this._element=_,this._mouseService=d,this._renderService=h,this._bufferService=y,this._linkProviderService=k,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,C.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,C.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,c.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,c.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,c.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,c.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(_){this._lastMouseEvent=_;const d=this._positionFromMouseEvent(_,this._element,this._mouseService);if(!d)return;this._isMouseOut=!1;const h=_.composedPath();for(let y=0;y<h.length;y++){const k=h[y];if(k.classList.contains("xterm"))break;if(k.classList.contains("xterm-hover"))return}this._lastBufferCell&&d.x===this._lastBufferCell.x&&d.y===this._lastBufferCell.y||(this._handleHover(d),this._lastBufferCell=d)}_handleHover(_){if(this._activeLine!==_.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(_,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,_)||(this._clearCurrentLink(),this._askForLink(_,!0))}_askForLink(_,d){var y,k;this._activeProviderReplies&&d||((y=this._activeProviderReplies)==null||y.forEach((R=>{R==null||R.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=_.y);let h=!1;for(const[R,D]of this._linkProviderService.linkProviders.entries())d?(k=this._activeProviderReplies)!=null&&k.get(R)&&(h=this._checkLinkProviderResult(R,_,h)):D.provideLinks(_.y,(L=>{var W,z;if(this._isMouseOut)return;const M=L==null?void 0:L.map((F=>({link:F})));(W=this._activeProviderReplies)==null||W.set(R,M),h=this._checkLinkProviderResult(R,_,h),((z=this._activeProviderReplies)==null?void 0:z.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(_.y,this._activeProviderReplies)}))}_removeIntersectingLinks(_,d){const h=new Set;for(let y=0;y<d.size;y++){const k=d.get(y);if(k)for(let R=0;R<k.length;R++){const D=k[R],L=D.link.range.start.y<_?0:D.link.range.start.x,M=D.link.range.end.y>_?this._bufferService.cols:D.link.range.end.x;for(let W=L;W<=M;W++){if(h.has(W)){k.splice(R--,1);break}h.add(W)}}}}_checkLinkProviderResult(_,d,h){var R;if(!this._activeProviderReplies)return h;const y=this._activeProviderReplies.get(_);let k=!1;for(let D=0;D<_;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(k=!0);if(!k&&y){const D=y.find((L=>this._linkAtPosition(L.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 L=(R=this._activeProviderReplies.get(D))==null?void 0:R.find((M=>this._linkAtPosition(M.link,d)));if(L){h=!0,this._handleNewLink(L);break}}return h}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(_){if(!this._currentLink)return;const d=this._positionFromMouseEvent(_,this._element,this._mouseService);d&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,d)&&this._currentLink.link.activate(_,this._currentLink.link.text)}_clearCurrentLink(_,d){this._currentLink&&this._lastMouseEvent&&(!_||!d||this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=d)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(_){if(!this._lastMouseEvent)return;const d=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);d&&this._linkAtPosition(_.link,d)&&(this._currentLink=_,this._currentLink.state={decorations:{underline:_.link.decorations===void 0||_.link.decorations.underline,pointerCursor:_.link.decorations===void 0||_.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,_.link,this._lastMouseEvent),_.link.decorations={},Object.defineProperties(_.link.decorations,{pointerCursor:{get:()=>{var h,y;return(y=(h=this._currentLink)==null?void 0:h.state)==null?void 0:y.decorations.pointerCursor},set:h=>{var y;(y=this._currentLink)!=null&&y.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,y;return(y=(h=this._currentLink)==null?void 0:h.state)==null?void 0:y.decorations.underline},set:h=>{var y,k,R;(y=this._currentLink)!=null&&y.state&&((R=(k=this._currentLink)==null?void 0:k.state)==null?void 0:R.decorations.underline)!==h&&(this._currentLink.state.decorations.underline=h,this._currentLink.state.isHovered&&this._fireUnderlineEvent(_.link,h))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((h=>{if(!this._currentLink)return;const y=h.start===0?0:h.start+1+this._bufferService.buffer.ydisp,k=this._bufferService.buffer.ydisp+1+h.end;if(this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=k&&(this._clearCurrentLink(y,k),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(_,d,h){var y;(y=this._currentLink)!=null&&y.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!0),this._currentLink.state.decorations.pointerCursor&&_.classList.add("xterm-cursor-pointer")),d.hover&&d.hover(h,d.text)}_fireUnderlineEvent(_,d){const h=_.range,y=this._bufferService.buffer.ydisp,k=this._createLinkUnderlineEvent(h.start.x-1,h.start.y-y-1,h.end.x,h.end.y-y-1,void 0);(d?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(k)}_linkLeave(_,d,h){var y;(y=this._currentLink)!=null&&y.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!1),this._currentLink.state.decorations.pointerCursor&&_.classList.remove("xterm-cursor-pointer")),d.leave&&d.leave(h,d.text)}_linkAtPosition(_,d){const h=_.range.start.y*this._bufferService.cols+_.range.start.x,y=_.range.end.y*this._bufferService.cols+_.range.end.x,k=d.y*this._bufferService.cols+d.x;return h<=k&&k<=y}_positionFromMouseEvent(_,d,h){const y=h.getCoords(_,d,this._bufferService.cols,this._bufferService.rows);if(y)return{x:y[0],y:y[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(_,d,h,y,k){return{x1:_,y1:d,x2:h,y2:y,cols:this._bufferService.cols,fg:k}}};a.Linkifier=f=p([v(1,x.IMouseService),v(2,x.IRenderService),v(3,b.IBufferService),v(4,x.ILinkProviderService)],f)},9042:(w,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(w,a,l){var p=this&&this.__decorate||function(x,f,_,d){var h,y=arguments.length,k=y<3?f:d===null?d=Object.getOwnPropertyDescriptor(f,_):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(x,f,_,d);else for(var R=x.length-1;R>=0;R--)(h=x[R])&&(k=(y<3?h(k):y>3?h(f,_,k):h(f,_))||k);return y>3&&k&&Object.defineProperty(f,_,k),k},v=this&&this.__param||function(x,f){return function(_,d){f(_,d,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const c=l(511),m=l(2585);let C=a.OscLinkProvider=class{constructor(x,f,_){this._bufferService=x,this._optionsService=f,this._oscLinkService=_}provideLinks(x,f){var M;const _=this._bufferService.buffer.lines.get(x-1);if(!_)return void f(void 0);const d=[],h=this._optionsService.rawOptions.linkHandler,y=new c.CellData,k=_.getTrimmedLength();let R=-1,D=-1,L=!1;for(let W=0;W<k;W++)if(D!==-1||_.hasContent(W)){if(_.loadCell(W,y),y.hasExtendedAttrs()&&y.extended.urlId){if(D===-1){D=W,R=y.extended.urlId;continue}L=y.extended.urlId!==R}else D!==-1&&(L=!0);if(L||D!==-1&&W===k-1){const z=(M=this._oscLinkService.getLinkData(R))==null?void 0:M.uri;if(z){const F={start:{x:D+1,y:x},end:{x:W+(L||W!==k-1?0:1),y:x}};let B=!1;if(!(h!=null&&h.allowNonHttpProtocols))try{const O=new URL(z);["http:","https:"].includes(O.protocol)||(B=!0)}catch{B=!0}B||d.push({text:z,range:F,activate:(O,q)=>h?h.activate(O,q,F):b(0,q),hover:(O,q)=>{var U;return(U=h==null?void 0:h.hover)==null?void 0:U.call(h,O,q,F)},leave:(O,q)=>{var U;return(U=h==null?void 0:h.leave)==null?void 0:U.call(h,O,q,F)}})}L=!1,y.hasExtendedAttrs()&&y.extended.urlId?(D=W,R=y.extended.urlId):(D=-1,R=-1)}}f(d)}};function b(x,f){if(confirm(`Do you want to navigate to ${f}?
|
|
65
|
+
|
|
66
|
+
WARNING: This link could potentially be dangerous`)){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=f}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=C=p([v(0,m.IBufferService),v(1,m.IOptionsService),v(2,m.IOscLinkService)],C)},6193:(w,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(l,p){this._renderCallback=l,this._coreBrowserService=p,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(l){return this._refreshCallbacks.push(l),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(l,p,v){this._rowCount=v,l=l!==void 0?l:0,p=p!==void 0?p:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,p):p,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 l=Math.max(this._rowStart,0),p=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,p),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const p=l(3614),v=l(3656),c=l(3551),m=l(9042),C=l(3730),b=l(1680),x=l(3107),f=l(5744),_=l(2950),d=l(1296),h=l(428),y=l(4269),k=l(5114),R=l(8934),D=l(3230),L=l(9312),M=l(4725),W=l(6731),z=l(8055),F=l(8969),B=l(8460),O=l(844),q=l(6114),U=l(8437),K=l(2584),V=l(7399),A=l(5941),I=l(9074),P=l(2585),j=l(5435),Y=l(4567),Z=l(779);class ie 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 O.MutableDisposable),this._onCursorMove=this.register(new B.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new B.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new B.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new B.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new B.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new B.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new B.EventEmitter),this._onBlur=this.register(new B.EventEmitter),this._onA11yCharEmitter=this.register(new B.EventEmitter),this._onA11yTabEmitter=this.register(new B.EventEmitter),this._onWillOpen=this.register(new B.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(I.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(C.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((H,re)=>this.refresh(H,re)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((H=>this._reportWindowsOptions(H)))),this.register(this._inputHandler.onColor((H=>this._handleColorEvent(H)))),this.register((0,B.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,B.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((H=>this._afterResize(H.cols,H.rows)))),this.register((0,O.toDisposable)((()=>{var H,re;this._customKeyEventHandler=void 0,(re=(H=this.element)==null?void 0:H.parentNode)==null||re.removeChild(this.element)})))}_handleColorEvent(X){if(this._themeService)for(const H of X){let re,te="";switch(H.index){case 256:re="foreground",te="10";break;case 257:re="background",te="11";break;case 258:re="cursor",te="12";break;default:re="ansi",te="4;"+H.index}switch(H.type){case 0:const ue=z.color.toColorRGB(re==="ansi"?this._themeService.colors.ansi[H.index]:this._themeService.colors[re]);this.coreService.triggerDataEvent(`${K.C0.ESC}]${te};${(0,A.toRgbString)(ue)}${K.C1_ESCAPED.ST}`);break;case 1:if(re==="ansi")this._themeService.modifyColors((le=>le.ansi[H.index]=z.channels.toColor(...H.color)));else{const le=re;this._themeService.modifyColors((pe=>pe[le]=z.channels.toColor(...H.color)))}break;case 2:this._themeService.restoreColor(H.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(Y.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,H=this.buffer.lines.get(X);if(!H)return;const re=Math.min(this.buffer.x,this.cols-1),te=this._renderService.dimensions.css.cell.height,ue=H.getWidth(re),le=this._renderService.dimensions.css.cell.width*ue,pe=this.buffer.y*this._renderService.dimensions.css.cell.height,Se=re*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Se+"px",this.textarea.style.top=pe+"px",this.textarea.style.width=le+"px",this.textarea.style.height=te+"px",this.textarea.style.lineHeight=te+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,v.addDisposableDomListener)(this.element,"copy",(H=>{this.hasSelection()&&(0,p.copyHandler)(H,this._selectionService)})));const X=H=>(0,p.handlePasteEvent)(H,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",(H=>{H.button===2&&(0,p.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,v.addDisposableDomListener)(this.element,"contextmenu",(H=>{(0,p.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),q.isLinux&&this.register((0,v.addDisposableDomListener)(this.element,"auxclick",(H=>{H.button===1&&(0,p.moveTextAreaUnderMouseCursor)(H,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 H=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),H.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",(te=>this.updateCursorStyle(te)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),H.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(k.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",(te=>this._handleTextAreaFocus(te)))),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(y.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((te=>this._onRender.fire(te)))),this.onResize((te=>this._renderService.resize(te.cols,te.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(_.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(c.Linkifier,this.screenElement)),this.element.appendChild(H);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((te=>this.scrollLines(te.amount,te.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(L.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((te=>this.scrollLines(te.amount,te.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((te=>this._renderService.handleSelectionChanged(te.start,te.end,te.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((te=>{this.textarea.value=te,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((te=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,v.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(x.BufferDecorationRenderer,this.screenElement)),this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(te=>this._selectionService.handleMouseDown(te)))),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(Y.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(te=>this._handleScreenReaderModeOptionChange(te)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(f.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(te=>{!this._overviewRulerRenderer&&te&&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,H=this.element;function re(le){const pe=X._mouseService.getMouseReportCoords(le,X.screenElement);if(!pe)return!1;let Se,be;switch(le.overrideType||le.type){case"mousemove":be=32,le.buttons===void 0?(Se=3,le.button!==void 0&&(Se=le.button<3?le.button:3)):Se=1&le.buttons?0:4&le.buttons?1:2&le.buttons?2:3;break;case"mouseup":be=0,Se=le.button<3?le.button:3;break;case"mousedown":be=1,Se=le.button<3?le.button:3;break;case"wheel":if(X._customWheelEventHandler&&X._customWheelEventHandler(le)===!1||X.viewport.getLinesScrolled(le)===0)return!1;be=le.deltaY<0?0:1,Se=4;break;default:return!1}return!(be===void 0||Se===void 0||Se>4)&&X.coreMouseService.triggerMouseEvent({col:pe.col,row:pe.row,x:pe.x,y:pe.y,button:Se,action:be,ctrl:le.ctrlKey,alt:le.altKey,shift:le.shiftKey})}const te={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ue={mouseup:le=>(re(le),le.buttons||(this._document.removeEventListener("mouseup",te.mouseup),te.mousedrag&&this._document.removeEventListener("mousemove",te.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?te.mousemove||(H.addEventListener("mousemove",ue.mousemove),te.mousemove=ue.mousemove):(H.removeEventListener("mousemove",te.mousemove),te.mousemove=null),16&le?te.wheel||(H.addEventListener("wheel",ue.wheel,{passive:!1}),te.wheel=ue.wheel):(H.removeEventListener("wheel",te.wheel),te.wheel=null),2&le?te.mouseup||(te.mouseup=ue.mouseup):(this._document.removeEventListener("mouseup",te.mouseup),te.mouseup=null),4&le?te.mousedrag||(te.mousedrag=ue.mousedrag):(this._document.removeEventListener("mousemove",te.mousedrag),te.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,v.addDisposableDomListener)(H,"mousedown",(le=>{if(le.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(le))return re(le),te.mouseup&&this._document.addEventListener("mouseup",te.mouseup),te.mousedrag&&this._document.addEventListener("mousemove",te.mousedrag),this.cancel(le)}))),this.register((0,v.addDisposableDomListener)(H,"wheel",(le=>{if(!te.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(le)===!1)return!1;if(!this.buffer.hasScrollback){const pe=this.viewport.getLinesScrolled(le);if(pe===0)return;const Se=K.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(le.deltaY<0?"A":"B");let be="";for(let ce=0;ce<Math.abs(pe);ce++)be+=Se;return this.coreService.triggerDataEvent(be,!0),this.cancel(le,!0)}return this.viewport.handleWheel(le)?this.cancel(le):void 0}}),{passive:!1})),this.register((0,v.addDisposableDomListener)(H,"touchstart",(le=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(le),this.cancel(le)}),{passive:!0})),this.register((0,v.addDisposableDomListener)(H,"touchmove",(le=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(le)?void 0:this.cancel(le)}),{passive:!1}))}refresh(X,H){var re;(re=this._renderService)==null||re.refreshRows(X,H)}updateCursorStyle(X){var H;(H=this._selectionService)!=null&&H.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,H,re=0){var te;re===1?(super.scrollLines(X,H,re),this.refresh(0,this.rows-1)):(te=this.viewport)==null||te.scrollLines(X)}paste(X){(0,p.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 H=this._characterJoinerService.register(X);return this.refresh(0,this.rows-1),H}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,H,re){this._selectionService.setSelection(X,H,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,H){var re;(re=this._selectionService)==null||re.selectLines(X,H)}_keyDown(X){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;const H=this.browser.isMac&&this.options.macOptionIsMeta&&X.altKey;if(!H&&!this._compositionHelper.keydown(X))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;H||X.key!=="Dead"&&X.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const re=(0,V.evaluateKeyboardEvent)(X,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(X),re.type===3||re.type===2){const te=this.rows-1;return this.scrollLines(re.type===2?-te:te),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,H){const re=X.isMac&&!this.options.macOptionIsMeta&&H.altKey&&!H.ctrlKey&&!H.metaKey||X.isWindows&&H.altKey&&H.ctrlKey&&!H.metaKey||X.isWindows&&H.getModifierState("AltGraph");return H.type==="keypress"?re:re&&(!H.keyCode||H.keyCode>47)}_keyUp(X){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1||((function(H){return H.keyCode===16||H.keyCode===17||H.keyCode===18})(X)||this.focus(),this.updateCursorStyle(X),this._keyPressHandled=!1)}_keyPress(X){let H;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(this.cancel(X),X.charCode)H=X.charCode;else if(X.which===null||X.which===void 0)H=X.keyCode;else{if(X.which===0||X.charCode===0)return!1;H=X.which}return!(!H||(X.altKey||X.ctrlKey||X.metaKey)&&!this._isThirdLevelShift(this.browser,X)||(H=String.fromCharCode(H),this._onKey.fire({key:H,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(H,!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 H=X.data;return this.coreService.triggerDataEvent(H,!0),this.cancel(X),!0}return!1}resize(X,H){X!==this.cols||H!==this.rows?super.resize(X,H):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(X,H){var re,te;(re=this._charSizeService)==null||re.measure(),(te=this.viewport)==null||te.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 H=1;H<this.rows;H++)this.buffer.lines.push(this.buffer.getBlankLine(U.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 H,re;this.options.rows=this.rows,this.options.cols=this.cols;const X=this._customKeyEventHandler;this._setup(),super.reset(),(H=this._selectionService)==null||H.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 j.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const H=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};${H}t`);break;case j.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const te=this._renderService.dimensions.css.cell.width.toFixed(0),ue=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[6;${ue};${te}t`)}}cancel(X,H){if(this.options.cancelEvents||H)return X.preventDefault(),X.stopPropagation(),!1}}a.Terminal=ie},9924:(w,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(l,p=1e3){this._renderCallback=l,this._debounceThresholdMS=p,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,p,v){this._rowCount=v,l=l!==void 0?l:0,p=p!==void 0?p:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,p):p;const c=Date.now();if(c-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=c,this._innerRefresh();else if(!this._additionalRefreshRequested){const m=c-this._lastRefreshMs,C=this._debounceThresholdMS-m;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),C)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const l=Math.max(this._rowStart,0),p=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,p)}}},1680:function(w,a,l){var p=this&&this.__decorate||function(_,d,h,y){var k,R=arguments.length,D=R<3?d:y===null?y=Object.getOwnPropertyDescriptor(d,h):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(_,d,h,y);else for(var L=_.length-1;L>=0;L--)(k=_[L])&&(D=(R<3?k(D):R>3?k(d,h,D):k(d,h))||D);return R>3&&D&&Object.defineProperty(d,h,D),D},v=this&&this.__param||function(_,d){return function(h,y){d(h,y,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const c=l(3656),m=l(4725),C=l(8460),b=l(844),x=l(2585);let f=a.Viewport=class extends b.Disposable{constructor(_,d,h,y,k,R,D,L){super(),this._viewportElement=_,this._scrollArea=d,this._bufferService=h,this._optionsService=y,this._charSizeService=k,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 C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,c.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(L.colors),this.register(L.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(_){this._viewportElement.style.backgroundColor=_.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(_){if(_)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 _=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==_&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=_),this._refreshAnimationFrame=null}syncScrollArea(_=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(_);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(_)}_handleScroll(_){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 _=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(_*(this._smoothScrollState.target-this._smoothScrollState.origin)),_<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(_,d){const h=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(d<0&&this._viewportElement.scrollTop!==0||d>0&&h<this._lastRecordedBufferHeight)||(_.cancelable&&_.preventDefault(),!1)}handleWheel(_){const d=this._getPixelsScrolled(_);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(_,d))}scrollLines(_){if(_!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const d=_*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:_,suppressScrollEvent:!1})}_getPixelsScrolled(_){if(_.deltaY===0||_.shiftKey)return 0;let d=this._applyScrollModifier(_.deltaY,_);return _.deltaMode===WheelEvent.DOM_DELTA_LINE?d*=this._currentRowHeight:_.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._currentRowHeight*this._bufferService.rows),d}getBufferElements(_,d){var L;let h,y="";const k=[],R=d??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let M=_;M<R;M++){const W=D.get(M);if(!W)continue;const z=(L=D.get(M+1))==null?void 0:L.isWrapped;if(y+=W.translateToString(!z),!z||M===D.length-1){const F=document.createElement("div");F.textContent=y,k.push(F),y.length>0&&(h=F),y=""}}return{bufferElements:k,cursorElement:h}}getLinesScrolled(_){if(_.deltaY===0||_.shiftKey)return 0;let d=this._applyScrollModifier(_.deltaY,_);return _.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):_.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._bufferService.rows),d}_applyScrollModifier(_,d){const h=this._optionsService.rawOptions.fastScrollModifier;return h==="alt"&&d.altKey||h==="ctrl"&&d.ctrlKey||h==="shift"&&d.shiftKey?_*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:_*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(_){this._lastTouchY=_.touches[0].pageY}handleTouchMove(_){const d=this._lastTouchY-_.touches[0].pageY;return this._lastTouchY=_.touches[0].pageY,d!==0&&(this._viewportElement.scrollTop+=d,this._bubbleScroll(_,d))}};a.Viewport=f=p([v(2,x.IBufferService),v(3,x.IOptionsService),v(4,m.ICharSizeService),v(5,m.IRenderService),v(6,m.ICoreBrowserService),v(7,m.IThemeService)],f)},3107:function(w,a,l){var p=this&&this.__decorate||function(x,f,_,d){var h,y=arguments.length,k=y<3?f:d===null?d=Object.getOwnPropertyDescriptor(f,_):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(x,f,_,d);else for(var R=x.length-1;R>=0;R--)(h=x[R])&&(k=(y<3?h(k):y>3?h(f,_,k):h(f,_))||k);return y>3&&k&&Object.defineProperty(f,_,k),k},v=this&&this.__param||function(x,f){return function(_,d){f(_,d,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const c=l(4725),m=l(844),C=l(2585);let b=a.BufferDecorationRenderer=class extends m.Disposable{constructor(x,f,_,d,h){super(),this._screenElement=x,this._bufferService=f,this._coreBrowserService=_,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((y=>this._removeDecoration(y)))),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 x of this._decorationService.decorations)this._renderDecoration(x);this._dimensionsChanged=!1}_renderDecoration(x){this._refreshStyle(x),this._dimensionsChanged&&this._refreshXPosition(x)}_createElement(x){var d;const f=this._coreBrowserService.mainDocument.createElement("div");f.classList.add("xterm-decoration"),f.classList.toggle("xterm-decoration-top-layer",((d=x==null?void 0:x.options)==null?void 0:d.layer)==="top"),f.style.width=`${Math.round((x.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,f.style.height=(x.options.height||1)*this._renderService.dimensions.css.cell.height+"px",f.style.top=(x.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 _=x.options.x??0;return _&&_>this._bufferService.cols&&(f.style.display="none"),this._refreshXPosition(x,f),f}_refreshStyle(x){const f=x.marker.line-this._bufferService.buffers.active.ydisp;if(f<0||f>=this._bufferService.rows)x.element&&(x.element.style.display="none",x.onRenderEmitter.fire(x.element));else{let _=this._decorationElements.get(x);_||(_=this._createElement(x),x.element=_,this._decorationElements.set(x,_),this._container.appendChild(_),x.onDispose((()=>{this._decorationElements.delete(x),_.remove()}))),_.style.top=f*this._renderService.dimensions.css.cell.height+"px",_.style.display=this._altBufferIsActive?"none":"block",x.onRenderEmitter.fire(_)}}_refreshXPosition(x,f=x.element){if(!f)return;const _=x.options.x??0;(x.options.anchor||"left")==="right"?f.style.right=_?_*this._renderService.dimensions.css.cell.width+"px":"":f.style.left=_?_*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(x){var f;(f=this._decorationElements.get(x))==null||f.remove(),this._decorationElements.delete(x),x.dispose()}};a.BufferDecorationRenderer=b=p([v(1,C.IBufferService),v(2,c.ICoreBrowserService),v(3,C.IDecorationService),v(4,c.IRenderService)],b)},5871:(w,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(l){if(l.options.overviewRulerOptions){for(const p of this._zones)if(p.color===l.options.overviewRulerOptions.color&&p.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(p,l.marker.line))return;if(this._lineAdjacentToZone(p,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(p,l.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=l.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=l.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=l.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=l.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:l.options.overviewRulerOptions.color,position:l.options.overviewRulerOptions.position,startBufferLine:l.marker.line,endBufferLine:l.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(l){this._linePadding=l}_lineIntersectsZone(l,p){return p>=l.startBufferLine&&p<=l.endBufferLine}_lineAdjacentToZone(l,p,v){return p>=l.startBufferLine-this._linePadding[v||"full"]&&p<=l.endBufferLine+this._linePadding[v||"full"]}_addLineToZone(l,p){l.startBufferLine=Math.min(l.startBufferLine,p),l.endBufferLine=Math.max(l.endBufferLine,p)}}},5744:function(w,a,l){var p=this&&this.__decorate||function(h,y,k,R){var D,L=arguments.length,M=L<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,k):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(h,y,k,R);else for(var W=h.length-1;W>=0;W--)(D=h[W])&&(M=(L<3?D(M):L>3?D(y,k,M):D(y,k))||M);return L>3&&M&&Object.defineProperty(y,k,M),M},v=this&&this.__param||function(h,y){return function(k,R){y(k,R,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const c=l(5871),m=l(4725),C=l(844),b=l(2585),x={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0};let d=a.OverviewRulerRenderer=class extends C.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(h,y,k,R,D,L,M){var z;super(),this._viewportElement=h,this._screenElement=y,this._bufferService=k,this._decorationService=R,this._renderService=D,this._optionsService=L,this._coreBrowserService=M,this._colorZoneStore=new c.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,C.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),y=Math.ceil(this._canvas.width/3);f.full=this._canvas.width,f.left=h,f.center=y,f.right=h,this._refreshDrawHeightConstants(),_.full=0,_.left=0,_.center=f.left,_.right=f.left+f.center}_refreshDrawHeightConstants(){x.full=Math.round(2*this._coreBrowserService.dpr);const h=this._canvas.height/this._bufferService.buffer.lines.length,y=Math.round(Math.max(Math.min(h,12),6)*this._coreBrowserService.dpr);x.left=y,x.center=y,x.right=y}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.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 y of this._decorationService.decorations)this._colorZoneStore.addDecoration(y);this._ctx.lineWidth=1;const h=this._colorZoneStore.zones;for(const y of h)y.position!=="full"&&this._renderColorZone(y);for(const y of h)y.position==="full"&&this._renderColorZone(y);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(h){this._ctx.fillStyle=h.color,this._ctx.fillRect(_[h.position||"full"],Math.round((this._canvas.height-1)*(h.startBufferLine/this._bufferService.buffers.active.lines.length)-x[h.position||"full"]/2),f[h.position||"full"],Math.round((this._canvas.height-1)*((h.endBufferLine-h.startBufferLine)/this._bufferService.buffers.active.lines.length)+x[h.position||"full"]))}_queueRefresh(h,y){this._shouldUpdateDimensions=h||this._shouldUpdateDimensions,this._shouldUpdateAnchor=y||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=d=p([v(2,b.IBufferService),v(3,b.IDecorationService),v(4,m.IRenderService),v(5,b.IOptionsService),v(6,m.ICoreBrowserService)],d)},2950:function(w,a,l){var p=this&&this.__decorate||function(x,f,_,d){var h,y=arguments.length,k=y<3?f:d===null?d=Object.getOwnPropertyDescriptor(f,_):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(x,f,_,d);else for(var R=x.length-1;R>=0;R--)(h=x[R])&&(k=(y<3?h(k):y>3?h(f,_,k):h(f,_))||k);return y>3&&k&&Object.defineProperty(f,_,k),k},v=this&&this.__param||function(x,f){return function(_,d){f(_,d,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const c=l(4725),m=l(2585),C=l(2584);let b=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(x,f,_,d,h,y){this._textarea=x,this._compositionView=f,this._bufferService=_,this._optionsService=d,this._coreService=h,this._renderService=y,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(x){this._compositionView.textContent=x.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(x){if(this._isComposing||this._isSendingComposition){if(x.keyCode===229||x.keyCode===16||x.keyCode===17||x.keyCode===18)return!1;this._finalizeComposition(!1)}return x.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(x){if(this._compositionView.classList.remove("active"),this._isComposing=!1,x){const f={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let _;this._isSendingComposition=!1,f.start+=this._dataAlreadySent.length,_=this._isComposing?this._textarea.value.substring(f.start,f.end):this._textarea.value.substring(f.start),_.length>0&&this._coreService.triggerDataEvent(_,!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 x=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const f=this._textarea.value,_=f.replace(x,"");this._dataAlreadySent=_,f.length>x.length?this._coreService.triggerDataEvent(_,!0):f.length<x.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):f.length===x.length&&f!==x&&this._coreService.triggerDataEvent(f,!0)}}),0)}updateCompositionElements(x){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const f=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),_=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=_+"px",this._compositionView.style.lineHeight=_+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const y=this._compositionView.getBoundingClientRect();this._textarea.style.left=h+"px",this._textarea.style.top=d+"px",this._textarea.style.width=Math.max(y.width,1)+"px",this._textarea.style.height=Math.max(y.height,1)+"px",this._textarea.style.lineHeight=y.height+"px"}x||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=b=p([v(2,m.IBufferService),v(3,m.IOptionsService),v(4,m.ICoreService),v(5,c.IRenderService)],b)},9806:(w,a)=>{function l(p,v,c){const m=c.getBoundingClientRect(),C=p.getComputedStyle(c),b=parseInt(C.getPropertyValue("padding-left")),x=parseInt(C.getPropertyValue("padding-top"));return[v.clientX-m.left-b,v.clientY-m.top-x]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=l,a.getCoords=function(p,v,c,m,C,b,x,f,_){if(!b)return;const d=l(p,v,c);return d?(d[0]=Math.ceil((d[0]+(_?x/2:0))/x),d[1]=Math.ceil(d[1]/f),d[0]=Math.min(Math.max(d[0],1),m+(_?1:0)),d[1]=Math.min(Math.max(d[1],1),C),d):void 0}},9504:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const p=l(2584);function v(f,_,d,h){const y=f-c(f,d),k=_-c(_,d),R=Math.abs(y-k)-(function(D,L,M){let W=0;const z=D-c(D,M),F=L-c(L,M);for(let B=0;B<Math.abs(z-F);B++){const O=m(D,L)==="A"?-1:1,q=M.buffer.lines.get(z+O*B);q!=null&&q.isWrapped&&W++}return W})(f,_,d);return x(R,b(m(f,_),h))}function c(f,_){let d=0,h=_.buffer.lines.get(f),y=h==null?void 0:h.isWrapped;for(;y&&f>=0&&f<_.rows;)d++,h=_.buffer.lines.get(--f),y=h==null?void 0:h.isWrapped;return d}function m(f,_){return f>_?"A":"B"}function C(f,_,d,h,y,k){let R=f,D=_,L="";for(;R!==d||D!==h;)R+=y?1:-1,y&&R>k.cols-1?(L+=k.buffer.translateBufferLineToString(D,!1,f,R),R=0,f=0,D++):!y&&R<0&&(L+=k.buffer.translateBufferLineToString(D,!1,0,f+1),R=k.cols-1,f=R,D--);return L+k.buffer.translateBufferLineToString(D,!1,f,R)}function b(f,_){const d=_?"O":"[";return p.C0.ESC+d+f}function x(f,_){f=Math.floor(f);let d="";for(let h=0;h<f;h++)d+=_;return d}a.moveToCellSequence=function(f,_,d,h){const y=d.buffer.x,k=d.buffer.y;if(!d.buffer.hasScrollback)return(function(L,M,W,z,F,B){return v(M,z,F,B).length===0?"":x(C(L,M,L,M-c(M,F),!1,F).length,b("D",B))})(y,k,0,_,d,h)+v(k,_,d,h)+(function(L,M,W,z,F,B){let O;O=v(M,z,F,B).length>0?z-c(z,F):M;const q=z,U=(function(K,V,A,I,P,j){let Y;return Y=v(A,I,P,j).length>0?I-c(I,P):V,K<A&&Y<=I||K>=A&&Y<I?"C":"D"})(L,M,W,z,F,B);return x(C(L,O,W,q,U==="C",F).length,b(U,B))})(y,k,f,_,d,h);let R;if(k===_)return R=y>f?"D":"C",x(Math.abs(y-f),b(R,h));R=k>_?"D":"C";const D=Math.abs(k-_);return x((function(L,M){return M.cols-L})(k>_?f:y,d)+(D-1)*d.cols+1+((k>_?y:f)-1),b(R,h))}},1296:function(w,a,l){var p=this&&this.__decorate||function(B,O,q,U){var K,V=arguments.length,A=V<3?O:U===null?U=Object.getOwnPropertyDescriptor(O,q):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(B,O,q,U);else for(var I=B.length-1;I>=0;I--)(K=B[I])&&(A=(V<3?K(A):V>3?K(O,q,A):K(O,q))||A);return V>3&&A&&Object.defineProperty(O,q,A),A},v=this&&this.__param||function(B,O){return function(q,U){O(q,U,B)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const c=l(3787),m=l(2550),C=l(2223),b=l(6171),x=l(6052),f=l(4725),_=l(8055),d=l(8460),h=l(844),y=l(2585),k="xterm-dom-renderer-owner-",R="xterm-rows",D="xterm-fg-",L="xterm-bg-",M="xterm-focus",W="xterm-selection";let z=1,F=a.DomRenderer=class extends h.Disposable{constructor(B,O,q,U,K,V,A,I,P,j,Y,Z,ie){super(),this._terminal=B,this._document=O,this._element=q,this._screenElement=U,this._viewportElement=K,this._helperContainer=V,this._linkifier2=A,this._charSizeService=P,this._optionsService=j,this._bufferService=Y,this._coreBrowserService=Z,this._themeService=ie,this._terminalClass=z++,this._rowElements=[],this._selectionRenderModel=(0,x.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((ae=>this._injectCss(ae)))),this._injectCss(this._themeService.colors),this._rowFactory=I.createInstance(c.DomRendererRowFactory,document),this._element.classList.add(k+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ae=>this._handleLinkHover(ae)))),this.register(this._linkifier2.onHideLinkUnderline((ae=>this._handleLinkLeave(ae)))),this.register((0,h.toDisposable)((()=>{this._element.classList.remove(k+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 B=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*B,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*B),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/B),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/B),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const 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 O=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=O,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(B){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let O=`${this._terminalSelector} .${R} { color: ${B.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;O+=`${this._terminalSelector} .${R} .xterm-dim { color: ${_.color.multiplyOpacity(B.foreground,.5).css};}`,O+=`${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}`,U=`blink_bar_${this._terminalClass}`,K=`blink_block_${this._terminalClass}`;O+=`@keyframes ${q} { 50% { border-bottom-style: hidden; }}`,O+=`@keyframes ${U} { 50% { box-shadow: none; }}`,O+=`@keyframes ${K} { 0% { background-color: ${B.cursor.css}; color: ${B.cursorAccent.css}; } 50% { background-color: inherit; color: ${B.cursor.css}; }}`,O+=`${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: ${U} 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: ${B.cursor.css}; color: ${B.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${B.cursor.css} !important; color: ${B.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${B.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${B.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${B.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,O+=`${this._terminalSelector} .${W} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${W} div { position: absolute; background-color: ${B.selectionBackgroundOpaque.css};}${this._terminalSelector} .${W} div { position: absolute; background-color: ${B.selectionInactiveBackgroundOpaque.css};}`;for(const[V,A]of B.ansi.entries())O+=`${this._terminalSelector} .${D}${V} { color: ${A.css}; }${this._terminalSelector} .${D}${V}.xterm-dim { color: ${_.color.multiplyOpacity(A,.5).css}; }${this._terminalSelector} .${L}${V} { background-color: ${A.css}; }`;O+=`${this._terminalSelector} .${D}${C.INVERTED_DEFAULT_COLOR} { color: ${_.color.opaque(B.background).css}; }${this._terminalSelector} .${D}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${_.color.multiplyOpacity(_.color.opaque(B.background),.5).css}; }${this._terminalSelector} .${L}${C.INVERTED_DEFAULT_COLOR} { background-color: ${B.foreground.css}; }`,this._themeStyleElement.textContent=O}_setDefaultSpacing(){const B=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${B}px`,this._rowFactory.defaultSpacing=B}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(B,O){for(let q=this._rowElements.length;q<=O;q++){const U=this._document.createElement("div");this._rowContainer.appendChild(U),this._rowElements.push(U)}for(;this._rowElements.length>O;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(B,O){this._refreshRowElements(B,O),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(B,O,q){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(B,O,q),this.renderRows(0,this._bufferService.rows-1),!B||!O)return;this._selectionRenderModel.update(this._terminal,B,O,q);const U=this._selectionRenderModel.viewportStartRow,K=this._selectionRenderModel.viewportEndRow,V=this._selectionRenderModel.viewportCappedStartRow,A=this._selectionRenderModel.viewportCappedEndRow;if(V>=this._bufferService.rows||A<0)return;const I=this._document.createDocumentFragment();if(q){const P=B[0]>O[0];I.appendChild(this._createSelectionElement(V,P?O[0]:B[0],P?B[0]:O[0],A-V+1))}else{const P=U===V?B[0]:0,j=V===K?O[0]:this._bufferService.cols;I.appendChild(this._createSelectionElement(V,P,j));const Y=A-V-1;if(I.appendChild(this._createSelectionElement(V+1,0,this._bufferService.cols,Y)),V!==A){const Z=K===A?O[0]:this._bufferService.cols;I.appendChild(this._createSelectionElement(A,0,Z))}}this._selectionContainer.appendChild(I)}_createSelectionElement(B,O,q,U=1){const K=this._document.createElement("div"),V=O*this.dimensions.css.cell.width;let A=this.dimensions.css.cell.width*(q-O);return V+A>this.dimensions.css.canvas.width&&(A=this.dimensions.css.canvas.width-V),K.style.height=U*this.dimensions.css.cell.height+"px",K.style.top=B*this.dimensions.css.cell.height+"px",K.style.left=`${V}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 B of this._rowElements)B.replaceChildren()}renderRows(B,O){const q=this._bufferService.buffer,U=q.ybase+q.y,K=Math.min(q.x,this._bufferService.cols-1),V=this._optionsService.rawOptions.cursorBlink,A=this._optionsService.rawOptions.cursorStyle,I=this._optionsService.rawOptions.cursorInactiveStyle;for(let P=B;P<=O;P++){const j=P+q.ydisp,Y=this._rowElements[P],Z=q.lines.get(j);if(!Y||!Z)break;Y.replaceChildren(...this._rowFactory.createRow(Z,j,j===U,A,I,K,V,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${k}${this._terminalClass}`}_handleLinkHover(B){this._setCellUnderline(B.x1,B.x2,B.y1,B.y2,B.cols,!0)}_handleLinkLeave(B){this._setCellUnderline(B.x1,B.x2,B.y1,B.y2,B.cols,!1)}_setCellUnderline(B,O,q,U,K,V){q<0&&(B=0),U<0&&(O=0);const A=this._bufferService.rows-1;q=Math.max(Math.min(q,A),0),U=Math.max(Math.min(U,A),0),K=Math.min(K,this._bufferService.cols);const I=this._bufferService.buffer,P=I.ybase+I.y,j=Math.min(I.x,K-1),Y=this._optionsService.rawOptions.cursorBlink,Z=this._optionsService.rawOptions.cursorStyle,ie=this._optionsService.rawOptions.cursorInactiveStyle;for(let ae=q;ae<=U;++ae){const X=ae+I.ydisp,H=this._rowElements[ae],re=I.lines.get(X);if(!H||!re)break;H.replaceChildren(...this._rowFactory.createRow(re,X,X===P,Z,ie,j,Y,this.dimensions.css.cell.width,this._widthCache,V?ae===q?B:0:-1,V?(ae===U?O:K)-1:-1))}}};a.DomRenderer=F=p([v(7,y.IInstantiationService),v(8,f.ICharSizeService),v(9,y.IOptionsService),v(10,y.IBufferService),v(11,f.ICoreBrowserService),v(12,f.IThemeService)],F)},3787:function(w,a,l){var p=this&&this.__decorate||function(R,D,L,M){var W,z=arguments.length,F=z<3?D:M===null?M=Object.getOwnPropertyDescriptor(D,L):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(R,D,L,M);else for(var B=R.length-1;B>=0;B--)(W=R[B])&&(F=(z<3?W(F):z>3?W(D,L,F):W(D,L))||F);return z>3&&F&&Object.defineProperty(D,L,F),F},v=this&&this.__param||function(R,D){return function(L,M){D(L,M,R)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const c=l(2223),m=l(643),C=l(511),b=l(2585),x=l(8055),f=l(4725),_=l(4269),d=l(6171),h=l(3734);let y=a.DomRendererRowFactory=class{constructor(R,D,L,M,W,z,F){this._document=R,this._characterJoinerService=D,this._optionsService=L,this._coreBrowserService=M,this._coreService=W,this._decorationService=z,this._themeService=F,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,D,L){this._selectionStart=R,this._selectionEnd=D,this._columnSelectMode=L}createRow(R,D,L,M,W,z,F,B,O,q,U){const K=[],V=this._characterJoinerService.getJoinedCharacters(D),A=this._themeService.colors;let I,P=R.getNoBgTrimmedLength();L&&P<z+1&&(P=z+1);let j=0,Y="",Z=0,ie=0,ae=0,X=!1,H=0,re=!1,te=0;const ue=[],le=q!==-1&&U!==-1;for(let pe=0;pe<P;pe++){R.loadCell(pe,this._workCell);let Se=this._workCell.getWidth();if(Se===0)continue;let be=!1,ce=pe,ge=this._workCell;if(V.length>0&&pe===V[0][0]){be=!0;const Oe=V.shift();ge=new _.JoinedCellData(this._workCell,R.translateToString(!0,Oe[0],Oe[1]),Oe[1]-Oe[0]),ce=Oe[1]-1,Se=ge.getWidth()}const Re=this._isCellInSelection(pe,D),Ie=L&&pe===z,ze=le&&pe>=q&&pe<=U;let Qe=!1;this._decorationService.forEachDecorationAtCell(pe,D,void 0,(Oe=>{Qe=!0}));let ut=ge.getChars()||m.WHITESPACE_CELL_CHAR;if(ut===" "&&(ge.isUnderline()||ge.isOverline())&&(ut=" "),te=Se*B-O.get(ut,ge.isBold(),ge.isItalic()),I){if(j&&(Re&&re||!Re&&!re&&ge.bg===Z)&&(Re&&re&&A.selectionForeground||ge.fg===ie)&&ge.extended.ext===ae&&ze===X&&te===H&&!Ie&&!be&&!Qe){ge.isInvisible()?Y+=m.WHITESPACE_CELL_CHAR:Y+=ut,j++;continue}j&&(I.textContent=Y),I=this._document.createElement("span"),j=0,Y=""}else I=this._document.createElement("span");if(Z=ge.bg,ie=ge.fg,ae=ge.extended.ext,X=ze,H=te,re=Re,be&&z>=pe&&z<=ce&&(z=pe),!this._coreService.isCursorHidden&&Ie&&this._coreService.isCursorInitialized){if(ue.push("xterm-cursor"),this._coreBrowserService.isFocused)F&&ue.push("xterm-cursor-blink"),ue.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(W)switch(W){case"outline":ue.push("xterm-cursor-outline");break;case"block":ue.push("xterm-cursor-block");break;case"bar":ue.push("xterm-cursor-bar");break;case"underline":ue.push("xterm-cursor-underline")}}if(ge.isBold()&&ue.push("xterm-bold"),ge.isItalic()&&ue.push("xterm-italic"),ge.isDim()&&ue.push("xterm-dim"),Y=ge.isInvisible()?m.WHITESPACE_CELL_CHAR:ge.getChars()||m.WHITESPACE_CELL_CHAR,ge.isUnderline()&&(ue.push(`xterm-underline-${ge.extended.underlineStyle}`),Y===" "&&(Y=" "),!ge.isUnderlineColorDefault()))if(ge.isUnderlineColorRGB())I.style.textDecorationColor=`rgb(${h.AttributeData.toColorRGB(ge.getUnderlineColor()).join(",")})`;else{let Oe=ge.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ge.isBold()&&Oe<8&&(Oe+=8),I.style.textDecorationColor=A.ansi[Oe].css}ge.isOverline()&&(ue.push("xterm-overline"),Y===" "&&(Y=" ")),ge.isStrikethrough()&&ue.push("xterm-strikethrough"),ze&&(I.style.textDecoration="underline");let qe=ge.getFgColor(),pt=ge.getFgColorMode(),Ne=ge.getBgColor(),Je=ge.getBgColorMode();const ht=!!ge.isInverse();if(ht){const Oe=qe;qe=Ne,Ne=Oe;const Rn=pt;pt=Je,Je=Rn}let $e,_r,ot,Rt=!1;switch(this._decorationService.forEachDecorationAtCell(pe,D,void 0,(Oe=>{Oe.options.layer!=="top"&&Rt||(Oe.backgroundColorRGB&&(Je=50331648,Ne=Oe.backgroundColorRGB.rgba>>8&16777215,$e=Oe.backgroundColorRGB),Oe.foregroundColorRGB&&(pt=50331648,qe=Oe.foregroundColorRGB.rgba>>8&16777215,_r=Oe.foregroundColorRGB),Rt=Oe.options.layer==="top")})),!Rt&&Re&&($e=this._coreBrowserService.isFocused?A.selectionBackgroundOpaque:A.selectionInactiveBackgroundOpaque,Ne=$e.rgba>>8&16777215,Je=50331648,Rt=!0,A.selectionForeground&&(pt=50331648,qe=A.selectionForeground.rgba>>8&16777215,_r=A.selectionForeground)),Rt&&ue.push("xterm-decoration-top"),Je){case 16777216:case 33554432:ot=A.ansi[Ne],ue.push(`xterm-bg-${Ne}`);break;case 50331648:ot=x.channels.toColor(Ne>>16,Ne>>8&255,255&Ne),this._addStyle(I,`background-color:#${k((Ne>>>0).toString(16),"0",6)}`);break;default:ht?(ot=A.foreground,ue.push(`xterm-bg-${c.INVERTED_DEFAULT_COLOR}`)):ot=A.background}switch($e||ge.isDim()&&($e=x.color.multiplyOpacity(ot,.5)),pt){case 16777216:case 33554432:ge.isBold()&&qe<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(qe+=8),this._applyMinimumContrast(I,ot,A.ansi[qe],ge,$e,void 0)||ue.push(`xterm-fg-${qe}`);break;case 50331648:const Oe=x.channels.toColor(qe>>16&255,qe>>8&255,255&qe);this._applyMinimumContrast(I,ot,Oe,ge,$e,_r)||this._addStyle(I,`color:#${k(qe.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(I,ot,A.foreground,ge,$e,_r)||ht&&ue.push(`xterm-fg-${c.INVERTED_DEFAULT_COLOR}`)}ue.length&&(I.className=ue.join(" "),ue.length=0),Ie||be||Qe?I.textContent=Y:j++,te!==this.defaultSpacing&&(I.style.letterSpacing=`${te}px`),K.push(I),pe=ce}return I&&j&&(I.textContent=Y),K}_applyMinimumContrast(R,D,L,M,W,z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,d.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const F=this._getContrastCache(M);let B;if(W||z||(B=F.getColor(D.rgba,L.rgba)),B===void 0){const O=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);B=x.color.ensureContrastRatio(W||D,z||L,O),F.setColor((W||D).rgba,(z||L).rgba,B??null)}return!!B&&(this._addStyle(R,`color:${B.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 L=this._selectionStart,M=this._selectionEnd;return!(!L||!M)&&(this._columnSelectMode?L[0]<=M[0]?R>=L[0]&&D>=L[1]&&R<M[0]&&D<=M[1]:R<L[0]&&D>=L[1]&&R>=M[0]&&D<=M[1]:D>L[1]&&D<M[1]||L[1]===M[1]&&D===L[1]&&R>=L[0]&&R<M[0]||L[1]<M[1]&&D===M[1]&&R<M[0]||L[1]<M[1]&&D===L[1]&&R>=L[0])}};function k(R,D,L){for(;R.length<L;)R=D+R;return R}a.DomRendererRowFactory=y=p([v(1,f.ICharacterJoinerService),v(2,b.IOptionsService),v(3,f.ICoreBrowserService),v(4,b.ICoreService),v(5,b.IDecorationService),v(6,f.IThemeService)],y)},2550:(w,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(l,p){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=l.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=l.createElement("span");v.classList.add("xterm-char-measure-element");const c=l.createElement("span");c.classList.add("xterm-char-measure-element"),c.style.fontWeight="bold";const m=l.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontStyle="italic";const C=l.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontWeight="bold",C.style.fontStyle="italic",this._measureElements=[v,c,m,C],this._container.appendChild(v),this._container.appendChild(c),this._container.appendChild(m),this._container.appendChild(C),p.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(l,p,v,c){l===this._font&&p===this._fontSize&&v===this._weight&&c===this._weightBold||(this._font=l,this._fontSize=p,this._weight=v,this._weightBold=c,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${v}`,this._measureElements[1].style.fontWeight=`${c}`,this._measureElements[2].style.fontWeight=`${v}`,this._measureElements[3].style.fontWeight=`${c}`,this.clear())}get(l,p,v){let c=0;if(!p&&!v&&l.length===1&&(c=l.charCodeAt(0))<256){if(this._flat[c]!==-9999)return this._flat[c];const b=this._measure(l,0);return b>0&&(this._flat[c]=b),b}let m=l;p&&(m+="B"),v&&(m+="I");let C=this._holey.get(m);if(C===void 0){let b=0;p&&(b|=1),v&&(b|=2),C=this._measure(l,b),C>0&&this._holey.set(m,C)}return C}_measure(l,p){const v=this._measureElements[p];return v.textContent=l.repeat(32),v.offsetWidth/32}}},2223:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const p=l(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=p.isFirefox||p.isLegacyEdge?"bottom":"ideographic"},6171:(w,a)=>{function l(v){return 57508<=v&&v<=57558}function p(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=l,a.isRestrictedPowerlineGlyph=function(v){return 57520<=v&&v<=57527},a.isEmoji=p,a.allowRescaling=function(v,c,m,C){return c===1&&m>Math.ceil(1.5*C)&&v!==void 0&&v>255&&!p(v)&&!l(v)&&!(function(b){return 57344<=b&&b<=63743})(v)},a.treatGlyphAsBackgroundColor=function(v){return l(v)||(function(c){return 9472<=c&&c<=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,c,m=0){return(v-(2*Math.round(c)-m))%(2*Math.round(c))}},6052:(w,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class l{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,c,m,C=!1){if(this.selectionStart=c,this.selectionEnd=m,!c||!m||c[0]===m[0]&&c[1]===m[1])return void this.clear();const b=v.buffers.active.ydisp,x=c[1]-b,f=m[1]-b,_=Math.max(x,0),d=Math.min(f,v.rows-1);_>=v.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=C,this.viewportStartRow=x,this.viewportEndRow=f,this.viewportCappedStartRow=_,this.viewportCappedEndRow=d,this.startCol=c[0],this.endCol=m[0])}isCellSelected(v,c,m){return!!this.hasSelection&&(m-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?c>=this.startCol&&m>=this.viewportCappedStartRow&&c<this.endCol&&m<=this.viewportCappedEndRow:c<this.startCol&&m>=this.viewportCappedStartRow&&c>=this.endCol&&m<=this.viewportCappedEndRow:m>this.viewportStartRow&&m<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&m===this.viewportStartRow&&c>=this.startCol&&c<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportEndRow&&c<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportStartRow&&c>=this.startCol)}}a.createSelectionRenderModel=function(){return new l}},456:(w,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(l){this._bufferService=l,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 l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?l%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)-1]:[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[l,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[Math.max(l,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const l=this.selectionStart,p=this.selectionEnd;return!(!l||!p)&&(l[1]>p[1]||l[1]===p[1]&&l[0]>p[0])}handleTrim(l){return this.selectionStart&&(this.selectionStart[1]-=l),this.selectionEnd&&(this.selectionEnd[1]-=l),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(w,a,l){var p=this&&this.__decorate||function(d,h,y,k){var R,D=arguments.length,L=D<3?h:k===null?k=Object.getOwnPropertyDescriptor(h,y):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(d,h,y,k);else for(var M=d.length-1;M>=0;M--)(R=d[M])&&(L=(D<3?R(L):D>3?R(h,y,L):R(h,y))||L);return D>3&&L&&Object.defineProperty(h,y,L),L},v=this&&this.__param||function(d,h){return function(y,k){h(y,k,d)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const c=l(2585),m=l(8460),C=l(844);let b=a.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(d,h,y){super(),this._optionsService=y,this.width=0,this.height=0,this._onCharSizeChange=this.register(new m.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new _(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=p([v(2,c.IOptionsService)],b);class x extends C.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(h,y){h!==void 0&&h>0&&y!==void 0&&y>0&&(this._result.width=h,this._result.height=y)}}class f extends x{constructor(h,y,k){super(),this._document=h,this._parentElement=y,this._optionsService=k,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 _ extends x{constructor(h){super(),this._optionsService=h,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const y=this._ctx.measureText("W");if(!("width"in y&&"fontBoundingBoxAscent"in y&&"fontBoundingBoxDescent"in y))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(w,a,l){var p=this&&this.__decorate||function(_,d,h,y){var k,R=arguments.length,D=R<3?d:y===null?y=Object.getOwnPropertyDescriptor(d,h):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(_,d,h,y);else for(var L=_.length-1;L>=0;L--)(k=_[L])&&(D=(R<3?k(D):R>3?k(d,h,D):k(d,h))||D);return R>3&&D&&Object.defineProperty(d,h,D),D},v=this&&this.__param||function(_,d){return function(h,y){d(h,y,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const c=l(3734),m=l(643),C=l(511),b=l(2585);class x extends c.AttributeData{constructor(d,h,y){super(),this.content=0,this.combinedData="",this.fg=d.fg,this.bg=d.bg,this.combinedData=h,this._width=y}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=x;let f=a.CharacterJoinerService=class am{constructor(d){this._bufferService=d,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.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 y=[],k=h.translateToString(!0);let R=0,D=0,L=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(k,L,D,h,R);for(let B=0;B<F.length;B++)y.push(F[B])}R=z,L=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(k,L,D,h,R);for(let F=0;F<z.length;F++)y.push(z[F])}return y}_getJoinedRanges(d,h,y,k,R){const D=d.substring(h,y);let L=[];try{L=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++)am._mergeRanges(L,W[z])}catch(W){console.error(W)}return this._stringRangesToCellRanges(L,k,R),L}_stringRangesToCellRanges(d,h,y){let k=0,R=!1,D=0,L=d[k];if(L){for(let M=y;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&&L[0]<=D&&(L[0]=M,R=!0),L[1]<=D){if(L[1]=M,L=d[++k],!L)break;L[0]<=D?(L[0]=M,R=!0):R=!1}D+=z}}L&&(L[1]=this._bufferService.cols)}}static _mergeRanges(d,h){let y=!1;for(let k=0;k<d.length;k++){const R=d[k];if(y){if(h[1]<=R[0])return d[k-1][1]=h[1],d;if(h[1]<=R[1])return d[k-1][1]=Math.max(h[1],R[1]),d.splice(k,1),d;d.splice(k,1),k--}else{if(h[1]<=R[0])return d.splice(k,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]),y=!0)}}return y?d[d.length-1][1]=h[1]:d.push(h),d}};a.CharacterJoinerService=f=p([v(0,b.IBufferService)],f)},5114:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const p=l(844),v=l(8460),c=l(3656);class m extends p.Disposable{constructor(x,f,_){super(),this._textarea=x,this._window=f,this.mainDocument=_,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new C(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(x){this._window!==x&&(this._window=x,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 C extends p.Disposable{constructor(x){super(),this._parentWindow=x,this._windowResizeListener=this.register(new p.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,p.toDisposable)((()=>this.clearListener())))}setWindow(x){this._parentWindow=x,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,c.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var x;this._outerListener&&((x=this._resolutionMediaMatchList)==null||x.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:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const p=l(844);class v extends p.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,p.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(m){return this.linkProviders.push(m),{dispose:()=>{const C=this.linkProviders.indexOf(m);C!==-1&&this.linkProviders.splice(C,1)}}}}a.LinkProviderService=v},8934:function(w,a,l){var p=this&&this.__decorate||function(b,x,f,_){var d,h=arguments.length,y=h<3?x:_===null?_=Object.getOwnPropertyDescriptor(x,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(b,x,f,_);else for(var k=b.length-1;k>=0;k--)(d=b[k])&&(y=(h<3?d(y):h>3?d(x,f,y):d(x,f))||y);return h>3&&y&&Object.defineProperty(x,f,y),y},v=this&&this.__param||function(b,x){return function(f,_){x(f,_,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const c=l(4725),m=l(9806);let C=a.MouseService=class{constructor(b,x){this._renderService=b,this._charSizeService=x}getCoords(b,x,f,_,d){return(0,m.getCoords)(window,b,x,f,_,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,d)}getMouseReportCoords(b,x){const f=(0,m.getCoordsRelativeToElement)(window,b,x);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=C=p([v(0,c.IRenderService),v(1,c.ICharSizeService)],C)},3230:function(w,a,l){var p=this&&this.__decorate||function(d,h,y,k){var R,D=arguments.length,L=D<3?h:k===null?k=Object.getOwnPropertyDescriptor(h,y):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(d,h,y,k);else for(var M=d.length-1;M>=0;M--)(R=d[M])&&(L=(D<3?R(L):D>3?R(h,y,L):R(h,y))||L);return D>3&&L&&Object.defineProperty(h,y,L),L},v=this&&this.__param||function(d,h){return function(y,k){h(y,k,d)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const c=l(6193),m=l(4725),C=l(8460),b=l(844),x=l(7226),f=l(2585);let _=a.RenderService=class extends b.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(d,h,y,k,R,D,L,M){super(),this._rowCount=d,this._charSizeService=k,this._renderer=this.register(new b.MutableDisposable),this._pausedResizeTask=new x.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 C.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new C.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new C.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new C.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new c.RenderDebouncer(((W,z)=>this._renderRows(W,z)),L),this.register(this._renderDebouncer),this.register(L.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(y.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(y.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(y.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(L.window,h),this.register(L.onWindowChange((W=>this._registerIntersectionObserver(W,h))))}_registerIntersectionObserver(d,h){if("IntersectionObserver"in d){const y=new d.IntersectionObserver((k=>this._handleIntersectionChange(k[k.length-1])),{threshold:0});y.observe(h),this._observerDisposable.value=(0,b.toDisposable)((()=>y.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,y=!1){this._isPaused?this._needsFullRefresh=!0:(y||(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 y;return(y=this._renderer.value)==null?void 0:y.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,y){var k;this._selectionState.start=d,this._selectionState.end=h,this._selectionState.columnSelectMode=y,(k=this._renderer.value)==null||k.handleSelectionChanged(d,h,y)}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)],_)},9312:function(w,a,l){var p=this&&this.__decorate||function(L,M,W,z){var F,B=arguments.length,O=B<3?M:z===null?z=Object.getOwnPropertyDescriptor(M,W):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(L,M,W,z);else for(var q=L.length-1;q>=0;q--)(F=L[q])&&(O=(B<3?F(O):B>3?F(M,W,O):F(M,W))||O);return B>3&&O&&Object.defineProperty(M,W,O),O},v=this&&this.__param||function(L,M){return function(W,z){M(W,z,L)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const c=l(9806),m=l(9504),C=l(456),b=l(4725),x=l(8460),f=l(844),_=l(6114),d=l(4841),h=l(511),y=l(2585),k=" ",R=new RegExp(k,"g");let D=a.SelectionService=class extends f.Disposable{constructor(L,M,W,z,F,B,O,q,U){super(),this._element=L,this._screenElement=M,this._linkifier=W,this._bufferService=z,this._coreService=F,this._mouseService=B,this._optionsService=O,this._renderService=q,this._coreBrowserService=U,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 x.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new x.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new x.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new x.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 C.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 L=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!L||!M||L[0]===M[0]&&L[1]===M[1])}get selectionText(){const L=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!L||!M)return"";const W=this._bufferService.buffer,z=[];if(this._activeSelectionMode===3){if(L[0]===M[0])return"";const F=L[0]<M[0]?L[0]:M[0],B=L[0]<M[0]?M[0]:L[0];for(let O=L[1];O<=M[1];O++){const q=W.translateBufferLineToString(O,!0,F,B);z.push(q)}}else{const F=L[1]===M[1]?M[0]:void 0;z.push(W.translateBufferLineToString(L[1],!0,L[0],F));for(let B=L[1]+1;B<=M[1]-1;B++){const O=W.lines.get(B),q=W.translateBufferLineToString(B,!0);O!=null&&O.isWrapped?z[z.length-1]+=q:z.push(q)}if(L[1]!==M[1]){const B=W.lines.get(M[1]),O=W.translateBufferLineToString(M[1],!0,0,M[0]);B&&B.isWrapped?z[z.length-1]+=O:z.push(O)}}return z.map((F=>F.replace(R," "))).join(_.isWindows?`\r
|
|
67
|
+
`:`
|
|
68
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(L){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),_.isLinux&&L&&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(L){const M=this._getMouseBufferCoords(L),W=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!!(W&&z&&M)&&this._areCoordsInSelection(M,W,z)}isCellInSelection(L,M){const W=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!(!W||!z)&&this._areCoordsInSelection([L,M],W,z)}_areCoordsInSelection(L,M,W){return L[1]>M[1]&&L[1]<W[1]||M[1]===W[1]&&L[1]===M[1]&&L[0]>=M[0]&&L[0]<W[0]||M[1]<W[1]&&L[1]===W[1]&&L[0]<W[0]||M[1]<W[1]&&L[1]===M[1]&&L[0]>=M[0]}_selectWordAtCursor(L,M){var F,B;const W=(B=(F=this._linkifier.currentLink)==null?void 0:F.link)==null?void 0:B.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(L);return!!z&&(this._selectWordAt(z,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(L,M){this._model.clearSelection(),L=Math.max(L,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,L],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(L){this._model.handleTrim(L)&&this.refresh()}_getMouseBufferCoords(L){const M=this._mouseService.getCoords(L,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(L){let M=(0,c.getCoordsRelativeToElement)(this._coreBrowserService.window,L,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(L){return _.isMac?L.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:L.shiftKey}handleMouseDown(L){if(this._mouseDownTimeStamp=L.timeStamp,(L.button!==2||!this.hasSelection)&&L.button===0){if(!this._enabled){if(!this.shouldForceSelection(L))return;L.stopPropagation()}L.preventDefault(),this._dragScrollAmount=0,this._enabled&&L.shiftKey?this._handleIncrementalClick(L):L.detail===1?this._handleSingleClick(L):L.detail===2?this._handleDoubleClick(L):L.detail===3&&this._handleTripleClick(L),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(L){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(L))}_handleSingleClick(L){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(L)?3:0,this._model.selectionStart=this._getMouseBufferCoords(L),!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(L){this._selectWordAtCursor(L,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(L){const M=this._getMouseBufferCoords(L);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(L){return L.altKey&&!(_.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(L){if(L.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(L),!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(L),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 L=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(L.ydisp+this._bufferService.rows,L.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=L.ydisp),this.refresh()}}_handleMouseUp(L){const M=L.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&L.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const W=this._mouseService.getCoords(L,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 L=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,W=!(!L||!M||L[0]===M[0]&&L[1]===M[1]);W?L&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&L[0]===this._oldSelectionStart[0]&&L[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(L,M,W)):this._oldHasSelection&&this._fireOnSelectionChange(L,M,W)}_fireOnSelectionChange(L,M,W){this._oldSelectionStart=L,this._oldSelectionEnd=M,this._oldHasSelection=W,this._onSelectionChange.fire()}_handleBufferActivate(L){this.clearSelection(),this._trimListener.dispose(),this._trimListener=L.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(L,M){let W=M;for(let z=0;M>=z;z++){const F=L.loadCell(z,this._workCell).getChars().length;this._workCell.getWidth()===0?W--:F>1&&M!==z&&(W+=F-1)}return W}setSelection(L,M,W){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[L,M],this._model.selectionStartLength=W,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(L){this._isClickInSelection(L)||(this._selectWordAtCursor(L,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(L,M,W=!0,z=!0){if(L[0]>=this._bufferService.cols)return;const F=this._bufferService.buffer,B=F.lines.get(L[1]);if(!B)return;const O=F.translateBufferLineToString(L[1],!1);let q=this._convertViewportColToCharacterIndex(B,L[0]),U=q;const K=L[0]-q;let V=0,A=0,I=0,P=0;if(O.charAt(q)===" "){for(;q>0&&O.charAt(q-1)===" ";)q--;for(;U<O.length&&O.charAt(U+1)===" ";)U++}else{let Z=L[0],ie=L[0];B.getWidth(Z)===0&&(V++,Z--),B.getWidth(ie)===2&&(A++,ie++);const ae=B.getString(ie).length;for(ae>1&&(P+=ae-1,U+=ae-1);Z>0&&q>0&&!this._isCharWordSeparator(B.loadCell(Z-1,this._workCell));){B.loadCell(Z-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(V++,Z--):X>1&&(I+=X-1,q-=X-1),q--,Z--}for(;ie<B.length&&U+1<O.length&&!this._isCharWordSeparator(B.loadCell(ie+1,this._workCell));){B.loadCell(ie+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(A++,ie++):X>1&&(P+=X-1,U+=X-1),U++,ie++}}U++;let j=q+K-V+I,Y=Math.min(this._bufferService.cols,U-q+V+A-I-P);if(M||O.slice(q,U).trim()!==""){if(W&&j===0&&B.getCodePoint(0)!==32){const Z=F.lines.get(L[1]-1);if(Z&&B.isWrapped&&Z.getCodePoint(this._bufferService.cols-1)!==32){const ie=this._getWordAt([this._bufferService.cols-1,L[1]-1],!1,!0,!1);if(ie){const ae=this._bufferService.cols-ie.start;j-=ae,Y+=ae}}}if(z&&j+Y===this._bufferService.cols&&B.getCodePoint(this._bufferService.cols-1)!==32){const Z=F.lines.get(L[1]+1);if(Z!=null&&Z.isWrapped&&Z.getCodePoint(0)!==32){const ie=this._getWordAt([0,L[1]+1],!1,!1,!0);ie&&(Y+=ie.length)}}return{start:j,length:Y}}}_selectWordAt(L,M){const W=this._getWordAt(L,M);if(W){for(;W.start<0;)W.start+=this._bufferService.cols,L[1]--;this._model.selectionStart=[W.start,L[1]],this._model.selectionStartLength=W.length}}_selectToWordAt(L){const M=this._getWordAt(L,!0);if(M){let W=L[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(L){return L.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(L.getChars())>=0}_selectLineAt(L){const M=this._bufferService.buffer.getWrappedRangeForLine(L),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=p([v(3,y.IBufferService),v(4,y.ICoreService),v(5,b.IMouseService),v(6,y.IOptionsService),v(7,b.IRenderService),v(8,b.ICoreBrowserService)],D)},4725:(w,a,l)=>{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 p=l(8343);a.ICharSizeService=(0,p.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,p.createDecorator)("CoreBrowserService"),a.IMouseService=(0,p.createDecorator)("MouseService"),a.IRenderService=(0,p.createDecorator)("RenderService"),a.ISelectionService=(0,p.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,p.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,p.createDecorator)("ThemeService"),a.ILinkProviderService=(0,p.createDecorator)("LinkProviderService")},6731:function(w,a,l){var p=this&&this.__decorate||function(D,L,M,W){var z,F=arguments.length,B=F<3?L:W===null?W=Object.getOwnPropertyDescriptor(L,M):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(D,L,M,W);else for(var O=D.length-1;O>=0;O--)(z=D[O])&&(B=(F<3?z(B):F>3?z(L,M,B):z(L,M))||B);return F>3&&B&&Object.defineProperty(L,M,B),B},v=this&&this.__param||function(D,L){return function(M,W){L(M,W,D)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const c=l(7239),m=l(8055),C=l(8460),b=l(844),x=l(2585),f=m.css.toColor("#ffffff"),_=m.css.toColor("#000000"),d=m.css.toColor("#ffffff"),h=m.css.toColor("#000000"),y={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")],L=[0,95,135,175,215,255];for(let M=0;M<216;M++){const W=L[M/36%6|0],z=L[M/6%6|0],F=L[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 k=a.ThemeService=class extends b.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new c.ColorContrastCache,this._halfContrastCache=new c.ColorContrastCache,this._onChangeColors=this.register(new C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:f,background:_,cursor:d,cursorAccent:h,selectionForeground:void 0,selectionBackgroundTransparent:y,selectionBackgroundOpaque:m.color.blend(_,y),selectionInactiveBackgroundTransparent:y,selectionInactiveBackgroundOpaque:m.color.blend(_,y),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 L=this._colors;if(L.foreground=R(D.foreground,f),L.background=R(D.background,_),L.cursor=R(D.cursor,d),L.cursorAccent=R(D.cursorAccent,h),L.selectionBackgroundTransparent=R(D.selectionBackground,y),L.selectionBackgroundOpaque=m.color.blend(L.background,L.selectionBackgroundTransparent),L.selectionInactiveBackgroundTransparent=R(D.selectionInactiveBackground,L.selectionBackgroundTransparent),L.selectionInactiveBackgroundOpaque=m.color.blend(L.background,L.selectionInactiveBackgroundTransparent),L.selectionForeground=D.selectionForeground?R(D.selectionForeground,m.NULL_COLOR):void 0,L.selectionForeground===m.NULL_COLOR&&(L.selectionForeground=void 0),m.color.isOpaque(L.selectionBackgroundTransparent)&&(L.selectionBackgroundTransparent=m.color.opacity(L.selectionBackgroundTransparent,.3)),m.color.isOpaque(L.selectionInactiveBackgroundTransparent)&&(L.selectionInactiveBackgroundTransparent=m.color.opacity(L.selectionInactiveBackgroundTransparent,.3)),L.ansi=a.DEFAULT_ANSI_COLORS.slice(),L.ansi[0]=R(D.black,a.DEFAULT_ANSI_COLORS[0]),L.ansi[1]=R(D.red,a.DEFAULT_ANSI_COLORS[1]),L.ansi[2]=R(D.green,a.DEFAULT_ANSI_COLORS[2]),L.ansi[3]=R(D.yellow,a.DEFAULT_ANSI_COLORS[3]),L.ansi[4]=R(D.blue,a.DEFAULT_ANSI_COLORS[4]),L.ansi[5]=R(D.magenta,a.DEFAULT_ANSI_COLORS[5]),L.ansi[6]=R(D.cyan,a.DEFAULT_ANSI_COLORS[6]),L.ansi[7]=R(D.white,a.DEFAULT_ANSI_COLORS[7]),L.ansi[8]=R(D.brightBlack,a.DEFAULT_ANSI_COLORS[8]),L.ansi[9]=R(D.brightRed,a.DEFAULT_ANSI_COLORS[9]),L.ansi[10]=R(D.brightGreen,a.DEFAULT_ANSI_COLORS[10]),L.ansi[11]=R(D.brightYellow,a.DEFAULT_ANSI_COLORS[11]),L.ansi[12]=R(D.brightBlue,a.DEFAULT_ANSI_COLORS[12]),L.ansi[13]=R(D.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),L.ansi[14]=R(D.brightCyan,a.DEFAULT_ANSI_COLORS[14]),L.ansi[15]=R(D.brightWhite,a.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const M=Math.min(L.ansi.length-16,D.extendedAnsi.length);for(let W=0;W<M;W++)L.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 L=0;L<this._restoreColors.ansi.length;++L)this._colors.ansi[L]=this._restoreColors.ansi[L]}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,L){if(D!==void 0)try{return m.css.toColor(D)}catch{}return L}a.ThemeService=k=p([v(0,x.IOptionsService)],k)},6349:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const p=l(8460),v=l(844);class c extends v.Disposable{constructor(C){super(),this._maxLength=C,this.onDeleteEmitter=this.register(new p.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new p.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new p.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(C){if(this._maxLength===C)return;const b=new Array(C);for(let x=0;x<Math.min(C,this.length);x++)b[x]=this._array[this._getCyclicIndex(x)];this._array=b,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let b=this._length;b<C;b++)this._array[b]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,b){this._array[this._getCyclicIndex(C)]=b}push(C){this._array[this._getCyclicIndex(this._length)]=C,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(C,b,...x){if(b){for(let f=C;f<this._length-b;f++)this._array[this._getCyclicIndex(f)]=this._array[this._getCyclicIndex(f+b)];this._length-=b,this.onDeleteEmitter.fire({index:C,amount:b})}for(let f=this._length-1;f>=C;f--)this._array[this._getCyclicIndex(f+x.length)]=this._array[this._getCyclicIndex(f)];for(let f=0;f<x.length;f++)this._array[this._getCyclicIndex(C+f)]=x[f];if(x.length&&this.onInsertEmitter.fire({index:C,amount:x.length}),this._length+x.length>this._maxLength){const f=this._length+x.length-this._maxLength;this._startIndex+=f,this._length=this._maxLength,this.onTrimEmitter.fire(f)}else this._length+=x.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,b,x){if(!(b<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+x<0)throw new Error("Cannot shift elements in list beyond index 0");if(x>0){for(let _=b-1;_>=0;_--)this.set(C+_+x,this.get(C+_));const f=C+b+x-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(C+f+x,this.get(C+f))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}a.CircularList=c},1439:(w,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function l(p,v=5){if(typeof p!="object")return p;const c=Array.isArray(p)?[]:{};for(const m in p)c[m]=v<=1?p[m]:p[m]&&l(p[m],v-1);return c}},8055:(w,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 l=0,p=0,v=0,c=0;var m,C,b,x,f;function _(h){const y=h.toString(16);return y.length<2?"0"+y:y}function d(h,y){return h<y?(y+.05)/(h+.05):(h+.05)/(y+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(h){h.toCss=function(y,k,R,D){return D!==void 0?`#${_(y)}${_(k)}${_(R)}${_(D)}`:`#${_(y)}${_(k)}${_(R)}`},h.toRgba=function(y,k,R,D=255){return(y<<24|k<<16|R<<8|D)>>>0},h.toColor=function(y,k,R,D){return{css:h.toCss(y,k,R,D),rgba:h.toRgba(y,k,R,D)}}})(m||(a.channels=m={})),(function(h){function y(k,R){return c=Math.round(255*R),[l,p,v]=f.toChannels(k.rgba),{css:m.toCss(l,p,v,c),rgba:m.toRgba(l,p,v,c)}}h.blend=function(k,R){if(c=(255&R.rgba)/255,c===1)return{css:R.css,rgba:R.rgba};const D=R.rgba>>24&255,L=R.rgba>>16&255,M=R.rgba>>8&255,W=k.rgba>>24&255,z=k.rgba>>16&255,F=k.rgba>>8&255;return l=W+Math.round((D-W)*c),p=z+Math.round((L-z)*c),v=F+Math.round((M-F)*c),{css:m.toCss(l,p,v),rgba:m.toRgba(l,p,v)}},h.isOpaque=function(k){return(255&k.rgba)==255},h.ensureContrastRatio=function(k,R,D){const L=f.ensureContrastRatio(k.rgba,R.rgba,D);if(L)return m.toColor(L>>24&255,L>>16&255,L>>8&255)},h.opaque=function(k){const R=(255|k.rgba)>>>0;return[l,p,v]=f.toChannels(R),{css:m.toCss(l,p,v),rgba:R}},h.opacity=y,h.multiplyOpacity=function(k,R){return c=255&k.rgba,y(k,c*R/255)},h.toColorRGB=function(k){return[k.rgba>>24&255,k.rgba>>16&255,k.rgba>>8&255]}})(C||(a.color=C={})),(function(h){let y,k;try{const R=document.createElement("canvas");R.width=1,R.height=1;const D=R.getContext("2d",{willReadFrequently:!0});D&&(y=D,y.globalCompositeOperation="copy",k=y.createLinearGradient(0,0,1,1))}catch{}h.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return l=parseInt(R.slice(1,2).repeat(2),16),p=parseInt(R.slice(2,3).repeat(2),16),v=parseInt(R.slice(3,4).repeat(2),16),m.toColor(l,p,v);case 5:return l=parseInt(R.slice(1,2).repeat(2),16),p=parseInt(R.slice(2,3).repeat(2),16),v=parseInt(R.slice(3,4).repeat(2),16),c=parseInt(R.slice(4,5).repeat(2),16),m.toColor(l,p,v,c);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 l=parseInt(D[1]),p=parseInt(D[2]),v=parseInt(D[3]),c=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),m.toColor(l,p,v,c);if(!y||!k)throw new Error("css.toColor: Unsupported css format");if(y.fillStyle=k,y.fillStyle=R,typeof y.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(y.fillRect(0,0,1,1),[l,p,v,c]=y.getImageData(0,0,1,1).data,c!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:m.toRgba(l,p,v,c),css:R}}})(b||(a.css=b={})),(function(h){function y(k,R,D){const L=k/255,M=R/255,W=D/255;return .2126*(L<=.03928?L/12.92:Math.pow((L+.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(k){return y(k>>16&255,k>>8&255,255&k)},h.relativeLuminance2=y})(x||(a.rgb=x={})),(function(h){function y(R,D,L){const M=R>>24&255,W=R>>16&255,z=R>>8&255;let F=D>>24&255,B=D>>16&255,O=D>>8&255,q=d(x.relativeLuminance2(F,B,O),x.relativeLuminance2(M,W,z));for(;q<L&&(F>0||B>0||O>0);)F-=Math.max(0,Math.ceil(.1*F)),B-=Math.max(0,Math.ceil(.1*B)),O-=Math.max(0,Math.ceil(.1*O)),q=d(x.relativeLuminance2(F,B,O),x.relativeLuminance2(M,W,z));return(F<<24|B<<16|O<<8|255)>>>0}function k(R,D,L){const M=R>>24&255,W=R>>16&255,z=R>>8&255;let F=D>>24&255,B=D>>16&255,O=D>>8&255,q=d(x.relativeLuminance2(F,B,O),x.relativeLuminance2(M,W,z));for(;q<L&&(F<255||B<255||O<255);)F=Math.min(255,F+Math.ceil(.1*(255-F))),B=Math.min(255,B+Math.ceil(.1*(255-B))),O=Math.min(255,O+Math.ceil(.1*(255-O))),q=d(x.relativeLuminance2(F,B,O),x.relativeLuminance2(M,W,z));return(F<<24|B<<16|O<<8|255)>>>0}h.blend=function(R,D){if(c=(255&D)/255,c===1)return D;const L=D>>24&255,M=D>>16&255,W=D>>8&255,z=R>>24&255,F=R>>16&255,B=R>>8&255;return l=z+Math.round((L-z)*c),p=F+Math.round((M-F)*c),v=B+Math.round((W-B)*c),m.toRgba(l,p,v)},h.ensureContrastRatio=function(R,D,L){const M=x.relativeLuminance(R>>8),W=x.relativeLuminance(D>>8);if(d(M,W)<L){if(W<M){const B=y(R,D,L),O=d(M,x.relativeLuminance(B>>8));if(O<L){const q=k(R,D,L);return O>d(M,x.relativeLuminance(q>>8))?B:q}return B}const z=k(R,D,L),F=d(M,x.relativeLuminance(z>>8));if(F<L){const B=y(R,D,L);return F>d(M,x.relativeLuminance(B>>8))?z:B}return z}},h.reduceLuminance=y,h.increaseLuminance=k,h.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(f||(a.rgba=f={})),a.toPaddedHex=_,a.contrastRatio=d},8969:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const p=l(844),v=l(2585),c=l(4348),m=l(7866),C=l(744),b=l(7302),x=l(6975),f=l(8460),_=l(1753),d=l(1480),h=l(7994),y=l(9282),k=l(5435),R=l(5981),D=l(2660);let L=!1;class M extends p.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 p.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 c.InstantiationService,this.optionsService=this.register(new b.OptionsService(z)),this._instantiationService.setService(v.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.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(x.CoreService)),this._instantiationService.setService(v.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(_.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 k.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,B)=>this._inputHandler.parse(F,B)))),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&&!L&&(this._logService.warn("writeSync is unreliable and will be removed soon."),L=!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,C.MINIMUM_COLS),F=Math.max(F,C.MINIMUM_ROWS),this._bufferService.resize(z,F))}scroll(z,F=!1){this._bufferService.scroll(z,F)}scrollLines(z,F,B){this._bufferService.scrollLines(z,F,B)}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(y.updateWindowsModeWrappedState.bind(null,this._bufferService))),z.push(this.registerCsiHandler({final:"H"},(()=>((0,y.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,p.toDisposable)((()=>{for(const F of z)F.dispose()}))}}}a.CoreTerminal=M},8460:(w,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=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let p=0;p<this._listeners.length;p++)if(this._listeners[p]===l)return void this._listeners.splice(p,1)}}})),this._event}fire(l,p){const v=[];for(let c=0;c<this._listeners.length;c++)v.push(this._listeners[c]);for(let c=0;c<v.length;c++)v[c].call(void 0,l,p)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(l,p){return l((v=>p.fire(v)))},a.runAndSubscribe=function(l,p){return p(void 0),l((v=>p(v)))}},5435:function(w,a,l){var p=this&&this.__decorate||function(V,A,I,P){var j,Y=arguments.length,Z=Y<3?A:P===null?P=Object.getOwnPropertyDescriptor(A,I):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(V,A,I,P);else for(var ie=V.length-1;ie>=0;ie--)(j=V[ie])&&(Z=(Y<3?j(Z):Y>3?j(A,I,Z):j(A,I))||Z);return Y>3&&Z&&Object.defineProperty(A,I,Z),Z},v=this&&this.__param||function(V,A){return function(I,P){A(I,P,V)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const c=l(2584),m=l(7116),C=l(2015),b=l(844),x=l(482),f=l(8437),_=l(8460),d=l(643),h=l(511),y=l(3734),k=l(2585),R=l(1480),D=l(6242),L=l(6351),M=l(5941),W={"(":0,")":1,"*":2,"+":3,"-":1,".":2},z=131072;function F(V,A){if(V>24)return A.setWinLines||!1;switch(V){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 B;(function(V){V[V.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",V[V.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(B||(a.WindowsOptionsReportType=B={}));let O=0;class q extends b.Disposable{getAttrData(){return this._curAttrData}constructor(A,I,P,j,Y,Z,ie,ae,X=new C.EscapeSequenceParser){super(),this._bufferService=A,this._charsetService=I,this._coreService=P,this._logService=j,this._optionsService=Y,this._oscLinkService=Z,this._coreMouseService=ie,this._unicodeService=ae,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new x.StringToUtf32,this._utf8Decoder=new x.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 _.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new _.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new _.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new _.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new _.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new _.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new _.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new _.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new _.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new _.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new _.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new _.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new _.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 U(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((H=>this._activeBuffer=H.activeBuffer))),this._parser.setCsiHandlerFallback(((H,re)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(H),params:re.toArray()})})),this._parser.setEscHandlerFallback((H=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(H)})})),this._parser.setExecuteHandlerFallback((H=>{this._logService.debug("Unknown EXECUTE code: ",{code:H})})),this._parser.setOscHandlerFallback(((H,re,te)=>{this._logService.debug("Unknown OSC code: ",{identifier:H,action:re,data:te})})),this._parser.setDcsHandlerFallback(((H,re,te)=>{re==="HOOK"&&(te=te.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(H),action:re,payload:te})})),this._parser.setPrintHandler(((H,re,te)=>this.print(H,re,te))),this._parser.registerCsiHandler({final:"@"},(H=>this.insertChars(H))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(H=>this.scrollLeft(H))),this._parser.registerCsiHandler({final:"A"},(H=>this.cursorUp(H))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(H=>this.scrollRight(H))),this._parser.registerCsiHandler({final:"B"},(H=>this.cursorDown(H))),this._parser.registerCsiHandler({final:"C"},(H=>this.cursorForward(H))),this._parser.registerCsiHandler({final:"D"},(H=>this.cursorBackward(H))),this._parser.registerCsiHandler({final:"E"},(H=>this.cursorNextLine(H))),this._parser.registerCsiHandler({final:"F"},(H=>this.cursorPrecedingLine(H))),this._parser.registerCsiHandler({final:"G"},(H=>this.cursorCharAbsolute(H))),this._parser.registerCsiHandler({final:"H"},(H=>this.cursorPosition(H))),this._parser.registerCsiHandler({final:"I"},(H=>this.cursorForwardTab(H))),this._parser.registerCsiHandler({final:"J"},(H=>this.eraseInDisplay(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(H=>this.eraseInDisplay(H,!0))),this._parser.registerCsiHandler({final:"K"},(H=>this.eraseInLine(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(H=>this.eraseInLine(H,!0))),this._parser.registerCsiHandler({final:"L"},(H=>this.insertLines(H))),this._parser.registerCsiHandler({final:"M"},(H=>this.deleteLines(H))),this._parser.registerCsiHandler({final:"P"},(H=>this.deleteChars(H))),this._parser.registerCsiHandler({final:"S"},(H=>this.scrollUp(H))),this._parser.registerCsiHandler({final:"T"},(H=>this.scrollDown(H))),this._parser.registerCsiHandler({final:"X"},(H=>this.eraseChars(H))),this._parser.registerCsiHandler({final:"Z"},(H=>this.cursorBackwardTab(H))),this._parser.registerCsiHandler({final:"`"},(H=>this.charPosAbsolute(H))),this._parser.registerCsiHandler({final:"a"},(H=>this.hPositionRelative(H))),this._parser.registerCsiHandler({final:"b"},(H=>this.repeatPrecedingCharacter(H))),this._parser.registerCsiHandler({final:"c"},(H=>this.sendDeviceAttributesPrimary(H))),this._parser.registerCsiHandler({prefix:">",final:"c"},(H=>this.sendDeviceAttributesSecondary(H))),this._parser.registerCsiHandler({final:"d"},(H=>this.linePosAbsolute(H))),this._parser.registerCsiHandler({final:"e"},(H=>this.vPositionRelative(H))),this._parser.registerCsiHandler({final:"f"},(H=>this.hVPosition(H))),this._parser.registerCsiHandler({final:"g"},(H=>this.tabClear(H))),this._parser.registerCsiHandler({final:"h"},(H=>this.setMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(H=>this.setModePrivate(H))),this._parser.registerCsiHandler({final:"l"},(H=>this.resetMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(H=>this.resetModePrivate(H))),this._parser.registerCsiHandler({final:"m"},(H=>this.charAttributes(H))),this._parser.registerCsiHandler({final:"n"},(H=>this.deviceStatus(H))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(H=>this.deviceStatusPrivate(H))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(H=>this.softReset(H))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(H=>this.setCursorStyle(H))),this._parser.registerCsiHandler({final:"r"},(H=>this.setScrollRegion(H))),this._parser.registerCsiHandler({final:"s"},(H=>this.saveCursor(H))),this._parser.registerCsiHandler({final:"t"},(H=>this.windowOptions(H))),this._parser.registerCsiHandler({final:"u"},(H=>this.restoreCursor(H))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(H=>this.insertColumns(H))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(H=>this.deleteColumns(H))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(H=>this.selectProtected(H))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(H=>this.requestMode(H,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(H=>this.requestMode(H,!1))),this._parser.setExecuteHandler(c.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(c.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(c.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(c.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(c.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(c.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(c.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(c.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(c.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(c.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(c.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(c.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((H=>(this.setTitle(H),this.setIconName(H),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((H=>this.setIconName(H)))),this._parser.registerOscHandler(2,new D.OscHandler((H=>this.setTitle(H)))),this._parser.registerOscHandler(4,new D.OscHandler((H=>this.setOrReportIndexedColor(H)))),this._parser.registerOscHandler(8,new D.OscHandler((H=>this.setHyperlink(H)))),this._parser.registerOscHandler(10,new D.OscHandler((H=>this.setOrReportFgColor(H)))),this._parser.registerOscHandler(11,new D.OscHandler((H=>this.setOrReportBgColor(H)))),this._parser.registerOscHandler(12,new D.OscHandler((H=>this.setOrReportCursorColor(H)))),this._parser.registerOscHandler(104,new D.OscHandler((H=>this.restoreIndexedColor(H)))),this._parser.registerOscHandler(110,new D.OscHandler((H=>this.restoreFgColor(H)))),this._parser.registerOscHandler(111,new D.OscHandler((H=>this.restoreBgColor(H)))),this._parser.registerOscHandler(112,new D.OscHandler((H=>this.restoreCursorColor(H)))),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 H in m.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:H},(()=>this.selectCharset("("+H))),this._parser.registerEscHandler({intermediates:")",final:H},(()=>this.selectCharset(")"+H))),this._parser.registerEscHandler({intermediates:"*",final:H},(()=>this.selectCharset("*"+H))),this._parser.registerEscHandler({intermediates:"+",final:H},(()=>this.selectCharset("+"+H))),this._parser.registerEscHandler({intermediates:"-",final:H},(()=>this.selectCharset("-"+H))),this._parser.registerEscHandler({intermediates:".",final:H},(()=>this.selectCharset("."+H))),this._parser.registerEscHandler({intermediates:"/",final:H},(()=>this.selectCharset("/"+H)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((H=>(this._logService.error("Parsing error: ",H),H))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new L.DcsHandler(((H,re)=>this.requestStatusString(H,re))))}_preserveStack(A,I,P,j){this._parseStack.paused=!0,this._parseStack.cursorStartX=A,this._parseStack.cursorStartY=I,this._parseStack.decodedLength=P,this._parseStack.position=j}_logSlowResolvingAsync(A){this._logService.logLevel<=k.LogLevelEnum.WARN&&Promise.race([A,new Promise(((I,P)=>setTimeout((()=>P("#SLOW_TIMEOUT")),5e3)))]).catch((I=>{if(I!=="#SLOW_TIMEOUT")throw I;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(A,I){let P,j=this._activeBuffer.x,Y=this._activeBuffer.y,Z=0;const ie=this._parseStack.paused;if(ie){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,I))return this._logSlowResolvingAsync(P),P;j=this._parseStack.cursorStartX,Y=this._parseStack.cursorStartY,this._parseStack.paused=!1,A.length>z&&(Z=this._parseStack.position+z)}if(this._logService.logLevel<=k.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof A=="string"?` "${A}"`:` "${Array.prototype.map.call(A,(H=>String.fromCharCode(H))).join("")}"`),typeof A=="string"?A.split("").map((H=>H.charCodeAt(0))):A),this._parseBuffer.length<A.length&&this._parseBuffer.length<z&&(this._parseBuffer=new Uint32Array(Math.min(A.length,z))),ie||this._dirtyRowTracker.clearRange(),A.length>z)for(let H=Z;H<A.length;H+=z){const re=H+z<A.length?H+z:A.length,te=typeof A=="string"?this._stringDecoder.decode(A.substring(H,re),this._parseBuffer):this._utf8Decoder.decode(A.subarray(H,re),this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,te))return this._preserveStack(j,Y,te,H),this._logSlowResolvingAsync(P),P}else if(!ie){const H=typeof A=="string"?this._stringDecoder.decode(A,this._parseBuffer):this._utf8Decoder.decode(A,this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,H))return this._preserveStack(j,Y,H,0),this._logSlowResolvingAsync(P),P}this._activeBuffer.x===j&&this._activeBuffer.y===Y||this._onCursorMove.fire();const ae=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(ae,this._bufferService.rows-1))}print(A,I,P){let j,Y;const Z=this._charsetService.charset,ie=this._optionsService.rawOptions.screenReaderMode,ae=this._bufferService.cols,X=this._coreService.decPrivateModes.wraparound,H=this._coreService.modes.insertMode,re=this._curAttrData;let te=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&P-I>0&&te.getWidth(this._activeBuffer.x-1)===2&&te.setCellFromCodepoint(this._activeBuffer.x-1,0,1,re);let ue=this._parser.precedingJoinState;for(let le=I;le<P;++le){if(j=A[le],j<127&&Z){const ce=Z[String.fromCharCode(j)];ce&&(j=ce.charCodeAt(0))}const pe=this._unicodeService.charProperties(j,ue);Y=R.UnicodeService.extractWidth(pe);const Se=R.UnicodeService.extractShouldJoin(pe),be=Se?R.UnicodeService.extractWidth(ue):0;if(ue=pe,ie&&this._onA11yChar.fire((0,x.stringFromCodePoint)(j)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Y-be>ae){if(X){const ce=te;let ge=this._activeBuffer.x-be;for(this._activeBuffer.x=be,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),te=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),be>0&&te instanceof f.BufferLine&&te.copyCellsFrom(ce,ge,0,be,!1);ge<ae;)ce.setCellFromCodepoint(ge++,0,1,re)}else if(this._activeBuffer.x=ae-1,Y===2)continue}if(Se&&this._activeBuffer.x){const ce=te.getWidth(this._activeBuffer.x-1)?1:2;te.addCodepointToCell(this._activeBuffer.x-ce,j,Y);for(let ge=Y-be;--ge>=0;)te.setCellFromCodepoint(this._activeBuffer.x++,0,0,re)}else if(H&&(te.insertCells(this._activeBuffer.x,Y-be,this._activeBuffer.getNullCell(re)),te.getWidth(ae-1)===2&&te.setCellFromCodepoint(ae-1,d.NULL_CELL_CODE,d.NULL_CELL_WIDTH,re)),te.setCellFromCodepoint(this._activeBuffer.x++,j,Y,re),Y>0)for(;--Y;)te.setCellFromCodepoint(this._activeBuffer.x++,0,0,re)}this._parser.precedingJoinState=ue,this._activeBuffer.x<ae&&P-I>0&&te.getWidth(this._activeBuffer.x)===0&&!te.hasContent(this._activeBuffer.x)&&te.setCellFromCodepoint(this._activeBuffer.x,0,1,re),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(A,I){return A.final!=="t"||A.prefix||A.intermediates?this._parser.registerCsiHandler(A,I):this._parser.registerCsiHandler(A,(P=>!F(P.params[0],this._optionsService.rawOptions.windowOptions)||I(P)))}registerDcsHandler(A,I){return this._parser.registerDcsHandler(A,new L.DcsHandler(I))}registerEscHandler(A,I){return this._parser.registerEscHandler(A,I)}registerOscHandler(A,I){return this._parser.registerOscHandler(A,new D.OscHandler(I))}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 I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);I.hasWidth(this._activeBuffer.x)&&!I.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const 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,I){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=A,this._activeBuffer.y=this._activeBuffer.scrollTop+I):(this._activeBuffer.x=A,this._activeBuffer.y=I),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(A,I){this._restrictCursor(),this._setCursor(this._activeBuffer.x+A,this._activeBuffer.y+I)}cursorUp(A){const I=this._activeBuffer.y-this._activeBuffer.scrollTop;return I>=0?this._moveCursor(0,-Math.min(I,A.params[0]||1)):this._moveCursor(0,-(A.params[0]||1)),!0}cursorDown(A){const I=this._activeBuffer.scrollBottom-this._activeBuffer.y;return I>=0?this._moveCursor(0,Math.min(I,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 I=A.params[0];return I===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:I===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let I=A.params[0]||1;for(;I--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let I=A.params[0]||1;for(;I--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(A){const I=A.params[0];return I===1&&(this._curAttrData.bg|=536870912),I!==2&&I!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(A,I,P,j=!1,Y=!1){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);Z.replaceCells(I,P,this._activeBuffer.getNullCell(this._eraseAttrData()),Y),j&&(Z.isWrapped=!1)}_resetBufferLine(A,I=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),I),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+A),P.isWrapped=!1)}eraseInDisplay(A,I=!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,I);P<this._bufferService.rows;P++)this._resetBufferLine(P,I);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,I),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,I);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,I);this._dirtyRowTracker.markDirty(0);break;case 3:const j=this._activeBuffer.lines.length-this._bufferService.rows;j>0&&(this._activeBuffer.lines.trimStart(j),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-j,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-j,0),this._onScroll.fire(0))}return!0}eraseInLine(A,I=!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,I);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,I);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,I)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(A){this._restrictCursor();let I=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,j=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Y=this._bufferService.rows-1+this._activeBuffer.ybase-j+1;for(;I--;)this._activeBuffer.lines.splice(Y-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 I=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 j;for(j=this._bufferService.rows-1-this._activeBuffer.scrollBottom,j=this._bufferService.rows-1+this._activeBuffer.ybase-j;I--;)this._activeBuffer.lines.splice(P,1),this._activeBuffer.lines.splice(j,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 I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.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 I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.deleteCells(this._activeBuffer.x,A.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(A){let I=A.params[0]||1;for(;I--;)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 I=A.params[0]||1;for(;I--;)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 I=A.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);j.deleteCells(0,I,this._activeBuffer.getNullCell(this._eraseAttrData())),j.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 I=A.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);j.insertCells(0,I,this._activeBuffer.getNullCell(this._eraseAttrData())),j.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 I=A.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);j.insertCells(this._activeBuffer.x,I,this._activeBuffer.getNullCell(this._eraseAttrData())),j.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 I=A.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);j.deleteCells(this._activeBuffer.x,I,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(A){this._restrictCursor();const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.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 I=this._parser.precedingJoinState;if(!I)return!0;const P=A.params[0]||1,j=R.UnicodeService.extractWidth(I),Y=this._activeBuffer.x-j,Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Y),ie=new Uint32Array(Z.length*P);let ae=0;for(let H=0;H<Z.length;){const re=Z.codePointAt(H)||0;ie[ae++]=re,H+=re>65535?2:1}let X=ae;for(let H=1;H<P;++H)ie.copyWithin(X,0,ae),X+=ae;return this.print(ie,0,X),!0}sendDeviceAttributesPrimary(A){return A.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(c.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(c.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(A){return A.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(c.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(c.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(A.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(c.C0.ESC+"[>83;40003;0c")),!0}_is(A){return(this._optionsService.rawOptions.termName+"").indexOf(A)===0}setMode(A){for(let I=0;I<A.length;I++)switch(A.params[I]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(A){for(let I=0;I<A.length;I++)switch(A.params[I]){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 I=0;I<A.length;I++)switch(A.params[I]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(A){for(let I=0;I<A.length;I++)switch(A.params[I]){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[I]===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,I){const P=this._coreService.decPrivateModes,{activeProtocol:j,activeEncoding:Y}=this._coreMouseService,Z=this._coreService,{buffers:ie,cols:ae}=this._bufferService,{active:X,alt:H}=ie,re=this._optionsService.rawOptions,te=Se=>Se?1:2,ue=A.params[0];return le=ue,pe=I?ue===2?4:ue===4?te(Z.modes.insertMode):ue===12?3:ue===20?te(re.convertEol):0:ue===1?te(P.applicationCursorKeys):ue===3?re.windowOptions.setWinLines?ae===80?2:ae===132?1:0:0:ue===6?te(P.origin):ue===7?te(P.wraparound):ue===8?3:ue===9?te(j==="X10"):ue===12?te(re.cursorBlink):ue===25?te(!Z.isCursorHidden):ue===45?te(P.reverseWraparound):ue===66?te(P.applicationKeypad):ue===67?4:ue===1e3?te(j==="VT200"):ue===1002?te(j==="DRAG"):ue===1003?te(j==="ANY"):ue===1004?te(P.sendFocus):ue===1005?4:ue===1006?te(Y==="SGR"):ue===1015?4:ue===1016?te(Y==="SGR_PIXELS"):ue===1048?1:ue===47||ue===1047||ue===1049?te(X===H):ue===2004?te(P.bracketedPasteMode):0,Z.triggerDataEvent(`${c.C0.ESC}[${I?"":"?"}${le};${pe}$y`),!0;var le,pe}_updateAttrColor(A,I,P,j,Y){return I===2?(A|=50331648,A&=-16777216,A|=y.AttributeData.fromColorRGB([P,j,Y])):I===5&&(A&=-50331904,A|=33554432|255&P),A}_extractColor(A,I,P){const j=[0,0,-1,0,0,0];let Y=0,Z=0;do{if(j[Z+Y]=A.params[I+Z],A.hasSubParams(I+Z)){const ie=A.getSubParams(I+Z);let ae=0;do j[1]===5&&(Y=1),j[Z+ae+1+Y]=ie[ae];while(++ae<ie.length&&ae+Z+1+Y<j.length);break}if(j[1]===5&&Z+Y>=2||j[1]===2&&Z+Y>=5)break;j[1]&&(Y=1)}while(++Z+I<A.length&&Z+Y<j.length);for(let ie=2;ie<j.length;++ie)j[ie]===-1&&(j[ie]=0);switch(j[0]){case 38:P.fg=this._updateAttrColor(P.fg,j[1],j[3],j[4],j[5]);break;case 48:P.bg=this._updateAttrColor(P.bg,j[1],j[3],j[4],j[5]);break;case 58:P.extended=P.extended.clone(),P.extended.underlineColor=this._updateAttrColor(P.extended.underlineColor,j[1],j[3],j[4],j[5])}return Z}_processUnderline(A,I){I.extended=I.extended.clone(),(!~A||A>5)&&(A=1),I.extended.underlineStyle=A,I.fg|=268435456,A===0&&(I.fg&=-268435457),I.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 I=A.length;let P;const j=this._curAttrData;for(let Y=0;Y<I;Y++)P=A.params[Y],P>=30&&P<=37?(j.fg&=-50331904,j.fg|=16777216|P-30):P>=40&&P<=47?(j.bg&=-50331904,j.bg|=16777216|P-40):P>=90&&P<=97?(j.fg&=-50331904,j.fg|=16777224|P-90):P>=100&&P<=107?(j.bg&=-50331904,j.bg|=16777224|P-100):P===0?this._processSGR0(j):P===1?j.fg|=134217728:P===3?j.bg|=67108864:P===4?(j.fg|=268435456,this._processUnderline(A.hasSubParams(Y)?A.getSubParams(Y)[0]:1,j)):P===5?j.fg|=536870912:P===7?j.fg|=67108864:P===8?j.fg|=1073741824:P===9?j.fg|=2147483648:P===2?j.bg|=134217728:P===21?this._processUnderline(2,j):P===22?(j.fg&=-134217729,j.bg&=-134217729):P===23?j.bg&=-67108865:P===24?(j.fg&=-268435457,this._processUnderline(0,j)):P===25?j.fg&=-536870913:P===27?j.fg&=-67108865:P===28?j.fg&=-1073741825:P===29?j.fg&=2147483647:P===39?(j.fg&=-67108864,j.fg|=16777215&f.DEFAULT_ATTR_DATA.fg):P===49?(j.bg&=-67108864,j.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?Y+=this._extractColor(A,Y,j):P===53?j.bg|=1073741824:P===55?j.bg&=-1073741825:P===59?(j.extended=j.extended.clone(),j.extended.underlineColor=-1,j.updateExtended()):P===100?(j.fg&=-67108864,j.fg|=16777215&f.DEFAULT_ATTR_DATA.fg,j.bg&=-67108864,j.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(`${c.C0.ESC}[0n`);break;case 6:const I=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${c.C0.ESC}[${I};${P}R`)}return!0}deviceStatusPrivate(A){if(A.params[0]===6){const I=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${c.C0.ESC}[?${I};${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 I=A.params[0]||1;switch(I){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=I%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(A){const I=A.params[0]||1;let P;return(A.length<2||(P=A.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>I&&(this._activeBuffer.scrollTop=I-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 I=A.length>1?A.params[1]:0;switch(A.params[0]){case 14:I!==2&&this._onRequestWindowsOptionsReport.fire(B.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(B.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${c.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:I!==0&&I!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),I!==0&&I!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:I!==0&&I!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),I!==0&&I!==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 I=[],P=A.split(";");for(;P.length>1;){const j=P.shift(),Y=P.shift();if(/^\d+$/.exec(j)){const Z=parseInt(j);if(K(Z))if(Y==="?")I.push({type:0,index:Z});else{const ie=(0,M.parseColor)(Y);ie&&I.push({type:1,index:Z,color:ie})}}}return I.length&&this._onColor.fire(I),!0}setHyperlink(A){const I=A.split(";");return!(I.length<2)&&(I[1]?this._createHyperlink(I[0],I[1]):!I[0]&&this._finishHyperlink())}_createHyperlink(A,I){this._getCurrentLinkId()&&this._finishHyperlink();const P=A.split(":");let j;const Y=P.findIndex((Z=>Z.startsWith("id=")));return Y!==-1&&(j=P[Y].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:j,uri:I}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(A,I){const P=A.split(";");for(let j=0;j<P.length&&!(I>=this._specialColors.length);++j,++I)if(P[j]==="?")this._onColor.fire([{type:0,index:this._specialColors[I]}]);else{const Y=(0,M.parseColor)(P[j]);Y&&this._onColor.fire([{type:1,index:this._specialColors[I],color:Y}])}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 I=[],P=A.split(";");for(let j=0;j<P.length;++j)if(/^\d+$/.exec(P[j])){const Y=parseInt(P[j]);K(Y)&&I.push({type:2,index:Y})}return I.length&&this._onColor.fire(I),!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 I=0;I<this._bufferService.rows;++I){const P=this._activeBuffer.ybase+this._activeBuffer.y+I,j=this._activeBuffer.lines.get(P);j&&(j.fill(A),j.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(A,I){const P=this._bufferService.buffer,j=this._optionsService.rawOptions;return(Y=>(this._coreService.triggerDataEvent(`${c.C0.ESC}${Y}${c.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}[j.cursorStyle]-(j.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(A,I){this._dirtyRowTracker.markRangeDirty(A,I)}}a.InputHandler=q;let U=class{constructor(V){this._bufferService=V,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(V){V<this.start?this.start=V:V>this.end&&(this.end=V)}markRangeDirty(V,A){V>A&&(O=V,V=A,A=O),V<this.start&&(this.start=V),A>this.end&&(this.end=A)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function K(V){return 0<=V&&V<256}U=p([v(0,k.IBufferService)],U)},844:(w,a)=>{function l(p){for(const v of p)v.dispose();p.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 p of this._disposables)p.dispose();this._disposables.length=0}register(p){return this._disposables.push(p),p}unregister(p){const v=this._disposables.indexOf(p);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(p){var v;this._isDisposed||p===this._value||((v=this._value)==null||v.dispose(),this._value=p)}clear(){this.value=void 0}dispose(){var p;this._isDisposed=!0,(p=this._value)==null||p.dispose(),this._value=void 0}},a.toDisposable=function(p){return{dispose:p}},a.disposeArray=l,a.getDisposeArrayDisposable=function(p){return{dispose:()=>l(p)}}},1505:(w,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(v,c,m){this._data[v]||(this._data[v]={}),this._data[v][c]=m}get(v,c){return this._data[v]?this._data[v][c]:void 0}clear(){this._data={}}}a.TwoKeyMap=l,a.FourKeyMap=class{constructor(){this._data=new l}set(p,v,c,m,C){this._data.get(p,v)||this._data.set(p,v,new l),this._data.get(p,v).set(c,m,C)}get(p,v,c,m){var C;return(C=this._data.get(p,v))==null?void 0:C.get(c,m)}clear(){this._data.clear()}}},6114:(w,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 l=a.isNode?"node":navigator.userAgent,p=a.isNode?"node":navigator.platform;a.isFirefox=l.includes("Firefox"),a.isLegacyEdge=l.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(l),a.getSafariVersion=function(){if(!a.isSafari)return 0;const v=l.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(p),a.isIpad=p==="iPad",a.isIphone=p==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(p),a.isLinux=p.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(l)},6106:(w,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let l=0;a.SortedList=class{constructor(p){this._getKey=p,this._array=[]}clear(){this._array.length=0}insert(p){this._array.length!==0?(l=this._search(this._getKey(p)),this._array.splice(l,0,p)):this._array.push(p)}delete(p){if(this._array.length===0)return!1;const v=this._getKey(p);if(v===void 0||(l=this._search(v),l===-1)||this._getKey(this._array[l])!==v)return!1;do if(this._array[l]===p)return this._array.splice(l,1),!0;while(++l<this._array.length&&this._getKey(this._array[l])===v);return!1}*getKeyIterator(p){if(this._array.length!==0&&(l=this._search(p),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===p))do yield this._array[l];while(++l<this._array.length&&this._getKey(this._array[l])===p)}forEachByKey(p,v){if(this._array.length!==0&&(l=this._search(p),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===p))do v(this._array[l]);while(++l<this._array.length&&this._getKey(this._array[l])===p)}values(){return[...this._array].values()}_search(p){let v=0,c=this._array.length-1;for(;c>=v;){let m=v+c>>1;const C=this._getKey(this._array[m]);if(C>p)c=m-1;else{if(!(C<p)){for(;m>0&&this._getKey(this._array[m-1])===p;)m--;return m}v=m+1}}return v}}},7226:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const p=l(6114);class v{constructor(){this._tasks=[],this._i=0}enqueue(C){this._tasks.push(C),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(C){this._idleCallback=void 0;let b=0,x=0,f=C.timeRemaining(),_=0;for(;this._i<this._tasks.length;){if(b=Date.now(),this._tasks[this._i]()||this._i++,b=Math.max(1,Date.now()-b),x=Math.max(b,x),_=C.timeRemaining(),1.5*x>_)return f-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(f-b))}ms`),void this._start();f=_}this.clear()}}class c extends v{_requestCallback(C){return setTimeout((()=>C(this._createDeadline(16))))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const b=Date.now()+C;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}a.PriorityTaskQueue=c,a.IdleTaskQueue=!p.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:c,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},9282:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const p=l(643);a.updateWindowsModeWrappedState=function(v){const c=v.buffer.lines.get(v.buffer.ybase+v.buffer.y-1),m=c==null?void 0:c.get(v.cols-1),C=v.buffer.lines.get(v.buffer.ybase+v.buffer.y);C&&m&&(C.isWrapped=m[p.CHAR_DATA_CODE_INDEX]!==p.NULL_CELL_CODE&&m[p.CHAR_DATA_CODE_INDEX]!==p.WHITESPACE_CELL_CODE)}},3734:(w,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new p}static toColorRGB(c){return[c>>>16&255,c>>>8&255,255&c]}static fromColorRGB(c){return(255&c[0])<<16|(255&c[1])<<8|255&c[2]}clone(){const c=new l;return c.fg=this.fg,c.bg=this.bg,c.extended=this.extended.clone(),c}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=l;class p{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(c){this._ext=c}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(c){this._ext&=-469762049,this._ext|=c<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(c){this._ext&=-67108864,this._ext|=67108863&c}get urlId(){return this._urlId}set urlId(c){this._urlId=c}get underlineVariantOffset(){const c=(3758096384&this._ext)>>29;return c<0?4294967288^c:c}set underlineVariantOffset(c){this._ext&=536870911,this._ext|=c<<29&3758096384}constructor(c=0,m=0){this._ext=0,this._urlId=0,this._ext=c,this._urlId=m}clone(){return new p(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=p},9092:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const p=l(6349),v=l(7226),c=l(3734),m=l(8437),C=l(4634),b=l(511),x=l(643),f=l(4863),_=l(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(d,h,y){this._hasScrollback=d,this._optionsService=h,this._bufferService=y,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=_.DEFAULT_CHARSET,this.markers=[],this._nullCell=b.CellData.fromCharData([0,x.NULL_CELL_CHAR,x.NULL_CELL_WIDTH,x.NULL_CELL_CODE]),this._whitespaceCell=b.CellData.fromCharData([0,x.WHITESPACE_CELL_CHAR,x.WHITESPACE_CELL_WIDTH,x.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 p.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 c.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 c.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 p.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(d,h){const y=this.getNullCell(m.DEFAULT_ATTR_DATA);let k=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 L=0;L<this.lines.length;L++)k+=+this.lines.get(L).resize(d,y);let D=0;if(this._rows<h)for(let L=this._rows;L<h;L++)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,y)):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,y)));else for(let L=this._rows;L>h;L--)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 L=this.lines.length-R;L>0&&(this.lines.trimStart(L),this.ybase=Math.max(this.ybase-L,0),this.ydisp=Math.max(this.ydisp-L,0),this.savedY=Math.max(this.savedY-L,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++)k+=+this.lines.get(D).resize(d,y);this._cols=d,this._rows=h,this._memoryCleanupQueue.clear(),k>.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 y=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,d,this.ybase+this.y,this.getNullCell(m.DEFAULT_ATTR_DATA));if(y.length>0){const k=(0,C.reflowLargerCreateNewLayout)(this.lines,y);(0,C.reflowLargerApplyNewLayout)(this.lines,k.layout),this._reflowLargerAdjustViewport(d,h,k.countRemoved)}}_reflowLargerAdjustViewport(d,h,y){const k=this.getNullCell(m.DEFAULT_ATTR_DATA);let R=y;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<h&&this.lines.push(new m.BufferLine(d,k))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-y,0)}_reflowSmaller(d,h){const y=this.getNullCell(m.DEFAULT_ATTR_DATA),k=[];let R=0;for(let D=this.lines.length-1;D>=0;D--){let L=this.lines.get(D);if(!L||!L.isWrapped&&L.getTrimmedLength()<=d)continue;const M=[L];for(;L.isWrapped&&D>0;)L=this.lines.get(--D),M.unshift(L);const W=this.ybase+this.y;if(W>=D&&W<D+M.length)continue;const z=M[M.length-1].getTrimmedLength(),F=(0,C.reflowSmallerGetNewLineLengths)(M,this._cols,d),B=F.length-M.length;let O;O=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+B):Math.max(0,this.lines.length-this.lines.maxLength+B);const q=[];for(let P=0;P<B;P++){const j=this.getBlankLine(m.DEFAULT_ATTR_DATA,!0);q.push(j)}q.length>0&&(k.push({start:D+M.length+R,newLines:q}),R+=q.length),M.push(...q);let U=F.length-1,K=F[U];K===0&&(U--,K=F[U]);let V=M.length-B-1,A=z;for(;V>=0;){const P=Math.min(A,K);if(M[U]===void 0)break;if(M[U].copyCellsFrom(M[V],A-P,K-P,P,!0),K-=P,K===0&&(U--,K=F[U]),A-=P,A===0){V--;const j=Math.max(V,0);A=(0,C.getWrappedLineTrimmedLength)(M,j,this._cols)}}for(let P=0;P<M.length;P++)F[P]<d&&M[P].setCell(F[P],y);let I=B-O;for(;I-- >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+B,this.ybase+h-1)}if(k.length>0){const D=[],L=[];for(let U=0;U<this.lines.length;U++)L.push(this.lines.get(U));const M=this.lines.length;let W=M-1,z=0,F=k[z];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let B=0;for(let U=Math.min(this.lines.maxLength-1,M+R-1);U>=0;U--)if(F&&F.start>W+B){for(let K=F.newLines.length-1;K>=0;K--)this.lines.set(U--,F.newLines[K]);U++,D.push({index:W+1,amount:F.newLines.length}),B+=F.newLines.length,F=k[++z]}else this.lines.set(U,L[W--]);let O=0;for(let U=D.length-1;U>=0;U--)D[U].index+=O,this.lines.onInsertEmitter.fire(D[U]),O+=D[U].amount;const q=Math.max(0,M+R-this.lines.maxLength);q>0&&this.lines.onTrimEmitter.fire(q)}}translateBufferLineToString(d,h,y=0,k){const R=this.lines.get(d);return R?R.translateToString(h,y,k):""}getWrappedRangeForLine(d){let h=d,y=d;for(;h>0&&this.lines.get(h).isWrapped;)h--;for(;y+1<this.lines.length&&this.lines.get(y+1).isWrapped;)y++;return{first:h,last:y}}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((y=>{h.line-=y,h.line<0&&h.dispose()}))),h.register(this.lines.onInsert((y=>{h.line>=y.index&&(h.line+=y.amount)}))),h.register(this.lines.onDelete((y=>{h.line>=y.index&&h.line<y.index+y.amount&&h.dispose(),h.line>y.index&&(h.line-=y.amount)}))),h.register(h.onDispose((()=>this._removeMarker(h)))),h}_removeMarker(d){this._isClearing||this.markers.splice(this.markers.indexOf(d),1)}}},8437:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const p=l(3734),v=l(511),c=l(643),m=l(482);a.DEFAULT_ATTR_DATA=Object.freeze(new p.AttributeData);let C=0;class b{constructor(f,_,d=!1){this.isWrapped=d,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*f);const h=_||v.CellData.fromCharData([0,c.NULL_CELL_CHAR,c.NULL_CELL_WIDTH,c.NULL_CELL_CODE]);for(let y=0;y<f;++y)this.setCell(y,h);this.length=f}get(f){const _=this._data[3*f+0],d=2097151&_;return[this._data[3*f+1],2097152&_?this._combined[f]:d?(0,m.stringFromCodePoint)(d):"",_>>22,2097152&_?this._combined[f].charCodeAt(this._combined[f].length-1):d]}set(f,_){this._data[3*f+1]=_[c.CHAR_DATA_ATTR_INDEX],_[c.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[f]=_[1],this._data[3*f+0]=2097152|f|_[c.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*f+0]=_[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|_[c.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 _=this._data[3*f+0];return 2097152&_?this._combined[f].charCodeAt(this._combined[f].length-1):2097151&_}isCombined(f){return 2097152&this._data[3*f+0]}getString(f){const _=this._data[3*f+0];return 2097152&_?this._combined[f]:2097151&_?(0,m.stringFromCodePoint)(2097151&_):""}isProtected(f){return 536870912&this._data[3*f+2]}loadCell(f,_){return C=3*f,_.content=this._data[C+0],_.fg=this._data[C+1],_.bg=this._data[C+2],2097152&_.content&&(_.combinedData=this._combined[f]),268435456&_.bg&&(_.extended=this._extendedAttrs[f]),_}setCell(f,_){2097152&_.content&&(this._combined[f]=_.combinedData),268435456&_.bg&&(this._extendedAttrs[f]=_.extended),this._data[3*f+0]=_.content,this._data[3*f+1]=_.fg,this._data[3*f+2]=_.bg}setCellFromCodepoint(f,_,d,h){268435456&h.bg&&(this._extendedAttrs[f]=h.extended),this._data[3*f+0]=_|d<<22,this._data[3*f+1]=h.fg,this._data[3*f+2]=h.bg}addCodepointToCell(f,_,d){let h=this._data[3*f+0];2097152&h?this._combined[f]+=(0,m.stringFromCodePoint)(_):2097151&h?(this._combined[f]=(0,m.stringFromCodePoint)(2097151&h)+(0,m.stringFromCodePoint)(_),h&=-2097152,h|=2097152):h=_|4194304,d&&(h&=-12582913,h|=d<<22),this._data[3*f+0]=h}insertCells(f,_,d){if((f%=this.length)&&this.getWidth(f-1)===2&&this.setCellFromCodepoint(f-1,0,1,d),_<this.length-f){const h=new v.CellData;for(let y=this.length-f-_-1;y>=0;--y)this.setCell(f+_+y,this.loadCell(f+y,h));for(let y=0;y<_;++y)this.setCell(f+y,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,_,d){if(f%=this.length,_<this.length-f){const h=new v.CellData;for(let y=0;y<this.length-f-_;++y)this.setCell(f+y,this.loadCell(f+_+y,h));for(let y=this.length-_;y<this.length;++y)this.setCell(y,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,_,d,h=!1){if(h)for(f&&this.getWidth(f-1)===2&&!this.isProtected(f-1)&&this.setCellFromCodepoint(f-1,0,1,d),_<this.length&&this.getWidth(_-1)===2&&!this.isProtected(_)&&this.setCellFromCodepoint(_,0,1,d);f<_&&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),_<this.length&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_,0,1,d);f<_&&f<this.length;)this.setCell(f++,d)}resize(f,_){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,_)}else{this._data=this._data.subarray(0,d);const h=Object.keys(this._combined);for(let k=0;k<h.length;k++){const R=parseInt(h[k],10);R>=f&&delete this._combined[R]}const y=Object.keys(this._extendedAttrs);for(let k=0;k<y.length;k++){const R=parseInt(y[k],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,_=!1){if(_)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 _ in f._combined)this._combined[_]=f._combined[_];this._extendedAttrs={};for(const _ in f._extendedAttrs)this._extendedAttrs[_]=f._extendedAttrs[_];this.isWrapped=f.isWrapped}clone(){const f=new b(0);f._data=new Uint32Array(this._data),f.length=this.length;for(const _ in this._combined)f._combined[_]=this._combined[_];for(const _ in this._extendedAttrs)f._extendedAttrs[_]=this._extendedAttrs[_];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,_,d,h,y){const k=f._data;if(y)for(let D=h-1;D>=0;D--){for(let L=0;L<3;L++)this._data[3*(d+D)+L]=k[3*(_+D)+L];268435456&k[3*(_+D)+2]&&(this._extendedAttrs[d+D]=f._extendedAttrs[_+D])}else for(let D=0;D<h;D++){for(let L=0;L<3;L++)this._data[3*(d+D)+L]=k[3*(_+D)+L];268435456&k[3*(_+D)+2]&&(this._extendedAttrs[d+D]=f._extendedAttrs[_+D])}const R=Object.keys(f._combined);for(let D=0;D<R.length;D++){const L=parseInt(R[D],10);L>=_&&(this._combined[L-_+d]=f._combined[L])}}translateToString(f,_,d,h){_=_??0,d=d??this.length,f&&(d=Math.min(d,this.getTrimmedLength())),h&&(h.length=0);let y="";for(;_<d;){const k=this._data[3*_+0],R=2097151&k,D=2097152&k?this._combined[_]:R?(0,m.stringFromCodePoint)(R):c.WHITESPACE_CELL_CHAR;if(y+=D,h)for(let L=0;L<D.length;++L)h.push(_);_+=k>>22||1}return h&&h.push(_),y}}a.BufferLine=b},4841:(w,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(l,p){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return p*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(w,a)=>{function l(p,v,c){if(v===p.length-1)return p[v].getTrimmedLength();const m=!p[v].hasContent(c-1)&&p[v].getWidth(c-1)===1,C=p[v+1].getWidth(0)===2;return m&&C?c-1:c}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(p,v,c,m,C){const b=[];for(let x=0;x<p.length-1;x++){let f=x,_=p.get(++f);if(!_.isWrapped)continue;const d=[p.get(x)];for(;f<p.length&&_.isWrapped;)d.push(_),_=p.get(++f);if(m>=x&&m<f){x+=d.length-1;continue}let h=0,y=l(d,h,v),k=1,R=0;for(;k<d.length;){const L=l(d,k,v),M=L-R,W=c-y,z=Math.min(M,W);d[h].copyCellsFrom(d[k],R,y,z,!1),y+=z,y===c&&(h++,y=0),R+=z,R===L&&(k++,R=0),y===0&&h!==0&&d[h-1].getWidth(c-1)===2&&(d[h].copyCellsFrom(d[h-1],c-1,y++,1,!1),d[h-1].setCell(c-1,C))}d[h].replaceCells(y,c,C);let D=0;for(let L=d.length-1;L>0&&(L>h||d[L].getTrimmedLength()===0);L--)D++;D>0&&(b.push(x+d.length-D),b.push(D)),x+=d.length-1}return b},a.reflowLargerCreateNewLayout=function(p,v){const c=[];let m=0,C=v[m],b=0;for(let x=0;x<p.length;x++)if(C===x){const f=v[++m];p.onDeleteEmitter.fire({index:x-b,amount:f}),x+=f-1,b+=f,C=v[++m]}else c.push(x);return{layout:c,countRemoved:b}},a.reflowLargerApplyNewLayout=function(p,v){const c=[];for(let m=0;m<v.length;m++)c.push(p.get(v[m]));for(let m=0;m<c.length;m++)p.set(m,c[m]);p.length=v.length},a.reflowSmallerGetNewLineLengths=function(p,v,c){const m=[],C=p.map(((_,d)=>l(p,d,v))).reduce(((_,d)=>_+d));let b=0,x=0,f=0;for(;f<C;){if(C-f<c){m.push(C-f);break}b+=c;const _=l(p,x,v);b>_&&(b-=_,x++);const d=p[x].getWidth(b-1)===2;d&&b--;const h=d?c-1:c;m.push(h),f+=h}return m},a.getWrappedLineTrimmedLength=l},5295:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const p=l(8460),v=l(844),c=l(9092);class m extends v.Disposable{constructor(b,x){super(),this._optionsService=b,this._bufferService=x,this._onBufferActivate=this.register(new p.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 c.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new c.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,x){this._normal.resize(b,x),this._alt.resize(b,x),this.setupTabStops(b)}setupTabStops(b){this._normal.setupTabStops(b),this._alt.setupTabStops(b)}}a.BufferSet=m},511:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const p=l(482),v=l(643),c=l(3734);class m extends c.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new c.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const x=new m;return x.setFromCharData(b),x}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,p.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 x=!1;if(b[v.CHAR_DATA_CHAR_INDEX].length>2)x=!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 _=b[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=_&&_<=57343?this.content=1024*(f-55296)+_-56320+65536|b[v.CHAR_DATA_WIDTH_INDEX]<<22:x=!0}else x=!0}else this.content=b[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[v.CHAR_DATA_WIDTH_INDEX]<<22;x&&(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:(w,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:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const p=l(8460),v=l(844);class c{get id(){return this._id}constructor(C){this.line=C,this.isDisposed=!1,this._disposables=[],this._id=c._nextId++,this._onDispose=this.register(new p.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(C){return this._disposables.push(C),C}}a.Marker=c,c._nextId=1},7116:(w,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:(w,a)=>{var l,p,v;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,(function(c){c.NUL="\0",c.SOH="",c.STX="",c.ETX="",c.EOT="",c.ENQ="",c.ACK="",c.BEL="\x07",c.BS="\b",c.HT=" ",c.LF=`
|
|
69
|
+
`,c.VT="\v",c.FF="\f",c.CR="\r",c.SO="",c.SI="",c.DLE="",c.DC1="",c.DC2="",c.DC3="",c.DC4="",c.NAK="",c.SYN="",c.ETB="",c.CAN="",c.EM="",c.SUB="",c.ESC="\x1B",c.FS="",c.GS="",c.RS="",c.US="",c.SP=" ",c.DEL=""})(l||(a.C0=l={})),(function(c){c.PAD="",c.HOP="",c.BPH="",c.NBH="",c.IND="",c.NEL="
",c.SSA="",c.ESA="",c.HTS="",c.HTJ="",c.VTS="",c.PLD="",c.PLU="",c.RI="",c.SS2="",c.SS3="",c.DCS="",c.PU1="",c.PU2="",c.STS="",c.CCH="",c.MW="",c.SPA="",c.EPA="",c.SOS="",c.SGCI="",c.SCI="",c.CSI="",c.ST="",c.OSC="",c.PM="",c.APC=""})(p||(a.C1=p={})),(function(c){c.ST=`${l.ESC}\\`})(v||(a.C1_ESCAPED=v={}))},7399:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const p=l(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(c,m,C,b){const x={type:0,cancel:!1,key:void 0},f=(c.shiftKey?1:0)|(c.altKey?2:0)|(c.ctrlKey?4:0)|(c.metaKey?8:0);switch(c.keyCode){case 0:c.key==="UIKeyInputUpArrow"?x.key=m?p.C0.ESC+"OA":p.C0.ESC+"[A":c.key==="UIKeyInputLeftArrow"?x.key=m?p.C0.ESC+"OD":p.C0.ESC+"[D":c.key==="UIKeyInputRightArrow"?x.key=m?p.C0.ESC+"OC":p.C0.ESC+"[C":c.key==="UIKeyInputDownArrow"&&(x.key=m?p.C0.ESC+"OB":p.C0.ESC+"[B");break;case 8:x.key=c.ctrlKey?"\b":p.C0.DEL,c.altKey&&(x.key=p.C0.ESC+x.key);break;case 9:if(c.shiftKey){x.key=p.C0.ESC+"[Z";break}x.key=p.C0.HT,x.cancel=!0;break;case 13:x.key=c.altKey?p.C0.ESC+p.C0.CR:p.C0.CR,x.cancel=!0;break;case 27:x.key=p.C0.ESC,c.altKey&&(x.key=p.C0.ESC+p.C0.ESC),x.cancel=!0;break;case 37:if(c.metaKey)break;f?(x.key=p.C0.ESC+"[1;"+(f+1)+"D",x.key===p.C0.ESC+"[1;3D"&&(x.key=p.C0.ESC+(C?"b":"[1;5D"))):x.key=m?p.C0.ESC+"OD":p.C0.ESC+"[D";break;case 39:if(c.metaKey)break;f?(x.key=p.C0.ESC+"[1;"+(f+1)+"C",x.key===p.C0.ESC+"[1;3C"&&(x.key=p.C0.ESC+(C?"f":"[1;5C"))):x.key=m?p.C0.ESC+"OC":p.C0.ESC+"[C";break;case 38:if(c.metaKey)break;f?(x.key=p.C0.ESC+"[1;"+(f+1)+"A",C||x.key!==p.C0.ESC+"[1;3A"||(x.key=p.C0.ESC+"[1;5A")):x.key=m?p.C0.ESC+"OA":p.C0.ESC+"[A";break;case 40:if(c.metaKey)break;f?(x.key=p.C0.ESC+"[1;"+(f+1)+"B",C||x.key!==p.C0.ESC+"[1;3B"||(x.key=p.C0.ESC+"[1;5B")):x.key=m?p.C0.ESC+"OB":p.C0.ESC+"[B";break;case 45:c.shiftKey||c.ctrlKey||(x.key=p.C0.ESC+"[2~");break;case 46:x.key=f?p.C0.ESC+"[3;"+(f+1)+"~":p.C0.ESC+"[3~";break;case 36:x.key=f?p.C0.ESC+"[1;"+(f+1)+"H":m?p.C0.ESC+"OH":p.C0.ESC+"[H";break;case 35:x.key=f?p.C0.ESC+"[1;"+(f+1)+"F":m?p.C0.ESC+"OF":p.C0.ESC+"[F";break;case 33:c.shiftKey?x.type=2:c.ctrlKey?x.key=p.C0.ESC+"[5;"+(f+1)+"~":x.key=p.C0.ESC+"[5~";break;case 34:c.shiftKey?x.type=3:c.ctrlKey?x.key=p.C0.ESC+"[6;"+(f+1)+"~":x.key=p.C0.ESC+"[6~";break;case 112:x.key=f?p.C0.ESC+"[1;"+(f+1)+"P":p.C0.ESC+"OP";break;case 113:x.key=f?p.C0.ESC+"[1;"+(f+1)+"Q":p.C0.ESC+"OQ";break;case 114:x.key=f?p.C0.ESC+"[1;"+(f+1)+"R":p.C0.ESC+"OR";break;case 115:x.key=f?p.C0.ESC+"[1;"+(f+1)+"S":p.C0.ESC+"OS";break;case 116:x.key=f?p.C0.ESC+"[15;"+(f+1)+"~":p.C0.ESC+"[15~";break;case 117:x.key=f?p.C0.ESC+"[17;"+(f+1)+"~":p.C0.ESC+"[17~";break;case 118:x.key=f?p.C0.ESC+"[18;"+(f+1)+"~":p.C0.ESC+"[18~";break;case 119:x.key=f?p.C0.ESC+"[19;"+(f+1)+"~":p.C0.ESC+"[19~";break;case 120:x.key=f?p.C0.ESC+"[20;"+(f+1)+"~":p.C0.ESC+"[20~";break;case 121:x.key=f?p.C0.ESC+"[21;"+(f+1)+"~":p.C0.ESC+"[21~";break;case 122:x.key=f?p.C0.ESC+"[23;"+(f+1)+"~":p.C0.ESC+"[23~";break;case 123:x.key=f?p.C0.ESC+"[24;"+(f+1)+"~":p.C0.ESC+"[24~";break;default:if(!c.ctrlKey||c.shiftKey||c.altKey||c.metaKey)if(C&&!b||!c.altKey||c.metaKey)!C||c.altKey||c.ctrlKey||c.shiftKey||!c.metaKey?c.key&&!c.ctrlKey&&!c.altKey&&!c.metaKey&&c.keyCode>=48&&c.key.length===1?x.key=c.key:c.key&&c.ctrlKey&&(c.key==="_"&&(x.key=p.C0.US),c.key==="@"&&(x.key=p.C0.NUL)):c.keyCode===65&&(x.type=1);else{const _=v[c.keyCode],d=_==null?void 0:_[c.shiftKey?1:0];if(d)x.key=p.C0.ESC+d;else if(c.keyCode>=65&&c.keyCode<=90){const h=c.ctrlKey?c.keyCode-64:c.keyCode+32;let y=String.fromCharCode(h);c.shiftKey&&(y=y.toUpperCase()),x.key=p.C0.ESC+y}else if(c.keyCode===32)x.key=p.C0.ESC+(c.ctrlKey?p.C0.NUL:" ");else if(c.key==="Dead"&&c.code.startsWith("Key")){let h=c.code.slice(3,4);c.shiftKey||(h=h.toLowerCase()),x.key=p.C0.ESC+h,x.cancel=!0}}else c.keyCode>=65&&c.keyCode<=90?x.key=String.fromCharCode(c.keyCode-64):c.keyCode===32?x.key=p.C0.NUL:c.keyCode>=51&&c.keyCode<=55?x.key=String.fromCharCode(c.keyCode-51+27):c.keyCode===56?x.key=p.C0.DEL:c.keyCode===219?x.key=p.C0.ESC:c.keyCode===220?x.key=p.C0.FS:c.keyCode===221&&(x.key=p.C0.GS)}return x}},482:(w,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},a.utf32ToString=function(l,p=0,v=l.length){let c="";for(let m=p;m<v;++m){let C=l[m];C>65535?(C-=65536,c+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):c+=String.fromCharCode(C)}return c},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,p){const v=l.length;if(!v)return 0;let c=0,m=0;if(this._interim){const C=l.charCodeAt(m++);56320<=C&&C<=57343?p[c++]=1024*(this._interim-55296)+C-56320+65536:(p[c++]=this._interim,p[c++]=C),this._interim=0}for(let C=m;C<v;++C){const b=l.charCodeAt(C);if(55296<=b&&b<=56319){if(++C>=v)return this._interim=b,c;const x=l.charCodeAt(C);56320<=x&&x<=57343?p[c++]=1024*(b-55296)+x-56320+65536:(p[c++]=b,p[c++]=x)}else b!==65279&&(p[c++]=b)}return c}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,p){const v=l.length;if(!v)return 0;let c,m,C,b,x=0,f=0,_=0;if(this.interim[0]){let y=!1,k=this.interim[0];k&=(224&k)==192?31:(240&k)==224?15:7;let R,D=0;for(;(R=63&this.interim[++D])&&D<4;)k<<=6,k|=R;const L=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=L-D;for(;_<M;){if(_>=v)return 0;if(R=l[_++],(192&R)!=128){_--,y=!0;break}this.interim[D++]=R,k<<=6,k|=63&R}y||(L===2?k<128?_--:p[x++]=k:L===3?k<2048||k>=55296&&k<=57343||k===65279||(p[x++]=k):k<65536||k>1114111||(p[x++]=k)),this.interim.fill(0)}const d=v-4;let h=_;for(;h<v;){for(;!(!(h<d)||128&(c=l[h])||128&(m=l[h+1])||128&(C=l[h+2])||128&(b=l[h+3]));)p[x++]=c,p[x++]=m,p[x++]=C,p[x++]=b,h+=4;if(c=l[h++],c<128)p[x++]=c;else if((224&c)==192){if(h>=v)return this.interim[0]=c,x;if(m=l[h++],(192&m)!=128){h--;continue}if(f=(31&c)<<6|63&m,f<128){h--;continue}p[x++]=f}else if((240&c)==224){if(h>=v)return this.interim[0]=c,x;if(m=l[h++],(192&m)!=128){h--;continue}if(h>=v)return this.interim[0]=c,this.interim[1]=m,x;if(C=l[h++],(192&C)!=128){h--;continue}if(f=(15&c)<<12|(63&m)<<6|63&C,f<2048||f>=55296&&f<=57343||f===65279)continue;p[x++]=f}else if((248&c)==240){if(h>=v)return this.interim[0]=c,x;if(m=l[h++],(192&m)!=128){h--;continue}if(h>=v)return this.interim[0]=c,this.interim[1]=m,x;if(C=l[h++],(192&C)!=128){h--;continue}if(h>=v)return this.interim[0]=c,this.interim[1]=m,this.interim[2]=C,x;if(b=l[h++],(192&b)!=128){h--;continue}if(f=(7&c)<<18|(63&m)<<12|(63&C)<<6|63&b,f<65536||f>1114111)continue;p[x++]=f}}return x}}},225:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const p=l(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]],c=[[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 C=0;C<v.length;++C)m.fill(0,v[C][0],v[C][1]+1)}}wcwidth(C){return C<32?0:C<127?1:C<65536?m[C]:(function(b,x){let f,_=0,d=x.length-1;if(b<x[0][0]||b>x[d][1])return!1;for(;d>=_;)if(f=_+d>>1,b>x[f][1])_=f+1;else{if(!(b<x[f][0]))return!0;d=f-1}return!1})(C,c)?0:C>=131072&&C<=196605||C>=196608&&C<=262141?2:1}charProperties(C,b){let x=this.wcwidth(C),f=x===0&&b!==0;if(f){const _=p.UnicodeService.extractWidth(b);_===0?f=!1:_>x&&(x=_)}return p.UnicodeService.createPropertyValue(0,x,f)}}},5981:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const p=l(8460),v=l(844);class c extends v.Disposable{constructor(C){super(),this._action=C,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new p.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(C,b){if(b!==void 0&&this._syncCalls>b)return void(this._syncCalls=0);if(this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let x;for(this._isSyncWriting=!0;x=this._writeBuffer.shift();){this._action(x);const f=this._callbacks.shift();f&&f()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,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+=C.length,this._writeBuffer.push(C),this._callbacks.push(b),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(b)}_innerWrite(C=0,b=!0){const x=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const f=this._writeBuffer[this._bufferOffset],_=this._action(f,b);if(_){const h=y=>Date.now()-x>=12?setTimeout((()=>this._innerWrite(0,y))):this._innerWrite(x,y);return void _.catch((y=>(queueMicrotask((()=>{throw y})),Promise.resolve(!1)))).then(h)}const d=this._callbacks[this._bufferOffset];if(d&&d(),this._bufferOffset++,this._pendingData-=f.length,Date.now()-x>=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=c},5941:(w,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const l=/^([\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})$/,p=/^[\da-f]+$/;function v(c,m){const C=c.toString(16),b=C.length<2?"0"+C:C;switch(m){case 4:return C[0];case 8:return b;case 12:return(b+b).slice(0,3);default:return b+b}}a.parseColor=function(c){if(!c)return;let m=c.toLowerCase();if(m.indexOf("rgb:")===0){m=m.slice(4);const C=l.exec(m);if(C){const b=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/b*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/b*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/b*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),p.exec(m)&&[3,6,9,12].includes(m.length))){const C=m.length/3,b=[0,0,0];for(let x=0;x<3;++x){const f=parseInt(m.slice(C*x,C*x+C),16);b[x]=C===1?f<<4:C===2?f:C===3?f>>4:f>>8}return b}},a.toRgbString=function(c,m=16){const[C,b,x]=c;return`rgb:${v(C,m)}/${v(b,m)}/${v(x,m)}`}},5770:(w,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const p=l(482),v=l(8742),c=l(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,x){this._handlers[b]===void 0&&(this._handlers[b]=[]);const f=this._handlers[b];return f.push(x),{dispose:()=>{const _=f.indexOf(x);_!==-1&&f.splice(_,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,x){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(x);else this._handlerFb(this._ident,"HOOK",x)}put(b,x,f){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(b,x,f);else this._handlerFb(this._ident,"PUT",(0,p.utf32ToString)(b,x,f))}unhook(b,x=!0){if(this._active.length){let f=!1,_=this._active.length-1,d=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,f=x,d=this._stack.fallThrough,this._stack.paused=!1),!d&&f===!1){for(;_>=0&&(f=this._active[_].unhook(b),f!==!0);_--)if(f instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,f;_--}for(;_>=0;_--)if(f=this._active[_].unhook(!1),f instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,f}else this._handlerFb(this._ident,"UNHOOK",b);this._active=m,this._ident=0}};const C=new v.Params;C.addParam(0),a.DcsHandler=class{constructor(b){this._handler=b,this._data="",this._params=C,this._hitLimit=!1}hook(b){this._params=b.length>1||b.params[0]?b.clone():C,this._data="",this._hitLimit=!1}put(b,x,f){this._hitLimit||(this._data+=(0,p.utf32ToString)(b,x,f),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(b){let x=!1;if(this._hitLimit)x=!1;else if(b&&(x=this._handler(this._data,this._params),x instanceof Promise))return x.then((f=>(this._params=C,this._data="",this._hitLimit=!1,f)));return this._params=C,this._data="",this._hitLimit=!1,x}}},2015:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const p=l(844),v=l(8742),c=l(6242),m=l(6351);class C{constructor(_){this.table=new Uint8Array(_)}setDefault(_,d){this.table.fill(_<<4|d)}add(_,d,h,y){this.table[d<<8|_]=h<<4|y}addMany(_,d,h,y){for(let k=0;k<_.length;k++)this.table[d<<8|_[k]]=h<<4|y}}a.TransitionTable=C;const b=160;a.VT500_TRANSITION_TABLE=(function(){const f=new C(4095),_=Array.apply(null,Array(256)).map(((D,L)=>L)),d=(D,L)=>_.slice(D,L),h=d(32,127),y=d(0,24);y.push(25),y.push.apply(y,d(28,32));const k=d(0,14);let R;for(R in f.setDefault(1,0),f.addMany(h,0,2,0),k)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(y,0,3,0),f.addMany(y,1,3,1),f.add(127,1,0,1),f.addMany(y,8,0,8),f.addMany(y,3,3,3),f.add(127,3,0,3),f.addMany(y,4,3,4),f.add(127,4,0,4),f.addMany(y,6,3,6),f.addMany(y,5,3,5),f.add(127,5,0,5),f.addMany(y,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(y,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(y,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(y,11,0,11),f.addMany(d(32,128),11,0,11),f.addMany(d(28,32),11,0,11),f.addMany(y,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(y,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(y,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 x extends p.Disposable{constructor(_=a.VT500_TRANSITION_TABLE){super(),this._transitions=_,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,y)=>{},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,p.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new c.OscParser),this._dcsParser=this.register(new m.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(_,d=[64,126]){let h=0;if(_.prefix){if(_.prefix.length>1)throw new Error("only one byte as prefix supported");if(h=_.prefix.charCodeAt(0),h&&60>h||h>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(_.intermediates){if(_.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let k=0;k<_.intermediates.length;++k){const R=_.intermediates.charCodeAt(k);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");h<<=8,h|=R}}if(_.final.length!==1)throw new Error("final must be a single byte");const y=_.final.charCodeAt(0);if(d[0]>y||y>d[1])throw new Error(`final must be in range ${d[0]} .. ${d[1]}`);return h<<=8,h|=y,h}identToString(_){const d=[];for(;_;)d.push(String.fromCharCode(255&_)),_>>=8;return d.reverse().join("")}setPrintHandler(_){this._printHandler=_}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(_,d){const h=this._identifier(_,[48,126]);this._escHandlers[h]===void 0&&(this._escHandlers[h]=[]);const y=this._escHandlers[h];return y.push(d),{dispose:()=>{const k=y.indexOf(d);k!==-1&&y.splice(k,1)}}}clearEscHandler(_){this._escHandlers[this._identifier(_,[48,126])]&&delete this._escHandlers[this._identifier(_,[48,126])]}setEscHandlerFallback(_){this._escHandlerFb=_}setExecuteHandler(_,d){this._executeHandlers[_.charCodeAt(0)]=d}clearExecuteHandler(_){this._executeHandlers[_.charCodeAt(0)]&&delete this._executeHandlers[_.charCodeAt(0)]}setExecuteHandlerFallback(_){this._executeHandlerFb=_}registerCsiHandler(_,d){const h=this._identifier(_);this._csiHandlers[h]===void 0&&(this._csiHandlers[h]=[]);const y=this._csiHandlers[h];return y.push(d),{dispose:()=>{const k=y.indexOf(d);k!==-1&&y.splice(k,1)}}}clearCsiHandler(_){this._csiHandlers[this._identifier(_)]&&delete this._csiHandlers[this._identifier(_)]}setCsiHandlerFallback(_){this._csiHandlerFb=_}registerDcsHandler(_,d){return this._dcsParser.registerHandler(this._identifier(_),d)}clearDcsHandler(_){this._dcsParser.clearHandler(this._identifier(_))}setDcsHandlerFallback(_){this._dcsParser.setHandlerFallback(_)}registerOscHandler(_,d){return this._oscParser.registerHandler(_,d)}clearOscHandler(_){this._oscParser.clearHandler(_)}setOscHandlerFallback(_){this._oscParser.setHandlerFallback(_)}setErrorHandler(_){this._errorHandler=_}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(_,d,h,y,k){this._parseStack.state=_,this._parseStack.handlers=d,this._parseStack.handlerPos=h,this._parseStack.transition=y,this._parseStack.chunkPos=k}parse(_,d,h){let y,k=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 L=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(h===!1&&M>-1){for(;M>=0&&(y=L[M](this._params),y!==!0);M--)if(y instanceof Promise)return this._parseStack.handlerPos=M,y}this._parseStack.handlers=[];break;case 4:if(h===!1&&M>-1){for(;M>=0&&(y=L[M](),y!==!0);M--)if(y instanceof Promise)return this._parseStack.handlerPos=M,y}this._parseStack.handlers=[];break;case 6:if(k=_[this._parseStack.chunkPos],y=this._dcsParser.unhook(k!==24&&k!==26,h),y)return y;k===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(k=_[this._parseStack.chunkPos],y=this._oscParser.end(k!==24&&k!==26,h),y)return y;k===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 L=D;L<d;++L){switch(k=_[L],R=this._transitions.table[this.currentState<<8|(k<160?k:b)],R>>4){case 2:for(let B=L+1;;++B){if(B>=d||(k=_[B])<32||k>126&&k<b){this._printHandler(_,L,B),L=B-1;break}if(++B>=d||(k=_[B])<32||k>126&&k<b){this._printHandler(_,L,B),L=B-1;break}if(++B>=d||(k=_[B])<32||k>126&&k<b){this._printHandler(_,L,B),L=B-1;break}if(++B>=d||(k=_[B])<32||k>126&&k<b){this._printHandler(_,L,B),L=B-1;break}}break;case 3:this._executeHandlers[k]?this._executeHandlers[k]():this._executeHandlerFb(k),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:L,code:k,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const M=this._csiHandlers[this._collect<<8|k];let W=M?M.length-1:-1;for(;W>=0&&(y=M[W](this._params),y!==!0);W--)if(y instanceof Promise)return this._preserveStack(3,M,W,R,L),y;W<0&&this._csiHandlerFb(this._collect<<8|k,this._params),this.precedingJoinState=0;break;case 8:do switch(k){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(k-48)}while(++L<d&&(k=_[L])>47&&k<60);L--;break;case 9:this._collect<<=8,this._collect|=k;break;case 10:const z=this._escHandlers[this._collect<<8|k];let F=z?z.length-1:-1;for(;F>=0&&(y=z[F](),y!==!0);F--)if(y instanceof Promise)return this._preserveStack(4,z,F,R,L),y;F<0&&this._escHandlerFb(this._collect<<8|k),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|k,this._params);break;case 13:for(let B=L+1;;++B)if(B>=d||(k=_[B])===24||k===26||k===27||k>127&&k<b){this._dcsParser.put(_,L,B),L=B-1;break}break;case 14:if(y=this._dcsParser.unhook(k!==24&&k!==26),y)return this._preserveStack(6,[],0,R,L),y;k===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 B=L+1;;B++)if(B>=d||(k=_[B])<32||k>127&&k<b){this._oscParser.put(_,L,B),L=B-1;break}break;case 6:if(y=this._oscParser.end(k!==24&&k!==26),y)return this._preserveStack(5,[],0,R,L),y;k===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}a.EscapeSequenceParser=x},6242:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const p=l(5770),v=l(482),c=[];a.OscParser=class{constructor(){this._state=0,this._active=c,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(m,C){this._handlers[m]===void 0&&(this._handlers[m]=[]);const b=this._handlers[m];return b.push(C),{dispose:()=>{const x=b.indexOf(C);x!==-1&&b.splice(x,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=c}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=c,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||c,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,C,b){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(m,C,b);else this._handlerFb(this._id,"PUT",(0,v.utf32ToString)(m,C,b))}start(){this.reset(),this._state=1}put(m,C,b){if(this._state!==3){if(this._state===1)for(;C<b;){const x=m[C++];if(x===59){this._state=2,this._start();break}if(x<48||57<x)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+x-48}this._state===2&&b-C>0&&this._put(m,C,b)}}end(m,C=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let b=!1,x=this._active.length-1,f=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,b=C,f=this._stack.fallThrough,this._stack.paused=!1),!f&&b===!1){for(;x>=0&&(b=this._active[x].end(m),b!==!0);x--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,b;x--}for(;x>=0;x--)if(b=this._active[x].end(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,b}else this._handlerFb(this._id,"END",m);this._active=c,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,C,b){this._hitLimit||(this._data+=(0,v.utf32ToString)(m,C,b),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let C=!1;if(this._hitLimit)C=!1;else if(m&&(C=this._handler(this._data),C instanceof Promise))return C.then((b=>(this._data="",this._hitLimit=!1,b)));return this._data="",this._hitLimit=!1,C}}},8742:(w,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const l=2147483647;class p{static fromArray(c){const m=new p;if(!c.length)return m;for(let C=Array.isArray(c[0])?1:0;C<c.length;++C){const b=c[C];if(Array.isArray(b))for(let x=0;x<b.length;++x)m.addSubParam(b[x]);else m.addParam(b)}return m}constructor(c=32,m=32){if(this.maxLength=c,this.maxSubParamsLength=m,m>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(c),this.length=0,this._subParams=new Int32Array(m),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(c),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const c=new p(this.maxLength,this.maxSubParamsLength);return c.params.set(this.params),c.length=this.length,c._subParams.set(this._subParams),c._subParamsLength=this._subParamsLength,c._subParamsIdx.set(this._subParamsIdx),c._rejectDigits=this._rejectDigits,c._rejectSubDigits=this._rejectSubDigits,c._digitIsSub=this._digitIsSub,c}toArray(){const c=[];for(let m=0;m<this.length;++m){c.push(this.params[m]);const C=this._subParamsIdx[m]>>8,b=255&this._subParamsIdx[m];b-C>0&&c.push(Array.prototype.slice.call(this._subParams,C,b))}return c}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(c){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(c<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=c>l?l:c}}addSubParam(c){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(c<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=c>l?l:c,this._subParamsIdx[this.length-1]++}}hasSubParams(c){return(255&this._subParamsIdx[c])-(this._subParamsIdx[c]>>8)>0}getSubParams(c){const m=this._subParamsIdx[c]>>8,C=255&this._subParamsIdx[c];return C-m>0?this._subParams.subarray(m,C):null}getSubParamsAll(){const c={};for(let m=0;m<this.length;++m){const C=this._subParamsIdx[m]>>8,b=255&this._subParamsIdx[m];b-C>0&&(c[m]=this._subParams.slice(C,b))}return c}addDigit(c){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const C=this._digitIsSub?this._subParams:this.params,b=C[m-1];C[m-1]=~b?Math.min(10*b+c,l):c}}a.Params=p},5741:(w,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,p){const v={instance:p,dispose:p.dispose,isDisposed:!1};this._addons.push(v),p.dispose=()=>this._wrappedAddonDispose(v),p.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let p=-1;for(let v=0;v<this._addons.length;v++)if(this._addons[v]===l){p=v;break}if(p===-1)throw new Error("Could not dispose an addon that has not been loaded");l.isDisposed=!0,l.dispose.apply(l.instance),this._addons.splice(p,1)}}},8771:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const p=l(3785),v=l(511);a.BufferApiView=class{constructor(c,m){this._buffer=c,this.type=m}init(c){return this._buffer=c,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(c){const m=this._buffer.lines.get(c);if(m)return new p.BufferLineApiView(m)}getNullCell(){return new v.CellData}}},3785:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const p=l(511);a.BufferLineApiView=class{constructor(v){this._line=v}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(v,c){if(!(v<0||v>=this._line.length))return c?(this._line.loadCell(v,c),c):this._line.loadCell(v,new p.CellData)}translateToString(v,c,m){return this._line.translateToString(v,c,m)}}},8285:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const p=l(8771),v=l(8460),c=l(844);class m extends c.Disposable{constructor(b){super(),this._core=b,this._onBufferChange=this.register(new v.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new p.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new p.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:(w,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,p){return this._core.registerCsiHandler(l,(v=>p(v.toArray())))}addCsiHandler(l,p){return this.registerCsiHandler(l,p)}registerDcsHandler(l,p){return this._core.registerDcsHandler(l,((v,c)=>p(v,c.toArray())))}addDcsHandler(l,p){return this.registerDcsHandler(l,p)}registerEscHandler(l,p){return this._core.registerEscHandler(l,p)}addEscHandler(l,p){return this.registerEscHandler(l,p)}registerOscHandler(l,p){return this._core.registerOscHandler(l,p)}addOscHandler(l,p){return this.registerOscHandler(l,p)}}},7090:(w,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(w,a,l){var p=this&&this.__decorate||function(f,_,d,h){var y,k=arguments.length,R=k<3?_:h===null?h=Object.getOwnPropertyDescriptor(_,d):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,_,d,h);else for(var D=f.length-1;D>=0;D--)(y=f[D])&&(R=(k<3?y(R):k>3?y(_,d,R):y(_,d))||R);return k>3&&R&&Object.defineProperty(_,d,R),R},v=this&&this.__param||function(f,_){return function(d,h){_(d,h,f)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const c=l(8460),m=l(844),C=l(5295),b=l(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let x=a.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(f){super(),this.isUserScrolling=!1,this._onResize=this.register(new c.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new c.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 C.BufferSet(f,this))}resize(f,_){this.cols=f,this.rows=_,this.buffers.resize(f,_),this._onResize.fire({cols:f,rows:_})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(f,_=!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,_),this._cachedBlankLine=h),h.isWrapped=_;const y=d.ybase+d.scrollTop,k=d.ybase+d.scrollBottom;if(d.scrollTop===0){const R=d.lines.isFull;k===d.lines.length-1?R?d.lines.recycle().copyFrom(h):d.lines.push(h.clone()):d.lines.splice(k+1,0,h.clone()),R?this.isUserScrolling&&(d.ydisp=Math.max(d.ydisp-1,0)):(d.ybase++,this.isUserScrolling||d.ydisp++)}else{const R=k-y+1;d.lines.shiftElements(y+1,R-1,-1),d.lines.set(k,h.clone())}this.isUserScrolling||(d.ydisp=d.ybase),this._onScroll.fire(d.ydisp)}scrollLines(f,_,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 y=h.ydisp;h.ydisp=Math.max(Math.min(h.ydisp+f,h.ybase),0),y!==h.ydisp&&(_||this._onScroll.fire(h.ydisp))}};a.BufferService=x=p([v(0,b.IOptionsService)],x)},7994:(w,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(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,p){this._charsets[l]=p,this.glevel===l&&(this.charset=p)}}},1753:function(w,a,l){var p=this&&this.__decorate||function(h,y,k,R){var D,L=arguments.length,M=L<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,k):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(h,y,k,R);else for(var W=h.length-1;W>=0;W--)(D=h[W])&&(M=(L<3?D(M):L>3?D(y,k,M):D(y,k))||M);return L>3&&M&&Object.defineProperty(y,k,M),M},v=this&&this.__param||function(h,y){return function(k,R){y(k,R,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const c=l(2585),m=l(8460),C=l(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 x(h,y){let k=(h.ctrl?16:0)|(h.shift?4:0)|(h.alt?8:0);return h.button===4?(k|=64,k|=h.action):(k|=3&h.button,4&h.button&&(k|=64),8&h.button&&(k|=128),h.action===32?k|=32:h.action!==0||y||(k|=3)),k}const f=String.fromCharCode,_={DEFAULT:h=>{const y=[x(h,!1)+32,h.col+32,h.row+32];return y[0]>255||y[1]>255||y[2]>255?"":`\x1B[M${f(y[0])}${f(y[1])}${f(y[2])}`},SGR:h=>{const y=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${x(h,!0)};${h.col};${h.row}${y}`},SGR_PIXELS:h=>{const y=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${x(h,!0)};${h.x};${h.y}${y}`}};let d=a.CoreMouseService=class extends C.Disposable{constructor(h,y){super(),this._bufferService=h,this._coreService=y,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 k of Object.keys(b))this.addProtocol(k,b[k]);for(const k of Object.keys(_))this.addEncoding(k,_[k]);this.reset()}addProtocol(h,y){this._protocols[h]=y}addEncoding(h,y){this._encodings[h]=y}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 y=this._encodings[this._activeEncoding](h);return y&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(y):this._coreService.triggerDataEvent(y,!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,y,k){if(k){if(h.x!==y.x||h.y!==y.y)return!1}else if(h.col!==y.col||h.row!==y.row)return!1;return h.button===y.button&&h.action===y.action&&h.ctrl===y.ctrl&&h.alt===y.alt&&h.shift===y.shift}};a.CoreMouseService=d=p([v(0,c.IBufferService),v(1,c.ICoreService)],d)},6975:function(w,a,l){var p=this&&this.__decorate||function(d,h,y,k){var R,D=arguments.length,L=D<3?h:k===null?k=Object.getOwnPropertyDescriptor(h,y):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(d,h,y,k);else for(var M=d.length-1;M>=0;M--)(R=d[M])&&(L=(D<3?R(L):D>3?R(h,y,L):R(h,y))||L);return D>3&&L&&Object.defineProperty(h,y,L),L},v=this&&this.__param||function(d,h){return function(y,k){h(y,k,d)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const c=l(1439),m=l(8460),C=l(844),b=l(2585),x=Object.freeze({insertMode:!1}),f=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let _=a.CoreService=class extends C.Disposable{constructor(d,h,y){super(),this._bufferService=d,this._logService=h,this._optionsService=y,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,c.clone)(x),this.decPrivateModes=(0,c.clone)(f)}reset(){this.modes=(0,c.clone)(x),this.decPrivateModes=(0,c.clone)(f)}triggerDataEvent(d,h=!1){if(this._optionsService.rawOptions.disableStdin)return;const y=this._bufferService.buffer;h&&this._optionsService.rawOptions.scrollOnUserInput&&y.ybase!==y.ydisp&&this._onRequestScrollToBottom.fire(),h&&this._onUserInput.fire(),this._logService.debug(`sending data "${d}"`,(()=>d.split("").map((k=>k.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)],_)},9074:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const p=l(8055),v=l(8460),c=l(844),m=l(6106);let C=0,b=0;class x extends c.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,c.toDisposable)((()=>this.reset())))}registerDecoration(d){if(d.marker.isDisposed)return;const h=new f(d);if(h){const y=h.marker.onDispose((()=>h.dispose()));h.onDispose((()=>{h&&(this._decorations.delete(h)&&this._onDecorationRemoved.fire(h),y.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,y){let k=0,R=0;for(const D of this._decorations.getKeyIterator(h))k=D.options.x??0,R=k+(D.options.width??1),d>=k&&d<R&&(!y||(D.options.layer??"bottom")===y)&&(yield D)}forEachDecorationAtCell(d,h,y,k){this._decorations.forEachByKey(h,(R=>{C=R.options.x??0,b=C+(R.options.width??1),d>=C&&d<b&&(!y||(R.options.layer??"bottom")===y)&&k(R)}))}}a.DecorationService=x;class f extends c.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=p.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=p.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:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const p=l(2585),v=l(8343);class c{constructor(...C){this._entries=new Map;for(const[b,x]of C)this.set(b,x)}set(C,b){const x=this._entries.get(C);return this._entries.set(C,b),x}forEach(C){for(const[b,x]of this._entries.entries())C(b,x)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}a.ServiceCollection=c,a.InstantiationService=class{constructor(){this._services=new c,this._services.set(p.IInstantiationService,this)}setService(m,C){this._services.set(m,C)}getService(m){return this._services.get(m)}createInstance(m,...C){const b=(0,v.getServiceDependencies)(m).sort(((_,d)=>_.index-d.index)),x=[];for(const _ of b){const d=this._services.get(_.id);if(!d)throw new Error(`[createInstance] ${m.name} depends on UNKNOWN service ${_.id}.`);x.push(d)}const f=b.length>0?b[0].index:C.length;if(C.length!==f)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${f+1} conflicts with ${C.length} static arguments`);return new m(...C,...x)}}},7866:function(w,a,l){var p=this&&this.__decorate||function(f,_,d,h){var y,k=arguments.length,R=k<3?_:h===null?h=Object.getOwnPropertyDescriptor(_,d):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,_,d,h);else for(var D=f.length-1;D>=0;D--)(y=f[D])&&(R=(k<3?y(R):k>3?y(_,d,R):y(_,d))||R);return k>3&&R&&Object.defineProperty(_,d,R),R},v=this&&this.__param||function(f,_){return function(d,h){_(d,h,f)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const c=l(844),m=l(2585),C={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,x=a.LogService=class extends c.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=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(f){for(let _=0;_<f.length;_++)typeof f[_]=="function"&&(f[_]=f[_]())}_log(f,_,d){this._evalLazyOptionalParams(d),f.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+_,...d)}trace(f,..._){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,_)}debug(f,..._){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,_)}info(f,..._){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,_)}warn(f,..._){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,_)}error(f,..._){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,_)}};a.LogService=x=p([v(0,m.IOptionsService)],x),a.setTraceLogger=function(f){b=f},a.traceCall=function(f,_,d){if(typeof d.value!="function")throw new Error("not supported");const h=d.value;d.value=function(...y){if(b.logLevel!==m.LogLevelEnum.TRACE)return h.apply(this,y);b.trace(`GlyphRenderer#${h.name}(${y.map((R=>JSON.stringify(R))).join(", ")})`);const k=h.apply(this,y);return b.trace(`GlyphRenderer#${h.name} return`,k),k}}},7302:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const p=l(8460),v=l(844),c=l(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:c.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 C extends v.Disposable{constructor(x){super(),this._onOptionChange=this.register(new p.EventEmitter),this.onOptionChange=this._onOptionChange.event;const f={...a.DEFAULT_OPTIONS};for(const _ in x)if(_ in f)try{const d=x[_];f[_]=this._sanitizeAndValidateOption(_,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(x,f){return this.onOptionChange((_=>{_===x&&f(this.rawOptions[x])}))}onMultipleOptionChange(x,f){return this.onOptionChange((_=>{x.indexOf(_)!==-1&&f()}))}_setupOptions(){const x=_=>{if(!(_ in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);return this.rawOptions[_]},f=(_,d)=>{if(!(_ in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);d=this._sanitizeAndValidateOption(_,d),this.rawOptions[_]!==d&&(this.rawOptions[_]=d,this._onOptionChange.fire(_))};for(const _ in this.rawOptions){const d={get:x.bind(this,_),set:f.bind(this,_)};Object.defineProperty(this.options,_,d)}}_sanitizeAndValidateOption(x,f){switch(x){case"cursorStyle":if(f||(f=a.DEFAULT_OPTIONS[x]),!(function(_){return _==="block"||_==="underline"||_==="bar"})(f))throw new Error(`"${f}" is not a valid value for ${x}`);break;case"wordSeparator":f||(f=a.DEFAULT_OPTIONS[x]);break;case"fontWeight":case"fontWeightBold":if(typeof f=="number"&&1<=f&&f<=1e3)break;f=m.includes(f)?f:a.DEFAULT_OPTIONS[x];break;case"cursorWidth":f=Math.floor(f);case"lineHeight":case"tabStopWidth":if(f<1)throw new Error(`${x} 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(`${x} cannot be less than 0, value: ${f}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(f<=0)throw new Error(`${x} cannot be less than or equal to 0, value: ${f}`);break;case"rows":case"cols":if(!f&&f!==0)throw new Error(`${x} must be numeric, value: ${f}`);break;case"windowsPty":f=f??{}}return f}}a.OptionsService=C},2660:function(w,a,l){var p=this&&this.__decorate||function(C,b,x,f){var _,d=arguments.length,h=d<3?b:f===null?f=Object.getOwnPropertyDescriptor(b,x):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(C,b,x,f);else for(var y=C.length-1;y>=0;y--)(_=C[y])&&(h=(d<3?_(h):d>3?_(b,x,h):_(b,x))||h);return d>3&&h&&Object.defineProperty(b,x,h),h},v=this&&this.__param||function(C,b){return function(x,f){b(x,f,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const c=l(2585);let m=a.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const b=this._bufferService.buffer;if(C.id===void 0){const y=b.addMarker(b.ybase+b.y),k={data:C,id:this._nextId++,lines:[y]};return y.onDispose((()=>this._removeMarkerFromLink(k,y))),this._dataByLinkId.set(k.id,k),k.id}const x=C,f=this._getEntryIdKey(x),_=this._entriesWithId.get(f);if(_)return this.addLineToLink(_.id,b.ybase+b.y),_.id;const d=b.addMarker(b.ybase+b.y),h={id:this._nextId++,key:this._getEntryIdKey(x),data:x,lines:[d]};return d.onDispose((()=>this._removeMarkerFromLink(h,d))),this._entriesWithId.set(h.key,h),this._dataByLinkId.set(h.id,h),h.id}addLineToLink(C,b){const x=this._dataByLinkId.get(C);if(x&&x.lines.every((f=>f.line!==b))){const f=this._bufferService.buffer.addMarker(b);x.lines.push(f),f.onDispose((()=>this._removeMarkerFromLink(x,f)))}}getLinkData(C){var b;return(b=this._dataByLinkId.get(C))==null?void 0:b.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,b){const x=C.lines.indexOf(b);x!==-1&&(C.lines.splice(x,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};a.OscLinkService=m=p([v(0,c.IBufferService)],m)},8343:(w,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const l="di$target",p="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(v){return v[p]||[]},a.createDecorator=function(v){if(a.serviceRegistry.has(v))return a.serviceRegistry.get(v);const c=function(m,C,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(x,f,_){f[l]===f?f[p].push({id:x,index:_}):(f[p]=[{id:x,index:_}],f[l]=f)})(c,m,b)};return c.toString=()=>v,a.serviceRegistry.set(v,c),c}},2585:(w,a,l)=>{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 p=l(8343);var v;a.IBufferService=(0,p.createDecorator)("BufferService"),a.ICoreMouseService=(0,p.createDecorator)("CoreMouseService"),a.ICoreService=(0,p.createDecorator)("CoreService"),a.ICharsetService=(0,p.createDecorator)("CharsetService"),a.IInstantiationService=(0,p.createDecorator)("InstantiationService"),(function(c){c[c.TRACE=0]="TRACE",c[c.DEBUG=1]="DEBUG",c[c.INFO=2]="INFO",c[c.WARN=3]="WARN",c[c.ERROR=4]="ERROR",c[c.OFF=5]="OFF"})(v||(a.LogLevelEnum=v={})),a.ILogService=(0,p.createDecorator)("LogService"),a.IOptionsService=(0,p.createDecorator)("OptionsService"),a.IOscLinkService=(0,p.createDecorator)("OscLinkService"),a.IUnicodeService=(0,p.createDecorator)("UnicodeService"),a.IDecorationService=(0,p.createDecorator)("DecorationService")},1480:(w,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const p=l(8460),v=l(225);class c{static extractShouldJoin(C){return(1&C)!=0}static extractWidth(C){return C>>1&3}static extractCharKind(C){return C>>3}static createPropertyValue(C,b,x=!1){return(16777215&C)<<3|(3&b)<<1|(x?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new p.EventEmitter,this.onChange=this._onChange.event;const C=new v.UnicodeV6;this.register(C),this._active=C.version,this._activeProvider=C}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(C){if(!this._providers[C])throw new Error(`unknown Unicode version "${C}"`);this._active=C,this._activeProvider=this._providers[C],this._onChange.fire(C)}register(C){this._providers[C.version]=C}wcwidth(C){return this._activeProvider.wcwidth(C)}getStringCellWidth(C){let b=0,x=0;const f=C.length;for(let _=0;_<f;++_){let d=C.charCodeAt(_);if(55296<=d&&d<=56319){if(++_>=f)return b+this.wcwidth(d);const k=C.charCodeAt(_);56320<=k&&k<=57343?d=1024*(d-55296)+k-56320+65536:b+=this.wcwidth(k)}const h=this.charProperties(d,x);let y=c.extractWidth(h);c.extractShouldJoin(h)&&(y-=c.extractWidth(x)),b+=y,x=h}return b}charProperties(C,b){return this._activeProvider.charProperties(C,b)}}a.UnicodeService=c}},o={};function u(w){var a=o[w];if(a!==void 0)return a.exports;var l=o[w]={exports:{}};return i[w].call(l.exports,l,l.exports,u),l.exports}var S={};return(()=>{var w=S;Object.defineProperty(w,"__esModule",{value:!0}),w.Terminal=void 0;const a=u(9042),l=u(3236),p=u(844),v=u(5741),c=u(8285),m=u(7975),C=u(7090),b=["cols","rows"];class x extends p.Disposable{constructor(_){super(),this._core=this.register(new l.Terminal(_)),this._addonManager=this.register(new v.AddonManager),this._publicOptions={...this._core.options};const d=y=>this._core.options[y],h=(y,k)=>{this._checkReadonlyOptions(y),this._core.options[y]=k};for(const y in this._core.options){const k={get:d.bind(this,y),set:h.bind(this,y)};Object.defineProperty(this._publicOptions,y,k)}}_checkReadonlyOptions(_){if(b.includes(_))throw new Error(`Option "${_}" 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 C.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 c.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const _=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:_.applicationCursorKeys,applicationKeypadMode:_.applicationKeypad,bracketedPasteMode:_.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:d,originMode:_.origin,reverseWraparoundMode:_.reverseWraparound,sendFocusMode:_.sendFocus,wraparoundMode:_.wraparound}}get options(){return this._publicOptions}set options(_){for(const d in _)this._publicOptions[d]=_[d]}blur(){this._core.blur()}focus(){this._core.focus()}input(_,d=!0){this._core.input(_,d)}resize(_,d){this._verifyIntegers(_,d),this._core.resize(_,d)}open(_){this._core.open(_)}attachCustomKeyEventHandler(_){this._core.attachCustomKeyEventHandler(_)}attachCustomWheelEventHandler(_){this._core.attachCustomWheelEventHandler(_)}registerLinkProvider(_){return this._core.registerLinkProvider(_)}registerCharacterJoiner(_){return this._checkProposedApi(),this._core.registerCharacterJoiner(_)}deregisterCharacterJoiner(_){this._checkProposedApi(),this._core.deregisterCharacterJoiner(_)}registerMarker(_=0){return this._verifyIntegers(_),this._core.registerMarker(_)}registerDecoration(_){return this._checkProposedApi(),this._verifyPositiveIntegers(_.x??0,_.width??0,_.height??0),this._core.registerDecoration(_)}hasSelection(){return this._core.hasSelection()}select(_,d,h){this._verifyIntegers(_,d,h),this._core.select(_,d,h)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(_,d){this._verifyIntegers(_,d),this._core.selectLines(_,d)}dispose(){super.dispose()}scrollLines(_){this._verifyIntegers(_),this._core.scrollLines(_)}scrollPages(_){this._verifyIntegers(_),this._core.scrollPages(_)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(_){this._verifyIntegers(_),this._core.scrollToLine(_)}clear(){this._core.clear()}write(_,d){this._core.write(_,d)}writeln(_,d){this._core.write(_),this._core.write(`\r
|
|
70
|
+
`,d)}paste(_){this._core.paste(_)}refresh(_,d){this._verifyIntegers(_,d),this._core.refresh(_,d)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(_){this._addonManager.loadAddon(this,_)}static get strings(){return a}_verifyIntegers(..._){for(const d of _)if(d===1/0||isNaN(d)||d%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(..._){for(const d of _)if(d&&(d===1/0||isNaN(d)||d%1!=0||d<0))throw new Error("This API only accepts positive integers")}}w.Terminal=x})(),S})()))})(au)),au.exports}var lm=gb(),lu={exports:{}},n_;function mb(){return n_||(n_=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 w=this._terminal.options.scrollback===0?0:u.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(a.getPropertyValue("height")),p=Math.max(0,parseInt(a.getPropertyValue("width"))),v=window.getComputedStyle(this._terminal.element),c=l-(parseInt(v.getPropertyValue("padding-top"))+parseInt(v.getPropertyValue("padding-bottom"))),m=p-(parseInt(v.getPropertyValue("padding-right"))+parseInt(v.getPropertyValue("padding-left")))-w;return{cols:Math.max(2,Math.floor(m/S.css.cell.width)),rows:Math.max(1,Math.floor(c/S.css.cell.height))}}}})(),i})()))})(lu)),lu.exports}var cm=mb();/**
|
|
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 cu=[[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]],vb=[[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]],st;function yb(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 wb=class{constructor(){if(this.version="6",!st){st=new Uint8Array(65536),st.fill(1),st[0]=0,st.fill(0,1,32),st.fill(0,127,160),st.fill(2,4352,4448),st[9001]=2,st[9002]=2,st.fill(2,11904,42192),st[12351]=1,st.fill(2,44032,55204),st.fill(2,63744,64256),st.fill(2,65040,65050),st.fill(2,65072,65136),st.fill(2,65280,65377),st.fill(2,65504,65511);for(let e=0;e<cu.length;++e)st.fill(0,cu[e][0],cu[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?st[e]:yb(e,vb)?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=Pa.extractWidth(r);u===0?o=!1:u>i&&(i=u)}return Pa.createPropertyValue(0,i,o)}},Sb=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?i_.isErrorNoTelemetry(e)?new i_(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)}},Cb=new Sb;function uu(e){xb(e)||Cb.onUnexpectedError(e)}var Ou="Canceled";function xb(e){return e instanceof bb?!0:e instanceof Error&&e.name===Ou&&e.message===Ou}var bb=class extends Error{constructor(){super(Ou),this.name=this.message}},i_=class Hu extends Error{constructor(r){super(r),this.name="CodeExpectedError"}static fromError(r){if(r instanceof Hu)return r;let i=new Hu;return i.message=r.message,i.stack=r.stack,i}static isErrorNoTelemetry(r){return r.name==="CodeExpectedError"}};function Eb(e,r){let i=this,o=!1,u;return function(){return o||(o=!0,r||(u=e.apply(i,arguments))),u}}var kb;(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})(kb||(kb={}));var um;(e=>{function r(y){return y&&typeof y=="object"&&typeof y[Symbol.iterator]=="function"}e.is=r;let i=Object.freeze([]);function o(){return i}e.empty=o;function*u(y){yield y}e.single=u;function S(y){return r(y)?y:u(y)}e.wrap=S;function w(y){return y||i}e.from=w;function*a(y){for(let k=y.length-1;k>=0;k--)yield y[k]}e.reverse=a;function l(y){return!y||y[Symbol.iterator]().next().done===!0}e.isEmpty=l;function p(y){return y[Symbol.iterator]().next().value}e.first=p;function v(y,k){let R=0;for(let D of y)if(k(D,R++))return!0;return!1}e.some=v;function c(y,k){for(let R of y)if(k(R))return R}e.find=c;function*m(y,k){for(let R of y)k(R)&&(yield R)}e.filter=m;function*C(y,k){let R=0;for(let D of y)yield k(D,R++)}e.map=C;function*b(y,k){let R=0;for(let D of y)yield*k(D,R++)}e.flatMap=b;function*x(...y){for(let k of y)yield*k}e.concat=x;function f(y,k,R){let D=R;for(let L of y)D=k(D,L);return D}e.reduce=f;function*_(y,k,R=y.length){for(k<0&&(k+=y.length),R<0?R+=y.length:R>y.length&&(R=y.length);k<R;k++)yield y[k]}e.slice=_;function d(y,k=Number.POSITIVE_INFINITY){let R=[];if(k===0)return[R,y];let D=y[Symbol.iterator]();for(let L=0;L<k;L++){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(y){let k=[];for await(let R of y)k.push(R);return Promise.resolve(k)}e.asyncToArray=h})(um||(um={}));function hm(e){if(um.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 Lb(...e){return dm(()=>hm(e))}function dm(e){return{dispose:Eb(()=>{e()})}}var fm=class pm{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{hm(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?pm.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)}};fm.DISABLE_DISPOSED_WARNING=!1;var dh=fm,Ma=class{constructor(){this._store=new dh,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)}};Ma.None=Object.freeze({dispose(){}});var Rb=globalThis.performance&&typeof globalThis.performance.now=="function",Db=class _m{static create(r){return new _m(r)}constructor(r){this._now=Rb&&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}},Tb;(e=>{e.None=()=>Ma.None;function r(F,B){return c(F,()=>{},0,void 0,!0,void 0,B)}e.defer=r;function i(F){return(B,O=null,q)=>{let U=!1,K;return K=F(V=>{if(!U)return K?K.dispose():U=!0,B.call(O,V)},null,q),U&&K.dispose(),K}}e.once=i;function o(F,B,O){return p((q,U=null,K)=>F(V=>q.call(U,B(V)),null,K),O)}e.map=o;function u(F,B,O){return p((q,U=null,K)=>F(V=>{B(V),q.call(U,V)},null,K),O)}e.forEach=u;function S(F,B,O){return p((q,U=null,K)=>F(V=>B(V)&&q.call(U,V),null,K),O)}e.filter=S;function w(F){return F}e.signal=w;function a(...F){return(B,O=null,q)=>{let U=Lb(...F.map(K=>K(V=>B.call(O,V))));return v(U,q)}}e.any=a;function l(F,B,O,q){let U=O;return o(F,K=>(U=B(U,K),U),q)}e.reduce=l;function p(F,B){let O,q={onWillAddFirstListener(){O=F(U.fire,U)},onDidRemoveLastListener(){O==null||O.dispose()}},U=new Jr(q);return B==null||B.add(U),U.event}function v(F,B){return B instanceof Array?B.push(F):B&&B.add(F),F}function c(F,B,O=100,q=!1,U=!1,K,V){let A,I,P,j=0,Y,Z={leakWarningThreshold:K,onWillAddFirstListener(){A=F(ae=>{j++,I=B(I,ae),q&&!P&&(ie.fire(I),I=void 0),Y=()=>{let X=I;I=void 0,P=void 0,(!q||j>1)&&ie.fire(X),j=0},typeof O=="number"?(clearTimeout(P),P=setTimeout(Y,O)):P===void 0&&(P=0,queueMicrotask(Y))})},onWillRemoveListener(){U&&j>0&&(Y==null||Y())},onDidRemoveLastListener(){Y=void 0,A.dispose()}},ie=new Jr(Z);return V==null||V.add(ie),ie.event}e.debounce=c;function m(F,B=0,O){return e.debounce(F,(q,U)=>q?(q.push(U),q):[U],B,void 0,!0,void 0,O)}e.accumulate=m;function C(F,B=(q,U)=>q===U,O){let q=!0,U;return S(F,K=>{let V=q||!B(K,U);return q=!1,U=K,V},O)}e.latch=C;function b(F,B,O){return[e.filter(F,B,O),e.filter(F,q=>!B(q),O)]}e.split=b;function x(F,B=!1,O=[],q){let U=O.slice(),K=F(I=>{U?U.push(I):A.fire(I)});q&&q.add(K);let V=()=>{U==null||U.forEach(I=>A.fire(I)),U=null},A=new Jr({onWillAddFirstListener(){K||(K=F(I=>A.fire(I)),q&&q.add(K))},onDidAddFirstListener(){U&&(B?setTimeout(V):V())},onDidRemoveLastListener(){K&&K.dispose(),K=null}});return q&&q.add(A),A.event}e.buffer=x;function f(F,B){return(O,q,U)=>{let K=B(new d);return F(function(V){let A=K.evaluate(V);A!==_&&O.call(q,A)},void 0,U)}}e.chain=f;let _=Symbol("HaltChainable");class d{constructor(){this.steps=[]}map(B){return this.steps.push(B),this}forEach(B){return this.steps.push(O=>(B(O),O)),this}filter(B){return this.steps.push(O=>B(O)?O:_),this}reduce(B,O){let q=O;return this.steps.push(U=>(q=B(q,U),q)),this}latch(B=(O,q)=>O===q){let O=!0,q;return this.steps.push(U=>{let K=O||!B(U,q);return O=!1,q=U,K?U:_}),this}evaluate(B){for(let O of this.steps)if(B=O(B),B===_)break;return B}}function h(F,B,O=q=>q){let q=(...A)=>V.fire(O(...A)),U=()=>F.on(B,q),K=()=>F.removeListener(B,q),V=new Jr({onWillAddFirstListener:U,onDidRemoveLastListener:K});return V.event}e.fromNodeEventEmitter=h;function y(F,B,O=q=>q){let q=(...A)=>V.fire(O(...A)),U=()=>F.addEventListener(B,q),K=()=>F.removeEventListener(B,q),V=new Jr({onWillAddFirstListener:U,onDidRemoveLastListener:K});return V.event}e.fromDOMEventEmitter=y;function k(F){return new Promise(B=>i(F)(B))}e.toPromise=k;function R(F){let B=new Jr;return F.then(O=>{B.fire(O)},()=>{B.fire(void 0)}).finally(()=>{B.dispose()}),B.event}e.fromPromise=R;function D(F,B){return F(O=>B.fire(O))}e.forward=D;function L(F,B,O){return B(O),F(q=>B(q))}e.runAndSubscribe=L;class M{constructor(B,O){this._observable=B,this._counter=0,this._hasChanged=!1;let q={onWillAddFirstListener:()=>{B.addObserver(this)},onDidRemoveLastListener:()=>{B.removeObserver(this)}};this.emitter=new Jr(q),O&&O.add(this.emitter)}beginUpdate(B){this._counter++}handlePossibleChange(B){}handleChange(B,O){this._hasChanged=!0}endUpdate(B){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function W(F,B){return new M(F,B).emitter.event}e.fromObservable=W;function z(F){return(B,O,q)=>{let U=0,K=!1,V={beginUpdate(){U++},endUpdate(){U--,U===0&&(F.reportChanges(),K&&(K=!1,B.call(O)))},handlePossibleChange(){},handleChange(){K=!0}};F.addObserver(V),F.reportChanges();let A={dispose(){F.removeObserver(V)}};return q instanceof dh?q.add(A):Array.isArray(q)&&q.push(A),A}}e.fromObservableLight=z})(Tb||(Tb={}));var ju=class Fu{constructor(r){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${r}_${Fu._idPool++}`,Fu.all.add(this)}start(r){this._stopWatch=new Db,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}}};ju.all=new Set,ju._idPool=0;var Ab=ju,Mb=-1,gm=class mm{constructor(r,i,o=(mm._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,w]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${w}):`;console.warn(a),console.warn(S);let l=new Bb(a,S);this._errorHandler(l)}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}};gm._idPool=1;var Pb=gm,Nb=class vm{constructor(r){this.value=r}static create(){let r=new Error;return new vm(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}},Ib=class extends Error{constructor(e,r){super(e),this.name="ListenerRefusalError",this.stack=r}},Ob=0,hu=class{constructor(e){this.value=e,this.id=Ob++}},Hb=2,jb,Jr=class{constructor(e){var r,i,o,u;this._size=0,this._options=e,this._leakageMon=(r=this._options)!=null&&r.leakWarningThreshold?new Pb((e==null?void 0:e.onListenerError)??uu,((i=this._options)==null?void 0:i.leakWarningThreshold)??Mb):void 0,this._perfMon=(o=this._options)!=null&&o._profName?new Ab(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 w,a,l,p,v;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let c=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(c);let m=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],C=new Ib(`${c}. HINT: Stack shows most frequent listener (${m[1]}-times)`,m[0]);return(((w=this._options)==null?void 0:w.onListenerError)||uu)(C),Ma.None}if(this._disposed)return Ma.None;r&&(e=e.bind(r));let o=new hu(e),u;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=Nb.create(),u=this._leakageMon.check(o.stack,this._size+1)),this._listeners?this._listeners instanceof hu?(this._deliveryQueue??(this._deliveryQueue=new Fb),this._listeners=[this._listeners,o]):this._listeners.push(o):((l=(a=this._options)==null?void 0:a.onWillAddFirstListener)==null||l.call(a,this),this._listeners=o,(v=(p=this._options)==null?void 0:p.onDidAddFirstListener)==null||v.call(p,this)),this._size++;let S=dm(()=>{u==null||u(),this._removeListener(o)});return i instanceof dh?i.add(S):Array.isArray(i)&&i.push(S),S}),this._event}_removeListener(e){var u,S,w,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=(w=this._options)==null?void 0:w.onDidRemoveLastListener)==null||a.call(w,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*Hb<=r.length){let l=0;for(let p=0;p<r.length;p++)r[p]?r[l++]=r[p]:o&&(this._deliveryQueue.end--,l<this._deliveryQueue.i&&this._deliveryQueue.i--);r.length=l}}_deliver(e,r){var o;if(!e)return;let i=((o=this._options)==null?void 0:o.onListenerError)||uu;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 hu)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}},Fb=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}},Pa=class ya{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Jr,this.onChange=this._onChange.event;let r=new wb;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 w=r.charCodeAt(S);if(55296<=w&&w<=56319){if(++S>=u)return i+this.wcwidth(w);let p=r.charCodeAt(S);56320<=p&&p<=57343?w=(w-55296)*1024+p-56320+65536:i+=this.wcwidth(p)}let a=this.charProperties(w,o),l=ya.extractWidth(a);ya.extractShouldJoin(a)&&(l-=ya.extractWidth(o)),i+=l,o=a}return i}charProperties(r,i){return this._activeProvider.charProperties(r,i)}},du=[[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]],zb=[[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]],fu=[[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]],$b=[[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]],Er;function s_(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 Wb=class{constructor(){if(this.version="11",!Er){Er=new Uint8Array(65536),Er.fill(1),Er[0]=0,Er.fill(0,1,32),Er.fill(0,127,160);for(let e=0;e<du.length;++e)Er.fill(0,du[e][0],du[e][1]+1);for(let e=0;e<fu.length;++e)Er.fill(2,fu[e][0],fu[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Er[e]:s_(e,zb)?0:s_(e,$b)?2:1}charProperties(e,r){let i=this.wcwidth(e),o=i===0&&r!==0;if(o){let u=Pa.extractWidth(r);u===0?o=!1:u>i&&(i=u)}return Pa.createPropertyValue(0,i,o)}},ym=class{activate(e){e.unicode.register(new Wb)}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 Ub=class{constructor(e,r,i,o={}){this._terminal=e,this._regex=r,this._handler=i,this._options=o}provideLinks(e,r){let i=qb.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 Vb(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 qb=class wa{static computeLink(r,i,o,u){let S=new RegExp(i.source,(i.flags||"")+"g"),[w,a]=wa._getWindowedLineStrings(r-1,o),l=w.join(""),p,v=[];for(;p=S.exec(l);){let c=p[0];if(!Vb(c))continue;let[m,C]=wa._mapStrIdx(o,a,0,p.index),[b,x]=wa._mapStrIdx(o,m,C,c.length);if(m===-1||C===-1||b===-1||x===-1)continue;let f={start:{x:C+1,y:m+1},end:{x,y:b+1}};v.push({range:f,text:c,activate:u})}return v}static _getWindowedLineStrings(r,i){let o,u=r,S=r,w=0,a="",l=[];if(o=i.buffer.active.getLine(r)){let p=o.translateToString(!0);if(o.isWrapped&&p[0]!==" "){for(w=0;(o=i.buffer.active.getLine(--u))&&w<2048&&(a=o.translateToString(!0),w+=a.length,l.push(a),!(!o.isWrapped||a.indexOf(" ")!==-1)););l.reverse()}for(l.push(p),w=0;(o=i.buffer.active.getLine(++S))&&o.isWrapped&&w<2048&&(a=o.translateToString(!0),w+=a.length,l.push(a),a.indexOf(" ")===-1););}return[l,u]}static _mapStrIdx(r,i,o,u){let S=r.buffer.active,w=S.getNullCell(),a=o;for(;u;){let l=S.getLine(i);if(!l)return[-1,-1];for(let p=a;p<l.length;++p){l.getCell(p,w);let v=w.getChars();if(w.getWidth()&&(u-=v.length||1,p===l.length-1&&v==="")){let c=S.getLine(i+1);c&&c.isWrapped&&(c.getCell(0,w),w.getWidth()===2&&(u+=1))}if(u<0)return[i,p]}i++,a=0}return[i,a]}},Kb=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function Xb(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 wm=class{constructor(e=Xb,r={}){this._handler=e,this._options=r}activate(e){this._terminal=e;let r=this._options,i=r.urlRegex||Kb;this._linkProvider=this._terminal.registerLinkProvider(new Ub(this._terminal,i,this._handler,r))}dispose(){var e;(e=this._linkProvider)==null||e.dispose()}};async function Yb(e){try{const r=await e.arrayBuffer(),i=new Uint8Array(r);let o="";const u=8192;for(let l=0;l<i.length;l+=u)o+=String.fromCharCode(...i.subarray(l,l+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 Gb({agent:e,socket:r}){const i=Q.useRef(null),o=Q.useRef(null),u=Q.useRef(null),S=Q.useRef(null),w=Q.useRef(!1),a=()=>{if(o.current||!i.current||w.current)return;w.current=!0;const p=new lm.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 cm.FitAddon;p.loadAddon(v);try{const c=new ym;p.loadAddon(c),p.unicode.activeVersion="11"}catch{}try{const c=new wm;p.loadAddon(c)}catch{}p.open(i.current);try{v.fit()}catch{}o.current=p,u.current=v};Q.useEffect(()=>{a();const p=i.current;if(!p)return;const v=new ResizeObserver(()=>{var m;try{(m=u.current)==null||m.fit()}catch{}const c=S.current;if(c&&r.current){const C=o.current;C&&r.current.emit("agent:resize",c,C.cols,C.rows)}});return v.observe(p),()=>{var c;v.disconnect(),(c=o.current)==null||c.dispose(),o.current=null,u.current=null,w.current=!1}},[]),Q.useEffect(()=>{var R;a();const p=o.current,v=r.current;if(!e||!p||!v){S.current=null;return}const c=S.current;S.current=e.id,c!==e.id&&p.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&&p){const M=D.scrollback;let W=0;const z=()=>{if(W>=M.length){m=!0,p.scrollToBottom(),setTimeout(()=>p.scrollToBottom(),50);return}const F=M.slice(W,W+16384);W+=16384,p.write(F,z)};z()}else m=!0}).catch(()=>{m=!0});const C=`agent:pty:${e.id}`,b=D=>{if(S.current===e.id&&p){const L=p.buffer.active,M=L.viewportY>=L.baseY-1;p.write(D),m&&M&&p.scrollToBottom()}};v.on(C,b);const x=p.onData(D=>{v.emit("agent:input",e.id,D)});p.attachCustomKeyEventHandler(D=>D.type==="keydown"&&D.key==="Enter"&&D.shiftKey?(D.preventDefault(),v.emit("agent:input",e.id,`
|
|
99
|
+
`),!1):!0);try{(R=u.current)==null||R.fit(),v.emit("agent:resize",e.id,p.cols,p.rows)}catch{}const f=i.current,_=e.id,d=async D=>{p.write(`\r
|
|
100
|
+
\x1B[33mUploading image...\x1B[0m`);const L=await Yb(D);L&&S.current===_?(v.emit("agent:input",_,L+"\r"),p.write(`\r
|
|
101
|
+
\x1B[32mImage ready: `+L+`\x1B[0m\r
|
|
102
|
+
`)):p.write(`\r
|
|
103
|
+
\x1B[31mFailed to upload image\x1B[0m\r
|
|
104
|
+
`)},h=D=>{var W,z;const L=(W=D.clipboardData)==null?void 0:W.items;if(!L)return;for(const F of L)if(F.type.startsWith("image/")){D.preventDefault(),D.stopPropagation();const B=F.getAsFile();B&&d(B);return}const M=(z=D.clipboardData)==null?void 0:z.getData("text/plain");if(M){D.preventDefault(),D.stopPropagation();const F=M.replace(/\r\n|\r|\n/g," ");v.emit("agent:input",_,F)}},y=D=>{var L,M;(M=(L=D.dataTransfer)==null?void 0:L.types)!=null&&M.includes("Files")&&(D.preventDefault(),D.stopPropagation())},k=D=>{var M;const L=(M=D.dataTransfer)==null?void 0:M.files;if(!(!L||L.length===0)){for(const W of L)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",y,!0),f==null||f.addEventListener("drop",k,!0),p.focus(),()=>{v.off(C,b),x.dispose(),f==null||f.removeEventListener("paste",h,!0),f==null||f.removeEventListener("dragover",y,!0),f==null||f.removeEventListener("drop",k,!0)}},[e,r]);const l=()=>{var p;(p=o.current)==null||p.focus()};return N.jsxs("div",{style:{width:"100%",height:"100%",position:"relative"},children:[N.jsx("div",{ref:i,onClick:l,style:{width:"100%",height:"100%",display:e?"block":"none",padding:"2px 0",overscrollBehavior:"contain"}}),!e&&N.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:12,color:"#333"},children:[N.jsx("div",{style:{fontSize:28,fontFamily:"'JetBrains Mono', monospace",fontWeight:400,letterSpacing:"0.05em"},children:"_"}),N.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 Qb(e){try{const r=await e.arrayBuffer(),i=new Uint8Array(r);let o="";const u=8192;for(let l=0;l<i.length;l+=u)o+=String.fromCharCode(...i.subarray(l,l+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 Jb={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 Zb(e){switch(e){case"running":return"#4ade80";case"starting":return"#fbbf24";case"done":return"#666";case"dead":return"#f87171";default:return"#666"}}function eE({orientation:e,onDrag:r}){const i=Q.useCallback(o=>{o.preventDefault();let u=e==="horizontal"?o.clientX:o.clientY;const S=a=>{const l=e==="horizontal"?a.clientX:a.clientY,p=l-u;u=l,r(p)},w=()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",w),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",S),document.addEventListener("mouseup",w),document.body.style.cursor=e==="horizontal"?"col-resize":"row-resize",document.body.style.userSelect="none"},[e,r]);return N.jsx("div",{className:`multi-term-divider ${e}`,onMouseDown:i})}function tE({agents:e,socket:r,onSelectAgent:i}){const o=Q.useRef(new Map),u=Q.useRef(new Map),S=Q.useRef(null),[w,a]=Q.useState(null),[l,p]=Q.useState([]),v=Q.useRef(""),c=e.filter(d=>d.status==="running"||d.status==="starting"),m=c.map(d=>d.id).join(",");Q.useEffect(()=>{if(m!==v.current){v.current=m;const d=c.length;d>0&&p(Array(d).fill(100/d))}},[m,c.length]);const C=Q.useCallback(d=>h=>{h?u.current.set(d,h):u.current.delete(d)},[]);Q.useEffect(()=>{var k,R;const d=r.current;if(!d)return;const h=new Set(c.map(D=>D.id)),y=o.current;for(const[D,L]of y)h.has(D)||((k=L.cleanup)==null||k.call(L),L.term.dispose(),y.delete(D));for(const D of c){const L=u.current.get(D.id);if(!L)continue;if(y.has(D.id)){const Y=y.get(D.id);try{Y.fit.fit()}catch{}continue}const M=new lm.Terminal({theme:Jb,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 cm.FitAddon;M.loadAddon(W);try{const Y=new ym;M.loadAddon(Y),M.unicode.activeVersion="11"}catch{}try{M.loadAddon(new wm)}catch{}M.open(L);try{W.fit()}catch{}let z=!1;fetch(`/api/agents/${D.id}/scrollback`).then(Y=>Y.ok?Y.json():null).then(Y=>{if(Y!=null&&Y.scrollback&&M){const ie=Y.scrollback;let ae=0;const X=()=>{if(ae>=ie.length){z=!0,M.scrollToBottom(),setTimeout(()=>M.scrollToBottom(),50);return}const H=ie.slice(ae,ae+16384);ae+=16384,M.write(H,X)};X()}else z=!0}).catch(()=>{z=!0});const F=`agent:pty:${D.id}`,B=Y=>{const Z=M.buffer.active,ie=Z.viewportY>=Z.baseY-1;M.write(Y),z&&ie&&M.scrollToBottom()};d.on(F,B);const O=M.onData(Y=>{d.emit("agent:input",D.id,Y)});M.attachCustomKeyEventHandler(Y=>Y.type==="keydown"&&Y.key==="Enter"&&Y.shiftKey?(Y.preventDefault(),d.emit("agent:input",D.id,`
|
|
105
|
+
`),!1):!0);const q=new ResizeObserver(()=>{try{W.fit(),d.emit("agent:resize",D.id,M.cols,M.rows)}catch{}});q.observe(L);const U=(R=u.current.get(D.id))==null?void 0:R.parentElement,K=D.id,V=async Y=>{M.write(`\r
|
|
106
|
+
\x1B[33mUploading image...\x1B[0m`);const Z=await Qb(Y);Z?(d.emit("agent:input",K,Z+"\r"),M.write(`\r
|
|
107
|
+
\x1B[32mImage ready: `+Z+`\x1B[0m\r
|
|
108
|
+
`)):M.write(`\r
|
|
109
|
+
\x1B[31mFailed to upload image\x1B[0m\r
|
|
110
|
+
`)},A=Y=>{var ae,X;const Z=(ae=Y.clipboardData)==null?void 0:ae.items;if(!Z)return;for(const H of Z)if(H.type.startsWith("image/")){Y.preventDefault(),Y.stopPropagation();const re=H.getAsFile();re&&V(re);return}const ie=(X=Y.clipboardData)==null?void 0:X.getData("text/plain");if(ie){Y.preventDefault(),Y.stopPropagation();const H=ie.replace(/\r\n|\r|\n/g," ");d.emit("agent:input",K,H)}},I=Y=>{var Z,ie;(ie=(Z=Y.dataTransfer)==null?void 0:Z.types)!=null&&ie.includes("Files")&&(Y.preventDefault(),Y.stopPropagation())},P=Y=>{var ie;const Z=(ie=Y.dataTransfer)==null?void 0:ie.files;if(!(!Z||Z.length===0)){for(const ae of Z)if(ae.type.startsWith("image/")){Y.preventDefault(),Y.stopPropagation(),V(ae);return}}};U==null||U.addEventListener("paste",A,!0),U==null||U.addEventListener("dragover",I,!0),U==null||U.addEventListener("drop",P,!0);const j=()=>{d.off(F,B),O.dispose(),q.disconnect(),U==null||U.removeEventListener("paste",A,!0),U==null||U.removeEventListener("dragover",I,!0),U==null||U.removeEventListener("drop",P,!0)};y.set(D.id,{term:M,fit:W,cleanup:j})}return()=>{var D;for(const[,L]of y)(D=L.cleanup)==null||D.call(L),L.term.dispose();y.clear()}},[c.map(d=>d.id).join(","),r.current]);const b=Q.useCallback(d=>{a(d.id);const h=o.current.get(d.id);h&&h.term.focus(),i==null||i(d)},[i]),x=Q.useCallback((d,h)=>{if(!S.current)return;const y=S.current.offsetWidth,k=h/y*100;p(R=>{const D=[...R],L=10,M=D[d]+k,W=D[d+1]-k;return M>=L&&W>=L&&(D[d]=M,D[d+1]=W),D})},[]),f=c.length;if(f===0)return N.jsxs("div",{className:"multi-term-empty",children:[N.jsx("div",{className:"multi-term-empty-icon",children:"_"}),N.jsx("div",{className:"multi-term-empty-text",children:"No running agents"})]});const _=l.length===f?l:Array(f).fill(100/f);return N.jsx("div",{className:"multi-term-container",ref:S,children:c.map((d,h)=>N.jsxs($u.Fragment,{children:[N.jsxs("div",{className:`multi-term-pane ${w===d.id?"focused":""}`,style:{flexBasis:`${_[h]}%`},onClick:()=>b(d),children:[N.jsxs("div",{className:"multi-term-pane-header",children:[N.jsx("span",{className:"multi-term-status-dot",style:{background:Zb(d.status)}}),N.jsx("span",{className:"multi-term-pane-name",children:d.name}),N.jsx("span",{className:"multi-term-pane-task",children:d.task})]}),N.jsx("div",{className:"multi-term-pane-body",ref:C(d.id)})]}),h<f-1&&N.jsx(eE,{orientation:"horizontal",onDrag:y=>x(h,y)})]},d.id))})}const rE=["all","error","warn","info","debug"],Xa="ERROR|FATAL|WARN|WARNING|INFO|DEBUG|TRACE",Sm=String.raw`\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2}(?:[,.]\d+)?(?:Z|[+-]\d{2}:?\d{2})?`,nE=new RegExp(String.raw`^\[([^\]]+)\]\s*(${Xa})\s*(\[[^\]]*\])?\s*(.*)$`,"i"),iE=new RegExp(String.raw`^(${Sm})\s+-\s+([^\s]+)\s+-\s+(${Xa})\s+-\s*(.*)$`,"i"),sE=new RegExp(String.raw`^(${Sm})\s+\[?(${Xa})\]?\s*(\[[^\]]*\])?\s*(.*)$`,"i"),oE=new RegExp(String.raw`^(${Xa}):\s*(.*)$`,"i"),aE=/^([A-Za-z_][\w.-]*(?:\.[\w.-]+)+):\s*(.*)$/,lE=/^(module=[^:\s]+):\s*(.*)$/i,cE=/\b(GET|POST|PUT|PATCH|DELETE|OPTIONS|HEAD)\s+["/][^"]*\s+HTTP\/\d(?:\.\d)?"?\s+\d{3}\b/i,uE=/\b(uvicorn|fastapi|django|flask|gunicorn|werkzeug|localhost|127\.0\.0\.1|0\.0\.0\.0|listening|started server|application startup|traceback|exception|module=)\b/i;function hE(e){return e==="all"?"All levels":e.toUpperCase()}function dE(e){return`agent-log-level ${e}`}function la(e){const r=e.toLowerCase();return r==="fatal"?"error":r==="warning"?"warn":r==="trace"?"debug":r}function pu(e){var i;const r=e.match(/\d{2}:\d{2}:\d{2}(?:[,.]\d+)?/);return((i=r==null?void 0:r[0])==null?void 0:i.replace(",","."))??e}function o_(e){return(e==null?void 0:e.replace(/^\[|\]$/g,"").trim())||void 0}function Cm(e){return e.replace(/^\s*[⎿│┃┆┊]\s?/,"").replace(/^\s{2,}(?=\[?\d{4}-\d{2}-\d{2}|(?:DEBUG|INFO|WARN|WARNING|ERROR|TRACE|FATAL)\b|module=)/i,"").trim()}function _u(e){const r=e.match(lE);if(r)return{context:r[1],message:r[2]};const i=e.match(aE);return i?{context:i[1],message:i[2]}:{message:e}}function xm(e){const r=Cm(e),i=r.match(iE);if(i){const[,w,a,l,p]=i;return{timestamp:pu(w),level:la(l),context:a,message:p}}const o=r.match(nE);if(o){const[,w,a,l,p]=o,v=_u(p);return{timestamp:pu(w),level:la(a),context:v.context??o_(l),message:v.message}}const u=r.match(sE);if(u){const[,w,a,l,p]=u,v=_u(p);return{timestamp:pu(w),level:la(a),context:o_(l)??v.context,message:v.message}}const S=r.match(oE);if(S){const[,w,a]=S,l=_u(a);return{level:la(w),context:l.context,message:l.message}}return{message:r}}function fE(e){const r=Cm(e.text),i=xm(r);return!!(i.timestamp||i.context||cE.test(r)||uE.test(r))}function a_(e,r){const i=new Map;for(const o of[...e,...r])i.set(o.id,o);return[...i.values()].sort((o,u)=>o.id-u.id).slice(-2e3)}function pE(e){return e>0?"No logs match the current filters.":"No server-like output found in this agent terminal yet. Turn off Server only to see raw agent terminal logs."}function _E({agents:e,selectedAgent:r,socket:i,onSelectAgent:o}){const[u,S]=Q.useState([]),[w,a]=Q.useState(""),[l,p]=Q.useState("all"),[v,c]=Q.useState(!0),[m,C]=Q.useState(!0),b=Q.useRef(null),x=Q.useMemo(()=>e.filter(y=>y.status!=="dead"),[e]),f=r??x[0]??null;Q.useEffect(()=>{if(!f){S([]);return}let y=!1;return S([]),lr(`/api/agents/${f.id}/logs?source=agent`).then(k=>k.ok?k.json():null).then(k=>{if(y)return;const R=Array.isArray(k==null?void 0:k.logs)?k.logs:[];S(D=>a_(R,D))}).catch(()=>{y||S([])}),()=>{y=!0}},[f==null?void 0:f.id]),Q.useEffect(()=>{const y=i.current;if(!y||!f)return;const k=`agent:logs:${f.id}`,R=D=>{D.source==="agent"&&S(L=>a_(L,[D]))};return y.on(k,R),()=>{y.off(k,R)}},[f==null?void 0:f.id,i]);const _=Q.useMemo(()=>{const y=w.trim().toLowerCase();return u.filter(k=>l!=="all"&&k.level!==l||v&&!fE(k)?!1:y?k.text.toLowerCase().includes(y):!0)},[u,l,w,v]);Q.useEffect(()=>{var y;m&&((y=b.current)==null||y.scrollIntoView({block:"end"}))},[_,m]);const d=y=>{const k=e.find(R=>R.id===y);k&&o(k)},h=pE(u.length);return N.jsxs("div",{className:"agent-logs",children:[N.jsxs("div",{className:"agent-logs-header",children:[N.jsxs("div",{className:"agent-logs-title",children:[N.jsxs("div",{children:[N.jsx("span",{children:"Server Logs"}),N.jsx("span",{className:"agent-logs-subtitle",children:"Agent terminal stream"})]}),N.jsxs("span",{className:"agent-logs-count",children:[_.length,"/",u.length]})]}),N.jsxs("div",{className:"agent-logs-controls",children:[N.jsxs("select",{value:(f==null?void 0:f.id)??"",onChange:y=>d(y.target.value),disabled:x.length===0,"aria-label":"Select agent logs",children:[x.length===0&&N.jsx("option",{value:"",children:"No agents"}),x.map(y=>N.jsx("option",{value:y.id,children:y.name},y.id))]}),N.jsx("select",{value:l,onChange:y=>p(y.target.value),"aria-label":"Filter log level",children:rE.map(y=>N.jsx("option",{value:y,children:hE(y)},y))}),N.jsx("input",{value:w,onChange:y=>a(y.target.value),placeholder:"Search logs...","aria-label":"Search logs"}),N.jsxs("label",{className:"agent-logs-autoscroll",children:[N.jsx("input",{type:"checkbox",checked:v,onChange:y=>c(y.target.checked)}),"Server only"]}),N.jsxs("label",{className:"agent-logs-autoscroll",children:[N.jsx("input",{type:"checkbox",checked:m,onChange:y=>C(y.target.checked)}),"Auto-scroll"]}),N.jsx("button",{onClick:()=>S([]),disabled:u.length===0,children:"Clear View"})]})]}),N.jsxs("div",{className:"agent-logs-list",children:[!f&&N.jsx("div",{className:"agent-logs-empty",children:"Spawn an agent and run a server command. Logs from Claude/Codex terminal output will appear here."}),f&&_.length===0&&N.jsx("div",{className:"agent-logs-empty",children:h}),_.map(y=>{const k=xm(y.text),R=k.level??y.level,D=k.timestamp??new Date(y.timestamp).toLocaleTimeString(),L=k.context||y.stream;return N.jsxs("div",{className:`agent-log-row ${R}`,children:[N.jsx("span",{className:"agent-log-time",children:D}),N.jsx("span",{className:dE(R),children:R}),N.jsxs("span",{className:"agent-log-text",children:[L&&N.jsx("span",{className:`agent-log-source ${y.stream??"stdout"}`,children:L}),N.jsx("span",{className:"agent-log-message",children:k.message})]})]},y.id)}),N.jsx("div",{ref:b})]})]})}function gE({messages:e,agents:r,selectedAgentId:i,onClear:o}){const u=Q.useRef(null),S=Q.useMemo(()=>{const a={user:"User"};return r.forEach(l=>{a[l.id]=l.name}),a},[r]),w=Q.useMemo(()=>i?e.filter(a=>a.from_agent===i||a.to_agent===i):e,[e,i]);return Q.useEffect(()=>{var a;(a=u.current)==null||a.scrollIntoView({behavior:"smooth"})},[w]),N.jsxs("div",{className:"message-feed",children:[N.jsxs("div",{className:"message-feed-header",children:[N.jsx("span",{children:i?`Messages for ${S[i]||i}`:"All Messages"}),w.length>0&&N.jsx("button",{className:"clear-messages-btn",onClick:o,children:"Clear All"})]}),N.jsxs("div",{className:"message-feed-list",children:[w.length===0&&N.jsx("div",{className:"message-feed-empty",children:"No messages yet"}),[...w].reverse().map(a=>N.jsxs("div",{className:"message-item",children:[N.jsxs("div",{className:"message-meta",children:[N.jsx("span",{className:"message-from",children:S[a.from_agent]||a.from_agent.slice(0,8)}),N.jsx("span",{className:"message-arrow",children:" → "}),N.jsx("span",{className:"message-to",children:a.to_agent==="all"?"All":S[a.to_agent]||a.to_agent.slice(0,8)}),N.jsx("span",{className:"message-time",children:new Date(a.created_at).toLocaleTimeString()})]}),N.jsx("div",{className:"message-content",children:a.content})]},a.id)),N.jsx("div",{ref:u})]})]})}function mE({entries:e,onRemove:r}){return N.jsxs("div",{className:"context-viewer",children:[N.jsx("div",{className:"context-header",children:"Shared Context"}),e.length===0&&N.jsx("div",{className:"context-empty",children:"No context entries yet"}),N.jsxs("table",{className:"context-table",children:[N.jsx("thead",{children:N.jsxs("tr",{children:[N.jsx("th",{children:"Key"}),N.jsx("th",{children:"Value"}),N.jsx("th",{children:"Updated By"}),N.jsx("th",{children:"Updated At"}),N.jsx("th",{})]})}),N.jsx("tbody",{children:e.map(i=>N.jsxs("tr",{children:[N.jsx("td",{className:"context-key",children:i.key}),N.jsx("td",{className:"context-value",children:i.value}),N.jsx("td",{children:i.updated_by||"—"}),N.jsx("td",{className:"context-time",children:i.updated_at?new Date(i.updated_at).toLocaleTimeString():"—"}),N.jsx("td",{children:N.jsx("button",{className:"context-remove-btn",onClick:()=>r(i.key),title:`Remove "${i.key}"`,children:"✕"})})]},i.key))})]})]})}function vE({diff:e,fileName:r}){const i=e.split(`
|
|
111
|
+
`);return N.jsxs("div",{className:"diff-viewer",children:[r&&N.jsx("div",{className:"diff-filename",children:r}),N.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"),N.jsx("div",{className:S,children:o},u)})})]})}function yE(e){switch(e){case"add":return"A";case"change":return"M";case"unlink":return"D";default:return"?"}}function wE(e){switch(e){case"add":return"#4ade80";case"change":return"#fbbf24";case"unlink":return"#f87171";default:return"#666"}}function SE({changes:e,agents:r,onClear:i}){const[o,u]=Q.useState(null),S=Q.useMemo(()=>{const w=new Map;for(const a of r)w.set(a.id,a.name);return w},[r]);return N.jsxs("div",{className:"file-changes",children:[N.jsxs("div",{className:"file-changes-header",children:[N.jsxs("span",{children:["File Changes (",e.length,")"]}),e.length>0&&N.jsx("button",{className:"file-changes-clear-btn",onClick:i,children:"Clear"})]}),N.jsxs("div",{className:"file-changes-list",children:[e.length===0&&N.jsx("div",{className:"file-changes-empty",children:"No file changes detected yet. Changes will appear here as agents edit files."}),e.map(w=>{const a=w.agent_id?S.get(w.agent_id):null;return N.jsxs("div",{className:"file-change-item",children:[N.jsxs("div",{className:"file-change-row",onClick:()=>u(o===w.id?null:w.id),children:[N.jsx("span",{className:"file-change-type",style:{color:wE(w.change_type)},children:yE(w.change_type)}),N.jsx("span",{className:"file-change-path",children:w.file_path}),a&&N.jsx("span",{className:"file-change-agent",title:"Agent that made this change",children:a}),N.jsx("span",{className:"file-change-time",children:new Date(w.created_at).toLocaleTimeString()}),N.jsx("span",{className:"file-change-expand",children:w.diff_text?o===w.id?"▼":"▶":""})]}),o===w.id&&w.diff_text&&N.jsx(vE,{diff:w.diff_text})]},w.id)})]})]})}function ca(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 CE(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 xE(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 bE({prs:e,branches:r,currentBranch:i,ghAvailable:o,repoInfo:u,agents:S,fetchPRDetail:w}){const[a,l]=Q.useState("all"),[p,v]=Q.useState(null),[c,m]=Q.useState(null),[C,b]=Q.useState(!1),[x,f]=Q.useState(!0),_=Q.useMemo(()=>a==="all"?e:e.filter(k=>k.state.toUpperCase()===a.toUpperCase()),[e,a]),d=Q.useMemo(()=>new Set(S.map(k=>k.name.toLowerCase())),[S]),h=async k=>{if(p===k){v(null),m(null);return}v(k),m(null),b(!0);const R=await w(k);m(R),b(!1)},y=k=>{const R=k.name.toLowerCase();for(const L of d)if(R.includes(L))return L;const D=k.author.toLowerCase();for(const L of d)if(D.includes(L))return L;return null};return N.jsxs("div",{className:"prs-tab",children:[N.jsxs("div",{className:"prs-header",children:[N.jsxs("div",{className:"prs-header-left",children:[N.jsxs("span",{children:["Pull Requests (",_.length,")"]}),N.jsxs("select",{className:"prs-filter",value:a,onChange:k=>l(k.target.value),children:[N.jsx("option",{value:"all",children:"All"}),N.jsx("option",{value:"open",children:"Open"}),N.jsx("option",{value:"closed",children:"Closed"}),N.jsx("option",{value:"merged",children:"Merged"})]})]}),u&&N.jsx("a",{className:"prs-repo-link",href:u.url,target:"_blank",rel:"noopener noreferrer",onClick:k=>{k.preventDefault(),window.open(u.url,"_blank")},children:u.nameWithOwner})]}),N.jsxs("div",{className:"prs-list",children:[o===!1&&N.jsxs("div",{className:"prs-unavailable",children:["GitHub CLI not available.",N.jsx("br",{}),"Install ",N.jsx("code",{children:"gh"})," and run ",N.jsx("code",{children:"gh auth login"})," to see PRs."]}),o!==!1&&_.length===0&&N.jsx("div",{className:"prs-empty",children:"No pull requests found."}),_.map(k=>{const R=k.isDraft?"draft":k.state.toLowerCase(),D=CE(k.statusCheckRollup),L=xE(k.reviewDecision),M=p===k.number;return N.jsxs("div",{className:"pr-item",children:[N.jsxs("div",{className:"pr-row",onClick:()=>h(k.number),children:[N.jsx("span",{className:"pr-expand",children:M?"▼":"▶"}),N.jsx("span",{className:`pr-status-badge ${R}`}),N.jsxs("span",{className:"pr-number",children:["#",k.number]}),N.jsx("span",{className:"pr-title",children:k.title}),L&&N.jsx("span",{className:`pr-review ${L.cls}`,children:L.text}),D.icon&&N.jsx("span",{className:`pr-ci ${D.cls}`,children:D.icon}),N.jsx("span",{className:"pr-branch",title:k.headRefName,children:k.headRefName}),N.jsx("span",{className:"pr-author",children:k.author.login}),N.jsx("span",{className:"pr-time",children:ca(k.createdAt)}),N.jsx("button",{className:"pr-link-btn",title:"Open in GitHub",onClick:W=>{W.stopPropagation(),window.open(k.url,"_blank")},children:"↗"})]}),M&&N.jsxs("div",{className:"pr-detail",children:[C&&N.jsx("div",{className:"pr-detail-loading",children:"Loading..."}),c&&c.number===k.number&&N.jsxs(N.Fragment,{children:[c.body&&N.jsx("div",{className:"pr-detail-body",children:c.body}),c.statusCheckRollup&&c.statusCheckRollup.length>0&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"pr-detail-section-title",children:"Checks"}),N.jsx("div",{className:"pr-detail-checks",children:c.statusCheckRollup.map((W,z)=>{var F,B,O,q;return N.jsxs("span",{className:`pr-check ${((F=W.conclusion)==null?void 0:F.toLowerCase())==="success"?"success":((B=W.conclusion)==null?void 0:B.toLowerCase())==="failure"?"failure":"pending"}`,children:[((O=W.conclusion)==null?void 0:O.toLowerCase())==="success"?"✓":((q=W.conclusion)==null?void 0:q.toLowerCase())==="failure"?"✗":"○"," ",W.name]},z)})})]}),c.reviews&&c.reviews.length>0&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"pr-detail-section-title",children:"Reviews"}),c.reviews.map((W,z)=>N.jsxs("div",{className:"pr-comment",children:[N.jsxs("div",{className:"pr-comment-header",children:[N.jsx("strong",{children:W.author.login})," ",W.state.toLowerCase().replace("_"," ")," ",ca(W.submittedAt)]}),W.body&&N.jsx("div",{className:"pr-comment-body",children:W.body})]},z))]}),c.comments&&c.comments.length>0&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"pr-detail-section-title",children:"Comments"}),c.comments.map((W,z)=>N.jsxs("div",{className:"pr-comment",children:[N.jsxs("div",{className:"pr-comment-header",children:[N.jsx("strong",{children:W.author.login})," ",ca(W.createdAt)]}),N.jsx("div",{className:"pr-comment-body",children:W.body})]},z))]}),(!c.reviews||c.reviews.length===0)&&(!c.comments||c.comments.length===0)&&!c.body&&N.jsx("div",{className:"pr-detail-loading",children:"No details available."})]})]})]},k.number)})]}),N.jsxs("div",{className:"branches-section",children:[N.jsxs("div",{className:"branches-header",onClick:()=>f(k=>!k),children:[N.jsxs("span",{children:["Branches (",r.length,")",i?` — ${i}`:""]}),N.jsx("span",{className:"branches-toggle",children:x?"▼":"▶"})]}),x&&N.jsxs("div",{className:"branches-list",children:[r.length===0&&N.jsx("div",{className:"prs-empty",children:"No branches found."}),r.map(k=>{const R=y(k);return N.jsxs("div",{className:`branch-item ${k.isCurrent?"current":""}`,children:[N.jsx("span",{className:"branch-current-marker",children:k.isCurrent?"●":""}),N.jsx("span",{className:`branch-name ${k.isCurrent?"current":""}`,title:k.name,children:k.name}),N.jsx("span",{className:"branch-message",children:k.lastCommitMessage}),R&&N.jsx("span",{className:"pr-branch",children:R}),N.jsx("span",{className:"branch-author",children:k.author}),N.jsxs("div",{className:"branch-ahead-behind",children:[k.ahead>0&&N.jsxs("span",{className:"branch-badge ahead",children:[k.ahead,"\\u2191"]}),k.behind>0&&N.jsxs("span",{className:"branch-badge behind",children:[k.behind,"\\u2193"]})]}),N.jsx("span",{className:"branch-time",children:k.lastCommitDate?ca(k.lastCommitDate):""})]},k.name)})]})]})]})}function EE({content:e,onChange:r}){const[i,o]=Q.useState(e),[u,S]=Q.useState(!1),[w,a]=Q.useState(!1),l=Q.useRef(null);Q.useEffect(()=>{w||o(e)},[e,w]);const p=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)},c=m=>{(m.metaKey||m.ctrlKey)&&m.key==="s"&&(m.preventDefault(),w&&v())};return N.jsxs("div",{className:"crewmd-editor",children:[N.jsxs("div",{className:"crewmd-header",children:[N.jsx("span",{className:"crewmd-title",children:"Rules"}),N.jsxs("div",{className:"crewmd-actions",children:[w&&N.jsx("span",{className:"crewmd-dirty",children:"unsaved"}),N.jsx("button",{className:"crewmd-save-btn",onClick:v,disabled:!w||u,children:u?"Saving...":"Save"})]})]}),N.jsx("textarea",{ref:l,className:"crewmd-textarea",value:i,onChange:m=>p(m.target.value),onKeyDown:c,spellCheck:!1,placeholder:"Write global instructions for all agents..."})]})}function kE(e){const[r,i]=Q.useState([]),[o,u]=Q.useState([]),[S,w]=Q.useState(""),[a,l]=Q.useState(null),[p,v]=Q.useState(null),[c,m]=Q.useState(!0);Q.useEffect(()=>{fetch("/api/github/status").then(b=>b.json()).then(b=>{l(b.available),v(b.repo||null)}).catch(()=>l(!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&&w(b.current),Array.isArray(b.branches)&&u(b.branches)}).catch(()=>{}).finally(()=>m(!1))},[]),Q.useEffect(()=>{const b=e.current;if(!b)return;const x=_=>{Array.isArray(_)&&i(_)},f=_=>{_.current&&w(_.current),Array.isArray(_.branches)&&u(_.branches)};return b.on("github:prs:updated",x),b.on("git:branches:updated",f),()=>{b.off("github:prs:updated",x),b.off("git:branches:updated",f)}},[e]);const C=Q.useCallback(async b=>{try{const x=await fetch(`/api/github/prs/${b}`);return x.ok?await x.json():null}catch{return null}},[]);return{prs:r,branches:o,currentBranch:S,ghAvailable:a,repoInfo:p,loading:c,fetchPRDetail:C}}function LE({onSpawn:e,onClose:r,initialMode:i="spawn",error:o}){const[u,S]=Q.useState(i),[w,a]=Q.useState(""),[l,p]=Q.useState(""),[v,c]=Q.useState(""),[m,C]=Q.useState("claude"),[b,x]=Q.useState(!1),f=async()=>{x(!0);try{const h=await(await fetch("/api/pick-folder",{method:"POST"})).json();h.path&&c(h.path)}catch{}x(!1)},_=()=>{if(u==="open"){if(!v.trim())return;const d=v.trim().split("/").filter(Boolean).pop()||"project";e(w.trim()||d,l.trim()||`Work on the project at ${v.trim()}. Explore the codebase and wait for instructions.`,v.trim(),m)}else{if(!w.trim()||!l.trim())return;e(w.trim(),l.trim(),v.trim()||void 0,m)}};return N.jsx("div",{className:"dialog-overlay",onClick:r,children:N.jsxs("div",{className:"dialog",onClick:d=>d.stopPropagation(),children:[N.jsxs("div",{className:"dialog-mode-tabs",children:[N.jsx("button",{className:`dialog-mode-tab ${u==="spawn"?"active":""}`,onClick:()=>S("spawn"),children:"Spawn Agent"}),N.jsx("button",{className:`dialog-mode-tab ${u==="open"?"active":""}`,onClick:()=>S("open"),children:"Open Project"})]}),N.jsxs("label",{children:["Agent Service",N.jsxs("div",{className:"service-selector",children:[N.jsx("button",{type:"button",className:`service-btn ${m==="claude"?"active":""}`,onClick:()=>C("claude"),children:"Claude"}),N.jsx("button",{type:"button",className:`service-btn ${m==="codex"?"active":""}`,onClick:()=>C("codex"),children:"Codex"})]})]}),u==="open"?N.jsxs(N.Fragment,{children:[N.jsxs("label",{children:["Project Directory",N.jsxs("div",{className:"browse-row",children:[N.jsx("input",{type:"text",value:v,onChange:d=>c(d.target.value),placeholder:"/Users/you/your-project",autoFocus:!0}),N.jsx("button",{type:"button",className:"browse-btn",onClick:f,disabled:b,children:b?"...":"Browse"})]})]}),N.jsxs("label",{children:["Agent Name ",N.jsx("span",{className:"optional",children:"(optional)"}),N.jsx("input",{type:"text",value:w,onChange:d=>a(d.target.value),placeholder:"Auto-detected from path"})]}),N.jsxs("label",{children:["Initial Task ",N.jsx("span",{className:"optional",children:"(optional)"}),N.jsx("textarea",{value:l,onChange:d=>p(d.target.value),placeholder:"Explore the codebase and wait for instructions...",rows:3})]})]}):N.jsxs(N.Fragment,{children:[N.jsxs("label",{children:["Name",N.jsx("input",{type:"text",value:w,onChange:d=>a(d.target.value),placeholder:"e.g. researcher",autoFocus:!0})]}),N.jsxs("label",{children:["Task",N.jsx("textarea",{value:l,onChange:d=>p(d.target.value),placeholder:"Describe what this agent should do...",rows:4})]}),N.jsxs("label",{children:["Working Directory ",N.jsx("span",{className:"optional",children:"(optional)"}),N.jsxs("div",{className:"browse-row",children:[N.jsx("input",{type:"text",value:v,onChange:d=>c(d.target.value),placeholder:"e.g. /Users/you/project (leave blank for server cwd)"}),N.jsx("button",{type:"button",className:"browse-btn",onClick:f,disabled:b,children:b?"...":"Browse"})]})]})]}),o&&N.jsx("div",{className:"dialog-error",children:o}),N.jsxs("div",{className:"dialog-actions",children:[N.jsx("button",{onClick:r,children:"Cancel"}),N.jsx("button",{className:"primary",onClick:_,children:u==="open"?"Open":"Spawn"})]})]})})}function RE({size:e=28}){return N.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[N.jsx("path",{d:"M50 5 A45 45 0 1 1 15 75",stroke:"currentColor",strokeWidth:"6",strokeLinecap:"round",fill:"none"}),N.jsx("path",{d:"M30 18 Q55 45 78 30",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round",fill:"none"}),N.jsx("path",{d:"M20 55 Q50 35 75 65",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round",fill:"none"}),N.jsx("path",{d:"M22 72 Q50 60 50 90",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round",fill:"none"}),N.jsx("circle",{cx:"30",cy:"18",r:"6",fill:"currentColor"}),N.jsx("circle",{cx:"78",cy:"30",r:"6",fill:"currentColor"}),N.jsx("circle",{cx:"75",cy:"65",r:"6",fill:"currentColor"}),N.jsx("circle",{cx:"22",cy:"72",r:"6",fill:"currentColor"}),N.jsx("circle",{cx:"50",cy:"90",r:"5.5",fill:"currentColor"})]})}function DE(){var be;const{socket:e,agents:r,messages:i,contextEntries:o,crewMd:u,setCrewMd:S,fileChanges:w}=iy(),{prs:a,branches:l,currentBranch:p,ghAvailable:v,repoInfo:c,fetchPRDetail:m}=kE(e),[C,b]=Q.useState(null),x=r.find(ce=>ce.id===C)??null,[f,_]=Q.useState("graph"),[d,h]=Q.useState(!1),[y,k]=Q.useState("spawn"),[R,D]=Q.useState(""),[L,M]=Q.useState("all"),[W,z]=Q.useState("multi"),[F,B]=Q.useState(()=>window.innerWidth>=768),[O,q]=Q.useState(!1),[U,K]=Q.useState(null),[V,A]=Q.useState(null),I=Q.useCallback(async()=>{q(!0),A(null);try{const ce=await fetch("/api/pair");if(!ce.ok){const Re=await ce.text();A(Re||`Error ${ce.status}`);return}const ge=await ce.json();K(ge)}catch(ce){A(ce.message||"Failed to load pairing info")}},[]),[P,j]=Q.useState(null),Y=Q.useCallback(async(ce,ge,Re,Ie)=>{j(null);try{const ze=await lr("/api/spawn",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ce,task:ge,cwd:Re,service:Ie||"claude"})}),Qe=await ze.json();if(!ze.ok){j(Qe.error||"Unknown error");return}h(!1),j(null)}catch(ze){j(ze.message||"Failed to connect to server")}},[]),Z=Q.useCallback(async ce=>{await fetch(`/api/agents/${ce}`,{method:"DELETE"})},[]),ie=Q.useCallback(async ce=>{await fetch(`/api/agents/${ce}/remove`,{method:"DELETE"}),C===ce&&b(null)},[C]),ae=Q.useCallback(async ce=>{await fetch(`/api/agents/${ce}/rollback`,{method:"POST"})},[]),X=Q.useCallback(async ce=>{await fetch(`/api/agents/${ce.id}/remove`,{method:"DELETE"});const Re=await(await lr("/api/spawn",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ce.name,task:ce.task,cwd:ce.agent_cwd||void 0,service:ce.service||"claude"})})).json();Re.id&&(b(Re.id),_("terminal"))},[]),H=Q.useCallback(async ce=>{await fetch(`/api/context/${encodeURIComponent(ce)}`,{method:"DELETE"})},[]),re=Q.useCallback(async()=>{if(!R.trim())return;const ce=L,ge=R;if(D(""),ce!=="all")await fetch(`/api/agents/${ce}/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:ge})}).catch(()=>{}),await lr("/api/messages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:"user",to:ce,content:ge})});else{const Re=r.filter(Ie=>Ie.status==="running");await Promise.all(Re.map(Ie=>fetch(`/api/agents/${Ie.id}/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:ge})}).catch(()=>{}))),await lr("/api/messages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:"user",to:"all",content:ge})})}},[R,L,r]),te=Q.useCallback(async()=>{await lr("/api/messages",{method:"DELETE"})},[]),ue=Q.useCallback(async()=>{await lr("/api/file-changes",{method:"DELETE"})},[]),le=Q.useCallback(ce=>{b(ce.id),_("terminal")},[]),pe=Q.useCallback(ce=>{k(ce),h(!0)},[]);Q.useEffect(()=>{const ce=["graph","terminal","logs","files","prs","messages","context","crewmd"],ge=Re=>{const Ie=Re.target,ze=Ie.tagName==="INPUT"||Ie.tagName==="TEXTAREA"||Ie.tagName==="SELECT",Qe=Ie.closest(".xterm"),ut=Re.metaKey||Re.ctrlKey;if(Re.key==="Escape"){h(!1);return}const qe=ut&&(Re.key==="["||Re.key==="]"||Re.key==="\\");if(Qe&&qe)Re.stopPropagation();else if(ze||Qe)return;if(!ut)return;const pt=parseInt(Re.key);if(pt>=1&&pt<=ce.length){Re.preventDefault(),_(ce[pt-1]);return}switch(Re.key){case"n":Re.preventDefault(),k("spawn"),h(!0);break;case"o":Re.preventDefault(),k("open"),h(!0);break;case"[":{Re.preventDefault();const Ne=r.filter($e=>$e.status!=="dead");if(Ne.length===0)break;const Je=Ne.findIndex($e=>$e.id===C),ht=Je<=0?Ne.length-1:Je-1;b(Ne[ht].id),_("terminal");break}case"]":{Re.preventDefault();const Ne=r.filter($e=>$e.status!=="dead");if(Ne.length===0)break;const Je=Ne.findIndex($e=>$e.id===C),ht=Je>=Ne.length-1?0:Je+1;b(Ne[ht].id),_("terminal");break}case"\\":Re.preventDefault(),z(Ne=>Ne==="multi"?"single":"multi");break}};return document.addEventListener("keydown",ge,!0),()=>document.removeEventListener("keydown",ge,!0)},[r,C]);const Se=[{key:"graph",label:"Graph"},{key:"terminal",label:"Terminal"},{key:"logs",label:"Logs"},{key:"files",label:"Files"},{key:"prs",label:"PRs"},{key:"messages",label:"Messages"},{key:"context",label:"Context"},{key:"crewmd",label:"Rules"}];return N.jsxs("div",{className:"app",children:[N.jsxs("header",{className:"app-header",children:[N.jsx("button",{className:"header-hamburger",onClick:()=>B(ce=>!ce),title:"Toggle sidebar",children:"☰"}),N.jsxs("div",{className:"header-brand",children:[N.jsx(RE,{size:26}),N.jsx("h1",{children:"Clustr"})]}),(()=>{const ce=r.reduce((ge,Re)=>ge+(Re.total_cost||0),0);return ce>0?N.jsxs("span",{className:"header-total-cost",children:["Total: $",ce.toFixed(4)]}):null})(),N.jsxs("div",{className:"header-actions",children:[window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"?N.jsx("button",{className:"header-connect-phone",onClick:I,title:"Connect phone",children:"Connect Phone"}):null,N.jsx("button",{onClick:()=>pe("open"),children:"Open Project"}),N.jsx("button",{className:"primary",onClick:()=>pe("spawn"),children:"New Agent"})]})]}),N.jsxs("div",{className:"app-body",children:[F&&N.jsx("div",{className:"sidebar-backdrop",onClick:()=>B(!1)}),N.jsxs("aside",{className:`sidebar ${F?"":"collapsed"}`,children:[N.jsx("button",{className:"sidebar-toggle",onClick:()=>B(ce=>!ce),title:F?"Collapse sidebar":"Expand sidebar",children:F?"‹":"›"}),F&&N.jsx(oy,{agents:r,selectedId:C,onSelect:ce=>{b(ce.id),_("terminal"),window.innerWidth<768&&B(!1)},onKill:Z,onRemove:ie,onRollback:ae,onRestart:X})]}),N.jsxs("main",{className:"main-content",children:[N.jsxs("nav",{className:"tabs",children:[Se.map(ce=>N.jsx("button",{className:f===ce.key?"tab active":"tab",onClick:()=>_(ce.key),children:ce.label},ce.key)),f==="terminal"&&N.jsxs("div",{className:"terminal-view-toggle",children:[N.jsx("button",{className:`view-toggle-btn ${W==="multi"?"active":""}`,onClick:()=>z("multi"),title:"Split view — all agents",children:"⊞"}),N.jsx("button",{className:`view-toggle-btn ${W==="single"?"active":""}`,onClick:()=>z("single"),title:"Single view — selected agent",children:"☐"})]})]}),N.jsxs("div",{className:"tab-content",children:[f==="graph"&&N.jsx(_b,{agents:r,messages:i,onSelectAgent:le}),f==="terminal"&&W==="multi"&&N.jsx(tE,{agents:r,socket:e,onSelectAgent:ce=>b(ce.id)}),f==="terminal"&&W==="single"&&N.jsx(Gb,{agent:x,socket:e}),f==="logs"&&N.jsx(_E,{agents:r,selectedAgent:x,socket:e,onSelectAgent:ce=>b(ce.id)}),f==="messages"&&N.jsx(gE,{messages:i,agents:r,selectedAgentId:(x==null?void 0:x.id)??null,onClear:te}),f==="context"&&N.jsx(mE,{entries:o,onRemove:H}),f==="files"&&N.jsx(SE,{changes:w,agents:r,onClear:ue}),f==="prs"&&N.jsx(bE,{prs:a,branches:l,currentBranch:p,ghAvailable:v,repoInfo:c,agents:r,fetchPRDetail:m}),f==="crewmd"&&N.jsx(EE,{content:u,onChange:S})]})]})]}),N.jsxs("footer",{className:"app-footer",children:[N.jsxs("select",{value:L,onChange:ce=>M(ce.target.value),children:[N.jsx("option",{value:"all",children:"All Agents"}),r.filter(ce=>ce.status==="running").map(ce=>N.jsx("option",{value:ce.id,children:ce.name},ce.id))]}),N.jsx("input",{type:"text",placeholder:L==="all"?"Broadcast message to all agents...":`Send message to ${((be=r.find(ce=>ce.id===L))==null?void 0:be.name)||"agent"}...`,value:R,onChange:ce=>D(ce.target.value),onKeyDown:ce=>ce.key==="Enter"&&re()}),N.jsx("button",{className:"primary",onClick:re,disabled:!R.trim(),children:"Send"})]}),d&&N.jsx(LE,{onSpawn:Y,onClose:()=>{h(!1),j(null)},initialMode:y,error:P}),O&&N.jsx("div",{className:"pair-modal-overlay",onClick:()=>q(!1),children:N.jsxs("div",{className:"pair-modal",onClick:ce=>ce.stopPropagation(),children:[N.jsxs("div",{className:"pair-modal-header",children:[N.jsx("h2",{children:"Connect Phone"}),N.jsx("button",{className:"pair-modal-close",onClick:()=>q(!1),children:"✕"})]}),V?N.jsx("p",{className:"pair-modal-error",children:V}):U?N.jsxs(N.Fragment,{children:[N.jsx("p",{className:"pair-modal-hint",children:"Scan to open Clustr on your phone's browser"}),N.jsx("img",{className:"pair-qr",src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(U.qrSvg)}`,alt:"QR code to connect phone"}),N.jsxs("div",{className:"pair-urls",children:[N.jsxs("div",{className:"pair-url-row",children:[N.jsx("span",{className:"pair-url-label",children:"Local"}),N.jsxs("span",{className:"pair-url-text",children:[U.localUrl,"?token=…"]}),N.jsx("button",{onClick:()=>navigator.clipboard.writeText(`${U.localUrl}?token=${U.token}`),children:"Copy"})]}),U.remoteUrl&&N.jsxs("div",{className:"pair-url-row",children:[N.jsx("span",{className:"pair-url-label",children:"Remote"}),N.jsxs("span",{className:"pair-url-text",children:[U.remoteUrl,"?token=…"]}),N.jsx("button",{onClick:()=>navigator.clipboard.writeText(`${U.remoteUrl}?token=${U.token}`),children:"Copy"})]}),!U.remoteUrl&&N.jsxs("p",{className:"pair-tunnel-hint",children:["Set ",N.jsx("code",{children:"CLUSTR_TUNNEL=1"})," to enable remote access via Cloudflare Tunnel."]})]})]}):N.jsx("p",{className:"pair-modal-loading",children:"Loading pairing info…"})]})})]})}uv.createRoot(document.getElementById("root")).render(N.jsx($u.StrictMode,{children:N.jsx(DE,{})}));
|