@marktoflow/gui 2.0.0-alpha.15 → 2.0.0-alpha.16

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.
@@ -0,0 +1,708 @@
1
+ function b4(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var lu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pp={exports:{}},Ta={},mp={exports:{}},Oe={};/**
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 p_;function S4(){if(p_)return Oe;p_=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.iterator;function g(D){return D===null||typeof D!="object"?null:(D=p&&D[p]||D["@@iterator"],typeof D=="function"?D:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,w={};function x(D,W,oe){this.props=D,this.context=W,this.refs=w,this.updater=oe||v}x.prototype.isReactComponent={},x.prototype.setState=function(D,W){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,W,"setState")},x.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function S(){}S.prototype=x.prototype;function k(D,W,oe){this.props=D,this.context=W,this.refs=w,this.updater=oe||v}var N=k.prototype=new S;N.constructor=k,b(N,x.prototype),N.isPureReactComponent=!0;var C=Array.isArray,R=Object.prototype.hasOwnProperty,T={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function O(D,W,oe){var K,J={},te=null,Y=null;if(W!=null)for(K in W.ref!==void 0&&(Y=W.ref),W.key!==void 0&&(te=""+W.key),W)R.call(W,K)&&!I.hasOwnProperty(K)&&(J[K]=W[K]);var ee=arguments.length-2;if(ee===1)J.children=oe;else if(1<ee){for(var ie=Array(ee),ue=0;ue<ee;ue++)ie[ue]=arguments[ue+2];J.children=ie}if(D&&D.defaultProps)for(K in ee=D.defaultProps,ee)J[K]===void 0&&(J[K]=ee[K]);return{$$typeof:e,type:D,key:te,ref:Y,props:J,_owner:T.current}}function P(D,W){return{$$typeof:e,type:D.type,key:W,ref:D.ref,props:D.props,_owner:D._owner}}function B(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function M(D){var W={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(oe){return W[oe]})}var L=/\/+/g;function U(D,W){return typeof D=="object"&&D!==null&&D.key!=null?M(""+D.key):W.toString(36)}function $(D,W,oe,K,J){var te=typeof D;(te==="undefined"||te==="boolean")&&(D=null);var Y=!1;if(D===null)Y=!0;else switch(te){case"string":case"number":Y=!0;break;case"object":switch(D.$$typeof){case e:case t:Y=!0}}if(Y)return Y=D,J=J(Y),D=K===""?"."+U(Y,0):K,C(J)?(oe="",D!=null&&(oe=D.replace(L,"$&/")+"/"),$(J,W,oe,"",function(ue){return ue})):J!=null&&(B(J)&&(J=P(J,oe+(!J.key||Y&&Y.key===J.key?"":(""+J.key).replace(L,"$&/")+"/")+D)),W.push(J)),1;if(Y=0,K=K===""?".":K+":",C(D))for(var ee=0;ee<D.length;ee++){te=D[ee];var ie=K+U(te,ee);Y+=$(te,W,oe,ie,J)}else if(ie=g(D),typeof ie=="function")for(D=ie.call(D),ee=0;!(te=D.next()).done;)te=te.value,ie=K+U(te,ee++),Y+=$(te,W,oe,ie,J);else if(te==="object")throw W=String(D),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.");return Y}function z(D,W,oe){if(D==null)return D;var K=[],J=0;return $(D,K,"","",function(te){return W.call(oe,te,J++)}),K}function V(D){if(D._status===-1){var W=D._result;W=W(),W.then(function(oe){(D._status===0||D._status===-1)&&(D._status=1,D._result=oe)},function(oe){(D._status===0||D._status===-1)&&(D._status=2,D._result=oe)}),D._status===-1&&(D._status=0,D._result=W)}if(D._status===1)return D._result.default;throw D._result}var G={current:null},F={transition:null},q={ReactCurrentDispatcher:G,ReactCurrentBatchConfig:F,ReactCurrentOwner:T};function X(){throw Error("act(...) is not supported in production builds of React.")}return Oe.Children={map:z,forEach:function(D,W,oe){z(D,function(){W.apply(this,arguments)},oe)},count:function(D){var W=0;return z(D,function(){W++}),W},toArray:function(D){return z(D,function(W){return W})||[]},only:function(D){if(!B(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},Oe.Component=x,Oe.Fragment=n,Oe.Profiler=s,Oe.PureComponent=k,Oe.StrictMode=r,Oe.Suspense=u,Oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,Oe.act=X,Oe.cloneElement=function(D,W,oe){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var K=b({},D.props),J=D.key,te=D.ref,Y=D._owner;if(W!=null){if(W.ref!==void 0&&(te=W.ref,Y=T.current),W.key!==void 0&&(J=""+W.key),D.type&&D.type.defaultProps)var ee=D.type.defaultProps;for(ie in W)R.call(W,ie)&&!I.hasOwnProperty(ie)&&(K[ie]=W[ie]===void 0&&ee!==void 0?ee[ie]:W[ie])}var ie=arguments.length-2;if(ie===1)K.children=oe;else if(1<ie){ee=Array(ie);for(var ue=0;ue<ie;ue++)ee[ue]=arguments[ue+2];K.children=ee}return{$$typeof:e,type:D.type,key:J,ref:te,props:K,_owner:Y}},Oe.createContext=function(D){return D={$$typeof:a,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:o,_context:D},D.Consumer=D},Oe.createElement=O,Oe.createFactory=function(D){var W=O.bind(null,D);return W.type=D,W},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(D){return{$$typeof:c,render:D}},Oe.isValidElement=B,Oe.lazy=function(D){return{$$typeof:m,_payload:{_status:-1,_result:D},_init:V}},Oe.memo=function(D,W){return{$$typeof:f,type:D,compare:W===void 0?null:W}},Oe.startTransition=function(D){var W=F.transition;F.transition={};try{D()}finally{F.transition=W}},Oe.unstable_act=X,Oe.useCallback=function(D,W){return G.current.useCallback(D,W)},Oe.useContext=function(D){return G.current.useContext(D)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(D){return G.current.useDeferredValue(D)},Oe.useEffect=function(D,W){return G.current.useEffect(D,W)},Oe.useId=function(){return G.current.useId()},Oe.useImperativeHandle=function(D,W,oe){return G.current.useImperativeHandle(D,W,oe)},Oe.useInsertionEffect=function(D,W){return G.current.useInsertionEffect(D,W)},Oe.useLayoutEffect=function(D,W){return G.current.useLayoutEffect(D,W)},Oe.useMemo=function(D,W){return G.current.useMemo(D,W)},Oe.useReducer=function(D,W,oe){return G.current.useReducer(D,W,oe)},Oe.useRef=function(D){return G.current.useRef(D)},Oe.useState=function(D){return G.current.useState(D)},Oe.useSyncExternalStore=function(D,W,oe){return G.current.useSyncExternalStore(D,W,oe)},Oe.useTransition=function(){return G.current.useTransition()},Oe.version="18.3.1",Oe}var m_;function bl(){return m_||(m_=1,mp.exports=S4()),mp.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 g_;function _4(){if(g_)return Ta;g_=1;var e=bl(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(c,u,f){var m,p={},g=null,v=null;f!==void 0&&(g=""+f),u.key!==void 0&&(g=""+u.key),u.ref!==void 0&&(v=u.ref);for(m in u)r.call(u,m)&&!o.hasOwnProperty(m)&&(p[m]=u[m]);if(c&&c.defaultProps)for(m in u=c.defaultProps,u)p[m]===void 0&&(p[m]=u[m]);return{$$typeof:t,type:c,key:g,ref:v,props:p,_owner:s.current}}return Ta.Fragment=n,Ta.jsx=a,Ta.jsxs=a,Ta}var y_;function N4(){return y_||(y_=1,pp.exports=_4()),pp.exports}var d=N4(),j=bl();const pt=wl(j),dT=b4({__proto__:null,default:pt},[j]);var cu={},gp={exports:{}},Yt={},yp={exports:{}},vp={};/**
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 v_;function k4(){return v_||(v_=1,(function(e){function t(F,q){var X=F.length;F.push(q);e:for(;0<X;){var D=X-1>>>1,W=F[D];if(0<s(W,q))F[D]=q,F[X]=W,X=D;else break e}}function n(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var q=F[0],X=F.pop();if(X!==q){F[0]=X;e:for(var D=0,W=F.length,oe=W>>>1;D<oe;){var K=2*(D+1)-1,J=F[K],te=K+1,Y=F[te];if(0>s(J,X))te<W&&0>s(Y,J)?(F[D]=Y,F[te]=X,D=te):(F[D]=J,F[K]=X,D=K);else if(te<W&&0>s(Y,X))F[D]=Y,F[te]=X,D=te;else break e}}return q}function s(F,q){var X=F.sortIndex-q.sortIndex;return X!==0?X:F.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var u=[],f=[],m=1,p=null,g=3,v=!1,b=!1,w=!1,x=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(F){for(var q=n(f);q!==null;){if(q.callback===null)r(f);else if(q.startTime<=F)r(f),q.sortIndex=q.expirationTime,t(u,q);else break;q=n(f)}}function C(F){if(w=!1,N(F),!b)if(n(u)!==null)b=!0,V(R);else{var q=n(f);q!==null&&G(C,q.startTime-F)}}function R(F,q){b=!1,w&&(w=!1,S(O),O=-1),v=!0;var X=g;try{for(N(q),p=n(u);p!==null&&(!(p.expirationTime>q)||F&&!M());){var D=p.callback;if(typeof D=="function"){p.callback=null,g=p.priorityLevel;var W=D(p.expirationTime<=q);q=e.unstable_now(),typeof W=="function"?p.callback=W:p===n(u)&&r(u),N(q)}else r(u);p=n(u)}if(p!==null)var oe=!0;else{var K=n(f);K!==null&&G(C,K.startTime-q),oe=!1}return oe}finally{p=null,g=X,v=!1}}var T=!1,I=null,O=-1,P=5,B=-1;function M(){return!(e.unstable_now()-B<P)}function L(){if(I!==null){var F=e.unstable_now();B=F;var q=!0;try{q=I(!0,F)}finally{q?U():(T=!1,I=null)}}else T=!1}var U;if(typeof k=="function")U=function(){k(L)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,z=$.port2;$.port1.onmessage=L,U=function(){z.postMessage(null)}}else U=function(){x(L,0)};function V(F){I=F,T||(T=!0,U())}function G(F,q){O=x(function(){F(e.unstable_now())},q)}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(F){F.callback=null},e.unstable_continueExecution=function(){b||v||(b=!0,V(R))},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(F){switch(g){case 1:case 2:case 3:var q=3;break;default:q=g}var X=g;g=q;try{return F()}finally{g=X}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(F,q){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var X=g;g=F;try{return q()}finally{g=X}},e.unstable_scheduleCallback=function(F,q,X){var D=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?D+X:D):X=D,F){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=X+W,F={id:m++,callback:q,priorityLevel:F,startTime:X,expirationTime:W,sortIndex:-1},X>D?(F.sortIndex=X,t(f,F),n(u)===null&&F===n(f)&&(w?(S(O),O=-1):w=!0,G(C,X-D))):(F.sortIndex=W,t(u,F),b||v||(b=!0,V(R))),F},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(F){var q=g;return function(){var X=g;g=q;try{return F.apply(this,arguments)}finally{g=X}}}})(vp)),vp}var x_;function C4(){return x_||(x_=1,yp.exports=k4()),yp.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 w_;function E4(){if(w_)return Yt;w_=1;var e=bl(),t=C4();function n(i){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+i,h=1;h<arguments.length;h++)l+="&args[]="+encodeURIComponent(arguments[h]);return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function o(i,l){a(i,l),a(i+"Capture",l)}function a(i,l){for(s[i]=l,i=0;i<l.length;i++)r.add(l[i])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,f=/^[: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]*$/,m={},p={};function g(i){return u.call(p,i)?!0:u.call(m,i)?!1:f.test(i)?p[i]=!0:(m[i]=!0,!1)}function v(i,l,h,y){if(h!==null&&h.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return y?!1:h!==null?!h.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function b(i,l,h,y){if(l===null||typeof l>"u"||v(i,l,h,y))return!0;if(y)return!1;if(h!==null)switch(h.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function w(i,l,h,y,_,E,A){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=y,this.attributeNamespace=_,this.mustUseProperty=h,this.propertyName=i,this.type=l,this.sanitizeURL=E,this.removeEmptyString=A}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){x[i]=new w(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var l=i[0];x[l]=new w(l,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){x[i]=new w(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){x[i]=new w(i,2,!1,i,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(i){x[i]=new w(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){x[i]=new w(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){x[i]=new w(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){x[i]=new w(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){x[i]=new w(i,5,!1,i.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function k(i){return i[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(i){var l=i.replace(S,k);x[l]=new w(l,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var l=i.replace(S,k);x[l]=new w(l,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var l=i.replace(S,k);x[l]=new w(l,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){x[i]=new w(i,1,!1,i.toLowerCase(),null,!1,!1)}),x.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){x[i]=new w(i,1,!1,i.toLowerCase(),null,!0,!0)});function N(i,l,h,y){var _=x.hasOwnProperty(l)?x[l]:null;(_!==null?_.type!==0:y||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(b(l,h,_,y)&&(h=null),y||_===null?g(l)&&(h===null?i.removeAttribute(l):i.setAttribute(l,""+h)):_.mustUseProperty?i[_.propertyName]=h===null?_.type===3?!1:"":h:(l=_.attributeName,y=_.attributeNamespace,h===null?i.removeAttribute(l):(_=_.type,h=_===3||_===4&&h===!0?"":""+h,y?i.setAttributeNS(y,l,h):i.setAttribute(l,h))))}var C=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),T=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),B=Symbol.for("react.provider"),M=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),G=Symbol.for("react.offscreen"),F=Symbol.iterator;function q(i){return i===null||typeof i!="object"?null:(i=F&&i[F]||i["@@iterator"],typeof i=="function"?i:null)}var X=Object.assign,D;function W(i){if(D===void 0)try{throw Error()}catch(h){var l=h.stack.trim().match(/\n( *(at )?)/);D=l&&l[1]||""}return`
34
+ `+D+i}var oe=!1;function K(i,l){if(!i||oe)return"";oe=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(se){var y=se}Reflect.construct(i,[],l)}else{try{l.call()}catch(se){y=se}i.call(l.prototype)}else{try{throw Error()}catch(se){y=se}i()}}catch(se){if(se&&y&&typeof se.stack=="string"){for(var _=se.stack.split(`
35
+ `),E=y.stack.split(`
36
+ `),A=_.length-1,H=E.length-1;1<=A&&0<=H&&_[A]!==E[H];)H--;for(;1<=A&&0<=H;A--,H--)if(_[A]!==E[H]){if(A!==1||H!==1)do if(A--,H--,0>H||_[A]!==E[H]){var Q=`
37
+ `+_[A].replace(" at new "," at ");return i.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",i.displayName)),Q}while(1<=A&&0<=H);break}}}finally{oe=!1,Error.prepareStackTrace=h}return(i=i?i.displayName||i.name:"")?W(i):""}function J(i){switch(i.tag){case 5:return W(i.type);case 16:return W("Lazy");case 13:return W("Suspense");case 19:return W("SuspenseList");case 0:case 2:case 15:return i=K(i.type,!1),i;case 11:return i=K(i.type.render,!1),i;case 1:return i=K(i.type,!0),i;default:return""}}function te(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case I:return"Fragment";case T:return"Portal";case P:return"Profiler";case O:return"StrictMode";case U:return"Suspense";case $:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case M:return(i.displayName||"Context")+".Consumer";case B:return(i._context.displayName||"Context")+".Provider";case L:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case z:return l=i.displayName||null,l!==null?l:te(i.type)||"Memo";case V:l=i._payload,i=i._init;try{return te(i(l))}catch{}}return null}function Y(i){var l=i.type;switch(i.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=l.render,i=i.displayName||i.name||"",l.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return te(l);case 8:return l===O?"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 l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function ee(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ie(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function ue(i){var l=ie(i)?"checked":"value",h=Object.getOwnPropertyDescriptor(i.constructor.prototype,l),y=""+i[l];if(!i.hasOwnProperty(l)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var _=h.get,E=h.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return _.call(this)},set:function(A){y=""+A,E.call(this,A)}}),Object.defineProperty(i,l,{enumerable:h.enumerable}),{getValue:function(){return y},setValue:function(A){y=""+A},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function ge(i){i._valueTracker||(i._valueTracker=ue(i))}function xe(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var h=l.getValue(),y="";return i&&(y=ie(i)?i.checked?"true":"false":i.value),i=y,i!==h?(l.setValue(i),!0):!1}function pe(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function be(i,l){var h=l.checked;return X({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??i._wrapperState.initialChecked})}function ve(i,l){var h=l.defaultValue==null?"":l.defaultValue,y=l.checked!=null?l.checked:l.defaultChecked;h=ee(l.value!=null?l.value:h),i._wrapperState={initialChecked:y,initialValue:h,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function Re(i,l){l=l.checked,l!=null&&N(i,"checked",l,!1)}function ke(i,l){Re(i,l);var h=ee(l.value),y=l.type;if(h!=null)y==="number"?(h===0&&i.value===""||i.value!=h)&&(i.value=""+h):i.value!==""+h&&(i.value=""+h);else if(y==="submit"||y==="reset"){i.removeAttribute("value");return}l.hasOwnProperty("value")?Ue(i,l.type,h):l.hasOwnProperty("defaultValue")&&Ue(i,l.type,ee(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(i.defaultChecked=!!l.defaultChecked)}function ze(i,l,h){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var y=l.type;if(!(y!=="submit"&&y!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+i._wrapperState.initialValue,h||l===i.value||(i.value=l),i.defaultValue=l}h=i.name,h!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,h!==""&&(i.name=h)}function Ue(i,l,h){(l!=="number"||pe(i.ownerDocument)!==i)&&(h==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+h&&(i.defaultValue=""+h))}var vt=Array.isArray;function Pe(i,l,h,y){if(i=i.options,l){l={};for(var _=0;_<h.length;_++)l["$"+h[_]]=!0;for(h=0;h<i.length;h++)_=l.hasOwnProperty("$"+i[h].value),i[h].selected!==_&&(i[h].selected=_),_&&y&&(i[h].defaultSelected=!0)}else{for(h=""+ee(h),l=null,_=0;_<i.length;_++){if(i[_].value===h){i[_].selected=!0,y&&(i[_].defaultSelected=!0);return}l!==null||i[_].disabled||(l=i[_])}l!==null&&(l.selected=!0)}}function ft(i,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return X({},l,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function He(i,l){var h=l.value;if(h==null){if(h=l.children,l=l.defaultValue,h!=null){if(l!=null)throw Error(n(92));if(vt(h)){if(1<h.length)throw Error(n(93));h=h[0]}l=h}l==null&&(l=""),h=l}i._wrapperState={initialValue:ee(h)}}function hn(i,l){var h=ee(l.value),y=ee(l.defaultValue);h!=null&&(h=""+h,h!==i.value&&(i.value=h),l.defaultValue==null&&i.defaultValue!==h&&(i.defaultValue=h)),y!=null&&(i.defaultValue=""+y)}function Zt(i){var l=i.textContent;l===i._wrapperState.initialValue&&l!==""&&l!==null&&(i.value=l)}function en(i){switch(i){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 Lt(i,l){return i==null||i==="http://www.w3.org/1999/xhtml"?en(l):i==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var bt,wr=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,h,y,_){MSApp.execUnsafeLocalFunction(function(){return i(l,h,y,_)})}:i})(function(i,l){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=l;else{for(bt=bt||document.createElement("div"),bt.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=bt.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;l.firstChild;)i.appendChild(l.firstChild)}});function kt(i,l){if(l){var h=i.firstChild;if(h&&h===i.lastChild&&h.nodeType===3){h.nodeValue=l;return}}i.textContent=l}var tn={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},Kr=["Webkit","ms","Moz","O"];Object.keys(tn).forEach(function(i){Kr.forEach(function(l){l=l+i.charAt(0).toUpperCase()+i.substring(1),tn[l]=tn[i]})});function Rt(i,l,h){return l==null||typeof l=="boolean"||l===""?"":h||typeof l!="number"||l===0||tn.hasOwnProperty(i)&&tn[i]?(""+l).trim():l+"px"}function Dt(i,l){i=i.style;for(var h in l)if(l.hasOwnProperty(h)){var y=h.indexOf("--")===0,_=Rt(h,l[h],y);h==="float"&&(h="cssFloat"),y?i.setProperty(h,_):i[h]=_}}var yi=X({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 _e(i,l){if(l){if(yi[i]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function Ce(i,l){if(i.indexOf("-")===-1)return typeof l.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var We=null;function pn(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var mn=null,Qn=null,Tt=null;function Kl(i){if(i=ma(i)){if(typeof mn!="function")throw Error(n(280));var l=i.stateNode;l&&(l=_c(l),mn(i.stateNode,i.type,l))}}function Gl(i){Qn?Tt?Tt.push(i):Tt=[i]:Qn=i}function Yl(){if(Qn){var i=Qn,l=Tt;if(Tt=Qn=null,Kl(i),l)for(i=0;i<l.length;i++)Kl(l[i])}}function Xl(i,l){return i(l)}function Ql(){}var Ho=!1;function Jl(i,l,h){if(Ho)return i(l,h);Ho=!0;try{return Xl(i,l,h)}finally{Ho=!1,(Qn!==null||Tt!==null)&&(Ql(),Yl())}}function Ts(i,l){var h=i.stateNode;if(h===null)return null;var y=_c(h);if(y===null)return null;h=y[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(i=i.type,y=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!y;break e;default:i=!1}if(i)return null;if(h&&typeof h!="function")throw Error(n(231,l,typeof h));return h}var Wo=!1;if(c)try{var Is={};Object.defineProperty(Is,"passive",{get:function(){Wo=!0}}),window.addEventListener("test",Is,Is),window.removeEventListener("test",Is,Is)}catch{Wo=!1}function Nf(i,l,h,y,_,E,A,H,Q){var se=Array.prototype.slice.call(arguments,3);try{l.apply(h,se)}catch(le){this.onError(le)}}var As=!1,vi=null,xi=!1,Ko=null,kf={onError:function(i){As=!0,vi=i}};function Cf(i,l,h,y,_,E,A,H,Q){As=!1,vi=null,Nf.apply(kf,arguments)}function Ef(i,l,h,y,_,E,A,H,Q){if(Cf.apply(this,arguments),As){if(As){var se=vi;As=!1,vi=null}else throw Error(n(198));xi||(xi=!0,Ko=se)}}function Jn(i){var l=i,h=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(h=l.return),i=l.return;while(i)}return l.tag===3?h:null}function Go(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function Yo(i){if(Jn(i)!==i)throw Error(n(188))}function jf(i){var l=i.alternate;if(!l){if(l=Jn(i),l===null)throw Error(n(188));return l!==i?null:i}for(var h=i,y=l;;){var _=h.return;if(_===null)break;var E=_.alternate;if(E===null){if(y=_.return,y!==null){h=y;continue}break}if(_.child===E.child){for(E=_.child;E;){if(E===h)return Yo(_),i;if(E===y)return Yo(_),l;E=E.sibling}throw Error(n(188))}if(h.return!==y.return)h=_,y=E;else{for(var A=!1,H=_.child;H;){if(H===h){A=!0,h=_,y=E;break}if(H===y){A=!0,y=_,h=E;break}H=H.sibling}if(!A){for(H=E.child;H;){if(H===h){A=!0,h=E,y=_;break}if(H===y){A=!0,y=E,h=_;break}H=H.sibling}if(!A)throw Error(n(189))}}if(h.alternate!==y)throw Error(n(190))}if(h.tag!==3)throw Error(n(188));return h.stateNode.current===h?i:l}function Zl(i){return i=jf(i),i!==null?ec(i):null}function ec(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var l=ec(i);if(l!==null)return l;i=i.sibling}return null}var tc=t.unstable_scheduleCallback,nc=t.unstable_cancelCallback,Rf=t.unstable_shouldYield,rc=t.unstable_requestPaint,rt=t.unstable_now,Tf=t.unstable_getCurrentPriorityLevel,Xo=t.unstable_ImmediatePriority,sc=t.unstable_UserBlockingPriority,wi=t.unstable_NormalPriority,If=t.unstable_LowPriority,ic=t.unstable_IdlePriority,Ms=null,gn=null;function Af(i){if(gn&&typeof gn.onCommitFiberRoot=="function")try{gn.onCommitFiberRoot(Ms,i,void 0,(i.current.flags&128)===128)}catch{}}var nn=Math.clz32?Math.clz32:Pf,Mf=Math.log,Of=Math.LN2;function Pf(i){return i>>>=0,i===0?32:31-(Mf(i)/Of|0)|0}var bi=64,Si=4194304;function Zn(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function _i(i,l){var h=i.pendingLanes;if(h===0)return 0;var y=0,_=i.suspendedLanes,E=i.pingedLanes,A=h&268435455;if(A!==0){var H=A&~_;H!==0?y=Zn(H):(E&=A,E!==0&&(y=Zn(E)))}else A=h&~_,A!==0?y=Zn(A):E!==0&&(y=Zn(E));if(y===0)return 0;if(l!==0&&l!==y&&(l&_)===0&&(_=y&-y,E=l&-l,_>=E||_===16&&(E&4194240)!==0))return l;if((y&4)!==0&&(y|=h&16),l=i.entangledLanes,l!==0)for(i=i.entanglements,l&=y;0<l;)h=31-nn(l),_=1<<h,y|=i[h],l&=~_;return y}function oc(i,l){switch(i){case 1:case 2:case 4:return l+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 l+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 Lf(i,l){for(var h=i.suspendedLanes,y=i.pingedLanes,_=i.expirationTimes,E=i.pendingLanes;0<E;){var A=31-nn(E),H=1<<A,Q=_[A];Q===-1?((H&h)===0||(H&y)!==0)&&(_[A]=oc(H,l)):Q<=l&&(i.expiredLanes|=H),E&=~H}}function Qo(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function Ni(){var i=bi;return bi<<=1,(bi&4194240)===0&&(bi=64),i}function Jo(i){for(var l=[],h=0;31>h;h++)l.push(i);return l}function Os(i,l,h){i.pendingLanes|=l,l!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,l=31-nn(l),i[l]=h}function ac(i,l){var h=i.pendingLanes&~l;i.pendingLanes=l,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=l,i.mutableReadLanes&=l,i.entangledLanes&=l,l=i.entanglements;var y=i.eventTimes;for(i=i.expirationTimes;0<h;){var _=31-nn(h),E=1<<_;l[_]=0,y[_]=-1,i[_]=-1,h&=~E}}function Df(i,l){var h=i.entangledLanes|=l;for(i=i.entanglements;h;){var y=31-nn(h),_=1<<y;_&l|i[y]&l&&(i[y]|=l),h&=~_}}var Ve=0;function Wb(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var Kb,$f,Gb,Yb,Xb,qf=!1,lc=[],Gr=null,Yr=null,Xr=null,Zo=new Map,ea=new Map,Qr=[],VL="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 Qb(i,l){switch(i){case"focusin":case"focusout":Gr=null;break;case"dragenter":case"dragleave":Yr=null;break;case"mouseover":case"mouseout":Xr=null;break;case"pointerover":case"pointerout":Zo.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":ea.delete(l.pointerId)}}function ta(i,l,h,y,_,E){return i===null||i.nativeEvent!==E?(i={blockedOn:l,domEventName:h,eventSystemFlags:y,nativeEvent:E,targetContainers:[_]},l!==null&&(l=ma(l),l!==null&&$f(l)),i):(i.eventSystemFlags|=y,l=i.targetContainers,_!==null&&l.indexOf(_)===-1&&l.push(_),i)}function UL(i,l,h,y,_){switch(l){case"focusin":return Gr=ta(Gr,i,l,h,y,_),!0;case"dragenter":return Yr=ta(Yr,i,l,h,y,_),!0;case"mouseover":return Xr=ta(Xr,i,l,h,y,_),!0;case"pointerover":var E=_.pointerId;return Zo.set(E,ta(Zo.get(E)||null,i,l,h,y,_)),!0;case"gotpointercapture":return E=_.pointerId,ea.set(E,ta(ea.get(E)||null,i,l,h,y,_)),!0}return!1}function Jb(i){var l=Ps(i.target);if(l!==null){var h=Jn(l);if(h!==null){if(l=h.tag,l===13){if(l=Go(h),l!==null){i.blockedOn=l,Xb(i.priority,function(){Gb(h)});return}}else if(l===3&&h.stateNode.current.memoizedState.isDehydrated){i.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}i.blockedOn=null}function cc(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var h=Bf(i.domEventName,i.eventSystemFlags,l[0],i.nativeEvent);if(h===null){h=i.nativeEvent;var y=new h.constructor(h.type,h);We=y,h.target.dispatchEvent(y),We=null}else return l=ma(h),l!==null&&$f(l),i.blockedOn=h,!1;l.shift()}return!0}function Zb(i,l,h){cc(i)&&h.delete(l)}function HL(){qf=!1,Gr!==null&&cc(Gr)&&(Gr=null),Yr!==null&&cc(Yr)&&(Yr=null),Xr!==null&&cc(Xr)&&(Xr=null),Zo.forEach(Zb),ea.forEach(Zb)}function na(i,l){i.blockedOn===l&&(i.blockedOn=null,qf||(qf=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,HL)))}function ra(i){function l(_){return na(_,i)}if(0<lc.length){na(lc[0],i);for(var h=1;h<lc.length;h++){var y=lc[h];y.blockedOn===i&&(y.blockedOn=null)}}for(Gr!==null&&na(Gr,i),Yr!==null&&na(Yr,i),Xr!==null&&na(Xr,i),Zo.forEach(l),ea.forEach(l),h=0;h<Qr.length;h++)y=Qr[h],y.blockedOn===i&&(y.blockedOn=null);for(;0<Qr.length&&(h=Qr[0],h.blockedOn===null);)Jb(h),h.blockedOn===null&&Qr.shift()}var ki=C.ReactCurrentBatchConfig,uc=!0;function WL(i,l,h,y){var _=Ve,E=ki.transition;ki.transition=null;try{Ve=1,Ff(i,l,h,y)}finally{Ve=_,ki.transition=E}}function KL(i,l,h,y){var _=Ve,E=ki.transition;ki.transition=null;try{Ve=4,Ff(i,l,h,y)}finally{Ve=_,ki.transition=E}}function Ff(i,l,h,y){if(uc){var _=Bf(i,l,h,y);if(_===null)sh(i,l,y,dc,h),Qb(i,y);else if(UL(_,i,l,h,y))y.stopPropagation();else if(Qb(i,y),l&4&&-1<VL.indexOf(i)){for(;_!==null;){var E=ma(_);if(E!==null&&Kb(E),E=Bf(i,l,h,y),E===null&&sh(i,l,y,dc,h),E===_)break;_=E}_!==null&&y.stopPropagation()}else sh(i,l,y,null,h)}}var dc=null;function Bf(i,l,h,y){if(dc=null,i=pn(y),i=Ps(i),i!==null)if(l=Jn(i),l===null)i=null;else if(h=l.tag,h===13){if(i=Go(l),i!==null)return i;i=null}else if(h===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null);return dc=i,null}function e1(i){switch(i){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(Tf()){case Xo:return 1;case sc:return 4;case wi:case If:return 16;case ic:return 536870912;default:return 16}default:return 16}}var Jr=null,zf=null,fc=null;function t1(){if(fc)return fc;var i,l=zf,h=l.length,y,_="value"in Jr?Jr.value:Jr.textContent,E=_.length;for(i=0;i<h&&l[i]===_[i];i++);var A=h-i;for(y=1;y<=A&&l[h-y]===_[E-y];y++);return fc=_.slice(i,1<y?1-y:void 0)}function hc(i){var l=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&l===13&&(i=13)):i=l,i===10&&(i=13),32<=i||i===13?i:0}function pc(){return!0}function n1(){return!1}function rn(i){function l(h,y,_,E,A){this._reactName=h,this._targetInst=_,this.type=y,this.nativeEvent=E,this.target=A,this.currentTarget=null;for(var H in i)i.hasOwnProperty(H)&&(h=i[H],this[H]=h?h(E):E[H]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?pc:n1,this.isPropagationStopped=n1,this}return X(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=pc)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=pc)},persist:function(){},isPersistent:pc}),l}var Ci={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vf=rn(Ci),sa=X({},Ci,{view:0,detail:0}),GL=rn(sa),Uf,Hf,ia,mc=X({},sa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kf,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==ia&&(ia&&i.type==="mousemove"?(Uf=i.screenX-ia.screenX,Hf=i.screenY-ia.screenY):Hf=Uf=0,ia=i),Uf)},movementY:function(i){return"movementY"in i?i.movementY:Hf}}),r1=rn(mc),YL=X({},mc,{dataTransfer:0}),XL=rn(YL),QL=X({},sa,{relatedTarget:0}),Wf=rn(QL),JL=X({},Ci,{animationName:0,elapsedTime:0,pseudoElement:0}),ZL=rn(JL),e3=X({},Ci,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),t3=rn(e3),n3=X({},Ci,{data:0}),s1=rn(n3),r3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},s3={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"},i3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function o3(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=i3[i])?!!l[i]:!1}function Kf(){return o3}var a3=X({},sa,{key:function(i){if(i.key){var l=r3[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=hc(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?s3[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kf,charCode:function(i){return i.type==="keypress"?hc(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?hc(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),l3=rn(a3),c3=X({},mc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),i1=rn(c3),u3=X({},sa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kf}),d3=rn(u3),f3=X({},Ci,{propertyName:0,elapsedTime:0,pseudoElement:0}),h3=rn(f3),p3=X({},mc,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),m3=rn(p3),g3=[9,13,27,32],Gf=c&&"CompositionEvent"in window,oa=null;c&&"documentMode"in document&&(oa=document.documentMode);var y3=c&&"TextEvent"in window&&!oa,o1=c&&(!Gf||oa&&8<oa&&11>=oa),a1=" ",l1=!1;function c1(i,l){switch(i){case"keyup":return g3.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function u1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ei=!1;function v3(i,l){switch(i){case"compositionend":return u1(l);case"keypress":return l.which!==32?null:(l1=!0,a1);case"textInput":return i=l.data,i===a1&&l1?null:i;default:return null}}function x3(i,l){if(Ei)return i==="compositionend"||!Gf&&c1(i,l)?(i=t1(),fc=zf=Jr=null,Ei=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return o1&&l.locale!=="ko"?null:l.data;default:return null}}var w3={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 d1(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!w3[i.type]:l==="textarea"}function f1(i,l,h,y){Gl(y),l=wc(l,"onChange"),0<l.length&&(h=new Vf("onChange","change",null,h,y),i.push({event:h,listeners:l}))}var aa=null,la=null;function b3(i){T1(i,0)}function gc(i){var l=Ai(i);if(xe(l))return i}function S3(i,l){if(i==="change")return l}var h1=!1;if(c){var Yf;if(c){var Xf="oninput"in document;if(!Xf){var p1=document.createElement("div");p1.setAttribute("oninput","return;"),Xf=typeof p1.oninput=="function"}Yf=Xf}else Yf=!1;h1=Yf&&(!document.documentMode||9<document.documentMode)}function m1(){aa&&(aa.detachEvent("onpropertychange",g1),la=aa=null)}function g1(i){if(i.propertyName==="value"&&gc(la)){var l=[];f1(l,la,i,pn(i)),Jl(b3,l)}}function _3(i,l,h){i==="focusin"?(m1(),aa=l,la=h,aa.attachEvent("onpropertychange",g1)):i==="focusout"&&m1()}function N3(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return gc(la)}function k3(i,l){if(i==="click")return gc(l)}function C3(i,l){if(i==="input"||i==="change")return gc(l)}function E3(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var In=typeof Object.is=="function"?Object.is:E3;function ca(i,l){if(In(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var h=Object.keys(i),y=Object.keys(l);if(h.length!==y.length)return!1;for(y=0;y<h.length;y++){var _=h[y];if(!u.call(l,_)||!In(i[_],l[_]))return!1}return!0}function y1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function v1(i,l){var h=y1(i);i=0;for(var y;h;){if(h.nodeType===3){if(y=i+h.textContent.length,i<=l&&y>=l)return{node:h,offset:l-i};i=y}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=y1(h)}}function x1(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?x1(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function w1(){for(var i=window,l=pe();l instanceof i.HTMLIFrameElement;){try{var h=typeof l.contentWindow.location.href=="string"}catch{h=!1}if(h)i=l.contentWindow;else break;l=pe(i.document)}return l}function Qf(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}function j3(i){var l=w1(),h=i.focusedElem,y=i.selectionRange;if(l!==h&&h&&h.ownerDocument&&x1(h.ownerDocument.documentElement,h)){if(y!==null&&Qf(h)){if(l=y.start,i=y.end,i===void 0&&(i=l),"selectionStart"in h)h.selectionStart=l,h.selectionEnd=Math.min(i,h.value.length);else if(i=(l=h.ownerDocument||document)&&l.defaultView||window,i.getSelection){i=i.getSelection();var _=h.textContent.length,E=Math.min(y.start,_);y=y.end===void 0?E:Math.min(y.end,_),!i.extend&&E>y&&(_=y,y=E,E=_),_=v1(h,E);var A=v1(h,y);_&&A&&(i.rangeCount!==1||i.anchorNode!==_.node||i.anchorOffset!==_.offset||i.focusNode!==A.node||i.focusOffset!==A.offset)&&(l=l.createRange(),l.setStart(_.node,_.offset),i.removeAllRanges(),E>y?(i.addRange(l),i.extend(A.node,A.offset)):(l.setEnd(A.node,A.offset),i.addRange(l)))}}for(l=[],i=h;i=i.parentNode;)i.nodeType===1&&l.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<l.length;h++)i=l[h],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var R3=c&&"documentMode"in document&&11>=document.documentMode,ji=null,Jf=null,ua=null,Zf=!1;function b1(i,l,h){var y=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Zf||ji==null||ji!==pe(y)||(y=ji,"selectionStart"in y&&Qf(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),ua&&ca(ua,y)||(ua=y,y=wc(Jf,"onSelect"),0<y.length&&(l=new Vf("onSelect","select",null,l,h),i.push({event:l,listeners:y}),l.target=ji)))}function yc(i,l){var h={};return h[i.toLowerCase()]=l.toLowerCase(),h["Webkit"+i]="webkit"+l,h["Moz"+i]="moz"+l,h}var Ri={animationend:yc("Animation","AnimationEnd"),animationiteration:yc("Animation","AnimationIteration"),animationstart:yc("Animation","AnimationStart"),transitionend:yc("Transition","TransitionEnd")},eh={},S1={};c&&(S1=document.createElement("div").style,"AnimationEvent"in window||(delete Ri.animationend.animation,delete Ri.animationiteration.animation,delete Ri.animationstart.animation),"TransitionEvent"in window||delete Ri.transitionend.transition);function vc(i){if(eh[i])return eh[i];if(!Ri[i])return i;var l=Ri[i],h;for(h in l)if(l.hasOwnProperty(h)&&h in S1)return eh[i]=l[h];return i}var _1=vc("animationend"),N1=vc("animationiteration"),k1=vc("animationstart"),C1=vc("transitionend"),E1=new Map,j1="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 Zr(i,l){E1.set(i,l),o(l,[i])}for(var th=0;th<j1.length;th++){var nh=j1[th],T3=nh.toLowerCase(),I3=nh[0].toUpperCase()+nh.slice(1);Zr(T3,"on"+I3)}Zr(_1,"onAnimationEnd"),Zr(N1,"onAnimationIteration"),Zr(k1,"onAnimationStart"),Zr("dblclick","onDoubleClick"),Zr("focusin","onFocus"),Zr("focusout","onBlur"),Zr(C1,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var da="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(" "),A3=new Set("cancel close invalid load scroll toggle".split(" ").concat(da));function R1(i,l,h){var y=i.type||"unknown-event";i.currentTarget=h,Ef(y,l,void 0,i),i.currentTarget=null}function T1(i,l){l=(l&4)!==0;for(var h=0;h<i.length;h++){var y=i[h],_=y.event;y=y.listeners;e:{var E=void 0;if(l)for(var A=y.length-1;0<=A;A--){var H=y[A],Q=H.instance,se=H.currentTarget;if(H=H.listener,Q!==E&&_.isPropagationStopped())break e;R1(_,H,se),E=Q}else for(A=0;A<y.length;A++){if(H=y[A],Q=H.instance,se=H.currentTarget,H=H.listener,Q!==E&&_.isPropagationStopped())break e;R1(_,H,se),E=Q}}}if(xi)throw i=Ko,xi=!1,Ko=null,i}function Ye(i,l){var h=l[uh];h===void 0&&(h=l[uh]=new Set);var y=i+"__bubble";h.has(y)||(I1(l,i,2,!1),h.add(y))}function rh(i,l,h){var y=0;l&&(y|=4),I1(h,i,y,l)}var xc="_reactListening"+Math.random().toString(36).slice(2);function fa(i){if(!i[xc]){i[xc]=!0,r.forEach(function(h){h!=="selectionchange"&&(A3.has(h)||rh(h,!1,i),rh(h,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[xc]||(l[xc]=!0,rh("selectionchange",!1,l))}}function I1(i,l,h,y){switch(e1(l)){case 1:var _=WL;break;case 4:_=KL;break;default:_=Ff}h=_.bind(null,l,h,i),_=void 0,!Wo||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(_=!0),y?_!==void 0?i.addEventListener(l,h,{capture:!0,passive:_}):i.addEventListener(l,h,!0):_!==void 0?i.addEventListener(l,h,{passive:_}):i.addEventListener(l,h,!1)}function sh(i,l,h,y,_){var E=y;if((l&1)===0&&(l&2)===0&&y!==null)e:for(;;){if(y===null)return;var A=y.tag;if(A===3||A===4){var H=y.stateNode.containerInfo;if(H===_||H.nodeType===8&&H.parentNode===_)break;if(A===4)for(A=y.return;A!==null;){var Q=A.tag;if((Q===3||Q===4)&&(Q=A.stateNode.containerInfo,Q===_||Q.nodeType===8&&Q.parentNode===_))return;A=A.return}for(;H!==null;){if(A=Ps(H),A===null)return;if(Q=A.tag,Q===5||Q===6){y=E=A;continue e}H=H.parentNode}}y=y.return}Jl(function(){var se=E,le=pn(h),ce=[];e:{var ae=E1.get(i);if(ae!==void 0){var me=Vf,we=i;switch(i){case"keypress":if(hc(h)===0)break e;case"keydown":case"keyup":me=l3;break;case"focusin":we="focus",me=Wf;break;case"focusout":we="blur",me=Wf;break;case"beforeblur":case"afterblur":me=Wf;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=r1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=XL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=d3;break;case _1:case N1:case k1:me=ZL;break;case C1:me=h3;break;case"scroll":me=GL;break;case"wheel":me=m3;break;case"copy":case"cut":case"paste":me=t3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=i1}var Se=(l&4)!==0,lt=!Se&&i==="scroll",ne=Se?ae!==null?ae+"Capture":null:ae;Se=[];for(var Z=se,re;Z!==null;){re=Z;var de=re.stateNode;if(re.tag===5&&de!==null&&(re=de,ne!==null&&(de=Ts(Z,ne),de!=null&&Se.push(ha(Z,de,re)))),lt)break;Z=Z.return}0<Se.length&&(ae=new me(ae,we,null,h,le),ce.push({event:ae,listeners:Se}))}}if((l&7)===0){e:{if(ae=i==="mouseover"||i==="pointerover",me=i==="mouseout"||i==="pointerout",ae&&h!==We&&(we=h.relatedTarget||h.fromElement)&&(Ps(we)||we[br]))break e;if((me||ae)&&(ae=le.window===le?le:(ae=le.ownerDocument)?ae.defaultView||ae.parentWindow:window,me?(we=h.relatedTarget||h.toElement,me=se,we=we?Ps(we):null,we!==null&&(lt=Jn(we),we!==lt||we.tag!==5&&we.tag!==6)&&(we=null)):(me=null,we=se),me!==we)){if(Se=r1,de="onMouseLeave",ne="onMouseEnter",Z="mouse",(i==="pointerout"||i==="pointerover")&&(Se=i1,de="onPointerLeave",ne="onPointerEnter",Z="pointer"),lt=me==null?ae:Ai(me),re=we==null?ae:Ai(we),ae=new Se(de,Z+"leave",me,h,le),ae.target=lt,ae.relatedTarget=re,de=null,Ps(le)===se&&(Se=new Se(ne,Z+"enter",we,h,le),Se.target=re,Se.relatedTarget=lt,de=Se),lt=de,me&&we)t:{for(Se=me,ne=we,Z=0,re=Se;re;re=Ti(re))Z++;for(re=0,de=ne;de;de=Ti(de))re++;for(;0<Z-re;)Se=Ti(Se),Z--;for(;0<re-Z;)ne=Ti(ne),re--;for(;Z--;){if(Se===ne||ne!==null&&Se===ne.alternate)break t;Se=Ti(Se),ne=Ti(ne)}Se=null}else Se=null;me!==null&&A1(ce,ae,me,Se,!1),we!==null&&lt!==null&&A1(ce,lt,we,Se,!0)}}e:{if(ae=se?Ai(se):window,me=ae.nodeName&&ae.nodeName.toLowerCase(),me==="select"||me==="input"&&ae.type==="file")var Ne=S3;else if(d1(ae))if(h1)Ne=C3;else{Ne=N3;var Ee=_3}else(me=ae.nodeName)&&me.toLowerCase()==="input"&&(ae.type==="checkbox"||ae.type==="radio")&&(Ne=k3);if(Ne&&(Ne=Ne(i,se))){f1(ce,Ne,h,le);break e}Ee&&Ee(i,ae,se),i==="focusout"&&(Ee=ae._wrapperState)&&Ee.controlled&&ae.type==="number"&&Ue(ae,"number",ae.value)}switch(Ee=se?Ai(se):window,i){case"focusin":(d1(Ee)||Ee.contentEditable==="true")&&(ji=Ee,Jf=se,ua=null);break;case"focusout":ua=Jf=ji=null;break;case"mousedown":Zf=!0;break;case"contextmenu":case"mouseup":case"dragend":Zf=!1,b1(ce,h,le);break;case"selectionchange":if(R3)break;case"keydown":case"keyup":b1(ce,h,le)}var je;if(Gf)e:{switch(i){case"compositionstart":var Te="onCompositionStart";break e;case"compositionend":Te="onCompositionEnd";break e;case"compositionupdate":Te="onCompositionUpdate";break e}Te=void 0}else Ei?c1(i,h)&&(Te="onCompositionEnd"):i==="keydown"&&h.keyCode===229&&(Te="onCompositionStart");Te&&(o1&&h.locale!=="ko"&&(Ei||Te!=="onCompositionStart"?Te==="onCompositionEnd"&&Ei&&(je=t1()):(Jr=le,zf="value"in Jr?Jr.value:Jr.textContent,Ei=!0)),Ee=wc(se,Te),0<Ee.length&&(Te=new s1(Te,i,null,h,le),ce.push({event:Te,listeners:Ee}),je?Te.data=je:(je=u1(h),je!==null&&(Te.data=je)))),(je=y3?v3(i,h):x3(i,h))&&(se=wc(se,"onBeforeInput"),0<se.length&&(le=new s1("onBeforeInput","beforeinput",null,h,le),ce.push({event:le,listeners:se}),le.data=je))}T1(ce,l)})}function ha(i,l,h){return{instance:i,listener:l,currentTarget:h}}function wc(i,l){for(var h=l+"Capture",y=[];i!==null;){var _=i,E=_.stateNode;_.tag===5&&E!==null&&(_=E,E=Ts(i,h),E!=null&&y.unshift(ha(i,E,_)),E=Ts(i,l),E!=null&&y.push(ha(i,E,_))),i=i.return}return y}function Ti(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function A1(i,l,h,y,_){for(var E=l._reactName,A=[];h!==null&&h!==y;){var H=h,Q=H.alternate,se=H.stateNode;if(Q!==null&&Q===y)break;H.tag===5&&se!==null&&(H=se,_?(Q=Ts(h,E),Q!=null&&A.unshift(ha(h,Q,H))):_||(Q=Ts(h,E),Q!=null&&A.push(ha(h,Q,H)))),h=h.return}A.length!==0&&i.push({event:l,listeners:A})}var M3=/\r\n?/g,O3=/\u0000|\uFFFD/g;function M1(i){return(typeof i=="string"?i:""+i).replace(M3,`
38
+ `).replace(O3,"")}function bc(i,l,h){if(l=M1(l),M1(i)!==l&&h)throw Error(n(425))}function Sc(){}var ih=null,oh=null;function ah(i,l){return i==="textarea"||i==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var lh=typeof setTimeout=="function"?setTimeout:void 0,P3=typeof clearTimeout=="function"?clearTimeout:void 0,O1=typeof Promise=="function"?Promise:void 0,L3=typeof queueMicrotask=="function"?queueMicrotask:typeof O1<"u"?function(i){return O1.resolve(null).then(i).catch(D3)}:lh;function D3(i){setTimeout(function(){throw i})}function ch(i,l){var h=l,y=0;do{var _=h.nextSibling;if(i.removeChild(h),_&&_.nodeType===8)if(h=_.data,h==="/$"){if(y===0){i.removeChild(_),ra(l);return}y--}else h!=="$"&&h!=="$?"&&h!=="$!"||y++;h=_}while(h);ra(l)}function es(i){for(;i!=null;i=i.nextSibling){var l=i.nodeType;if(l===1||l===3)break;if(l===8){if(l=i.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return i}function P1(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var h=i.data;if(h==="$"||h==="$!"||h==="$?"){if(l===0)return i;l--}else h==="/$"&&l++}i=i.previousSibling}return null}var Ii=Math.random().toString(36).slice(2),er="__reactFiber$"+Ii,pa="__reactProps$"+Ii,br="__reactContainer$"+Ii,uh="__reactEvents$"+Ii,$3="__reactListeners$"+Ii,q3="__reactHandles$"+Ii;function Ps(i){var l=i[er];if(l)return l;for(var h=i.parentNode;h;){if(l=h[br]||h[er]){if(h=l.alternate,l.child!==null||h!==null&&h.child!==null)for(i=P1(i);i!==null;){if(h=i[er])return h;i=P1(i)}return l}i=h,h=i.parentNode}return null}function ma(i){return i=i[er]||i[br],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function Ai(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function _c(i){return i[pa]||null}var dh=[],Mi=-1;function ts(i){return{current:i}}function Xe(i){0>Mi||(i.current=dh[Mi],dh[Mi]=null,Mi--)}function Ke(i,l){Mi++,dh[Mi]=i.current,i.current=l}var ns={},It=ts(ns),Ut=ts(!1),Ls=ns;function Oi(i,l){var h=i.type.contextTypes;if(!h)return ns;var y=i.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===l)return y.__reactInternalMemoizedMaskedChildContext;var _={},E;for(E in h)_[E]=l[E];return y&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=l,i.__reactInternalMemoizedMaskedChildContext=_),_}function Ht(i){return i=i.childContextTypes,i!=null}function Nc(){Xe(Ut),Xe(It)}function L1(i,l,h){if(It.current!==ns)throw Error(n(168));Ke(It,l),Ke(Ut,h)}function D1(i,l,h){var y=i.stateNode;if(l=l.childContextTypes,typeof y.getChildContext!="function")return h;y=y.getChildContext();for(var _ in y)if(!(_ in l))throw Error(n(108,Y(i)||"Unknown",_));return X({},h,y)}function kc(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||ns,Ls=It.current,Ke(It,i),Ke(Ut,Ut.current),!0}function $1(i,l,h){var y=i.stateNode;if(!y)throw Error(n(169));h?(i=D1(i,l,Ls),y.__reactInternalMemoizedMergedChildContext=i,Xe(Ut),Xe(It),Ke(It,i)):Xe(Ut),Ke(Ut,h)}var Sr=null,Cc=!1,fh=!1;function q1(i){Sr===null?Sr=[i]:Sr.push(i)}function F3(i){Cc=!0,q1(i)}function rs(){if(!fh&&Sr!==null){fh=!0;var i=0,l=Ve;try{var h=Sr;for(Ve=1;i<h.length;i++){var y=h[i];do y=y(!0);while(y!==null)}Sr=null,Cc=!1}catch(_){throw Sr!==null&&(Sr=Sr.slice(i+1)),tc(Xo,rs),_}finally{Ve=l,fh=!1}}return null}var Pi=[],Li=0,Ec=null,jc=0,yn=[],vn=0,Ds=null,_r=1,Nr="";function $s(i,l){Pi[Li++]=jc,Pi[Li++]=Ec,Ec=i,jc=l}function F1(i,l,h){yn[vn++]=_r,yn[vn++]=Nr,yn[vn++]=Ds,Ds=i;var y=_r;i=Nr;var _=32-nn(y)-1;y&=~(1<<_),h+=1;var E=32-nn(l)+_;if(30<E){var A=_-_%5;E=(y&(1<<A)-1).toString(32),y>>=A,_-=A,_r=1<<32-nn(l)+_|h<<_|y,Nr=E+i}else _r=1<<E|h<<_|y,Nr=i}function hh(i){i.return!==null&&($s(i,1),F1(i,1,0))}function ph(i){for(;i===Ec;)Ec=Pi[--Li],Pi[Li]=null,jc=Pi[--Li],Pi[Li]=null;for(;i===Ds;)Ds=yn[--vn],yn[vn]=null,Nr=yn[--vn],yn[vn]=null,_r=yn[--vn],yn[vn]=null}var sn=null,on=null,Je=!1,An=null;function B1(i,l){var h=Sn(5,null,null,0);h.elementType="DELETED",h.stateNode=l,h.return=i,l=i.deletions,l===null?(i.deletions=[h],i.flags|=16):l.push(h)}function z1(i,l){switch(i.tag){case 5:var h=i.type;return l=l.nodeType!==1||h.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(i.stateNode=l,sn=i,on=es(l.firstChild),!0):!1;case 6:return l=i.pendingProps===""||l.nodeType!==3?null:l,l!==null?(i.stateNode=l,sn=i,on=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(h=Ds!==null?{id:_r,overflow:Nr}:null,i.memoizedState={dehydrated:l,treeContext:h,retryLane:1073741824},h=Sn(18,null,null,0),h.stateNode=l,h.return=i,i.child=h,sn=i,on=null,!0):!1;default:return!1}}function mh(i){return(i.mode&1)!==0&&(i.flags&128)===0}function gh(i){if(Je){var l=on;if(l){var h=l;if(!z1(i,l)){if(mh(i))throw Error(n(418));l=es(h.nextSibling);var y=sn;l&&z1(i,l)?B1(y,h):(i.flags=i.flags&-4097|2,Je=!1,sn=i)}}else{if(mh(i))throw Error(n(418));i.flags=i.flags&-4097|2,Je=!1,sn=i}}}function V1(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;sn=i}function Rc(i){if(i!==sn)return!1;if(!Je)return V1(i),Je=!0,!1;var l;if((l=i.tag!==3)&&!(l=i.tag!==5)&&(l=i.type,l=l!=="head"&&l!=="body"&&!ah(i.type,i.memoizedProps)),l&&(l=on)){if(mh(i))throw U1(),Error(n(418));for(;l;)B1(i,l),l=es(l.nextSibling)}if(V1(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,l=0;i;){if(i.nodeType===8){var h=i.data;if(h==="/$"){if(l===0){on=es(i.nextSibling);break e}l--}else h!=="$"&&h!=="$!"&&h!=="$?"||l++}i=i.nextSibling}on=null}}else on=sn?es(i.stateNode.nextSibling):null;return!0}function U1(){for(var i=on;i;)i=es(i.nextSibling)}function Di(){on=sn=null,Je=!1}function yh(i){An===null?An=[i]:An.push(i)}var B3=C.ReactCurrentBatchConfig;function ga(i,l,h){if(i=h.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(h._owner){if(h=h._owner,h){if(h.tag!==1)throw Error(n(309));var y=h.stateNode}if(!y)throw Error(n(147,i));var _=y,E=""+i;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===E?l.ref:(l=function(A){var H=_.refs;A===null?delete H[E]:H[E]=A},l._stringRef=E,l)}if(typeof i!="string")throw Error(n(284));if(!h._owner)throw Error(n(290,i))}return i}function Tc(i,l){throw i=Object.prototype.toString.call(l),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i))}function H1(i){var l=i._init;return l(i._payload)}function W1(i){function l(ne,Z){if(i){var re=ne.deletions;re===null?(ne.deletions=[Z],ne.flags|=16):re.push(Z)}}function h(ne,Z){if(!i)return null;for(;Z!==null;)l(ne,Z),Z=Z.sibling;return null}function y(ne,Z){for(ne=new Map;Z!==null;)Z.key!==null?ne.set(Z.key,Z):ne.set(Z.index,Z),Z=Z.sibling;return ne}function _(ne,Z){return ne=ds(ne,Z),ne.index=0,ne.sibling=null,ne}function E(ne,Z,re){return ne.index=re,i?(re=ne.alternate,re!==null?(re=re.index,re<Z?(ne.flags|=2,Z):re):(ne.flags|=2,Z)):(ne.flags|=1048576,Z)}function A(ne){return i&&ne.alternate===null&&(ne.flags|=2),ne}function H(ne,Z,re,de){return Z===null||Z.tag!==6?(Z=lp(re,ne.mode,de),Z.return=ne,Z):(Z=_(Z,re),Z.return=ne,Z)}function Q(ne,Z,re,de){var Ne=re.type;return Ne===I?le(ne,Z,re.props.children,de,re.key):Z!==null&&(Z.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===V&&H1(Ne)===Z.type)?(de=_(Z,re.props),de.ref=ga(ne,Z,re),de.return=ne,de):(de=eu(re.type,re.key,re.props,null,ne.mode,de),de.ref=ga(ne,Z,re),de.return=ne,de)}function se(ne,Z,re,de){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==re.containerInfo||Z.stateNode.implementation!==re.implementation?(Z=cp(re,ne.mode,de),Z.return=ne,Z):(Z=_(Z,re.children||[]),Z.return=ne,Z)}function le(ne,Z,re,de,Ne){return Z===null||Z.tag!==7?(Z=Ws(re,ne.mode,de,Ne),Z.return=ne,Z):(Z=_(Z,re),Z.return=ne,Z)}function ce(ne,Z,re){if(typeof Z=="string"&&Z!==""||typeof Z=="number")return Z=lp(""+Z,ne.mode,re),Z.return=ne,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case R:return re=eu(Z.type,Z.key,Z.props,null,ne.mode,re),re.ref=ga(ne,null,Z),re.return=ne,re;case T:return Z=cp(Z,ne.mode,re),Z.return=ne,Z;case V:var de=Z._init;return ce(ne,de(Z._payload),re)}if(vt(Z)||q(Z))return Z=Ws(Z,ne.mode,re,null),Z.return=ne,Z;Tc(ne,Z)}return null}function ae(ne,Z,re,de){var Ne=Z!==null?Z.key:null;if(typeof re=="string"&&re!==""||typeof re=="number")return Ne!==null?null:H(ne,Z,""+re,de);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case R:return re.key===Ne?Q(ne,Z,re,de):null;case T:return re.key===Ne?se(ne,Z,re,de):null;case V:return Ne=re._init,ae(ne,Z,Ne(re._payload),de)}if(vt(re)||q(re))return Ne!==null?null:le(ne,Z,re,de,null);Tc(ne,re)}return null}function me(ne,Z,re,de,Ne){if(typeof de=="string"&&de!==""||typeof de=="number")return ne=ne.get(re)||null,H(Z,ne,""+de,Ne);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case R:return ne=ne.get(de.key===null?re:de.key)||null,Q(Z,ne,de,Ne);case T:return ne=ne.get(de.key===null?re:de.key)||null,se(Z,ne,de,Ne);case V:var Ee=de._init;return me(ne,Z,re,Ee(de._payload),Ne)}if(vt(de)||q(de))return ne=ne.get(re)||null,le(Z,ne,de,Ne,null);Tc(Z,de)}return null}function we(ne,Z,re,de){for(var Ne=null,Ee=null,je=Z,Te=Z=0,Nt=null;je!==null&&Te<re.length;Te++){je.index>Te?(Nt=je,je=null):Nt=je.sibling;var Fe=ae(ne,je,re[Te],de);if(Fe===null){je===null&&(je=Nt);break}i&&je&&Fe.alternate===null&&l(ne,je),Z=E(Fe,Z,Te),Ee===null?Ne=Fe:Ee.sibling=Fe,Ee=Fe,je=Nt}if(Te===re.length)return h(ne,je),Je&&$s(ne,Te),Ne;if(je===null){for(;Te<re.length;Te++)je=ce(ne,re[Te],de),je!==null&&(Z=E(je,Z,Te),Ee===null?Ne=je:Ee.sibling=je,Ee=je);return Je&&$s(ne,Te),Ne}for(je=y(ne,je);Te<re.length;Te++)Nt=me(je,ne,Te,re[Te],de),Nt!==null&&(i&&Nt.alternate!==null&&je.delete(Nt.key===null?Te:Nt.key),Z=E(Nt,Z,Te),Ee===null?Ne=Nt:Ee.sibling=Nt,Ee=Nt);return i&&je.forEach(function(fs){return l(ne,fs)}),Je&&$s(ne,Te),Ne}function Se(ne,Z,re,de){var Ne=q(re);if(typeof Ne!="function")throw Error(n(150));if(re=Ne.call(re),re==null)throw Error(n(151));for(var Ee=Ne=null,je=Z,Te=Z=0,Nt=null,Fe=re.next();je!==null&&!Fe.done;Te++,Fe=re.next()){je.index>Te?(Nt=je,je=null):Nt=je.sibling;var fs=ae(ne,je,Fe.value,de);if(fs===null){je===null&&(je=Nt);break}i&&je&&fs.alternate===null&&l(ne,je),Z=E(fs,Z,Te),Ee===null?Ne=fs:Ee.sibling=fs,Ee=fs,je=Nt}if(Fe.done)return h(ne,je),Je&&$s(ne,Te),Ne;if(je===null){for(;!Fe.done;Te++,Fe=re.next())Fe=ce(ne,Fe.value,de),Fe!==null&&(Z=E(Fe,Z,Te),Ee===null?Ne=Fe:Ee.sibling=Fe,Ee=Fe);return Je&&$s(ne,Te),Ne}for(je=y(ne,je);!Fe.done;Te++,Fe=re.next())Fe=me(je,ne,Te,Fe.value,de),Fe!==null&&(i&&Fe.alternate!==null&&je.delete(Fe.key===null?Te:Fe.key),Z=E(Fe,Z,Te),Ee===null?Ne=Fe:Ee.sibling=Fe,Ee=Fe);return i&&je.forEach(function(w4){return l(ne,w4)}),Je&&$s(ne,Te),Ne}function lt(ne,Z,re,de){if(typeof re=="object"&&re!==null&&re.type===I&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case R:e:{for(var Ne=re.key,Ee=Z;Ee!==null;){if(Ee.key===Ne){if(Ne=re.type,Ne===I){if(Ee.tag===7){h(ne,Ee.sibling),Z=_(Ee,re.props.children),Z.return=ne,ne=Z;break e}}else if(Ee.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===V&&H1(Ne)===Ee.type){h(ne,Ee.sibling),Z=_(Ee,re.props),Z.ref=ga(ne,Ee,re),Z.return=ne,ne=Z;break e}h(ne,Ee);break}else l(ne,Ee);Ee=Ee.sibling}re.type===I?(Z=Ws(re.props.children,ne.mode,de,re.key),Z.return=ne,ne=Z):(de=eu(re.type,re.key,re.props,null,ne.mode,de),de.ref=ga(ne,Z,re),de.return=ne,ne=de)}return A(ne);case T:e:{for(Ee=re.key;Z!==null;){if(Z.key===Ee)if(Z.tag===4&&Z.stateNode.containerInfo===re.containerInfo&&Z.stateNode.implementation===re.implementation){h(ne,Z.sibling),Z=_(Z,re.children||[]),Z.return=ne,ne=Z;break e}else{h(ne,Z);break}else l(ne,Z);Z=Z.sibling}Z=cp(re,ne.mode,de),Z.return=ne,ne=Z}return A(ne);case V:return Ee=re._init,lt(ne,Z,Ee(re._payload),de)}if(vt(re))return we(ne,Z,re,de);if(q(re))return Se(ne,Z,re,de);Tc(ne,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,Z!==null&&Z.tag===6?(h(ne,Z.sibling),Z=_(Z,re),Z.return=ne,ne=Z):(h(ne,Z),Z=lp(re,ne.mode,de),Z.return=ne,ne=Z),A(ne)):h(ne,Z)}return lt}var $i=W1(!0),K1=W1(!1),Ic=ts(null),Ac=null,qi=null,vh=null;function xh(){vh=qi=Ac=null}function wh(i){var l=Ic.current;Xe(Ic),i._currentValue=l}function bh(i,l,h){for(;i!==null;){var y=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,y!==null&&(y.childLanes|=l)):y!==null&&(y.childLanes&l)!==l&&(y.childLanes|=l),i===h)break;i=i.return}}function Fi(i,l){Ac=i,vh=qi=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&l)!==0&&(Wt=!0),i.firstContext=null)}function xn(i){var l=i._currentValue;if(vh!==i)if(i={context:i,memoizedValue:l,next:null},qi===null){if(Ac===null)throw Error(n(308));qi=i,Ac.dependencies={lanes:0,firstContext:i}}else qi=qi.next=i;return l}var qs=null;function Sh(i){qs===null?qs=[i]:qs.push(i)}function G1(i,l,h,y){var _=l.interleaved;return _===null?(h.next=h,Sh(l)):(h.next=_.next,_.next=h),l.interleaved=h,kr(i,y)}function kr(i,l){i.lanes|=l;var h=i.alternate;for(h!==null&&(h.lanes|=l),h=i,i=i.return;i!==null;)i.childLanes|=l,h=i.alternate,h!==null&&(h.childLanes|=l),h=i,i=i.return;return h.tag===3?h.stateNode:null}var ss=!1;function _h(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Y1(i,l){i=i.updateQueue,l.updateQueue===i&&(l.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Cr(i,l){return{eventTime:i,lane:l,tag:0,payload:null,callback:null,next:null}}function is(i,l,h){var y=i.updateQueue;if(y===null)return null;if(y=y.shared,($e&2)!==0){var _=y.pending;return _===null?l.next=l:(l.next=_.next,_.next=l),y.pending=l,kr(i,h)}return _=y.interleaved,_===null?(l.next=l,Sh(y)):(l.next=_.next,_.next=l),y.interleaved=l,kr(i,h)}function Mc(i,l,h){if(l=l.updateQueue,l!==null&&(l=l.shared,(h&4194240)!==0)){var y=l.lanes;y&=i.pendingLanes,h|=y,l.lanes=h,Df(i,h)}}function X1(i,l){var h=i.updateQueue,y=i.alternate;if(y!==null&&(y=y.updateQueue,h===y)){var _=null,E=null;if(h=h.firstBaseUpdate,h!==null){do{var A={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};E===null?_=E=A:E=E.next=A,h=h.next}while(h!==null);E===null?_=E=l:E=E.next=l}else _=E=l;h={baseState:y.baseState,firstBaseUpdate:_,lastBaseUpdate:E,shared:y.shared,effects:y.effects},i.updateQueue=h;return}i=h.lastBaseUpdate,i===null?h.firstBaseUpdate=l:i.next=l,h.lastBaseUpdate=l}function Oc(i,l,h,y){var _=i.updateQueue;ss=!1;var E=_.firstBaseUpdate,A=_.lastBaseUpdate,H=_.shared.pending;if(H!==null){_.shared.pending=null;var Q=H,se=Q.next;Q.next=null,A===null?E=se:A.next=se,A=Q;var le=i.alternate;le!==null&&(le=le.updateQueue,H=le.lastBaseUpdate,H!==A&&(H===null?le.firstBaseUpdate=se:H.next=se,le.lastBaseUpdate=Q))}if(E!==null){var ce=_.baseState;A=0,le=se=Q=null,H=E;do{var ae=H.lane,me=H.eventTime;if((y&ae)===ae){le!==null&&(le=le.next={eventTime:me,lane:0,tag:H.tag,payload:H.payload,callback:H.callback,next:null});e:{var we=i,Se=H;switch(ae=l,me=h,Se.tag){case 1:if(we=Se.payload,typeof we=="function"){ce=we.call(me,ce,ae);break e}ce=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Se.payload,ae=typeof we=="function"?we.call(me,ce,ae):we,ae==null)break e;ce=X({},ce,ae);break e;case 2:ss=!0}}H.callback!==null&&H.lane!==0&&(i.flags|=64,ae=_.effects,ae===null?_.effects=[H]:ae.push(H))}else me={eventTime:me,lane:ae,tag:H.tag,payload:H.payload,callback:H.callback,next:null},le===null?(se=le=me,Q=ce):le=le.next=me,A|=ae;if(H=H.next,H===null){if(H=_.shared.pending,H===null)break;ae=H,H=ae.next,ae.next=null,_.lastBaseUpdate=ae,_.shared.pending=null}}while(!0);if(le===null&&(Q=ce),_.baseState=Q,_.firstBaseUpdate=se,_.lastBaseUpdate=le,l=_.shared.interleaved,l!==null){_=l;do A|=_.lane,_=_.next;while(_!==l)}else E===null&&(_.shared.lanes=0);zs|=A,i.lanes=A,i.memoizedState=ce}}function Q1(i,l,h){if(i=l.effects,l.effects=null,i!==null)for(l=0;l<i.length;l++){var y=i[l],_=y.callback;if(_!==null){if(y.callback=null,y=h,typeof _!="function")throw Error(n(191,_));_.call(y)}}}var ya={},tr=ts(ya),va=ts(ya),xa=ts(ya);function Fs(i){if(i===ya)throw Error(n(174));return i}function Nh(i,l){switch(Ke(xa,l),Ke(va,i),Ke(tr,ya),i=l.nodeType,i){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:Lt(null,"");break;default:i=i===8?l.parentNode:l,l=i.namespaceURI||null,i=i.tagName,l=Lt(l,i)}Xe(tr),Ke(tr,l)}function Bi(){Xe(tr),Xe(va),Xe(xa)}function J1(i){Fs(xa.current);var l=Fs(tr.current),h=Lt(l,i.type);l!==h&&(Ke(va,i),Ke(tr,h))}function kh(i){va.current===i&&(Xe(tr),Xe(va))}var st=ts(0);function Pc(i){for(var l=i;l!==null;){if(l.tag===13){var h=l.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Ch=[];function Eh(){for(var i=0;i<Ch.length;i++)Ch[i]._workInProgressVersionPrimary=null;Ch.length=0}var Lc=C.ReactCurrentDispatcher,jh=C.ReactCurrentBatchConfig,Bs=0,it=null,xt=null,St=null,Dc=!1,wa=!1,ba=0,z3=0;function At(){throw Error(n(321))}function Rh(i,l){if(l===null)return!1;for(var h=0;h<l.length&&h<i.length;h++)if(!In(i[h],l[h]))return!1;return!0}function Th(i,l,h,y,_,E){if(Bs=E,it=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,Lc.current=i===null||i.memoizedState===null?W3:K3,i=h(y,_),wa){E=0;do{if(wa=!1,ba=0,25<=E)throw Error(n(301));E+=1,St=xt=null,l.updateQueue=null,Lc.current=G3,i=h(y,_)}while(wa)}if(Lc.current=Fc,l=xt!==null&&xt.next!==null,Bs=0,St=xt=it=null,Dc=!1,l)throw Error(n(300));return i}function Ih(){var i=ba!==0;return ba=0,i}function nr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?it.memoizedState=St=i:St=St.next=i,St}function wn(){if(xt===null){var i=it.alternate;i=i!==null?i.memoizedState:null}else i=xt.next;var l=St===null?it.memoizedState:St.next;if(l!==null)St=l,xt=i;else{if(i===null)throw Error(n(310));xt=i,i={memoizedState:xt.memoizedState,baseState:xt.baseState,baseQueue:xt.baseQueue,queue:xt.queue,next:null},St===null?it.memoizedState=St=i:St=St.next=i}return St}function Sa(i,l){return typeof l=="function"?l(i):l}function Ah(i){var l=wn(),h=l.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=i;var y=xt,_=y.baseQueue,E=h.pending;if(E!==null){if(_!==null){var A=_.next;_.next=E.next,E.next=A}y.baseQueue=_=E,h.pending=null}if(_!==null){E=_.next,y=y.baseState;var H=A=null,Q=null,se=E;do{var le=se.lane;if((Bs&le)===le)Q!==null&&(Q=Q.next={lane:0,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),y=se.hasEagerState?se.eagerState:i(y,se.action);else{var ce={lane:le,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null};Q===null?(H=Q=ce,A=y):Q=Q.next=ce,it.lanes|=le,zs|=le}se=se.next}while(se!==null&&se!==E);Q===null?A=y:Q.next=H,In(y,l.memoizedState)||(Wt=!0),l.memoizedState=y,l.baseState=A,l.baseQueue=Q,h.lastRenderedState=y}if(i=h.interleaved,i!==null){_=i;do E=_.lane,it.lanes|=E,zs|=E,_=_.next;while(_!==i)}else _===null&&(h.lanes=0);return[l.memoizedState,h.dispatch]}function Mh(i){var l=wn(),h=l.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=i;var y=h.dispatch,_=h.pending,E=l.memoizedState;if(_!==null){h.pending=null;var A=_=_.next;do E=i(E,A.action),A=A.next;while(A!==_);In(E,l.memoizedState)||(Wt=!0),l.memoizedState=E,l.baseQueue===null&&(l.baseState=E),h.lastRenderedState=E}return[E,y]}function Z1(){}function eS(i,l){var h=it,y=wn(),_=l(),E=!In(y.memoizedState,_);if(E&&(y.memoizedState=_,Wt=!0),y=y.queue,Oh(rS.bind(null,h,y,i),[i]),y.getSnapshot!==l||E||St!==null&&St.memoizedState.tag&1){if(h.flags|=2048,_a(9,nS.bind(null,h,y,_,l),void 0,null),_t===null)throw Error(n(349));(Bs&30)!==0||tS(h,l,_)}return _}function tS(i,l,h){i.flags|=16384,i={getSnapshot:l,value:h},l=it.updateQueue,l===null?(l={lastEffect:null,stores:null},it.updateQueue=l,l.stores=[i]):(h=l.stores,h===null?l.stores=[i]:h.push(i))}function nS(i,l,h,y){l.value=h,l.getSnapshot=y,sS(l)&&iS(i)}function rS(i,l,h){return h(function(){sS(l)&&iS(i)})}function sS(i){var l=i.getSnapshot;i=i.value;try{var h=l();return!In(i,h)}catch{return!0}}function iS(i){var l=kr(i,1);l!==null&&Ln(l,i,1,-1)}function oS(i){var l=nr();return typeof i=="function"&&(i=i()),l.memoizedState=l.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:i},l.queue=i,i=i.dispatch=H3.bind(null,it,i),[l.memoizedState,i]}function _a(i,l,h,y){return i={tag:i,create:l,destroy:h,deps:y,next:null},l=it.updateQueue,l===null?(l={lastEffect:null,stores:null},it.updateQueue=l,l.lastEffect=i.next=i):(h=l.lastEffect,h===null?l.lastEffect=i.next=i:(y=h.next,h.next=i,i.next=y,l.lastEffect=i)),i}function aS(){return wn().memoizedState}function $c(i,l,h,y){var _=nr();it.flags|=i,_.memoizedState=_a(1|l,h,void 0,y===void 0?null:y)}function qc(i,l,h,y){var _=wn();y=y===void 0?null:y;var E=void 0;if(xt!==null){var A=xt.memoizedState;if(E=A.destroy,y!==null&&Rh(y,A.deps)){_.memoizedState=_a(l,h,E,y);return}}it.flags|=i,_.memoizedState=_a(1|l,h,E,y)}function lS(i,l){return $c(8390656,8,i,l)}function Oh(i,l){return qc(2048,8,i,l)}function cS(i,l){return qc(4,2,i,l)}function uS(i,l){return qc(4,4,i,l)}function dS(i,l){if(typeof l=="function")return i=i(),l(i),function(){l(null)};if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function fS(i,l,h){return h=h!=null?h.concat([i]):null,qc(4,4,dS.bind(null,l,i),h)}function Ph(){}function hS(i,l){var h=wn();l=l===void 0?null:l;var y=h.memoizedState;return y!==null&&l!==null&&Rh(l,y[1])?y[0]:(h.memoizedState=[i,l],i)}function pS(i,l){var h=wn();l=l===void 0?null:l;var y=h.memoizedState;return y!==null&&l!==null&&Rh(l,y[1])?y[0]:(i=i(),h.memoizedState=[i,l],i)}function mS(i,l,h){return(Bs&21)===0?(i.baseState&&(i.baseState=!1,Wt=!0),i.memoizedState=h):(In(h,l)||(h=Ni(),it.lanes|=h,zs|=h,i.baseState=!0),l)}function V3(i,l){var h=Ve;Ve=h!==0&&4>h?h:4,i(!0);var y=jh.transition;jh.transition={};try{i(!1),l()}finally{Ve=h,jh.transition=y}}function gS(){return wn().memoizedState}function U3(i,l,h){var y=cs(i);if(h={lane:y,action:h,hasEagerState:!1,eagerState:null,next:null},yS(i))vS(l,h);else if(h=G1(i,l,h,y),h!==null){var _=qt();Ln(h,i,y,_),xS(h,l,y)}}function H3(i,l,h){var y=cs(i),_={lane:y,action:h,hasEagerState:!1,eagerState:null,next:null};if(yS(i))vS(l,_);else{var E=i.alternate;if(i.lanes===0&&(E===null||E.lanes===0)&&(E=l.lastRenderedReducer,E!==null))try{var A=l.lastRenderedState,H=E(A,h);if(_.hasEagerState=!0,_.eagerState=H,In(H,A)){var Q=l.interleaved;Q===null?(_.next=_,Sh(l)):(_.next=Q.next,Q.next=_),l.interleaved=_;return}}catch{}finally{}h=G1(i,l,_,y),h!==null&&(_=qt(),Ln(h,i,y,_),xS(h,l,y))}}function yS(i){var l=i.alternate;return i===it||l!==null&&l===it}function vS(i,l){wa=Dc=!0;var h=i.pending;h===null?l.next=l:(l.next=h.next,h.next=l),i.pending=l}function xS(i,l,h){if((h&4194240)!==0){var y=l.lanes;y&=i.pendingLanes,h|=y,l.lanes=h,Df(i,h)}}var Fc={readContext:xn,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useInsertionEffect:At,useLayoutEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useMutableSource:At,useSyncExternalStore:At,useId:At,unstable_isNewReconciler:!1},W3={readContext:xn,useCallback:function(i,l){return nr().memoizedState=[i,l===void 0?null:l],i},useContext:xn,useEffect:lS,useImperativeHandle:function(i,l,h){return h=h!=null?h.concat([i]):null,$c(4194308,4,dS.bind(null,l,i),h)},useLayoutEffect:function(i,l){return $c(4194308,4,i,l)},useInsertionEffect:function(i,l){return $c(4,2,i,l)},useMemo:function(i,l){var h=nr();return l=l===void 0?null:l,i=i(),h.memoizedState=[i,l],i},useReducer:function(i,l,h){var y=nr();return l=h!==void 0?h(l):l,y.memoizedState=y.baseState=l,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:l},y.queue=i,i=i.dispatch=U3.bind(null,it,i),[y.memoizedState,i]},useRef:function(i){var l=nr();return i={current:i},l.memoizedState=i},useState:oS,useDebugValue:Ph,useDeferredValue:function(i){return nr().memoizedState=i},useTransition:function(){var i=oS(!1),l=i[0];return i=V3.bind(null,i[1]),nr().memoizedState=i,[l,i]},useMutableSource:function(){},useSyncExternalStore:function(i,l,h){var y=it,_=nr();if(Je){if(h===void 0)throw Error(n(407));h=h()}else{if(h=l(),_t===null)throw Error(n(349));(Bs&30)!==0||tS(y,l,h)}_.memoizedState=h;var E={value:h,getSnapshot:l};return _.queue=E,lS(rS.bind(null,y,E,i),[i]),y.flags|=2048,_a(9,nS.bind(null,y,E,h,l),void 0,null),h},useId:function(){var i=nr(),l=_t.identifierPrefix;if(Je){var h=Nr,y=_r;h=(y&~(1<<32-nn(y)-1)).toString(32)+h,l=":"+l+"R"+h,h=ba++,0<h&&(l+="H"+h.toString(32)),l+=":"}else h=z3++,l=":"+l+"r"+h.toString(32)+":";return i.memoizedState=l},unstable_isNewReconciler:!1},K3={readContext:xn,useCallback:hS,useContext:xn,useEffect:Oh,useImperativeHandle:fS,useInsertionEffect:cS,useLayoutEffect:uS,useMemo:pS,useReducer:Ah,useRef:aS,useState:function(){return Ah(Sa)},useDebugValue:Ph,useDeferredValue:function(i){var l=wn();return mS(l,xt.memoizedState,i)},useTransition:function(){var i=Ah(Sa)[0],l=wn().memoizedState;return[i,l]},useMutableSource:Z1,useSyncExternalStore:eS,useId:gS,unstable_isNewReconciler:!1},G3={readContext:xn,useCallback:hS,useContext:xn,useEffect:Oh,useImperativeHandle:fS,useInsertionEffect:cS,useLayoutEffect:uS,useMemo:pS,useReducer:Mh,useRef:aS,useState:function(){return Mh(Sa)},useDebugValue:Ph,useDeferredValue:function(i){var l=wn();return xt===null?l.memoizedState=i:mS(l,xt.memoizedState,i)},useTransition:function(){var i=Mh(Sa)[0],l=wn().memoizedState;return[i,l]},useMutableSource:Z1,useSyncExternalStore:eS,useId:gS,unstable_isNewReconciler:!1};function Mn(i,l){if(i&&i.defaultProps){l=X({},l),i=i.defaultProps;for(var h in i)l[h]===void 0&&(l[h]=i[h]);return l}return l}function Lh(i,l,h,y){l=i.memoizedState,h=h(y,l),h=h==null?l:X({},l,h),i.memoizedState=h,i.lanes===0&&(i.updateQueue.baseState=h)}var Bc={isMounted:function(i){return(i=i._reactInternals)?Jn(i)===i:!1},enqueueSetState:function(i,l,h){i=i._reactInternals;var y=qt(),_=cs(i),E=Cr(y,_);E.payload=l,h!=null&&(E.callback=h),l=is(i,E,_),l!==null&&(Ln(l,i,_,y),Mc(l,i,_))},enqueueReplaceState:function(i,l,h){i=i._reactInternals;var y=qt(),_=cs(i),E=Cr(y,_);E.tag=1,E.payload=l,h!=null&&(E.callback=h),l=is(i,E,_),l!==null&&(Ln(l,i,_,y),Mc(l,i,_))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var h=qt(),y=cs(i),_=Cr(h,y);_.tag=2,l!=null&&(_.callback=l),l=is(i,_,y),l!==null&&(Ln(l,i,y,h),Mc(l,i,y))}};function wS(i,l,h,y,_,E,A){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(y,E,A):l.prototype&&l.prototype.isPureReactComponent?!ca(h,y)||!ca(_,E):!0}function bS(i,l,h){var y=!1,_=ns,E=l.contextType;return typeof E=="object"&&E!==null?E=xn(E):(_=Ht(l)?Ls:It.current,y=l.contextTypes,E=(y=y!=null)?Oi(i,_):ns),l=new l(h,E),i.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Bc,i.stateNode=l,l._reactInternals=i,y&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=_,i.__reactInternalMemoizedMaskedChildContext=E),l}function SS(i,l,h,y){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(h,y),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(h,y),l.state!==i&&Bc.enqueueReplaceState(l,l.state,null)}function Dh(i,l,h,y){var _=i.stateNode;_.props=h,_.state=i.memoizedState,_.refs={},_h(i);var E=l.contextType;typeof E=="object"&&E!==null?_.context=xn(E):(E=Ht(l)?Ls:It.current,_.context=Oi(i,E)),_.state=i.memoizedState,E=l.getDerivedStateFromProps,typeof E=="function"&&(Lh(i,l,E,h),_.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(l=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),l!==_.state&&Bc.enqueueReplaceState(_,_.state,null),Oc(i,h,_,y),_.state=i.memoizedState),typeof _.componentDidMount=="function"&&(i.flags|=4194308)}function zi(i,l){try{var h="",y=l;do h+=J(y),y=y.return;while(y);var _=h}catch(E){_=`
39
+ Error generating stack: `+E.message+`
40
+ `+E.stack}return{value:i,source:l,stack:_,digest:null}}function $h(i,l,h){return{value:i,source:null,stack:h??null,digest:l??null}}function qh(i,l){try{console.error(l.value)}catch(h){setTimeout(function(){throw h})}}var Y3=typeof WeakMap=="function"?WeakMap:Map;function _S(i,l,h){h=Cr(-1,h),h.tag=3,h.payload={element:null};var y=l.value;return h.callback=function(){Gc||(Gc=!0,ep=y),qh(i,l)},h}function NS(i,l,h){h=Cr(-1,h),h.tag=3;var y=i.type.getDerivedStateFromError;if(typeof y=="function"){var _=l.value;h.payload=function(){return y(_)},h.callback=function(){qh(i,l)}}var E=i.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(h.callback=function(){qh(i,l),typeof y!="function"&&(as===null?as=new Set([this]):as.add(this));var A=l.stack;this.componentDidCatch(l.value,{componentStack:A!==null?A:""})}),h}function kS(i,l,h){var y=i.pingCache;if(y===null){y=i.pingCache=new Y3;var _=new Set;y.set(l,_)}else _=y.get(l),_===void 0&&(_=new Set,y.set(l,_));_.has(h)||(_.add(h),i=c4.bind(null,i,l,h),l.then(i,i))}function CS(i){do{var l;if((l=i.tag===13)&&(l=i.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return i;i=i.return}while(i!==null);return null}function ES(i,l,h,y,_){return(i.mode&1)===0?(i===l?i.flags|=65536:(i.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(l=Cr(-1,1),l.tag=2,is(h,l,1))),h.lanes|=1),i):(i.flags|=65536,i.lanes=_,i)}var X3=C.ReactCurrentOwner,Wt=!1;function $t(i,l,h,y){l.child=i===null?K1(l,null,h,y):$i(l,i.child,h,y)}function jS(i,l,h,y,_){h=h.render;var E=l.ref;return Fi(l,_),y=Th(i,l,h,y,E,_),h=Ih(),i!==null&&!Wt?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~_,Er(i,l,_)):(Je&&h&&hh(l),l.flags|=1,$t(i,l,y,_),l.child)}function RS(i,l,h,y,_){if(i===null){var E=h.type;return typeof E=="function"&&!ap(E)&&E.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(l.tag=15,l.type=E,TS(i,l,E,y,_)):(i=eu(h.type,null,y,l,l.mode,_),i.ref=l.ref,i.return=l,l.child=i)}if(E=i.child,(i.lanes&_)===0){var A=E.memoizedProps;if(h=h.compare,h=h!==null?h:ca,h(A,y)&&i.ref===l.ref)return Er(i,l,_)}return l.flags|=1,i=ds(E,y),i.ref=l.ref,i.return=l,l.child=i}function TS(i,l,h,y,_){if(i!==null){var E=i.memoizedProps;if(ca(E,y)&&i.ref===l.ref)if(Wt=!1,l.pendingProps=y=E,(i.lanes&_)!==0)(i.flags&131072)!==0&&(Wt=!0);else return l.lanes=i.lanes,Er(i,l,_)}return Fh(i,l,h,y,_)}function IS(i,l,h){var y=l.pendingProps,_=y.children,E=i!==null?i.memoizedState:null;if(y.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ke(Ui,an),an|=h;else{if((h&1073741824)===0)return i=E!==null?E.baseLanes|h:h,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:i,cachePool:null,transitions:null},l.updateQueue=null,Ke(Ui,an),an|=i,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=E!==null?E.baseLanes:h,Ke(Ui,an),an|=y}else E!==null?(y=E.baseLanes|h,l.memoizedState=null):y=h,Ke(Ui,an),an|=y;return $t(i,l,_,h),l.child}function AS(i,l){var h=l.ref;(i===null&&h!==null||i!==null&&i.ref!==h)&&(l.flags|=512,l.flags|=2097152)}function Fh(i,l,h,y,_){var E=Ht(h)?Ls:It.current;return E=Oi(l,E),Fi(l,_),h=Th(i,l,h,y,E,_),y=Ih(),i!==null&&!Wt?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~_,Er(i,l,_)):(Je&&y&&hh(l),l.flags|=1,$t(i,l,h,_),l.child)}function MS(i,l,h,y,_){if(Ht(h)){var E=!0;kc(l)}else E=!1;if(Fi(l,_),l.stateNode===null)Vc(i,l),bS(l,h,y),Dh(l,h,y,_),y=!0;else if(i===null){var A=l.stateNode,H=l.memoizedProps;A.props=H;var Q=A.context,se=h.contextType;typeof se=="object"&&se!==null?se=xn(se):(se=Ht(h)?Ls:It.current,se=Oi(l,se));var le=h.getDerivedStateFromProps,ce=typeof le=="function"||typeof A.getSnapshotBeforeUpdate=="function";ce||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(H!==y||Q!==se)&&SS(l,A,y,se),ss=!1;var ae=l.memoizedState;A.state=ae,Oc(l,y,A,_),Q=l.memoizedState,H!==y||ae!==Q||Ut.current||ss?(typeof le=="function"&&(Lh(l,h,le,y),Q=l.memoizedState),(H=ss||wS(l,h,H,y,ae,Q,se))?(ce||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount()),typeof A.componentDidMount=="function"&&(l.flags|=4194308)):(typeof A.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=y,l.memoizedState=Q),A.props=y,A.state=Q,A.context=se,y=H):(typeof A.componentDidMount=="function"&&(l.flags|=4194308),y=!1)}else{A=l.stateNode,Y1(i,l),H=l.memoizedProps,se=l.type===l.elementType?H:Mn(l.type,H),A.props=se,ce=l.pendingProps,ae=A.context,Q=h.contextType,typeof Q=="object"&&Q!==null?Q=xn(Q):(Q=Ht(h)?Ls:It.current,Q=Oi(l,Q));var me=h.getDerivedStateFromProps;(le=typeof me=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(H!==ce||ae!==Q)&&SS(l,A,y,Q),ss=!1,ae=l.memoizedState,A.state=ae,Oc(l,y,A,_);var we=l.memoizedState;H!==ce||ae!==we||Ut.current||ss?(typeof me=="function"&&(Lh(l,h,me,y),we=l.memoizedState),(se=ss||wS(l,h,se,y,ae,we,Q)||!1)?(le||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(y,we,Q),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(y,we,Q)),typeof A.componentDidUpdate=="function"&&(l.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof A.componentDidUpdate!="function"||H===i.memoizedProps&&ae===i.memoizedState||(l.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||H===i.memoizedProps&&ae===i.memoizedState||(l.flags|=1024),l.memoizedProps=y,l.memoizedState=we),A.props=y,A.state=we,A.context=Q,y=se):(typeof A.componentDidUpdate!="function"||H===i.memoizedProps&&ae===i.memoizedState||(l.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||H===i.memoizedProps&&ae===i.memoizedState||(l.flags|=1024),y=!1)}return Bh(i,l,h,y,E,_)}function Bh(i,l,h,y,_,E){AS(i,l);var A=(l.flags&128)!==0;if(!y&&!A)return _&&$1(l,h,!1),Er(i,l,E);y=l.stateNode,X3.current=l;var H=A&&typeof h.getDerivedStateFromError!="function"?null:y.render();return l.flags|=1,i!==null&&A?(l.child=$i(l,i.child,null,E),l.child=$i(l,null,H,E)):$t(i,l,H,E),l.memoizedState=y.state,_&&$1(l,h,!0),l.child}function OS(i){var l=i.stateNode;l.pendingContext?L1(i,l.pendingContext,l.pendingContext!==l.context):l.context&&L1(i,l.context,!1),Nh(i,l.containerInfo)}function PS(i,l,h,y,_){return Di(),yh(_),l.flags|=256,$t(i,l,h,y),l.child}var zh={dehydrated:null,treeContext:null,retryLane:0};function Vh(i){return{baseLanes:i,cachePool:null,transitions:null}}function LS(i,l,h){var y=l.pendingProps,_=st.current,E=!1,A=(l.flags&128)!==0,H;if((H=A)||(H=i!==null&&i.memoizedState===null?!1:(_&2)!==0),H?(E=!0,l.flags&=-129):(i===null||i.memoizedState!==null)&&(_|=1),Ke(st,_&1),i===null)return gh(l),i=l.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((l.mode&1)===0?l.lanes=1:i.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(A=y.children,i=y.fallback,E?(y=l.mode,E=l.child,A={mode:"hidden",children:A},(y&1)===0&&E!==null?(E.childLanes=0,E.pendingProps=A):E=tu(A,y,0,null),i=Ws(i,y,h,null),E.return=l,i.return=l,E.sibling=i,l.child=E,l.child.memoizedState=Vh(h),l.memoizedState=zh,i):Uh(l,A));if(_=i.memoizedState,_!==null&&(H=_.dehydrated,H!==null))return Q3(i,l,A,y,H,_,h);if(E){E=y.fallback,A=l.mode,_=i.child,H=_.sibling;var Q={mode:"hidden",children:y.children};return(A&1)===0&&l.child!==_?(y=l.child,y.childLanes=0,y.pendingProps=Q,l.deletions=null):(y=ds(_,Q),y.subtreeFlags=_.subtreeFlags&14680064),H!==null?E=ds(H,E):(E=Ws(E,A,h,null),E.flags|=2),E.return=l,y.return=l,y.sibling=E,l.child=y,y=E,E=l.child,A=i.child.memoizedState,A=A===null?Vh(h):{baseLanes:A.baseLanes|h,cachePool:null,transitions:A.transitions},E.memoizedState=A,E.childLanes=i.childLanes&~h,l.memoizedState=zh,y}return E=i.child,i=E.sibling,y=ds(E,{mode:"visible",children:y.children}),(l.mode&1)===0&&(y.lanes=h),y.return=l,y.sibling=null,i!==null&&(h=l.deletions,h===null?(l.deletions=[i],l.flags|=16):h.push(i)),l.child=y,l.memoizedState=null,y}function Uh(i,l){return l=tu({mode:"visible",children:l},i.mode,0,null),l.return=i,i.child=l}function zc(i,l,h,y){return y!==null&&yh(y),$i(l,i.child,null,h),i=Uh(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function Q3(i,l,h,y,_,E,A){if(h)return l.flags&256?(l.flags&=-257,y=$h(Error(n(422))),zc(i,l,A,y)):l.memoizedState!==null?(l.child=i.child,l.flags|=128,null):(E=y.fallback,_=l.mode,y=tu({mode:"visible",children:y.children},_,0,null),E=Ws(E,_,A,null),E.flags|=2,y.return=l,E.return=l,y.sibling=E,l.child=y,(l.mode&1)!==0&&$i(l,i.child,null,A),l.child.memoizedState=Vh(A),l.memoizedState=zh,E);if((l.mode&1)===0)return zc(i,l,A,null);if(_.data==="$!"){if(y=_.nextSibling&&_.nextSibling.dataset,y)var H=y.dgst;return y=H,E=Error(n(419)),y=$h(E,y,void 0),zc(i,l,A,y)}if(H=(A&i.childLanes)!==0,Wt||H){if(y=_t,y!==null){switch(A&-A){case 4:_=2;break;case 16:_=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:_=32;break;case 536870912:_=268435456;break;default:_=0}_=(_&(y.suspendedLanes|A))!==0?0:_,_!==0&&_!==E.retryLane&&(E.retryLane=_,kr(i,_),Ln(y,i,_,-1))}return op(),y=$h(Error(n(421))),zc(i,l,A,y)}return _.data==="$?"?(l.flags|=128,l.child=i.child,l=u4.bind(null,i),_._reactRetry=l,null):(i=E.treeContext,on=es(_.nextSibling),sn=l,Je=!0,An=null,i!==null&&(yn[vn++]=_r,yn[vn++]=Nr,yn[vn++]=Ds,_r=i.id,Nr=i.overflow,Ds=l),l=Uh(l,y.children),l.flags|=4096,l)}function DS(i,l,h){i.lanes|=l;var y=i.alternate;y!==null&&(y.lanes|=l),bh(i.return,l,h)}function Hh(i,l,h,y,_){var E=i.memoizedState;E===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:y,tail:h,tailMode:_}:(E.isBackwards=l,E.rendering=null,E.renderingStartTime=0,E.last=y,E.tail=h,E.tailMode=_)}function $S(i,l,h){var y=l.pendingProps,_=y.revealOrder,E=y.tail;if($t(i,l,y.children,h),y=st.current,(y&2)!==0)y=y&1|2,l.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&DS(i,h,l);else if(i.tag===19)DS(i,h,l);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break e;for(;i.sibling===null;){if(i.return===null||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}y&=1}if(Ke(st,y),(l.mode&1)===0)l.memoizedState=null;else switch(_){case"forwards":for(h=l.child,_=null;h!==null;)i=h.alternate,i!==null&&Pc(i)===null&&(_=h),h=h.sibling;h=_,h===null?(_=l.child,l.child=null):(_=h.sibling,h.sibling=null),Hh(l,!1,_,h,E);break;case"backwards":for(h=null,_=l.child,l.child=null;_!==null;){if(i=_.alternate,i!==null&&Pc(i)===null){l.child=_;break}i=_.sibling,_.sibling=h,h=_,_=i}Hh(l,!0,h,null,E);break;case"together":Hh(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Vc(i,l){(l.mode&1)===0&&i!==null&&(i.alternate=null,l.alternate=null,l.flags|=2)}function Er(i,l,h){if(i!==null&&(l.dependencies=i.dependencies),zs|=l.lanes,(h&l.childLanes)===0)return null;if(i!==null&&l.child!==i.child)throw Error(n(153));if(l.child!==null){for(i=l.child,h=ds(i,i.pendingProps),l.child=h,h.return=l;i.sibling!==null;)i=i.sibling,h=h.sibling=ds(i,i.pendingProps),h.return=l;h.sibling=null}return l.child}function J3(i,l,h){switch(l.tag){case 3:OS(l),Di();break;case 5:J1(l);break;case 1:Ht(l.type)&&kc(l);break;case 4:Nh(l,l.stateNode.containerInfo);break;case 10:var y=l.type._context,_=l.memoizedProps.value;Ke(Ic,y._currentValue),y._currentValue=_;break;case 13:if(y=l.memoizedState,y!==null)return y.dehydrated!==null?(Ke(st,st.current&1),l.flags|=128,null):(h&l.child.childLanes)!==0?LS(i,l,h):(Ke(st,st.current&1),i=Er(i,l,h),i!==null?i.sibling:null);Ke(st,st.current&1);break;case 19:if(y=(h&l.childLanes)!==0,(i.flags&128)!==0){if(y)return $S(i,l,h);l.flags|=128}if(_=l.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),Ke(st,st.current),y)break;return null;case 22:case 23:return l.lanes=0,IS(i,l,h)}return Er(i,l,h)}var qS,Wh,FS,BS;qS=function(i,l){for(var h=l.child;h!==null;){if(h.tag===5||h.tag===6)i.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===l)break;for(;h.sibling===null;){if(h.return===null||h.return===l)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},Wh=function(){},FS=function(i,l,h,y){var _=i.memoizedProps;if(_!==y){i=l.stateNode,Fs(tr.current);var E=null;switch(h){case"input":_=be(i,_),y=be(i,y),E=[];break;case"select":_=X({},_,{value:void 0}),y=X({},y,{value:void 0}),E=[];break;case"textarea":_=ft(i,_),y=ft(i,y),E=[];break;default:typeof _.onClick!="function"&&typeof y.onClick=="function"&&(i.onclick=Sc)}_e(h,y);var A;h=null;for(se in _)if(!y.hasOwnProperty(se)&&_.hasOwnProperty(se)&&_[se]!=null)if(se==="style"){var H=_[se];for(A in H)H.hasOwnProperty(A)&&(h||(h={}),h[A]="")}else se!=="dangerouslySetInnerHTML"&&se!=="children"&&se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&se!=="autoFocus"&&(s.hasOwnProperty(se)?E||(E=[]):(E=E||[]).push(se,null));for(se in y){var Q=y[se];if(H=_!=null?_[se]:void 0,y.hasOwnProperty(se)&&Q!==H&&(Q!=null||H!=null))if(se==="style")if(H){for(A in H)!H.hasOwnProperty(A)||Q&&Q.hasOwnProperty(A)||(h||(h={}),h[A]="");for(A in Q)Q.hasOwnProperty(A)&&H[A]!==Q[A]&&(h||(h={}),h[A]=Q[A])}else h||(E||(E=[]),E.push(se,h)),h=Q;else se==="dangerouslySetInnerHTML"?(Q=Q?Q.__html:void 0,H=H?H.__html:void 0,Q!=null&&H!==Q&&(E=E||[]).push(se,Q)):se==="children"?typeof Q!="string"&&typeof Q!="number"||(E=E||[]).push(se,""+Q):se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&(s.hasOwnProperty(se)?(Q!=null&&se==="onScroll"&&Ye("scroll",i),E||H===Q||(E=[])):(E=E||[]).push(se,Q))}h&&(E=E||[]).push("style",h);var se=E;(l.updateQueue=se)&&(l.flags|=4)}},BS=function(i,l,h,y){h!==y&&(l.flags|=4)};function Na(i,l){if(!Je)switch(i.tailMode){case"hidden":l=i.tail;for(var h=null;l!==null;)l.alternate!==null&&(h=l),l=l.sibling;h===null?i.tail=null:h.sibling=null;break;case"collapsed":h=i.tail;for(var y=null;h!==null;)h.alternate!==null&&(y=h),h=h.sibling;y===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:y.sibling=null}}function Mt(i){var l=i.alternate!==null&&i.alternate.child===i.child,h=0,y=0;if(l)for(var _=i.child;_!==null;)h|=_.lanes|_.childLanes,y|=_.subtreeFlags&14680064,y|=_.flags&14680064,_.return=i,_=_.sibling;else for(_=i.child;_!==null;)h|=_.lanes|_.childLanes,y|=_.subtreeFlags,y|=_.flags,_.return=i,_=_.sibling;return i.subtreeFlags|=y,i.childLanes=h,l}function Z3(i,l,h){var y=l.pendingProps;switch(ph(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(l),null;case 1:return Ht(l.type)&&Nc(),Mt(l),null;case 3:return y=l.stateNode,Bi(),Xe(Ut),Xe(It),Eh(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(i===null||i.child===null)&&(Rc(l)?l.flags|=4:i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,An!==null&&(rp(An),An=null))),Wh(i,l),Mt(l),null;case 5:kh(l);var _=Fs(xa.current);if(h=l.type,i!==null&&l.stateNode!=null)FS(i,l,h,y,_),i.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!y){if(l.stateNode===null)throw Error(n(166));return Mt(l),null}if(i=Fs(tr.current),Rc(l)){y=l.stateNode,h=l.type;var E=l.memoizedProps;switch(y[er]=l,y[pa]=E,i=(l.mode&1)!==0,h){case"dialog":Ye("cancel",y),Ye("close",y);break;case"iframe":case"object":case"embed":Ye("load",y);break;case"video":case"audio":for(_=0;_<da.length;_++)Ye(da[_],y);break;case"source":Ye("error",y);break;case"img":case"image":case"link":Ye("error",y),Ye("load",y);break;case"details":Ye("toggle",y);break;case"input":ve(y,E),Ye("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!E.multiple},Ye("invalid",y);break;case"textarea":He(y,E),Ye("invalid",y)}_e(h,E),_=null;for(var A in E)if(E.hasOwnProperty(A)){var H=E[A];A==="children"?typeof H=="string"?y.textContent!==H&&(E.suppressHydrationWarning!==!0&&bc(y.textContent,H,i),_=["children",H]):typeof H=="number"&&y.textContent!==""+H&&(E.suppressHydrationWarning!==!0&&bc(y.textContent,H,i),_=["children",""+H]):s.hasOwnProperty(A)&&H!=null&&A==="onScroll"&&Ye("scroll",y)}switch(h){case"input":ge(y),ze(y,E,!0);break;case"textarea":ge(y),Zt(y);break;case"select":case"option":break;default:typeof E.onClick=="function"&&(y.onclick=Sc)}y=_,l.updateQueue=y,y!==null&&(l.flags|=4)}else{A=_.nodeType===9?_:_.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=en(h)),i==="http://www.w3.org/1999/xhtml"?h==="script"?(i=A.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof y.is=="string"?i=A.createElement(h,{is:y.is}):(i=A.createElement(h),h==="select"&&(A=i,y.multiple?A.multiple=!0:y.size&&(A.size=y.size))):i=A.createElementNS(i,h),i[er]=l,i[pa]=y,qS(i,l,!1,!1),l.stateNode=i;e:{switch(A=Ce(h,y),h){case"dialog":Ye("cancel",i),Ye("close",i),_=y;break;case"iframe":case"object":case"embed":Ye("load",i),_=y;break;case"video":case"audio":for(_=0;_<da.length;_++)Ye(da[_],i);_=y;break;case"source":Ye("error",i),_=y;break;case"img":case"image":case"link":Ye("error",i),Ye("load",i),_=y;break;case"details":Ye("toggle",i),_=y;break;case"input":ve(i,y),_=be(i,y),Ye("invalid",i);break;case"option":_=y;break;case"select":i._wrapperState={wasMultiple:!!y.multiple},_=X({},y,{value:void 0}),Ye("invalid",i);break;case"textarea":He(i,y),_=ft(i,y),Ye("invalid",i);break;default:_=y}_e(h,_),H=_;for(E in H)if(H.hasOwnProperty(E)){var Q=H[E];E==="style"?Dt(i,Q):E==="dangerouslySetInnerHTML"?(Q=Q?Q.__html:void 0,Q!=null&&wr(i,Q)):E==="children"?typeof Q=="string"?(h!=="textarea"||Q!=="")&&kt(i,Q):typeof Q=="number"&&kt(i,""+Q):E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&E!=="autoFocus"&&(s.hasOwnProperty(E)?Q!=null&&E==="onScroll"&&Ye("scroll",i):Q!=null&&N(i,E,Q,A))}switch(h){case"input":ge(i),ze(i,y,!1);break;case"textarea":ge(i),Zt(i);break;case"option":y.value!=null&&i.setAttribute("value",""+ee(y.value));break;case"select":i.multiple=!!y.multiple,E=y.value,E!=null?Pe(i,!!y.multiple,E,!1):y.defaultValue!=null&&Pe(i,!!y.multiple,y.defaultValue,!0);break;default:typeof _.onClick=="function"&&(i.onclick=Sc)}switch(h){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Mt(l),null;case 6:if(i&&l.stateNode!=null)BS(i,l,i.memoizedProps,y);else{if(typeof y!="string"&&l.stateNode===null)throw Error(n(166));if(h=Fs(xa.current),Fs(tr.current),Rc(l)){if(y=l.stateNode,h=l.memoizedProps,y[er]=l,(E=y.nodeValue!==h)&&(i=sn,i!==null))switch(i.tag){case 3:bc(y.nodeValue,h,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&bc(y.nodeValue,h,(i.mode&1)!==0)}E&&(l.flags|=4)}else y=(h.nodeType===9?h:h.ownerDocument).createTextNode(y),y[er]=l,l.stateNode=y}return Mt(l),null;case 13:if(Xe(st),y=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(Je&&on!==null&&(l.mode&1)!==0&&(l.flags&128)===0)U1(),Di(),l.flags|=98560,E=!1;else if(E=Rc(l),y!==null&&y.dehydrated!==null){if(i===null){if(!E)throw Error(n(318));if(E=l.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(n(317));E[er]=l}else Di(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Mt(l),E=!1}else An!==null&&(rp(An),An=null),E=!0;if(!E)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=h,l):(y=y!==null,y!==(i!==null&&i.memoizedState!==null)&&y&&(l.child.flags|=8192,(l.mode&1)!==0&&(i===null||(st.current&1)!==0?wt===0&&(wt=3):op())),l.updateQueue!==null&&(l.flags|=4),Mt(l),null);case 4:return Bi(),Wh(i,l),i===null&&fa(l.stateNode.containerInfo),Mt(l),null;case 10:return wh(l.type._context),Mt(l),null;case 17:return Ht(l.type)&&Nc(),Mt(l),null;case 19:if(Xe(st),E=l.memoizedState,E===null)return Mt(l),null;if(y=(l.flags&128)!==0,A=E.rendering,A===null)if(y)Na(E,!1);else{if(wt!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(A=Pc(i),A!==null){for(l.flags|=128,Na(E,!1),y=A.updateQueue,y!==null&&(l.updateQueue=y,l.flags|=4),l.subtreeFlags=0,y=h,h=l.child;h!==null;)E=h,i=y,E.flags&=14680066,A=E.alternate,A===null?(E.childLanes=0,E.lanes=i,E.child=null,E.subtreeFlags=0,E.memoizedProps=null,E.memoizedState=null,E.updateQueue=null,E.dependencies=null,E.stateNode=null):(E.childLanes=A.childLanes,E.lanes=A.lanes,E.child=A.child,E.subtreeFlags=0,E.deletions=null,E.memoizedProps=A.memoizedProps,E.memoizedState=A.memoizedState,E.updateQueue=A.updateQueue,E.type=A.type,i=A.dependencies,E.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),h=h.sibling;return Ke(st,st.current&1|2),l.child}i=i.sibling}E.tail!==null&&rt()>Hi&&(l.flags|=128,y=!0,Na(E,!1),l.lanes=4194304)}else{if(!y)if(i=Pc(A),i!==null){if(l.flags|=128,y=!0,h=i.updateQueue,h!==null&&(l.updateQueue=h,l.flags|=4),Na(E,!0),E.tail===null&&E.tailMode==="hidden"&&!A.alternate&&!Je)return Mt(l),null}else 2*rt()-E.renderingStartTime>Hi&&h!==1073741824&&(l.flags|=128,y=!0,Na(E,!1),l.lanes=4194304);E.isBackwards?(A.sibling=l.child,l.child=A):(h=E.last,h!==null?h.sibling=A:l.child=A,E.last=A)}return E.tail!==null?(l=E.tail,E.rendering=l,E.tail=l.sibling,E.renderingStartTime=rt(),l.sibling=null,h=st.current,Ke(st,y?h&1|2:h&1),l):(Mt(l),null);case 22:case 23:return ip(),y=l.memoizedState!==null,i!==null&&i.memoizedState!==null!==y&&(l.flags|=8192),y&&(l.mode&1)!==0?(an&1073741824)!==0&&(Mt(l),l.subtreeFlags&6&&(l.flags|=8192)):Mt(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function e4(i,l){switch(ph(l),l.tag){case 1:return Ht(l.type)&&Nc(),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return Bi(),Xe(Ut),Xe(It),Eh(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 5:return kh(l),null;case 13:if(Xe(st),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Di()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return Xe(st),null;case 4:return Bi(),null;case 10:return wh(l.type._context),null;case 22:case 23:return ip(),null;case 24:return null;default:return null}}var Uc=!1,Ot=!1,t4=typeof WeakSet=="function"?WeakSet:Set,ye=null;function Vi(i,l){var h=i.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(y){at(i,l,y)}else h.current=null}function Kh(i,l,h){try{h()}catch(y){at(i,l,y)}}var zS=!1;function n4(i,l){if(ih=uc,i=w1(),Qf(i)){if("selectionStart"in i)var h={start:i.selectionStart,end:i.selectionEnd};else e:{h=(h=i.ownerDocument)&&h.defaultView||window;var y=h.getSelection&&h.getSelection();if(y&&y.rangeCount!==0){h=y.anchorNode;var _=y.anchorOffset,E=y.focusNode;y=y.focusOffset;try{h.nodeType,E.nodeType}catch{h=null;break e}var A=0,H=-1,Q=-1,se=0,le=0,ce=i,ae=null;t:for(;;){for(var me;ce!==h||_!==0&&ce.nodeType!==3||(H=A+_),ce!==E||y!==0&&ce.nodeType!==3||(Q=A+y),ce.nodeType===3&&(A+=ce.nodeValue.length),(me=ce.firstChild)!==null;)ae=ce,ce=me;for(;;){if(ce===i)break t;if(ae===h&&++se===_&&(H=A),ae===E&&++le===y&&(Q=A),(me=ce.nextSibling)!==null)break;ce=ae,ae=ce.parentNode}ce=me}h=H===-1||Q===-1?null:{start:H,end:Q}}else h=null}h=h||{start:0,end:0}}else h=null;for(oh={focusedElem:i,selectionRange:h},uc=!1,ye=l;ye!==null;)if(l=ye,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,ye=i;else for(;ye!==null;){l=ye;try{var we=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(we!==null){var Se=we.memoizedProps,lt=we.memoizedState,ne=l.stateNode,Z=ne.getSnapshotBeforeUpdate(l.elementType===l.type?Se:Mn(l.type,Se),lt);ne.__reactInternalSnapshotBeforeUpdate=Z}break;case 3:var re=l.stateNode.containerInfo;re.nodeType===1?re.textContent="":re.nodeType===9&&re.documentElement&&re.removeChild(re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(de){at(l,l.return,de)}if(i=l.sibling,i!==null){i.return=l.return,ye=i;break}ye=l.return}return we=zS,zS=!1,we}function ka(i,l,h){var y=l.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var _=y=y.next;do{if((_.tag&i)===i){var E=_.destroy;_.destroy=void 0,E!==void 0&&Kh(l,h,E)}_=_.next}while(_!==y)}}function Hc(i,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var h=l=l.next;do{if((h.tag&i)===i){var y=h.create;h.destroy=y()}h=h.next}while(h!==l)}}function Gh(i){var l=i.ref;if(l!==null){var h=i.stateNode;switch(i.tag){case 5:i=h;break;default:i=h}typeof l=="function"?l(i):l.current=i}}function VS(i){var l=i.alternate;l!==null&&(i.alternate=null,VS(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&(delete l[er],delete l[pa],delete l[uh],delete l[$3],delete l[q3])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function US(i){return i.tag===5||i.tag===3||i.tag===4}function HS(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||US(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Yh(i,l,h){var y=i.tag;if(y===5||y===6)i=i.stateNode,l?h.nodeType===8?h.parentNode.insertBefore(i,l):h.insertBefore(i,l):(h.nodeType===8?(l=h.parentNode,l.insertBefore(i,h)):(l=h,l.appendChild(i)),h=h._reactRootContainer,h!=null||l.onclick!==null||(l.onclick=Sc));else if(y!==4&&(i=i.child,i!==null))for(Yh(i,l,h),i=i.sibling;i!==null;)Yh(i,l,h),i=i.sibling}function Xh(i,l,h){var y=i.tag;if(y===5||y===6)i=i.stateNode,l?h.insertBefore(i,l):h.appendChild(i);else if(y!==4&&(i=i.child,i!==null))for(Xh(i,l,h),i=i.sibling;i!==null;)Xh(i,l,h),i=i.sibling}var Ct=null,On=!1;function os(i,l,h){for(h=h.child;h!==null;)WS(i,l,h),h=h.sibling}function WS(i,l,h){if(gn&&typeof gn.onCommitFiberUnmount=="function")try{gn.onCommitFiberUnmount(Ms,h)}catch{}switch(h.tag){case 5:Ot||Vi(h,l);case 6:var y=Ct,_=On;Ct=null,os(i,l,h),Ct=y,On=_,Ct!==null&&(On?(i=Ct,h=h.stateNode,i.nodeType===8?i.parentNode.removeChild(h):i.removeChild(h)):Ct.removeChild(h.stateNode));break;case 18:Ct!==null&&(On?(i=Ct,h=h.stateNode,i.nodeType===8?ch(i.parentNode,h):i.nodeType===1&&ch(i,h),ra(i)):ch(Ct,h.stateNode));break;case 4:y=Ct,_=On,Ct=h.stateNode.containerInfo,On=!0,os(i,l,h),Ct=y,On=_;break;case 0:case 11:case 14:case 15:if(!Ot&&(y=h.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){_=y=y.next;do{var E=_,A=E.destroy;E=E.tag,A!==void 0&&((E&2)!==0||(E&4)!==0)&&Kh(h,l,A),_=_.next}while(_!==y)}os(i,l,h);break;case 1:if(!Ot&&(Vi(h,l),y=h.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=h.memoizedProps,y.state=h.memoizedState,y.componentWillUnmount()}catch(H){at(h,l,H)}os(i,l,h);break;case 21:os(i,l,h);break;case 22:h.mode&1?(Ot=(y=Ot)||h.memoizedState!==null,os(i,l,h),Ot=y):os(i,l,h);break;default:os(i,l,h)}}function KS(i){var l=i.updateQueue;if(l!==null){i.updateQueue=null;var h=i.stateNode;h===null&&(h=i.stateNode=new t4),l.forEach(function(y){var _=d4.bind(null,i,y);h.has(y)||(h.add(y),y.then(_,_))})}}function Pn(i,l){var h=l.deletions;if(h!==null)for(var y=0;y<h.length;y++){var _=h[y];try{var E=i,A=l,H=A;e:for(;H!==null;){switch(H.tag){case 5:Ct=H.stateNode,On=!1;break e;case 3:Ct=H.stateNode.containerInfo,On=!0;break e;case 4:Ct=H.stateNode.containerInfo,On=!0;break e}H=H.return}if(Ct===null)throw Error(n(160));WS(E,A,_),Ct=null,On=!1;var Q=_.alternate;Q!==null&&(Q.return=null),_.return=null}catch(se){at(_,l,se)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)GS(l,i),l=l.sibling}function GS(i,l){var h=i.alternate,y=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(Pn(l,i),rr(i),y&4){try{ka(3,i,i.return),Hc(3,i)}catch(Se){at(i,i.return,Se)}try{ka(5,i,i.return)}catch(Se){at(i,i.return,Se)}}break;case 1:Pn(l,i),rr(i),y&512&&h!==null&&Vi(h,h.return);break;case 5:if(Pn(l,i),rr(i),y&512&&h!==null&&Vi(h,h.return),i.flags&32){var _=i.stateNode;try{kt(_,"")}catch(Se){at(i,i.return,Se)}}if(y&4&&(_=i.stateNode,_!=null)){var E=i.memoizedProps,A=h!==null?h.memoizedProps:E,H=i.type,Q=i.updateQueue;if(i.updateQueue=null,Q!==null)try{H==="input"&&E.type==="radio"&&E.name!=null&&Re(_,E),Ce(H,A);var se=Ce(H,E);for(A=0;A<Q.length;A+=2){var le=Q[A],ce=Q[A+1];le==="style"?Dt(_,ce):le==="dangerouslySetInnerHTML"?wr(_,ce):le==="children"?kt(_,ce):N(_,le,ce,se)}switch(H){case"input":ke(_,E);break;case"textarea":hn(_,E);break;case"select":var ae=_._wrapperState.wasMultiple;_._wrapperState.wasMultiple=!!E.multiple;var me=E.value;me!=null?Pe(_,!!E.multiple,me,!1):ae!==!!E.multiple&&(E.defaultValue!=null?Pe(_,!!E.multiple,E.defaultValue,!0):Pe(_,!!E.multiple,E.multiple?[]:"",!1))}_[pa]=E}catch(Se){at(i,i.return,Se)}}break;case 6:if(Pn(l,i),rr(i),y&4){if(i.stateNode===null)throw Error(n(162));_=i.stateNode,E=i.memoizedProps;try{_.nodeValue=E}catch(Se){at(i,i.return,Se)}}break;case 3:if(Pn(l,i),rr(i),y&4&&h!==null&&h.memoizedState.isDehydrated)try{ra(l.containerInfo)}catch(Se){at(i,i.return,Se)}break;case 4:Pn(l,i),rr(i);break;case 13:Pn(l,i),rr(i),_=i.child,_.flags&8192&&(E=_.memoizedState!==null,_.stateNode.isHidden=E,!E||_.alternate!==null&&_.alternate.memoizedState!==null||(Zh=rt())),y&4&&KS(i);break;case 22:if(le=h!==null&&h.memoizedState!==null,i.mode&1?(Ot=(se=Ot)||le,Pn(l,i),Ot=se):Pn(l,i),rr(i),y&8192){if(se=i.memoizedState!==null,(i.stateNode.isHidden=se)&&!le&&(i.mode&1)!==0)for(ye=i,le=i.child;le!==null;){for(ce=ye=le;ye!==null;){switch(ae=ye,me=ae.child,ae.tag){case 0:case 11:case 14:case 15:ka(4,ae,ae.return);break;case 1:Vi(ae,ae.return);var we=ae.stateNode;if(typeof we.componentWillUnmount=="function"){y=ae,h=ae.return;try{l=y,we.props=l.memoizedProps,we.state=l.memoizedState,we.componentWillUnmount()}catch(Se){at(y,h,Se)}}break;case 5:Vi(ae,ae.return);break;case 22:if(ae.memoizedState!==null){QS(ce);continue}}me!==null?(me.return=ae,ye=me):QS(ce)}le=le.sibling}e:for(le=null,ce=i;;){if(ce.tag===5){if(le===null){le=ce;try{_=ce.stateNode,se?(E=_.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none"):(H=ce.stateNode,Q=ce.memoizedProps.style,A=Q!=null&&Q.hasOwnProperty("display")?Q.display:null,H.style.display=Rt("display",A))}catch(Se){at(i,i.return,Se)}}}else if(ce.tag===6){if(le===null)try{ce.stateNode.nodeValue=se?"":ce.memoizedProps}catch(Se){at(i,i.return,Se)}}else if((ce.tag!==22&&ce.tag!==23||ce.memoizedState===null||ce===i)&&ce.child!==null){ce.child.return=ce,ce=ce.child;continue}if(ce===i)break e;for(;ce.sibling===null;){if(ce.return===null||ce.return===i)break e;le===ce&&(le=null),ce=ce.return}le===ce&&(le=null),ce.sibling.return=ce.return,ce=ce.sibling}}break;case 19:Pn(l,i),rr(i),y&4&&KS(i);break;case 21:break;default:Pn(l,i),rr(i)}}function rr(i){var l=i.flags;if(l&2){try{e:{for(var h=i.return;h!==null;){if(US(h)){var y=h;break e}h=h.return}throw Error(n(160))}switch(y.tag){case 5:var _=y.stateNode;y.flags&32&&(kt(_,""),y.flags&=-33);var E=HS(i);Xh(i,E,_);break;case 3:case 4:var A=y.stateNode.containerInfo,H=HS(i);Yh(i,H,A);break;default:throw Error(n(161))}}catch(Q){at(i,i.return,Q)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function r4(i,l,h){ye=i,YS(i)}function YS(i,l,h){for(var y=(i.mode&1)!==0;ye!==null;){var _=ye,E=_.child;if(_.tag===22&&y){var A=_.memoizedState!==null||Uc;if(!A){var H=_.alternate,Q=H!==null&&H.memoizedState!==null||Ot;H=Uc;var se=Ot;if(Uc=A,(Ot=Q)&&!se)for(ye=_;ye!==null;)A=ye,Q=A.child,A.tag===22&&A.memoizedState!==null?JS(_):Q!==null?(Q.return=A,ye=Q):JS(_);for(;E!==null;)ye=E,YS(E),E=E.sibling;ye=_,Uc=H,Ot=se}XS(i)}else(_.subtreeFlags&8772)!==0&&E!==null?(E.return=_,ye=E):XS(i)}}function XS(i){for(;ye!==null;){var l=ye;if((l.flags&8772)!==0){var h=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Ot||Hc(5,l);break;case 1:var y=l.stateNode;if(l.flags&4&&!Ot)if(h===null)y.componentDidMount();else{var _=l.elementType===l.type?h.memoizedProps:Mn(l.type,h.memoizedProps);y.componentDidUpdate(_,h.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var E=l.updateQueue;E!==null&&Q1(l,E,y);break;case 3:var A=l.updateQueue;if(A!==null){if(h=null,l.child!==null)switch(l.child.tag){case 5:h=l.child.stateNode;break;case 1:h=l.child.stateNode}Q1(l,A,h)}break;case 5:var H=l.stateNode;if(h===null&&l.flags&4){h=H;var Q=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":Q.autoFocus&&h.focus();break;case"img":Q.src&&(h.src=Q.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var se=l.alternate;if(se!==null){var le=se.memoizedState;if(le!==null){var ce=le.dehydrated;ce!==null&&ra(ce)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Ot||l.flags&512&&Gh(l)}catch(ae){at(l,l.return,ae)}}if(l===i){ye=null;break}if(h=l.sibling,h!==null){h.return=l.return,ye=h;break}ye=l.return}}function QS(i){for(;ye!==null;){var l=ye;if(l===i){ye=null;break}var h=l.sibling;if(h!==null){h.return=l.return,ye=h;break}ye=l.return}}function JS(i){for(;ye!==null;){var l=ye;try{switch(l.tag){case 0:case 11:case 15:var h=l.return;try{Hc(4,l)}catch(Q){at(l,h,Q)}break;case 1:var y=l.stateNode;if(typeof y.componentDidMount=="function"){var _=l.return;try{y.componentDidMount()}catch(Q){at(l,_,Q)}}var E=l.return;try{Gh(l)}catch(Q){at(l,E,Q)}break;case 5:var A=l.return;try{Gh(l)}catch(Q){at(l,A,Q)}}}catch(Q){at(l,l.return,Q)}if(l===i){ye=null;break}var H=l.sibling;if(H!==null){H.return=l.return,ye=H;break}ye=l.return}}var s4=Math.ceil,Wc=C.ReactCurrentDispatcher,Qh=C.ReactCurrentOwner,bn=C.ReactCurrentBatchConfig,$e=0,_t=null,ht=null,Et=0,an=0,Ui=ts(0),wt=0,Ca=null,zs=0,Kc=0,Jh=0,Ea=null,Kt=null,Zh=0,Hi=1/0,jr=null,Gc=!1,ep=null,as=null,Yc=!1,ls=null,Xc=0,ja=0,tp=null,Qc=-1,Jc=0;function qt(){return($e&6)!==0?rt():Qc!==-1?Qc:Qc=rt()}function cs(i){return(i.mode&1)===0?1:($e&2)!==0&&Et!==0?Et&-Et:B3.transition!==null?(Jc===0&&(Jc=Ni()),Jc):(i=Ve,i!==0||(i=window.event,i=i===void 0?16:e1(i.type)),i)}function Ln(i,l,h,y){if(50<ja)throw ja=0,tp=null,Error(n(185));Os(i,h,y),(($e&2)===0||i!==_t)&&(i===_t&&(($e&2)===0&&(Kc|=h),wt===4&&us(i,Et)),Gt(i,y),h===1&&$e===0&&(l.mode&1)===0&&(Hi=rt()+500,Cc&&rs()))}function Gt(i,l){var h=i.callbackNode;Lf(i,l);var y=_i(i,i===_t?Et:0);if(y===0)h!==null&&nc(h),i.callbackNode=null,i.callbackPriority=0;else if(l=y&-y,i.callbackPriority!==l){if(h!=null&&nc(h),l===1)i.tag===0?F3(e_.bind(null,i)):q1(e_.bind(null,i)),L3(function(){($e&6)===0&&rs()}),h=null;else{switch(Wb(y)){case 1:h=Xo;break;case 4:h=sc;break;case 16:h=wi;break;case 536870912:h=ic;break;default:h=wi}h=l_(h,ZS.bind(null,i))}i.callbackPriority=l,i.callbackNode=h}}function ZS(i,l){if(Qc=-1,Jc=0,($e&6)!==0)throw Error(n(327));var h=i.callbackNode;if(Wi()&&i.callbackNode!==h)return null;var y=_i(i,i===_t?Et:0);if(y===0)return null;if((y&30)!==0||(y&i.expiredLanes)!==0||l)l=Zc(i,y);else{l=y;var _=$e;$e|=2;var E=n_();(_t!==i||Et!==l)&&(jr=null,Hi=rt()+500,Us(i,l));do try{a4();break}catch(H){t_(i,H)}while(!0);xh(),Wc.current=E,$e=_,ht!==null?l=0:(_t=null,Et=0,l=wt)}if(l!==0){if(l===2&&(_=Qo(i),_!==0&&(y=_,l=np(i,_))),l===1)throw h=Ca,Us(i,0),us(i,y),Gt(i,rt()),h;if(l===6)us(i,y);else{if(_=i.current.alternate,(y&30)===0&&!i4(_)&&(l=Zc(i,y),l===2&&(E=Qo(i),E!==0&&(y=E,l=np(i,E))),l===1))throw h=Ca,Us(i,0),us(i,y),Gt(i,rt()),h;switch(i.finishedWork=_,i.finishedLanes=y,l){case 0:case 1:throw Error(n(345));case 2:Hs(i,Kt,jr);break;case 3:if(us(i,y),(y&130023424)===y&&(l=Zh+500-rt(),10<l)){if(_i(i,0)!==0)break;if(_=i.suspendedLanes,(_&y)!==y){qt(),i.pingedLanes|=i.suspendedLanes&_;break}i.timeoutHandle=lh(Hs.bind(null,i,Kt,jr),l);break}Hs(i,Kt,jr);break;case 4:if(us(i,y),(y&4194240)===y)break;for(l=i.eventTimes,_=-1;0<y;){var A=31-nn(y);E=1<<A,A=l[A],A>_&&(_=A),y&=~E}if(y=_,y=rt()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*s4(y/1960))-y,10<y){i.timeoutHandle=lh(Hs.bind(null,i,Kt,jr),y);break}Hs(i,Kt,jr);break;case 5:Hs(i,Kt,jr);break;default:throw Error(n(329))}}}return Gt(i,rt()),i.callbackNode===h?ZS.bind(null,i):null}function np(i,l){var h=Ea;return i.current.memoizedState.isDehydrated&&(Us(i,l).flags|=256),i=Zc(i,l),i!==2&&(l=Kt,Kt=h,l!==null&&rp(l)),i}function rp(i){Kt===null?Kt=i:Kt.push.apply(Kt,i)}function i4(i){for(var l=i;;){if(l.flags&16384){var h=l.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var y=0;y<h.length;y++){var _=h[y],E=_.getSnapshot;_=_.value;try{if(!In(E(),_))return!1}catch{return!1}}}if(h=l.child,l.subtreeFlags&16384&&h!==null)h.return=l,l=h;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function us(i,l){for(l&=~Jh,l&=~Kc,i.suspendedLanes|=l,i.pingedLanes&=~l,i=i.expirationTimes;0<l;){var h=31-nn(l),y=1<<h;i[h]=-1,l&=~y}}function e_(i){if(($e&6)!==0)throw Error(n(327));Wi();var l=_i(i,0);if((l&1)===0)return Gt(i,rt()),null;var h=Zc(i,l);if(i.tag!==0&&h===2){var y=Qo(i);y!==0&&(l=y,h=np(i,y))}if(h===1)throw h=Ca,Us(i,0),us(i,l),Gt(i,rt()),h;if(h===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=l,Hs(i,Kt,jr),Gt(i,rt()),null}function sp(i,l){var h=$e;$e|=1;try{return i(l)}finally{$e=h,$e===0&&(Hi=rt()+500,Cc&&rs())}}function Vs(i){ls!==null&&ls.tag===0&&($e&6)===0&&Wi();var l=$e;$e|=1;var h=bn.transition,y=Ve;try{if(bn.transition=null,Ve=1,i)return i()}finally{Ve=y,bn.transition=h,$e=l,($e&6)===0&&rs()}}function ip(){an=Ui.current,Xe(Ui)}function Us(i,l){i.finishedWork=null,i.finishedLanes=0;var h=i.timeoutHandle;if(h!==-1&&(i.timeoutHandle=-1,P3(h)),ht!==null)for(h=ht.return;h!==null;){var y=h;switch(ph(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&Nc();break;case 3:Bi(),Xe(Ut),Xe(It),Eh();break;case 5:kh(y);break;case 4:Bi();break;case 13:Xe(st);break;case 19:Xe(st);break;case 10:wh(y.type._context);break;case 22:case 23:ip()}h=h.return}if(_t=i,ht=i=ds(i.current,null),Et=an=l,wt=0,Ca=null,Jh=Kc=zs=0,Kt=Ea=null,qs!==null){for(l=0;l<qs.length;l++)if(h=qs[l],y=h.interleaved,y!==null){h.interleaved=null;var _=y.next,E=h.pending;if(E!==null){var A=E.next;E.next=_,y.next=A}h.pending=y}qs=null}return i}function t_(i,l){do{var h=ht;try{if(xh(),Lc.current=Fc,Dc){for(var y=it.memoizedState;y!==null;){var _=y.queue;_!==null&&(_.pending=null),y=y.next}Dc=!1}if(Bs=0,St=xt=it=null,wa=!1,ba=0,Qh.current=null,h===null||h.return===null){wt=1,Ca=l,ht=null;break}e:{var E=i,A=h.return,H=h,Q=l;if(l=Et,H.flags|=32768,Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var se=Q,le=H,ce=le.tag;if((le.mode&1)===0&&(ce===0||ce===11||ce===15)){var ae=le.alternate;ae?(le.updateQueue=ae.updateQueue,le.memoizedState=ae.memoizedState,le.lanes=ae.lanes):(le.updateQueue=null,le.memoizedState=null)}var me=CS(A);if(me!==null){me.flags&=-257,ES(me,A,H,E,l),me.mode&1&&kS(E,se,l),l=me,Q=se;var we=l.updateQueue;if(we===null){var Se=new Set;Se.add(Q),l.updateQueue=Se}else we.add(Q);break e}else{if((l&1)===0){kS(E,se,l),op();break e}Q=Error(n(426))}}else if(Je&&H.mode&1){var lt=CS(A);if(lt!==null){(lt.flags&65536)===0&&(lt.flags|=256),ES(lt,A,H,E,l),yh(zi(Q,H));break e}}E=Q=zi(Q,H),wt!==4&&(wt=2),Ea===null?Ea=[E]:Ea.push(E),E=A;do{switch(E.tag){case 3:E.flags|=65536,l&=-l,E.lanes|=l;var ne=_S(E,Q,l);X1(E,ne);break e;case 1:H=Q;var Z=E.type,re=E.stateNode;if((E.flags&128)===0&&(typeof Z.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(as===null||!as.has(re)))){E.flags|=65536,l&=-l,E.lanes|=l;var de=NS(E,H,l);X1(E,de);break e}}E=E.return}while(E!==null)}s_(h)}catch(Ne){l=Ne,ht===h&&h!==null&&(ht=h=h.return);continue}break}while(!0)}function n_(){var i=Wc.current;return Wc.current=Fc,i===null?Fc:i}function op(){(wt===0||wt===3||wt===2)&&(wt=4),_t===null||(zs&268435455)===0&&(Kc&268435455)===0||us(_t,Et)}function Zc(i,l){var h=$e;$e|=2;var y=n_();(_t!==i||Et!==l)&&(jr=null,Us(i,l));do try{o4();break}catch(_){t_(i,_)}while(!0);if(xh(),$e=h,Wc.current=y,ht!==null)throw Error(n(261));return _t=null,Et=0,wt}function o4(){for(;ht!==null;)r_(ht)}function a4(){for(;ht!==null&&!Rf();)r_(ht)}function r_(i){var l=a_(i.alternate,i,an);i.memoizedProps=i.pendingProps,l===null?s_(i):ht=l,Qh.current=null}function s_(i){var l=i;do{var h=l.alternate;if(i=l.return,(l.flags&32768)===0){if(h=Z3(h,l,an),h!==null){ht=h;return}}else{if(h=e4(h,l),h!==null){h.flags&=32767,ht=h;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{wt=6,ht=null;return}}if(l=l.sibling,l!==null){ht=l;return}ht=l=i}while(l!==null);wt===0&&(wt=5)}function Hs(i,l,h){var y=Ve,_=bn.transition;try{bn.transition=null,Ve=1,l4(i,l,h,y)}finally{bn.transition=_,Ve=y}return null}function l4(i,l,h,y){do Wi();while(ls!==null);if(($e&6)!==0)throw Error(n(327));h=i.finishedWork;var _=i.finishedLanes;if(h===null)return null;if(i.finishedWork=null,i.finishedLanes=0,h===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var E=h.lanes|h.childLanes;if(ac(i,E),i===_t&&(ht=_t=null,Et=0),(h.subtreeFlags&2064)===0&&(h.flags&2064)===0||Yc||(Yc=!0,l_(wi,function(){return Wi(),null})),E=(h.flags&15990)!==0,(h.subtreeFlags&15990)!==0||E){E=bn.transition,bn.transition=null;var A=Ve;Ve=1;var H=$e;$e|=4,Qh.current=null,n4(i,h),GS(h,i),j3(oh),uc=!!ih,oh=ih=null,i.current=h,r4(h),rc(),$e=H,Ve=A,bn.transition=E}else i.current=h;if(Yc&&(Yc=!1,ls=i,Xc=_),E=i.pendingLanes,E===0&&(as=null),Af(h.stateNode),Gt(i,rt()),l!==null)for(y=i.onRecoverableError,h=0;h<l.length;h++)_=l[h],y(_.value,{componentStack:_.stack,digest:_.digest});if(Gc)throw Gc=!1,i=ep,ep=null,i;return(Xc&1)!==0&&i.tag!==0&&Wi(),E=i.pendingLanes,(E&1)!==0?i===tp?ja++:(ja=0,tp=i):ja=0,rs(),null}function Wi(){if(ls!==null){var i=Wb(Xc),l=bn.transition,h=Ve;try{if(bn.transition=null,Ve=16>i?16:i,ls===null)var y=!1;else{if(i=ls,ls=null,Xc=0,($e&6)!==0)throw Error(n(331));var _=$e;for($e|=4,ye=i.current;ye!==null;){var E=ye,A=E.child;if((ye.flags&16)!==0){var H=E.deletions;if(H!==null){for(var Q=0;Q<H.length;Q++){var se=H[Q];for(ye=se;ye!==null;){var le=ye;switch(le.tag){case 0:case 11:case 15:ka(8,le,E)}var ce=le.child;if(ce!==null)ce.return=le,ye=ce;else for(;ye!==null;){le=ye;var ae=le.sibling,me=le.return;if(VS(le),le===se){ye=null;break}if(ae!==null){ae.return=me,ye=ae;break}ye=me}}}var we=E.alternate;if(we!==null){var Se=we.child;if(Se!==null){we.child=null;do{var lt=Se.sibling;Se.sibling=null,Se=lt}while(Se!==null)}}ye=E}}if((E.subtreeFlags&2064)!==0&&A!==null)A.return=E,ye=A;else e:for(;ye!==null;){if(E=ye,(E.flags&2048)!==0)switch(E.tag){case 0:case 11:case 15:ka(9,E,E.return)}var ne=E.sibling;if(ne!==null){ne.return=E.return,ye=ne;break e}ye=E.return}}var Z=i.current;for(ye=Z;ye!==null;){A=ye;var re=A.child;if((A.subtreeFlags&2064)!==0&&re!==null)re.return=A,ye=re;else e:for(A=Z;ye!==null;){if(H=ye,(H.flags&2048)!==0)try{switch(H.tag){case 0:case 11:case 15:Hc(9,H)}}catch(Ne){at(H,H.return,Ne)}if(H===A){ye=null;break e}var de=H.sibling;if(de!==null){de.return=H.return,ye=de;break e}ye=H.return}}if($e=_,rs(),gn&&typeof gn.onPostCommitFiberRoot=="function")try{gn.onPostCommitFiberRoot(Ms,i)}catch{}y=!0}return y}finally{Ve=h,bn.transition=l}}return!1}function i_(i,l,h){l=zi(h,l),l=_S(i,l,1),i=is(i,l,1),l=qt(),i!==null&&(Os(i,1,l),Gt(i,l))}function at(i,l,h){if(i.tag===3)i_(i,i,h);else for(;l!==null;){if(l.tag===3){i_(l,i,h);break}else if(l.tag===1){var y=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(as===null||!as.has(y))){i=zi(h,i),i=NS(l,i,1),l=is(l,i,1),i=qt(),l!==null&&(Os(l,1,i),Gt(l,i));break}}l=l.return}}function c4(i,l,h){var y=i.pingCache;y!==null&&y.delete(l),l=qt(),i.pingedLanes|=i.suspendedLanes&h,_t===i&&(Et&h)===h&&(wt===4||wt===3&&(Et&130023424)===Et&&500>rt()-Zh?Us(i,0):Jh|=h),Gt(i,l)}function o_(i,l){l===0&&((i.mode&1)===0?l=1:(l=Si,Si<<=1,(Si&130023424)===0&&(Si=4194304)));var h=qt();i=kr(i,l),i!==null&&(Os(i,l,h),Gt(i,h))}function u4(i){var l=i.memoizedState,h=0;l!==null&&(h=l.retryLane),o_(i,h)}function d4(i,l){var h=0;switch(i.tag){case 13:var y=i.stateNode,_=i.memoizedState;_!==null&&(h=_.retryLane);break;case 19:y=i.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(l),o_(i,h)}var a_;a_=function(i,l,h){if(i!==null)if(i.memoizedProps!==l.pendingProps||Ut.current)Wt=!0;else{if((i.lanes&h)===0&&(l.flags&128)===0)return Wt=!1,J3(i,l,h);Wt=(i.flags&131072)!==0}else Wt=!1,Je&&(l.flags&1048576)!==0&&F1(l,jc,l.index);switch(l.lanes=0,l.tag){case 2:var y=l.type;Vc(i,l),i=l.pendingProps;var _=Oi(l,It.current);Fi(l,h),_=Th(null,l,y,i,_,h);var E=Ih();return l.flags|=1,typeof _=="object"&&_!==null&&typeof _.render=="function"&&_.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Ht(y)?(E=!0,kc(l)):E=!1,l.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_h(l),_.updater=Bc,l.stateNode=_,_._reactInternals=l,Dh(l,y,i,h),l=Bh(null,l,y,!0,E,h)):(l.tag=0,Je&&E&&hh(l),$t(null,l,_,h),l=l.child),l;case 16:y=l.elementType;e:{switch(Vc(i,l),i=l.pendingProps,_=y._init,y=_(y._payload),l.type=y,_=l.tag=h4(y),i=Mn(y,i),_){case 0:l=Fh(null,l,y,i,h);break e;case 1:l=MS(null,l,y,i,h);break e;case 11:l=jS(null,l,y,i,h);break e;case 14:l=RS(null,l,y,Mn(y.type,i),h);break e}throw Error(n(306,y,""))}return l;case 0:return y=l.type,_=l.pendingProps,_=l.elementType===y?_:Mn(y,_),Fh(i,l,y,_,h);case 1:return y=l.type,_=l.pendingProps,_=l.elementType===y?_:Mn(y,_),MS(i,l,y,_,h);case 3:e:{if(OS(l),i===null)throw Error(n(387));y=l.pendingProps,E=l.memoizedState,_=E.element,Y1(i,l),Oc(l,y,null,h);var A=l.memoizedState;if(y=A.element,E.isDehydrated)if(E={element:y,isDehydrated:!1,cache:A.cache,pendingSuspenseBoundaries:A.pendingSuspenseBoundaries,transitions:A.transitions},l.updateQueue.baseState=E,l.memoizedState=E,l.flags&256){_=zi(Error(n(423)),l),l=PS(i,l,y,h,_);break e}else if(y!==_){_=zi(Error(n(424)),l),l=PS(i,l,y,h,_);break e}else for(on=es(l.stateNode.containerInfo.firstChild),sn=l,Je=!0,An=null,h=K1(l,null,y,h),l.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Di(),y===_){l=Er(i,l,h);break e}$t(i,l,y,h)}l=l.child}return l;case 5:return J1(l),i===null&&gh(l),y=l.type,_=l.pendingProps,E=i!==null?i.memoizedProps:null,A=_.children,ah(y,_)?A=null:E!==null&&ah(y,E)&&(l.flags|=32),AS(i,l),$t(i,l,A,h),l.child;case 6:return i===null&&gh(l),null;case 13:return LS(i,l,h);case 4:return Nh(l,l.stateNode.containerInfo),y=l.pendingProps,i===null?l.child=$i(l,null,y,h):$t(i,l,y,h),l.child;case 11:return y=l.type,_=l.pendingProps,_=l.elementType===y?_:Mn(y,_),jS(i,l,y,_,h);case 7:return $t(i,l,l.pendingProps,h),l.child;case 8:return $t(i,l,l.pendingProps.children,h),l.child;case 12:return $t(i,l,l.pendingProps.children,h),l.child;case 10:e:{if(y=l.type._context,_=l.pendingProps,E=l.memoizedProps,A=_.value,Ke(Ic,y._currentValue),y._currentValue=A,E!==null)if(In(E.value,A)){if(E.children===_.children&&!Ut.current){l=Er(i,l,h);break e}}else for(E=l.child,E!==null&&(E.return=l);E!==null;){var H=E.dependencies;if(H!==null){A=E.child;for(var Q=H.firstContext;Q!==null;){if(Q.context===y){if(E.tag===1){Q=Cr(-1,h&-h),Q.tag=2;var se=E.updateQueue;if(se!==null){se=se.shared;var le=se.pending;le===null?Q.next=Q:(Q.next=le.next,le.next=Q),se.pending=Q}}E.lanes|=h,Q=E.alternate,Q!==null&&(Q.lanes|=h),bh(E.return,h,l),H.lanes|=h;break}Q=Q.next}}else if(E.tag===10)A=E.type===l.type?null:E.child;else if(E.tag===18){if(A=E.return,A===null)throw Error(n(341));A.lanes|=h,H=A.alternate,H!==null&&(H.lanes|=h),bh(A,h,l),A=E.sibling}else A=E.child;if(A!==null)A.return=E;else for(A=E;A!==null;){if(A===l){A=null;break}if(E=A.sibling,E!==null){E.return=A.return,A=E;break}A=A.return}E=A}$t(i,l,_.children,h),l=l.child}return l;case 9:return _=l.type,y=l.pendingProps.children,Fi(l,h),_=xn(_),y=y(_),l.flags|=1,$t(i,l,y,h),l.child;case 14:return y=l.type,_=Mn(y,l.pendingProps),_=Mn(y.type,_),RS(i,l,y,_,h);case 15:return TS(i,l,l.type,l.pendingProps,h);case 17:return y=l.type,_=l.pendingProps,_=l.elementType===y?_:Mn(y,_),Vc(i,l),l.tag=1,Ht(y)?(i=!0,kc(l)):i=!1,Fi(l,h),bS(l,y,_),Dh(l,y,_,h),Bh(null,l,y,!0,i,h);case 19:return $S(i,l,h);case 22:return IS(i,l,h)}throw Error(n(156,l.tag))};function l_(i,l){return tc(i,l)}function f4(i,l,h,y){this.tag=i,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Sn(i,l,h,y){return new f4(i,l,h,y)}function ap(i){return i=i.prototype,!(!i||!i.isReactComponent)}function h4(i){if(typeof i=="function")return ap(i)?1:0;if(i!=null){if(i=i.$$typeof,i===L)return 11;if(i===z)return 14}return 2}function ds(i,l){var h=i.alternate;return h===null?(h=Sn(i.tag,l,i.key,i.mode),h.elementType=i.elementType,h.type=i.type,h.stateNode=i.stateNode,h.alternate=i,i.alternate=h):(h.pendingProps=l,h.type=i.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=i.flags&14680064,h.childLanes=i.childLanes,h.lanes=i.lanes,h.child=i.child,h.memoizedProps=i.memoizedProps,h.memoizedState=i.memoizedState,h.updateQueue=i.updateQueue,l=i.dependencies,h.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},h.sibling=i.sibling,h.index=i.index,h.ref=i.ref,h}function eu(i,l,h,y,_,E){var A=2;if(y=i,typeof i=="function")ap(i)&&(A=1);else if(typeof i=="string")A=5;else e:switch(i){case I:return Ws(h.children,_,E,l);case O:A=8,_|=8;break;case P:return i=Sn(12,h,l,_|2),i.elementType=P,i.lanes=E,i;case U:return i=Sn(13,h,l,_),i.elementType=U,i.lanes=E,i;case $:return i=Sn(19,h,l,_),i.elementType=$,i.lanes=E,i;case G:return tu(h,_,E,l);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case B:A=10;break e;case M:A=9;break e;case L:A=11;break e;case z:A=14;break e;case V:A=16,y=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return l=Sn(A,h,l,_),l.elementType=i,l.type=y,l.lanes=E,l}function Ws(i,l,h,y){return i=Sn(7,i,y,l),i.lanes=h,i}function tu(i,l,h,y){return i=Sn(22,i,y,l),i.elementType=G,i.lanes=h,i.stateNode={isHidden:!1},i}function lp(i,l,h){return i=Sn(6,i,null,l),i.lanes=h,i}function cp(i,l,h){return l=Sn(4,i.children!==null?i.children:[],i.key,l),l.lanes=h,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}function p4(i,l,h,y,_){this.tag=l,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Jo(0),this.expirationTimes=Jo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jo(0),this.identifierPrefix=y,this.onRecoverableError=_,this.mutableSourceEagerHydrationData=null}function up(i,l,h,y,_,E,A,H,Q){return i=new p4(i,l,h,H,Q),l===1?(l=1,E===!0&&(l|=8)):l=0,E=Sn(3,null,null,l),i.current=E,E.stateNode=i,E.memoizedState={element:y,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},_h(E),i}function m4(i,l,h){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:y==null?null:""+y,children:i,containerInfo:l,implementation:h}}function c_(i){if(!i)return ns;i=i._reactInternals;e:{if(Jn(i)!==i||i.tag!==1)throw Error(n(170));var l=i;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(Ht(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(i.tag===1){var h=i.type;if(Ht(h))return D1(i,h,l)}return l}function u_(i,l,h,y,_,E,A,H,Q){return i=up(h,y,!0,i,_,E,A,H,Q),i.context=c_(null),h=i.current,y=qt(),_=cs(h),E=Cr(y,_),E.callback=l??null,is(h,E,_),i.current.lanes=_,Os(i,_,y),Gt(i,y),i}function nu(i,l,h,y){var _=l.current,E=qt(),A=cs(_);return h=c_(h),l.context===null?l.context=h:l.pendingContext=h,l=Cr(E,A),l.payload={element:i},y=y===void 0?null:y,y!==null&&(l.callback=y),i=is(_,l,A),i!==null&&(Ln(i,_,A,E),Mc(i,_,A)),A}function ru(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function d_(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var h=i.retryLane;i.retryLane=h!==0&&h<l?h:l}}function dp(i,l){d_(i,l),(i=i.alternate)&&d_(i,l)}function g4(){return null}var f_=typeof reportError=="function"?reportError:function(i){console.error(i)};function fp(i){this._internalRoot=i}su.prototype.render=fp.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(n(409));nu(i,l,null,null)},su.prototype.unmount=fp.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;Vs(function(){nu(null,i,null,null)}),l[br]=null}};function su(i){this._internalRoot=i}su.prototype.unstable_scheduleHydration=function(i){if(i){var l=Yb();i={blockedOn:null,target:i,priority:l};for(var h=0;h<Qr.length&&l!==0&&l<Qr[h].priority;h++);Qr.splice(h,0,i),h===0&&Jb(i)}};function hp(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function iu(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function h_(){}function y4(i,l,h,y,_){if(_){if(typeof y=="function"){var E=y;y=function(){var se=ru(A);E.call(se)}}var A=u_(l,y,i,0,null,!1,!1,"",h_);return i._reactRootContainer=A,i[br]=A.current,fa(i.nodeType===8?i.parentNode:i),Vs(),A}for(;_=i.lastChild;)i.removeChild(_);if(typeof y=="function"){var H=y;y=function(){var se=ru(Q);H.call(se)}}var Q=up(i,0,!1,null,null,!1,!1,"",h_);return i._reactRootContainer=Q,i[br]=Q.current,fa(i.nodeType===8?i.parentNode:i),Vs(function(){nu(l,Q,h,y)}),Q}function ou(i,l,h,y,_){var E=h._reactRootContainer;if(E){var A=E;if(typeof _=="function"){var H=_;_=function(){var Q=ru(A);H.call(Q)}}nu(l,A,i,_)}else A=y4(h,l,i,_,y);return ru(A)}Kb=function(i){switch(i.tag){case 3:var l=i.stateNode;if(l.current.memoizedState.isDehydrated){var h=Zn(l.pendingLanes);h!==0&&(Df(l,h|1),Gt(l,rt()),($e&6)===0&&(Hi=rt()+500,rs()))}break;case 13:Vs(function(){var y=kr(i,1);if(y!==null){var _=qt();Ln(y,i,1,_)}}),dp(i,1)}},$f=function(i){if(i.tag===13){var l=kr(i,134217728);if(l!==null){var h=qt();Ln(l,i,134217728,h)}dp(i,134217728)}},Gb=function(i){if(i.tag===13){var l=cs(i),h=kr(i,l);if(h!==null){var y=qt();Ln(h,i,l,y)}dp(i,l)}},Yb=function(){return Ve},Xb=function(i,l){var h=Ve;try{return Ve=i,l()}finally{Ve=h}},mn=function(i,l,h){switch(l){case"input":if(ke(i,h),l=h.name,h.type==="radio"&&l!=null){for(h=i;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<h.length;l++){var y=h[l];if(y!==i&&y.form===i.form){var _=_c(y);if(!_)throw Error(n(90));xe(y),ke(y,_)}}}break;case"textarea":hn(i,h);break;case"select":l=h.value,l!=null&&Pe(i,!!h.multiple,l,!1)}},Xl=sp,Ql=Vs;var v4={usingClientEntryPoint:!1,Events:[ma,Ai,_c,Gl,Yl,sp]},Ra={findFiberByHostInstance:Ps,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},x4={bundleType:Ra.bundleType,version:Ra.version,rendererPackageName:Ra.rendererPackageName,rendererConfig:Ra.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=Zl(i),i===null?null:i.stateNode},findFiberByHostInstance:Ra.findFiberByHostInstance||g4,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 au=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!au.isDisabled&&au.supportsFiber)try{Ms=au.inject(x4),gn=au}catch{}}return Yt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=v4,Yt.createPortal=function(i,l){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!hp(l))throw Error(n(200));return m4(i,l,null,h)},Yt.createRoot=function(i,l){if(!hp(i))throw Error(n(299));var h=!1,y="",_=f_;return l!=null&&(l.unstable_strictMode===!0&&(h=!0),l.identifierPrefix!==void 0&&(y=l.identifierPrefix),l.onRecoverableError!==void 0&&(_=l.onRecoverableError)),l=up(i,1,!1,null,null,h,!1,y,_),i[br]=l.current,fa(i.nodeType===8?i.parentNode:i),new fp(l)},Yt.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=Zl(l),i=i===null?null:i.stateNode,i},Yt.flushSync=function(i){return Vs(i)},Yt.hydrate=function(i,l,h){if(!iu(l))throw Error(n(200));return ou(null,i,l,!0,h)},Yt.hydrateRoot=function(i,l,h){if(!hp(i))throw Error(n(405));var y=h!=null&&h.hydratedSources||null,_=!1,E="",A=f_;if(h!=null&&(h.unstable_strictMode===!0&&(_=!0),h.identifierPrefix!==void 0&&(E=h.identifierPrefix),h.onRecoverableError!==void 0&&(A=h.onRecoverableError)),l=u_(l,null,i,1,h??null,_,!1,E,A),i[br]=l.current,fa(i),y)for(i=0;i<y.length;i++)h=y[i],_=h._getVersion,_=_(h._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[h,_]:l.mutableSourceEagerHydrationData.push(h,_);return new su(l)},Yt.render=function(i,l,h){if(!iu(l))throw Error(n(200));return ou(null,i,l,!1,h)},Yt.unmountComponentAtNode=function(i){if(!iu(i))throw Error(n(40));return i._reactRootContainer?(Vs(function(){ou(null,null,i,!1,function(){i._reactRootContainer=null,i[br]=null})}),!0):!1},Yt.unstable_batchedUpdates=sp,Yt.unstable_renderSubtreeIntoContainer=function(i,l,h,y){if(!iu(h))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return ou(i,l,h,!1,y)},Yt.version="18.3.1-next-f1338f8080-20240426",Yt}var b_;function fT(){if(b_)return gp.exports;b_=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),gp.exports=E4(),gp.exports}var S_;function j4(){if(S_)return cu;S_=1;var e=fT();return cu.createRoot=e.createRoot,cu.hydrateRoot=e.hydrateRoot,cu}var R4=j4();const T4=wl(R4);function gt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=gt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var I4={value:()=>{}};function kd(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Lu(n)}function Lu(e){this._=e}function A4(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Lu.prototype=kd.prototype={constructor:Lu,on:function(e,t){var n=this._,r=A4(e+"",n),s,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((s=(e=r[o]).type)&&(s=M4(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(s=(e=r[o]).type)n[s]=__(n[s],e.name,t);else if(t==null)for(s in n)n[s]=__(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Lu(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,o;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,s=o.length;r<s;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,o=r.length;s<o;++s)r[s].value.apply(t,n)}};function M4(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function __(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=I4,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var S0="http://www.w3.org/1999/xhtml";const N_={svg:"http://www.w3.org/2000/svg",xhtml:S0,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Cd(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),N_.hasOwnProperty(t)?{space:N_[t],local:e}:e}function O4(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===S0&&t.documentElement.namespaceURI===S0?t.createElement(e):t.createElementNS(n,e)}}function P4(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function hT(e){var t=Cd(e);return(t.local?P4:O4)(t)}function L4(){}function uw(e){return e==null?L4:function(){return this.querySelector(e)}}function D4(e){typeof e!="function"&&(e=uw(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],a=o.length,c=r[s]=new Array(a),u,f,m=0;m<a;++m)(u=o[m])&&(f=e.call(u,u.__data__,m,o))&&("__data__"in u&&(f.__data__=u.__data__),c[m]=f);return new fn(r,this._parents)}function $4(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function q4(){return[]}function pT(e){return e==null?q4:function(){return this.querySelectorAll(e)}}function F4(e){return function(){return $4(e.apply(this,arguments))}}function B4(e){typeof e=="function"?e=F4(e):e=pT(e);for(var t=this._groups,n=t.length,r=[],s=[],o=0;o<n;++o)for(var a=t[o],c=a.length,u,f=0;f<c;++f)(u=a[f])&&(r.push(e.call(u,u.__data__,f,a)),s.push(u));return new fn(r,s)}function mT(e){return function(){return this.matches(e)}}function gT(e){return function(t){return t.matches(e)}}var z4=Array.prototype.find;function V4(e){return function(){return z4.call(this.children,e)}}function U4(){return this.firstElementChild}function H4(e){return this.select(e==null?U4:V4(typeof e=="function"?e:gT(e)))}var W4=Array.prototype.filter;function K4(){return Array.from(this.children)}function G4(e){return function(){return W4.call(this.children,e)}}function Y4(e){return this.selectAll(e==null?K4:G4(typeof e=="function"?e:gT(e)))}function X4(e){typeof e!="function"&&(e=mT(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],a=o.length,c=r[s]=[],u,f=0;f<a;++f)(u=o[f])&&e.call(u,u.__data__,f,o)&&c.push(u);return new fn(r,this._parents)}function yT(e){return new Array(e.length)}function Q4(){return new fn(this._enter||this._groups.map(yT),this._parents)}function Ju(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ju.prototype={constructor:Ju,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function J4(e){return function(){return e}}function Z4(e,t,n,r,s,o){for(var a=0,c,u=t.length,f=o.length;a<f;++a)(c=t[a])?(c.__data__=o[a],r[a]=c):n[a]=new Ju(e,o[a]);for(;a<u;++a)(c=t[a])&&(s[a]=c)}function e5(e,t,n,r,s,o,a){var c,u,f=new Map,m=t.length,p=o.length,g=new Array(m),v;for(c=0;c<m;++c)(u=t[c])&&(g[c]=v=a.call(u,u.__data__,c,t)+"",f.has(v)?s[c]=u:f.set(v,u));for(c=0;c<p;++c)v=a.call(e,o[c],c,o)+"",(u=f.get(v))?(r[c]=u,u.__data__=o[c],f.delete(v)):n[c]=new Ju(e,o[c]);for(c=0;c<m;++c)(u=t[c])&&f.get(g[c])===u&&(s[c]=u)}function t5(e){return e.__data__}function n5(e,t){if(!arguments.length)return Array.from(this,t5);var n=t?e5:Z4,r=this._parents,s=this._groups;typeof e!="function"&&(e=J4(e));for(var o=s.length,a=new Array(o),c=new Array(o),u=new Array(o),f=0;f<o;++f){var m=r[f],p=s[f],g=p.length,v=r5(e.call(m,m&&m.__data__,f,r)),b=v.length,w=c[f]=new Array(b),x=a[f]=new Array(b),S=u[f]=new Array(g);n(m,p,w,x,S,v,t);for(var k=0,N=0,C,R;k<b;++k)if(C=w[k]){for(k>=N&&(N=k+1);!(R=x[N])&&++N<b;);C._next=R||null}}return a=new fn(a,r),a._enter=c,a._exit=u,a}function r5(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function s5(){return new fn(this._exit||this._groups.map(yT),this._parents)}function i5(e,t,n){var r=this.enter(),s=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?o.remove():n(o),r&&s?r.merge(s).order():s}function o5(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,o=r.length,a=Math.min(s,o),c=new Array(s),u=0;u<a;++u)for(var f=n[u],m=r[u],p=f.length,g=c[u]=new Array(p),v,b=0;b<p;++b)(v=f[b]||m[b])&&(g[b]=v);for(;u<s;++u)c[u]=n[u];return new fn(c,this._parents)}function a5(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,o=r[s],a;--s>=0;)(a=r[s])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function l5(e){e||(e=c5);function t(p,g){return p&&g?e(p.__data__,g.__data__):!p-!g}for(var n=this._groups,r=n.length,s=new Array(r),o=0;o<r;++o){for(var a=n[o],c=a.length,u=s[o]=new Array(c),f,m=0;m<c;++m)(f=a[m])&&(u[m]=f);u.sort(t)}return new fn(s,this._parents).order()}function c5(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function u5(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function d5(){return Array.from(this)}function f5(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length;s<o;++s){var a=r[s];if(a)return a}return null}function h5(){let e=0;for(const t of this)++e;return e}function p5(){return!this.node()}function m5(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],o=0,a=s.length,c;o<a;++o)(c=s[o])&&e.call(c,c.__data__,o,s);return this}function g5(e){return function(){this.removeAttribute(e)}}function y5(e){return function(){this.removeAttributeNS(e.space,e.local)}}function v5(e,t){return function(){this.setAttribute(e,t)}}function x5(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function w5(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function b5(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function S5(e,t){var n=Cd(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?y5:g5:typeof t=="function"?n.local?b5:w5:n.local?x5:v5)(n,t))}function vT(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function _5(e){return function(){this.style.removeProperty(e)}}function N5(e,t,n){return function(){this.style.setProperty(e,t,n)}}function k5(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function C5(e,t,n){return arguments.length>1?this.each((t==null?_5:typeof t=="function"?k5:N5)(e,t,n??"")):mo(this.node(),e)}function mo(e,t){return e.style.getPropertyValue(t)||vT(e).getComputedStyle(e,null).getPropertyValue(t)}function E5(e){return function(){delete this[e]}}function j5(e,t){return function(){this[e]=t}}function R5(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function T5(e,t){return arguments.length>1?this.each((t==null?E5:typeof t=="function"?R5:j5)(e,t)):this.node()[e]}function xT(e){return e.trim().split(/^|\s+/)}function dw(e){return e.classList||new wT(e)}function wT(e){this._node=e,this._names=xT(e.getAttribute("class")||"")}wT.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function bT(e,t){for(var n=dw(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function ST(e,t){for(var n=dw(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function I5(e){return function(){bT(this,e)}}function A5(e){return function(){ST(this,e)}}function M5(e,t){return function(){(t.apply(this,arguments)?bT:ST)(this,e)}}function O5(e,t){var n=xT(e+"");if(arguments.length<2){for(var r=dw(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?M5:t?I5:A5)(n,t))}function P5(){this.textContent=""}function L5(e){return function(){this.textContent=e}}function D5(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function $5(e){return arguments.length?this.each(e==null?P5:(typeof e=="function"?D5:L5)(e)):this.node().textContent}function q5(){this.innerHTML=""}function F5(e){return function(){this.innerHTML=e}}function B5(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function z5(e){return arguments.length?this.each(e==null?q5:(typeof e=="function"?B5:F5)(e)):this.node().innerHTML}function V5(){this.nextSibling&&this.parentNode.appendChild(this)}function U5(){return this.each(V5)}function H5(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function W5(){return this.each(H5)}function K5(e){var t=typeof e=="function"?e:hT(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function G5(){return null}function Y5(e,t){var n=typeof e=="function"?e:hT(e),r=t==null?G5:typeof t=="function"?t:uw(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function X5(){var e=this.parentNode;e&&e.removeChild(this)}function Q5(){return this.each(X5)}function J5(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Z5(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eD(e){return this.select(e?Z5:J5)}function tD(e){return arguments.length?this.property("__data__",e):this.node().__data__}function nD(e){return function(t){e.call(this,t,this.__data__)}}function rD(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function sD(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,o;n<s;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function iD(e,t,n){return function(){var r=this.__on,s,o=nD(t);if(r){for(var a=0,c=r.length;a<c;++a)if((s=r[a]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=n),s.value=t;return}}this.addEventListener(e.type,o,n),s={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(s):this.__on=[s]}}function oD(e,t,n){var r=rD(e+""),s,o=r.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var u=0,f=c.length,m;u<f;++u)for(s=0,m=c[u];s<o;++s)if((a=r[s]).type===m.type&&a.name===m.name)return m.value}return}for(c=t?iD:sD,s=0;s<o;++s)this.each(c(r[s],t,n));return this}function _T(e,t,n){var r=vT(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function aD(e,t){return function(){return _T(this,e,t)}}function lD(e,t){return function(){return _T(this,e,t.apply(this,arguments))}}function cD(e,t){return this.each((typeof t=="function"?lD:aD)(e,t))}function*uD(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length,a;s<o;++s)(a=r[s])&&(yield a)}var NT=[null];function fn(e,t){this._groups=e,this._parents=t}function Sl(){return new fn([[document.documentElement]],NT)}function dD(){return this}fn.prototype=Sl.prototype={constructor:fn,select:D4,selectAll:B4,selectChild:H4,selectChildren:Y4,filter:X4,data:n5,enter:Q4,exit:s5,join:i5,merge:o5,selection:dD,order:a5,sort:l5,call:u5,nodes:d5,node:f5,size:h5,empty:p5,each:m5,attr:S5,style:C5,property:T5,classed:O5,text:$5,html:z5,raise:U5,lower:W5,append:K5,insert:Y5,remove:Q5,clone:eD,datum:tD,on:oD,dispatch:cD,[Symbol.iterator]:uD};function un(e){return typeof e=="string"?new fn([[document.querySelector(e)]],[document.documentElement]):new fn([[e]],NT)}function fD(e){let t;for(;t=e.sourceEvent;)e=t;return e}function qn(e,t){if(e=fD(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const hD={passive:!1},nl={capture:!0,passive:!1};function xp(e){e.stopImmediatePropagation()}function ao(e){e.preventDefault(),e.stopImmediatePropagation()}function kT(e){var t=e.document.documentElement,n=un(e).on("dragstart.drag",ao,nl);"onselectstart"in t?n.on("selectstart.drag",ao,nl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function CT(e,t){var n=e.document.documentElement,r=un(e).on("dragstart.drag",null);t&&(r.on("click.drag",ao,nl),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const uu=e=>()=>e;function _0(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:o,x:a,y:c,dx:u,dy:f,dispatch:m}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:m}})}_0.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function pD(e){return!e.ctrlKey&&!e.button}function mD(){return this.parentNode}function gD(e,t){return t??{x:e.x,y:e.y}}function yD(){return navigator.maxTouchPoints||"ontouchstart"in this}function ET(){var e=pD,t=mD,n=gD,r=yD,s={},o=kd("start","drag","end"),a=0,c,u,f,m,p=0;function g(C){C.on("mousedown.drag",v).filter(r).on("touchstart.drag",x).on("touchmove.drag",S,hD).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(C,R){if(!(m||!e.call(this,C,R))){var T=N(this,t.call(this,C,R),C,R,"mouse");T&&(un(C.view).on("mousemove.drag",b,nl).on("mouseup.drag",w,nl),kT(C.view),xp(C),f=!1,c=C.clientX,u=C.clientY,T("start",C))}}function b(C){if(ao(C),!f){var R=C.clientX-c,T=C.clientY-u;f=R*R+T*T>p}s.mouse("drag",C)}function w(C){un(C.view).on("mousemove.drag mouseup.drag",null),CT(C.view,f),ao(C),s.mouse("end",C)}function x(C,R){if(e.call(this,C,R)){var T=C.changedTouches,I=t.call(this,C,R),O=T.length,P,B;for(P=0;P<O;++P)(B=N(this,I,C,R,T[P].identifier,T[P]))&&(xp(C),B("start",C,T[P]))}}function S(C){var R=C.changedTouches,T=R.length,I,O;for(I=0;I<T;++I)(O=s[R[I].identifier])&&(ao(C),O("drag",C,R[I]))}function k(C){var R=C.changedTouches,T=R.length,I,O;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),I=0;I<T;++I)(O=s[R[I].identifier])&&(xp(C),O("end",C,R[I]))}function N(C,R,T,I,O,P){var B=o.copy(),M=qn(P||T,R),L,U,$;if(($=n.call(C,new _0("beforestart",{sourceEvent:T,target:g,identifier:O,active:a,x:M[0],y:M[1],dx:0,dy:0,dispatch:B}),I))!=null)return L=$.x-M[0]||0,U=$.y-M[1]||0,function z(V,G,F){var q=M,X;switch(V){case"start":s[O]=z,X=a++;break;case"end":delete s[O],--a;case"drag":M=qn(F||G,R),X=a;break}B.call(V,C,new _0(V,{sourceEvent:G,subject:$,target:g,identifier:O,active:X,x:M[0]+L,y:M[1]+U,dx:M[0]-q[0],dy:M[1]-q[1],dispatch:B}),I)}}return g.filter=function(C){return arguments.length?(e=typeof C=="function"?C:uu(!!C),g):e},g.container=function(C){return arguments.length?(t=typeof C=="function"?C:uu(C),g):t},g.subject=function(C){return arguments.length?(n=typeof C=="function"?C:uu(C),g):n},g.touchable=function(C){return arguments.length?(r=typeof C=="function"?C:uu(!!C),g):r},g.on=function(){var C=o.on.apply(o,arguments);return C===o?g:C},g.clickDistance=function(C){return arguments.length?(p=(C=+C)*C,g):Math.sqrt(p)},g}function fw(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function jT(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function _l(){}var rl=.7,Zu=1/rl,lo="\\s*([+-]?\\d+)\\s*",sl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",cr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",vD=/^#([0-9a-f]{3,8})$/,xD=new RegExp(`^rgb\\(${lo},${lo},${lo}\\)$`),wD=new RegExp(`^rgb\\(${cr},${cr},${cr}\\)$`),bD=new RegExp(`^rgba\\(${lo},${lo},${lo},${sl}\\)$`),SD=new RegExp(`^rgba\\(${cr},${cr},${cr},${sl}\\)$`),_D=new RegExp(`^hsl\\(${sl},${cr},${cr}\\)$`),ND=new RegExp(`^hsla\\(${sl},${cr},${cr},${sl}\\)$`),k_={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};fw(_l,ei,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:C_,formatHex:C_,formatHex8:kD,formatHsl:CD,formatRgb:E_,toString:E_});function C_(){return this.rgb().formatHex()}function kD(){return this.rgb().formatHex8()}function CD(){return RT(this).formatHsl()}function E_(){return this.rgb().formatRgb()}function ei(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=vD.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?j_(t):n===3?new Xt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?du(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?du(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=xD.exec(e))?new Xt(t[1],t[2],t[3],1):(t=wD.exec(e))?new Xt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=bD.exec(e))?du(t[1],t[2],t[3],t[4]):(t=SD.exec(e))?du(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=_D.exec(e))?I_(t[1],t[2]/100,t[3]/100,1):(t=ND.exec(e))?I_(t[1],t[2]/100,t[3]/100,t[4]):k_.hasOwnProperty(e)?j_(k_[e]):e==="transparent"?new Xt(NaN,NaN,NaN,0):null}function j_(e){return new Xt(e>>16&255,e>>8&255,e&255,1)}function du(e,t,n,r){return r<=0&&(e=t=n=NaN),new Xt(e,t,n,r)}function ED(e){return e instanceof _l||(e=ei(e)),e?(e=e.rgb(),new Xt(e.r,e.g,e.b,e.opacity)):new Xt}function N0(e,t,n,r){return arguments.length===1?ED(e):new Xt(e,t,n,r??1)}function Xt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}fw(Xt,N0,jT(_l,{brighter(e){return e=e==null?Zu:Math.pow(Zu,e),new Xt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?rl:Math.pow(rl,e),new Xt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Xt(Js(this.r),Js(this.g),Js(this.b),ed(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:R_,formatHex:R_,formatHex8:jD,formatRgb:T_,toString:T_}));function R_(){return`#${Ys(this.r)}${Ys(this.g)}${Ys(this.b)}`}function jD(){return`#${Ys(this.r)}${Ys(this.g)}${Ys(this.b)}${Ys((isNaN(this.opacity)?1:this.opacity)*255)}`}function T_(){const e=ed(this.opacity);return`${e===1?"rgb(":"rgba("}${Js(this.r)}, ${Js(this.g)}, ${Js(this.b)}${e===1?")":`, ${e})`}`}function ed(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Js(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ys(e){return e=Js(e),(e<16?"0":"")+e.toString(16)}function I_(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Bn(e,t,n,r)}function RT(e){if(e instanceof Bn)return new Bn(e.h,e.s,e.l,e.opacity);if(e instanceof _l||(e=ei(e)),!e)return new Bn;if(e instanceof Bn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,c=o-s,u=(o+s)/2;return c?(t===o?a=(n-r)/c+(n<r)*6:n===o?a=(r-t)/c+2:a=(t-n)/c+4,c/=u<.5?o+s:2-o-s,a*=60):c=u>0&&u<1?0:a,new Bn(a,c,u,e.opacity)}function RD(e,t,n,r){return arguments.length===1?RT(e):new Bn(e,t,n,r??1)}function Bn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}fw(Bn,RD,jT(_l,{brighter(e){return e=e==null?Zu:Math.pow(Zu,e),new Bn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?rl:Math.pow(rl,e),new Bn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new Xt(wp(e>=240?e-240:e+120,s,r),wp(e,s,r),wp(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Bn(A_(this.h),fu(this.s),fu(this.l),ed(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=ed(this.opacity);return`${e===1?"hsl(":"hsla("}${A_(this.h)}, ${fu(this.s)*100}%, ${fu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function A_(e){return e=(e||0)%360,e<0?e+360:e}function fu(e){return Math.max(0,Math.min(1,e||0))}function wp(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const hw=e=>()=>e;function TD(e,t){return function(n){return e+n*t}}function ID(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function AD(e){return(e=+e)==1?TT:function(t,n){return n-t?ID(t,n,e):hw(isNaN(t)?n:t)}}function TT(e,t){var n=t-e;return n?TD(e,n):hw(isNaN(e)?t:e)}const td=(function e(t){var n=AD(t);function r(s,o){var a=n((s=N0(s)).r,(o=N0(o)).r),c=n(s.g,o.g),u=n(s.b,o.b),f=TT(s.opacity,o.opacity);return function(m){return s.r=a(m),s.g=c(m),s.b=u(m),s.opacity=f(m),s+""}}return r.gamma=e,r})(1);function MD(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(o){for(s=0;s<n;++s)r[s]=e[s]*(1-o)+t[s]*o;return r}}function OD(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function PD(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)s[a]=Ya(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(c){for(a=0;a<r;++a)o[a]=s[a](c);return o}}function LD(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function sr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function DD(e,t){var n={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=Ya(e[s],t[s]):r[s]=t[s];return function(o){for(s in n)r[s]=n[s](o);return r}}var k0=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bp=new RegExp(k0.source,"g");function $D(e){return function(){return e}}function qD(e){return function(t){return e(t)+""}}function IT(e,t){var n=k0.lastIndex=bp.lastIndex=0,r,s,o,a=-1,c=[],u=[];for(e=e+"",t=t+"";(r=k0.exec(e))&&(s=bp.exec(t));)(o=s.index)>n&&(o=t.slice(n,o),c[a]?c[a]+=o:c[++a]=o),(r=r[0])===(s=s[0])?c[a]?c[a]+=s:c[++a]=s:(c[++a]=null,u.push({i:a,x:sr(r,s)})),n=bp.lastIndex;return n<t.length&&(o=t.slice(n),c[a]?c[a]+=o:c[++a]=o),c.length<2?u[0]?qD(u[0].x):$D(t):(t=u.length,function(f){for(var m=0,p;m<t;++m)c[(p=u[m]).i]=p.x(f);return c.join("")})}function Ya(e,t){var n=typeof t,r;return t==null||n==="boolean"?hw(t):(n==="number"?sr:n==="string"?(r=ei(t))?(t=r,td):IT:t instanceof ei?td:t instanceof Date?LD:OD(t)?MD:Array.isArray(t)?PD:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?DD:sr)(e,t)}var M_=180/Math.PI,C0={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function AT(e,t,n,r,s,o){var a,c,u;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(c=Math.sqrt(n*n+r*r))&&(n/=c,r/=c,u/=c),e*r<t*n&&(e=-e,t=-t,u=-u,a=-a),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*M_,skewX:Math.atan(u)*M_,scaleX:a,scaleY:c}}var hu;function FD(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?C0:AT(t.a,t.b,t.c,t.d,t.e,t.f)}function BD(e){return e==null||(hu||(hu=document.createElementNS("http://www.w3.org/2000/svg","g")),hu.setAttribute("transform",e),!(e=hu.transform.baseVal.consolidate()))?C0:(e=e.matrix,AT(e.a,e.b,e.c,e.d,e.e,e.f))}function MT(e,t,n,r){function s(f){return f.length?f.pop()+" ":""}function o(f,m,p,g,v,b){if(f!==p||m!==g){var w=v.push("translate(",null,t,null,n);b.push({i:w-4,x:sr(f,p)},{i:w-2,x:sr(m,g)})}else(p||g)&&v.push("translate("+p+t+g+n)}function a(f,m,p,g){f!==m?(f-m>180?m+=360:m-f>180&&(f+=360),g.push({i:p.push(s(p)+"rotate(",null,r)-2,x:sr(f,m)})):m&&p.push(s(p)+"rotate("+m+r)}function c(f,m,p,g){f!==m?g.push({i:p.push(s(p)+"skewX(",null,r)-2,x:sr(f,m)}):m&&p.push(s(p)+"skewX("+m+r)}function u(f,m,p,g,v,b){if(f!==p||m!==g){var w=v.push(s(v)+"scale(",null,",",null,")");b.push({i:w-4,x:sr(f,p)},{i:w-2,x:sr(m,g)})}else(p!==1||g!==1)&&v.push(s(v)+"scale("+p+","+g+")")}return function(f,m){var p=[],g=[];return f=e(f),m=e(m),o(f.translateX,f.translateY,m.translateX,m.translateY,p,g),a(f.rotate,m.rotate,p,g),c(f.skewX,m.skewX,p,g),u(f.scaleX,f.scaleY,m.scaleX,m.scaleY,p,g),f=m=null,function(v){for(var b=-1,w=g.length,x;++b<w;)p[(x=g[b]).i]=x.x(v);return p.join("")}}}var zD=MT(FD,"px, ","px)","deg)"),VD=MT(BD,", ",")",")"),UD=1e-12;function O_(e){return((e=Math.exp(e))+1/e)/2}function HD(e){return((e=Math.exp(e))-1/e)/2}function WD(e){return((e=Math.exp(2*e))-1)/(e+1)}const Du=(function e(t,n,r){function s(o,a){var c=o[0],u=o[1],f=o[2],m=a[0],p=a[1],g=a[2],v=m-c,b=p-u,w=v*v+b*b,x,S;if(w<UD)S=Math.log(g/f)/t,x=function(I){return[c+I*v,u+I*b,f*Math.exp(t*I*S)]};else{var k=Math.sqrt(w),N=(g*g-f*f+r*w)/(2*f*n*k),C=(g*g-f*f-r*w)/(2*g*n*k),R=Math.log(Math.sqrt(N*N+1)-N),T=Math.log(Math.sqrt(C*C+1)-C);S=(T-R)/t,x=function(I){var O=I*S,P=O_(R),B=f/(n*k)*(P*WD(t*O+R)-HD(R));return[c+B*v,u+B*b,f*P/O_(t*O+R)]}}return x.duration=S*1e3*t/Math.SQRT2,x}return s.rho=function(o){var a=Math.max(.001,+o),c=a*a,u=c*c;return e(a,c,u)},s})(Math.SQRT2,2,4);var go=0,$a=0,Ia=0,OT=1e3,nd,qa,rd=0,ti=0,Ed=0,il=typeof performance=="object"&&performance.now?performance:Date,PT=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function pw(){return ti||(PT(KD),ti=il.now()+Ed)}function KD(){ti=0}function sd(){this._call=this._time=this._next=null}sd.prototype=LT.prototype={constructor:sd,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?pw():+n)+(t==null?0:+t),!this._next&&qa!==this&&(qa?qa._next=this:nd=this,qa=this),this._call=e,this._time=n,E0()},stop:function(){this._call&&(this._call=null,this._time=1/0,E0())}};function LT(e,t,n){var r=new sd;return r.restart(e,t,n),r}function GD(){pw(),++go;for(var e=nd,t;e;)(t=ti-e._time)>=0&&e._call.call(void 0,t),e=e._next;--go}function P_(){ti=(rd=il.now())+Ed,go=$a=0;try{GD()}finally{go=0,XD(),ti=0}}function YD(){var e=il.now(),t=e-rd;t>OT&&(Ed-=t,rd=e)}function XD(){for(var e,t=nd,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:nd=n);qa=e,E0(r)}function E0(e){if(!go){$a&&($a=clearTimeout($a));var t=e-ti;t>24?(e<1/0&&($a=setTimeout(P_,e-il.now()-Ed)),Ia&&(Ia=clearInterval(Ia))):(Ia||(rd=il.now(),Ia=setInterval(YD,OT)),go=1,PT(P_))}}function L_(e,t,n){var r=new sd;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var QD=kd("start","end","cancel","interrupt"),JD=[],DT=0,D_=1,j0=2,$u=3,$_=4,R0=5,qu=6;function jd(e,t,n,r,s,o){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;ZD(e,n,{name:t,index:r,group:s,on:QD,tween:JD,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:DT})}function mw(e,t){var n=Kn(e,t);if(n.state>DT)throw new Error("too late; already scheduled");return n}function yr(e,t){var n=Kn(e,t);if(n.state>$u)throw new Error("too late; already running");return n}function Kn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function ZD(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=LT(o,0,n.time);function o(f){n.state=D_,n.timer.restart(a,n.delay,n.time),n.delay<=f&&a(f-n.delay)}function a(f){var m,p,g,v;if(n.state!==D_)return u();for(m in r)if(v=r[m],v.name===n.name){if(v.state===$u)return L_(a);v.state===$_?(v.state=qu,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[m]):+m<t&&(v.state=qu,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete r[m])}if(L_(function(){n.state===$u&&(n.state=$_,n.timer.restart(c,n.delay,n.time),c(f))}),n.state=j0,n.on.call("start",e,e.__data__,n.index,n.group),n.state===j0){for(n.state=$u,s=new Array(g=n.tween.length),m=0,p=-1;m<g;++m)(v=n.tween[m].value.call(e,e.__data__,n.index,n.group))&&(s[++p]=v);s.length=p+1}}function c(f){for(var m=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(u),n.state=R0,1),p=-1,g=s.length;++p<g;)s[p].call(e,m);n.state===R0&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=qu,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function Fu(e,t){var n=e.__transition,r,s,o=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){o=!1;continue}s=r.state>j0&&r.state<R0,r.state=qu,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}o&&delete e.__transition}}function e$(e){return this.each(function(){Fu(this,e)})}function t$(e,t){var n,r;return function(){var s=yr(this,e),o=s.tween;if(o!==n){r=n=o;for(var a=0,c=r.length;a<c;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}s.tween=r}}function n$(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=yr(this,e),a=o.tween;if(a!==r){s=(r=a).slice();for(var c={name:t,value:n},u=0,f=s.length;u<f;++u)if(s[u].name===t){s[u]=c;break}u===f&&s.push(c)}o.tween=s}}function r$(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Kn(this.node(),n).tween,s=0,o=r.length,a;s<o;++s)if((a=r[s]).name===e)return a.value;return null}return this.each((t==null?t$:n$)(n,e,t))}function gw(e,t,n){var r=e._id;return e.each(function(){var s=yr(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return Kn(s,r).value[t]}}function $T(e,t){var n;return(typeof t=="number"?sr:t instanceof ei?td:(n=ei(t))?(t=n,td):IT)(e,t)}function s$(e){return function(){this.removeAttribute(e)}}function i$(e){return function(){this.removeAttributeNS(e.space,e.local)}}function o$(e,t,n){var r,s=n+"",o;return function(){var a=this.getAttribute(e);return a===s?null:a===r?o:o=t(r=a,n)}}function a$(e,t,n){var r,s=n+"",o;return function(){var a=this.getAttributeNS(e.space,e.local);return a===s?null:a===r?o:o=t(r=a,n)}}function l$(e,t,n){var r,s,o;return function(){var a,c=n(this),u;return c==null?void this.removeAttribute(e):(a=this.getAttribute(e),u=c+"",a===u?null:a===r&&u===s?o:(s=u,o=t(r=a,c)))}}function c$(e,t,n){var r,s,o;return function(){var a,c=n(this),u;return c==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),u=c+"",a===u?null:a===r&&u===s?o:(s=u,o=t(r=a,c)))}}function u$(e,t){var n=Cd(e),r=n==="transform"?VD:$T;return this.attrTween(e,typeof t=="function"?(n.local?c$:l$)(n,r,gw(this,"attr."+e,t)):t==null?(n.local?i$:s$)(n):(n.local?a$:o$)(n,r,t))}function d$(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function f$(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function h$(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&f$(e,o)),n}return s._value=t,s}function p$(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&d$(e,o)),n}return s._value=t,s}function m$(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Cd(e);return this.tween(n,(r.local?h$:p$)(r,t))}function g$(e,t){return function(){mw(this,e).delay=+t.apply(this,arguments)}}function y$(e,t){return t=+t,function(){mw(this,e).delay=t}}function v$(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?g$:y$)(t,e)):Kn(this.node(),t).delay}function x$(e,t){return function(){yr(this,e).duration=+t.apply(this,arguments)}}function w$(e,t){return t=+t,function(){yr(this,e).duration=t}}function b$(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?x$:w$)(t,e)):Kn(this.node(),t).duration}function S$(e,t){if(typeof t!="function")throw new Error;return function(){yr(this,e).ease=t}}function _$(e){var t=this._id;return arguments.length?this.each(S$(t,e)):Kn(this.node(),t).ease}function N$(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;yr(this,e).ease=n}}function k$(e){if(typeof e!="function")throw new Error;return this.each(N$(this._id,e))}function C$(e){typeof e!="function"&&(e=mT(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],a=o.length,c=r[s]=[],u,f=0;f<a;++f)(u=o[f])&&e.call(u,u.__data__,f,o)&&c.push(u);return new Lr(r,this._parents,this._name,this._id)}function E$(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,o=Math.min(r,s),a=new Array(r),c=0;c<o;++c)for(var u=t[c],f=n[c],m=u.length,p=a[c]=new Array(m),g,v=0;v<m;++v)(g=u[v]||f[v])&&(p[v]=g);for(;c<r;++c)a[c]=t[c];return new Lr(a,this._parents,this._name,this._id)}function j$(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function R$(e,t,n){var r,s,o=j$(t)?mw:yr;return function(){var a=o(this,e),c=a.on;c!==r&&(s=(r=c).copy()).on(t,n),a.on=s}}function T$(e,t){var n=this._id;return arguments.length<2?Kn(this.node(),n).on.on(e):this.each(R$(n,e,t))}function I$(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function A$(){return this.on("end.remove",I$(this._id))}function M$(e){var t=this._name,n=this._id;typeof e!="function"&&(e=uw(e));for(var r=this._groups,s=r.length,o=new Array(s),a=0;a<s;++a)for(var c=r[a],u=c.length,f=o[a]=new Array(u),m,p,g=0;g<u;++g)(m=c[g])&&(p=e.call(m,m.__data__,g,c))&&("__data__"in m&&(p.__data__=m.__data__),f[g]=p,jd(f[g],t,n,g,f,Kn(m,n)));return new Lr(o,this._parents,t,n)}function O$(e){var t=this._name,n=this._id;typeof e!="function"&&(e=pT(e));for(var r=this._groups,s=r.length,o=[],a=[],c=0;c<s;++c)for(var u=r[c],f=u.length,m,p=0;p<f;++p)if(m=u[p]){for(var g=e.call(m,m.__data__,p,u),v,b=Kn(m,n),w=0,x=g.length;w<x;++w)(v=g[w])&&jd(v,t,n,w,g,b);o.push(g),a.push(m)}return new Lr(o,a,t,n)}var P$=Sl.prototype.constructor;function L$(){return new P$(this._groups,this._parents)}function D$(e,t){var n,r,s;return function(){var o=mo(this,e),a=(this.style.removeProperty(e),mo(this,e));return o===a?null:o===n&&a===r?s:s=t(n=o,r=a)}}function qT(e){return function(){this.style.removeProperty(e)}}function $$(e,t,n){var r,s=n+"",o;return function(){var a=mo(this,e);return a===s?null:a===r?o:o=t(r=a,n)}}function q$(e,t,n){var r,s,o;return function(){var a=mo(this,e),c=n(this),u=c+"";return c==null&&(u=c=(this.style.removeProperty(e),mo(this,e))),a===u?null:a===r&&u===s?o:(s=u,o=t(r=a,c))}}function F$(e,t){var n,r,s,o="style."+t,a="end."+o,c;return function(){var u=yr(this,e),f=u.on,m=u.value[o]==null?c||(c=qT(t)):void 0;(f!==n||s!==m)&&(r=(n=f).copy()).on(a,s=m),u.on=r}}function B$(e,t,n){var r=(e+="")=="transform"?zD:$T;return t==null?this.styleTween(e,D$(e,r)).on("end.style."+e,qT(e)):typeof t=="function"?this.styleTween(e,q$(e,r,gw(this,"style."+e,t))).each(F$(this._id,e)):this.styleTween(e,$$(e,r,t),n).on("end.style."+e,null)}function z$(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function V$(e,t,n){var r,s;function o(){var a=t.apply(this,arguments);return a!==s&&(r=(s=a)&&z$(e,a,n)),r}return o._value=t,o}function U$(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,V$(e,t,n??""))}function H$(e){return function(){this.textContent=e}}function W$(e){return function(){var t=e(this);this.textContent=t??""}}function K$(e){return this.tween("text",typeof e=="function"?W$(gw(this,"text",e)):H$(e==null?"":e+""))}function G$(e){return function(t){this.textContent=e.call(this,t)}}function Y$(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&G$(s)),t}return r._value=e,r}function X$(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Y$(e))}function Q$(){for(var e=this._name,t=this._id,n=FT(),r=this._groups,s=r.length,o=0;o<s;++o)for(var a=r[o],c=a.length,u,f=0;f<c;++f)if(u=a[f]){var m=Kn(u,t);jd(u,e,n,f,a,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new Lr(r,this._parents,e,n)}function J$(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(o,a){var c={value:a},u={value:function(){--s===0&&o()}};n.each(function(){var f=yr(this,r),m=f.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(u)),f.on=t}),s===0&&o()})}var Z$=0;function Lr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function FT(){return++Z$}var Rr=Sl.prototype;Lr.prototype={constructor:Lr,select:M$,selectAll:O$,selectChild:Rr.selectChild,selectChildren:Rr.selectChildren,filter:C$,merge:E$,selection:L$,transition:Q$,call:Rr.call,nodes:Rr.nodes,node:Rr.node,size:Rr.size,empty:Rr.empty,each:Rr.each,on:T$,attr:u$,attrTween:m$,style:B$,styleTween:U$,text:K$,textTween:X$,remove:A$,tween:r$,delay:v$,duration:b$,ease:_$,easeVarying:k$,end:J$,[Symbol.iterator]:Rr[Symbol.iterator]};function eq(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var tq={time:null,delay:0,duration:250,ease:eq};function nq(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function rq(e){var t,n;e instanceof Lr?(t=e._id,e=e._name):(t=FT(),(n=tq).time=pw(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,o=0;o<s;++o)for(var a=r[o],c=a.length,u,f=0;f<c;++f)(u=a[f])&&jd(u,e,t,f,a,n||nq(u,t));return new Lr(r,this._parents,e,t)}Sl.prototype.interrupt=e$;Sl.prototype.transition=rq;const pu=e=>()=>e;function sq(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Ar(e,t,n){this.k=e,this.x=t,this.y=n}Ar.prototype={constructor:Ar,scale:function(e){return e===1?this:new Ar(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ar(this.k,this.x+this.k*e,this.y+this.k*t)},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 Rd=new Ar(1,0,0);BT.prototype=Ar.prototype;function BT(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Rd;return e.__zoom}function Sp(e){e.stopImmediatePropagation()}function Aa(e){e.preventDefault(),e.stopImmediatePropagation()}function iq(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function oq(){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 q_(){return this.__zoom||Rd}function aq(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function lq(){return navigator.maxTouchPoints||"ontouchstart"in this}function cq(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function zT(){var e=iq,t=oq,n=cq,r=aq,s=lq,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],c=250,u=Du,f=kd("start","zoom","end"),m,p,g,v=500,b=150,w=0,x=10;function S($){$.property("__zoom",q_).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",B).filter(s).on("touchstart.zoom",M).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function($,z,V,G){var F=$.selection?$.selection():$;F.property("__zoom",q_),$!==F?R($,z,V,G):F.interrupt().each(function(){T(this,arguments).event(G).start().zoom(null,typeof z=="function"?z.apply(this,arguments):z).end()})},S.scaleBy=function($,z,V,G){S.scaleTo($,function(){var F=this.__zoom.k,q=typeof z=="function"?z.apply(this,arguments):z;return F*q},V,G)},S.scaleTo=function($,z,V,G){S.transform($,function(){var F=t.apply(this,arguments),q=this.__zoom,X=V==null?C(F):typeof V=="function"?V.apply(this,arguments):V,D=q.invert(X),W=typeof z=="function"?z.apply(this,arguments):z;return n(N(k(q,W),X,D),F,a)},V,G)},S.translateBy=function($,z,V,G){S.transform($,function(){return n(this.__zoom.translate(typeof z=="function"?z.apply(this,arguments):z,typeof V=="function"?V.apply(this,arguments):V),t.apply(this,arguments),a)},null,G)},S.translateTo=function($,z,V,G,F){S.transform($,function(){var q=t.apply(this,arguments),X=this.__zoom,D=G==null?C(q):typeof G=="function"?G.apply(this,arguments):G;return n(Rd.translate(D[0],D[1]).scale(X.k).translate(typeof z=="function"?-z.apply(this,arguments):-z,typeof V=="function"?-V.apply(this,arguments):-V),q,a)},G,F)};function k($,z){return z=Math.max(o[0],Math.min(o[1],z)),z===$.k?$:new Ar(z,$.x,$.y)}function N($,z,V){var G=z[0]-V[0]*$.k,F=z[1]-V[1]*$.k;return G===$.x&&F===$.y?$:new Ar($.k,G,F)}function C($){return[(+$[0][0]+ +$[1][0])/2,(+$[0][1]+ +$[1][1])/2]}function R($,z,V,G){$.on("start.zoom",function(){T(this,arguments).event(G).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(G).end()}).tween("zoom",function(){var F=this,q=arguments,X=T(F,q).event(G),D=t.apply(F,q),W=V==null?C(D):typeof V=="function"?V.apply(F,q):V,oe=Math.max(D[1][0]-D[0][0],D[1][1]-D[0][1]),K=F.__zoom,J=typeof z=="function"?z.apply(F,q):z,te=u(K.invert(W).concat(oe/K.k),J.invert(W).concat(oe/J.k));return function(Y){if(Y===1)Y=J;else{var ee=te(Y),ie=oe/ee[2];Y=new Ar(ie,W[0]-ee[0]*ie,W[1]-ee[1]*ie)}X.zoom(null,Y)}})}function T($,z,V){return!V&&$.__zooming||new I($,z)}function I($,z){this.that=$,this.args=z,this.active=0,this.sourceEvent=null,this.extent=t.apply($,z),this.taps=0}I.prototype={event:function($){return $&&(this.sourceEvent=$),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function($,z){return this.mouse&&$!=="mouse"&&(this.mouse[1]=z.invert(this.mouse[0])),this.touch0&&$!=="touch"&&(this.touch0[1]=z.invert(this.touch0[0])),this.touch1&&$!=="touch"&&(this.touch1[1]=z.invert(this.touch1[0])),this.that.__zoom=z,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function($){var z=un(this.that).datum();f.call($,this.that,new sq($,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:f}),z)}};function O($,...z){if(!e.apply(this,arguments))return;var V=T(this,z).event($),G=this.__zoom,F=Math.max(o[0],Math.min(o[1],G.k*Math.pow(2,r.apply(this,arguments)))),q=qn($);if(V.wheel)(V.mouse[0][0]!==q[0]||V.mouse[0][1]!==q[1])&&(V.mouse[1]=G.invert(V.mouse[0]=q)),clearTimeout(V.wheel);else{if(G.k===F)return;V.mouse=[q,G.invert(q)],Fu(this),V.start()}Aa($),V.wheel=setTimeout(X,b),V.zoom("mouse",n(N(k(G,F),V.mouse[0],V.mouse[1]),V.extent,a));function X(){V.wheel=null,V.end()}}function P($,...z){if(g||!e.apply(this,arguments))return;var V=$.currentTarget,G=T(this,z,!0).event($),F=un($.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",oe,!0),q=qn($,V),X=$.clientX,D=$.clientY;kT($.view),Sp($),G.mouse=[q,this.__zoom.invert(q)],Fu(this),G.start();function W(K){if(Aa(K),!G.moved){var J=K.clientX-X,te=K.clientY-D;G.moved=J*J+te*te>w}G.event(K).zoom("mouse",n(N(G.that.__zoom,G.mouse[0]=qn(K,V),G.mouse[1]),G.extent,a))}function oe(K){F.on("mousemove.zoom mouseup.zoom",null),CT(K.view,G.moved),Aa(K),G.event(K).end()}}function B($,...z){if(e.apply(this,arguments)){var V=this.__zoom,G=qn($.changedTouches?$.changedTouches[0]:$,this),F=V.invert(G),q=V.k*($.shiftKey?.5:2),X=n(N(k(V,q),G,F),t.apply(this,z),a);Aa($),c>0?un(this).transition().duration(c).call(R,X,G,$):un(this).call(S.transform,X,G,$)}}function M($,...z){if(e.apply(this,arguments)){var V=$.touches,G=V.length,F=T(this,z,$.changedTouches.length===G).event($),q,X,D,W;for(Sp($),X=0;X<G;++X)D=V[X],W=qn(D,this),W=[W,this.__zoom.invert(W),D.identifier],F.touch0?!F.touch1&&F.touch0[2]!==W[2]&&(F.touch1=W,F.taps=0):(F.touch0=W,q=!0,F.taps=1+!!m);m&&(m=clearTimeout(m)),q&&(F.taps<2&&(p=W[0],m=setTimeout(function(){m=null},v)),Fu(this),F.start())}}function L($,...z){if(this.__zooming){var V=T(this,z).event($),G=$.changedTouches,F=G.length,q,X,D,W;for(Aa($),q=0;q<F;++q)X=G[q],D=qn(X,this),V.touch0&&V.touch0[2]===X.identifier?V.touch0[0]=D:V.touch1&&V.touch1[2]===X.identifier&&(V.touch1[0]=D);if(X=V.that.__zoom,V.touch1){var oe=V.touch0[0],K=V.touch0[1],J=V.touch1[0],te=V.touch1[1],Y=(Y=J[0]-oe[0])*Y+(Y=J[1]-oe[1])*Y,ee=(ee=te[0]-K[0])*ee+(ee=te[1]-K[1])*ee;X=k(X,Math.sqrt(Y/ee)),D=[(oe[0]+J[0])/2,(oe[1]+J[1])/2],W=[(K[0]+te[0])/2,(K[1]+te[1])/2]}else if(V.touch0)D=V.touch0[0],W=V.touch0[1];else return;V.zoom("touch",n(N(X,D,W),V.extent,a))}}function U($,...z){if(this.__zooming){var V=T(this,z).event($),G=$.changedTouches,F=G.length,q,X;for(Sp($),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),q=0;q<F;++q)X=G[q],V.touch0&&V.touch0[2]===X.identifier?delete V.touch0:V.touch1&&V.touch1[2]===X.identifier&&delete V.touch1;if(V.touch1&&!V.touch0&&(V.touch0=V.touch1,delete V.touch1),V.touch0)V.touch0[1]=this.__zoom.invert(V.touch0[0]);else if(V.end(),V.taps===2&&(X=qn(X,this),Math.hypot(p[0]-X[0],p[1]-X[1])<x)){var D=un(this).on("dblclick.zoom");D&&D.apply(this,arguments)}}}return S.wheelDelta=function($){return arguments.length?(r=typeof $=="function"?$:pu(+$),S):r},S.filter=function($){return arguments.length?(e=typeof $=="function"?$:pu(!!$),S):e},S.touchable=function($){return arguments.length?(s=typeof $=="function"?$:pu(!!$),S):s},S.extent=function($){return arguments.length?(t=typeof $=="function"?$:pu([[+$[0][0],+$[0][1]],[+$[1][0],+$[1][1]]]),S):t},S.scaleExtent=function($){return arguments.length?(o[0]=+$[0],o[1]=+$[1],S):[o[0],o[1]]},S.translateExtent=function($){return arguments.length?(a[0][0]=+$[0][0],a[1][0]=+$[1][0],a[0][1]=+$[0][1],a[1][1]=+$[1][1],S):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},S.constrain=function($){return arguments.length?(n=$,S):n},S.duration=function($){return arguments.length?(c=+$,S):c},S.interpolate=function($){return arguments.length?(u=$,S):u},S.on=function(){var $=f.on.apply(f,arguments);return $===f?S:$},S.clickDistance=function($){return arguments.length?(w=($=+$)*$,S):Math.sqrt(w)},S.tapDistance=function($){return arguments.length?(x=+$,S):x},S}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:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,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."},ol=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],VT=["Enter"," ","Escape"],UT={"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:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"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 yo;(function(e){e.Strict="strict",e.Loose="loose"})(yo||(yo={}));var Zs;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Zs||(Zs={}));var al;(function(e){e.Partial="partial",e.Full="full"})(al||(al={}));const HT={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ws;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ws||(ws={}));var id;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(id||(id={}));var he;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(he||(he={}));const F_={[he.Left]:he.Right,[he.Right]:he.Left,[he.Top]:he.Bottom,[he.Bottom]:he.Top};function WT(e){return e===null?null:e?"valid":"invalid"}const KT=e=>"id"in e&&"source"in e&&"target"in e,uq=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),yw=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Nl=(e,t=[0,0])=>{const{width:n,height:r}=zr(e),s=e.origin??t,o=n*s[0],a=r*s[1];return{x:e.position.x-o,y:e.position.y-a}},dq=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const o=typeof s=="string";let a=!t.nodeLookup&&!o?s:void 0;t.nodeLookup&&(a=o?t.nodeLookup.get(s):yw(s)?s:t.nodeLookup.get(s.id));const c=a?od(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Td(r,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Id(n)},kl=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(t.filter===void 0||t.filter(s))&&(n=Td(n,od(s)),r=!0)}),r?Id(n):{x:0,y:0,width:0,height:0}},vw=(e,t,[n,r,s]=[0,0,1],o=!1,a=!1)=>{const c={...El(t,[n,r,s]),width:t.width/s,height:t.height/s},u=[];for(const f of e.values()){const{measured:m,selectable:p=!0,hidden:g=!1}=f;if(a&&!p||g)continue;const v=m.width??f.width??f.initialWidth??null,b=m.height??f.height??f.initialHeight??null,w=ll(c,xo(f)),x=(v??0)*(b??0),S=o&&w>0;(!f.internals.handleBounds||S||w>=x||f.dragging)&&u.push(f)}return u},fq=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function hq(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function pq({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:o},a){if(e.size===0)return Promise.resolve(!0);const c=hq(e,a),u=kl(c),f=xw(u,t,n,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??o,(a==null?void 0:a.padding)??.1);return await r.setViewport(f,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),Promise.resolve(!0)}function GT({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:o}){const a=n.get(e),c=a.parentId?n.get(a.parentId):void 0,{x:u,y:f}=c?c.internals.positionAbsolute:{x:0,y:0},m=a.origin??r;let p=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!c)o==null||o("005",fr.error005());else{const v=c.measured.width,b=c.measured.height;v&&b&&(p=[[u,f],[u+v,f+b]])}else c&&wo(a.extent)&&(p=[[a.extent[0][0]+u,a.extent[0][1]+f],[a.extent[1][0]+u,a.extent[1][1]+f]]);const g=wo(p)?ni(t,p,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(o==null||o("015",fr.error015())),{position:{x:g.x-u+(a.measured.width??0)*m[0],y:g.y-f+(a.measured.height??0)*m[1]},positionAbsolute:g}}async function mq({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const o=new Set(e.map(g=>g.id)),a=[];for(const g of n){if(g.deletable===!1)continue;const v=o.has(g.id),b=!v&&g.parentId&&a.find(w=>w.id===g.parentId);(v||b)&&a.push(g)}const c=new Set(t.map(g=>g.id)),u=r.filter(g=>g.deletable!==!1),m=fq(a,u);for(const g of u)c.has(g.id)&&!m.find(b=>b.id===g.id)&&m.push(g);if(!s)return{edges:m,nodes:a};const p=await s({nodes:a,edges:m});return typeof p=="boolean"?p?{edges:m,nodes:a}:{edges:[],nodes:[]}:p}const vo=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ni=(e={x:0,y:0},t,n)=>({x:vo(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:vo(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function YT(e,t,n){const{width:r,height:s}=zr(n),{x:o,y:a}=n.internals.positionAbsolute;return ni(e,[[o,a],[o+r,a+s]],t)}const B_=(e,t,n)=>e<t?vo(Math.abs(e-t),1,t)/t:e>n?-vo(Math.abs(e-n),1,t)/t:0,XT=(e,t,n=15,r=40)=>{const s=B_(e.x,r,t.width-r)*n,o=B_(e.y,r,t.height-r)*n;return[s,o]},Td=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),T0=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Id=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),xo=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=yw(e)?e.internals.positionAbsolute:Nl(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},od=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=yw(e)?e.internals.positionAbsolute:Nl(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},QT=(e,t)=>Id(Td(T0(e),T0(t))),ll=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},z_=e=>zn(e.width)&&zn(e.height)&&zn(e.x)&&zn(e.y),zn=e=>!isNaN(e)&&isFinite(e),gq=(e,t)=>{},Cl=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),El=({x:e,y:t},[n,r,s],o=!1,a=[1,1])=>{const c={x:(e-n)/s,y:(t-r)/s};return o?Cl(c,a):c},ad=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function Ki(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.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 yq(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Ki(e,n),s=Ki(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Ki(e.top??e.y??0,n),s=Ki(e.bottom??e.y??0,n),o=Ki(e.left??e.x??0,t),a=Ki(e.right??e.x??0,t);return{top:r,right:a,bottom:s,left:o,x:o+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function vq(e,t,n,r,s,o){const{x:a,y:c}=ad(e,[t,n,r]),{x:u,y:f}=ad({x:e.x+e.width,y:e.y+e.height},[t,n,r]),m=s-u,p=o-f;return{left:Math.floor(a),top:Math.floor(c),right:Math.floor(m),bottom:Math.floor(p)}}const xw=(e,t,n,r,s,o)=>{const a=yq(o,t,n),c=(t-a.x)/e.width,u=(n-a.y)/e.height,f=Math.min(c,u),m=vo(f,r,s),p=e.x+e.width/2,g=e.y+e.height/2,v=t/2-p*m,b=n/2-g*m,w=vq(e,v,b,m,t,n),x={left:Math.min(w.left-a.left,0),top:Math.min(w.top-a.top,0),right:Math.min(w.right-a.right,0),bottom:Math.min(w.bottom-a.bottom,0)};return{x:v-x.left+x.right,y:b-x.top+x.bottom,zoom:m}},cl=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function wo(e){return e!=null&&e!=="parent"}function zr(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function JT(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function ZT(e,t={width:0,height:0},n,r,s){const o={...e},a=r.get(n);if(a){const c=a.origin||s;o.x+=a.internals.positionAbsolute.x-(t.width??0)*c[0],o.y+=a.internals.positionAbsolute.y-(t.height??0)*c[1]}return o}function V_(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function xq(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function wq(e){return{...UT,...e||{}}}function Xa(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:o,y:a}=Vn(e),c=El({x:o-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:u,y:f}=n?Cl(c,t):c;return{xSnapped:u,ySnapped:f,...c}}const ww=e=>({width:e.offsetWidth,height:e.offsetHeight}),eI=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},bq=["INPUT","SELECT","TEXTAREA"];function tI(e){var r,s;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:bq.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const nI=e=>"clientX"in e,Vn=(e,t)=>{var o,a;const n=nI(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,s=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},U_=(e,t,n,r,s)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(a=>{const c=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(c.left-n.left)/r,y:(c.top-n.top)/r,...ww(a)}})};function rI({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:o,targetControlX:a,targetControlY:c}){const u=e*.125+s*.375+a*.375+n*.125,f=t*.125+o*.375+c*.375+r*.125,m=Math.abs(u-e),p=Math.abs(f-t);return[u,f,m,p]}function mu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function H_({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case he.Left:return[t-mu(t-r,o),n];case he.Right:return[t+mu(r-t,o),n];case he.Top:return[t,n-mu(n-s,o)];case he.Bottom:return[t,n+mu(s-n,o)]}}function sI({sourceX:e,sourceY:t,sourcePosition:n=he.Bottom,targetX:r,targetY:s,targetPosition:o=he.Top,curvature:a=.25}){const[c,u]=H_({pos:n,x1:e,y1:t,x2:r,y2:s,c:a}),[f,m]=H_({pos:o,x1:r,y1:s,x2:e,y2:t,c:a}),[p,g,v,b]=rI({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:c,sourceControlY:u,targetControlX:f,targetControlY:m});return[`M${e},${t} C${c},${u} ${f},${m} ${r},${s}`,p,g,v,b]}function iI({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,o=n<e?n+s:n-s,a=Math.abs(r-t)/2,c=r<t?r+a:r-a;return[o,c,s,a]}function Sq({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:s=!1,zIndexMode:o="basic"}){if(o==="manual")return r;const a=s&&n?r+1e3:r,c=Math.max(e.parentId||s&&e.selected?e.internals.z:0,t.parentId||s&&t.selected?t.internals.z:0);return a+c}function _q({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=Td(od(e),od(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const a={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:r/s[2]};return ll(a,Id(o))>0}const Nq=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,kq=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),oI=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||Nq;let s;return KT(e)?s={...e}:s={...e,id:r(e)},kq(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function aI({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,a,c]=iI({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,a,c]}const W_={[he.Left]:{x:-1,y:0},[he.Right]:{x:1,y:0},[he.Top]:{x:0,y:-1},[he.Bottom]:{x:0,y:1}},Cq=({source:e,sourcePosition:t=he.Bottom,target:n})=>t===he.Left||t===he.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},K_=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Eq({source:e,sourcePosition:t=he.Bottom,target:n,targetPosition:r=he.Top,center:s,offset:o,stepPosition:a}){const c=W_[t],u=W_[r],f={x:e.x+c.x*o,y:e.y+c.y*o},m={x:n.x+u.x*o,y:n.y+u.y*o},p=Cq({source:f,sourcePosition:t,target:m}),g=p.x!==0?"x":"y",v=p[g];let b=[],w,x;const S={x:0,y:0},k={x:0,y:0},[,,N,C]=iI({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[g]*u[g]===-1){g==="x"?(w=s.x??f.x+(m.x-f.x)*a,x=s.y??(f.y+m.y)/2):(w=s.x??(f.x+m.x)/2,x=s.y??f.y+(m.y-f.y)*a);const T=[{x:w,y:f.y},{x:w,y:m.y}],I=[{x:f.x,y:x},{x:m.x,y:x}];c[g]===v?b=g==="x"?T:I:b=g==="x"?I:T}else{const T=[{x:f.x,y:m.y}],I=[{x:m.x,y:f.y}];if(g==="x"?b=c.x===v?I:T:b=c.y===v?T:I,t===r){const L=Math.abs(e[g]-n[g]);if(L<=o){const U=Math.min(o-1,o-L);c[g]===v?S[g]=(f[g]>e[g]?-1:1)*U:k[g]=(m[g]>n[g]?-1:1)*U}}if(t!==r){const L=g==="x"?"y":"x",U=c[g]===u[L],$=f[L]>m[L],z=f[L]<m[L];(c[g]===1&&(!U&&$||U&&z)||c[g]!==1&&(!U&&z||U&&$))&&(b=g==="x"?T:I)}const O={x:f.x+S.x,y:f.y+S.y},P={x:m.x+k.x,y:m.y+k.y},B=Math.max(Math.abs(O.x-b[0].x),Math.abs(P.x-b[0].x)),M=Math.max(Math.abs(O.y-b[0].y),Math.abs(P.y-b[0].y));B>=M?(w=(O.x+P.x)/2,x=b[0].y):(w=b[0].x,x=(O.y+P.y)/2)}return[[e,{x:f.x+S.x,y:f.y+S.y},...b,{x:m.x+k.x,y:m.y+k.y},n],w,x,N,C]}function jq(e,t,n,r){const s=Math.min(K_(e,t)/2,K_(t,n)/2,r),{x:o,y:a}=t;if(e.x===o&&o===n.x||e.y===a&&a===n.y)return`L${o} ${a}`;if(e.y===a){const f=e.x<n.x?-1:1,m=e.y<n.y?1:-1;return`L ${o+s*f},${a}Q ${o},${a} ${o},${a+s*m}`}const c=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${o},${a+s*u}Q ${o},${a} ${o+s*c},${a}`}function I0({sourceX:e,sourceY:t,sourcePosition:n=he.Bottom,targetX:r,targetY:s,targetPosition:o=he.Top,borderRadius:a=5,centerX:c,centerY:u,offset:f=20,stepPosition:m=.5}){const[p,g,v,b,w]=Eq({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:o,center:{x:c,y:u},offset:f,stepPosition:m});return[p.reduce((S,k,N)=>{let C="";return N>0&&N<p.length-1?C=jq(p[N-1],k,p[N+1],a):C=`${N===0?"M":"L"}${k.x} ${k.y}`,S+=C,S},""),g,v,b,w]}function G_(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Rq(e){var p;const{sourceNode:t,targetNode:n}=e;if(!G_(t)||!G_(n))return null;const r=t.internals.handleBounds||Y_(t.handles),s=n.internals.handleBounds||Y_(n.handles),o=X_((r==null?void 0:r.source)??[],e.sourceHandle),a=X_(e.connectionMode===yo.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!o||!a)return(p=e.onError)==null||p.call(e,"008",fr.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(o==null?void 0:o.position)||he.Bottom,u=(a==null?void 0:a.position)||he.Top,f=ri(t,o,c),m=ri(n,a,u);return{sourceX:f.x,sourceY:f.y,targetX:m.x,targetY:m.y,sourcePosition:c,targetPosition:u}}function Y_(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function ri(e,t,n=he.Left,r=!1){const s=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:a,height:c}=t??zr(e);if(r)return{x:s+a/2,y:o+c/2};switch((t==null?void 0:t.position)??n){case he.Top:return{x:s+a/2,y:o};case he.Right:return{x:s+a,y:o+c/2};case he.Bottom:return{x:s+a/2,y:o+c};case he.Left:return{x:s,y:o+c/2}}}function X_(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function A0(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Tq(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const o=new Set;return e.reduce((a,c)=>([c.markerStart||r,c.markerEnd||s].forEach(u=>{if(u&&typeof u=="object"){const f=A0(u,t);o.has(f)||(a.push({id:f,color:u.color||n,...u}),o.add(f))}}),a),[]).sort((a,c)=>a.id.localeCompare(c.id))}const lI=1e3,Iq=10,bw={nodeOrigin:[0,0],nodeExtent:ol,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Aq={...bw,checkEquality:!0};function Sw(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Mq(e,t,n){const r=Sw(bw,n);for(const s of e.values())if(s.parentId)Nw(s,e,t,r);else{const o=Nl(s,r.nodeOrigin),a=wo(s.extent)?s.extent:r.nodeExtent,c=ni(o,a,zr(s));s.internals.positionAbsolute=c}}function Oq(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const s of e.handles){const o={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?n.push(o):s.type==="target"&&r.push(o)}return{source:n,target:r}}function _w(e){return e==="manual"}function M0(e,t,n,r={}){var f,m;const s=Sw(Aq,r),o={i:0},a=new Map(t),c=s!=null&&s.elevateNodesOnSelect&&!_w(s.zIndexMode)?lI:0;let u=e.length>0;t.clear(),n.clear();for(const p of e){let g=a.get(p.id);if(s.checkEquality&&p===(g==null?void 0:g.internals.userNode))t.set(p.id,g);else{const v=Nl(p,s.nodeOrigin),b=wo(p.extent)?p.extent:s.nodeExtent,w=ni(v,b,zr(p));g={...s.defaults,...p,measured:{width:(f=p.measured)==null?void 0:f.width,height:(m=p.measured)==null?void 0:m.height},internals:{positionAbsolute:w,handleBounds:Oq(p,g),z:cI(p,c,s.zIndexMode),userNode:p}},t.set(p.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(u=!1),p.parentId&&Nw(g,t,n,r,o)}return u}function Pq(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Nw(e,t,n,r,s){const{elevateNodesOnSelect:o,nodeOrigin:a,nodeExtent:c,zIndexMode:u}=Sw(bw,r),f=e.parentId,m=t.get(f);if(!m){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Pq(e,n),s&&!m.parentId&&m.internals.rootParentIndex===void 0&&u==="auto"&&(m.internals.rootParentIndex=++s.i,m.internals.z=m.internals.z+s.i*Iq),s&&m.internals.rootParentIndex!==void 0&&(s.i=m.internals.rootParentIndex);const p=o&&!_w(u)?lI:0,{x:g,y:v,z:b}=Lq(e,m,a,c,p,u),{positionAbsolute:w}=e.internals,x=g!==w.x||v!==w.y;(x||b!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:g,y:v}:w,z:b}})}function cI(e,t,n){const r=zn(e.zIndex)?e.zIndex:0;return _w(n)?r:r+(e.selected?t:0)}function Lq(e,t,n,r,s,o){const{x:a,y:c}=t.internals.positionAbsolute,u=zr(e),f=Nl(e,n),m=wo(e.extent)?ni(f,e.extent,u):f;let p=ni({x:a+m.x,y:c+m.y},r,u);e.extent==="parent"&&(p=YT(p,u,t));const g=cI(e,s,o),v=t.internals.z??0;return{x:p.x,y:p.y,z:v>=g?v+1:g}}function kw(e,t,n,r=[0,0]){var a;const s=[],o=new Map;for(const c of e){const u=t.get(c.parentId);if(!u)continue;const f=((a=o.get(c.parentId))==null?void 0:a.expandedRect)??xo(u),m=QT(f,c.rect);o.set(c.parentId,{expandedRect:m,parent:u})}return o.size>0&&o.forEach(({expandedRect:c,parent:u},f)=>{var N;const m=u.internals.positionAbsolute,p=zr(u),g=u.origin??r,v=c.x<m.x?Math.round(Math.abs(m.x-c.x)):0,b=c.y<m.y?Math.round(Math.abs(m.y-c.y)):0,w=Math.max(p.width,Math.round(c.width)),x=Math.max(p.height,Math.round(c.height)),S=(w-p.width)*g[0],k=(x-p.height)*g[1];(v>0||b>0||S||k)&&(s.push({id:f,type:"position",position:{x:u.position.x-v+S,y:u.position.y-b+k}}),(N=n.get(f))==null||N.forEach(C=>{e.some(R=>R.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+v,y:C.position.y+b}})})),(p.width<c.width||p.height<c.height||v||b)&&s.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:w+(v?g[0]*v-S:0),height:x+(b?g[1]*b-k:0)}})}),s}function Dq(e,t,n,r,s,o,a){const c=r==null?void 0:r.querySelector(".xyflow__viewport");let u=!1;if(!c)return{changes:[],updatedInternals:u};const f=[],m=window.getComputedStyle(c),{m22:p}=new window.DOMMatrixReadOnly(m.transform),g=[];for(const v of e.values()){const b=t.get(v.id);if(!b)continue;if(b.hidden){t.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),u=!0;continue}const w=ww(v.nodeElement),x=b.measured.width!==w.width||b.measured.height!==w.height;if(!!(w.width&&w.height&&(x||!b.internals.handleBounds||v.force))){const k=v.nodeElement.getBoundingClientRect(),N=wo(b.extent)?b.extent:o;let{positionAbsolute:C}=b.internals;b.parentId&&b.extent==="parent"?C=YT(C,w,t.get(b.parentId)):N&&(C=ni(C,N,w));const R={...b,measured:w,internals:{...b.internals,positionAbsolute:C,handleBounds:{source:U_("source",v.nodeElement,k,p,b.id),target:U_("target",v.nodeElement,k,p,b.id)}}};t.set(b.id,R),b.parentId&&Nw(R,t,n,{nodeOrigin:s,zIndexMode:a}),u=!0,x&&(f.push({id:b.id,type:"dimensions",dimensions:w}),b.expandParent&&b.parentId&&g.push({id:b.id,parentId:b.parentId,rect:xo(R,s)}))}}if(g.length>0){const v=kw(g,t,n,s);f.push(...v)}return{changes:f,updatedInternals:u}}async function $q({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,o]],r),c=!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]);return Promise.resolve(c)}function Q_(e,t,n,r,s,o){let a=s;const c=r.get(a)||new Map;r.set(a,c.set(n,t)),a=`${s}-${e}`;const u=r.get(a)||new Map;if(r.set(a,u.set(n,t)),o){a=`${s}-${e}-${o}`;const f=r.get(a)||new Map;r.set(a,f.set(n,t))}}function uI(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:o,sourceHandle:a=null,targetHandle:c=null}=r,u={edgeId:r.id,source:s,target:o,sourceHandle:a,targetHandle:c},f=`${s}-${a}--${o}-${c}`,m=`${o}-${c}--${s}-${a}`;Q_("source",u,m,e,s,a),Q_("target",u,f,e,o,c),t.set(r.id,r)}}function dI(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:dI(n,t):!1}function J_(e,t,n){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function qq(e,t,n,r){const s=new Map;for(const[o,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!dI(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const c=e.get(o);c&&s.set(o,{id:o,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return s}function _p({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,c,u;const s=[];for(const[f,m]of t){const p=(a=n.get(f))==null?void 0:a.internals.userNode;p&&s.push({...p,position:m.position,dragging:r})}if(!e)return[s[0],s];const o=(c=n.get(e))==null?void 0:c.internals.userNode;return[o?{...o,position:((u=t.get(e))==null?void 0:u.position)||o.position,dragging:r}:s[0],s]}function Fq({dragItems:e,snapGrid:t,x:n,y:r}){const s=e.values().next().value;if(!s)return null;const o={x:n-s.distance.x,y:r-s.distance.y},a=Cl(o,t);return{x:a.x-o.x,y:a.y-o.y}}function Bq({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let o={x:null,y:null},a=0,c=new Map,u=!1,f={x:0,y:0},m=null,p=!1,g=null,v=!1,b=!1,w=null;function x({noDragClassName:k,handleSelector:N,domNode:C,isSelectable:R,nodeId:T,nodeClickDistance:I=0}){g=un(C);function O({x:L,y:U}){const{nodeLookup:$,nodeExtent:z,snapGrid:V,snapToGrid:G,nodeOrigin:F,onNodeDrag:q,onSelectionDrag:X,onError:D,updateNodePositions:W}=t();o={x:L,y:U};let oe=!1;const K=c.size>1,J=K&&z?T0(kl(c)):null,te=K&&G?Fq({dragItems:c,snapGrid:V,x:L,y:U}):null;for(const[Y,ee]of c){if(!$.has(Y))continue;let ie={x:L-ee.distance.x,y:U-ee.distance.y};G&&(ie=te?{x:Math.round(ie.x+te.x),y:Math.round(ie.y+te.y)}:Cl(ie,V));let ue=null;if(K&&z&&!ee.extent&&J){const{positionAbsolute:pe}=ee.internals,be=pe.x-J.x+z[0][0],ve=pe.x+ee.measured.width-J.x2+z[1][0],Re=pe.y-J.y+z[0][1],ke=pe.y+ee.measured.height-J.y2+z[1][1];ue=[[be,Re],[ve,ke]]}const{position:ge,positionAbsolute:xe}=GT({nodeId:Y,nextPosition:ie,nodeLookup:$,nodeExtent:ue||z,nodeOrigin:F,onError:D});oe=oe||ee.position.x!==ge.x||ee.position.y!==ge.y,ee.position=ge,ee.internals.positionAbsolute=xe}if(b=b||oe,!!oe&&(W(c,!0),w&&(r||q||!T&&X))){const[Y,ee]=_p({nodeId:T,dragItems:c,nodeLookup:$});r==null||r(w,c,Y,ee),q==null||q(w,Y,ee),T||X==null||X(w,ee)}}async function P(){if(!m)return;const{transform:L,panBy:U,autoPanSpeed:$,autoPanOnNodeDrag:z}=t();if(!z){u=!1,cancelAnimationFrame(a);return}const[V,G]=XT(f,m,$);(V!==0||G!==0)&&(o.x=(o.x??0)-V/L[2],o.y=(o.y??0)-G/L[2],await U({x:V,y:G})&&O(o)),a=requestAnimationFrame(P)}function B(L){var K;const{nodeLookup:U,multiSelectionActive:$,nodesDraggable:z,transform:V,snapGrid:G,snapToGrid:F,selectNodesOnDrag:q,onNodeDragStart:X,onSelectionDragStart:D,unselectNodesAndEdges:W}=t();p=!0,(!q||!R)&&!$&&T&&((K=U.get(T))!=null&&K.selected||W()),R&&q&&T&&(e==null||e(T));const oe=Xa(L.sourceEvent,{transform:V,snapGrid:G,snapToGrid:F,containerBounds:m});if(o=oe,c=qq(U,z,oe,T),c.size>0&&(n||X||!T&&D)){const[J,te]=_p({nodeId:T,dragItems:c,nodeLookup:U});n==null||n(L.sourceEvent,c,J,te),X==null||X(L.sourceEvent,J,te),T||D==null||D(L.sourceEvent,te)}}const M=ET().clickDistance(I).on("start",L=>{const{domNode:U,nodeDragThreshold:$,transform:z,snapGrid:V,snapToGrid:G}=t();m=(U==null?void 0:U.getBoundingClientRect())||null,v=!1,b=!1,w=L.sourceEvent,$===0&&B(L),o=Xa(L.sourceEvent,{transform:z,snapGrid:V,snapToGrid:G,containerBounds:m}),f=Vn(L.sourceEvent,m)}).on("drag",L=>{const{autoPanOnNodeDrag:U,transform:$,snapGrid:z,snapToGrid:V,nodeDragThreshold:G,nodeLookup:F}=t(),q=Xa(L.sourceEvent,{transform:$,snapGrid:z,snapToGrid:V,containerBounds:m});if(w=L.sourceEvent,(L.sourceEvent.type==="touchmove"&&L.sourceEvent.touches.length>1||T&&!F.has(T))&&(v=!0),!v){if(!u&&U&&p&&(u=!0,P()),!p){const X=Vn(L.sourceEvent,m),D=X.x-f.x,W=X.y-f.y;Math.sqrt(D*D+W*W)>G&&B(L)}(o.x!==q.xSnapped||o.y!==q.ySnapped)&&c&&p&&(f=Vn(L.sourceEvent,m),O(q))}}).on("end",L=>{if(!(!p||v)&&(u=!1,p=!1,cancelAnimationFrame(a),c.size>0)){const{nodeLookup:U,updateNodePositions:$,onNodeDragStop:z,onSelectionDragStop:V}=t();if(b&&($(c,!1),b=!1),s||z||!T&&V){const[G,F]=_p({nodeId:T,dragItems:c,nodeLookup:U,dragging:!1});s==null||s(L.sourceEvent,c,G,F),z==null||z(L.sourceEvent,G,F),T||V==null||V(L.sourceEvent,F)}}}).filter(L=>{const U=L.target;return!L.button&&(!k||!J_(U,`.${k}`,C))&&(!N||J_(U,N,C))});g.call(M)}function S(){g==null||g.on(".drag",null)}return{update:x,destroy:S}}function zq(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())ll(s,xo(o))>0&&r.push(o);return r}const Vq=250;function Uq(e,t,n,r){var c,u;let s=[],o=1/0;const a=zq(e,n,t+Vq);for(const f of a){const m=[...((c=f.internals.handleBounds)==null?void 0:c.source)??[],...((u=f.internals.handleBounds)==null?void 0:u.target)??[]];for(const p of m){if(r.nodeId===p.nodeId&&r.type===p.type&&r.id===p.id)continue;const{x:g,y:v}=ri(f,p,p.position,!0),b=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(v-e.y,2));b>t||(b<o?(s=[{...p,x:g,y:v}],o=b):b===o&&s.push({...p,x:g,y:v}))}}if(!s.length)return null;if(s.length>1){const f=r.type==="source"?"target":"source";return s.find(m=>m.type===f)??s[0]}return s[0]}function fI(e,t,n,r,s,o=!1){var f,m,p;const a=r.get(e);if(!a)return null;const c=s==="strict"?(f=a.internals.handleBounds)==null?void 0:f[t]:[...((m=a.internals.handleBounds)==null?void 0:m.source)??[],...((p=a.internals.handleBounds)==null?void 0:p.target)??[]],u=(n?c==null?void 0:c.find(g=>g.id===n):c==null?void 0:c[0])??null;return u&&o?{...u,...ri(a,u,u.position,!0)}:u}function hI(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Hq(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const pI=()=>!0;function Wq(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:a,domNode:c,nodeLookup:u,lib:f,autoPanOnConnect:m,flowId:p,panBy:g,cancelConnection:v,onConnectStart:b,onConnect:w,onConnectEnd:x,isValidConnection:S=pI,onReconnectEnd:k,updateConnection:N,getTransform:C,getFromHandle:R,autoPanSpeed:T,dragThreshold:I=1,handleDomNode:O}){const P=eI(e.target);let B=0,M;const{x:L,y:U}=Vn(e),$=hI(o,O),z=c==null?void 0:c.getBoundingClientRect();let V=!1;if(!z||!$)return;const G=fI(s,$,r,u,t);if(!G)return;let F=Vn(e,z),q=!1,X=null,D=!1,W=null;function oe(){if(!m||!z)return;const[ge,xe]=XT(F,z,T);g({x:ge,y:xe}),B=requestAnimationFrame(oe)}const K={...G,nodeId:s,type:$,position:G.position},J=u.get(s);let Y={inProgress:!0,isValid:null,from:ri(J,K,he.Left,!0),fromHandle:K,fromPosition:K.position,fromNode:J,to:F,toHandle:null,toPosition:F_[K.position],toNode:null,pointer:F};function ee(){V=!0,N(Y),b==null||b(e,{nodeId:s,handleId:r,handleType:$})}I===0&&ee();function ie(ge){if(!V){const{x:ke,y:ze}=Vn(ge),Ue=ke-L,vt=ze-U;if(!(Ue*Ue+vt*vt>I*I))return;ee()}if(!R()||!K){ue(ge);return}const xe=C();F=Vn(ge,z),M=Uq(El(F,xe,!1,[1,1]),n,u,K),q||(oe(),q=!0);const pe=mI(ge,{handle:M,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:S,doc:P,lib:f,flowId:p,nodeLookup:u});W=pe.handleDomNode,X=pe.connection,D=Hq(!!M,pe.isValid);const be=u.get(s),ve=be?ri(be,K,he.Left,!0):Y.from,Re={...Y,from:ve,isValid:D,to:pe.toHandle&&D?ad({x:pe.toHandle.x,y:pe.toHandle.y},xe):F,toHandle:pe.toHandle,toPosition:D&&pe.toHandle?pe.toHandle.position:F_[K.position],toNode:pe.toHandle?u.get(pe.toHandle.nodeId):null,pointer:F};N(Re),Y=Re}function ue(ge){if(!("touches"in ge&&ge.touches.length>0)){if(V){(M||W)&&X&&D&&(w==null||w(X));const{inProgress:xe,...pe}=Y,be={...pe,toPosition:Y.toHandle?Y.toPosition:null};x==null||x(ge,be),o&&(k==null||k(ge,be))}v(),cancelAnimationFrame(B),q=!1,D=!1,X=null,W=null,P.removeEventListener("mousemove",ie),P.removeEventListener("mouseup",ue),P.removeEventListener("touchmove",ie),P.removeEventListener("touchend",ue)}}P.addEventListener("mousemove",ie),P.addEventListener("mouseup",ue),P.addEventListener("touchmove",ie),P.addEventListener("touchend",ue)}function mI(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:a,lib:c,flowId:u,isValidConnection:f=pI,nodeLookup:m}){const p=o==="target",g=t?a.querySelector(`.${c}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:b}=Vn(e),w=a.elementFromPoint(v,b),x=w!=null&&w.classList.contains(`${c}-flow__handle`)?w:g,S={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const k=hI(void 0,x),N=x.getAttribute("data-nodeid"),C=x.getAttribute("data-handleid"),R=x.classList.contains("connectable"),T=x.classList.contains("connectableend");if(!N||!k)return S;const I={source:p?N:r,sourceHandle:p?C:s,target:p?r:N,targetHandle:p?s:C};S.connection=I;const P=R&&T&&(n===yo.Strict?p&&k==="source"||!p&&k==="target":N!==r||C!==s);S.isValid=P&&f(I),S.toHandle=fI(N,k,C,m,n,!0)}return S}const O0={onPointerDown:Wq,isValid:mI};function Kq({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=un(e);function o({translateExtent:c,width:u,height:f,zoomStep:m=1,pannable:p=!0,zoomable:g=!0,inversePan:v=!1}){const b=N=>{if(N.sourceEvent.type!=="wheel"||!t)return;const C=n(),R=N.sourceEvent.ctrlKey&&cl()?10:1,T=-N.sourceEvent.deltaY*(N.sourceEvent.deltaMode===1?.05:N.sourceEvent.deltaMode?1:.002)*m,I=C[2]*Math.pow(2,T*R);t.scaleTo(I)};let w=[0,0];const x=N=>{(N.sourceEvent.type==="mousedown"||N.sourceEvent.type==="touchstart")&&(w=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY])},S=N=>{const C=n();if(N.sourceEvent.type!=="mousemove"&&N.sourceEvent.type!=="touchmove"||!t)return;const R=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY],T=[R[0]-w[0],R[1]-w[1]];w=R;const I=r()*Math.max(C[2],Math.log(C[2]))*(v?-1:1),O={x:C[0]-T[0]*I,y:C[1]-T[1]*I},P=[[0,0],[u,f]];t.setViewportConstrained({x:O.x,y:O.y,zoom:C[2]},P,c)},k=zT().on("start",x).on("zoom",p?S:null).on("zoom.wheel",g?b:null);s.call(k,{})}function a(){s.on("zoom",null)}return{update:o,destroy:a,pointer:qn}}const Ad=e=>({x:e.x,y:e.y,zoom:e.k}),Np=({x:e,y:t,zoom:n})=>Rd.translate(e,t).scale(n),to=(e,t)=>e.target.closest(`.${t}`),gI=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Gq=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,kp=(e,t=0,n=Gq,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},yI=e=>{const t=e.ctrlKey&&cl()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Yq({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:a,onPanZoomStart:c,onPanZoom:u,onPanZoomEnd:f}){return m=>{if(to(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(m.ctrlKey&&a){const x=qn(m),S=yI(m),k=p*Math.pow(2,S);r.scaleTo(n,k,x,m);return}const g=m.deltaMode===1?20:1;let v=s===Zs.Vertical?0:m.deltaX*g,b=s===Zs.Horizontal?0:m.deltaY*g;!cl()&&m.shiftKey&&s!==Zs.Vertical&&(v=m.deltaY*g,b=0),r.translateBy(n,-(v/p)*o,-(b/p)*o,{internal:!0});const w=Ad(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(m,w),e.panScrollTimeout=setTimeout(()=>{f==null||f(m,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,c==null||c(m,w))}}function Xq({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const o=r.type==="wheel",a=!t&&o&&!r.ctrlKey,c=to(r,e);if(r.ctrlKey&&o&&c&&r.preventDefault(),a||c)return null;r.preventDefault(),n.call(this,r,s)}}function Qq({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,a,c;if((o=r.sourceEvent)!=null&&o.internal)return;const s=Ad(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((c=r.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function Jq({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var a,c;e.usedRightMouseButton=!!(n&&gI(t,e.mouseButton??0)),(a=o.sourceEvent)!=null&&a.sync||r([o.transform.x,o.transform.y,o.transform.k]),s&&!((c=o.sourceEvent)!=null&&c.internal)&&(s==null||s(o.sourceEvent,Ad(o.transform)))}}function Zq({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:o}){return a=>{var c;if(!((c=a.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,o&&gI(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&o(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const u=Ad(a.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,u)},n?150:0)}}}function eF({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:a,noWheelClassName:c,noPanClassName:u,lib:f,connectionInProgress:m}){return p=>{var x;const g=e||t,v=n&&p.ctrlKey,b=p.type==="wheel";if(p.button===1&&p.type==="mousedown"&&(to(p,`${f}-flow__node`)||to(p,`${f}-flow__edge`)))return!0;if(!r&&!g&&!s&&!o&&!n||a||m&&!b||to(p,c)&&b||to(p,u)&&(!b||s&&b&&!e)||!n&&p.ctrlKey&&b)return!1;if(!n&&p.type==="touchstart"&&((x=p.touches)==null?void 0:x.length)>1)return p.preventDefault(),!1;if(!g&&!s&&!v&&b||!r&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(r)&&!r.includes(p.button)&&p.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||b)&&w}}function tF({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:o,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:u}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),p=zT().scaleExtent([t,n]).translateExtent(r),g=un(e).call(p);k({x:s.x,y:s.y,zoom:vo(s.zoom,t,n)},[[0,0],[m.width,m.height]],r);const v=g.on("wheel.zoom"),b=g.on("dblclick.zoom");p.wheelDelta(yI);function w(M,L){return g?new Promise(U=>{p==null||p.interpolate((L==null?void 0:L.interpolate)==="linear"?Ya:Du).transform(kp(g,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>U(!0)),M)}):Promise.resolve(!1)}function x({noWheelClassName:M,noPanClassName:L,onPaneContextMenu:U,userSelectionActive:$,panOnScroll:z,panOnDrag:V,panOnScrollMode:G,panOnScrollSpeed:F,preventScrolling:q,zoomOnPinch:X,zoomOnScroll:D,zoomOnDoubleClick:W,zoomActivationKeyPressed:oe,lib:K,onTransformChange:J,connectionInProgress:te,paneClickDistance:Y,selectionOnDrag:ee}){$&&!f.isZoomingOrPanning&&S();const ie=z&&!oe&&!$;p.clickDistance(ee?1/0:!zn(Y)||Y<0?0:Y);const ue=ie?Yq({zoomPanValues:f,noWheelClassName:M,d3Selection:g,d3Zoom:p,panOnScrollMode:G,panOnScrollSpeed:F,zoomOnPinch:X,onPanZoomStart:a,onPanZoom:o,onPanZoomEnd:c}):Xq({noWheelClassName:M,preventScrolling:q,d3ZoomHandler:v});if(g.on("wheel.zoom",ue,{passive:!1}),!$){const xe=Qq({zoomPanValues:f,onDraggingChange:u,onPanZoomStart:a});p.on("start",xe);const pe=Jq({zoomPanValues:f,panOnDrag:V,onPaneContextMenu:!!U,onPanZoom:o,onTransformChange:J});p.on("zoom",pe);const be=Zq({zoomPanValues:f,panOnDrag:V,panOnScroll:z,onPaneContextMenu:U,onPanZoomEnd:c,onDraggingChange:u});p.on("end",be)}const ge=eF({zoomActivationKeyPressed:oe,panOnDrag:V,zoomOnScroll:D,panOnScroll:z,zoomOnDoubleClick:W,zoomOnPinch:X,userSelectionActive:$,noPanClassName:L,noWheelClassName:M,lib:K,connectionInProgress:te});p.filter(ge),W?g.on("dblclick.zoom",b):g.on("dblclick.zoom",null)}function S(){p.on("zoom",null)}async function k(M,L,U){const $=Np(M),z=p==null?void 0:p.constrain()($,L,U);return z&&await w(z),new Promise(V=>V(z))}async function N(M,L){const U=Np(M);return await w(U,L),new Promise($=>$(U))}function C(M){if(g){const L=Np(M),U=g.property("__zoom");(U.k!==M.zoom||U.x!==M.x||U.y!==M.y)&&(p==null||p.transform(g,L,null,{sync:!0}))}}function R(){const M=g?BT(g.node()):{x:0,y:0,k:1};return{x:M.x,y:M.y,zoom:M.k}}function T(M,L){return g?new Promise(U=>{p==null||p.interpolate((L==null?void 0:L.interpolate)==="linear"?Ya:Du).scaleTo(kp(g,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>U(!0)),M)}):Promise.resolve(!1)}function I(M,L){return g?new Promise(U=>{p==null||p.interpolate((L==null?void 0:L.interpolate)==="linear"?Ya:Du).scaleBy(kp(g,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>U(!0)),M)}):Promise.resolve(!1)}function O(M){p==null||p.scaleExtent(M)}function P(M){p==null||p.translateExtent(M)}function B(M){const L=!zn(M)||M<0?0:M;p==null||p.clickDistance(L)}return{update:x,destroy:S,setViewport:N,setViewportConstrained:k,getViewport:R,scaleTo:T,scaleBy:I,setScaleExtent:O,setTranslateExtent:P,syncViewport:C,setClickDistance:B}}var bo;(function(e){e.Line="line",e.Handle="handle"})(bo||(bo={}));function nF({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:o}){const a=e-t,c=n-r,u=[a>0?1:a<0?-1:0,c>0?1:c<0?-1:0];return a&&s&&(u[0]=u[0]*-1),c&&o&&(u[1]=u[1]*-1),u}function Z_(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:s}}function hs(e,t){return Math.max(0,t-e)}function ps(e,t){return Math.max(0,e-t)}function gu(e,t,n){return Math.max(0,t-e,e-n)}function eN(e,t){return e?!t:t}function rF(e,t,n,r,s,o,a,c){let{affectsX:u,affectsY:f}=t;const{isHorizontal:m,isVertical:p}=t,g=m&&p,{xSnapped:v,ySnapped:b}=n,{minWidth:w,maxWidth:x,minHeight:S,maxHeight:k}=r,{x:N,y:C,width:R,height:T,aspectRatio:I}=e;let O=Math.floor(m?v-e.pointerX:0),P=Math.floor(p?b-e.pointerY:0);const B=R+(u?-O:O),M=T+(f?-P:P),L=-o[0]*R,U=-o[1]*T;let $=gu(B,w,x),z=gu(M,S,k);if(a){let F=0,q=0;u&&O<0?F=hs(N+O+L,a[0][0]):!u&&O>0&&(F=ps(N+B+L,a[1][0])),f&&P<0?q=hs(C+P+U,a[0][1]):!f&&P>0&&(q=ps(C+M+U,a[1][1])),$=Math.max($,F),z=Math.max(z,q)}if(c){let F=0,q=0;u&&O>0?F=ps(N+O,c[0][0]):!u&&O<0&&(F=hs(N+B,c[1][0])),f&&P>0?q=ps(C+P,c[0][1]):!f&&P<0&&(q=hs(C+M,c[1][1])),$=Math.max($,F),z=Math.max(z,q)}if(s){if(m){const F=gu(B/I,S,k)*I;if($=Math.max($,F),a){let q=0;!u&&!f||u&&!f&&g?q=ps(C+U+B/I,a[1][1])*I:q=hs(C+U+(u?O:-O)/I,a[0][1])*I,$=Math.max($,q)}if(c){let q=0;!u&&!f||u&&!f&&g?q=hs(C+B/I,c[1][1])*I:q=ps(C+(u?O:-O)/I,c[0][1])*I,$=Math.max($,q)}}if(p){const F=gu(M*I,w,x)/I;if(z=Math.max(z,F),a){let q=0;!u&&!f||f&&!u&&g?q=ps(N+M*I+L,a[1][0])/I:q=hs(N+(f?P:-P)*I+L,a[0][0])/I,z=Math.max(z,q)}if(c){let q=0;!u&&!f||f&&!u&&g?q=hs(N+M*I,c[1][0])/I:q=ps(N+(f?P:-P)*I,c[0][0])/I,z=Math.max(z,q)}}}P=P+(P<0?z:-z),O=O+(O<0?$:-$),s&&(g?B>M*I?P=(eN(u,f)?-O:O)/I:O=(eN(u,f)?-P:P)*I:m?(P=O/I,f=u):(O=P*I,u=f));const V=u?N+O:N,G=f?C+P:C;return{width:R+(u?-O:O),height:T+(f?-P:P),x:o[0]*O*(u?-1:1)+V,y:o[1]*P*(f?-1:1)+G}}const vI={width:0,height:0,x:0,y:0},sF={...vI,pointerX:0,pointerY:0,aspectRatio:1};function iF(e){return[[0,0],[e.measured.width,e.measured.height]]}function oF(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,o=e.measured.width??0,a=e.measured.height??0,c=n[0]*o,u=n[1]*a;return[[r-c,s-u],[r+o-c,s+a-u]]}function aF({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=un(e);let a={controlDirection:Z_("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:f,boundaries:m,keepAspectRatio:p,resizeDirection:g,onResizeStart:v,onResize:b,onResizeEnd:w,shouldResize:x}){let S={...vI},k={...sF};a={boundaries:m,resizeDirection:g,keepAspectRatio:p,controlDirection:Z_(f)};let N,C=null,R=[],T,I,O,P=!1;const B=ET().on("start",M=>{const{nodeLookup:L,transform:U,snapGrid:$,snapToGrid:z,nodeOrigin:V,paneDomNode:G}=n();if(N=L.get(t),!N)return;C=(G==null?void 0:G.getBoundingClientRect())??null;const{xSnapped:F,ySnapped:q}=Xa(M.sourceEvent,{transform:U,snapGrid:$,snapToGrid:z,containerBounds:C});S={width:N.measured.width??0,height:N.measured.height??0,x:N.position.x??0,y:N.position.y??0},k={...S,pointerX:F,pointerY:q,aspectRatio:S.width/S.height},T=void 0,N.parentId&&(N.extent==="parent"||N.expandParent)&&(T=L.get(N.parentId),I=T&&N.extent==="parent"?iF(T):void 0),R=[],O=void 0;for(const[X,D]of L)if(D.parentId===t&&(R.push({id:X,position:{...D.position},extent:D.extent}),D.extent==="parent"||D.expandParent)){const W=oF(D,N,D.origin??V);O?O=[[Math.min(W[0][0],O[0][0]),Math.min(W[0][1],O[0][1])],[Math.max(W[1][0],O[1][0]),Math.max(W[1][1],O[1][1])]]:O=W}v==null||v(M,{...S})}).on("drag",M=>{const{transform:L,snapGrid:U,snapToGrid:$,nodeOrigin:z}=n(),V=Xa(M.sourceEvent,{transform:L,snapGrid:U,snapToGrid:$,containerBounds:C}),G=[];if(!N)return;const{x:F,y:q,width:X,height:D}=S,W={},oe=N.origin??z,{width:K,height:J,x:te,y:Y}=rF(k,a.controlDirection,V,a.boundaries,a.keepAspectRatio,oe,I,O),ee=K!==X,ie=J!==D,ue=te!==F&&ee,ge=Y!==q&&ie;if(!ue&&!ge&&!ee&&!ie)return;if((ue||ge||oe[0]===1||oe[1]===1)&&(W.x=ue?te:S.x,W.y=ge?Y:S.y,S.x=W.x,S.y=W.y,R.length>0)){const ve=te-F,Re=Y-q;for(const ke of R)ke.position={x:ke.position.x-ve+oe[0]*(K-X),y:ke.position.y-Re+oe[1]*(J-D)},G.push(ke)}if((ee||ie)&&(W.width=ee&&(!a.resizeDirection||a.resizeDirection==="horizontal")?K:S.width,W.height=ie&&(!a.resizeDirection||a.resizeDirection==="vertical")?J:S.height,S.width=W.width,S.height=W.height),T&&N.expandParent){const ve=oe[0]*(W.width??0);W.x&&W.x<ve&&(S.x=ve,k.x=k.x-(W.x-ve));const Re=oe[1]*(W.height??0);W.y&&W.y<Re&&(S.y=Re,k.y=k.y-(W.y-Re))}const xe=nF({width:S.width,prevWidth:X,height:S.height,prevHeight:D,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),pe={...S,direction:xe};(x==null?void 0:x(M,pe))!==!1&&(P=!0,b==null||b(M,pe),r(W,G))}).on("end",M=>{P&&(w==null||w(M,{...S}),s==null||s({...S}),P=!1)});o.call(B)}function u(){o.on(".drag",null)}return{update:c,destroy:u}}var Cp={exports:{}},Ep={},jp={exports:{}},Rp={};/**
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 tN;function lF(){if(tN)return Rp;tN=1;var e=bl();function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function c(p,g){var v=g(),b=r({inst:{value:v,getSnapshot:g}}),w=b[0].inst,x=b[1];return o(function(){w.value=v,w.getSnapshot=g,u(w)&&x({inst:w})},[p,v,g]),s(function(){return u(w)&&x({inst:w}),p(function(){u(w)&&x({inst:w})})},[p]),a(v),v}function u(p){var g=p.getSnapshot;p=p.value;try{var v=g();return!n(p,v)}catch{return!0}}function f(p,g){return g()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return Rp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Rp}var nN;function cF(){return nN||(nN=1,jp.exports=lF()),jp.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 rN;function uF(){if(rN)return Ep;rN=1;var e=bl(),t=cF();function n(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,c=e.useMemo,u=e.useDebugValue;return Ep.useSyncExternalStoreWithSelector=function(f,m,p,g,v){var b=o(null);if(b.current===null){var w={hasValue:!1,value:null};b.current=w}else w=b.current;b=c(function(){function S(T){if(!k){if(k=!0,N=T,T=g(T),v!==void 0&&w.hasValue){var I=w.value;if(v(I,T))return C=I}return C=T}if(I=C,r(N,T))return I;var O=g(T);return v!==void 0&&v(I,O)?(N=T,I):(N=T,C=O)}var k=!1,N,C,R=p===void 0?null:p;return[function(){return S(m())},R===null?void 0:function(){return S(R())}]},[m,p,g,v]);var x=s(f,b[0],b[1]);return a(function(){w.hasValue=!0,w.value=x},[x]),u(x),x},Ep}var sN;function dF(){return sN||(sN=1,Cp.exports=uF()),Cp.exports}var fF=dF();const hF=wl(fF),pF={},iN=e=>{let t;const n=new Set,r=(m,p)=>{const g=typeof m=="function"?m(t):m;if(!Object.is(g,t)){const v=t;t=p??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(b=>b(t,v))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>f,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(pF?"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."),n.clear()}},f=t=e(r,s,u);return u},mF=e=>e?iN(e):iN,{useDebugValue:gF}=pt,{useSyncExternalStoreWithSelector:yF}=hF,vF=e=>e;function xI(e,t=vF,n){const r=yF(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return gF(r),r}const oN=(e,t)=>{const n=mF(e),r=(s,o=t)=>xI(n,s,o);return Object.assign(r,n),r},xF=(e,t)=>e?oN(e,t):oN;function Ze(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var Cw=fT();const wF=wl(Cw),Md=j.createContext(null),bF=Md.Provider,wI=fr.error001();function De(e,t){const n=j.useContext(Md);if(n===null)throw new Error(wI);return xI(n,e,t)}function et(){const e=j.useContext(Md);if(e===null)throw new Error(wI);return j.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const aN={display:"none"},SF={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},bI="react-flow__node-desc",SI="react-flow__edge-desc",_F="react-flow__aria-live",NF=e=>e.ariaLiveMessage,kF=e=>e.ariaLabelConfig;function CF({rfId:e}){const t=De(NF);return d.jsx("div",{id:`${_F}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:SF,children:t})}function EF({rfId:e,disableKeyboardA11y:t}){const n=De(kF);return d.jsxs(d.Fragment,{children:[d.jsx("div",{id:`${bI}-${e}`,style:aN,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),d.jsx("div",{id:`${SI}-${e}`,style:aN,children:n["edge.a11yDescription.default"]}),!t&&d.jsx(CF,{rfId:e})]})}const Od=j.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const a=`${e}`.split("-");return d.jsx("div",{className:gt(["react-flow__panel",n,...a]),style:r,ref:o,...s,children:t})});Od.displayName="Panel";function jF({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:d.jsx(Od,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:d.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const RF=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},yu=e=>e.id;function TF(e,t){return Ze(e.selectedNodes.map(yu),t.selectedNodes.map(yu))&&Ze(e.selectedEdges.map(yu),t.selectedEdges.map(yu))}function IF({onSelectionChange:e}){const t=et(),{selectedNodes:n,selectedEdges:r}=De(RF,TF);return j.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[n,r,e]),null}const AF=e=>!!e.onSelectionChangeHandlers;function MF({onSelectionChange:e}){const t=De(AF);return e||t?d.jsx(IF,{onSelectionChange:e}):null}const _I=[0,0],OF={x:0,y:0,zoom:1},PF=["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"],lN=[...PF,"rfId"],LF=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}),cN={translateExtent:ol,nodeOrigin:_I,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function DF(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:a,reset:c,setDefaultNodesAndEdges:u}=De(LF,Ze),f=et();j.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{m.current=cN,c()}),[]);const m=j.useRef(cN);return j.useEffect(()=>{for(const p of lN){const g=e[p],v=m.current[p];g!==v&&(typeof e[p]>"u"||(p==="nodes"?t(g):p==="edges"?n(g):p==="minZoom"?r(g):p==="maxZoom"?s(g):p==="translateExtent"?o(g):p==="nodeExtent"?a(g):p==="ariaLabelConfig"?f.setState({ariaLabelConfig:wq(g)}):p==="fitView"?f.setState({fitViewQueued:g}):p==="fitViewOptions"?f.setState({fitViewOptions:g}):f.setState({[p]:g})))}m.current=e},lN.map(p=>e[p])),null}function uN(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function $F(e){var r;const[t,n]=j.useState(e==="system"?null:e);return j.useEffect(()=>{if(e!=="system"){n(e);return}const s=uN(),o=()=>n(s!=null&&s.matches?"dark":"light");return o(),s==null||s.addEventListener("change",o),()=>{s==null||s.removeEventListener("change",o)}},[e]),t!==null?t:(r=uN())!=null&&r.matches?"dark":"light"}const dN=typeof document<"u"?document:null;function ul(e=null,t={target:dN,actInsideInputWithModifier:!0}){const[n,r]=j.useState(!1),s=j.useRef(!1),o=j.useRef(new Set([])),[a,c]=j.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
57
+ `).replace(`
58
+
59
+ `,`
60
+ +`).split(`
61
+ `)),m=f.reduce((p,g)=>p.concat(...g),[]);return[f,m]}return[[],[]]},[e]);return j.useEffect(()=>{const u=(t==null?void 0:t.target)??dN,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=v=>{var x,S;if(s.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!s.current||s.current&&!f)&&tI(v))return!1;const w=hN(v.code,c);if(o.current.add(v[w]),fN(a,o.current,!1)){const k=((S=(x=v.composedPath)==null?void 0:x.call(v))==null?void 0:S[0])||v.target,N=(k==null?void 0:k.nodeName)==="BUTTON"||(k==null?void 0:k.nodeName)==="A";t.preventDefault!==!1&&(s.current||!N)&&v.preventDefault(),r(!0)}},p=v=>{const b=hN(v.code,c);fN(a,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(v[b]),v.key==="Meta"&&o.current.clear(),s.current=!1},g=()=>{o.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",m),u==null||u.addEventListener("keyup",p),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{u==null||u.removeEventListener("keydown",m),u==null||u.removeEventListener("keyup",p),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function fN(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function hN(e,t){return t.includes(e)?"code":"key"}const qF=()=>{const e=et();return j.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,o],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??o},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:o,maxZoom:a,panZoom:c}=e.getState(),u=xw(t,r,s,o,a,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(u,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:s,snapToGrid:o,domNode:a}=e.getState();if(!a)return t;const{x:c,y:u}=a.getBoundingClientRect(),f={x:t.x-c,y:t.y-u},m=n.snapGrid??s,p=n.snapToGrid??o;return El(f,r,p,m)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:o}=r.getBoundingClientRect(),a=ad(t,n);return{x:a.x+s,y:a.y+o}}}),[])};function NI(e,t){const n=[],r=new Map,s=[];for(const o of e)if(o.type==="add"){s.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const a=r.get(o.id);a?a.push(o):r.set(o.id,[o])}for(const o of t){const a=r.get(o.id);if(!a){n.push(o);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const c={...o};for(const u of a)FF(u,c);n.push(c)}return s.length&&s.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function FF(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function kI(e,t){return NI(e,t)}function CI(e,t){return NI(e,t)}function Ks(e,t){return{id:e,type:"select",selected:t}}function no(e,t=new Set,n=!1){const r=[];for(const[s,o]of e){const a=t.has(s);!(o.selected===void 0&&!a)&&o.selected!==a&&(n&&(o.selected=a),r.push(Ks(o.id,a)))}return r}function pN({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,a]of e.entries()){const c=t.get(a.id),u=((s=c==null?void 0:c.internals)==null?void 0:s.userNode)??c;u!==void 0&&u!==a&&n.push({id:a.id,item:a,type:"replace"}),u===void 0&&n.push({item:a,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function mN(e){return{id:e.id,type:"remove"}}const gN=e=>uq(e),BF=e=>KT(e);function EI(e){return j.forwardRef(e)}const zF=typeof window<"u"?j.useLayoutEffect:j.useEffect;function yN(e){const[t,n]=j.useState(BigInt(0)),[r]=j.useState(()=>VF(()=>n(s=>s+BigInt(1))));return zF(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function VF(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const jI=j.createContext(null);function UF({children:e}){const t=et(),n=j.useCallback(c=>{const{nodes:u=[],setNodes:f,hasDefaultNodes:m,onNodesChange:p,nodeLookup:g,fitViewQueued:v,onNodesChangeMiddlewareMap:b}=t.getState();let w=u;for(const S of c)w=typeof S=="function"?S(w):S;let x=pN({items:w,lookup:g});for(const S of b.values())x=S(x);m&&f(w),x.length>0?p==null||p(x):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:k,setNodes:N}=t.getState();S&&N(k)})},[]),r=yN(n),s=j.useCallback(c=>{const{edges:u=[],setEdges:f,hasDefaultEdges:m,onEdgesChange:p,edgeLookup:g}=t.getState();let v=u;for(const b of c)v=typeof b=="function"?b(v):b;m?f(v):p&&p(pN({items:v,lookup:g}))},[]),o=yN(s),a=j.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return d.jsx(jI.Provider,{value:a,children:e})}function HF(){const e=j.useContext(jI);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const WF=e=>!!e.panZoom;function jo(){const e=qF(),t=et(),n=HF(),r=De(WF),s=j.useMemo(()=>{const o=p=>t.getState().nodeLookup.get(p),a=p=>{n.nodeQueue.push(p)},c=p=>{n.edgeQueue.push(p)},u=p=>{var S,k;const{nodeLookup:g,nodeOrigin:v}=t.getState(),b=gN(p)?p:g.get(p.id),w=b.parentId?ZT(b.position,b.measured,b.parentId,g,v):b.position,x={...b,position:w,width:((S=b.measured)==null?void 0:S.width)??b.width,height:((k=b.measured)==null?void 0:k.height)??b.height};return xo(x)},f=(p,g,v={replace:!1})=>{a(b=>b.map(w=>{if(w.id===p){const x=typeof g=="function"?g(w):g;return v.replace&&gN(x)?x:{...w,...x}}return w}))},m=(p,g,v={replace:!1})=>{c(b=>b.map(w=>{if(w.id===p){const x=typeof g=="function"?g(w):g;return v.replace&&BF(x)?x:{...w,...x}}return w}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>{var g;return(g=o(p))==null?void 0:g.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(g=>({...g}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:a,setEdges:c,addNodes:p=>{const g=Array.isArray(p)?p:[p];n.nodeQueue.push(v=>[...v,...g])},addEdges:p=>{const g=Array.isArray(p)?p:[p];n.edgeQueue.push(v=>[...v,...g])},toObject:()=>{const{nodes:p=[],edges:g=[],transform:v}=t.getState(),[b,w,x]=v;return{nodes:p.map(S=>({...S})),edges:g.map(S=>({...S})),viewport:{x:b,y:w,zoom:x}}},deleteElements:async({nodes:p=[],edges:g=[]})=>{const{nodes:v,edges:b,onNodesDelete:w,onEdgesDelete:x,triggerNodeChanges:S,triggerEdgeChanges:k,onDelete:N,onBeforeDelete:C}=t.getState(),{nodes:R,edges:T}=await mq({nodesToRemove:p,edgesToRemove:g,nodes:v,edges:b,onBeforeDelete:C}),I=T.length>0,O=R.length>0;if(I){const P=T.map(mN);x==null||x(T),k(P)}if(O){const P=R.map(mN);w==null||w(R),S(P)}return(O||I)&&(N==null||N({nodes:R,edges:T})),{deletedNodes:R,deletedEdges:T}},getIntersectingNodes:(p,g=!0,v)=>{const b=z_(p),w=b?p:u(p),x=v!==void 0;return w?(v||t.getState().nodes).filter(S=>{const k=t.getState().nodeLookup.get(S.id);if(k&&!b&&(S.id===p.id||!k.internals.positionAbsolute))return!1;const N=xo(x?S:k),C=ll(N,w);return g&&C>0||C>=N.width*N.height||C>=w.width*w.height}):[]},isNodeIntersecting:(p,g,v=!0)=>{const w=z_(p)?p:u(p);if(!w)return!1;const x=ll(w,g);return v&&x>0||x>=g.width*g.height||x>=w.width*w.height},updateNode:f,updateNodeData:(p,g,v={replace:!1})=>{f(p,b=>{const w=typeof g=="function"?g(b):g;return v.replace?{...b,data:w}:{...b,data:{...b.data,...w}}},v)},updateEdge:m,updateEdgeData:(p,g,v={replace:!1})=>{m(p,b=>{const w=typeof g=="function"?g(b):g;return v.replace?{...b,data:w}:{...b,data:{...b.data,...w}}},v)},getNodesBounds:p=>{const{nodeLookup:g,nodeOrigin:v}=t.getState();return dq(p,{nodeLookup:g,nodeOrigin:v})},getHandleConnections:({type:p,id:g,nodeId:v})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${v}-${p}${g?`-${g}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:p,handleId:g,nodeId:v})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${v}${p?g?`-${p}-${g}`:`-${p}`:""}`))==null?void 0:b.values())??[])},fitView:async p=>{const g=t.getState().fitViewResolver??xq();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:g}),n.nodeQueue.push(v=>[...v]),g.promise}}},[]);return j.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const vN=e=>e.selected,KF=typeof window<"u"?window:void 0;function GF({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=et(),{deleteElements:r}=jo(),s=ul(e,{actInsideInputWithModifier:!1}),o=ul(t,{target:KF});j.useEffect(()=>{if(s){const{edges:a,nodes:c}=n.getState();r({nodes:c.filter(vN),edges:a.filter(vN)}),n.setState({nodesSelectionActive:!1})}},[s]),j.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function YF(e){const t=et();j.useEffect(()=>{const n=()=>{var s,o,a,c;if(!e.current||!(((o=(s=e.current).checkVisibility)==null?void 0:o.call(s))??!0))return!1;const r=ww(e.current);(r.height===0||r.width===0)&&((c=(a=t.getState()).onError)==null||c.call(a,"004",fr.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Pd={position:"absolute",width:"100%",height:"100%",top:0,left:0},XF=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function QF({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=Zs.Free,zoomOnDoubleClick:a=!0,panOnDrag:c=!0,defaultViewport:u,translateExtent:f,minZoom:m,maxZoom:p,zoomActivationKeyCode:g,preventScrolling:v=!0,children:b,noWheelClassName:w,noPanClassName:x,onViewportChange:S,isControlledViewport:k,paneClickDistance:N,selectionOnDrag:C}){const R=et(),T=j.useRef(null),{userSelectionActive:I,lib:O,connectionInProgress:P}=De(XF,Ze),B=ul(g),M=j.useRef();YF(T);const L=j.useCallback(U=>{S==null||S({x:U[0],y:U[1],zoom:U[2]}),k||R.setState({transform:U})},[S,k]);return j.useEffect(()=>{if(T.current){M.current=tF({domNode:T.current,minZoom:m,maxZoom:p,translateExtent:f,viewport:u,onDraggingChange:V=>R.setState({paneDragging:V}),onPanZoomStart:(V,G)=>{const{onViewportChangeStart:F,onMoveStart:q}=R.getState();q==null||q(V,G),F==null||F(G)},onPanZoom:(V,G)=>{const{onViewportChange:F,onMove:q}=R.getState();q==null||q(V,G),F==null||F(G)},onPanZoomEnd:(V,G)=>{const{onViewportChangeEnd:F,onMoveEnd:q}=R.getState();q==null||q(V,G),F==null||F(G)}});const{x:U,y:$,zoom:z}=M.current.getViewport();return R.setState({panZoom:M.current,transform:[U,$,z],domNode:T.current.closest(".react-flow")}),()=>{var V;(V=M.current)==null||V.destroy()}}},[]),j.useEffect(()=>{var U;(U=M.current)==null||U.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:a,panOnDrag:c,zoomActivationKeyPressed:B,preventScrolling:v,noPanClassName:x,userSelectionActive:I,noWheelClassName:w,lib:O,onTransformChange:L,connectionInProgress:P,selectionOnDrag:C,paneClickDistance:N})},[e,t,n,r,s,o,a,c,B,v,x,I,w,O,L,P,C,N]),d.jsx("div",{className:"react-flow__renderer",ref:T,style:Pd,children:b})}const JF=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ZF(){const{userSelectionActive:e,userSelectionRect:t}=De(JF,Ze);return e&&t?d.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Tp=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},eB=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function tB({isSelecting:e,selectionKeyPressed:t,selectionMode:n=al.Full,panOnDrag:r,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:a,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:f,onPaneScroll:m,onPaneMouseEnter:p,onPaneMouseMove:g,onPaneMouseLeave:v,children:b}){const w=et(),{userSelectionActive:x,elementsSelectable:S,dragging:k,connectionInProgress:N}=De(eB,Ze),C=S&&(e||x),R=j.useRef(null),T=j.useRef(),I=j.useRef(new Set),O=j.useRef(new Set),P=j.useRef(!1),B=F=>{if(P.current||N){P.current=!1;return}u==null||u(F),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},M=F=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){F.preventDefault();return}f==null||f(F)},L=m?F=>m(F):void 0,U=F=>{P.current&&(F.stopPropagation(),P.current=!1)},$=F=>{var J,te;const{domNode:q}=w.getState();if(T.current=q==null?void 0:q.getBoundingClientRect(),!T.current)return;const X=F.target===R.current;if(!X&&!!F.target.closest(".nokey")||!e||!(o&&X||t)||F.button!==0||!F.isPrimary)return;(te=(J=F.target)==null?void 0:J.setPointerCapture)==null||te.call(J,F.pointerId),P.current=!1;const{x:oe,y:K}=Vn(F.nativeEvent,T.current);w.setState({userSelectionRect:{width:0,height:0,startX:oe,startY:K,x:oe,y:K}}),X||(F.stopPropagation(),F.preventDefault())},z=F=>{const{userSelectionRect:q,transform:X,nodeLookup:D,edgeLookup:W,connectionLookup:oe,triggerNodeChanges:K,triggerEdgeChanges:J,defaultEdgeOptions:te,resetSelectedElements:Y}=w.getState();if(!T.current||!q)return;const{x:ee,y:ie}=Vn(F.nativeEvent,T.current),{startX:ue,startY:ge}=q;if(!P.current){const Re=t?0:s;if(Math.hypot(ee-ue,ie-ge)<=Re)return;Y(),a==null||a(F)}P.current=!0;const xe={startX:ue,startY:ge,x:ee<ue?ee:ue,y:ie<ge?ie:ge,width:Math.abs(ee-ue),height:Math.abs(ie-ge)},pe=I.current,be=O.current;I.current=new Set(vw(D,xe,X,n===al.Partial,!0).map(Re=>Re.id)),O.current=new Set;const ve=(te==null?void 0:te.selectable)??!0;for(const Re of I.current){const ke=oe.get(Re);if(ke)for(const{edgeId:ze}of ke.values()){const Ue=W.get(ze);Ue&&(Ue.selectable??ve)&&O.current.add(ze)}}if(!V_(pe,I.current)){const Re=no(D,I.current,!0);K(Re)}if(!V_(be,O.current)){const Re=no(W,O.current);J(Re)}w.setState({userSelectionRect:xe,userSelectionActive:!0,nodesSelectionActive:!1})},V=F=>{var q,X;F.button===0&&((X=(q=F.target)==null?void 0:q.releasePointerCapture)==null||X.call(q,F.pointerId),!x&&F.target===R.current&&w.getState().userSelectionRect&&(B==null||B(F)),w.setState({userSelectionActive:!1,userSelectionRect:null}),P.current&&(c==null||c(F),w.setState({nodesSelectionActive:I.current.size>0})))},G=r===!0||Array.isArray(r)&&r.includes(0);return d.jsxs("div",{className:gt(["react-flow__pane",{draggable:G,dragging:k,selection:e}]),onClick:C?void 0:Tp(B,R),onContextMenu:Tp(M,R),onWheel:Tp(L,R),onPointerEnter:C?void 0:p,onPointerMove:C?z:g,onPointerUp:C?V:void 0,onPointerDownCapture:C?$:void 0,onClickCapture:C?U:void 0,onPointerLeave:v,ref:R,style:Pd,children:[b,d.jsx(ZF,{})]})}function P0({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:a,nodeLookup:c,onError:u}=t.getState(),f=c.get(e);if(!f){u==null||u("012",fr.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&a)&&(o({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var m;return(m=r==null?void 0:r.current)==null?void 0:m.blur()})):s([e])}function RI({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:o,nodeClickDistance:a}){const c=et(),[u,f]=j.useState(!1),m=j.useRef();return j.useEffect(()=>{m.current=Bq({getStoreItems:()=>c.getState(),onNodeMouseDown:p=>{P0({id:p,store:c,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),j.useEffect(()=>{var p,g;if(t)(p=m.current)==null||p.destroy();else if(e.current)return(g=m.current)==null||g.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:s,nodeClickDistance:a}),()=>{var v;(v=m.current)==null||v.destroy()}},[n,r,t,o,e,s]),u}const nB=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function TI(){const e=et();return j.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:o,nodesDraggable:a,onError:c,updateNodePositions:u,nodeLookup:f,nodeOrigin:m}=e.getState(),p=new Map,g=nB(a),v=s?o[0]:5,b=s?o[1]:5,w=n.direction.x*v*n.factor,x=n.direction.y*b*n.factor;for(const[,S]of f){if(!g(S))continue;let k={x:S.internals.positionAbsolute.x+w,y:S.internals.positionAbsolute.y+x};s&&(k=Cl(k,o));const{position:N,positionAbsolute:C}=GT({nodeId:S.id,nextPosition:k,nodeLookup:f,nodeExtent:r,nodeOrigin:m,onError:c});S.position=N,S.internals.positionAbsolute=C,p.set(S.id,S)}u(p)},[])}const Ew=j.createContext(null),rB=Ew.Provider;Ew.Consumer;const II=()=>j.useContext(Ew),sB=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),iB=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:o,connection:a}=r,{fromHandle:c,toHandle:u,isValid:f}=a,m=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:m,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:o===yo.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!s,valid:m&&f}};function oB({type:e="source",position:t=he.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:a,onConnect:c,children:u,className:f,onMouseDown:m,onTouchStart:p,...g},v){var z,V;const b=a||null,w=e==="target",x=et(),S=II(),{connectOnClick:k,noPanClassName:N,rfId:C}=De(sB,Ze),{connectingFrom:R,connectingTo:T,clickConnecting:I,isPossibleEndHandle:O,connectionInProcess:P,clickConnectionInProcess:B,valid:M}=De(iB(S,b,e),Ze);S||(V=(z=x.getState()).onError)==null||V.call(z,"010",fr.error010());const L=G=>{const{defaultEdgeOptions:F,onConnect:q,hasDefaultEdges:X}=x.getState(),D={...F,...G};if(X){const{edges:W,setEdges:oe}=x.getState();oe(oI(D,W))}q==null||q(D),c==null||c(D)},U=G=>{if(!S)return;const F=nI(G.nativeEvent);if(s&&(F&&G.button===0||!F)){const q=x.getState();O0.onPointerDown(G.nativeEvent,{handleDomNode:G.currentTarget,autoPanOnConnect:q.autoPanOnConnect,connectionMode:q.connectionMode,connectionRadius:q.connectionRadius,domNode:q.domNode,nodeLookup:q.nodeLookup,lib:q.lib,isTarget:w,handleId:b,nodeId:S,flowId:q.rfId,panBy:q.panBy,cancelConnection:q.cancelConnection,onConnectStart:q.onConnectStart,onConnectEnd:q.onConnectEnd,updateConnection:q.updateConnection,onConnect:L,isValidConnection:n||q.isValidConnection,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,autoPanSpeed:q.autoPanSpeed,dragThreshold:q.connectionDragThreshold})}F?m==null||m(G):p==null||p(G)},$=G=>{const{onClickConnectStart:F,onClickConnectEnd:q,connectionClickStartHandle:X,connectionMode:D,isValidConnection:W,lib:oe,rfId:K,nodeLookup:J,connection:te}=x.getState();if(!S||!X&&!s)return;if(!X){F==null||F(G.nativeEvent,{nodeId:S,handleId:b,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:S,type:e,id:b}});return}const Y=eI(G.target),ee=n||W,{connection:ie,isValid:ue}=O0.isValid(G.nativeEvent,{handle:{nodeId:S,id:b,type:e},connectionMode:D,fromNodeId:X.nodeId,fromHandleId:X.id||null,fromType:X.type,isValidConnection:ee,flowId:K,doc:Y,lib:oe,nodeLookup:J});ue&&ie&&L(ie);const ge=structuredClone(te);delete ge.inProgress,ge.toPosition=ge.toHandle?ge.toHandle.position:null,q==null||q(G,ge),x.setState({connectionClickStartHandle:null})};return d.jsx("div",{"data-handleid":b,"data-nodeid":S,"data-handlepos":t,"data-id":`${C}-${S}-${b}-${e}`,className:gt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",N,f,{source:!w,target:w,connectable:r,connectablestart:s,connectableend:o,clickconnecting:I,connectingfrom:R,connectingto:T,valid:M,connectionindicator:r&&(!P||O)&&(P||B?o:s)}]),onMouseDown:U,onTouchStart:U,onClick:k?$:void 0,ref:v,...g,children:u})}const qe=j.memo(EI(oB));function aB({data:e,isConnectable:t,sourcePosition:n=he.Bottom}){return d.jsxs(d.Fragment,{children:[e==null?void 0:e.label,d.jsx(qe,{type:"source",position:n,isConnectable:t})]})}function lB({data:e,isConnectable:t,targetPosition:n=he.Top,sourcePosition:r=he.Bottom}){return d.jsxs(d.Fragment,{children:[d.jsx(qe,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,d.jsx(qe,{type:"source",position:r,isConnectable:t})]})}function cB(){return null}function uB({data:e,isConnectable:t,targetPosition:n=he.Top}){return d.jsxs(d.Fragment,{children:[d.jsx(qe,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const ld={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},xN={input:aB,default:lB,output:uB,group:cB};function dB(e){var t,n,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const fB=e=>{const{width:t,height:n,x:r,y:s}=kl(e.nodeLookup,{filter:o=>!!o.selected});return{width:zn(t)?t:null,height:zn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function hB({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=et(),{width:s,height:o,transformString:a,userSelectionActive:c}=De(fB,Ze),u=TI(),f=j.useRef(null);if(j.useEffect(()=>{var g;n||(g=f.current)==null||g.focus({preventScroll:!0})},[n]),RI({nodeRef:f}),c||!s||!o)return null;const m=e?g=>{const v=r.getState().nodes.filter(b=>b.selected);e(g,v)}:void 0,p=g=>{Object.prototype.hasOwnProperty.call(ld,g.key)&&(g.preventDefault(),u({direction:ld[g.key],factor:g.shiftKey?4:1}))};return d.jsx("div",{className:gt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:d.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:s,height:o}})})}const wN=typeof window<"u"?window:void 0,pB=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function AI({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:a,paneClickDistance:c,deleteKeyCode:u,selectionKeyCode:f,selectionOnDrag:m,selectionMode:p,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:b,panActivationKeyCode:w,zoomActivationKeyCode:x,elementsSelectable:S,zoomOnScroll:k,zoomOnPinch:N,panOnScroll:C,panOnScrollSpeed:R,panOnScrollMode:T,zoomOnDoubleClick:I,panOnDrag:O,defaultViewport:P,translateExtent:B,minZoom:M,maxZoom:L,preventScrolling:U,onSelectionContextMenu:$,noWheelClassName:z,noPanClassName:V,disableKeyboardA11y:G,onViewportChange:F,isControlledViewport:q}){const{nodesSelectionActive:X,userSelectionActive:D}=De(pB,Ze),W=ul(f,{target:wN}),oe=ul(w,{target:wN}),K=oe||O,J=oe||C,te=m&&K!==!0,Y=W||D||te;return GF({deleteKeyCode:u,multiSelectionKeyCode:b}),d.jsx(QF,{onPaneContextMenu:o,elementsSelectable:S,zoomOnScroll:k,zoomOnPinch:N,panOnScroll:J,panOnScrollSpeed:R,panOnScrollMode:T,zoomOnDoubleClick:I,panOnDrag:!W&&K,defaultViewport:P,translateExtent:B,minZoom:M,maxZoom:L,zoomActivationKeyCode:x,preventScrolling:U,noWheelClassName:z,noPanClassName:V,onViewportChange:F,isControlledViewport:q,paneClickDistance:c,selectionOnDrag:te,children:d.jsxs(tB,{onSelectionStart:g,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:a,panOnDrag:K,isSelecting:!!Y,selectionMode:p,selectionKeyPressed:W,paneClickDistance:c,selectionOnDrag:te,children:[e,X&&d.jsx(hB,{onSelectionContextMenu:$,noPanClassName:V,disableKeyboardA11y:G})]})})}AI.displayName="FlowRenderer";const mB=j.memo(AI),gB=e=>t=>e?vw(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function yB(e){return De(j.useCallback(gB(e),[e]),Ze)}const vB=e=>e.updateNodeInternals;function xB(){const e=De(vB),[t]=j.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const o=s.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:s.target,force:!0})}),e(r)}));return j.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function wB({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=et(),o=j.useRef(null),a=j.useRef(null),c=j.useRef(e.sourcePosition),u=j.useRef(e.targetPosition),f=j.useRef(t),m=n&&!!e.internals.handleBounds;return j.useEffect(()=>{o.current&&!e.hidden&&(!m||a.current!==o.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(o.current),a.current=o.current)},[m,e.hidden]),j.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),j.useEffect(()=>{if(o.current){const p=f.current!==t,g=c.current!==e.sourcePosition,v=u.current!==e.targetPosition;(p||g||v)&&(f.current=t,c.current=e.sourcePosition,u.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function bB({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:o,onDoubleClick:a,nodesDraggable:c,elementsSelectable:u,nodesConnectable:f,nodesFocusable:m,resizeObserver:p,noDragClassName:g,noPanClassName:v,disableKeyboardA11y:b,rfId:w,nodeTypes:x,nodeClickDistance:S,onError:k}){const{node:N,internals:C,isParent:R}=De(ee=>{const ie=ee.nodeLookup.get(e),ue=ee.parentLookup.has(e);return{node:ie,internals:ie.internals,isParent:ue}},Ze);let T=N.type||"default",I=(x==null?void 0:x[T])||xN[T];I===void 0&&(k==null||k("003",fr.error003(T)),T="default",I=(x==null?void 0:x.default)||xN.default);const O=!!(N.draggable||c&&typeof N.draggable>"u"),P=!!(N.selectable||u&&typeof N.selectable>"u"),B=!!(N.connectable||f&&typeof N.connectable>"u"),M=!!(N.focusable||m&&typeof N.focusable>"u"),L=et(),U=JT(N),$=wB({node:N,nodeType:T,hasDimensions:U,resizeObserver:p}),z=RI({nodeRef:$,disabled:N.hidden||!O,noDragClassName:g,handleSelector:N.dragHandle,nodeId:e,isSelectable:P,nodeClickDistance:S}),V=TI();if(N.hidden)return null;const G=zr(N),F=dB(N),q=P||O||t||n||r||s,X=n?ee=>n(ee,{...C.userNode}):void 0,D=r?ee=>r(ee,{...C.userNode}):void 0,W=s?ee=>s(ee,{...C.userNode}):void 0,oe=o?ee=>o(ee,{...C.userNode}):void 0,K=a?ee=>a(ee,{...C.userNode}):void 0,J=ee=>{const{selectNodesOnDrag:ie,nodeDragThreshold:ue}=L.getState();P&&(!ie||!O||ue>0)&&P0({id:e,store:L,nodeRef:$}),t&&t(ee,{...C.userNode})},te=ee=>{if(!(tI(ee.nativeEvent)||b)){if(VT.includes(ee.key)&&P){const ie=ee.key==="Escape";P0({id:e,store:L,unselect:ie,nodeRef:$})}else if(O&&N.selected&&Object.prototype.hasOwnProperty.call(ld,ee.key)){ee.preventDefault();const{ariaLabelConfig:ie}=L.getState();L.setState({ariaLiveMessage:ie["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),V({direction:ld[ee.key],factor:ee.shiftKey?4:1})}}},Y=()=>{var be;if(b||!((be=$.current)!=null&&be.matches(":focus-visible")))return;const{transform:ee,width:ie,height:ue,autoPanOnNodeFocus:ge,setCenter:xe}=L.getState();if(!ge)return;vw(new Map([[e,N]]),{x:0,y:0,width:ie,height:ue},ee,!0).length>0||xe(N.position.x+G.width/2,N.position.y+G.height/2,{zoom:ee[2]})};return d.jsx("div",{className:gt(["react-flow__node",`react-flow__node-${T}`,{[v]:O},N.className,{selected:N.selected,selectable:P,parent:R,draggable:O,dragging:z}]),ref:$,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:q?"all":"none",visibility:U?"visible":"hidden",...N.style,...F},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:X,onMouseMove:D,onMouseLeave:W,onContextMenu:oe,onClick:J,onDoubleClick:K,onKeyDown:M?te:void 0,tabIndex:M?0:void 0,onFocus:M?Y:void 0,role:N.ariaRole??(M?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${bI}-${w}`,"aria-label":N.ariaLabel,...N.domAttributes,children:d.jsx(rB,{value:e,children:d.jsx(I,{id:e,data:N.data,type:T,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:N.selected??!1,selectable:P,draggable:O,deletable:N.deletable??!0,isConnectable:B,sourcePosition:N.sourcePosition,targetPosition:N.targetPosition,dragging:z,dragHandle:N.dragHandle,zIndex:C.z,parentId:N.parentId,...G})})})}var SB=j.memo(bB);const _B=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function MI(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:o}=De(_B,Ze),a=yB(e.onlyRenderVisibleElements),c=xB();return d.jsx("div",{className:"react-flow__nodes",style:Pd,children:a.map(u=>d.jsx(SB,{id:u,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:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:o},u))})}MI.displayName="NodeRenderer";const NB=j.memo(MI);function kB(e){return De(j.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const r=[];if(n.width&&n.height)for(const s of n.edges){const o=n.nodeLookup.get(s.source),a=n.nodeLookup.get(s.target);o&&a&&_q({sourceNode:o,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),Ze)}const CB=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return d.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},EB=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return d.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},bN={[id.Arrow]:CB,[id.ArrowClosed]:EB};function jB(e){const t=et();return j.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(bN,e)?bN[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",fr.error009(e)),null)},[e])}const RB=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:a,orient:c="auto-start-reverse"})=>{const u=jB(t);return u?d.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:c,refX:"0",refY:"0",children:d.jsx(u,{color:n,strokeWidth:a})}):null},OI=({defaultColor:e,rfId:t})=>{const n=De(o=>o.edges),r=De(o=>o.defaultEdgeOptions),s=j.useMemo(()=>Tq(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return s.length?d.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:d.jsx("defs",{children:s.map(o=>d.jsx(RB,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};OI.displayName="MarkerDefinitions";var TB=j.memo(OI);function PI({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:a=[2,4],labelBgBorderRadius:c=2,children:u,className:f,...m}){const[p,g]=j.useState({x:1,y:0,width:0,height:0}),v=gt(["react-flow__edge-textwrapper",f]),b=j.useRef(null);return j.useEffect(()=>{if(b.current){const w=b.current.getBBox();g({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?d.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:v,visibility:p.width?"visible":"hidden",...m,children:[s&&d.jsx("rect",{width:p.width+2*a[0],x:-a[0],y:-a[1],height:p.height+2*a[1],className:"react-flow__edge-textbg",style:o,rx:c,ry:c}),d.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:b,style:r,children:n}),u]}):null}PI.displayName="EdgeText";const IB=j.memo(PI);function Ld({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:u,interactionWidth:f=20,...m}){return d.jsxs(d.Fragment,{children:[d.jsx("path",{...m,d:e,fill:"none",className:gt(["react-flow__edge-path",m.className])}),f?d.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&zn(t)&&zn(n)?d.jsx(IB,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:u}):null]})}function SN({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===he.Left||e===he.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function LI({sourceX:e,sourceY:t,sourcePosition:n=he.Bottom,targetX:r,targetY:s,targetPosition:o=he.Top}){const[a,c]=SN({pos:n,x1:e,y1:t,x2:r,y2:s}),[u,f]=SN({pos:o,x1:r,y1:s,x2:e,y2:t}),[m,p,g,v]=rI({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:a,sourceControlY:c,targetControlX:u,targetControlY:f});return[`M${e},${t} C${a},${c} ${u},${f} ${r},${s}`,m,p,g,v]}function DI(e){return j.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:a,targetPosition:c,label:u,labelStyle:f,labelShowBg:m,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:x,interactionWidth:S})=>{const[k,N,C]=LI({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:o,targetPosition:c}),R=e.isInternal?void 0:t;return d.jsx(Ld,{id:R,path:k,labelX:N,labelY:C,label:u,labelStyle:f,labelShowBg:m,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:x,interactionWidth:S})})}const AB=DI({isInternal:!1}),$I=DI({isInternal:!0});AB.displayName="SimpleBezierEdge";$I.displayName="SimpleBezierEdgeInternal";function qI(e){return j.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:p,style:g,sourcePosition:v=he.Bottom,targetPosition:b=he.Top,markerEnd:w,markerStart:x,pathOptions:S,interactionWidth:k})=>{const[N,C,R]=I0({sourceX:n,sourceY:r,sourcePosition:v,targetX:s,targetY:o,targetPosition:b,borderRadius:S==null?void 0:S.borderRadius,offset:S==null?void 0:S.offset,stepPosition:S==null?void 0:S.stepPosition}),T=e.isInternal?void 0:t;return d.jsx(Ld,{id:T,path:N,labelX:C,labelY:R,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:p,style:g,markerEnd:w,markerStart:x,interactionWidth:k})})}const FI=qI({isInternal:!1}),BI=qI({isInternal:!0});FI.displayName="SmoothStepEdge";BI.displayName="SmoothStepEdgeInternal";function zI(e){return j.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return d.jsx(FI,{...n,id:r,pathOptions:j.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const MB=zI({isInternal:!1}),VI=zI({isInternal:!0});MB.displayName="StepEdge";VI.displayName="StepEdgeInternal";function UI(e){return j.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:b,interactionWidth:w})=>{const[x,S,k]=aI({sourceX:n,sourceY:r,targetX:s,targetY:o}),N=e.isInternal?void 0:t;return d.jsx(Ld,{id:N,path:x,labelX:S,labelY:k,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:b,interactionWidth:w})})}const OB=UI({isInternal:!1}),HI=UI({isInternal:!0});OB.displayName="StraightEdge";HI.displayName="StraightEdgeInternal";function WI(e){return j.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:a=he.Bottom,targetPosition:c=he.Top,label:u,labelStyle:f,labelShowBg:m,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:x,pathOptions:S,interactionWidth:k})=>{const[N,C,R]=sI({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:o,targetPosition:c,curvature:S==null?void 0:S.curvature}),T=e.isInternal?void 0:t;return d.jsx(Ld,{id:T,path:N,labelX:C,labelY:R,label:u,labelStyle:f,labelShowBg:m,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:x,interactionWidth:k})})}const PB=WI({isInternal:!1}),KI=WI({isInternal:!0});PB.displayName="BezierEdge";KI.displayName="BezierEdgeInternal";const _N={default:KI,straight:HI,step:VI,smoothstep:BI,simplebezier:$I},NN={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},LB=(e,t,n)=>n===he.Left?e-t:n===he.Right?e+t:e,DB=(e,t,n)=>n===he.Top?e-t:n===he.Bottom?e+t:e,kN="react-flow__edgeupdater";function CN({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:a,type:c}){return d.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:a,className:gt([kN,`${kN}-${c}`]),cx:LB(t,r,e),cy:DB(n,r,e),r,stroke:"transparent",fill:"transparent"})}function $B({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:o,targetY:a,sourcePosition:c,targetPosition:u,onReconnect:f,onReconnectStart:m,onReconnectEnd:p,setReconnecting:g,setUpdateHover:v}){const b=et(),w=(C,R)=>{if(C.button!==0)return;const{autoPanOnConnect:T,domNode:I,isValidConnection:O,connectionMode:P,connectionRadius:B,lib:M,onConnectStart:L,onConnectEnd:U,cancelConnection:$,nodeLookup:z,rfId:V,panBy:G,updateConnection:F}=b.getState(),q=R.type==="target",X=(oe,K)=>{g(!1),p==null||p(oe,n,R.type,K)},D=oe=>f==null?void 0:f(n,oe),W=(oe,K)=>{g(!0),m==null||m(C,n,R.type),L==null||L(oe,K)};O0.onPointerDown(C.nativeEvent,{autoPanOnConnect:T,connectionMode:P,connectionRadius:B,domNode:I,handleId:R.id,nodeId:R.nodeId,nodeLookup:z,isTarget:q,edgeUpdaterType:R.type,lib:M,flowId:V,cancelConnection:$,panBy:G,isValidConnection:O,onConnect:D,onConnectStart:W,onConnectEnd:U,onReconnectEnd:X,updateConnection:F,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},x=C=>w(C,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),S=C=>w(C,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),k=()=>v(!0),N=()=>v(!1);return d.jsxs(d.Fragment,{children:[(e===!0||e==="source")&&d.jsx(CN,{position:c,centerX:r,centerY:s,radius:t,onMouseDown:x,onMouseEnter:k,onMouseOut:N,type:"source"}),(e===!0||e==="target")&&d.jsx(CN,{position:u,centerX:o,centerY:a,radius:t,onMouseDown:S,onMouseEnter:k,onMouseOut:N,type:"target"})]})}function qB({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:o,onContextMenu:a,onMouseEnter:c,onMouseMove:u,onMouseLeave:f,reconnectRadius:m,onReconnect:p,onReconnectStart:g,onReconnectEnd:v,rfId:b,edgeTypes:w,noPanClassName:x,onError:S,disableKeyboardA11y:k}){let N=De(xe=>xe.edgeLookup.get(e));const C=De(xe=>xe.defaultEdgeOptions);N=C?{...C,...N}:N;let R=N.type||"default",T=(w==null?void 0:w[R])||_N[R];T===void 0&&(S==null||S("011",fr.error011(R)),R="default",T=(w==null?void 0:w.default)||_N.default);const I=!!(N.focusable||t&&typeof N.focusable>"u"),O=typeof p<"u"&&(N.reconnectable||n&&typeof N.reconnectable>"u"),P=!!(N.selectable||r&&typeof N.selectable>"u"),B=j.useRef(null),[M,L]=j.useState(!1),[U,$]=j.useState(!1),z=et(),{zIndex:V,sourceX:G,sourceY:F,targetX:q,targetY:X,sourcePosition:D,targetPosition:W}=De(j.useCallback(xe=>{const pe=xe.nodeLookup.get(N.source),be=xe.nodeLookup.get(N.target);if(!pe||!be)return{zIndex:N.zIndex,...NN};const ve=Rq({id:e,sourceNode:pe,targetNode:be,sourceHandle:N.sourceHandle||null,targetHandle:N.targetHandle||null,connectionMode:xe.connectionMode,onError:S});return{zIndex:Sq({selected:N.selected,zIndex:N.zIndex,sourceNode:pe,targetNode:be,elevateOnSelect:xe.elevateEdgesOnSelect,zIndexMode:xe.zIndexMode}),...ve||NN}},[N.source,N.target,N.sourceHandle,N.targetHandle,N.selected,N.zIndex]),Ze),oe=j.useMemo(()=>N.markerStart?`url('#${A0(N.markerStart,b)}')`:void 0,[N.markerStart,b]),K=j.useMemo(()=>N.markerEnd?`url('#${A0(N.markerEnd,b)}')`:void 0,[N.markerEnd,b]);if(N.hidden||G===null||F===null||q===null||X===null)return null;const J=xe=>{var Re;const{addSelectedEdges:pe,unselectNodesAndEdges:be,multiSelectionActive:ve}=z.getState();P&&(z.setState({nodesSelectionActive:!1}),N.selected&&ve?(be({nodes:[],edges:[N]}),(Re=B.current)==null||Re.blur()):pe([e])),s&&s(xe,N)},te=o?xe=>{o(xe,{...N})}:void 0,Y=a?xe=>{a(xe,{...N})}:void 0,ee=c?xe=>{c(xe,{...N})}:void 0,ie=u?xe=>{u(xe,{...N})}:void 0,ue=f?xe=>{f(xe,{...N})}:void 0,ge=xe=>{var pe;if(!k&&VT.includes(xe.key)&&P){const{unselectNodesAndEdges:be,addSelectedEdges:ve}=z.getState();xe.key==="Escape"?((pe=B.current)==null||pe.blur(),be({edges:[N]})):ve([e])}};return d.jsx("svg",{style:{zIndex:V},children:d.jsxs("g",{className:gt(["react-flow__edge",`react-flow__edge-${R}`,N.className,x,{selected:N.selected,animated:N.animated,inactive:!P&&!s,updating:M,selectable:P}]),onClick:J,onDoubleClick:te,onContextMenu:Y,onMouseEnter:ee,onMouseMove:ie,onMouseLeave:ue,onKeyDown:I?ge:void 0,tabIndex:I?0:void 0,role:N.ariaRole??(I?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":N.ariaLabel===null?void 0:N.ariaLabel||`Edge from ${N.source} to ${N.target}`,"aria-describedby":I?`${SI}-${b}`:void 0,ref:B,...N.domAttributes,children:[!U&&d.jsx(T,{id:e,source:N.source,target:N.target,type:N.type,selected:N.selected,animated:N.animated,selectable:P,deletable:N.deletable??!0,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,sourceX:G,sourceY:F,targetX:q,targetY:X,sourcePosition:D,targetPosition:W,data:N.data,style:N.style,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerStart:oe,markerEnd:K,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth}),O&&d.jsx($B,{edge:N,isReconnectable:O,reconnectRadius:m,onReconnect:p,onReconnectStart:g,onReconnectEnd:v,sourceX:G,sourceY:F,targetX:q,targetY:X,sourcePosition:D,targetPosition:W,setUpdateHover:L,setReconnecting:$})]})})}var FB=j.memo(qB);const BB=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function GI({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:o,onEdgeContextMenu:a,onEdgeMouseEnter:c,onEdgeMouseMove:u,onEdgeMouseLeave:f,onEdgeClick:m,reconnectRadius:p,onEdgeDoubleClick:g,onReconnectStart:v,onReconnectEnd:b,disableKeyboardA11y:w}){const{edgesFocusable:x,edgesReconnectable:S,elementsSelectable:k,onError:N}=De(BB,Ze),C=kB(t);return d.jsxs("div",{className:"react-flow__edges",children:[d.jsx(TB,{defaultColor:e,rfId:n}),C.map(R=>d.jsx(FB,{id:R,edgesFocusable:x,edgesReconnectable:S,elementsSelectable:k,noPanClassName:s,onReconnect:o,onContextMenu:a,onMouseEnter:c,onMouseMove:u,onMouseLeave:f,onClick:m,reconnectRadius:p,onDoubleClick:g,onReconnectStart:v,onReconnectEnd:b,rfId:n,onError:N,edgeTypes:r,disableKeyboardA11y:w},R))]})}GI.displayName="EdgeRenderer";const zB=j.memo(GI),VB=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function UB({children:e}){const t=De(VB);return d.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function HB(e){const t=jo(),n=j.useRef(!1);j.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const WB=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function KB(e){const t=De(WB),n=et();return j.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function GB(e){return e.connection.inProgress?{...e.connection,to:El(e.connection.to,e.transform)}:{...e.connection}}function YB(e){return GB}function XB(e){const t=YB();return De(t,Ze)}const QB=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function JB({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:o,height:a,isValid:c,inProgress:u}=De(QB,Ze);return!(o&&s&&u)?null:d.jsx("svg",{style:e,width:o,height:a,className:"react-flow__connectionline react-flow__container",children:d.jsx("g",{className:gt(["react-flow__connection",WT(c)]),children:d.jsx(YI,{style:t,type:n,CustomComponent:r,isValid:c})})})}const YI=({style:e,type:t=ws.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:a,fromHandle:c,fromPosition:u,to:f,toNode:m,toHandle:p,toPosition:g,pointer:v}=XB();if(!s)return;if(n)return d.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:c,fromX:o.x,fromY:o.y,toX:f.x,toY:f.y,fromPosition:u,toPosition:g,connectionStatus:WT(r),toNode:m,toHandle:p,pointer:v});let b="";const w={sourceX:o.x,sourceY:o.y,sourcePosition:u,targetX:f.x,targetY:f.y,targetPosition:g};switch(t){case ws.Bezier:[b]=sI(w);break;case ws.SimpleBezier:[b]=LI(w);break;case ws.Step:[b]=I0({...w,borderRadius:0});break;case ws.SmoothStep:[b]=I0(w);break;default:[b]=aI(w)}return d.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};YI.displayName="ConnectionLine";const ZB={};function EN(e=ZB){j.useRef(e),et(),j.useEffect(()=>{},[e])}function e6(){et(),j.useRef(!1),j.useEffect(()=>{},[])}function XI({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:f,onNodeContextMenu:m,onSelectionContextMenu:p,onSelectionStart:g,onSelectionEnd:v,connectionLineType:b,connectionLineStyle:w,connectionLineComponent:x,connectionLineContainerStyle:S,selectionKeyCode:k,selectionOnDrag:N,selectionMode:C,multiSelectionKeyCode:R,panActivationKeyCode:T,zoomActivationKeyCode:I,deleteKeyCode:O,onlyRenderVisibleElements:P,elementsSelectable:B,defaultViewport:M,translateExtent:L,minZoom:U,maxZoom:$,preventScrolling:z,defaultMarkerColor:V,zoomOnScroll:G,zoomOnPinch:F,panOnScroll:q,panOnScrollSpeed:X,panOnScrollMode:D,zoomOnDoubleClick:W,panOnDrag:oe,onPaneClick:K,onPaneMouseEnter:J,onPaneMouseMove:te,onPaneMouseLeave:Y,onPaneScroll:ee,onPaneContextMenu:ie,paneClickDistance:ue,nodeClickDistance:ge,onEdgeContextMenu:xe,onEdgeMouseEnter:pe,onEdgeMouseMove:be,onEdgeMouseLeave:ve,reconnectRadius:Re,onReconnect:ke,onReconnectStart:ze,onReconnectEnd:Ue,noDragClassName:vt,noWheelClassName:Pe,noPanClassName:ft,disableKeyboardA11y:He,nodeExtent:hn,rfId:Zt,viewport:en,onViewportChange:Lt}){return EN(e),EN(t),e6(),HB(n),KB(en),d.jsx(mB,{onPaneClick:K,onPaneMouseEnter:J,onPaneMouseMove:te,onPaneMouseLeave:Y,onPaneContextMenu:ie,onPaneScroll:ee,paneClickDistance:ue,deleteKeyCode:O,selectionKeyCode:k,selectionOnDrag:N,selectionMode:C,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:R,panActivationKeyCode:T,zoomActivationKeyCode:I,elementsSelectable:B,zoomOnScroll:G,zoomOnPinch:F,zoomOnDoubleClick:W,panOnScroll:q,panOnScrollSpeed:X,panOnScrollMode:D,panOnDrag:oe,defaultViewport:M,translateExtent:L,minZoom:U,maxZoom:$,onSelectionContextMenu:p,preventScrolling:z,noDragClassName:vt,noWheelClassName:Pe,noPanClassName:ft,disableKeyboardA11y:He,onViewportChange:Lt,isControlledViewport:!!en,children:d.jsxs(UB,{children:[d.jsx(zB,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:ke,onReconnectStart:ze,onReconnectEnd:Ue,onlyRenderVisibleElements:P,onEdgeContextMenu:xe,onEdgeMouseEnter:pe,onEdgeMouseMove:be,onEdgeMouseLeave:ve,reconnectRadius:Re,defaultMarkerColor:V,noPanClassName:ft,disableKeyboardA11y:He,rfId:Zt}),d.jsx(JB,{style:w,type:b,component:x,containerStyle:S}),d.jsx("div",{className:"react-flow__edgelabel-renderer"}),d.jsx(NB,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:f,onNodeContextMenu:m,nodeClickDistance:ge,onlyRenderVisibleElements:P,noPanClassName:ft,noDragClassName:vt,disableKeyboardA11y:He,nodeExtent:hn,rfId:Zt}),d.jsx("div",{className:"react-flow__viewport-portal"})]})})}XI.displayName="GraphView";const t6=j.memo(XI),jN=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:a,fitViewOptions:c,minZoom:u=.5,maxZoom:f=2,nodeOrigin:m,nodeExtent:p,zIndexMode:g="basic"}={})=>{const v=new Map,b=new Map,w=new Map,x=new Map,S=r??t??[],k=n??e??[],N=m??[0,0],C=p??ol;uI(w,x,S);const R=M0(k,v,b,{nodeOrigin:N,nodeExtent:C,zIndexMode:g});let T=[0,0,1];if(a&&s&&o){const I=kl(v,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:O,y:P,zoom:B}=xw(I,s,o,u,f,(c==null?void 0:c.padding)??.1);T=[O,P,B]}return{rfId:"1",width:s??0,height:o??0,transform:T,nodes:k,nodesInitialized:R,nodeLookup:v,parentLookup:b,edges:S,edgeLookup:x,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:f,translateExtent:ol,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:yo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:N,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:a??!1,fitViewOptions:c,fitViewResolver:null,connection:{...HT},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:gq,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:UT,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},n6=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:a,fitViewOptions:c,minZoom:u,maxZoom:f,nodeOrigin:m,nodeExtent:p,zIndexMode:g})=>xF((v,b)=>{async function w(){const{nodeLookup:x,panZoom:S,fitViewOptions:k,fitViewResolver:N,width:C,height:R,minZoom:T,maxZoom:I}=b();S&&(await pq({nodes:x,width:C,height:R,panZoom:S,minZoom:T,maxZoom:I},k),N==null||N.resolve(!0),v({fitViewResolver:null}))}return{...jN({nodes:e,edges:t,width:s,height:o,fitView:a,fitViewOptions:c,minZoom:u,maxZoom:f,nodeOrigin:m,nodeExtent:p,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:x=>{const{nodeLookup:S,parentLookup:k,nodeOrigin:N,elevateNodesOnSelect:C,fitViewQueued:R,zIndexMode:T}=b(),I=M0(x,S,k,{nodeOrigin:N,nodeExtent:p,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:T});R&&I?(w(),v({nodes:x,nodesInitialized:I,fitViewQueued:!1,fitViewOptions:void 0})):v({nodes:x,nodesInitialized:I})},setEdges:x=>{const{connectionLookup:S,edgeLookup:k}=b();uI(S,k,x),v({edges:x})},setDefaultNodesAndEdges:(x,S)=>{if(x){const{setNodes:k}=b();k(x),v({hasDefaultNodes:!0})}if(S){const{setEdges:k}=b();k(S),v({hasDefaultEdges:!0})}},updateNodeInternals:x=>{const{triggerNodeChanges:S,nodeLookup:k,parentLookup:N,domNode:C,nodeOrigin:R,nodeExtent:T,debug:I,fitViewQueued:O,zIndexMode:P}=b(),{changes:B,updatedInternals:M}=Dq(x,k,N,C,R,T,P);M&&(Mq(k,N,{nodeOrigin:R,nodeExtent:T,zIndexMode:P}),O?(w(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(B==null?void 0:B.length)>0&&(I&&console.log("React Flow: trigger node changes",B),S==null||S(B)))},updateNodePositions:(x,S=!1)=>{const k=[];let N=[];const{nodeLookup:C,triggerNodeChanges:R,connection:T,updateConnection:I,onNodesChangeMiddlewareMap:O}=b();for(const[P,B]of x){const M=C.get(P),L=!!(M!=null&&M.expandParent&&(M!=null&&M.parentId)&&(B!=null&&B.position)),U={id:P,type:"position",position:L?{x:Math.max(0,B.position.x),y:Math.max(0,B.position.y)}:B.position,dragging:S};if(M&&T.inProgress&&T.fromNode.id===M.id){const $=ri(M,T.fromHandle,he.Left,!0);I({...T,from:$})}L&&M.parentId&&k.push({id:P,parentId:M.parentId,rect:{...B.internals.positionAbsolute,width:B.measured.width??0,height:B.measured.height??0}}),N.push(U)}if(k.length>0){const{parentLookup:P,nodeOrigin:B}=b(),M=kw(k,C,P,B);N.push(...M)}for(const P of O.values())N=P(N);R(N)},triggerNodeChanges:x=>{const{onNodesChange:S,setNodes:k,nodes:N,hasDefaultNodes:C,debug:R}=b();if(x!=null&&x.length){if(C){const T=kI(x,N);k(T)}R&&console.log("React Flow: trigger node changes",x),S==null||S(x)}},triggerEdgeChanges:x=>{const{onEdgesChange:S,setEdges:k,edges:N,hasDefaultEdges:C,debug:R}=b();if(x!=null&&x.length){if(C){const T=CI(x,N);k(T)}R&&console.log("React Flow: trigger edge changes",x),S==null||S(x)}},addSelectedNodes:x=>{const{multiSelectionActive:S,edgeLookup:k,nodeLookup:N,triggerNodeChanges:C,triggerEdgeChanges:R}=b();if(S){const T=x.map(I=>Ks(I,!0));C(T);return}C(no(N,new Set([...x]),!0)),R(no(k))},addSelectedEdges:x=>{const{multiSelectionActive:S,edgeLookup:k,nodeLookup:N,triggerNodeChanges:C,triggerEdgeChanges:R}=b();if(S){const T=x.map(I=>Ks(I,!0));R(T);return}R(no(k,new Set([...x]))),C(no(N,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:S}={})=>{const{edges:k,nodes:N,nodeLookup:C,triggerNodeChanges:R,triggerEdgeChanges:T}=b(),I=x||N,O=S||k,P=I.map(M=>{const L=C.get(M.id);return L&&(L.selected=!1),Ks(M.id,!1)}),B=O.map(M=>Ks(M.id,!1));R(P),T(B)},setMinZoom:x=>{const{panZoom:S,maxZoom:k}=b();S==null||S.setScaleExtent([x,k]),v({minZoom:x})},setMaxZoom:x=>{const{panZoom:S,minZoom:k}=b();S==null||S.setScaleExtent([k,x]),v({maxZoom:x})},setTranslateExtent:x=>{var S;(S=b().panZoom)==null||S.setTranslateExtent(x),v({translateExtent:x})},resetSelectedElements:()=>{const{edges:x,nodes:S,triggerNodeChanges:k,triggerEdgeChanges:N,elementsSelectable:C}=b();if(!C)return;const R=S.reduce((I,O)=>O.selected?[...I,Ks(O.id,!1)]:I,[]),T=x.reduce((I,O)=>O.selected?[...I,Ks(O.id,!1)]:I,[]);k(R),N(T)},setNodeExtent:x=>{const{nodes:S,nodeLookup:k,parentLookup:N,nodeOrigin:C,elevateNodesOnSelect:R,nodeExtent:T,zIndexMode:I}=b();x[0][0]===T[0][0]&&x[0][1]===T[0][1]&&x[1][0]===T[1][0]&&x[1][1]===T[1][1]||(M0(S,k,N,{nodeOrigin:C,nodeExtent:x,elevateNodesOnSelect:R,checkEquality:!1,zIndexMode:I}),v({nodeExtent:x}))},panBy:x=>{const{transform:S,width:k,height:N,panZoom:C,translateExtent:R}=b();return $q({delta:x,panZoom:C,transform:S,translateExtent:R,width:k,height:N})},setCenter:async(x,S,k)=>{const{width:N,height:C,maxZoom:R,panZoom:T}=b();if(!T)return Promise.resolve(!1);const I=typeof(k==null?void 0:k.zoom)<"u"?k.zoom:R;return await T.setViewport({x:N/2-x*I,y:C/2-S*I,zoom:I},{duration:k==null?void 0:k.duration,ease:k==null?void 0:k.ease,interpolate:k==null?void 0:k.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{...HT}})},updateConnection:x=>{v({connection:x})},reset:()=>v({...jN()})}},Object.is);function QI({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,initialMinZoom:a,initialMaxZoom:c,initialFitViewOptions:u,fitView:f,nodeOrigin:m,nodeExtent:p,zIndexMode:g,children:v}){const[b]=j.useState(()=>n6({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:f,minZoom:a,maxZoom:c,fitViewOptions:u,nodeOrigin:m,nodeExtent:p,zIndexMode:g}));return d.jsx(bF,{value:b,children:d.jsx(UF,{children:v})})}function r6({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:a,fitView:c,fitViewOptions:u,minZoom:f,maxZoom:m,nodeOrigin:p,nodeExtent:g,zIndexMode:v}){return j.useContext(Md)?d.jsx(d.Fragment,{children:e}):d.jsx(QI,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:a,fitView:c,initialFitViewOptions:u,initialMinZoom:f,initialMaxZoom:m,nodeOrigin:p,nodeExtent:g,zIndexMode:v,children:e})}const s6={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function i6({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o,edgeTypes:a,onNodeClick:c,onEdgeClick:u,onInit:f,onMove:m,onMoveStart:p,onMoveEnd:g,onConnect:v,onConnectStart:b,onConnectEnd:w,onClickConnectStart:x,onClickConnectEnd:S,onNodeMouseEnter:k,onNodeMouseMove:N,onNodeMouseLeave:C,onNodeContextMenu:R,onNodeDoubleClick:T,onNodeDragStart:I,onNodeDrag:O,onNodeDragStop:P,onNodesDelete:B,onEdgesDelete:M,onDelete:L,onSelectionChange:U,onSelectionDragStart:$,onSelectionDrag:z,onSelectionDragStop:V,onSelectionContextMenu:G,onSelectionStart:F,onSelectionEnd:q,onBeforeDelete:X,connectionMode:D,connectionLineType:W=ws.Bezier,connectionLineStyle:oe,connectionLineComponent:K,connectionLineContainerStyle:J,deleteKeyCode:te="Backspace",selectionKeyCode:Y="Shift",selectionOnDrag:ee=!1,selectionMode:ie=al.Full,panActivationKeyCode:ue="Space",multiSelectionKeyCode:ge=cl()?"Meta":"Control",zoomActivationKeyCode:xe=cl()?"Meta":"Control",snapToGrid:pe,snapGrid:be,onlyRenderVisibleElements:ve=!1,selectNodesOnDrag:Re,nodesDraggable:ke,autoPanOnNodeFocus:ze,nodesConnectable:Ue,nodesFocusable:vt,nodeOrigin:Pe=_I,edgesFocusable:ft,edgesReconnectable:He,elementsSelectable:hn=!0,defaultViewport:Zt=OF,minZoom:en=.5,maxZoom:Lt=2,translateExtent:bt=ol,preventScrolling:wr=!0,nodeExtent:kt,defaultMarkerColor:tn="#b1b1b7",zoomOnScroll:Kr=!0,zoomOnPinch:Rt=!0,panOnScroll:Dt=!1,panOnScrollSpeed:yi=.5,panOnScrollMode:_e=Zs.Free,zoomOnDoubleClick:Ce=!0,panOnDrag:We=!0,onPaneClick:pn,onPaneMouseEnter:mn,onPaneMouseMove:Qn,onPaneMouseLeave:Tt,onPaneScroll:Kl,onPaneContextMenu:Gl,paneClickDistance:Yl=1,nodeClickDistance:Xl=0,children:Ql,onReconnect:Ho,onReconnectStart:Jl,onReconnectEnd:Ts,onEdgeContextMenu:Wo,onEdgeDoubleClick:Is,onEdgeMouseEnter:Nf,onEdgeMouseMove:As,onEdgeMouseLeave:vi,reconnectRadius:xi=10,onNodesChange:Ko,onEdgesChange:kf,noDragClassName:Cf="nodrag",noWheelClassName:Ef="nowheel",noPanClassName:Jn="nopan",fitView:Go,fitViewOptions:Yo,connectOnClick:jf,attributionPosition:Zl,proOptions:ec,defaultEdgeOptions:tc,elevateNodesOnSelect:nc=!0,elevateEdgesOnSelect:Rf=!1,disableKeyboardA11y:rc=!1,autoPanOnConnect:rt,autoPanOnNodeDrag:Tf,autoPanSpeed:Xo,connectionRadius:sc,isValidConnection:wi,onError:If,style:ic,id:Ms,nodeDragThreshold:gn,connectionDragThreshold:Af,viewport:nn,onViewportChange:Mf,width:Of,height:Pf,colorMode:bi="light",debug:Si,onScroll:Zn,ariaLabelConfig:_i,zIndexMode:oc="basic",...Lf},Qo){const Ni=Ms||"1",Jo=$F(bi),Os=j.useCallback(ac=>{ac.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Zn==null||Zn(ac)},[Zn]);return d.jsx("div",{"data-testid":"rf__wrapper",...Lf,onScroll:Os,style:{...ic,...s6},ref:Qo,className:gt(["react-flow",s,Jo]),id:Ms,role:"application",children:d.jsxs(r6,{nodes:e,edges:t,width:Of,height:Pf,fitView:Go,fitViewOptions:Yo,minZoom:en,maxZoom:Lt,nodeOrigin:Pe,nodeExtent:kt,zIndexMode:oc,children:[d.jsx(t6,{onInit:f,onNodeClick:c,onEdgeClick:u,onNodeMouseEnter:k,onNodeMouseMove:N,onNodeMouseLeave:C,onNodeContextMenu:R,onNodeDoubleClick:T,nodeTypes:o,edgeTypes:a,connectionLineType:W,connectionLineStyle:oe,connectionLineComponent:K,connectionLineContainerStyle:J,selectionKeyCode:Y,selectionOnDrag:ee,selectionMode:ie,deleteKeyCode:te,multiSelectionKeyCode:ge,panActivationKeyCode:ue,zoomActivationKeyCode:xe,onlyRenderVisibleElements:ve,defaultViewport:Zt,translateExtent:bt,minZoom:en,maxZoom:Lt,preventScrolling:wr,zoomOnScroll:Kr,zoomOnPinch:Rt,zoomOnDoubleClick:Ce,panOnScroll:Dt,panOnScrollSpeed:yi,panOnScrollMode:_e,panOnDrag:We,onPaneClick:pn,onPaneMouseEnter:mn,onPaneMouseMove:Qn,onPaneMouseLeave:Tt,onPaneScroll:Kl,onPaneContextMenu:Gl,paneClickDistance:Yl,nodeClickDistance:Xl,onSelectionContextMenu:G,onSelectionStart:F,onSelectionEnd:q,onReconnect:Ho,onReconnectStart:Jl,onReconnectEnd:Ts,onEdgeContextMenu:Wo,onEdgeDoubleClick:Is,onEdgeMouseEnter:Nf,onEdgeMouseMove:As,onEdgeMouseLeave:vi,reconnectRadius:xi,defaultMarkerColor:tn,noDragClassName:Cf,noWheelClassName:Ef,noPanClassName:Jn,rfId:Ni,disableKeyboardA11y:rc,nodeExtent:kt,viewport:nn,onViewportChange:Mf}),d.jsx(DF,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:b,onConnectEnd:w,onClickConnectStart:x,onClickConnectEnd:S,nodesDraggable:ke,autoPanOnNodeFocus:ze,nodesConnectable:Ue,nodesFocusable:vt,edgesFocusable:ft,edgesReconnectable:He,elementsSelectable:hn,elevateNodesOnSelect:nc,elevateEdgesOnSelect:Rf,minZoom:en,maxZoom:Lt,nodeExtent:kt,onNodesChange:Ko,onEdgesChange:kf,snapToGrid:pe,snapGrid:be,connectionMode:D,translateExtent:bt,connectOnClick:jf,defaultEdgeOptions:tc,fitView:Go,fitViewOptions:Yo,onNodesDelete:B,onEdgesDelete:M,onDelete:L,onNodeDragStart:I,onNodeDrag:O,onNodeDragStop:P,onSelectionDrag:z,onSelectionDragStart:$,onSelectionDragStop:V,onMove:m,onMoveStart:p,onMoveEnd:g,noPanClassName:Jn,nodeOrigin:Pe,rfId:Ni,autoPanOnConnect:rt,autoPanOnNodeDrag:Tf,autoPanSpeed:Xo,onError:If,connectionRadius:sc,isValidConnection:wi,selectNodesOnDrag:Re,nodeDragThreshold:gn,connectionDragThreshold:Af,onBeforeDelete:X,debug:Si,ariaLabelConfig:_i,zIndexMode:oc}),d.jsx(MF,{onSelectionChange:U}),Ql,d.jsx(jF,{proOptions:ec,position:Zl}),d.jsx(EF,{rfId:Ni,disableKeyboardA11y:rc})]})})}var o6=EI(i6);function a6({dimensions:e,lineWidth:t,variant:n,className:r}){return d.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:gt(["react-flow__background-pattern",n,r])})}function l6({radius:e,className:t}){return d.jsx("circle",{cx:e,cy:e,r:e,className:gt(["react-flow__background-pattern","dots",t])})}var Or;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Or||(Or={}));const c6={[Or.Dots]:1,[Or.Lines]:1,[Or.Cross]:6},u6=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function JI({id:e,variant:t=Or.Dots,gap:n=20,size:r,lineWidth:s=1,offset:o=0,color:a,bgColor:c,style:u,className:f,patternClassName:m}){const p=j.useRef(null),{transform:g,patternId:v}=De(u6,Ze),b=r||c6[t],w=t===Or.Dots,x=t===Or.Cross,S=Array.isArray(n)?n:[n,n],k=[S[0]*g[2]||1,S[1]*g[2]||1],N=b*g[2],C=Array.isArray(o)?o:[o,o],R=x?[N,N]:k,T=[C[0]*g[2]||1+R[0]/2,C[1]*g[2]||1+R[1]/2],I=`${v}${e||""}`;return d.jsxs("svg",{className:gt(["react-flow__background",f]),style:{...u,...Pd,"--xy-background-color-props":c,"--xy-background-pattern-color-props":a},ref:p,"data-testid":"rf__background",children:[d.jsx("pattern",{id:I,x:g[0]%k[0],y:g[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:w?d.jsx(l6,{radius:N/2,className:m}):d.jsx(a6,{dimensions:R,lineWidth:s,variant:t,className:m})}),d.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${I})`})]})}JI.displayName="Background";const d6=j.memo(JI);function f6(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:d.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function h6(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:d.jsx("path",{d:"M0 0h32v4.2H0z"})})}function p6(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:d.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 m6(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.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 g6(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.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 vu({children:e,className:t,...n}){return d.jsx("button",{type:"button",className:gt(["react-flow__controls-button",t]),...n,children:e})}const y6=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function ZI({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:a,onFitView:c,onInteractiveChange:u,className:f,children:m,position:p="bottom-left",orientation:g="vertical","aria-label":v}){const b=et(),{isInteractive:w,minZoomReached:x,maxZoomReached:S,ariaLabelConfig:k}=De(y6,Ze),{zoomIn:N,zoomOut:C,fitView:R}=jo(),T=()=>{N(),o==null||o()},I=()=>{C(),a==null||a()},O=()=>{R(s),c==null||c()},P=()=>{b.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),u==null||u(!w)},B=g==="horizontal"?"horizontal":"vertical";return d.jsxs(Od,{className:gt(["react-flow__controls",B,f]),position:p,style:e,"data-testid":"rf__controls","aria-label":v??k["controls.ariaLabel"],children:[t&&d.jsxs(d.Fragment,{children:[d.jsx(vu,{onClick:T,className:"react-flow__controls-zoomin",title:k["controls.zoomIn.ariaLabel"],"aria-label":k["controls.zoomIn.ariaLabel"],disabled:S,children:d.jsx(f6,{})}),d.jsx(vu,{onClick:I,className:"react-flow__controls-zoomout",title:k["controls.zoomOut.ariaLabel"],"aria-label":k["controls.zoomOut.ariaLabel"],disabled:x,children:d.jsx(h6,{})})]}),n&&d.jsx(vu,{className:"react-flow__controls-fitview",onClick:O,title:k["controls.fitView.ariaLabel"],"aria-label":k["controls.fitView.ariaLabel"],children:d.jsx(p6,{})}),r&&d.jsx(vu,{className:"react-flow__controls-interactive",onClick:P,title:k["controls.interactive.ariaLabel"],"aria-label":k["controls.interactive.ariaLabel"],children:w?d.jsx(g6,{}):d.jsx(m6,{})}),m]})}ZI.displayName="Controls";const v6=j.memo(ZI);function x6({id:e,x:t,y:n,width:r,height:s,style:o,color:a,strokeColor:c,strokeWidth:u,className:f,borderRadius:m,shapeRendering:p,selected:g,onClick:v}){const{background:b,backgroundColor:w}=o||{},x=a||b||w;return d.jsx("rect",{className:gt(["react-flow__minimap-node",{selected:g},f]),x:t,y:n,rx:m,ry:m,width:r,height:s,style:{fill:x,stroke:c,strokeWidth:u},shapeRendering:p,onClick:v?S=>v(S,e):void 0})}const w6=j.memo(x6),b6=e=>e.nodes.map(t=>t.id),Ip=e=>e instanceof Function?e:()=>e;function S6({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:o=w6,onClick:a}){const c=De(b6,Ze),u=Ip(t),f=Ip(e),m=Ip(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return d.jsx(d.Fragment,{children:c.map(g=>d.jsx(N6,{id:g,nodeColorFunc:u,nodeStrokeColorFunc:f,nodeClassNameFunc:m,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:o,onClick:a,shapeRendering:p},g))})}function _6({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:a,NodeComponent:c,onClick:u}){const{node:f,x:m,y:p,width:g,height:v}=De(b=>{const{internals:w}=b.nodeLookup.get(e),x=w.userNode,{x:S,y:k}=w.positionAbsolute,{width:N,height:C}=zr(x);return{node:x,x:S,y:k,width:N,height:C}},Ze);return!f||f.hidden||!JT(f)?null:d.jsx(c,{x:m,y:p,width:g,height:v,style:f.style,selected:!!f.selected,className:r(f),color:t(f),borderRadius:s,strokeColor:n(f),strokeWidth:o,shapeRendering:a,onClick:u,id:f.id})}const N6=j.memo(_6);var k6=j.memo(S6);const C6=200,E6=150,j6=e=>!e.hidden,R6=e=>{const t={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:t,boundingRect:e.nodeLookup.size>0?QT(kl(e.nodeLookup,{filter:j6}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},T6="react-flow__minimap-desc";function eA({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:a,nodeComponent:c,bgColor:u,maskColor:f,maskStrokeColor:m,maskStrokeWidth:p,position:g="bottom-right",onClick:v,onNodeClick:b,pannable:w=!1,zoomable:x=!1,ariaLabel:S,inversePan:k,zoomStep:N=1,offsetScale:C=5}){const R=et(),T=j.useRef(null),{boundingRect:I,viewBB:O,rfId:P,panZoom:B,translateExtent:M,flowWidth:L,flowHeight:U,ariaLabelConfig:$}=De(R6,Ze),z=(e==null?void 0:e.width)??C6,V=(e==null?void 0:e.height)??E6,G=I.width/z,F=I.height/V,q=Math.max(G,F),X=q*z,D=q*V,W=C*q,oe=I.x-(X-I.width)/2-W,K=I.y-(D-I.height)/2-W,J=X+W*2,te=D+W*2,Y=`${T6}-${P}`,ee=j.useRef(0),ie=j.useRef();ee.current=q,j.useEffect(()=>{if(T.current&&B)return ie.current=Kq({domNode:T.current,panZoom:B,getTransform:()=>R.getState().transform,getViewScale:()=>ee.current}),()=>{var pe;(pe=ie.current)==null||pe.destroy()}},[B]),j.useEffect(()=>{var pe;(pe=ie.current)==null||pe.update({translateExtent:M,width:L,height:U,inversePan:k,pannable:w,zoomStep:N,zoomable:x})},[w,x,k,N,M,L,U]);const ue=v?pe=>{var Re;const[be,ve]=((Re=ie.current)==null?void 0:Re.pointer(pe))||[0,0];v(pe,{x:be,y:ve})}:void 0,ge=b?j.useCallback((pe,be)=>{const ve=R.getState().nodeLookup.get(be).internals.userNode;b(pe,ve)},[]):void 0,xe=S??$["minimap.ariaLabel"];return d.jsx(Od,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*q:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:gt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:d.jsxs("svg",{width:z,height:V,viewBox:`${oe} ${K} ${J} ${te}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Y,ref:T,onClick:ue,children:[xe&&d.jsx("title",{id:Y,children:xe}),d.jsx(k6,{onClick:ge,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:c}),d.jsx("path",{className:"react-flow__minimap-mask",d:`M${oe-W},${K-W}h${J+W*2}v${te+W*2}h${-J-W*2}z
62
+ M${O.x},${O.y}h${O.width}v${O.height}h${-O.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}eA.displayName="MiniMap";const I6=j.memo(eA),A6=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,M6={[bo.Line]:"right",[bo.Handle]:"bottom-right"};function O6({nodeId:e,position:t,variant:n=bo.Handle,className:r,style:s=void 0,children:o,color:a,minWidth:c=10,minHeight:u=10,maxWidth:f=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:g,autoScale:v=!0,shouldResize:b,onResizeStart:w,onResize:x,onResizeEnd:S}){const k=II(),N=typeof e=="string"?e:k,C=et(),R=j.useRef(null),T=n===bo.Handle,I=De(j.useCallback(A6(T&&v),[T,v]),Ze),O=j.useRef(null),P=t??M6[n];j.useEffect(()=>{if(!(!R.current||!N))return O.current||(O.current=aF({domNode:R.current,nodeId:N,getStoreItems:()=>{const{nodeLookup:M,transform:L,snapGrid:U,snapToGrid:$,nodeOrigin:z,domNode:V}=C.getState();return{nodeLookup:M,transform:L,snapGrid:U,snapToGrid:$,nodeOrigin:z,paneDomNode:V}},onChange:(M,L)=>{const{triggerNodeChanges:U,nodeLookup:$,parentLookup:z,nodeOrigin:V}=C.getState(),G=[],F={x:M.x,y:M.y},q=$.get(N);if(q&&q.expandParent&&q.parentId){const X=q.origin??V,D=M.width??q.measured.width??0,W=M.height??q.measured.height??0,oe={id:q.id,parentId:q.parentId,rect:{width:D,height:W,...ZT({x:M.x??q.position.x,y:M.y??q.position.y},{width:D,height:W},q.parentId,$,X)}},K=kw([oe],$,z,V);G.push(...K),F.x=M.x?Math.max(X[0]*D,M.x):void 0,F.y=M.y?Math.max(X[1]*W,M.y):void 0}if(F.x!==void 0&&F.y!==void 0){const X={id:N,type:"position",position:{...F}};G.push(X)}if(M.width!==void 0&&M.height!==void 0){const D={id:N,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:M.width,height:M.height}};G.push(D)}for(const X of L){const D={...X,type:"position"};G.push(D)}U(G)},onEnd:({width:M,height:L})=>{const U={id:N,type:"dimensions",resizing:!1,dimensions:{width:M,height:L}};C.getState().triggerNodeChanges([U])}})),O.current.update({controlPosition:P,boundaries:{minWidth:c,minHeight:u,maxWidth:f,maxHeight:m},keepAspectRatio:p,resizeDirection:g,onResizeStart:w,onResize:x,onResizeEnd:S,shouldResize:b}),()=>{var M;(M=O.current)==null||M.destroy()}},[P,c,u,f,m,p,w,x,S,b]);const B=P.split("-");return d.jsx("div",{className:gt(["react-flow__resize-control","nodrag",...B,n,r]),ref:R,style:{...s,scale:I,...a&&{[T?"backgroundColor":"borderColor"]:a}},children:o})}j.memo(O6);/**
63
+ * @license lucide-react v0.468.0 - ISC
64
+ *
65
+ * This source code is licensed under the ISC license.
66
+ * See the LICENSE file in the root directory of this source tree.
67
+ */const P6=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),tA=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
68
+ * @license lucide-react v0.468.0 - ISC
69
+ *
70
+ * This source code is licensed under the ISC license.
71
+ * See the LICENSE file in the root directory of this source tree.
72
+ */var L6={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
73
+ * @license lucide-react v0.468.0 - ISC
74
+ *
75
+ * This source code is licensed under the ISC license.
76
+ * See the LICENSE file in the root directory of this source tree.
77
+ */const D6=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:a,...c},u)=>j.createElement("svg",{ref:u,...L6,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:tA("lucide",s),...c},[...a.map(([f,m])=>j.createElement(f,m)),...Array.isArray(o)?o:[o]]));/**
78
+ * @license lucide-react v0.468.0 - ISC
79
+ *
80
+ * This source code is licensed under the ISC license.
81
+ * See the LICENSE file in the root directory of this source tree.
82
+ */const fe=(e,t)=>{const n=j.forwardRef(({className:r,...s},o)=>j.createElement(D6,{ref:o,iconNode:t,className:tA(`lucide-${P6(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
83
+ * @license lucide-react v0.468.0 - ISC
84
+ *
85
+ * This source code is licensed under the ISC license.
86
+ * See the LICENSE file in the root directory of this source tree.
87
+ */const $6=fe("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
88
+ * @license lucide-react v0.468.0 - ISC
89
+ *
90
+ * This source code is licensed under the ISC license.
91
+ * See the LICENSE file in the root directory of this source tree.
92
+ */const q6=fe("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
93
+ * @license lucide-react v0.468.0 - ISC
94
+ *
95
+ * This source code is licensed under the ISC license.
96
+ * See the LICENSE file in the root directory of this source tree.
97
+ */const dl=fe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
98
+ * @license lucide-react v0.468.0 - ISC
99
+ *
100
+ * This source code is licensed under the ISC license.
101
+ * See the LICENSE file in the root directory of this source tree.
102
+ */const F6=fe("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
103
+ * @license lucide-react v0.468.0 - ISC
104
+ *
105
+ * This source code is licensed under the ISC license.
106
+ * See the LICENSE file in the root directory of this source tree.
107
+ */const Bu=fe("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
108
+ * @license lucide-react v0.468.0 - ISC
109
+ *
110
+ * This source code is licensed under the ISC license.
111
+ * See the LICENSE file in the root directory of this source tree.
112
+ */const RN=fe("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
113
+ * @license lucide-react v0.468.0 - ISC
114
+ *
115
+ * This source code is licensed under the ISC license.
116
+ * See the LICENSE file in the root directory of this source tree.
117
+ */const L0=fe("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
118
+ * @license lucide-react v0.468.0 - ISC
119
+ *
120
+ * This source code is licensed under the ISC license.
121
+ * See the LICENSE file in the root directory of this source tree.
122
+ */const si=fe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
123
+ * @license lucide-react v0.468.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */const bs=fe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
128
+ * @license lucide-react v0.468.0 - ISC
129
+ *
130
+ * This source code is licensed under the ISC license.
131
+ * See the LICENSE file in the root directory of this source tree.
132
+ */const B6=fe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
133
+ * @license lucide-react v0.468.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */const Qt=fe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
138
+ * @license lucide-react v0.468.0 - ISC
139
+ *
140
+ * This source code is licensed under the ISC license.
141
+ * See the LICENSE file in the root directory of this source tree.
142
+ */const z6=fe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
143
+ * @license lucide-react v0.468.0 - ISC
144
+ *
145
+ * This source code is licensed under the ISC license.
146
+ * See the LICENSE file in the root directory of this source tree.
147
+ */const Ro=fe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
148
+ * @license lucide-react v0.468.0 - ISC
149
+ *
150
+ * This source code is licensed under the ISC license.
151
+ * See the LICENSE file in the root directory of this source tree.
152
+ */const Pt=fe("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
153
+ * @license lucide-react v0.468.0 - ISC
154
+ *
155
+ * This source code is licensed under the ISC license.
156
+ * See the LICENSE file in the root directory of this source tree.
157
+ */const V6=fe("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
158
+ * @license lucide-react v0.468.0 - ISC
159
+ *
160
+ * This source code is licensed under the ISC license.
161
+ * See the LICENSE file in the root directory of this source tree.
162
+ */const ot=fe("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
163
+ * @license lucide-react v0.468.0 - ISC
164
+ *
165
+ * This source code is licensed under the ISC license.
166
+ * See the LICENSE file in the root directory of this source tree.
167
+ */const D0=fe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
168
+ * @license lucide-react v0.468.0 - ISC
169
+ *
170
+ * This source code is licensed under the ISC license.
171
+ * See the LICENSE file in the root directory of this source tree.
172
+ */const U6=fe("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
173
+ * @license lucide-react v0.468.0 - ISC
174
+ *
175
+ * This source code is licensed under the ISC license.
176
+ * See the LICENSE file in the root directory of this source tree.
177
+ */const jn=fe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
178
+ * @license lucide-react v0.468.0 - ISC
179
+ *
180
+ * This source code is licensed under the ISC license.
181
+ * See the LICENSE file in the root directory of this source tree.
182
+ */const H6=fe("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
183
+ * @license lucide-react v0.468.0 - ISC
184
+ *
185
+ * This source code is licensed under the ISC license.
186
+ * See the LICENSE file in the root directory of this source tree.
187
+ */const jw=fe("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
188
+ * @license lucide-react v0.468.0 - ISC
189
+ *
190
+ * This source code is licensed under the ISC license.
191
+ * See the LICENSE file in the root directory of this source tree.
192
+ */const So=fe("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
193
+ * @license lucide-react v0.468.0 - ISC
194
+ *
195
+ * This source code is licensed under the ISC license.
196
+ * See the LICENSE file in the root directory of this source tree.
197
+ */const W6=fe("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/**
198
+ * @license lucide-react v0.468.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ */const K6=fe("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
203
+ * @license lucide-react v0.468.0 - ISC
204
+ *
205
+ * This source code is licensed under the ISC license.
206
+ * See the LICENSE file in the root directory of this source tree.
207
+ */const G6=fe("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
208
+ * @license lucide-react v0.468.0 - ISC
209
+ *
210
+ * This source code is licensed under the ISC license.
211
+ * See the LICENSE file in the root directory of this source tree.
212
+ */const Y6=fe("FileInput",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 15h10",key:"jfw4w8"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/**
213
+ * @license lucide-react v0.468.0 - ISC
214
+ *
215
+ * This source code is licensed under the ISC license.
216
+ * See the LICENSE file in the root directory of this source tree.
217
+ */const X6=fe("FileOutput",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4 7V4a2 2 0 0 1 2-2 2 2 0 0 0-2 2",key:"1vk7w2"}],["path",{d:"M4.063 20.999a2 2 0 0 0 2 1L18 22a2 2 0 0 0 2-2V7l-5-5H6",key:"1jink5"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]]);/**
218
+ * @license lucide-react v0.468.0 - ISC
219
+ *
220
+ * This source code is licensed under the ISC license.
221
+ * See the LICENSE file in the root directory of this source tree.
222
+ */const _o=fe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
223
+ * @license lucide-react v0.468.0 - ISC
224
+ *
225
+ * This source code is licensed under the ISC license.
226
+ * See the LICENSE file in the root directory of this source tree.
227
+ */const nA=fe("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
228
+ * @license lucide-react v0.468.0 - ISC
229
+ *
230
+ * This source code is licensed under the ISC license.
231
+ * See the LICENSE file in the root directory of this source tree.
232
+ */const Q6=fe("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);/**
233
+ * @license lucide-react v0.468.0 - ISC
234
+ *
235
+ * This source code is licensed under the ISC license.
236
+ * See the LICENSE file in the root directory of this source tree.
237
+ */const cd=fe("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
238
+ * @license lucide-react v0.468.0 - ISC
239
+ *
240
+ * This source code is licensed under the ISC license.
241
+ * See the LICENSE file in the root directory of this source tree.
242
+ */const rA=fe("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);/**
243
+ * @license lucide-react v0.468.0 - ISC
244
+ *
245
+ * This source code is licensed under the ISC license.
246
+ * See the LICENSE file in the root directory of this source tree.
247
+ */const $0=fe("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
248
+ * @license lucide-react v0.468.0 - ISC
249
+ *
250
+ * This source code is licensed under the ISC license.
251
+ * See the LICENSE file in the root directory of this source tree.
252
+ */const J6=fe("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/**
253
+ * @license lucide-react v0.468.0 - ISC
254
+ *
255
+ * This source code is licensed under the ISC license.
256
+ * See the LICENSE file in the root directory of this source tree.
257
+ */const TN=fe("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/**
258
+ * @license lucide-react v0.468.0 - ISC
259
+ *
260
+ * This source code is licensed under the ISC license.
261
+ * See the LICENSE file in the root directory of this source tree.
262
+ */const Z6=fe("GitPullRequest",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]]);/**
263
+ * @license lucide-react v0.468.0 - ISC
264
+ *
265
+ * This source code is licensed under the ISC license.
266
+ * See the LICENSE file in the root directory of this source tree.
267
+ */const sA=fe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
268
+ * @license lucide-react v0.468.0 - ISC
269
+ *
270
+ * This source code is licensed under the ISC license.
271
+ * See the LICENSE file in the root directory of this source tree.
272
+ */const IN=fe("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
273
+ * @license lucide-react v0.468.0 - ISC
274
+ *
275
+ * This source code is licensed under the ISC license.
276
+ * See the LICENSE file in the root directory of this source tree.
277
+ */const e8=fe("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);/**
278
+ * @license lucide-react v0.468.0 - ISC
279
+ *
280
+ * This source code is licensed under the ISC license.
281
+ * See the LICENSE file in the root directory of this source tree.
282
+ */const Rw=fe("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
283
+ * @license lucide-react v0.468.0 - ISC
284
+ *
285
+ * This source code is licensed under the ISC license.
286
+ * See the LICENSE file in the root directory of this source tree.
287
+ */const t8=fe("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
288
+ * @license lucide-react v0.468.0 - ISC
289
+ *
290
+ * This source code is licensed under the ISC license.
291
+ * See the LICENSE file in the root directory of this source tree.
292
+ */const n8=fe("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/**
293
+ * @license lucide-react v0.468.0 - ISC
294
+ *
295
+ * This source code is licensed under the ISC license.
296
+ * See the LICENSE file in the root directory of this source tree.
297
+ */const AN=fe("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
298
+ * @license lucide-react v0.468.0 - ISC
299
+ *
300
+ * This source code is licensed under the ISC license.
301
+ * See the LICENSE file in the root directory of this source tree.
302
+ */const Dr=fe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
303
+ * @license lucide-react v0.468.0 - ISC
304
+ *
305
+ * This source code is licensed under the ISC license.
306
+ * See the LICENSE file in the root directory of this source tree.
307
+ */const iA=fe("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
308
+ * @license lucide-react v0.468.0 - ISC
309
+ *
310
+ * This source code is licensed under the ISC license.
311
+ * See the LICENSE file in the root directory of this source tree.
312
+ */const MN=fe("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
313
+ * @license lucide-react v0.468.0 - ISC
314
+ *
315
+ * This source code is licensed under the ISC license.
316
+ * See the LICENSE file in the root directory of this source tree.
317
+ */const r8=fe("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);/**
318
+ * @license lucide-react v0.468.0 - ISC
319
+ *
320
+ * This source code is licensed under the ISC license.
321
+ * See the LICENSE file in the root directory of this source tree.
322
+ */const s8=fe("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
323
+ * @license lucide-react v0.468.0 - ISC
324
+ *
325
+ * This source code is licensed under the ISC license.
326
+ * See the LICENSE file in the root directory of this source tree.
327
+ */const i8=fe("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
328
+ * @license lucide-react v0.468.0 - ISC
329
+ *
330
+ * This source code is licensed under the ISC license.
331
+ * See the LICENSE file in the root directory of this source tree.
332
+ */const oA=fe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
333
+ * @license lucide-react v0.468.0 - ISC
334
+ *
335
+ * This source code is licensed under the ISC license.
336
+ * See the LICENSE file in the root directory of this source tree.
337
+ */const o8=fe("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
338
+ * @license lucide-react v0.468.0 - ISC
339
+ *
340
+ * This source code is licensed under the ISC license.
341
+ * See the LICENSE file in the root directory of this source tree.
342
+ */const a8=fe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
343
+ * @license lucide-react v0.468.0 - ISC
344
+ *
345
+ * This source code is licensed under the ISC license.
346
+ * See the LICENSE file in the root directory of this source tree.
347
+ */const l8=fe("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
348
+ * @license lucide-react v0.468.0 - ISC
349
+ *
350
+ * This source code is licensed under the ISC license.
351
+ * See the LICENSE file in the root directory of this source tree.
352
+ */const c8=fe("PanelsTopLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);/**
353
+ * @license lucide-react v0.468.0 - ISC
354
+ *
355
+ * This source code is licensed under the ISC license.
356
+ * See the LICENSE file in the root directory of this source tree.
357
+ */const aA=fe("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
358
+ * @license lucide-react v0.468.0 - ISC
359
+ *
360
+ * This source code is licensed under the ISC license.
361
+ * See the LICENSE file in the root directory of this source tree.
362
+ */const u8=fe("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
363
+ * @license lucide-react v0.468.0 - ISC
364
+ *
365
+ * This source code is licensed under the ISC license.
366
+ * See the LICENSE file in the root directory of this source tree.
367
+ */const To=fe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
368
+ * @license lucide-react v0.468.0 - ISC
369
+ *
370
+ * This source code is licensed under the ISC license.
371
+ * See the LICENSE file in the root directory of this source tree.
372
+ */const Dd=fe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
373
+ * @license lucide-react v0.468.0 - ISC
374
+ *
375
+ * This source code is licensed under the ISC license.
376
+ * See the LICENSE file in the root directory of this source tree.
377
+ */const d8=fe("Redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]);/**
378
+ * @license lucide-react v0.468.0 - ISC
379
+ *
380
+ * This source code is licensed under the ISC license.
381
+ * See the LICENSE file in the root directory of this source tree.
382
+ */const f8=fe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
383
+ * @license lucide-react v0.468.0 - ISC
384
+ *
385
+ * This source code is licensed under the ISC license.
386
+ * See the LICENSE file in the root directory of this source tree.
387
+ */const ON=fe("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/**
388
+ * @license lucide-react v0.468.0 - ISC
389
+ *
390
+ * This source code is licensed under the ISC license.
391
+ * See the LICENSE file in the root directory of this source tree.
392
+ */const PN=fe("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
393
+ * @license lucide-react v0.468.0 - ISC
394
+ *
395
+ * This source code is licensed under the ISC license.
396
+ * See the LICENSE file in the root directory of this source tree.
397
+ */const h8=fe("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
398
+ * @license lucide-react v0.468.0 - ISC
399
+ *
400
+ * This source code is licensed under the ISC license.
401
+ * See the LICENSE file in the root directory of this source tree.
402
+ */const ud=fe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
403
+ * @license lucide-react v0.468.0 - ISC
404
+ *
405
+ * This source code is licensed under the ISC license.
406
+ * See the LICENSE file in the root directory of this source tree.
407
+ */const lA=fe("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
408
+ * @license lucide-react v0.468.0 - ISC
409
+ *
410
+ * This source code is licensed under the ISC license.
411
+ * See the LICENSE file in the root directory of this source tree.
412
+ */const $d=fe("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
413
+ * @license lucide-react v0.468.0 - ISC
414
+ *
415
+ * This source code is licensed under the ISC license.
416
+ * See the LICENSE file in the root directory of this source tree.
417
+ */const LN=fe("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
418
+ * @license lucide-react v0.468.0 - ISC
419
+ *
420
+ * This source code is licensed under the ISC license.
421
+ * See the LICENSE file in the root directory of this source tree.
422
+ */const p8=fe("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);/**
423
+ * @license lucide-react v0.468.0 - ISC
424
+ *
425
+ * This source code is licensed under the ISC license.
426
+ * See the LICENSE file in the root directory of this source tree.
427
+ */const cA=fe("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
428
+ * @license lucide-react v0.468.0 - ISC
429
+ *
430
+ * This source code is licensed under the ISC license.
431
+ * See the LICENSE file in the root directory of this source tree.
432
+ */const m8=fe("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
433
+ * @license lucide-react v0.468.0 - ISC
434
+ *
435
+ * This source code is licensed under the ISC license.
436
+ * See the LICENSE file in the root directory of this source tree.
437
+ */const g8=fe("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
438
+ * @license lucide-react v0.468.0 - ISC
439
+ *
440
+ * This source code is licensed under the ISC license.
441
+ * See the LICENSE file in the root directory of this source tree.
442
+ */const y8=fe("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
443
+ * @license lucide-react v0.468.0 - ISC
444
+ *
445
+ * This source code is licensed under the ISC license.
446
+ * See the LICENSE file in the root directory of this source tree.
447
+ */const uA=fe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
448
+ * @license lucide-react v0.468.0 - ISC
449
+ *
450
+ * This source code is licensed under the ISC license.
451
+ * See the LICENSE file in the root directory of this source tree.
452
+ */const v8=fe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
453
+ * @license lucide-react v0.468.0 - ISC
454
+ *
455
+ * This source code is licensed under the ISC license.
456
+ * See the LICENSE file in the root directory of this source tree.
457
+ */const Io=fe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
458
+ * @license lucide-react v0.468.0 - ISC
459
+ *
460
+ * This source code is licensed under the ISC license.
461
+ * See the LICENSE file in the root directory of this source tree.
462
+ */const DN=fe("Trello",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["rect",{width:"3",height:"9",x:"7",y:"7",key:"14n3xi"}],["rect",{width:"3",height:"5",x:"14",y:"7",key:"s4azjd"}]]);/**
463
+ * @license lucide-react v0.468.0 - ISC
464
+ *
465
+ * This source code is licensed under the ISC license.
466
+ * See the LICENSE file in the root directory of this source tree.
467
+ */const jl=fe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
468
+ * @license lucide-react v0.468.0 - ISC
469
+ *
470
+ * This source code is licensed under the ISC license.
471
+ * See the LICENSE file in the root directory of this source tree.
472
+ */const x8=fe("Undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]);/**
473
+ * @license lucide-react v0.468.0 - ISC
474
+ *
475
+ * This source code is licensed under the ISC license.
476
+ * See the LICENSE file in the root directory of this source tree.
477
+ */const dA=fe("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
478
+ * @license lucide-react v0.468.0 - ISC
479
+ *
480
+ * This source code is licensed under the ISC license.
481
+ * See the LICENSE file in the root directory of this source tree.
482
+ */const w8=fe("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
483
+ * @license lucide-react v0.468.0 - ISC
484
+ *
485
+ * This source code is licensed under the ISC license.
486
+ * See the LICENSE file in the root directory of this source tree.
487
+ */const Rl=fe("Variable",[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]]);/**
488
+ * @license lucide-react v0.468.0 - ISC
489
+ *
490
+ * This source code is licensed under the ISC license.
491
+ * See the LICENSE file in the root directory of this source tree.
492
+ */const b8=fe("Webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]);/**
493
+ * @license lucide-react v0.468.0 - ISC
494
+ *
495
+ * This source code is licensed under the ISC license.
496
+ * See the LICENSE file in the root directory of this source tree.
497
+ */const $r=fe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
498
+ * @license lucide-react v0.468.0 - ISC
499
+ *
500
+ * This source code is licensed under the ISC license.
501
+ * See the LICENSE file in the root directory of this source tree.
502
+ */const dd=fe("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);/**
503
+ * @license lucide-react v0.468.0 - ISC
504
+ *
505
+ * This source code is licensed under the ISC license.
506
+ * See the LICENSE file in the root directory of this source tree.
507
+ */const S8=fe("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);/**
508
+ * @license lucide-react v0.468.0 - ISC
509
+ *
510
+ * This source code is licensed under the ISC license.
511
+ * See the LICENSE file in the root directory of this source tree.
512
+ */const _8=fe("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),$N=e=>{let t;const n=new Set,r=(f,m)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const g=t;t=m??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(v=>v(t,g))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>u,subscribe:f=>(n.add(f),()=>n.delete(f))},u=t=e(r,s,c);return c},N8=(e=>e?$N(e):$N),k8=e=>e;function C8(e,t=k8){const n=pt.useSyncExternalStore(e.subscribe,pt.useCallback(()=>t(e.getState()),[e,t]),pt.useCallback(()=>t(e.getInitialState()),[e,t]));return pt.useDebugValue(n),n}const qN=e=>{const t=N8(e),n=r=>C8(t,r);return Object.assign(n,t),n},Vr=(e=>e?qN(e):qN),E8=[{id:"trigger",type:"step",position:{x:250,y:0},data:{id:"trigger",name:"PR Opened",action:"github.webhook",status:"completed"}},{id:"fetch_pr",type:"step",position:{x:250,y:120},data:{id:"fetch_pr",name:"Fetch PR Details",action:"github.pulls.get",status:"completed"}},{id:"get_files",type:"step",position:{x:250,y:240},data:{id:"get_files",name:"Get Changed Files",action:"github.pulls.listFiles",status:"running"}},{id:"analyze",type:"step",position:{x:250,y:360},data:{id:"analyze",name:"Analyze Changes",action:"claude.analyze",status:"pending"}},{id:"post_review",type:"step",position:{x:250,y:480},data:{id:"post_review",name:"Post Review",action:"github.pulls.createReview",status:"pending"}}],j8=[{id:"e1",source:"trigger",target:"fetch_pr",animated:!0},{id:"e2",source:"fetch_pr",target:"get_files",animated:!0},{id:"e3",source:"get_files",target:"analyze"},{id:"e4",source:"analyze",target:"post_review"}],No=Vr((e,t)=>({nodes:E8,edges:j8,past:[],future:[],maxHistorySize:50,clipboard:null,onNodesChange:n=>{n.some(s=>s.type!=="position"&&s.type!=="select"&&s.type!=="dimensions")&&t().saveCheckpoint(),e({nodes:kI(n,t().nodes)})},onEdgesChange:n=>{n.some(s=>s.type!=="select")&&t().saveCheckpoint(),e({edges:CI(n,t().edges)})},onConnect:n=>{t().saveCheckpoint(),e({edges:oI({...n,animated:!0,style:{stroke:"#ff6d5a",strokeWidth:2}},t().edges)})},setNodes:n=>{t().saveCheckpoint(),e({nodes:n,future:[]})},setEdges:n=>{t().saveCheckpoint(),e({edges:n,future:[]})},updateNodeData:(n,r)=>{t().saveCheckpoint(),e({nodes:t().nodes.map(s=>s.id===n?{...s,data:{...s.data,...r}}:s),future:[]})},clearCanvas:()=>{t().saveCheckpoint(),e({nodes:[],edges:[],future:[]})},saveCheckpoint:()=>{const{nodes:n,edges:r,past:s,maxHistorySize:o}=t();if(s.length>0){const u=s[s.length-1];if(JSON.stringify(u.nodes)===JSON.stringify(n)&&JSON.stringify(u.edges)===JSON.stringify(r))return}const a={nodes:JSON.parse(JSON.stringify(n)),edges:JSON.parse(JSON.stringify(r))},c=[...s,a];c.length>o&&c.shift(),e({past:c})},undo:()=>{const{nodes:n,edges:r,past:s,future:o}=t();if(s.length===0)return;const a={nodes:JSON.parse(JSON.stringify(n)),edges:JSON.parse(JSON.stringify(r))},c=s[s.length-1],u=s.slice(0,-1);e({nodes:c.nodes,edges:c.edges,past:u,future:[a,...o]})},redo:()=>{const{nodes:n,edges:r,past:s,future:o}=t();if(o.length===0)return;const a={nodes:JSON.parse(JSON.stringify(n)),edges:JSON.parse(JSON.stringify(r))},c=o[0],u=o.slice(1);e({nodes:c.nodes,edges:c.edges,past:[...s,a],future:u})},canUndo:()=>t().past.length>0,canRedo:()=>t().future.length>0,copySelected:()=>{const{nodes:n}=t(),r=n.filter(u=>u.selected);if(r.length===0)return;const s=new Set(r.map(u=>u.id)),{edges:o}=t(),a=o.filter(u=>s.has(u.source)&&s.has(u.target)),c={nodes:JSON.parse(JSON.stringify(r)),edges:JSON.parse(JSON.stringify(a))};e({clipboard:c})},paste:(n={x:50,y:50})=>{const{clipboard:r,nodes:s,edges:o}=t();if(!r||r.nodes.length===0)return;t().saveCheckpoint();const a=new Map,c=Date.now().toString(36),u=r.nodes.map((p,g)=>{const v=`${p.id.split("-copy")[0]}-copy-${c}-${g}`;return a.set(p.id,v),{...p,id:v,position:{x:p.position.x+n.x,y:p.position.y+n.y},selected:!0,data:{...p.data,id:v}}}),f=r.edges.map((p,g)=>({...p,id:`${p.id.split("-copy")[0]}-copy-${c}-${g}`,source:a.get(p.source)||p.source,target:a.get(p.target)||p.target})),m=s.map(p=>({...p,selected:!1}));e({nodes:[...m,...u],edges:[...o,...f],future:[]})},canPaste:()=>{const{clipboard:n}=t();return n!==null&&n.nodes.length>0}})),FN=[{path:"examples/code-review/workflow.md",name:"Code Review"},{path:"examples/daily-standup/workflow.md",name:"Daily Standup"},{path:"examples/incident-response/workflow.md",name:"Incident Response"},{path:"examples/sprint-planning/workflow.md",name:"Sprint Planning"},{path:"examples/dependency-update/workflow.md",name:"Dependency Update"}],R8={metadata:{id:"code-review",name:"Code Review",version:"1.0.0",description:"Automatically review pull requests using Claude AI",author:"Marktoflow",tags:["github","ai","code-review"]},steps:[{id:"fetch_pr",name:"Fetch PR Details",action:"github.pulls.get",inputs:{owner:"{{ inputs.repo.split('/')[0] }}",repo:"{{ inputs.repo.split('/')[1] }}",pull_number:"{{ inputs.pr_number }}"},outputVariable:"pr_details"},{id:"get_files",name:"Get Changed Files",action:"github.pulls.listFiles",inputs:{owner:"{{ inputs.repo.split('/')[0] }}",repo:"{{ inputs.repo.split('/')[1] }}",pull_number:"{{ inputs.pr_number }}"},outputVariable:"changed_files"},{id:"analyze",name:"Analyze Changes",action:"claude.analyze",inputs:{prompt:"Review the following code changes",context:"{{ changed_files }}"},outputVariable:"analysis"},{id:"post_review",name:"Post Review",action:"github.pulls.createReview",inputs:{owner:"{{ inputs.repo.split('/')[0] }}",repo:"{{ inputs.repo.split('/')[1] }}",pull_number:"{{ inputs.pr_number }}",body:"{{ analysis.summary }}",event:"COMMENT"},outputVariable:"review_result"}]},q0="marktoflow:selectedWorkflow",T8=()=>{try{return localStorage.getItem(q0)}catch{return null}},BN=e=>{try{e?localStorage.setItem(q0,e):localStorage.removeItem(q0)}catch{}},qr=Vr((e,t)=>({workflows:FN,selectedWorkflow:T8(),currentWorkflow:null,isLoading:!1,error:null,loadWorkflows:async()=>{e({isLoading:!0,error:null});try{const n=await fetch("/api/workflows");if(!n.ok)throw new Error("Failed to load workflows");const r=await n.json();console.log("Loaded workflows:",r.workflows.length),e({workflows:r.workflows,isLoading:!1});const s=t().selectedWorkflow;s&&t().loadWorkflow(s)}catch(n){console.error("Failed to load workflows, using demo data:",n),e({workflows:FN,isLoading:!1})}},fetchWorkflows:async()=>{await t().loadWorkflows()},selectWorkflow:n=>{e({selectedWorkflow:n}),BN(n),t().loadWorkflow(n)},loadWorkflow:async n=>{e({isLoading:!0,error:null});try{const r=await fetch(`/api/workflows/${encodeURIComponent(n)}`);if(!r.ok)throw new Error("Failed to load workflow");const s=await r.json();e({currentWorkflow:s.workflow,isLoading:!1})}catch{e({currentWorkflow:R8,isLoading:!1})}},saveWorkflow:async n=>{const r=t().selectedWorkflow;if(r){e({isLoading:!0,error:null});try{if(!(await fetch(`/api/workflows/${encodeURIComponent(r)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({workflow:n})})).ok)throw new Error("Failed to save workflow");e({currentWorkflow:n,isLoading:!1})}catch{e({error:"Failed to save workflow",isLoading:!1})}}},createWorkflow:async n=>{e({isLoading:!0,error:null});try{const r=await fetch("/api/workflows",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n})});if(!r.ok)throw new Error("Failed to create workflow");const s=await r.json(),o=[...t().workflows,s.workflow];e({workflows:o,selectedWorkflow:s.workflow.path,isLoading:!1}),t().loadWorkflow(s.workflow.path)}catch{e({error:"Failed to create workflow",isLoading:!1})}},deleteWorkflow:async n=>{var r;e({isLoading:!0,error:null});try{if(!(await fetch(`/api/workflows/${encodeURIComponent(n)}`,{method:"DELETE"})).ok)throw new Error("Failed to delete workflow");const o=t().workflows.filter(c=>c.path!==n),a=((r=o[0])==null?void 0:r.path)||null;e({workflows:o,selectedWorkflow:a,isLoading:!1}),BN(a)}catch{e({error:"Failed to delete workflow",isLoading:!1})}}})),I8=()=>typeof window>"u"||typeof navigator>"u"?!1:navigator.platform.toUpperCase().includes("MAC"),Tl=()=>I8()?"⌘":"Ctrl",A8={slack:oA,github:$0,jira:U6,gmail:MN,outlook:L0,linear:DN,notion:_o,discord:i8,airtable:K6,confluence:_o,http:sA,claude:Bu,opencode:Bu,ollama:Bu,webhook:dd,schedule:L0,trigger:dd,stripe:W6,teams:w8,twilio:u8,sendgrid:lA,shopify:p8,zendesk:e8,mailchimp:MN,asana:g8,trello:DN,dropbox:H6,s3:IN,"aws-s3":IN};function F0(e){const t=e.toLowerCase().split(".")[0];return A8[t]||V6}function M8({data:e,selected:t}){var f,m;const n=((f=e.action)==null?void 0:f.split(".")[0])||"unknown",r=((m=e.action)==null?void 0:m.split(".").slice(1).join("."))||e.action,s=F0(n),o={pending:{icon:jn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:To,color:"text-warning",bgColor:"bg-warning/10",animate:!0},completed:{icon:Pt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:ot,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:Ro,color:"text-gray-500",bgColor:"bg-gray-500/10"}},a=e.status||"pending",c=o[a],u=c.icon;return d.jsxs("div",{className:`step-node p-0 ${t?"selected":""} ${a==="running"?"running":""} ${a==="completed"?"completed":""} ${a==="failed"?"failed":""}`,children:[d.jsx(qe,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),d.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-node-border",children:[d.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center",children:d.jsx(s,{className:"w-5 h-5 text-primary"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-sm font-medium text-white truncate",children:e.name||e.id}),d.jsx("div",{className:"text-xs text-gray-400 truncate",children:n})]}),d.jsx("div",{className:`w-6 h-6 rounded-full ${c.bgColor} flex items-center justify-center`,children:d.jsx(u,{className:`w-4 h-4 ${c.color} ${c.animate?"animate-pulse":""}`})})]}),d.jsxs("div",{className:"p-3",children:[d.jsx("div",{className:"text-xs text-gray-300 font-mono truncate",children:r}),e.retryCount&&e.retryCount>0&&d.jsxs("div",{className:"mt-2 text-xs text-warning",children:["Retry #",e.retryCount]}),e.error&&d.jsx("div",{className:"mt-2 text-xs text-error truncate",children:e.error})]}),d.jsx(qe,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"})]})}const O8=j.memo(M8),Tw=Vr((e,t)=>({breadcrumbs:[],pushWorkflow:n=>{e({breadcrumbs:[...t().breadcrumbs,n]})},popToIndex:n=>{const{breadcrumbs:r}=t();n>=0&&n<r.length&&e({breadcrumbs:r.slice(0,n+1)})},popWorkflow:()=>{const{breadcrumbs:n}=t();n.length>1&&e({breadcrumbs:n.slice(0,-1)})},resetNavigation:()=>{e({breadcrumbs:[]})},setRootWorkflow:n=>{e({breadcrumbs:[n]})}}));function P8({data:e,selected:t}){const[n,r]=j.useState(!1),{pushWorkflow:s,breadcrumbs:o,setRootWorkflow:a}=Tw(),{loadWorkflow:c,selectedWorkflow:u,currentWorkflow:f}=qr(),m=j.useCallback(()=>{var v;o.length===0&&u&&f&&a({id:u,name:((v=f.metadata)==null?void 0:v.name)||"Main Workflow",path:u}),s({id:e.id,name:e.name||e.id,path:e.workflowPath}),c(e.workflowPath)},[e,s,o,a,u,f,c]),p={pending:"border-node-border",running:"border-warning",completed:"border-success",failed:"border-error"},g=e.status||"pending";return d.jsxs("div",{className:`step-node p-0 min-w-[250px] ${t?"selected":""} ${p[g]}`,children:[d.jsx(qe,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-info !border-2 !border-node-bg"}),d.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-node-border bg-info/5",children:[d.jsx("button",{onClick:()=>r(!n),className:"w-6 h-6 rounded flex items-center justify-center hover:bg-white/10 transition-colors",children:n?d.jsx(bs,{className:"w-4 h-4 text-info"}):d.jsx(Qt,{className:"w-4 h-4 text-info"})}),d.jsx("div",{className:"w-8 h-8 rounded-lg bg-info/10 flex items-center justify-center",children:d.jsx(cd,{className:"w-5 h-5 text-info"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-sm font-medium text-white truncate",children:e.name||e.id}),d.jsx("div",{className:"text-xs text-gray-400",children:"Sub-workflow"})]}),d.jsx("button",{onClick:m,className:"w-6 h-6 rounded flex items-center justify-center hover:bg-info/20 transition-colors",title:"Drill into sub-workflow",children:d.jsx(dl,{className:"w-4 h-4 text-info"})})]}),d.jsxs("div",{className:"p-3",children:[d.jsx("div",{className:"text-xs text-gray-400 font-mono truncate",children:e.workflowPath}),e.stepCount!==void 0&&d.jsx("div",{className:"mt-2 flex items-center gap-2",children:d.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full bg-info/10 text-info",children:[e.stepCount," steps"]})})]}),n&&d.jsx("div",{className:"border-t border-node-border p-3 bg-black/20",children:d.jsxs("button",{onClick:m,className:"w-full flex items-center justify-center gap-2 px-3 py-2 bg-info/10 hover:bg-info/20 rounded text-sm text-info transition-colors",children:[d.jsx(cd,{className:"w-4 h-4"}),"Open Sub-workflow",d.jsx(dl,{className:"w-4 h-4"})]})}),d.jsx(qe,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-info !border-2 !border-node-bg"})]})}const L8=j.memo(P8),zN={manual:{icon:To,color:"text-primary",bgColor:"bg-primary/10",borderColor:"border-primary",label:"Manual Trigger"},schedule:{icon:L0,color:"text-info",bgColor:"bg-info/10",borderColor:"border-info",label:"Schedule"},webhook:{icon:b8,color:"text-success",bgColor:"bg-success/10",borderColor:"border-success",label:"Webhook"},file:{icon:cd,color:"text-warning",bgColor:"bg-warning/10",borderColor:"border-warning",label:"File Watcher"},event:{icon:dd,color:"text-purple-400",bgColor:"bg-purple-400/10",borderColor:"border-purple-400",label:"Event"}};function D8({data:e,selected:t}){const n=zN[e.type]||zN.manual,r=n.icon,s=()=>{var o;switch(e.type){case"schedule":return e.cron||"No schedule set";case"webhook":return`${e.method||"POST"} ${e.path||"/webhook"}`;case"file":return e.pattern||"**/*";case"event":return((o=e.events)==null?void 0:o.join(", "))||"No events";default:return"Click to run"}};return d.jsxs("div",{className:`min-w-[180px] rounded-lg border-2 ${n.borderColor} ${n.bgColor} ${t?"ring-2 ring-primary ring-offset-2 ring-offset-canvas-bg":""} transition-all duration-200`,children:[d.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",children:[d.jsx("div",{className:`w-8 h-8 rounded-full ${n.bgColor} flex items-center justify-center`,children:d.jsx(r,{className:`w-4 h-4 ${n.color}`})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:n.label}),d.jsx("div",{className:"text-sm font-medium text-white truncate",children:e.name||"Trigger"})]}),e.active!==!1&&d.jsx("div",{className:"w-2 h-2 rounded-full bg-success animate-pulse",title:"Active"})]}),d.jsxs("div",{className:"px-3 py-2 border-t border-white/10",children:[d.jsx("div",{className:"text-xs text-gray-400 font-mono truncate",title:s(),children:s()}),e.lastTriggered&&d.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:["Last: ",new Date(e.lastTriggered).toLocaleString()]})]}),d.jsx(qe,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-canvas-bg"})]})}const $8=j.memo(D8);function q8({data:e,selected:t}){const n={pending:{icon:jn,color:"text-gray-400",borderColor:"border-gray-500",bgColor:"bg-gray-500/10"},completed:{icon:Pt,color:"text-success",borderColor:"border-success",bgColor:"bg-success/10"},failed:{icon:ot,color:"text-error",borderColor:"border-error",bgColor:"bg-error/10"}},r=e.status||"pending",s=n[r],o=s.icon;return d.jsxs("div",{className:`min-w-[160px] rounded-lg border-2 ${s.borderColor} ${s.bgColor} ${t?"ring-2 ring-primary ring-offset-2 ring-offset-canvas-bg":""} transition-all duration-200`,children:[d.jsx(qe,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-canvas-bg"}),d.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",children:[d.jsx("div",{className:`w-8 h-8 rounded-full ${s.bgColor} flex items-center justify-center`,children:d.jsx(Q6,{className:`w-4 h-4 ${s.color}`})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Output"}),d.jsx("div",{className:"text-sm font-medium text-white truncate",children:e.name||"Workflow End"})]}),d.jsx(o,{className:`w-4 h-4 ${s.color}`})]}),e.variables&&e.variables.length>0&&d.jsxs("div",{className:"px-3 py-2 border-t border-white/10",children:[d.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Output Variables"}),d.jsx("div",{className:"flex flex-wrap gap-1",children:e.variables.map(a=>d.jsx("code",{className:"px-1.5 py-0.5 bg-white/5 text-primary text-xs rounded",children:a},a))})]}),e.description&&d.jsx("div",{className:"px-3 py-2 border-t border-white/10",children:d.jsx("div",{className:"text-xs text-gray-400",children:e.description})}),r==="completed"&&e.result!==void 0&&d.jsxs("div",{className:"px-3 py-2 border-t border-white/10",children:[d.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Result"}),d.jsxs("pre",{className:"text-xs text-success font-mono bg-black/20 rounded p-1.5 overflow-x-auto max-h-20",children:[typeof e.result=="string"?e.result.slice(0,100):JSON.stringify(e.result,null,2).slice(0,100),(typeof e.result=="string"?e.result:JSON.stringify(e.result)).length>100&&"..."]})]})]})}const F8=j.memo(q8);function B8({data:e,selected:t}){const n={pending:{icon:jn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:$0,color:"text-blue-400",bgColor:"bg-blue-400/10",animate:!0},completed:{icon:Pt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:ot,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:ot,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return d.jsxs("div",{className:`control-flow-node if-else-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)"},children:[d.jsx(qe,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),d.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[d.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:d.jsx($0,{className:"w-5 h-5 text-white"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"If/Else"}),d.jsx("div",{className:"text-xs text-white/70",children:"Conditional"})]}),d.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:d.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),d.jsxs("div",{className:"p-3 bg-white/10",children:[d.jsx("div",{className:"text-xs text-white/90 font-mono mb-3",children:e.condition||"No condition set"}),d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsxs("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors relative ${e.activeBranch==="then"?"bg-green-500/30 text-green-200 ring-1 ring-green-400/50":e.skippedBranch==="then"?"bg-gray-500/20 text-gray-400":"bg-white/5 text-white/60"}`,children:["✓ Then",e.skippedBranch==="then"&&d.jsx("span",{className:"absolute -top-1 -right-1 text-[8px] px-1 py-0.5 rounded bg-gray-500/50 text-gray-300",children:"SKIP"})]}),d.jsxs("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors relative ${e.activeBranch==="else"?"bg-red-500/30 text-red-200 ring-1 ring-red-400/50":e.skippedBranch==="else"?"bg-gray-500/20 text-gray-400":"bg-white/5 text-white/60"}`,children:["✗ Else",e.skippedBranch==="else"&&d.jsx("span",{className:"absolute -top-1 -right-1 text-[8px] px-1 py-0.5 rounded bg-gray-500/50 text-gray-300",children:"SKIP"})]})]})]}),d.jsx(qe,{type:"source",position:he.Bottom,id:"then",style:{left:"33%"},className:"!w-3 !h-3 !bg-green-500 !border-2 !border-node-bg"}),d.jsx(qe,{type:"source",position:he.Bottom,id:"else",style:{left:"67%"},className:"!w-3 !h-3 !bg-red-500 !border-2 !border-node-bg"})]})}const z8=j.memo(B8);function V8({data:e,selected:t}){const n={pending:{icon:jn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:ON,color:"text-orange-400",bgColor:"bg-orange-400/10",animate:!0},completed:{icon:Pt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:ot,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:ot,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return d.jsxs("div",{className:`control-flow-node for-each-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #f093fb 0%, #f5576c 100%)"},children:[d.jsx(qe,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),d.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[d.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:d.jsx(ON,{className:"w-5 h-5 text-white"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"For Each"}),d.jsx("div",{className:"text-xs text-white/70",children:"Loop"})]}),d.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:d.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),d.jsxs("div",{className:"p-3 bg-white/10",children:[d.jsxs("div",{className:"text-xs text-white/90 mb-2",children:[d.jsx("span",{className:"text-white/60",children:"Items:"})," ",d.jsx("span",{className:"font-mono",children:e.items||"Not set"})]}),d.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[d.jsx("span",{className:"text-white/60",children:"Variable:"})," ",d.jsx("span",{className:"font-mono",children:e.itemVariable||"item"})]}),e.earlyExit&&d.jsxs("div",{className:"mb-3 p-2 bg-orange-500/20 border border-orange-500/30 rounded flex items-center gap-2",children:[d.jsx(iA,{className:"w-4 h-4 text-orange-200"}),d.jsx("span",{className:"text-xs text-orange-200 font-medium",children:e.exitReason==="break"?"Loop exited early (break)":"Loop stopped on error"})]}),e.totalIterations!==void 0&&d.jsxs("div",{className:"mt-2 p-2 bg-white/5 rounded",children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("span",{className:"text-xs text-white/70",children:"Progress"}),d.jsxs("span",{className:"text-xs text-white font-medium",children:[e.currentIteration||0," / ",e.totalIterations,e.earlyExit&&d.jsx("span",{className:"ml-1 text-orange-300 text-[10px]",children:"(stopped)"})]})]}),d.jsx("div",{className:"w-full bg-white/10 rounded-full h-1.5",children:d.jsx("div",{className:`h-1.5 rounded-full transition-all ${e.earlyExit?"bg-orange-400":"bg-pink-400"}`,style:{width:`${(e.currentIteration||0)/e.totalIterations*100}%`}})})]}),d.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[d.jsx("span",{children:"ℹ️"}),d.jsx("span",{children:"Access: loop.index, loop.first, loop.last"})]})]}),d.jsx(qe,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),d.jsx(qe,{id:"body",type:"source",position:he.Right,className:"!w-3 !h-3 !bg-purple-500 !border-2 !border-node-bg",style:{top:"50%",right:"-6px"}}),d.jsx(qe,{id:"loop-back",type:"target",position:he.Left,className:"!w-3 !h-3 !bg-purple-500 !border-2 !border-node-bg",style:{top:"50%",left:"-6px"}})]})}const U8=j.memo(V8);function H8({data:e,selected:t}){const n={pending:{icon:jn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:PN,color:"text-orange-400",bgColor:"bg-orange-400/10",animate:!0},completed:{icon:Pt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:ot,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:ot,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return d.jsxs("div",{className:`control-flow-node while-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #fb923c 0%, #f97316 100%)"},children:[d.jsx(qe,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),d.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[d.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:d.jsx(PN,{className:"w-5 h-5 text-white"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"While"}),d.jsx("div",{className:"text-xs text-white/70",children:"Loop"})]}),d.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:d.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),d.jsxs("div",{className:"p-3 bg-white/10",children:[d.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[d.jsx("span",{className:"text-white/60",children:"Condition:"})," ",d.jsx("span",{className:"font-mono",children:e.condition||"Not set"})]}),d.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[d.jsx("span",{className:"text-white/60",children:"Max Iterations:"})," ",d.jsx("span",{className:"font-medium",children:e.maxIterations||100})]}),e.earlyExit&&d.jsxs("div",{className:"mb-3 p-2 bg-orange-500/20 border border-orange-500/30 rounded flex items-center gap-2",children:[e.exitReason==="max_iterations"?d.jsx(jl,{className:"w-4 h-4 text-orange-200"}):d.jsx(iA,{className:"w-4 h-4 text-orange-200"}),d.jsx("span",{className:"text-xs text-orange-200 font-medium",children:e.exitReason==="break"?"Loop exited early (break)":e.exitReason==="max_iterations"?"Max iterations reached":"Loop stopped on error"})]}),e.currentIteration!==void 0&&d.jsxs("div",{className:"mt-2 p-2 bg-white/5 rounded",children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("span",{className:"text-xs text-white/70",children:"Iterations"}),d.jsxs("span",{className:"text-xs text-white font-medium",children:[e.currentIteration," / ",e.maxIterations||100,e.earlyExit&&d.jsx("span",{className:"ml-1 text-orange-300 text-[10px]",children:"(stopped)"})]})]}),d.jsx("div",{className:"w-full bg-white/10 rounded-full h-1.5",children:d.jsx("div",{className:`h-1.5 rounded-full transition-all ${e.earlyExit?"bg-orange-400":"bg-orange-500"}`,style:{width:`${e.currentIteration/(e.maxIterations||100)*100}%`}})})]}),d.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[d.jsx("span",{children:"⚠️"}),d.jsx("span",{children:"Exits when condition becomes false"})]})]}),d.jsx(qe,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),d.jsx(qe,{id:"body",type:"source",position:he.Right,className:"!w-3 !h-3 !bg-orange-500 !border-2 !border-node-bg",style:{top:"50%",right:"-6px"}}),d.jsx(qe,{id:"loop-back",type:"target",position:he.Left,className:"!w-3 !h-3 !bg-orange-500 !border-2 !border-node-bg",style:{top:"50%",left:"-6px"}})]})}const W8=j.memo(H8);function K8({data:e,selected:t}){const n={pending:{icon:jn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:TN,color:"text-purple-400",bgColor:"bg-purple-400/10",animate:!0},completed:{icon:Pt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:ot,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:ot,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon,a=Object.keys(e.cases||{}),c=a.slice(0,4),u=a.length>4,f=Math.min(a.length,4)+(e.hasDefault?1:0),m=p=>f===1?50:(p+1)/(f+1)*100;return d.jsxs("div",{className:`control-flow-node switch-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #a855f7 0%, #ec4899 100%)"},children:[d.jsx(qe,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),d.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[d.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:d.jsx(TN,{className:"w-5 h-5 text-white"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"Switch"}),d.jsx("div",{className:"text-xs text-white/70",children:"Multi-Branch Router"})]}),d.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:d.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),d.jsxs("div",{className:"p-3 bg-white/10",children:[d.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[d.jsx("span",{className:"text-white/60",children:"Expression:"})," ",d.jsx("span",{className:"font-mono",children:e.expression||"Not set"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("div",{className:"text-xs text-white/70 font-medium mb-1",children:"Cases:"}),c.map((p,g)=>{var w;const v=e.activeCase===p,b=(w=e.skippedBranches)==null?void 0:w.includes(p);return d.jsx("div",{className:"relative",children:d.jsxs("div",{className:`text-xs px-2 py-1.5 rounded font-medium transition-colors relative ${v?"bg-purple-500/30 text-purple-200 ring-1 ring-purple-400/50":b?"bg-gray-500/20 text-gray-400 line-through":"bg-white/5 text-white/70"}`,children:[p,b&&d.jsx("span",{className:"ml-2 text-[8px] px-1 py-0.5 rounded bg-gray-500/30",children:"SKIPPED"})]})},p)}),u&&d.jsxs("div",{className:"text-xs px-2 py-1 rounded bg-white/5 text-white/60 text-center",children:["+",a.length-4," more cases"]}),e.hasDefault&&d.jsx("div",{className:"relative",children:d.jsx("div",{className:`text-xs px-2 py-1.5 rounded font-medium transition-colors ${e.activeCase==="default"?"bg-gray-500/30 text-gray-200 ring-1 ring-gray-400/50":"bg-white/5 text-white/70"}`,children:"default"})})]}),d.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[d.jsx("span",{children:"ℹ️"}),d.jsxs("span",{children:[a.length," case",a.length!==1?"s":"",e.hasDefault?" + default":""]})]})]}),c.map((p,g)=>d.jsx(qe,{type:"source",position:he.Bottom,id:`case-${p}`,style:{left:`${m(g)}%`},className:"!w-2.5 !h-2.5 !bg-purple-400 !border-2 !border-node-bg"},`handle-${p}`)),e.hasDefault&&d.jsx(qe,{type:"source",position:he.Bottom,id:"case-default",style:{left:`${m(c.length)}%`},className:"!w-2.5 !h-2.5 !bg-gray-400 !border-2 !border-node-bg"})]})}const G8=j.memo(K8);function Y8({data:e,selected:t}){var a,c;const n={pending:{icon:jn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:AN,color:"text-green-400",bgColor:"bg-green-400/10",animate:!0},completed:{icon:Pt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:ot,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:ot,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return d.jsxs("div",{className:`control-flow-node parallel-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)"},children:[d.jsx(qe,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),d.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[d.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:d.jsx(AN,{className:"w-5 h-5 text-white"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"Parallel"}),d.jsx("div",{className:"text-xs text-white/70",children:"Concurrent Execution"})]}),d.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:d.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),d.jsxs("div",{className:"p-3 bg-white/10",children:[e.maxConcurrentExceeded&&d.jsxs("div",{className:"mb-3 p-2 bg-yellow-500/20 border border-yellow-500/30 rounded flex items-center gap-2",children:[d.jsx(jl,{className:"w-4 h-4 text-yellow-200"}),d.jsx("span",{className:"text-xs text-yellow-200 font-medium",children:"Rate limiting active"})]}),d.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[d.jsx("span",{className:"text-white/60",children:"Branches:"})," ",d.jsx("span",{className:"font-medium",children:((a=e.branches)==null?void 0:a.length)||0}),e.maxConcurrent&&d.jsxs(d.Fragment,{children:[" ",d.jsx("span",{className:"text-white/60",children:"• Max Concurrent:"})," ",d.jsx("span",{className:`font-medium ${e.maxConcurrentExceeded?"text-yellow-300":""}`,children:e.maxConcurrent})]})]}),d.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[(c=e.branches)==null?void 0:c.slice(0,6).map(u=>{var g,v,b;const f=(g=e.activeBranches)==null?void 0:g.includes(u.id),m=(v=e.completedBranches)==null?void 0:v.includes(u.id),p=(b=e.failedBranches)==null?void 0:b.includes(u.id);return d.jsx("div",{className:`px-2 py-1 rounded text-xs font-medium transition-colors ${p?"bg-red-500/30 text-red-200":m?"bg-green-500/30 text-green-200":f?"bg-blue-500/30 text-blue-200 animate-pulse":"bg-white/10 text-white/60"}`,title:u.name||u.id,children:u.name||`B${u.id.slice(-2)}`},u.id)}),e.branches&&e.branches.length>6&&d.jsxs("div",{className:"px-2 py-1 rounded text-xs font-medium bg-white/10 text-white/60",children:["+",e.branches.length-6]})]}),d.jsxs("div",{className:"text-xs text-white/50 flex items-center gap-1",children:[d.jsx("span",{children:"On Error:"}),d.jsx("span",{className:"font-medium",children:e.onError||"stop"})]})]}),d.jsx(qe,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"})]})}const X8=j.memo(Y8);function Q8({data:e,selected:t}){const n={pending:{icon:jn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:LN,color:"text-yellow-400",bgColor:"bg-yellow-400/10",animate:!0},completed:{icon:Pt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:ot,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:ot,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return d.jsxs("div",{className:`control-flow-node try-catch-node p-0 ${t?"selected":""} ${r==="running"?"running":""}`,style:{background:"linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%)"},children:[d.jsx(qe,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),d.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[d.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:d.jsx(LN,{className:"w-5 h-5 text-white"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"Try/Catch"}),d.jsx("div",{className:"text-xs text-white/70",children:"Error Handling"})]}),d.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:d.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),d.jsxs("div",{className:"p-3 bg-white/10",children:[e.errorOccurred&&d.jsxs("div",{className:"mb-3 p-2 bg-red-500/20 border border-red-500/30 rounded flex items-center gap-2",children:[d.jsx(jl,{className:"w-4 h-4 text-red-200"}),d.jsx("span",{className:"text-xs text-red-200 font-medium",children:"Error occurred"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors ${e.activeBranch==="try"?"bg-blue-500/30 text-blue-200 ring-1 ring-blue-400/50":"bg-white/5 text-white/60"}`,children:"✓ Try"}),e.hasCatch&&d.jsx("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors ${e.activeBranch==="catch"?"bg-red-500/30 text-red-200 ring-1 ring-red-400/50":"bg-white/5 text-white/60"}`,children:"⚠ Catch"}),e.hasFinally&&d.jsx("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors ${e.activeBranch==="finally"?"bg-purple-500/30 text-purple-200 ring-1 ring-purple-400/50":"bg-white/5 text-white/60"}`,children:"⟳ Finally"})]}),d.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[d.jsx("span",{children:"ℹ️"}),d.jsx("span",{children:"Finally always executes"})]})]}),d.jsx(qe,{type:"source",position:he.Bottom,id:"try",style:{left:"25%"},className:"!w-2.5 !h-2.5 !bg-blue-500 !border-2 !border-node-bg"}),e.hasCatch&&d.jsx(qe,{type:"source",position:he.Bottom,id:"catch",style:{left:"50%"},className:"!w-2.5 !h-2.5 !bg-red-500 !border-2 !border-node-bg"}),e.hasFinally&&d.jsx(qe,{type:"source",position:he.Bottom,id:"finally",style:{left:"75%"},className:"!w-2.5 !h-2.5 !bg-purple-500 !border-2 !border-node-bg"})]})}const J8=j.memo(Q8);function Z8({data:e,selected:t}){const n={map:{icon:dl,label:"Map",color:"#14b8a6"},filter:{icon:nA,label:"Filter",color:"#10b981"},reduce:{icon:o8,label:"Reduce",color:"#06b6d4"}},r={pending:{icon:jn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:n[e.transformType].icon,color:"text-teal-400",bgColor:"bg-teal-400/10",animate:!0},completed:{icon:Pt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:ot,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:ot,color:"text-gray-500",bgColor:"bg-gray-500/10"}},s=e.status||"pending",o=r[s],a=o.icon,c=n[e.transformType],u=c.icon,f=e.transformType==="filter"?e.condition:e.transformType==="reduce"?`${e.accumulatorVariable||"acc"}: ${e.expression||"Not set"}`:e.expression;return d.jsxs("div",{className:`control-flow-node transform-node p-0 ${t?"selected":""} ${s==="running"?"running":""}`,style:{background:"linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%)"},children:[d.jsx(qe,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),d.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[d.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:d.jsx(u,{className:"w-5 h-5 text-white"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-sm font-medium text-white",children:e.name||c.label}),d.jsx("div",{className:"text-xs text-white/70",children:"Transform"})]}),d.jsx("div",{className:`w-6 h-6 rounded-full ${o.bgColor} flex items-center justify-center`,children:d.jsx(a,{className:`w-4 h-4 ${o.color} ${o.animate?"animate-pulse":""}`})})]}),d.jsxs("div",{className:"p-3 bg-white/10",children:[d.jsxs("div",{className:"text-xs text-white/90 mb-2",children:[d.jsx("span",{className:"text-white/60",children:"Items:"})," ",d.jsx("span",{className:"font-mono",children:e.items||"Not set"})]}),d.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[d.jsx("span",{className:"text-white/60",children:"Variable:"})," ",d.jsx("span",{className:"font-mono",children:e.itemVariable||"item"})]}),d.jsxs("div",{className:"mb-3 p-2 bg-white/5 rounded",children:[d.jsx("div",{className:"text-xs text-white/60 mb-1",children:e.transformType==="filter"?"Condition":e.transformType==="reduce"?"Reducer":"Expression"}),d.jsx("div",{className:"text-xs text-white font-mono break-all",children:f||"Not set"})]}),e.transformType==="reduce"&&e.initialValue!==void 0&&d.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[d.jsx("span",{className:"text-white/60",children:"Initial:"})," ",d.jsx("span",{className:"font-mono",children:JSON.stringify(e.initialValue)})]}),(e.inputCount!==void 0||e.outputCount!==void 0)&&d.jsxs("div",{className:"mt-3 p-2 bg-white/5 rounded flex items-center justify-between",children:[d.jsxs("div",{className:"text-xs",children:[d.jsx("span",{className:"text-white/60",children:"In:"})," ",d.jsx("span",{className:"text-white font-medium",children:e.inputCount??"?"})]}),d.jsx("div",{className:"text-white/40",children:"→"}),d.jsxs("div",{className:"text-xs",children:[d.jsx("span",{className:"text-white/60",children:"Out:"})," ",d.jsx("span",{className:"text-white font-medium",children:e.outputCount??"?"})]})]}),d.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[d.jsx("span",{children:"ℹ️"}),d.jsx("span",{children:e.transformType==="map"?"Transforms each item":e.transformType==="filter"?"Selects matching items":"Aggregates to single value"})]})]}),d.jsx(qe,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),d.jsx(qe,{id:"loop-back",type:"source",position:he.Left,className:"!w-3 !h-3 !bg-teal-500 !border-2 !border-node-bg",style:{top:"50%",left:"-6px"}})]})}const Ap=j.memo(Z8);function Ae(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function VN(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Iw(...e){return t=>{let n=!1;const r=e.map(s=>{const o=VN(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():VN(e[s],null)}}}}function jt(...e){return j.useCallback(Iw(...e),e)}function ez(e,t){const n=j.createContext(t),r=o=>{const{children:a,...c}=o,u=j.useMemo(()=>c,Object.values(c));return d.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function s(o){const a=j.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,s]}function ci(e,t=[]){let n=[];function r(o,a){const c=j.createContext(a),u=n.length;n=[...n,a];const f=p=>{var S;const{scope:g,children:v,...b}=p,w=((S=g==null?void 0:g[e])==null?void 0:S[u])||c,x=j.useMemo(()=>b,Object.values(b));return d.jsx(w.Provider,{value:x,children:v})};f.displayName=o+"Provider";function m(p,g){var w;const v=((w=g==null?void 0:g[e])==null?void 0:w[u])||c,b=j.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[f,m]}const s=()=>{const o=n.map(a=>j.createContext(a));return function(c){const u=(c==null?void 0:c[e])||o;return j.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return s.scopeName=e,[r,tz(s,...t)]}function tz(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const a=r.reduce((c,{useScope:u,scopeName:f})=>{const p=u(o)[`__scope${f}`];return{...c,...p}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var ks=globalThis!=null&&globalThis.document?j.useLayoutEffect:()=>{},nz=dT[" useId ".trim().toString()]||(()=>{}),rz=0;function Qa(e){const[t,n]=j.useState(nz());return ks(()=>{n(r=>r??String(rz++))},[e]),t?`radix-${t}`:""}var sz=dT[" useInsertionEffect ".trim().toString()]||ks;function Aw({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,a]=iz({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:s;{const m=j.useRef(e!==void 0);j.useEffect(()=>{const p=m.current;p!==c&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=c},[c,r])}const f=j.useCallback(m=>{var p;if(c){const g=oz(m)?m(e):m;g!==e&&((p=a.current)==null||p.call(a,g))}else o(m)},[c,e,o,a]);return[u,f]}function iz({defaultProp:e,onChange:t}){const[n,r]=j.useState(e),s=j.useRef(n),o=j.useRef(t);return sz(()=>{o.current=t},[t]),j.useEffect(()=>{var a;s.current!==n&&((a=o.current)==null||a.call(o,n),s.current=n)},[n,s]),[n,r,o]}function oz(e){return typeof e=="function"}function fl(e){const t=az(e),n=j.forwardRef((r,s)=>{const{children:o,...a}=r,c=j.Children.toArray(o),u=c.find(cz);if(u){const f=u.props.children,m=c.map(p=>p===u?j.Children.count(f)>1?j.Children.only(null):j.isValidElement(f)?f.props.children:null:p);return d.jsx(t,{...a,ref:s,children:j.isValidElement(f)?j.cloneElement(f,void 0,m):null})}return d.jsx(t,{...a,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function az(e){const t=j.forwardRef((n,r)=>{const{children:s,...o}=n;if(j.isValidElement(s)){const a=dz(s),c=uz(o,s.props);return s.type!==j.Fragment&&(c.ref=r?Iw(r,a):a),j.cloneElement(s,c)}return j.Children.count(s)>1?j.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lz=Symbol("radix.slottable");function cz(e){return j.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lz}function uz(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...c)=>{const u=o(...c);return s(...c),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function dz(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tt=fz.reduce((e,t)=>{const n=fl(`Primitive.${t}`),r=j.forwardRef((s,o)=>{const{asChild:a,...c}=s,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(u,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function fA(e,t){e&&Cw.flushSync(()=>e.dispatchEvent(t))}function hr(e){const t=j.useRef(e);return j.useEffect(()=>{t.current=e}),j.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function hz(e,t=globalThis==null?void 0:globalThis.document){const n=hr(e);j.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var pz="DismissableLayer",B0="dismissableLayer.update",mz="dismissableLayer.pointerDownOutside",gz="dismissableLayer.focusOutside",UN,hA=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Mw=j.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...u}=e,f=j.useContext(hA),[m,p]=j.useState(null),g=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=j.useState({}),b=jt(t,I=>p(I)),w=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=w.indexOf(x),k=m?w.indexOf(m):-1,N=f.layersWithOutsidePointerEventsDisabled.size>0,C=k>=S,R=xz(I=>{const O=I.target,P=[...f.branches].some(B=>B.contains(O));!C||P||(s==null||s(I),a==null||a(I),I.defaultPrevented||c==null||c())},g),T=wz(I=>{const O=I.target;[...f.branches].some(B=>B.contains(O))||(o==null||o(I),a==null||a(I),I.defaultPrevented||c==null||c())},g);return hz(I=>{k===f.layers.size-1&&(r==null||r(I),!I.defaultPrevented&&c&&(I.preventDefault(),c()))},g),j.useEffect(()=>{if(m)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(UN=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),HN(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=UN)}},[m,g,n,f]),j.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),HN())},[m,f]),j.useEffect(()=>{const I=()=>v({});return document.addEventListener(B0,I),()=>document.removeEventListener(B0,I)},[]),d.jsx(tt.div,{...u,ref:b,style:{pointerEvents:N?C?"auto":"none":void 0,...e.style},onFocusCapture:Ae(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Ae(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Ae(e.onPointerDownCapture,R.onPointerDownCapture)})});Mw.displayName=pz;var yz="DismissableLayerBranch",vz=j.forwardRef((e,t)=>{const n=j.useContext(hA),r=j.useRef(null),s=jt(t,r);return j.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),d.jsx(tt.div,{...e,ref:s})});vz.displayName=yz;function xz(e,t=globalThis==null?void 0:globalThis.document){const n=hr(e),r=j.useRef(!1),s=j.useRef(()=>{});return j.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let u=function(){pA(mz,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=u,t.addEventListener("click",s.current,{once:!0})):u()}else t.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function wz(e,t=globalThis==null?void 0:globalThis.document){const n=hr(e),r=j.useRef(!1);return j.useEffect(()=>{const s=o=>{o.target&&!r.current&&pA(gz,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function HN(){const e=new CustomEvent(B0);document.dispatchEvent(e)}function pA(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?fA(s,o):s.dispatchEvent(o)}var Mp="focusScope.autoFocusOnMount",Op="focusScope.autoFocusOnUnmount",WN={bubbles:!1,cancelable:!0},bz="FocusScope",Ow=j.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[c,u]=j.useState(null),f=hr(s),m=hr(o),p=j.useRef(null),g=jt(t,w=>u(w)),v=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(r){let w=function(N){if(v.paused||!c)return;const C=N.target;c.contains(C)?p.current=C:vs(p.current,{select:!0})},x=function(N){if(v.paused||!c)return;const C=N.relatedTarget;C!==null&&(c.contains(C)||vs(p.current,{select:!0}))},S=function(N){if(document.activeElement===document.body)for(const R of N)R.removedNodes.length>0&&vs(c)};document.addEventListener("focusin",w),document.addEventListener("focusout",x);const k=new MutationObserver(S);return c&&k.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",x),k.disconnect()}}},[r,c,v.paused]),j.useEffect(()=>{if(c){GN.add(v);const w=document.activeElement;if(!c.contains(w)){const S=new CustomEvent(Mp,WN);c.addEventListener(Mp,f),c.dispatchEvent(S),S.defaultPrevented||(Sz(Ez(mA(c)),{select:!0}),document.activeElement===w&&vs(c))}return()=>{c.removeEventListener(Mp,f),setTimeout(()=>{const S=new CustomEvent(Op,WN);c.addEventListener(Op,m),c.dispatchEvent(S),S.defaultPrevented||vs(w??document.body,{select:!0}),c.removeEventListener(Op,m),GN.remove(v)},0)}}},[c,f,m,v]);const b=j.useCallback(w=>{if(!n&&!r||v.paused)return;const x=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,S=document.activeElement;if(x&&S){const k=w.currentTarget,[N,C]=_z(k);N&&C?!w.shiftKey&&S===C?(w.preventDefault(),n&&vs(N,{select:!0})):w.shiftKey&&S===N&&(w.preventDefault(),n&&vs(C,{select:!0})):S===k&&w.preventDefault()}},[n,r,v.paused]);return d.jsx(tt.div,{tabIndex:-1,...a,ref:g,onKeyDown:b})});Ow.displayName=bz;function Sz(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(vs(r,{select:t}),document.activeElement!==n)return}function _z(e){const t=mA(e),n=KN(t,e),r=KN(t.reverse(),e);return[n,r]}function mA(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function KN(e,t){for(const n of e)if(!Nz(n,{upTo:t}))return n}function Nz(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function kz(e){return e instanceof HTMLInputElement&&"select"in e}function vs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&kz(e)&&t&&e.select()}}var GN=Cz();function Cz(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=YN(e,t),e.unshift(t)},remove(t){var n;e=YN(e,t),(n=e[0])==null||n.resume()}}}function YN(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ez(e){return e.filter(t=>t.tagName!=="A")}var jz="Portal",Pw=j.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[s,o]=j.useState(!1);ks(()=>o(!0),[]);const a=n||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?wF.createPortal(d.jsx(tt.div,{...r,ref:t}),a):null});Pw.displayName=jz;function Rz(e,t){return j.useReducer((n,r)=>t[n][r]??n,e)}var Ur=e=>{const{present:t,children:n}=e,r=Tz(t),s=typeof n=="function"?n({present:r.isPresent}):j.Children.only(n),o=jt(r.ref,Iz(s));return typeof n=="function"||r.isPresent?j.cloneElement(s,{ref:o}):null};Ur.displayName="Presence";function Tz(e){const[t,n]=j.useState(),r=j.useRef(null),s=j.useRef(e),o=j.useRef("none"),a=e?"mounted":"unmounted",[c,u]=Rz(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{const f=xu(r.current);o.current=c==="mounted"?f:"none"},[c]),ks(()=>{const f=r.current,m=s.current;if(m!==e){const g=o.current,v=xu(f);e?u("MOUNT"):v==="none"||(f==null?void 0:f.display)==="none"?u("UNMOUNT"):u(m&&g!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,u]),ks(()=>{if(t){let f;const m=t.ownerDocument.defaultView??window,p=v=>{const w=xu(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&w&&(u("ANIMATION_END"),!s.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",f=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},g=v=>{v.target===t&&(o.current=xu(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{m.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:j.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function xu(e){return(e==null?void 0:e.animationName)||"none"}function Iz(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Pp=0;function gA(){j.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??XN()),document.body.insertAdjacentElement("beforeend",e[1]??XN()),Pp++,()=>{Pp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Pp--}},[])}function XN(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ar=function(){return ar=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ar.apply(this,arguments)};function yA(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function Az(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var zu="right-scroll-bar-position",Vu="width-before-scroll-bar",Mz="with-scroll-bars-hidden",Oz="--removed-body-scroll-bar-size";function Lp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Pz(e,t){var n=j.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var Lz=typeof window<"u"?j.useLayoutEffect:j.useEffect,QN=new WeakMap;function Dz(e,t){var n=Pz(null,function(r){return e.forEach(function(s){return Lp(s,r)})});return Lz(function(){var r=QN.get(n);if(r){var s=new Set(r),o=new Set(e),a=n.current;s.forEach(function(c){o.has(c)||Lp(c,null)}),o.forEach(function(c){s.has(c)||Lp(c,a)})}QN.set(n,e)},[e]),n}function $z(e){return e}function qz(e,t){t===void 0&&(t=$z);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(c){return o(c)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(o),a=n}var u=function(){var m=a;a=[],m.forEach(o)},f=function(){return Promise.resolve().then(u)};f(),n={push:function(m){a.push(m),f()},filter:function(m){return a=a.filter(m),n}}}};return s}function Fz(e){e===void 0&&(e={});var t=qz(null);return t.options=ar({async:!0,ssr:!1},e),t}var vA=function(e){var t=e.sideCar,n=yA(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return j.createElement(r,ar({},n))};vA.isSideCarExport=!0;function Bz(e,t){return e.useMedium(t),vA}var xA=Fz(),Dp=function(){},qd=j.forwardRef(function(e,t){var n=j.useRef(null),r=j.useState({onScrollCapture:Dp,onWheelCapture:Dp,onTouchMoveCapture:Dp}),s=r[0],o=r[1],a=e.forwardProps,c=e.children,u=e.className,f=e.removeScrollBar,m=e.enabled,p=e.shards,g=e.sideCar,v=e.noRelative,b=e.noIsolation,w=e.inert,x=e.allowPinchZoom,S=e.as,k=S===void 0?"div":S,N=e.gapMode,C=yA(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=g,T=Dz([n,t]),I=ar(ar({},C),s);return j.createElement(j.Fragment,null,m&&j.createElement(R,{sideCar:xA,removeScrollBar:f,shards:p,noRelative:v,noIsolation:b,inert:w,setCallbacks:o,allowPinchZoom:!!x,lockRef:n,gapMode:N}),a?j.cloneElement(j.Children.only(c),ar(ar({},I),{ref:T})):j.createElement(k,ar({},I,{className:u,ref:T}),c))});qd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};qd.classNames={fullWidth:Vu,zeroRight:zu};var zz=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Vz(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=zz();return t&&e.setAttribute("nonce",t),e}function Uz(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Hz(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Wz=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Vz())&&(Uz(t,n),Hz(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Kz=function(){var e=Wz();return function(t,n){j.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},wA=function(){var e=Kz(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},Gz={left:0,top:0,right:0,gap:0},$p=function(e){return parseInt(e||"",10)||0},Yz=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[$p(n),$p(r),$p(s)]},Xz=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Gz;var t=Yz(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Qz=wA(),co="data-scroll-locked",Jz=function(e,t,n,r){var s=e.left,o=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
513
+ .`.concat(Mz,` {
514
+ overflow: hidden `).concat(r,`;
515
+ padding-right: `).concat(c,"px ").concat(r,`;
516
+ }
517
+ body[`).concat(co,`] {
518
+ overflow: hidden `).concat(r,`;
519
+ overscroll-behavior: contain;
520
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
521
+ padding-left: `.concat(s,`px;
522
+ padding-top: `).concat(o,`px;
523
+ padding-right: `).concat(a,`px;
524
+ margin-left:0;
525
+ margin-top:0;
526
+ margin-right: `).concat(c,"px ").concat(r,`;
527
+ `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
528
+ }
529
+
530
+ .`).concat(zu,` {
531
+ right: `).concat(c,"px ").concat(r,`;
532
+ }
533
+
534
+ .`).concat(Vu,` {
535
+ margin-right: `).concat(c,"px ").concat(r,`;
536
+ }
537
+
538
+ .`).concat(zu," .").concat(zu,` {
539
+ right: 0 `).concat(r,`;
540
+ }
541
+
542
+ .`).concat(Vu," .").concat(Vu,` {
543
+ margin-right: 0 `).concat(r,`;
544
+ }
545
+
546
+ body[`).concat(co,`] {
547
+ `).concat(Oz,": ").concat(c,`px;
548
+ }
549
+ `)},JN=function(){var e=parseInt(document.body.getAttribute(co)||"0",10);return isFinite(e)?e:0},Zz=function(){j.useEffect(function(){return document.body.setAttribute(co,(JN()+1).toString()),function(){var e=JN()-1;e<=0?document.body.removeAttribute(co):document.body.setAttribute(co,e.toString())}},[])},eV=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;Zz();var o=j.useMemo(function(){return Xz(s)},[s]);return j.createElement(Qz,{styles:Jz(o,!t,s,n?"":"!important")})},z0=!1;if(typeof window<"u")try{var wu=Object.defineProperty({},"passive",{get:function(){return z0=!0,!0}});window.addEventListener("test",wu,wu),window.removeEventListener("test",wu,wu)}catch{z0=!1}var Gi=z0?{passive:!1}:!1,tV=function(e){return e.tagName==="TEXTAREA"},bA=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!tV(e)&&n[t]==="visible")},nV=function(e){return bA(e,"overflowY")},rV=function(e){return bA(e,"overflowX")},ZN=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=SA(e,r);if(s){var o=_A(e,r),a=o[1],c=o[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},sV=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},iV=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},SA=function(e,t){return e==="v"?nV(t):rV(t)},_A=function(e,t){return e==="v"?sV(t):iV(t)},oV=function(e,t){return e==="h"&&t==="rtl"?-1:1},aV=function(e,t,n,r,s){var o=oV(e,window.getComputedStyle(t).direction),a=o*r,c=n.target,u=t.contains(c),f=!1,m=a>0,p=0,g=0;do{if(!c)break;var v=_A(e,c),b=v[0],w=v[1],x=v[2],S=w-x-o*b;(b||S)&&SA(e,c)&&(p+=S,g+=b);var k=c.parentNode;c=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(m&&Math.abs(p)<1||!m&&Math.abs(g)<1)&&(f=!0),f},bu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ek=function(e){return[e.deltaX,e.deltaY]},tk=function(e){return e&&"current"in e?e.current:e},lV=function(e,t){return e[0]===t[0]&&e[1]===t[1]},cV=function(e){return`
550
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
551
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
552
+ `)},uV=0,Yi=[];function dV(e){var t=j.useRef([]),n=j.useRef([0,0]),r=j.useRef(),s=j.useState(uV++)[0],o=j.useState(wA)[0],a=j.useRef(e);j.useEffect(function(){a.current=e},[e]),j.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=Az([e.lockRef.current],(e.shards||[]).map(tk),!0).filter(Boolean);return w.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=j.useCallback(function(w,x){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!a.current.allowPinchZoom;var S=bu(w),k=n.current,N="deltaX"in w?w.deltaX:k[0]-S[0],C="deltaY"in w?w.deltaY:k[1]-S[1],R,T=w.target,I=Math.abs(N)>Math.abs(C)?"h":"v";if("touches"in w&&I==="h"&&T.type==="range")return!1;var O=window.getSelection(),P=O&&O.anchorNode,B=P?P===T||P.contains(T):!1;if(B)return!1;var M=ZN(I,T);if(!M)return!0;if(M?R=I:(R=I==="v"?"h":"v",M=ZN(I,T)),!M)return!1;if(!r.current&&"changedTouches"in w&&(N||C)&&(r.current=R),!R)return!0;var L=r.current||R;return aV(L,x,w,L==="h"?N:C)},[]),u=j.useCallback(function(w){var x=w;if(!(!Yi.length||Yi[Yi.length-1]!==o)){var S="deltaY"in x?ek(x):bu(x),k=t.current.filter(function(R){return R.name===x.type&&(R.target===x.target||x.target===R.shadowParent)&&lV(R.delta,S)})[0];if(k&&k.should){x.cancelable&&x.preventDefault();return}if(!k){var N=(a.current.shards||[]).map(tk).filter(Boolean).filter(function(R){return R.contains(x.target)}),C=N.length>0?c(x,N[0]):!a.current.noIsolation;C&&x.cancelable&&x.preventDefault()}}},[]),f=j.useCallback(function(w,x,S,k){var N={name:w,delta:x,target:S,should:k,shadowParent:fV(S)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(C){return C!==N})},1)},[]),m=j.useCallback(function(w){n.current=bu(w),r.current=void 0},[]),p=j.useCallback(function(w){f(w.type,ek(w),w.target,c(w,e.lockRef.current))},[]),g=j.useCallback(function(w){f(w.type,bu(w),w.target,c(w,e.lockRef.current))},[]);j.useEffect(function(){return Yi.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",u,Gi),document.addEventListener("touchmove",u,Gi),document.addEventListener("touchstart",m,Gi),function(){Yi=Yi.filter(function(w){return w!==o}),document.removeEventListener("wheel",u,Gi),document.removeEventListener("touchmove",u,Gi),document.removeEventListener("touchstart",m,Gi)}},[]);var v=e.removeScrollBar,b=e.inert;return j.createElement(j.Fragment,null,b?j.createElement(o,{styles:cV(s)}):null,v?j.createElement(eV,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function fV(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const hV=Bz(xA,dV);var Lw=j.forwardRef(function(e,t){return j.createElement(qd,ar({},e,{ref:t,sideCar:hV}))});Lw.classNames=qd.classNames;var pV=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Xi=new WeakMap,Su=new WeakMap,_u={},qp=0,NA=function(e){return e&&(e.host||NA(e.parentNode))},mV=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=NA(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},gV=function(e,t,n,r){var s=mV(t,Array.isArray(e)?e:[e]);_u[n]||(_u[n]=new WeakMap);var o=_u[n],a=[],c=new Set,u=new Set(s),f=function(p){!p||c.has(p)||(c.add(p),f(p.parentNode))};s.forEach(f);var m=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(g){if(c.has(g))m(g);else try{var v=g.getAttribute(r),b=v!==null&&v!=="false",w=(Xi.get(g)||0)+1,x=(o.get(g)||0)+1;Xi.set(g,w),o.set(g,x),a.push(g),w===1&&b&&Su.set(g,!0),x===1&&g.setAttribute(n,"true"),b||g.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",g,S)}})};return m(t),c.clear(),qp++,function(){a.forEach(function(p){var g=Xi.get(p)-1,v=o.get(p)-1;Xi.set(p,g),o.set(p,v),g||(Su.has(p)||p.removeAttribute(r),Su.delete(p)),v||p.removeAttribute(n)}),qp--,qp||(Xi=new WeakMap,Xi=new WeakMap,Su=new WeakMap,_u={})}},kA=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=pV(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),gV(r,s,n,"aria-hidden")):function(){return null}},Fd="Dialog",[CA]=ci(Fd),[yV,Gn]=CA(Fd),EA=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,c=j.useRef(null),u=j.useRef(null),[f,m]=Aw({prop:r,defaultProp:s??!1,onChange:o,caller:Fd});return d.jsx(yV,{scope:t,triggerRef:c,contentRef:u,contentId:Qa(),titleId:Qa(),descriptionId:Qa(),open:f,onOpenChange:m,onOpenToggle:j.useCallback(()=>m(p=>!p),[m]),modal:a,children:n})};EA.displayName=Fd;var jA="DialogTrigger",vV=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Gn(jA,n),o=jt(t,s.triggerRef);return d.jsx(tt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":qw(s.open),...r,ref:o,onClick:Ae(e.onClick,s.onOpenToggle)})});vV.displayName=jA;var Dw="DialogPortal",[xV,RA]=CA(Dw,{forceMount:void 0}),TA=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Gn(Dw,t);return d.jsx(xV,{scope:t,forceMount:n,children:j.Children.map(r,a=>d.jsx(Ur,{present:n||o.open,children:d.jsx(Pw,{asChild:!0,container:s,children:a})}))})};TA.displayName=Dw;var fd="DialogOverlay",IA=j.forwardRef((e,t)=>{const n=RA(fd,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Gn(fd,e.__scopeDialog);return o.modal?d.jsx(Ur,{present:r||o.open,children:d.jsx(bV,{...s,ref:t})}):null});IA.displayName=fd;var wV=fl("DialogOverlay.RemoveScroll"),bV=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Gn(fd,n);return d.jsx(Lw,{as:wV,allowPinchZoom:!0,shards:[s.contentRef],children:d.jsx(tt.div,{"data-state":qw(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ii="DialogContent",AA=j.forwardRef((e,t)=>{const n=RA(ii,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Gn(ii,e.__scopeDialog);return d.jsx(Ur,{present:r||o.open,children:o.modal?d.jsx(SV,{...s,ref:t}):d.jsx(_V,{...s,ref:t})})});AA.displayName=ii;var SV=j.forwardRef((e,t)=>{const n=Gn(ii,e.__scopeDialog),r=j.useRef(null),s=jt(t,n.contentRef,r);return j.useEffect(()=>{const o=r.current;if(o)return kA(o)},[]),d.jsx(MA,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ae(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&o.preventDefault()}),onFocusOutside:Ae(e.onFocusOutside,o=>o.preventDefault())})}),_V=j.forwardRef((e,t)=>{const n=Gn(ii,e.__scopeDialog),r=j.useRef(!1),s=j.useRef(!1);return d.jsx(MA,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var u,f;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;((f=n.triggerRef.current)==null?void 0:f.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),MA=j.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=e,c=Gn(ii,n),u=j.useRef(null),f=jt(t,u);return gA(),d.jsxs(d.Fragment,{children:[d.jsx(Ow,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:d.jsx(Mw,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":qw(c.open),...a,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(NV,{titleId:c.titleId}),d.jsx(CV,{contentRef:u,descriptionId:c.descriptionId})]})]})}),$w="DialogTitle",OA=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Gn($w,n);return d.jsx(tt.h2,{id:s.titleId,...r,ref:t})});OA.displayName=$w;var PA="DialogDescription",LA=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Gn(PA,n);return d.jsx(tt.p,{id:s.descriptionId,...r,ref:t})});LA.displayName=PA;var DA="DialogClose",$A=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Gn(DA,n);return d.jsx(tt.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,()=>s.onOpenChange(!1))})});$A.displayName=DA;function qw(e){return e?"open":"closed"}var qA="DialogTitleWarning",[WJ,FA]=ez(qA,{contentName:ii,titleName:$w,docsSlug:"dialog"}),NV=({titleId:e})=>{const t=FA(qA),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
553
+
554
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
555
+
556
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return j.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},kV="DialogDescriptionWarning",CV=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${FA(kV).contentName}}.`;return j.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},EV=EA,jV=TA,RV=IA,TV=AA,IV=OA,AV=LA,MV=$A;function BA(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=BA(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function OV(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=BA(e))&&(r&&(r+=" "),r+=t);return r}const Fw="-",PV=e=>{const t=DV(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const c=a.split(Fw);return c[0]===""&&c.length!==1&&c.shift(),zA(c,t)||LV(a)},getConflictingClassGroupIds:(a,c)=>{const u=n[a]||[];return c&&r[a]?[...u,...r[a]]:u}}},zA=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?zA(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Fw);return(a=t.validators.find(({validator:c})=>c(o)))==null?void 0:a.classGroupId},nk=/^\[(.+)\]$/,LV=e=>{if(nk.test(e)){const t=nk.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},DV=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return qV(Object.entries(e.classGroups),n).forEach(([o,a])=>{V0(a,r,o,t)}),r},V0=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:rk(t,s);o.classGroupId=n;return}if(typeof s=="function"){if($V(s)){V0(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,a])=>{V0(a,rk(t,o),n,r)})})},rk=(e,t)=>{let n=e;return t.split(Fw).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},$V=e=>e.isThemeGetter,qV=(e,t)=>t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,c])=>[t+a,c])):o);return[n,s]}):e,FV=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return s(o,a),a},set(o,a){n.has(o)?n.set(o,a):s(o,a)}}},VA="!",BV=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],o=t.length,a=c=>{const u=[];let f=0,m=0,p;for(let x=0;x<c.length;x++){let S=c[x];if(f===0){if(S===s&&(r||c.slice(x,x+o)===t)){u.push(c.slice(m,x)),m=x+o;continue}if(S==="/"){p=x;continue}}S==="["?f++:S==="]"&&f--}const g=u.length===0?c:c.substring(m),v=g.startsWith(VA),b=v?g.substring(1):g,w=p&&p>m?p-m:void 0;return{modifiers:u,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:w}};return n?c=>n({className:c,parseClassName:a}):a},zV=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},VV=e=>({cache:FV(e.cacheSize),parseClassName:BV(e),...PV(e)}),UV=/\s+/,HV=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=[],a=e.trim().split(UV);let c="";for(let u=a.length-1;u>=0;u-=1){const f=a[u],{modifiers:m,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:v}=n(f);let b=!!v,w=r(b?g.substring(0,v):g);if(!w){if(!b){c=f+(c.length>0?" "+c:c);continue}if(w=r(g),!w){c=f+(c.length>0?" "+c:c);continue}b=!1}const x=zV(m).join(":"),S=p?x+VA:x,k=S+w;if(o.includes(k))continue;o.push(k);const N=s(w,b);for(let C=0;C<N.length;++C){const R=N[C];o.push(S+R)}c=f+(c.length>0?" "+c:c)}return c};function WV(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=UA(t))&&(r&&(r+=" "),r+=n);return r}const UA=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=UA(e[r]))&&(n&&(n+=" "),n+=t);return n};function KV(e,...t){let n,r,s,o=a;function a(u){const f=t.reduce((m,p)=>p(m),e());return n=VV(f),r=n.cache.get,s=n.cache.set,o=c,c(u)}function c(u){const f=r(u);if(f)return f;const m=HV(u,n);return s(u,m),m}return function(){return o(WV.apply(null,arguments))}}const Qe=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},HA=/^\[(?:([a-z-]+):)?(.+)\]$/i,GV=/^\d+\/\d+$/,YV=new Set(["px","full","screen"]),XV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QV=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,JV=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ZV=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,e9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Tr=e=>uo(e)||YV.has(e)||GV.test(e),ms=e=>Ao(e,"length",l9),uo=e=>!!e&&!Number.isNaN(Number(e)),Fp=e=>Ao(e,"number",uo),Ma=e=>!!e&&Number.isInteger(Number(e)),t9=e=>e.endsWith("%")&&uo(e.slice(0,-1)),Me=e=>HA.test(e),gs=e=>XV.test(e),n9=new Set(["length","size","percentage"]),r9=e=>Ao(e,n9,WA),s9=e=>Ao(e,"position",WA),i9=new Set(["image","url"]),o9=e=>Ao(e,i9,u9),a9=e=>Ao(e,"",c9),Oa=()=>!0,Ao=(e,t,n)=>{const r=HA.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},l9=e=>QV.test(e)&&!JV.test(e),WA=()=>!1,c9=e=>ZV.test(e),u9=e=>e9.test(e),d9=()=>{const e=Qe("colors"),t=Qe("spacing"),n=Qe("blur"),r=Qe("brightness"),s=Qe("borderColor"),o=Qe("borderRadius"),a=Qe("borderSpacing"),c=Qe("borderWidth"),u=Qe("contrast"),f=Qe("grayscale"),m=Qe("hueRotate"),p=Qe("invert"),g=Qe("gap"),v=Qe("gradientColorStops"),b=Qe("gradientColorStopPositions"),w=Qe("inset"),x=Qe("margin"),S=Qe("opacity"),k=Qe("padding"),N=Qe("saturate"),C=Qe("scale"),R=Qe("sepia"),T=Qe("skew"),I=Qe("space"),O=Qe("translate"),P=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",Me,t],L=()=>[Me,t],U=()=>["",Tr,ms],$=()=>["auto",uo,Me],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],V=()=>["solid","dashed","dotted","double","none"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",Me],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[uo,Me];return{cacheSize:500,separator:":",theme:{colors:[Oa],spacing:[Tr,ms],blur:["none","",gs,Me],brightness:D(),borderColor:[e],borderRadius:["none","","full",gs,Me],borderSpacing:L(),borderWidth:U(),contrast:D(),grayscale:q(),hueRotate:D(),invert:q(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[t9,ms],inset:M(),margin:M(),opacity:D(),padding:L(),saturate:D(),scale:D(),sepia:q(),skew:D(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",Me]}],container:["container"],columns:[{columns:[gs]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...z(),Me]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ma,Me]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Me]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",Ma,Me]}],"grid-cols":[{"grid-cols":[Oa]}],"col-start-end":[{col:["auto",{span:["full",Ma,Me]},Me]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[Oa]}],"row-start-end":[{row:["auto",{span:[Ma,Me]},Me]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Me]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[k]}],px:[{px:[k]}],py:[{py:[k]}],ps:[{ps:[k]}],pe:[{pe:[k]}],pt:[{pt:[k]}],pr:[{pr:[k]}],pb:[{pb:[k]}],pl:[{pl:[k]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Me,t]}],"min-w":[{"min-w":[Me,t,"min","max","fit"]}],"max-w":[{"max-w":[Me,t,"none","full","min","max","fit","prose",{screen:[gs]},gs]}],h:[{h:[Me,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Me,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Me,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Me,t,"auto","min","max","fit"]}],"font-size":[{text:["base",gs,ms]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Fp]}],"font-family":[{font:[Oa]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Me]}],"line-clamp":[{"line-clamp":["none",uo,Fp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Tr,Me]}],"list-image":[{"list-image":["none",Me]}],"list-style-type":[{list:["none","disc","decimal",Me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Tr,ms]}],"underline-offset":[{"underline-offset":["auto",Tr,Me]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...z(),s9]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",r9]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},o9]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...V(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:V()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...V()]}],"outline-offset":[{"outline-offset":[Tr,Me]}],"outline-w":[{outline:[Tr,ms]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Tr,ms]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",gs,a9]}],"shadow-color":[{shadow:[Oa]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...G(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":G()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",gs,Me]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[p]}],saturate:[{saturate:[N]}],sepia:[{sepia:[R]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[R]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Me]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",Me]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",Me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Ma,Me]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Me]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Me]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Me]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Tr,ms,Fp]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},f9=KV(d9);function zt(...e){return f9(OV(e))}const h9={sm:"max-w-md",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl",full:"max-w-[90vw]"};function Cs({open:e,onOpenChange:t,title:n,description:r,children:s,className:o,size:a="md"}){return d.jsx(EV,{open:e,onOpenChange:t,children:d.jsxs(jV,{children:[d.jsx(RV,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),d.jsxs(TV,{className:zt("fixed left-[50%] top-[50%] z-50 translate-x-[-50%] translate-y-[-50%]","w-full rounded-lg border border-node-border bg-panel-bg shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]","data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]","duration-200",h9[a],o),children:[(n||r)&&d.jsxs("div",{className:"flex items-start justify-between p-4 border-b border-node-border",children:[d.jsxs("div",{children:[n&&d.jsx(IV,{className:"text-lg font-semibold text-white",children:n}),r&&d.jsx(AV,{className:"mt-1 text-sm text-gray-400",children:r})]}),d.jsx(MV,{className:"rounded-full p-1 hover:bg-white/10 transition-colors",children:d.jsx($r,{className:"w-5 h-5 text-gray-400"})})]}),d.jsx("div",{className:"max-h-[calc(85vh-8rem)] overflow-y-auto",children:s})]})]})})}function oi({children:e,className:t}){return d.jsx("div",{className:zt("flex items-center justify-end gap-3 p-4 border-t border-node-border",t),children:e})}const p9={primary:"bg-primary hover:bg-primary-dark text-white border-transparent",secondary:"bg-node-bg hover:bg-white/10 text-gray-300 border-node-border hover:border-primary",ghost:"bg-transparent hover:bg-white/10 text-gray-300 border-transparent",destructive:"bg-error/10 hover:bg-error/20 text-error border-error/20 hover:border-error"},m9={sm:"px-2.5 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},Be=j.forwardRef(({className:e,variant:t="primary",size:n="md",loading:r,icon:s,disabled:o,children:a,...c},u)=>d.jsxs("button",{ref:u,disabled:o||r,className:zt("inline-flex items-center justify-center gap-2 rounded-lg border font-medium transition-colors","focus:outline-none focus:ring-2 focus:ring-primary/50 focus:ring-offset-2 focus:ring-offset-panel-bg","disabled:opacity-50 disabled:cursor-not-allowed",p9[t],m9[n],e),...c,children:[r?d.jsx(Dr,{className:"w-4 h-4 animate-spin"}):s&&d.jsx("span",{className:"flex-shrink-0",children:s}),a]}));Be.displayName="Button";function KA(e){const t=e+"CollectionProvider",[n,r]=ci(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=w=>{const{scope:x,children:S}=w,k=pt.useRef(null),N=pt.useRef(new Map).current;return d.jsx(s,{scope:x,itemMap:N,collectionRef:k,children:S})};a.displayName=t;const c=e+"CollectionSlot",u=fl(c),f=pt.forwardRef((w,x)=>{const{scope:S,children:k}=w,N=o(c,S),C=jt(x,N.collectionRef);return d.jsx(u,{ref:C,children:k})});f.displayName=c;const m=e+"CollectionItemSlot",p="data-radix-collection-item",g=fl(m),v=pt.forwardRef((w,x)=>{const{scope:S,children:k,...N}=w,C=pt.useRef(null),R=jt(x,C),T=o(m,S);return pt.useEffect(()=>(T.itemMap.set(C,{ref:C,...N}),()=>void T.itemMap.delete(C))),d.jsx(g,{[p]:"",ref:R,children:k})});v.displayName=m;function b(w){const x=o(e+"CollectionConsumer",w);return pt.useCallback(()=>{const k=x.collectionRef.current;if(!k)return[];const N=Array.from(k.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((T,I)=>N.indexOf(T.ref.current)-N.indexOf(I.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:a,Slot:f,ItemSlot:v},b,r]}var g9=j.createContext(void 0);function Bw(e){const t=j.useContext(g9);return e||t||"ltr"}var Bp="rovingFocusGroup.onEntryFocus",y9={bubbles:!1,cancelable:!0},Il="RovingFocusGroup",[U0,GA,v9]=KA(Il),[x9,Bd]=ci(Il,[v9]),[w9,b9]=x9(Il),YA=j.forwardRef((e,t)=>d.jsx(U0.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(U0.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(S9,{...e,ref:t})})}));YA.displayName=Il;var S9=j.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...p}=e,g=j.useRef(null),v=jt(t,g),b=Bw(o),[w,x]=Aw({prop:a,defaultProp:c??null,onChange:u,caller:Il}),[S,k]=j.useState(!1),N=hr(f),C=GA(n),R=j.useRef(!1),[T,I]=j.useState(0);return j.useEffect(()=>{const O=g.current;if(O)return O.addEventListener(Bp,N),()=>O.removeEventListener(Bp,N)},[N]),d.jsx(w9,{scope:n,orientation:r,dir:b,loop:s,currentTabStopId:w,onItemFocus:j.useCallback(O=>x(O),[x]),onItemShiftTab:j.useCallback(()=>k(!0),[]),onFocusableItemAdd:j.useCallback(()=>I(O=>O+1),[]),onFocusableItemRemove:j.useCallback(()=>I(O=>O-1),[]),children:d.jsx(tt.div,{tabIndex:S||T===0?-1:0,"data-orientation":r,...p,ref:v,style:{outline:"none",...e.style},onMouseDown:Ae(e.onMouseDown,()=>{R.current=!0}),onFocus:Ae(e.onFocus,O=>{const P=!R.current;if(O.target===O.currentTarget&&P&&!S){const B=new CustomEvent(Bp,y9);if(O.currentTarget.dispatchEvent(B),!B.defaultPrevented){const M=C().filter(V=>V.focusable),L=M.find(V=>V.active),U=M.find(V=>V.id===w),z=[L,U,...M].filter(Boolean).map(V=>V.ref.current);JA(z,m)}}R.current=!1}),onBlur:Ae(e.onBlur,()=>k(!1))})})}),XA="RovingFocusGroupItem",QA=j.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,children:a,...c}=e,u=Qa(),f=o||u,m=b9(XA,n),p=m.currentTabStopId===f,g=GA(n),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:w}=m;return j.useEffect(()=>{if(r)return v(),()=>b()},[r,v,b]),d.jsx(U0.ItemSlot,{scope:n,id:f,focusable:r,active:s,children:d.jsx(tt.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...c,ref:t,onMouseDown:Ae(e.onMouseDown,x=>{r?m.onItemFocus(f):x.preventDefault()}),onFocus:Ae(e.onFocus,()=>m.onItemFocus(f)),onKeyDown:Ae(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){m.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const S=k9(x,m.orientation,m.dir);if(S!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let N=g().filter(C=>C.focusable).map(C=>C.ref.current);if(S==="last")N.reverse();else if(S==="prev"||S==="next"){S==="prev"&&N.reverse();const C=N.indexOf(x.currentTarget);N=m.loop?C9(N,C+1):N.slice(C+1)}setTimeout(()=>JA(N))}}),children:typeof a=="function"?a({isCurrentTabStop:p,hasTabStop:w!=null}):a})})});QA.displayName=XA;var _9={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function N9(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function k9(e,t,n){const r=N9(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return _9[r]}function JA(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function C9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ZA=YA,eM=QA,zd="Tabs",[E9]=ci(zd,[Bd]),tM=Bd(),[j9,zw]=E9(zd),nM=j.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:a="horizontal",dir:c,activationMode:u="automatic",...f}=e,m=Bw(c),[p,g]=Aw({prop:r,onChange:s,defaultProp:o??"",caller:zd});return d.jsx(j9,{scope:n,baseId:Qa(),value:p,onValueChange:g,orientation:a,dir:m,activationMode:u,children:d.jsx(tt.div,{dir:m,"data-orientation":a,...f,ref:t})})});nM.displayName=zd;var rM="TabsList",sM=j.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=zw(rM,n),a=tM(n);return d.jsx(ZA,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:d.jsx(tt.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});sM.displayName=rM;var iM="TabsTrigger",oM=j.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,a=zw(iM,n),c=tM(n),u=cM(a.baseId,r),f=uM(a.baseId,r),m=r===a.value;return d.jsx(eM,{asChild:!0,...c,focusable:!s,active:m,children:d.jsx(tt.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":f,"data-state":m?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:u,...o,ref:t,onMouseDown:Ae(e.onMouseDown,p=>{!s&&p.button===0&&p.ctrlKey===!1?a.onValueChange(r):p.preventDefault()}),onKeyDown:Ae(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&a.onValueChange(r)}),onFocus:Ae(e.onFocus,()=>{const p=a.activationMode!=="manual";!m&&!s&&p&&a.onValueChange(r)})})})});oM.displayName=iM;var aM="TabsContent",lM=j.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...a}=e,c=zw(aM,n),u=cM(c.baseId,r),f=uM(c.baseId,r),m=r===c.value,p=j.useRef(m);return j.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),d.jsx(Ur,{present:s||m,children:({present:g})=>d.jsx(tt.div,{"data-state":m?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!g,id:f,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:g&&o})})});lM.displayName=aM;function cM(e,t){return`${e}-trigger-${t}`}function uM(e,t){return`${e}-content-${t}`}var R9=nM,dM=sM,fM=oM,hM=lM;const pM=R9,Vw=j.forwardRef(({className:e,...t},n)=>d.jsx(dM,{ref:n,className:zt("inline-flex items-center gap-1 border-b border-node-border w-full px-2",e),...t}));Vw.displayName=dM.displayName;const ir=j.forwardRef(({className:e,...t},n)=>d.jsx(fM,{ref:n,className:zt("inline-flex items-center justify-center whitespace-nowrap px-3 py-2 text-sm font-medium","text-gray-400 transition-all","hover:text-gray-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50","disabled:pointer-events-none disabled:opacity-50","data-[state=active]:text-primary data-[state=active]:border-b-2 data-[state=active]:border-primary data-[state=active]:-mb-px",e),...t}));ir.displayName=fM.displayName;const or=j.forwardRef(({className:e,...t},n)=>d.jsx(hM,{ref:n,className:zt("focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50",e),...t}));or.displayName=hM.displayName;function sk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function T9(e){if(Array.isArray(e))return e}function I9(e,t,n){return(t=$9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A9(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,a,c=[],u=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(u=(r=o.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(m){f=!0,s=m}finally{try{if(!u&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(f)throw s}}return c}}function M9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
557
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ik(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ok(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ik(Object(n),!0).forEach(function(r){I9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ik(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function O9(e,t){if(e==null)return{};var n,r,s=P9(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function P9(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function L9(e,t){return T9(e)||A9(e,t)||q9(e,t)||M9()}function D9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $9(e){var t=D9(e,"string");return typeof t=="symbol"?t:t+""}function q9(e,t){if(e){if(typeof e=="string")return sk(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sk(e,t):void 0}}function F9(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ak(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function lk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ak(Object(n),!0).forEach(function(r){F9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ak(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function B9(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(s,o){return o(s)},r)}}function Fa(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return s.length>=e.length?e.apply(this,s):function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];return t.apply(n,[].concat(s,c))}}}function hd(e){return{}.toString.call(e).includes("Object")}function z9(e){return!Object.keys(e).length}function hl(e){return typeof e=="function"}function V9(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function U9(e,t){return hd(t)||Ss("changeType"),Object.keys(t).some(function(n){return!V9(e,n)})&&Ss("changeField"),t}function H9(e){hl(e)||Ss("selectorType")}function W9(e){hl(e)||hd(e)||Ss("handlerType"),hd(e)&&Object.values(e).some(function(t){return!hl(t)})&&Ss("handlersType")}function K9(e){e||Ss("initialIsRequired"),hd(e)||Ss("initialType"),z9(e)&&Ss("initialContent")}function G9(e,t){throw new Error(e[t]||e.default)}var Y9={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Ss=Fa(G9)(Y9),Nu={changes:U9,selector:H9,handler:W9,initial:K9};function X9(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Nu.initial(e),Nu.handler(t);var n={current:e},r=Fa(Z9)(n,t),s=Fa(J9)(n),o=Fa(Nu.changes)(e),a=Fa(Q9)(n);function c(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(m){return m};return Nu.selector(f),f(n.current)}function u(f){B9(r,s,o,a)(f)}return[c,u]}function Q9(e,t){return hl(t)?t(e.current):t}function J9(e,t){return e.current=lk(lk({},e.current),t),t}function Z9(e,t,n){return hl(t)?t(e.current):Object.keys(n).forEach(function(r){var s;return(s=t[r])===null||s===void 0?void 0:s.call(t,e.current[r])}),n}var eU={create:X9},tU={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function nU(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return s.length>=e.length?e.apply(this,s):function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];return t.apply(n,[].concat(s,c))}}}function rU(e){return{}.toString.call(e).includes("Object")}function sU(e){return e||ck("configIsRequired"),rU(e)||ck("configType"),e.urls?(iU(),{paths:{vs:e.urls.monacoBase}}):e}function iU(){console.warn(mM.deprecation)}function oU(e,t){throw new Error(e[t]||e.default)}var mM={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
558
+ You are using deprecated way of configuration.
559
+
560
+ Instead of using
561
+ monaco.config({ urls: { monacoBase: '...' } })
562
+ use
563
+ monaco.config({ paths: { vs: '...' } })
564
+
565
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
566
+ `},ck=nU(oU)(mM),aU={config:sU},lU=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(s){return n.reduceRight(function(o,a){return a(o)},s)}};function gM(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],gM(e[n],t[n]))}),ok(ok({},e),t)}var cU={type:"cancelation",msg:"operation is manually canceled"};function zp(e){var t=!1,n=new Promise(function(r,s){e.then(function(o){return t?s(cU):r(o)}),e.catch(s)});return n.cancel=function(){return t=!0},n}var uU=["monaco"],dU=eU.create({config:tU,isInitialized:!1,resolve:null,reject:null,monaco:null}),yM=L9(dU,2),Al=yM[0],Vd=yM[1];function fU(e){var t=aU.config(e),n=t.monaco,r=O9(t,uU);Vd(function(s){return{config:gM(s.config,r),monaco:n}})}function hU(){var e=Al(function(t){var n=t.monaco,r=t.isInitialized,s=t.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!e.isInitialized){if(Vd({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),zp(Vp);if(window.monaco&&window.monaco.editor)return vM(window.monaco),e.resolve(window.monaco),zp(Vp);lU(pU,gU)(yU)}return zp(Vp)}function pU(e){return document.body.appendChild(e)}function mU(e){var t=document.createElement("script");return e&&(t.src=e),t}function gU(e){var t=Al(function(r){var s=r.config,o=r.reject;return{config:s,reject:o}}),n=mU("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function yU(){var e=Al(function(n){var r=n.config,s=n.resolve,o=n.reject;return{config:r,resolve:s,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m||n;vM(r),e.resolve(r)},function(n){e.reject(n)})}function vM(e){Al().monaco||Vd({monaco:e})}function vU(){return Al(function(e){var t=e.monaco;return t})}var Vp=new Promise(function(e,t){return Vd({resolve:e,reject:t})}),xM={config:fU,init:hU,__getMonacoInstance:vU},xU={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Up=xU,wU={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},bU=wU;function SU({children:e}){return pt.createElement("div",{style:bU.container},e)}var _U=SU,NU=_U;function kU({width:e,height:t,isEditorReady:n,loading:r,_ref:s,className:o,wrapperProps:a}){return pt.createElement("section",{style:{...Up.wrapper,width:e,height:t},...a},!n&&pt.createElement(NU,null,r),pt.createElement("div",{ref:s,style:{...Up.fullWidth,...!n&&Up.hide},className:o}))}var CU=kU,wM=j.memo(CU);function EU(e){j.useEffect(e,[])}var bM=EU;function jU(e,t,n=!0){let r=j.useRef(!0);j.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var ln=jU;function Ja(){}function ro(e,t,n,r){return RU(e,r)||TU(e,t,n,r)}function RU(e,t){return e.editor.getModel(SM(e,t))}function TU(e,t,n,r){return e.editor.createModel(t,n,r?SM(e,r):void 0)}function SM(e,t){return e.Uri.parse(t)}function IU({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:c=!1,keepCurrentModifiedModel:u=!1,theme:f="light",loading:m="Loading...",options:p={},height:g="100%",width:v="100%",className:b,wrapperProps:w={},beforeMount:x=Ja,onMount:S=Ja}){let[k,N]=j.useState(!1),[C,R]=j.useState(!0),T=j.useRef(null),I=j.useRef(null),O=j.useRef(null),P=j.useRef(S),B=j.useRef(x),M=j.useRef(!1);bM(()=>{let z=xM.init();return z.then(V=>(I.current=V)&&R(!1)).catch(V=>(V==null?void 0:V.type)!=="cancelation"&&console.error("Monaco initialization: error:",V)),()=>T.current?$():z.cancel()}),ln(()=>{if(T.current&&I.current){let z=T.current.getOriginalEditor(),V=ro(I.current,e||"",r||n||"text",o||"");V!==z.getModel()&&z.setModel(V)}},[o],k),ln(()=>{if(T.current&&I.current){let z=T.current.getModifiedEditor(),V=ro(I.current,t||"",s||n||"text",a||"");V!==z.getModel()&&z.setModel(V)}},[a],k),ln(()=>{let z=T.current.getModifiedEditor();z.getOption(I.current.editor.EditorOption.readOnly)?z.setValue(t||""):t!==z.getValue()&&(z.executeEdits("",[{range:z.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),z.pushUndoStop())},[t],k),ln(()=>{var z,V;(V=(z=T.current)==null?void 0:z.getModel())==null||V.original.setValue(e||"")},[e],k),ln(()=>{let{original:z,modified:V}=T.current.getModel();I.current.editor.setModelLanguage(z,r||n||"text"),I.current.editor.setModelLanguage(V,s||n||"text")},[n,r,s],k),ln(()=>{var z;(z=I.current)==null||z.editor.setTheme(f)},[f],k),ln(()=>{var z;(z=T.current)==null||z.updateOptions(p)},[p],k);let L=j.useCallback(()=>{var G;if(!I.current)return;B.current(I.current);let z=ro(I.current,e||"",r||n||"text",o||""),V=ro(I.current,t||"",s||n||"text",a||"");(G=T.current)==null||G.setModel({original:z,modified:V})},[n,t,s,e,r,o,a]),U=j.useCallback(()=>{var z;!M.current&&O.current&&(T.current=I.current.editor.createDiffEditor(O.current,{automaticLayout:!0,...p}),L(),(z=I.current)==null||z.editor.setTheme(f),N(!0),M.current=!0)},[p,f,L]);j.useEffect(()=>{k&&P.current(T.current,I.current)},[k]),j.useEffect(()=>{!C&&!k&&U()},[C,k,U]);function $(){var V,G,F,q;let z=(V=T.current)==null?void 0:V.getModel();c||((G=z==null?void 0:z.original)==null||G.dispose()),u||((F=z==null?void 0:z.modified)==null||F.dispose()),(q=T.current)==null||q.dispose()}return pt.createElement(wM,{width:v,height:g,isEditorReady:k,loading:m,_ref:O,className:b,wrapperProps:w})}var AU=IU;j.memo(AU);function MU(e){let t=j.useRef();return j.useEffect(()=>{t.current=e},[e]),t.current}var OU=MU,ku=new Map;function PU({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:s,path:o,theme:a="light",line:c,loading:u="Loading...",options:f={},overrideServices:m={},saveViewState:p=!0,keepCurrentModel:g=!1,width:v="100%",height:b="100%",className:w,wrapperProps:x={},beforeMount:S=Ja,onMount:k=Ja,onChange:N,onValidate:C=Ja}){let[R,T]=j.useState(!1),[I,O]=j.useState(!0),P=j.useRef(null),B=j.useRef(null),M=j.useRef(null),L=j.useRef(k),U=j.useRef(S),$=j.useRef(),z=j.useRef(r),V=OU(o),G=j.useRef(!1),F=j.useRef(!1);bM(()=>{let D=xM.init();return D.then(W=>(P.current=W)&&O(!1)).catch(W=>(W==null?void 0:W.type)!=="cancelation"&&console.error("Monaco initialization: error:",W)),()=>B.current?X():D.cancel()}),ln(()=>{var W,oe,K,J;let D=ro(P.current,e||r||"",t||s||"",o||n||"");D!==((W=B.current)==null?void 0:W.getModel())&&(p&&ku.set(V,(oe=B.current)==null?void 0:oe.saveViewState()),(K=B.current)==null||K.setModel(D),p&&((J=B.current)==null||J.restoreViewState(ku.get(o))))},[o],R),ln(()=>{var D;(D=B.current)==null||D.updateOptions(f)},[f],R),ln(()=>{!B.current||r===void 0||(B.current.getOption(P.current.editor.EditorOption.readOnly)?B.current.setValue(r):r!==B.current.getValue()&&(F.current=!0,B.current.executeEdits("",[{range:B.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),B.current.pushUndoStop(),F.current=!1))},[r],R),ln(()=>{var W,oe;let D=(W=B.current)==null?void 0:W.getModel();D&&s&&((oe=P.current)==null||oe.editor.setModelLanguage(D,s))},[s],R),ln(()=>{var D;c!==void 0&&((D=B.current)==null||D.revealLine(c))},[c],R),ln(()=>{var D;(D=P.current)==null||D.editor.setTheme(a)},[a],R);let q=j.useCallback(()=>{var D;if(!(!M.current||!P.current)&&!G.current){U.current(P.current);let W=o||n,oe=ro(P.current,r||e||"",t||s||"",W||"");B.current=(D=P.current)==null?void 0:D.editor.create(M.current,{model:oe,automaticLayout:!0,...f},m),p&&B.current.restoreViewState(ku.get(W)),P.current.editor.setTheme(a),c!==void 0&&B.current.revealLine(c),T(!0),G.current=!0}},[e,t,n,r,s,o,f,m,p,a,c]);j.useEffect(()=>{R&&L.current(B.current,P.current)},[R]),j.useEffect(()=>{!I&&!R&&q()},[I,R,q]),z.current=r,j.useEffect(()=>{var D,W;R&&N&&((D=$.current)==null||D.dispose(),$.current=(W=B.current)==null?void 0:W.onDidChangeModelContent(oe=>{F.current||N(B.current.getValue(),oe)}))},[R,N]),j.useEffect(()=>{if(R){let D=P.current.editor.onDidChangeMarkers(W=>{var K;let oe=(K=B.current.getModel())==null?void 0:K.uri;if(oe&&W.find(J=>J.path===oe.path)){let J=P.current.editor.getModelMarkers({resource:oe});C==null||C(J)}});return()=>{D==null||D.dispose()}}return()=>{}},[R,C]);function X(){var D,W;(D=$.current)==null||D.dispose(),g?p&&ku.set(o,B.current.saveViewState()):(W=B.current.getModel())==null||W.dispose(),B.current.dispose()}return pt.createElement(wM,{width:v,height:b,isEditorReady:R,loading:u,_ref:M,className:w,wrapperProps:x})}var LU=PU,DU=j.memo(LU),Za=DU;const Uw=Symbol.for("yaml.alias"),H0=Symbol.for("yaml.document"),_s=Symbol.for("yaml.map"),_M=Symbol.for("yaml.pair"),pr=Symbol.for("yaml.scalar"),Mo=Symbol.for("yaml.seq"),En=Symbol.for("yaml.node.type"),ui=e=>!!e&&typeof e=="object"&&e[En]===Uw,Ml=e=>!!e&&typeof e=="object"&&e[En]===H0,Ol=e=>!!e&&typeof e=="object"&&e[En]===_s,dt=e=>!!e&&typeof e=="object"&&e[En]===_M,Ge=e=>!!e&&typeof e=="object"&&e[En]===pr,Pl=e=>!!e&&typeof e=="object"&&e[En]===Mo;function ct(e){if(e&&typeof e=="object")switch(e[En]){case _s:case Mo:return!0}return!1}function ut(e){if(e&&typeof e=="object")switch(e[En]){case Uw:case _s:case pr:case Mo:return!0}return!1}const NM=e=>(Ge(e)||ct(e))&&!!e.anchor,Gs=Symbol("break visit"),$U=Symbol("skip children"),el=Symbol("remove node");function Oo(e,t){const n=qU(t);Ml(e)?so(null,e.contents,n,Object.freeze([e]))===el&&(e.contents=null):so(null,e,n,Object.freeze([]))}Oo.BREAK=Gs;Oo.SKIP=$U;Oo.REMOVE=el;function so(e,t,n,r){const s=FU(e,t,n,r);if(ut(s)||dt(s))return BU(e,r,s),so(e,s,n,r);if(typeof s!="symbol"){if(ct(t)){r=Object.freeze(r.concat(t));for(let o=0;o<t.items.length;++o){const a=so(o,t.items[o],n,r);if(typeof a=="number")o=a-1;else{if(a===Gs)return Gs;a===el&&(t.items.splice(o,1),o-=1)}}}else if(dt(t)){r=Object.freeze(r.concat(t));const o=so("key",t.key,n,r);if(o===Gs)return Gs;o===el&&(t.key=null);const a=so("value",t.value,n,r);if(a===Gs)return Gs;a===el&&(t.value=null)}}return s}function qU(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function FU(e,t,n,r){var s,o,a,c,u;if(typeof n=="function")return n(e,t,r);if(Ol(t))return(s=n.Map)==null?void 0:s.call(n,e,t,r);if(Pl(t))return(o=n.Seq)==null?void 0:o.call(n,e,t,r);if(dt(t))return(a=n.Pair)==null?void 0:a.call(n,e,t,r);if(Ge(t))return(c=n.Scalar)==null?void 0:c.call(n,e,t,r);if(ui(t))return(u=n.Alias)==null?void 0:u.call(n,e,t,r)}function BU(e,t,n){const r=t[t.length-1];if(ct(r))r.items[e]=n;else if(dt(r))e==="key"?r.key=n:r.value=n;else if(Ml(r))r.contents=n;else{const s=ui(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const zU={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},VU=e=>e.replace(/[!,[\]{}]/g,t=>zU[t]);class Ft{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Ft.defaultYaml,t),this.tags=Object.assign({},Ft.defaultTags,n)}clone(){const t=new Ft(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Ft(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Ft.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Ft.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Ft.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Ft.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[o,a]=r;return this.tags[o]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[o]=r;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{const a=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,a),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const a=t.slice(2,-1);return a==="!"||a==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),a)}const[,r,s]=t.match(/^(.*!)([^!]*)$/s);s||n(`The ${t} tag has no suffix`);const o=this.tags[r];if(o)try{return o+decodeURIComponent(s)}catch(a){return n(String(a)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+VU(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let s;if(t&&r.length>0&&ut(t.contents)){const o={};Oo(t.contents,(a,c)=>{ut(c)&&c.tag&&(o[c.tag]=!0)}),s=Object.keys(o)}else s=[];for(const[o,a]of r)o==="!!"&&a==="tag:yaml.org,2002:"||(!t||s.some(c=>c.startsWith(a)))&&n.push(`%TAG ${o} ${a}`);return n.join(`
567
+ `)}}Ft.defaultYaml={explicit:!1,version:"1.2"};Ft.defaultTags={"!!":"tag:yaml.org,2002:"};function kM(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function CM(e){const t=new Set;return Oo(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function EM(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function UU(e,t){const n=[],r=new Map;let s=null;return{onAnchor:o=>{n.push(o),s??(s=CM(e));const a=EM(t,s);return s.add(a),a},setAnchors:()=>{for(const o of n){const a=r.get(o);if(typeof a=="object"&&a.anchor&&(Ge(a.node)||ct(a.node)))a.node.anchor=a.anchor;else{const c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=o,c}}},sourceObjects:r}}function io(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,o=r.length;s<o;++s){const a=r[s],c=io(e,r,String(s),a);c===void 0?delete r[s]:c!==a&&(r[s]=c)}else if(r instanceof Map)for(const s of Array.from(r.keys())){const o=r.get(s),a=io(e,r,s,o);a===void 0?r.delete(s):a!==o&&r.set(s,a)}else if(r instanceof Set)for(const s of Array.from(r)){const o=io(e,r,s,s);o===void 0?r.delete(s):o!==s&&(r.delete(s),r.add(o))}else for(const[s,o]of Object.entries(r)){const a=io(e,r,s,o);a===void 0?delete r[s]:a!==o&&(r[s]=a)}return e.call(t,n,r)}function kn(e,t,n){if(Array.isArray(e))return e.map((r,s)=>kn(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!NM(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=o=>{r.res=o,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class Hw{constructor(t){Object.defineProperty(this,En,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:o}={}){if(!Ml(t))throw new TypeError("A document argument is required");const a={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=kn(this,"",a);if(typeof s=="function")for(const{count:u,res:f}of a.anchors.values())s(f,u);return typeof o=="function"?io(o,{"":c},"",c):c}}class Ww extends Hw{constructor(t){super(Uw),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){let r;n!=null&&n.aliasResolveCache?r=n.aliasResolveCache:(r=[],Oo(t,{Node:(o,a)=>{(ui(a)||NM(a))&&r.push(a)}}),n&&(n.aliasResolveCache=r));let s;for(const o of r){if(o===this)break;o.anchor===this.source&&(s=o)}return s}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:s,maxAliasCount:o}=n,a=this.resolve(s,n);if(!a){const u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(u)}let c=r.get(a);if(c||(kn(a,null,n),c=r.get(a)),(c==null?void 0:c.res)===void 0){const u="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(u)}if(o>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=Uu(s,a,r)),c.count*c.aliasCount>o)){const u="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(u)}return c.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(kM(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${s} `}return s}}function Uu(e,t,n){if(ui(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(ct(t)){let r=0;for(const s of t.items){const o=Uu(e,s,n);o>r&&(r=o)}return r}else if(dt(t)){const r=Uu(e,t.key,n),s=Uu(e,t.value,n);return Math.max(r,s)}return 1}const jM=e=>!e||typeof e!="function"&&typeof e!="object";class Ie extends Hw{constructor(t){super(pr),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:kn(this.value,t,n)}toString(){return String(this.value)}}Ie.BLOCK_FOLDED="BLOCK_FOLDED";Ie.BLOCK_LITERAL="BLOCK_LITERAL";Ie.PLAIN="PLAIN";Ie.QUOTE_DOUBLE="QUOTE_DOUBLE";Ie.QUOTE_SINGLE="QUOTE_SINGLE";const HU="tag:yaml.org,2002:";function WU(e,t,n){if(t){const r=n.filter(o=>o.tag===t),s=r.find(o=>!o.format)??r[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find(r=>{var s;return((s=r.identify)==null?void 0:s.call(r,e))&&!r.format})}function pl(e,t,n){var p,g,v;if(Ml(e)&&(e=e.contents),ut(e))return e;if(dt(e)){const b=(g=(p=n.schema[_s]).createNode)==null?void 0:g.call(p,n.schema,null,n);return b.items.push(e),b}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:s,onTagObj:o,schema:a,sourceObjects:c}=n;let u;if(r&&e&&typeof e=="object"){if(u=c.get(e),u)return u.anchor??(u.anchor=s(e)),new Ww(u.anchor);u={anchor:null,node:null},c.set(e,u)}t!=null&&t.startsWith("!!")&&(t=HU+t.slice(2));let f=WU(e,t,a.tags);if(!f){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const b=new Ie(e);return u&&(u.node=b),b}f=e instanceof Map?a[_s]:Symbol.iterator in Object(e)?a[Mo]:a[_s]}o&&(o(f),delete n.onTagObj);const m=f!=null&&f.createNode?f.createNode(n.schema,e,n):typeof((v=f==null?void 0:f.nodeClass)==null?void 0:v.from)=="function"?f.nodeClass.from(n.schema,e,n):new Ie(e);return t?m.tag=t:f.default||(m.tag=f.tag),u&&(u.node=m),m}function pd(e,t,n){let r=n;for(let s=t.length-1;s>=0;--s){const o=t[s];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){const a=[];a[o]=r,r=a}else r=new Map([[o,r]])}return pl(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Ba=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;let RM=class extends Hw{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>ut(r)||dt(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Ba(t))this.add(n);else{const[r,...s]=t,o=this.get(r,!0);if(ct(o))o.addIn(s,n);else if(o===void 0&&this.schema)this.set(r,pd(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const s=this.get(n,!0);if(ct(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...s]=t,o=this.get(r,!0);return s.length===0?!n&&Ge(o)?o.value:o:ct(o)?o.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!dt(n))return!1;const r=n.value;return r==null||t&&Ge(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const s=this.get(n,!0);return ct(s)?s.hasIn(r):!1}setIn(t,n){const[r,...s]=t;if(s.length===0)this.set(r,n);else{const o=this.get(r,!0);if(ct(o))o.setIn(s,n);else if(o===void 0&&this.schema)this.set(r,pd(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}};const KU=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Mr(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Xs=(e,t,n)=>e.endsWith(`
568
+ `)?Mr(n,t):n.includes(`
569
+ `)?`
570
+ `+Mr(n,t):(e.endsWith(" ")?"":" ")+n,TM="flow",W0="block",Hu="quoted";function Ud(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:o=20,onFold:a,onOverflow:c}={}){if(!s||s<0)return e;s<o&&(o=0);const u=Math.max(1+o,1+s-t.length);if(e.length<=u)return e;const f=[],m={};let p=s-t.length;typeof r=="number"&&(r>s-Math.max(2,o)?f.push(0):p=s-r);let g,v,b=!1,w=-1,x=-1,S=-1;n===W0&&(w=uk(e,w,t.length),w!==-1&&(p=w+u));for(let N;N=e[w+=1];){if(n===Hu&&N==="\\"){switch(x=w,e[w+1]){case"x":w+=3;break;case"u":w+=5;break;case"U":w+=9;break;default:w+=1}S=w}if(N===`
571
+ `)n===W0&&(w=uk(e,w,t.length)),p=w+t.length+u,g=void 0;else{if(N===" "&&v&&v!==" "&&v!==`
572
+ `&&v!==" "){const C=e[w+1];C&&C!==" "&&C!==`
573
+ `&&C!==" "&&(g=w)}if(w>=p)if(g)f.push(g),p=g+u,g=void 0;else if(n===Hu){for(;v===" "||v===" ";)v=N,N=e[w+=1],b=!0;const C=w>S+1?w-2:x-1;if(m[C])return e;f.push(C),m[C]=!0,p=C+u,g=void 0}else b=!0}v=N}if(b&&c&&c(),f.length===0)return e;a&&a();let k=e.slice(0,f[0]);for(let N=0;N<f.length;++N){const C=f[N],R=f[N+1]||e.length;C===0?k=`
574
+ ${t}${e.slice(0,R)}`:(n===Hu&&m[C]&&(k+=`${e[C]}\\`),k+=`
575
+ ${t}${e.slice(C+1,R)}`)}return k}function uk(e,t,n){let r=t,s=t+1,o=e[s];for(;o===" "||o===" ";)if(t<s+n)o=e[++t];else{do o=e[++t];while(o&&o!==`
576
+ `);r=t,s=t+1,o=e[s]}return r}const Hd=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Wd=e=>/^(%|---|\.\.\.)/m.test(e);function GU(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let o=0,a=0;o<s;++o)if(e[o]===`
577
+ `){if(o-a>r)return!0;if(a=o+1,s-a<=r)return!1}return!0}function tl(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(Wd(e)?" ":"");let a="",c=0;for(let u=0,f=n[u];f;f=n[++u])if(f===" "&&n[u+1]==="\\"&&n[u+2]==="n"&&(a+=n.slice(c,u)+"\\ ",u+=1,c=u,f="\\"),f==="\\")switch(n[u+1]){case"u":{a+=n.slice(c,u);const m=n.substr(u+2,4);switch(m){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:m.substr(0,2)==="00"?a+="\\x"+m.substr(2):a+=n.substr(u,6)}u+=5,c=u+1}break;case"n":if(r||n[u+2]==='"'||n.length<s)u+=1;else{for(a+=n.slice(c,u)+`
578
+
579
+ `;n[u+2]==="\\"&&n[u+3]==="n"&&n[u+4]!=='"';)a+=`
580
+ `,u+=2;a+=o,n[u+2]===" "&&(a+="\\"),u+=1,c=u+1}break;default:u+=1}return a=c?a+n.slice(c):n,r?a:Ud(a,o,Hu,Hd(t,!1))}function K0(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
581
+ `)||/[ \t]\n|\n[ \t]/.test(e))return tl(e,t);const n=t.indent||(Wd(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
582
+ ${n}`)+"'";return t.implicitKey?r:Ud(r,n,TM,Hd(t,!1))}function oo(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=tl;else{const s=e.includes('"'),o=e.includes("'");s&&!o?r=K0:o&&!s?r=tl:r=n?K0:tl}return r(e,t)}let G0;try{G0=new RegExp(`(^|(?<!
583
+ ))
584
+ +(?!
585
+ |$)`,"g")}catch{G0=/\n+(?!\n|$)/g}function Wu({comment:e,type:t,value:n},r,s,o){const{blockQuote:a,commentString:c,lineWidth:u}=r.options;if(!a||/\n[\t ]+$/.test(n))return oo(n,r);const f=r.indent||(r.forceBlockIndent||Wd(n)?" ":""),m=a==="literal"?!0:a==="folded"||t===Ie.BLOCK_FOLDED?!1:t===Ie.BLOCK_LITERAL?!0:!GU(n,u,f.length);if(!n)return m?`|
586
+ `:`>
587
+ `;let p,g;for(g=n.length;g>0;--g){const R=n[g-1];if(R!==`
588
+ `&&R!==" "&&R!==" ")break}let v=n.substring(g);const b=v.indexOf(`
589
+ `);b===-1?p="-":n===v||b!==v.length-1?(p="+",o&&o()):p="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
590
+ `&&(v=v.slice(0,-1)),v=v.replace(G0,`$&${f}`));let w=!1,x,S=-1;for(x=0;x<n.length;++x){const R=n[x];if(R===" ")w=!0;else if(R===`
591
+ `)S=x;else break}let k=n.substring(0,S<x?S+1:x);k&&(n=n.substring(k.length),k=k.replace(/\n+/g,`$&${f}`));let C=(w?f?"2":"1":"")+p;if(e&&(C+=" "+c(e.replace(/ ?[\r\n]+/g," ")),s&&s()),!m){const R=n.replace(/\n+/g,`
592
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`);let T=!1;const I=Hd(r,!0);a!=="folded"&&t!==Ie.BLOCK_FOLDED&&(I.onOverflow=()=>{T=!0});const O=Ud(`${k}${R}${v}`,f,W0,I);if(!T)return`>${C}
593
+ ${f}${O}`}return n=n.replace(/\n+/g,`$&${f}`),`|${C}
594
+ ${f}${k}${n}${v}`}function YU(e,t,n,r){const{type:s,value:o}=e,{actualString:a,implicitKey:c,indent:u,indentStep:f,inFlow:m}=t;if(c&&o.includes(`
595
+ `)||m&&/[[\]{},]/.test(o))return oo(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return c||m||!o.includes(`
596
+ `)?oo(o,t):Wu(e,t,n,r);if(!c&&!m&&s!==Ie.PLAIN&&o.includes(`
597
+ `))return Wu(e,t,n,r);if(Wd(o)){if(u==="")return t.forceBlockIndent=!0,Wu(e,t,n,r);if(c&&u===f)return oo(o,t)}const p=o.replace(/\n+/g,`$&
598
+ ${u}`);if(a){const g=w=>{var x;return w.default&&w.tag!=="tag:yaml.org,2002:str"&&((x=w.test)==null?void 0:x.test(p))},{compat:v,tags:b}=t.doc.schema;if(b.some(g)||v!=null&&v.some(g))return oo(o,t)}return c?p:Ud(p,u,TM,Hd(t,!1))}function Kw(e,t,n,r){const{implicitKey:s,inFlow:o}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:c}=e;c!==Ie.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(c=Ie.QUOTE_DOUBLE);const u=m=>{switch(m){case Ie.BLOCK_FOLDED:case Ie.BLOCK_LITERAL:return s||o?oo(a.value,t):Wu(a,t,n,r);case Ie.QUOTE_DOUBLE:return tl(a.value,t);case Ie.QUOTE_SINGLE:return K0(a.value,t);case Ie.PLAIN:return YU(a,t,n,r);default:return null}};let f=u(c);if(f===null){const{defaultKeyType:m,defaultStringType:p}=t.options,g=s&&m||p;if(f=u(g),f===null)throw new Error(`Unsupported default string type ${g}`)}return f}function IM(e,t){const n=Object.assign({blockQuote:!0,commentString:KU,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function XU(e,t){var s;if(t.tag){const o=e.filter(a=>a.tag===t.tag);if(o.length>0)return o.find(a=>a.format===t.format)??o[0]}let n,r;if(Ge(t)){r=t.value;let o=e.filter(a=>{var c;return(c=a.identify)==null?void 0:c.call(a,r)});if(o.length>1){const a=o.filter(c=>c.test);a.length>0&&(o=a)}n=o.find(a=>a.format===t.format)??o.find(a=>!a.format)}else r=t,n=e.find(o=>o.nodeClass&&r instanceof o.nodeClass);if(!n){const o=((s=r==null?void 0:r.constructor)==null?void 0:s.name)??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${o} value`)}return n}function QU(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],o=(Ge(e)||ct(e))&&e.anchor;o&&kM(o)&&(n.add(o),s.push(`&${o}`));const a=e.tag??(t.default?null:t.tag);return a&&s.push(r.directives.tagString(a)),s.join(" ")}function ko(e,t,n,r){var u;if(dt(e))return e.toString(t,n,r);if(ui(e)){if(t.doc.directives)return e.toString(t);if((u=t.resolvedAliases)!=null&&u.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const o=ut(e)?e:t.doc.createNode(e,{onTagObj:f=>s=f});s??(s=XU(t.doc.schema.tags,o));const a=QU(o,s,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const c=typeof s.stringify=="function"?s.stringify(o,t,n,r):Ge(o)?Kw(o,t,n,r):o.toString(t,n,r);return a?Ge(o)||c[0]==="{"||c[0]==="["?`${a} ${c}`:`${a}
599
+ ${t.indent}${c}`:c}function JU({key:e,value:t},n,r,s){const{allNullValues:o,doc:a,indent:c,indentStep:u,options:{commentString:f,indentSeq:m,simpleKeys:p}}=n;let g=ut(e)&&e.comment||null;if(p){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(ct(e)||!ut(e)&&typeof e=="object"){const I="With simple keys, collection cannot be used as a key value";throw new Error(I)}}let v=!p&&(!e||g&&t==null&&!n.inFlow||ct(e)||(Ge(e)?e.type===Ie.BLOCK_FOLDED||e.type===Ie.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(p||!o),indent:c+u});let b=!1,w=!1,x=ko(e,n,()=>b=!0,()=>w=!0);if(!v&&!n.inFlow&&x.length>1024){if(p)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(o||t==null)return b&&r&&r(),x===""?"?":v?`? ${x}`:x}else if(o&&!p||t==null&&v)return x=`? ${x}`,g&&!b?x+=Xs(x,n.indent,f(g)):w&&s&&s(),x;b&&(g=null),v?(g&&(x+=Xs(x,n.indent,f(g))),x=`? ${x}
600
+ ${c}:`):(x=`${x}:`,g&&(x+=Xs(x,n.indent,f(g))));let S,k,N;ut(t)?(S=!!t.spaceBefore,k=t.commentBefore,N=t.comment):(S=!1,k=null,N=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!v&&!g&&Ge(t)&&(n.indentAtStart=x.length+1),w=!1,!m&&u.length>=2&&!n.inFlow&&!v&&Pl(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let C=!1;const R=ko(t,n,()=>C=!0,()=>w=!0);let T=" ";if(g||S||k){if(T=S?`
601
+ `:"",k){const I=f(k);T+=`
602
+ ${Mr(I,n.indent)}`}R===""&&!n.inFlow?T===`
603
+ `&&N&&(T=`
604
+
605
+ `):T+=`
606
+ ${n.indent}`}else if(!v&&ct(t)){const I=R[0],O=R.indexOf(`
607
+ `),P=O!==-1,B=n.inFlow??t.flow??t.items.length===0;if(P||!B){let M=!1;if(P&&(I==="&"||I==="!")){let L=R.indexOf(" ");I==="&"&&L!==-1&&L<O&&R[L+1]==="!"&&(L=R.indexOf(" ",L+1)),(L===-1||O<L)&&(M=!0)}M||(T=`
608
+ ${n.indent}`)}}else(R===""||R[0]===`
609
+ `)&&(T="");return x+=T+R,n.inFlow?C&&r&&r():N&&!C?x+=Xs(x,n.indent,f(N)):w&&s&&s(),x}function AM(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Cu="<<",Pr={identify:e=>e===Cu||typeof e=="symbol"&&e.description===Cu,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ie(Symbol(Cu)),{addToJSMap:MM}),stringify:()=>Cu},ZU=(e,t)=>(Pr.identify(t)||Ge(t)&&(!t.type||t.type===Ie.PLAIN)&&Pr.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Pr.tag&&n.default));function MM(e,t,n){if(n=e&&ui(n)?n.resolve(e.doc):n,Pl(n))for(const r of n.items)Hp(e,t,r);else if(Array.isArray(n))for(const r of n)Hp(e,t,r);else Hp(e,t,n)}function Hp(e,t,n){const r=e&&ui(n)?n.resolve(e.doc):n;if(!Ol(r))throw new Error("Merge sources must be maps or map aliases");const s=r.toJSON(null,e,Map);for(const[o,a]of s)t instanceof Map?t.has(o)||t.set(o,a):t instanceof Set?t.add(o):Object.prototype.hasOwnProperty.call(t,o)||Object.defineProperty(t,o,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function OM(e,t,{key:n,value:r}){if(ut(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(ZU(e,n))MM(e,t,r);else{const s=kn(n,"",e);if(t instanceof Map)t.set(s,kn(r,s,e));else if(t instanceof Set)t.add(s);else{const o=eH(n,s,e),a=kn(r,o,e);o in t?Object.defineProperty(t,o,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[o]=a}}return t}function eH(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(ut(e)&&(n!=null&&n.doc)){const r=IM(n.doc,{});r.anchors=new Set;for(const o of n.anchors.keys())r.anchors.add(o.anchor);r.inFlow=!0,r.inStringifyKey=!0;const s=e.toString(r);if(!n.mapKeyWarned){let o=JSON.stringify(s);o.length>40&&(o=o.substring(0,36)+'..."'),AM(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}function Gw(e,t,n){const r=pl(e,void 0,n),s=pl(t,void 0,n);return new Bt(r,s)}class Bt{constructor(t,n=null){Object.defineProperty(this,En,{value:_M}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return ut(n)&&(n=n.clone(t)),ut(r)&&(r=r.clone(t)),new Bt(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return OM(n,r,this)}toString(t,n,r){return t!=null&&t.doc?JU(this,t,n,r):JSON.stringify(this)}}function PM(e,t,n){return(t.inFlow??e.flow?nH:tH)(e,t,n)}function tH({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:o,onChompKeep:a,onComment:c}){const{indent:u,options:{commentString:f}}=n,m=Object.assign({},n,{indent:o,type:null});let p=!1;const g=[];for(let b=0;b<t.length;++b){const w=t[b];let x=null;if(ut(w))!p&&w.spaceBefore&&g.push(""),md(n,g,w.commentBefore,p),w.comment&&(x=w.comment);else if(dt(w)){const k=ut(w.key)?w.key:null;k&&(!p&&k.spaceBefore&&g.push(""),md(n,g,k.commentBefore,p))}p=!1;let S=ko(w,m,()=>x=null,()=>p=!0);x&&(S+=Xs(S,o,f(x))),p&&x&&(p=!1),g.push(r+S)}let v;if(g.length===0)v=s.start+s.end;else{v=g[0];for(let b=1;b<g.length;++b){const w=g[b];v+=w?`
610
+ ${u}${w}`:`
611
+ `}}return e?(v+=`
612
+ `+Mr(f(e),u),c&&c()):p&&a&&a(),v}function nH({items:e},t,{flowChars:n,itemIndent:r}){const{indent:s,indentStep:o,flowCollectionPadding:a,options:{commentString:c}}=t;r+=o;const u=Object.assign({},t,{indent:r,inFlow:!0,type:null});let f=!1,m=0;const p=[];for(let b=0;b<e.length;++b){const w=e[b];let x=null;if(ut(w))w.spaceBefore&&p.push(""),md(t,p,w.commentBefore,!1),w.comment&&(x=w.comment);else if(dt(w)){const k=ut(w.key)?w.key:null;k&&(k.spaceBefore&&p.push(""),md(t,p,k.commentBefore,!1),k.comment&&(f=!0));const N=ut(w.value)?w.value:null;N?(N.comment&&(x=N.comment),N.commentBefore&&(f=!0)):w.value==null&&(k!=null&&k.comment)&&(x=k.comment)}x&&(f=!0);let S=ko(w,u,()=>x=null);b<e.length-1&&(S+=","),x&&(S+=Xs(S,r,c(x))),!f&&(p.length>m||S.includes(`
613
+ `))&&(f=!0),p.push(S),m=p.length}const{start:g,end:v}=n;if(p.length===0)return g+v;if(!f){const b=p.reduce((w,x)=>w+x.length+2,2);f=t.options.lineWidth>0&&b>t.options.lineWidth}if(f){let b=g;for(const w of p)b+=w?`
614
+ ${o}${s}${w}`:`
615
+ `;return`${b}
616
+ ${s}${v}`}else return`${g}${a}${p.join(" ")}${a}${v}`}function md({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const o=Mr(t(r),e);n.push(o.trimStart())}}function Qs(e,t){const n=Ge(t)?t.value:t;for(const r of e)if(dt(r)&&(r.key===t||r.key===n||Ge(r.key)&&r.key.value===n))return r}class Nn extends RM{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(_s,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:o}=r,a=new this(t),c=(u,f)=>{if(typeof o=="function")f=o.call(n,u,f);else if(Array.isArray(o)&&!o.includes(u))return;(f!==void 0||s)&&a.items.push(Gw(u,f,r))};if(n instanceof Map)for(const[u,f]of n)c(u,f);else if(n&&typeof n=="object")for(const u of Object.keys(n))c(u,n[u]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let r;dt(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Bt(t,t==null?void 0:t.value):r=new Bt(t.key,t.value);const s=Qs(this.items,r.key),o=(a=this.schema)==null?void 0:a.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);Ge(s.value)&&jM(r.value)?s.value.value=r.value:s.value=r.value}else if(o){const c=this.items.findIndex(u=>o(r,u)<0);c===-1?this.items.push(r):this.items.splice(c,0,r)}else this.items.push(r)}delete(t){const n=Qs(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=Qs(this.items,t),s=r==null?void 0:r.value;return(!n&&Ge(s)?s.value:s)??void 0}has(t){return!!Qs(this.items,t)}set(t,n){this.add(new Bt(t,n),!0)}toJSON(t,n,r){const s=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(s);for(const o of this.items)OM(n,s,o);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!dt(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),PM(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Po={collection:"map",default:!0,nodeClass:Nn,tag:"tag:yaml.org,2002:map",resolve(e,t){return Ol(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Nn.from(e,t,n)};class ai extends RM{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Mo,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Eu(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Eu(t);if(typeof r!="number")return;const s=this.items[r];return!n&&Ge(s)?s.value:s}has(t){const n=Eu(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=Eu(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const s=this.items[r];Ge(s)&&jM(n)?s.value=n:this.items[r]=n}toJSON(t,n){const r=[];n!=null&&n.onCreate&&n.onCreate(r);let s=0;for(const o of this.items)r.push(kn(o,String(s++),n));return r}toString(t,n,r){return t?PM(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:s}=r,o=new this(t);if(n&&Symbol.iterator in Object(n)){let a=0;for(let c of n){if(typeof s=="function"){const u=n instanceof Set?c:String(a++);c=s.call(n,u,c)}o.items.push(pl(c,void 0,r))}}return o}}function Eu(e){let t=Ge(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Lo={collection:"seq",default:!0,nodeClass:ai,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Pl(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>ai.from(e,t,n)},Kd={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),Kw(e,t,n,r)}},Gd={identify:e=>e==null,createNode:()=>new Ie(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ie(null),stringify:({source:e},t)=>typeof e=="string"&&Gd.test.test(e)?e:t.options.nullStr},Yw={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Ie(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Yw.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function Yn({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let o=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(o)){let a=o.indexOf(".");a<0&&(a=o.length,o+=".");let c=t-(o.length-a-1);for(;c-- >0;)o+="0"}return o}const LM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Yn},DM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Yn(e)}},$M={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Ie(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Yn},Yd=e=>typeof e=="bigint"||Number.isInteger(e),Xw=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function qM(e,t,n){const{value:r}=e;return Yd(r)&&r>=0?n+r.toString(t):Yn(e)}const FM={identify:e=>Yd(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Xw(e,2,8,n),stringify:e=>qM(e,8,"0o")},BM={identify:Yd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Xw(e,0,10,n),stringify:Yn},zM={identify:e=>Yd(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Xw(e,2,16,n),stringify:e=>qM(e,16,"0x")},rH=[Po,Lo,Kd,Gd,Yw,FM,BM,zM,LM,DM,$M];function dk(e){return typeof e=="bigint"||Number.isInteger(e)}const ju=({value:e})=>JSON.stringify(e),sH=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:ju},{identify:e=>e==null,createNode:()=>new Ie(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ju},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:ju},{identify:dk,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>dk(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:ju}],iH={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},oH=[Po,Lo].concat(sH,iH),Qw={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let s=0;s<n.length;++s)r[s]=n.charCodeAt(s);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,s,o){if(!n)return"";const a=n;let c;if(typeof btoa=="function"){let u="";for(let f=0;f<a.length;++f)u+=String.fromCharCode(a[f]);c=btoa(u)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Ie.BLOCK_LITERAL),t!==Ie.QUOTE_DOUBLE){const u=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),f=Math.ceil(c.length/u),m=new Array(f);for(let p=0,g=0;p<f;++p,g+=u)m[p]=c.substr(g,u);c=m.join(t===Ie.BLOCK_LITERAL?`
617
+ `:" ")}return Kw({comment:e,type:t,value:c},r,s,o)}};function VM(e,t){if(Pl(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!dt(r)){if(Ol(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const s=r.items[0]||new Bt(new Ie(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore}
618
+ ${s.key.commentBefore}`:r.commentBefore),r.comment){const o=s.value??s.key;o.comment=o.comment?`${r.comment}
619
+ ${o.comment}`:r.comment}r=s}e.items[n]=dt(r)?r:new Bt(r)}}else t("Expected a sequence for this tag");return e}function UM(e,t,n){const{replacer:r}=n,s=new ai(e);s.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof r=="function"&&(a=r.call(t,String(o++),a));let c,u;if(Array.isArray(a))if(a.length===2)c=a[0],u=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const f=Object.keys(a);if(f.length===1)c=f[0],u=a[c];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else c=a;s.items.push(Gw(c,u,n))}return s}const Jw={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:VM,createNode:UM};class fo extends ai{constructor(){super(),this.add=Nn.prototype.add.bind(this),this.delete=Nn.prototype.delete.bind(this),this.get=Nn.prototype.get.bind(this),this.has=Nn.prototype.has.bind(this),this.set=Nn.prototype.set.bind(this),this.tag=fo.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const s of this.items){let o,a;if(dt(s)?(o=kn(s.key,"",n),a=kn(s.value,o,n)):o=kn(s,"",n),r.has(o))throw new Error("Ordered maps must not include duplicate keys");r.set(o,a)}return r}static from(t,n,r){const s=UM(t,n,r),o=new this;return o.items=s.items,o}}fo.tag="tag:yaml.org,2002:omap";const Zw={collection:"seq",identify:e=>e instanceof Map,nodeClass:fo,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=VM(e,t),r=[];for(const{key:s}of n.items)Ge(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new fo,n)},createNode:(e,t,n)=>fo.from(e,t,n)};function HM({value:e,source:t},n){return t&&(e?WM:KM).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const WM={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Ie(!0),stringify:HM},KM={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Ie(!1),stringify:HM},aH={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Yn},lH={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Yn(e)}},cH={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new Ie(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:Yn},Ll=e=>typeof e=="bigint"||Number.isInteger(e);function Xd(e,t,n,{intAsBigInt:r}){const s=e[0];if((s==="-"||s==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const a=BigInt(e);return s==="-"?BigInt(-1)*a:a}const o=parseInt(e,n);return s==="-"?-1*o:o}function eb(e,t,n){const{value:r}=e;if(Ll(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return Yn(e)}const uH={identify:Ll,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Xd(e,2,2,n),stringify:e=>eb(e,2,"0b")},dH={identify:Ll,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Xd(e,1,8,n),stringify:e=>eb(e,8,"0")},fH={identify:Ll,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Xd(e,0,10,n),stringify:Yn},hH={identify:Ll,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Xd(e,2,16,n),stringify:e=>eb(e,16,"0x")};class ho extends Nn{constructor(t){super(t),this.tag=ho.tag}add(t){let n;dt(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Bt(t.key,null):n=new Bt(t,null),Qs(this.items,n.key)||this.items.push(n)}get(t,n){const r=Qs(this.items,t);return!n&&dt(r)?Ge(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=Qs(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Bt(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:s}=r,o=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof s=="function"&&(a=s.call(n,a,a)),o.items.push(Gw(a,null,r));return o}}ho.tag="tag:yaml.org,2002:set";const tb={collection:"map",identify:e=>e instanceof Set,nodeClass:ho,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>ho.from(e,t,n),resolve(e,t){if(Ol(e)){if(e.hasAllNullValues(!0))return Object.assign(new ho,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function nb(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,s=a=>t?BigInt(a):Number(a),o=r.replace(/_/g,"").split(":").reduce((a,c)=>a*s(60)+s(c),s(0));return n==="-"?s(-1)*o:o}function GM(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return Yn(e);let r="";t<0&&(r="-",t*=n(-1));const s=n(60),o=[t%s];return t<60?o.unshift(0):(t=(t-o[0])/s,o.unshift(t%s),t>=60&&(t=(t-o[0])/s,o.unshift(t))),r+o.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const YM={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>nb(e,n),stringify:GM},XM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>nb(e,!1),stringify:GM},Qd={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Qd.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,o,a,c]=t.map(Number),u=t[7]?Number((t[7]+"00").substr(1,3)):0;let f=Date.UTC(n,r-1,s,o||0,a||0,c||0,u);const m=t[8];if(m&&m!=="Z"){let p=nb(m,!1);Math.abs(p)<30&&(p*=60),f-=6e4*p}return new Date(f)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},fk=[Po,Lo,Kd,Gd,WM,KM,uH,dH,fH,hH,aH,lH,cH,Qw,Pr,Zw,Jw,tb,YM,XM,Qd],hk=new Map([["core",rH],["failsafe",[Po,Lo,Kd]],["json",oH],["yaml11",fk],["yaml-1.1",fk]]),pk={binary:Qw,bool:Yw,float:$M,floatExp:DM,floatNaN:LM,floatTime:XM,int:BM,intHex:zM,intOct:FM,intTime:YM,map:Po,merge:Pr,null:Gd,omap:Zw,pairs:Jw,seq:Lo,set:tb,timestamp:Qd},pH={"tag:yaml.org,2002:binary":Qw,"tag:yaml.org,2002:merge":Pr,"tag:yaml.org,2002:omap":Zw,"tag:yaml.org,2002:pairs":Jw,"tag:yaml.org,2002:set":tb,"tag:yaml.org,2002:timestamp":Qd};function Wp(e,t,n){const r=hk.get(t);if(r&&!e)return n&&!r.includes(Pr)?r.concat(Pr):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const o=Array.from(hk.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(const o of e)s=s.concat(o);else typeof e=="function"&&(s=e(s.slice()));return n&&(s=s.concat(Pr)),s.reduce((o,a)=>{const c=typeof a=="string"?pk[a]:a;if(!c){const u=JSON.stringify(a),f=Object.keys(pk).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${u}; use one of ${f}`)}return o.includes(c)||o.push(c),o},[])}const mH=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class rb{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:o,sortMapEntries:a,toStringDefaults:c}){this.compat=Array.isArray(t)?Wp(t,"compat"):t?Wp(null,t):null,this.name=typeof o=="string"&&o||"core",this.knownTags=s?pH:{},this.tags=Wp(n,this.name,r),this.toStringOptions=c??null,Object.defineProperty(this,_s,{value:Po}),Object.defineProperty(this,pr,{value:Kd}),Object.defineProperty(this,Mo,{value:Lo}),this.sortMapEntries=typeof a=="function"?a:a===!0?mH:null}clone(){const t=Object.create(rb.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function gH(e,t){var u;const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const f=e.directives.toString(e);f?(n.push(f),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const s=IM(e,t),{commentString:o}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const f=o(e.commentBefore);n.unshift(Mr(f,""))}let a=!1,c=null;if(e.contents){if(ut(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const p=o(e.contents.commentBefore);n.push(Mr(p,""))}s.forceBlockIndent=!!e.comment,c=e.contents.comment}const f=c?void 0:()=>a=!0;let m=ko(e.contents,s,()=>c=null,f);c&&(m+=Xs(m,"",o(c))),(m[0]==="|"||m[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${m}`:n.push(m)}else n.push(ko(e.contents,s));if((u=e.directives)!=null&&u.docEnd)if(e.comment){const f=o(e.comment);f.includes(`
620
+ `)?(n.push("..."),n.push(Mr(f,""))):n.push(`... ${f}`)}else n.push("...");else{let f=e.comment;f&&a&&(f=f.replace(/^\n+/,"")),f&&((!a||c)&&n[n.length-1]!==""&&n.push(""),n.push(Mr(o(f),"")))}return n.join(`
621
+ `)+`
622
+ `}class Dl{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,En,{value:H0});let s=null;typeof n=="function"||Array.isArray(n)?s=n:r===void 0&&n&&(r=n,n=void 0);const o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=o;let{version:a}=o;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new Ft({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,s,r)}clone(){const t=Object.create(Dl.prototype,{[En]:{value:H0}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=ut(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Qi(this.contents)&&this.contents.add(t)}addIn(t,n){Qi(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=CM(this);t.anchor=!n||r.has(n)?EM(n||"a",r):n}return new Ww(t.anchor)}createNode(t,n,r){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const x=k=>typeof k=="number"||k instanceof String||k instanceof Number,S=n.filter(x).map(String);S.length>0&&(n=n.concat(S)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:o,anchorPrefix:a,flow:c,keepUndefined:u,onTagObj:f,tag:m}=r??{},{onAnchor:p,setAnchors:g,sourceObjects:v}=UU(this,a||"a"),b={aliasDuplicateObjects:o??!0,keepUndefined:u??!1,onAnchor:p,onTagObj:f,replacer:s,schema:this.schema,sourceObjects:v},w=pl(t,m,b);return c&&ct(w)&&(w.flow=!0),g(),w}createPair(t,n,r={}){const s=this.createNode(t,null,r),o=this.createNode(n,null,r);return new Bt(s,o)}delete(t){return Qi(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Ba(t)?this.contents==null?!1:(this.contents=null,!0):Qi(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return ct(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Ba(t)?!n&&Ge(this.contents)?this.contents.value:this.contents:ct(this.contents)?this.contents.getIn(t,n):void 0}has(t){return ct(this.contents)?this.contents.has(t):!1}hasIn(t){return Ba(t)?this.contents!==void 0:ct(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=pd(this.schema,[t],n):Qi(this.contents)&&this.contents.set(t,n)}setIn(t,n){Ba(t)?this.contents=n:this.contents==null?this.contents=pd(this.schema,Array.from(t),n):Qi(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ft({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Ft({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const s=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new rb(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:s,onAnchor:o,reviver:a}={}){const c={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},u=kn(this.contents,n??"",c);if(typeof o=="function")for(const{count:f,res:m}of c.anchors.values())o(m,f);return typeof a=="function"?io(a,{"":u},"",u):u}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return gH(this,t)}}function Qi(e){if(ct(e))return!0;throw new Error("Expected a YAML collection as document contents")}class QM extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class za extends QM{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class yH extends QM{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const mk=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(c=>t.linePos(c));const{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let o=s-1,a=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(o>=60&&a.length>80){const c=Math.min(o-39,a.length-79);a="…"+a.substring(c),o-=c-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,o))){let c=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);c.length>80&&(c=c.substring(0,79)+`…
623
+ `),a=c+a}if(/[^ ]/.test(a)){let c=1;const u=n.linePos[1];(u==null?void 0:u.line)===r&&u.col>s&&(c=Math.max(1,Math.min(u.col-s,80-o)));const f=" ".repeat(o)+"^".repeat(c);n.message+=`:
624
+
625
+ ${a}
626
+ ${f}
627
+ `}};function Co(e,{flow:t,indicator:n,next:r,offset:s,onError:o,parentIndent:a,startOnNewline:c}){let u=!1,f=c,m=c,p="",g="",v=!1,b=!1,w=null,x=null,S=null,k=null,N=null,C=null,R=null;for(const O of e)switch(b&&(O.type!=="space"&&O.type!=="newline"&&O.type!=="comma"&&o(O.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b=!1),w&&(f&&O.type!=="comment"&&O.type!=="newline"&&o(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),w=null),O.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&O.source.includes(" ")&&(w=O),m=!0;break;case"comment":{m||o(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const P=O.source.substring(1)||" ";p?p+=g+P:p=P,g="",f=!1;break}case"newline":f?p?p+=O.source:(!C||n!=="seq-item-ind")&&(u=!0):g+=O.source,f=!0,v=!0,(x||S)&&(k=O),m=!0;break;case"anchor":x&&o(O,"MULTIPLE_ANCHORS","A node can have at most one anchor"),O.source.endsWith(":")&&o(O.offset+O.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),x=O,R??(R=O.offset),f=!1,m=!1,b=!0;break;case"tag":{S&&o(O,"MULTIPLE_TAGS","A node can have at most one tag"),S=O,R??(R=O.offset),f=!1,m=!1,b=!0;break}case n:(x||S)&&o(O,"BAD_PROP_ORDER",`Anchors and tags must be after the ${O.source} indicator`),C&&o(O,"UNEXPECTED_TOKEN",`Unexpected ${O.source} in ${t??"collection"}`),C=O,f=n==="seq-item-ind"||n==="explicit-key-ind",m=!1;break;case"comma":if(t){N&&o(O,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),N=O,f=!1,m=!1;break}default:o(O,"UNEXPECTED_TOKEN",`Unexpected ${O.type} token`),f=!1,m=!1}const T=e[e.length-1],I=T?T.offset+T.source.length:s;return b&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w&&(f&&w.indent<=a||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&o(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:N,found:C,spaceBefore:u,comment:p,hasNewline:v,anchor:x,tag:S,newlineAfterProp:k,end:I,start:R??I}}function ml(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
628
+ `))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(ml(t.key)||ml(t.value))return!0}return!1;default:return!0}}function Y0(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&ml(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function JM(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const s=typeof r=="function"?r:(o,a)=>o===a||Ge(o)&&Ge(a)&&o.value===a.value;return t.some(o=>s(o.key,n))}const gk="All mapping items must start at the same column";function vH({composeNode:e,composeEmptyNode:t},n,r,s,o){var m;const a=(o==null?void 0:o.nodeClass)??Nn,c=new a(n.schema);n.atRoot&&(n.atRoot=!1);let u=r.offset,f=null;for(const p of r.items){const{start:g,key:v,sep:b,value:w}=p,x=Co(g,{indicator:"explicit-key-ind",next:v??(b==null?void 0:b[0]),offset:u,onError:s,parentIndent:r.indent,startOnNewline:!0}),S=!x.found;if(S){if(v&&(v.type==="block-seq"?s(u,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in v&&v.indent!==r.indent&&s(u,"BAD_INDENT",gk)),!x.anchor&&!x.tag&&!b){f=x.end,x.comment&&(c.comment?c.comment+=`
629
+ `+x.comment:c.comment=x.comment);continue}(x.newlineAfterProp||ml(v))&&s(v??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((m=x.found)==null?void 0:m.indent)!==r.indent&&s(u,"BAD_INDENT",gk);n.atKey=!0;const k=x.end,N=v?e(n,v,x,s):t(n,k,g,null,x,s);n.schema.compat&&Y0(r.indent,v,s),n.atKey=!1,JM(n,c.items,N)&&s(k,"DUPLICATE_KEY","Map keys must be unique");const C=Co(b??[],{indicator:"map-value-ind",next:w,offset:N.range[2],onError:s,parentIndent:r.indent,startOnNewline:!v||v.type==="block-scalar"});if(u=C.end,C.found){S&&((w==null?void 0:w.type)==="block-map"&&!C.hasNewline&&s(u,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&x.start<C.found.offset-1024&&s(N.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const R=w?e(n,w,C,s):t(n,u,b,null,C,s);n.schema.compat&&Y0(r.indent,w,s),u=R.range[2];const T=new Bt(N,R);n.options.keepSourceTokens&&(T.srcToken=p),c.items.push(T)}else{S&&s(N.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),C.comment&&(N.comment?N.comment+=`
630
+ `+C.comment:N.comment=C.comment);const R=new Bt(N);n.options.keepSourceTokens&&(R.srcToken=p),c.items.push(R)}}return f&&f<u&&s(f,"IMPOSSIBLE","Map comment with trailing content"),c.range=[r.offset,u,f??u],c}function xH({composeNode:e,composeEmptyNode:t},n,r,s,o){const a=(o==null?void 0:o.nodeClass)??ai,c=new a(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=r.offset,f=null;for(const{start:m,value:p}of r.items){const g=Co(m,{indicator:"seq-item-ind",next:p,offset:u,onError:s,parentIndent:r.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||p)(p==null?void 0:p.type)==="block-seq"?s(g.end,"BAD_INDENT","All sequence items must start at the same column"):s(u,"MISSING_CHAR","Sequence item without - indicator");else{f=g.end,g.comment&&(c.comment=g.comment);continue}const v=p?e(n,p,g,s):t(n,g.end,m,null,g,s);n.schema.compat&&Y0(r.indent,p,s),u=v.range[2],c.items.push(v)}return c.range=[r.offset,u,f??u],c}function $l(e,t,n,r){let s="";if(e){let o=!1,a="";for(const c of e){const{source:u,type:f}=c;switch(f){case"space":o=!0;break;case"comment":{n&&!o&&r(c,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const m=u.substring(1)||" ";s?s+=a+m:s=m,a="";break}case"newline":s&&(a+=u),o=!0;break;default:r(c,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}t+=u.length}}return{comment:s,offset:t}}const Kp="Block collections are not allowed within flow collections",Gp=e=>e&&(e.type==="block-map"||e.type==="block-seq");function wH({composeNode:e,composeEmptyNode:t},n,r,s,o){var x;const a=r.start.source==="{",c=a?"flow map":"flow sequence",u=(o==null?void 0:o.nodeClass)??(a?Nn:ai),f=new u(n.schema);f.flow=!0;const m=n.atRoot;m&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let p=r.offset+r.start.source.length;for(let S=0;S<r.items.length;++S){const k=r.items[S],{start:N,key:C,sep:R,value:T}=k,I=Co(N,{flow:c,indicator:"explicit-key-ind",next:C??(R==null?void 0:R[0]),offset:p,onError:s,parentIndent:r.indent,startOnNewline:!1});if(!I.found){if(!I.anchor&&!I.tag&&!R&&!T){S===0&&I.comma?s(I.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):S<r.items.length-1&&s(I.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),I.comment&&(f.comment?f.comment+=`
631
+ `+I.comment:f.comment=I.comment),p=I.end;continue}!a&&n.options.strict&&ml(C)&&s(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(S===0)I.comma&&s(I.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(I.comma||s(I.start,"MISSING_CHAR",`Missing , between ${c} items`),I.comment){let O="";e:for(const P of N)switch(P.type){case"comma":case"space":break;case"comment":O=P.source.substring(1);break e;default:break e}if(O){let P=f.items[f.items.length-1];dt(P)&&(P=P.value??P.key),P.comment?P.comment+=`
632
+ `+O:P.comment=O,I.comment=I.comment.substring(O.length+1)}}if(!a&&!R&&!I.found){const O=T?e(n,T,I,s):t(n,I.end,R,null,I,s);f.items.push(O),p=O.range[2],Gp(T)&&s(O.range,"BLOCK_IN_FLOW",Kp)}else{n.atKey=!0;const O=I.end,P=C?e(n,C,I,s):t(n,O,N,null,I,s);Gp(C)&&s(P.range,"BLOCK_IN_FLOW",Kp),n.atKey=!1;const B=Co(R??[],{flow:c,indicator:"map-value-ind",next:T,offset:P.range[2],onError:s,parentIndent:r.indent,startOnNewline:!1});if(B.found){if(!a&&!I.found&&n.options.strict){if(R)for(const U of R){if(U===B.found)break;if(U.type==="newline"){s(U,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}I.start<B.found.offset-1024&&s(B.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else T&&("source"in T&&((x=T.source)==null?void 0:x[0])===":"?s(T,"MISSING_CHAR",`Missing space after : in ${c}`):s(B.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const M=T?e(n,T,B,s):B.found?t(n,B.end,R,null,B,s):null;M?Gp(T)&&s(M.range,"BLOCK_IN_FLOW",Kp):B.comment&&(P.comment?P.comment+=`
633
+ `+B.comment:P.comment=B.comment);const L=new Bt(P,M);if(n.options.keepSourceTokens&&(L.srcToken=k),a){const U=f;JM(n,U.items,P)&&s(O,"DUPLICATE_KEY","Map keys must be unique"),U.items.push(L)}else{const U=new Nn(n.schema);U.flow=!0,U.items.push(L);const $=(M??P).range;U.range=[P.range[0],$[1],$[2]],f.items.push(U)}p=M?M.range[2]:B.end}}const g=a?"}":"]",[v,...b]=r.end;let w=p;if((v==null?void 0:v.source)===g)w=v.offset+v.source.length;else{const S=c[0].toUpperCase()+c.substring(1),k=m?`${S} must end with a ${g}`:`${S} in block collection must be sufficiently indented and end with a ${g}`;s(p,m?"MISSING_CHAR":"BAD_INDENT",k),v&&v.source.length!==1&&b.unshift(v)}if(b.length>0){const S=$l(b,w,n.options.strict,s);S.comment&&(f.comment?f.comment+=`
634
+ `+S.comment:f.comment=S.comment),f.range=[r.offset,w,S.offset]}else f.range=[r.offset,w,w];return f}function Yp(e,t,n,r,s,o){const a=n.type==="block-map"?vH(e,t,n,r,o):n.type==="block-seq"?xH(e,t,n,r,o):wH(e,t,n,r,o),c=a.constructor;return s==="!"||s===c.tagName?(a.tag=c.tagName,a):(s&&(a.tag=s),a)}function bH(e,t,n,r,s){var g;const o=r.tag,a=o?t.directives.tagName(o.source,v=>s(o,"TAG_RESOLVE_FAILED",v)):null;if(n.type==="block-seq"){const{anchor:v,newlineAfterProp:b}=r,w=v&&o?v.offset>o.offset?v:o:v??o;w&&(!b||b.offset<w.offset)&&s(w,"MISSING_CHAR","Missing newline after block sequence props")}const c=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!o||!a||a==="!"||a===Nn.tagName&&c==="map"||a===ai.tagName&&c==="seq")return Yp(e,t,n,s,a);let u=t.schema.tags.find(v=>v.tag===a&&v.collection===c);if(!u){const v=t.schema.knownTags[a];if((v==null?void 0:v.collection)===c)t.schema.tags.push(Object.assign({},v,{default:!1})),u=v;else return v?s(o,"BAD_COLLECTION_TYPE",`${v.tag} used for ${c} collection, but expects ${v.collection??"scalar"}`,!0):s(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Yp(e,t,n,s,a)}const f=Yp(e,t,n,s,a,u),m=((g=u.resolve)==null?void 0:g.call(u,f,v=>s(o,"TAG_RESOLVE_FAILED",v),t.options))??f,p=ut(m)?m:new Ie(m);return p.range=f.range,p.tag=a,u!=null&&u.format&&(p.format=u.format),p}function SH(e,t,n){const r=t.offset,s=_H(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const o=s.mode===">"?Ie.BLOCK_FOLDED:Ie.BLOCK_LITERAL,a=t.source?NH(t.source):[];let c=a.length;for(let w=a.length-1;w>=0;--w){const x=a[w][1];if(x===""||x==="\r")c=w;else break}if(c===0){const w=s.chomp==="+"&&a.length>0?`
635
+ `.repeat(Math.max(1,a.length-1)):"";let x=r+s.length;return t.source&&(x+=t.source.length),{value:w,type:o,comment:s.comment,range:[r,x,x]}}let u=t.indent+s.indent,f=t.offset+s.length,m=0;for(let w=0;w<c;++w){const[x,S]=a[w];if(S===""||S==="\r")s.indent===0&&x.length>u&&(u=x.length);else{x.length<u&&n(f+x.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(u=x.length),m=w,u===0&&!e.atRoot&&n(f,"BAD_INDENT","Block scalar values in collections must be indented");break}f+=x.length+S.length+1}for(let w=a.length-1;w>=c;--w)a[w][0].length>u&&(c=w+1);let p="",g="",v=!1;for(let w=0;w<m;++w)p+=a[w][0].slice(u)+`
636
+ `;for(let w=m;w<c;++w){let[x,S]=a[w];f+=x.length+S.length+1;const k=S[S.length-1]==="\r";if(k&&(S=S.slice(0,-1)),S&&x.length<u){const C=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;n(f-S.length-(k?2:1),"BAD_INDENT",C),x=""}o===Ie.BLOCK_LITERAL?(p+=g+x.slice(u)+S,g=`
637
+ `):x.length>u||S[0]===" "?(g===" "?g=`
638
+ `:!v&&g===`
639
+ `&&(g=`
640
+
641
+ `),p+=g+x.slice(u)+S,g=`
642
+ `,v=!0):S===""?g===`
643
+ `?p+=`
644
+ `:g=`
645
+ `:(p+=g+S,g=" ",v=!1)}switch(s.chomp){case"-":break;case"+":for(let w=c;w<a.length;++w)p+=`
646
+ `+a[w][0].slice(u);p[p.length-1]!==`
647
+ `&&(p+=`
648
+ `);break;default:p+=`
649
+ `}const b=r+s.length+t.source.length;return{value:p,type:o,comment:s.comment,range:[r,b,b]}}function _H({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=t[0],o=s[0];let a=0,c="",u=-1;for(let g=1;g<s.length;++g){const v=s[g];if(!c&&(v==="-"||v==="+"))c=v;else{const b=Number(v);!a&&b?a=b:u===-1&&(u=e+g)}}u!==-1&&r(u,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let f=!1,m="",p=s.length;for(let g=1;g<t.length;++g){const v=t[g];switch(v.type){case"space":f=!0;case"newline":p+=v.source.length;break;case"comment":n&&!f&&r(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),p+=v.source.length,m=v.source.substring(1);break;case"error":r(v,"UNEXPECTED_TOKEN",v.message),p+=v.source.length;break;default:{const b=`Unexpected token in block scalar header: ${v.type}`;r(v,"UNEXPECTED_TOKEN",b);const w=v.source;w&&typeof w=="string"&&(p+=w.length)}}}return{mode:o,indent:a,chomp:c,comment:m,length:p}}function NH(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),o=[r!=null&&r[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let a=1;a<t.length;a+=2)o.push([t[a],t[a+1]]);return o}function kH(e,t,n){const{offset:r,type:s,source:o,end:a}=e;let c,u;const f=(g,v,b)=>n(r+g,v,b);switch(s){case"scalar":c=Ie.PLAIN,u=CH(o,f);break;case"single-quoted-scalar":c=Ie.QUOTE_SINGLE,u=EH(o,f);break;case"double-quoted-scalar":c=Ie.QUOTE_DOUBLE,u=jH(o,f);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}const m=r+o.length,p=$l(a,m,t,n);return{value:u,type:c,comment:p.comment,range:[r,m,p.offset]}}function CH(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),ZM(e)}function EH(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),ZM(e.slice(1,-1)).replace(/''/g,"'")}function ZM(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
650
+ `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
651
+ `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let s=r[1],o=" ",a=t.lastIndex;for(n.lastIndex=a;r=n.exec(e);)r[1]===""?o===`
652
+ `?s+=o:o=`
653
+ `:(s+=o+r[1],o=" "),a=n.lastIndex;const c=/[ \t]*(.*)/sy;return c.lastIndex=a,r=c.exec(e),s+o+((r==null?void 0:r[1])??"")}function jH(e,t){let n="";for(let r=1;r<e.length-1;++r){const s=e[r];if(!(s==="\r"&&e[r+1]===`
654
+ `))if(s===`
655
+ `){const{fold:o,offset:a}=RH(e,r);n+=o,r=a}else if(s==="\\"){let o=e[++r];const a=TH[o];if(a)n+=a;else if(o===`
656
+ `)for(o=e[r+1];o===" "||o===" ";)o=e[++r+1];else if(o==="\r"&&e[r+1]===`
657
+ `)for(o=e[++r+1];o===" "||o===" ";)o=e[++r+1];else if(o==="x"||o==="u"||o==="U"){const c={x:2,u:4,U:8}[o];n+=IH(e,r+1,c,t),r+=c}else{const c=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),n+=c}}else if(s===" "||s===" "){const o=r;let a=e[r+1];for(;a===" "||a===" ";)a=e[++r+1];a!==`
658
+ `&&!(a==="\r"&&e[r+2]===`
659
+ `)&&(n+=r>o?e.slice(o,r+1):s)}else n+=s}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function RH(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
660
+ `||r==="\r")&&!(r==="\r"&&e[t+2]!==`
661
+ `);)r===`
662
+ `&&(n+=`
663
+ `),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const TH={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
664
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function IH(e,t,n,r){const s=e.substr(t,n),a=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;if(isNaN(a)){const c=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),c}return String.fromCodePoint(a)}function eO(e,t,n,r){const{value:s,type:o,comment:a,range:c}=t.type==="block-scalar"?SH(e,t,r):kH(t,e.options.strict,r),u=n?e.directives.tagName(n.source,p=>r(n,"TAG_RESOLVE_FAILED",p)):null;let f;e.options.stringKeys&&e.atKey?f=e.schema[pr]:u?f=AH(e.schema,s,u,n,r):t.type==="scalar"?f=MH(e,s,t,r):f=e.schema[pr];let m;try{const p=f.resolve(s,g=>r(n??t,"TAG_RESOLVE_FAILED",g),e.options);m=Ge(p)?p:new Ie(p)}catch(p){const g=p instanceof Error?p.message:String(p);r(n??t,"TAG_RESOLVE_FAILED",g),m=new Ie(s)}return m.range=c,m.source=s,o&&(m.type=o),u&&(m.tag=u),f.format&&(m.format=f.format),a&&(m.comment=a),m}function AH(e,t,n,r,s){var c;if(n==="!")return e[pr];const o=[];for(const u of e.tags)if(!u.collection&&u.tag===n)if(u.default&&u.test)o.push(u);else return u;for(const u of o)if((c=u.test)!=null&&c.test(t))return u;const a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[pr])}function MH({atKey:e,directives:t,schema:n},r,s,o){const a=n.tags.find(c=>{var u;return(c.default===!0||e&&c.default==="key")&&((u=c.test)==null?void 0:u.test(r))})||n[pr];if(n.compat){const c=n.compat.find(u=>{var f;return u.default&&((f=u.test)==null?void 0:f.test(r))})??n[pr];if(a.tag!==c.tag){const u=t.tagString(a.tag),f=t.tagString(c.tag),m=`Value may be parsed as either ${u} or ${f}`;o(s,"TAG_RESOLVE_FAILED",m,!0)}}return a}function OH(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let s=t[r];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++r];(s==null?void 0:s.type)==="space";)e+=s.source.length,s=t[++r];break}}return e}const PH={composeNode:tO,composeEmptyNode:sb};function tO(e,t,n,r){const s=e.atKey,{spaceBefore:o,comment:a,anchor:c,tag:u}=n;let f,m=!0;switch(t.type){case"alias":f=LH(e,t,r),(c||u)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":f=eO(e,t,u,r),c&&(f.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=bH(PH,e,t,n,r),c&&(f.anchor=c.source.substring(1));break;default:{const p=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",p),f=sb(e,t.offset,void 0,null,n,r),m=!1}}return c&&f.anchor===""&&r(c,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!Ge(f)||typeof f.value!="string"||f.tag&&f.tag!=="tag:yaml.org,2002:str")&&r(u??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(f.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?f.comment=a:f.commentBefore=a),e.options.keepSourceTokens&&m&&(f.srcToken=t),f}function sb(e,t,n,r,{spaceBefore:s,comment:o,anchor:a,tag:c,end:u},f){const m={type:"scalar",offset:OH(t,n,r),indent:-1,source:""},p=eO(e,m,c,f);return a&&(p.anchor=a.source.substring(1),p.anchor===""&&f(a,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(p.spaceBefore=!0),o&&(p.comment=o,p.range[2]=u),p}function LH({options:e},{offset:t,source:n,end:r},s){const o=new Ww(n.substring(1));o.source===""&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&s(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=t+n.length,c=$l(r,a,e.strict,s);return o.range=[t,a,c.offset],c.comment&&(o.comment=c.comment),o}function DH(e,t,{offset:n,start:r,value:s,end:o},a){const c=Object.assign({_directives:t},e),u=new Dl(void 0,c),f={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},m=Co(r,{indicator:"doc-start",next:s??(o==null?void 0:o[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});m.found&&(u.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!m.hasNewline&&a(m.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=s?tO(f,s,m,a):sb(f,m.end,r,null,m,a);const p=u.contents.range[2],g=$l(o,p,!1,a);return g.comment&&(u.comment=g.comment),u.range=[n,p,g.offset],u}function Pa(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function yk(e){var s;let t="",n=!1,r=!1;for(let o=0;o<e.length;++o){const a=e[o];switch(a[0]){case"#":t+=(t===""?"":r?`
665
+
666
+ `:`
667
+ `)+(a.substring(1)||" "),n=!0,r=!1;break;case"%":((s=e[o+1])==null?void 0:s[0])!=="#"&&(o+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class $H{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,s,o)=>{const a=Pa(n);o?this.warnings.push(new yH(a,r,s)):this.errors.push(new za(a,r,s))},this.directives=new Ft({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=yk(this.prelude);if(r){const o=t.contents;if(n)t.comment=t.comment?`${t.comment}
668
+ ${r}`:r;else if(s||t.directives.docStart||!o)t.commentBefore=r;else if(ct(o)&&!o.flow&&o.items.length>0){let a=o.items[0];dt(a)&&(a=a.key);const c=a.commentBefore;a.commentBefore=c?`${r}
669
+ ${c}`:r}else{const a=o.commentBefore;o.commentBefore=a?`${r}
670
+ ${a}`:r}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:yk(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(const s of t)yield*this.next(s);yield*this.end(n,r)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,r,s)=>{const o=Pa(t);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=DH(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new za(Pa(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new za(Pa(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=$l(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
671
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new za(Pa(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const r=Object.assign({_directives:this.directives},this.options),s=new Dl(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}}const nO="\uFEFF",rO="",sO="",X0="";function qH(e){switch(e){case nO:return"byte-order-mark";case rO:return"doc-mode";case sO:return"flow-error-end";case X0:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
672
+ `:case`\r
673
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function Dn(e){switch(e){case void 0:case" ":case`
674
+ `:case"\r":case" ":return!0;default:return!1}}const vk=new Set("0123456789ABCDEFabcdef"),FH=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Ru=new Set(",[]{}"),BH=new Set(` ,[]{}
675
+ \r `),Xp=e=>!e||BH.has(e);class zH{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
676
+ `?!0:n==="\r"?this.buffer[t+1]===`
677
+ `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){const s=this.buffer[r+t+1];if(s===`
678
+ `||!s&&!this.atEnd)return t+r+1}return n===`
679
+ `||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&Dn(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
680
+ `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===nO&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){const o=t[r-1];if(o===" "||o===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){const o=t[n-1];if(o===" "||o===" ")n-=1;else break}const s=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield rO,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&Dn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Dn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&Dn(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Xp),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&s[0]!=="#"||r===0&&(s.startsWith("---")||s.startsWith("..."))&&Dn(s[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield sO,yield*this.parseLineStart();let o=0;for(;s[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),s[o]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Xp),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const a=this.charAt(1);if(this.flowKey||Dn(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let o=0;for(;this.buffer[n-1-o]==="\\";)o+=1;if(o%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let s=r.indexOf(`
681
+ `,this.pos);if(s!==-1){for(;s!==-1;){const o=this.continueScalar(s+1);if(o===-1)break;s=r.indexOf(`
682
+ `,o)}s!==-1&&(n=s-(r[s-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Dn(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let o=this.pos;r=this.buffer[o];++o)switch(r){case" ":n+=1;break;case`
683
+ `:t=o,n=0;break;case"\r":{const a=this.buffer[o+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
684
+ `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const o=this.continueScalar(t+1);if(o===-1)break;t=this.buffer.indexOf(`
685
+ `,o)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let s=t+1;for(r=this.buffer[s];r===" ";)r=this.buffer[++s];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
686
+ `;)r=this.buffer[++s];t=s-1}else if(!this.blockScalarKeep)do{let o=t-1,a=this.buffer[o];a==="\r"&&(a=this.buffer[--o]);const c=o;for(;a===" ";)a=this.buffer[--o];if(a===`
687
+ `&&o>=this.pos&&o+1+n>c)t=o;else break}while(!0);return yield X0,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){const o=this.buffer[r+1];if(Dn(o)||t&&Ru.has(o))break;n=r}else if(Dn(s)){let o=this.buffer[r+1];if(s==="\r"&&(o===`
688
+ `?(r+=1,s=`
689
+ `,o=this.buffer[r+1]):n=r),o==="#"||t&&Ru.has(o))break;if(s===`
690
+ `){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&Ru.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield X0,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Xp))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(Dn(n)||t&&Ru.has(n))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!Dn(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(FH.has(n))n=this.buffer[++t];else if(n==="%"&&vk.has(this.buffer[t+1])&&vk.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
691
+ `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
692
+ `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");const s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class VH{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){const o=n+r>>1;this.lineStarts[o]<t?n=o+1:r=o}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const s=this.lineStarts[n-1];return{line:n,col:t-s+1}}}}function xs(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function xk(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function iO(e){switch(e==null?void 0:e.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Tu(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Ji(e){var n;if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function wk(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!xs(t.start,"explicit-key-ind")&&!xs(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,iO(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}class UH{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new zH,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(t,n))yield*this.next(r);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=qH(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const r=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&wk(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=n;else{Object.assign(s,{key:n,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{const s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{const s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:n,sep:[]}):s.sep?s.value=n:Object.assign(s,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const s=n.items[n.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&xk(s.start)===-1&&(n.indent===0||s.start.every(o=>o.type!=="comment"||o.indent<n.indent))&&(r.type==="document"?r.end=s.start:r.items.push({start:s.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{xk(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=Tu(this.peek(2)),r=Ji(n);let s;t.end?(s=t.end,s.push(this.sourceToken),delete t.end):s=[this.sourceToken];const o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
693
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
694
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const s="end"in n.value?n.value.end:void 0,o=Array.isArray(s)?s[s.length-1]:void 0;(o==null?void 0:o.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],o=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const s=!this.onKeyLine&&this.indent===t.indent,o=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(o&&n.sep&&!n.value){const c=[];for(let u=0;u<n.sep.length;++u){const f=n.sep[u];switch(f.type){case"newline":c.push(u);break;case"space":break;case"comment":f.indent>t.indent&&(c.length=0);break;default:c.length=0}}c.length>=2&&(a=n.sep.splice(c[1]))}switch(this.type){case"anchor":case"tag":o||n.value?(a.push(this.sourceToken),t.items.push({start:a}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):o||n.value?(a.push(this.sourceToken),t.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(xs(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(iO(n.key)&&!xs(n.sep,"newline")){const c=Ji(n.start),u=n.key,f=n.sep;f.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:u,sep:f}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(xs(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const c=Ji(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||o?t.items.push({start:a,key:null,sep:[this.sourceToken]}):xs(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const c=this.flowScalar(this.type);o||n.value?(t.items.push({start:a,key:c,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(c):(Object.assign(n,{key:c,sep:[]}),this.onKeyLine=!0);return}default:{const c=this.startBlockValue(t);if(c){if(c.type==="block-seq"){if(!n.explicitKey&&n.sep&&!xs(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&t.items.push({start:a});this.stack.push(c);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const s="end"in n.value?n.value.end:void 0,o=Array.isArray(s)?s[s.length-1]:void 0;(o==null?void 0:o.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],o=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||xs(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const s=this.startBlockValue(t);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while((r==null?void 0:r.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const s=Tu(r),o=Ji(s);wk(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:o,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
695
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
696
+ `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Tu(t),r=Ji(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Tu(t),r=Ji(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function HH(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new VH||null,prettyErrors:t}}function WH(e,t={}){const{lineCounter:n,prettyErrors:r}=HH(t),s=new UH(n==null?void 0:n.addNewLine),o=new $H(t);let a=null;for(const c of o.compose(s.parse(e),!0,e.length))if(!a)a=c;else if(a.options.logLevel!=="silent"){a.errors.push(new za(c.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(mk(e,n)),a.warnings.forEach(mk(e,n))),a}function oO(e,t,n){let r;const s=WH(e,n);if(!s)return null;if(s.warnings.forEach(o=>AM(s.options.logLevel,o)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}function gd(e,t,n){let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const s=Math.round(n);n=s<1?void 0:s>8?{indent:8}:{indent:s}}if(e===void 0){const{keepUndefined:s}=n??t??{};if(!s)return}return Ml(e)&&!r?e.toString(n):new Dl(e,r,n).toString(n)}function KH({value:e,onChange:t}){const[n,r]=j.useState(""),[s,o]=j.useState(null),[a,c]=j.useState(!0);j.useEffect(()=>{try{const f=gd(e,{indent:2,lineWidth:0});r(f),o(null),c(!0)}catch(f){o(f instanceof Error?f.message:"Failed to serialize"),c(!1)}},[e]);const u=f=>{if(f){r(f);try{const m=oO(f);if(!m.id)throw new Error("Step ID is required");if(!m.action&&!m.workflow)throw new Error("Either action or workflow is required");o(null),c(!0),t(m)}catch(m){o(m instanceof Error?m.message:"Invalid YAML"),c(!1)}}};return d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("div",{className:"flex items-center gap-2",children:a?d.jsxs("span",{className:"flex items-center gap-1 text-xs text-success",children:[d.jsx(si,{className:"w-3 h-3"}),"Valid YAML"]}):d.jsxs("span",{className:"flex items-center gap-1 text-xs text-error",children:[d.jsx(Ro,{className:"w-3 h-3"}),s]})}),d.jsxs("span",{className:"text-xs text-gray-500",children:[n.split(`
697
+ `).length," lines"]})]}),d.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:d.jsx(Za,{height:"400px",language:"yaml",value:n,onChange:u,theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, Consolas, monospace",lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on",padding:{top:12,bottom:12}}})}),d.jsx("div",{className:"text-xs text-gray-500",children:d.jsx("p",{children:"Edit the step configuration directly in YAML format. Changes are applied automatically when valid."})})]})}function GH({value:e,title:t}){const[n,r]=j.useState("");return j.useEffect(()=>{try{const s=gd(e,{indent:2,lineWidth:0});r(s)}catch{r("# Failed to serialize value")}},[e]),d.jsxs("div",{className:"space-y-2",children:[t&&d.jsx("h4",{className:"text-sm font-medium text-gray-300",children:t}),d.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:d.jsx(Za,{height:"300px",language:"yaml",value:n,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, Consolas, monospace",lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on",padding:{top:12,bottom:12}}})})]})}function YH({inputs:e,onChange:t,availableVariables:n}){const[r,s]=j.useState(""),o=Object.entries(e),a=(p,g)=>{t({...e,[p]:g})},c=p=>{const g={...e};delete g[p],t(g)},u=()=>{r&&!e.hasOwnProperty(r)&&(t({...e,[r]:""}),s(""))},f=(p,g)=>{if(g&&g!==p&&!e.hasOwnProperty(g)){const v={};for(const[b,w]of Object.entries(e))b===p?v[g]=w:v[b]=w;t(v)}},m=(p,g)=>{const v=String(e[p]||"");a(p,v+`{{ ${g} }}`)};return d.jsxs("div",{className:"space-y-4",children:[o.length===0?d.jsx("div",{className:"text-center py-8",children:d.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"No inputs defined"})}):d.jsx("div",{className:"space-y-3",children:o.map(([p,g])=>d.jsx(XH,{inputKey:p,value:g,onChange:v=>a(p,v),onRemove:()=>c(p),onRename:v=>f(p,v),availableVariables:n,onInsertVariable:v=>m(p,v)},p))}),d.jsxs("div",{className:"flex gap-2 pt-2 border-t border-node-border",children:[d.jsx("input",{type:"text",value:r,onChange:p=>s(p.target.value),placeholder:"New input key...",className:"flex-1 px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",onKeyDown:p=>{p.key==="Enter"&&u()}}),d.jsx(Be,{variant:"secondary",size:"sm",onClick:u,disabled:!r||e.hasOwnProperty(r),icon:d.jsx(Dd,{className:"w-4 h-4"}),children:"Add"})]}),n.length>0&&d.jsxs("div",{className:"p-3 bg-node-bg rounded-lg border border-node-border",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[d.jsx(Rl,{className:"w-4 h-4 text-primary"}),d.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Available Variables"})]}),d.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(p=>d.jsx("code",{className:"px-2 py-0.5 bg-primary/10 text-primary text-xs rounded",children:p},p))}),d.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Click on an input field, then use the variable button to insert"})]})]})}function XH({inputKey:e,value:t,onChange:n,onRemove:r,onRename:s,availableVariables:o,onInsertVariable:a}){const[c,u]=j.useState(!1),[f,m]=j.useState(e),[p,g]=j.useState(!1),v=typeof t,b=v==="object"&&t!==null,w=Array.isArray(t),x=()=>{f!==e&&s(f),u(!1)},S=()=>w||b?d.jsx("textarea",{value:JSON.stringify(t,null,2),onChange:k=>{try{n(JSON.parse(k.target.value))}catch{n(k.target.value)}},className:"flex-1 px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary resize-none",rows:3}):v==="boolean"?d.jsxs("select",{value:String(t),onChange:k=>n(k.target.value==="true"),className:"flex-1 px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",children:[d.jsx("option",{value:"true",children:"true"}),d.jsx("option",{value:"false",children:"false"})]}):v==="number"?d.jsx("input",{type:"number",value:String(t),onChange:k=>n(parseFloat(k.target.value)||0),className:"flex-1 px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary"}):d.jsx(QH,{value:String(t),onChange:k=>n(k),variables:o,placeholder:"Value or {{ variable }}"});return d.jsxs("div",{className:"p-3 bg-node-bg/50 rounded-lg border border-node-border space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[c?d.jsx("input",{type:"text",value:f,onChange:k=>m(k.target.value),onBlur:x,onKeyDown:k=>{k.key==="Enter"&&x(),k.key==="Escape"&&(m(e),u(!1))},className:"flex-1 px-2 py-1 bg-node-bg border border-primary rounded text-white text-sm font-mono focus:outline-none",autoFocus:!0}):d.jsx("button",{onClick:()=>u(!0),className:"flex-1 text-left px-2 py-1 text-sm font-mono text-primary hover:bg-white/5 rounded",children:e}),d.jsx("span",{className:"text-xs text-gray-500",children:v}),d.jsx(Be,{variant:"ghost",size:"sm",onClick:r,className:"!p-1 text-gray-400 hover:text-error",children:d.jsx(Io,{className:"w-4 h-4"})})]}),d.jsxs("div",{className:"flex gap-2",children:[S(),o.length>0&&!w&&!b&&d.jsxs("div",{className:"relative",children:[d.jsx(Be,{variant:"ghost",size:"sm",onClick:()=>g(!p),className:"!p-2",children:d.jsx(Rl,{className:"w-4 h-4"})}),p&&d.jsxs("div",{className:"absolute right-0 top-full mt-1 z-10 p-2 bg-panel-bg border border-node-border rounded-lg shadow-lg min-w-[150px]",children:[d.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Insert variable"}),d.jsx("div",{className:"space-y-1 max-h-40 overflow-y-auto",children:o.map(k=>d.jsx("button",{onClick:()=>{a(k),g(!1)},className:"w-full text-left px-2 py-1 text-xs font-mono text-primary hover:bg-white/10 rounded",children:k},k))})]})]})]})]})}function QH({value:e,onChange:t,variables:n,placeholder:r}){const[s,o]=j.useState(!1),[a,c]=j.useState(0),[u,f]=j.useState(0),m=j.useRef(null),g=(()=>{const N=e.substring(0,a),C=N.lastIndexOf("{{");if(C===-1)return null;const R=N.substring(C);return R.includes("}}")?null:{text:R.substring(2).trim(),start:C,end:a}})(),v=g?n.filter(N=>N.toLowerCase().includes(g.text.toLowerCase())):[],b=s&&g&&v.length>0,w=N=>{t(N.target.value),c(N.target.selectionStart||0),o(!0),f(0)},x=N=>{const C=N.target;c(C.selectionStart||0)},S=N=>{if(b)switch(N.key){case"ArrowDown":N.preventDefault(),f(C=>C<v.length-1?C+1:0);break;case"ArrowUp":N.preventDefault(),f(C=>C>0?C-1:v.length-1);break;case"Enter":case"Tab":N.preventDefault(),k(v[u]);break;case"Escape":o(!1);break}},k=N=>{if(!g)return;const C=e.substring(0,g.start),R=e.substring(g.end),T=`${C}{{ ${N} }}${R}`;t(T),o(!1),setTimeout(()=>{if(m.current){const I=g.start+N.length+6;m.current.setSelectionRange(I,I),m.current.focus()}},0)};return j.useEffect(()=>{const N=()=>o(!1);return document.addEventListener("click",N),()=>document.removeEventListener("click",N)},[]),d.jsxs("div",{className:"relative flex-1",children:[d.jsx("input",{ref:m,type:"text",value:e,onChange:w,onSelect:x,onKeyDown:S,onFocus:()=>o(!0),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",placeholder:r}),b&&d.jsxs("div",{className:"absolute left-0 top-full mt-1 z-20 p-1 bg-panel-bg border border-node-border rounded-lg shadow-lg min-w-[200px] max-h-[200px] overflow-y-auto",onClick:N=>N.stopPropagation(),children:[d.jsxs("div",{className:"text-xs text-gray-500 px-2 py-1 mb-1",children:['Variables matching "',(g==null?void 0:g.text)||"",'"']}),v.map((N,C)=>d.jsxs("button",{onClick:()=>k(N),className:`w-full text-left px-2 py-1.5 text-xs font-mono rounded flex items-center gap-2 ${C===u?"bg-primary/20 text-primary":"text-gray-300 hover:bg-white/5"}`,children:[d.jsx(Rl,{className:"w-3 h-3"}),N]},N)),d.jsx("div",{className:"text-xs text-gray-600 px-2 pt-1 border-t border-node-border mt-1",children:"↑↓ to navigate, Enter to select"})]})]})}function bk(e){const t=[];return!e.id||e.id.trim()===""?t.push({field:"id",message:"Step ID is required"}):/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(e.id)||t.push({field:"id",message:"Step ID must start with a letter and contain only letters, numbers, underscores, and hyphens"}),!e.action&&!e.workflow&&t.push({field:"action",message:"Step must have either an action or a workflow reference"}),e.action&&e.action.split(".").length<2&&t.push({field:"action",message:"Action must be in format: service.method (e.g., slack.chat.postMessage)"}),e.workflow&&!e.workflow.endsWith(".md")&&!e.workflow.endsWith(".yaml")&&!e.workflow.endsWith(".yml")&&t.push({field:"workflow",message:"Workflow reference should end with .md, .yaml, or .yml"}),e.outputVariable&&(/^[a-zA-Z][a-zA-Z0-9_]*$/.test(e.outputVariable)||t.push({field:"outputVariable",message:"Output variable must start with a letter and contain only letters, numbers, and underscores"})),e.timeout!==void 0&&(typeof e.timeout!="number"||e.timeout<=0)&&t.push({field:"timeout",message:"Timeout must be a positive number"}),e.errorHandling&&(["stop","continue","retry"].includes(e.errorHandling.action)||t.push({field:"errorHandling.action",message:"Error action must be one of: stop, continue, retry"}),e.errorHandling.action==="retry"&&(e.errorHandling.maxRetries!==void 0&&(typeof e.errorHandling.maxRetries!="number"||e.errorHandling.maxRetries<1)&&t.push({field:"errorHandling.maxRetries",message:"Max retries must be at least 1"}),e.errorHandling.retryDelay!==void 0&&(typeof e.errorHandling.retryDelay!="number"||e.errorHandling.retryDelay<0)&&t.push({field:"errorHandling.retryDelay",message:"Retry delay must be a non-negative number"})),e.errorHandling.fallbackStep&&(/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(e.errorHandling.fallbackStep)||t.push({field:"errorHandling.fallbackStep",message:"Fallback step ID must be a valid identifier"}))),e.conditions&&e.conditions.length>0&&e.conditions.forEach((n,r)=>{(!n||n.trim()==="")&&t.push({field:`conditions[${r}]`,message:`Condition ${r+1} cannot be empty`})}),{valid:t.length===0,errors:t}}function JH(e,t){const n=e.find(r=>r.field===t);return n==null?void 0:n.message}function ZH({open:e,onOpenChange:t,step:n,onSave:r,availableVariables:s}){const[o,a]=j.useState(null),[c,u]=j.useState("properties"),[f,m]=j.useState([]),[p,g]=j.useState(!1);if(j.useEffect(()=>{n&&(a({...n}),u("properties"),m([]),g(!1))},[n]),j.useMemo(()=>o?bk(o):{valid:!0,errors:[]},[o]),!o)return null;const v=()=>{if(!o)return;const x=bk(o);if(m(x.errors),g(!0),x.valid)r(o),t(!1);else{const S=x.errors[0];S&&(S.field==="id"||S.field==="action"||S.field==="workflow"||S.field==="timeout"?u("properties"):S.field==="outputVariable"?u("output"):S.field.startsWith("errorHandling")?u("errors"):S.field.startsWith("conditions")&&u("conditions"))}},b=x=>{a(S=>S?{...S,...x}:null)},w=x=>{if(p)return JH(f,x)};return d.jsxs(Cs,{open:e,onOpenChange:t,title:`Edit Step: ${o.name||o.id}`,description:o.action||o.workflow||"Configure step settings",size:"xl",children:[d.jsxs(pM,{value:c,onValueChange:u,children:[d.jsxs(Vw,{children:[d.jsxs(ir,{value:"properties",children:[d.jsx($d,{className:"w-4 h-4 mr-1.5"}),"Properties"]}),d.jsxs(ir,{value:"inputs",children:[d.jsx(Y6,{className:"w-4 h-4 mr-1.5"}),"Inputs"]}),d.jsxs(ir,{value:"output",children:[d.jsx(X6,{className:"w-4 h-4 mr-1.5"}),"Output"]}),d.jsxs(ir,{value:"errors",children:[d.jsx(jl,{className:"w-4 h-4 mr-1.5"}),"Errors"]}),d.jsxs(ir,{value:"conditions",children:[d.jsx(nA,{className:"w-4 h-4 mr-1.5"}),"Conditions"]}),d.jsxs(ir,{value:"yaml",children:[d.jsx(jw,{className:"w-4 h-4 mr-1.5"}),"YAML"]})]}),d.jsxs("div",{className:"p-4",children:[d.jsx(or,{value:"properties",children:d.jsx(eW,{step:o,onChange:b,getError:w})}),d.jsx(or,{value:"inputs",children:d.jsx(YH,{inputs:o.inputs,onChange:x=>b({inputs:x}),availableVariables:s})}),d.jsx(or,{value:"output",children:d.jsx(tW,{step:o,onChange:b})}),d.jsx(or,{value:"errors",children:d.jsx(nW,{step:o,onChange:b})}),d.jsx(or,{value:"conditions",children:d.jsx(rW,{step:o,onChange:b,availableVariables:s})}),d.jsx(or,{value:"yaml",children:d.jsx(KH,{value:o,onChange:x=>a(x)})})]})]}),d.jsxs(oi,{children:[p&&f.length>0&&d.jsxs("div",{className:"flex-1 flex items-center gap-2 text-error text-sm",children:[d.jsx(Ro,{className:"w-4 h-4 flex-shrink-0"}),d.jsxs("span",{children:[f.length," validation error",f.length>1?"s":""]})]}),d.jsx(Be,{variant:"secondary",onClick:()=>t(!1),children:"Cancel"}),d.jsx(Be,{onClick:v,children:"Save Changes"})]})]})}function eW({step:e,onChange:t,getError:n}){const r=n("id"),s=n("action"),o=n("workflow"),a=n("timeout");return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:["Step ID ",d.jsx("span",{className:"text-error",children:"*"})]}),d.jsx("input",{type:"text",value:e.id,onChange:c=>t({id:c.target.value}),className:`w-full px-3 py-2 bg-node-bg border rounded-lg text-white text-sm focus:outline-none ${r?"border-error focus:border-error":"border-node-border focus:border-primary"}`,placeholder:"unique-step-id"}),r?d.jsx("p",{className:"mt-1 text-xs text-error",children:r}):d.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Unique identifier for this step"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step Name"}),d.jsx("input",{type:"text",value:e.name||"",onChange:c=>t({name:c.target.value||void 0}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",placeholder:"Human-readable name"})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:["Action ",!e.workflow&&d.jsx("span",{className:"text-error",children:"*"})]}),d.jsx("input",{type:"text",value:e.action||"",onChange:c=>t({action:c.target.value||void 0}),className:`w-full px-3 py-2 bg-node-bg border rounded-lg text-white text-sm font-mono focus:outline-none ${s?"border-error focus:border-error":"border-node-border focus:border-primary"}`,placeholder:"service.method (e.g., slack.chat.postMessage)"}),s?d.jsx("p",{className:"mt-1 text-xs text-error",children:s}):d.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Format: service.method or service.namespace.method"})]}),e.workflow&&d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Sub-workflow Path"}),d.jsx("input",{type:"text",value:e.workflow,onChange:c=>t({workflow:c.target.value}),className:`w-full px-3 py-2 bg-node-bg border rounded-lg text-white text-sm font-mono focus:outline-none ${o?"border-error focus:border-error":"border-node-border focus:border-primary"}`,placeholder:"./path/to/workflow.md"}),o&&d.jsx("p",{className:"mt-1 text-xs text-error",children:o})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Timeout (seconds)"}),d.jsx("input",{type:"number",value:e.timeout||"",onChange:c=>t({timeout:c.target.value?parseInt(c.target.value,10):void 0}),className:`w-full px-3 py-2 bg-node-bg border rounded-lg text-white text-sm focus:outline-none ${a?"border-error focus:border-error":"border-node-border focus:border-primary"}`,placeholder:"30",min:"1"}),a&&d.jsx("p",{className:"mt-1 text-xs text-error",children:a})]})]})}function tW({step:e,onChange:t}){return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Output Variable"}),d.jsx("input",{type:"text",value:e.outputVariable||"",onChange:n=>t({outputVariable:n.target.value||void 0}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary",placeholder:"result_variable"}),d.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Store the step output in this variable for use in subsequent steps"})]}),d.jsxs("div",{className:"p-4 bg-node-bg rounded-lg border border-node-border",children:[d.jsx("h4",{className:"text-sm font-medium text-gray-300 mb-2",children:"Usage Example"}),d.jsx("code",{className:"text-xs text-primary font-mono",children:"{{ "+(e.outputVariable||"variable_name")+" }}"}),d.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Use this syntax in subsequent steps to reference the output"})]})]})}function nW({step:e,onChange:t}){const n=e.errorHandling||{action:"stop"},r=s=>{t({errorHandling:{...n,...s}})};return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Error Action"}),d.jsxs("select",{value:n.action,onChange:s=>r({action:s.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",children:[d.jsx("option",{value:"stop",children:"Stop workflow on error"}),d.jsx("option",{value:"continue",children:"Continue to next step"}),d.jsx("option",{value:"retry",children:"Retry with backoff"})]})]}),n.action==="retry"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Max Retries"}),d.jsx("input",{type:"number",value:n.maxRetries||3,onChange:s=>r({maxRetries:parseInt(s.target.value,10)}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",min:"1",max:"10"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Retry Delay (ms)"}),d.jsx("input",{type:"number",value:n.retryDelay||1e3,onChange:s=>r({retryDelay:parseInt(s.target.value,10)}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",min:"100",step:"100"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Fallback Step (optional)"}),d.jsx("input",{type:"text",value:n.fallbackStep||"",onChange:s=>r({fallbackStep:s.target.value||void 0}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary",placeholder:"fallback-step-id"}),d.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Jump to this step if the error action fails"})]})]})}function rW({step:e,onChange:t,availableVariables:n}){const r=e.conditions||[],s=()=>{t({conditions:[...r,""]})},o=(c,u)=>{const f=[...r];f[c]=u,t({conditions:f})},a=c=>{const u=r.filter((f,m)=>m!==c);t({conditions:u.length>0?u:void 0})};return d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-sm text-gray-400",children:"This step will only execute if all conditions evaluate to true."}),r.length===0?d.jsxs("div",{className:"text-center py-8",children:[d.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"No conditions defined"}),d.jsx(Be,{variant:"secondary",size:"sm",onClick:s,children:"Add Condition"})]}):d.jsxs("div",{className:"space-y-3",children:[r.map((c,u)=>d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"text",value:c,onChange:f=>o(u,f.target.value),className:"flex-1 px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary",placeholder:"{{ variable }} === 'value'"}),d.jsx(Be,{variant:"ghost",size:"sm",onClick:()=>a(u),children:"×"})]},u)),d.jsx(Be,{variant:"secondary",size:"sm",onClick:s,children:"Add Condition"})]}),n.length>0&&d.jsxs("div",{className:"mt-4 p-3 bg-node-bg rounded-lg border border-node-border",children:[d.jsx("h4",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider mb-2",children:"Available Variables"}),d.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(c=>d.jsx("code",{className:"px-2 py-0.5 bg-primary/10 text-primary text-xs rounded cursor-pointer hover:bg-primary/20",onClick:()=>{navigator.clipboard.writeText(`{{ ${c} }}`)},children:c},c))})]})]})}const sW=["top","right","bottom","left"],Es=Math.min,cn=Math.max,yd=Math.round,Iu=Math.floor,ur=e=>({x:e,y:e}),iW={left:"right",right:"left",bottom:"top",top:"bottom"},oW={start:"end",end:"start"};function Q0(e,t,n){return cn(e,Es(t,n))}function Fr(e,t){return typeof e=="function"?e(t):e}function Br(e){return e.split("-")[0]}function Do(e){return e.split("-")[1]}function ib(e){return e==="x"?"y":"x"}function ob(e){return e==="y"?"height":"width"}const aW=new Set(["top","bottom"]);function lr(e){return aW.has(Br(e))?"y":"x"}function ab(e){return ib(lr(e))}function lW(e,t,n){n===void 0&&(n=!1);const r=Do(e),s=ab(e),o=ob(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=vd(a)),[a,vd(a)]}function cW(e){const t=vd(e);return[J0(e),t,J0(t)]}function J0(e){return e.replace(/start|end/g,t=>oW[t])}const Sk=["left","right"],_k=["right","left"],uW=["top","bottom"],dW=["bottom","top"];function fW(e,t,n){switch(e){case"top":case"bottom":return n?t?_k:Sk:t?Sk:_k;case"left":case"right":return t?uW:dW;default:return[]}}function hW(e,t,n,r){const s=Do(e);let o=fW(Br(e),n==="start",r);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(J0)))),o}function vd(e){return e.replace(/left|right|bottom|top/g,t=>iW[t])}function pW(e){return{top:0,right:0,bottom:0,left:0,...e}}function aO(e){return typeof e!="number"?pW(e):{top:e,right:e,bottom:e,left:e}}function xd(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Nk(e,t,n){let{reference:r,floating:s}=e;const o=lr(t),a=ab(t),c=ob(a),u=Br(t),f=o==="y",m=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,g=r[c]/2-s[c]/2;let v;switch(u){case"top":v={x:m,y:r.y-s.height};break;case"bottom":v={x:m,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:p};break;case"left":v={x:r.x-s.width,y:p};break;default:v={x:r.x,y:r.y}}switch(Do(t)){case"start":v[a]-=g*(n&&f?-1:1);break;case"end":v[a]+=g*(n&&f?-1:1);break}return v}const mW=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:a}=n,c=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let f=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:m,y:p}=Nk(f,r,u),g=r,v={},b=0;for(let w=0;w<c.length;w++){const{name:x,fn:S}=c[w],{x:k,y:N,data:C,reset:R}=await S({x:m,y:p,initialPlacement:r,placement:g,strategy:s,middlewareData:v,rects:f,platform:a,elements:{reference:e,floating:t}});m=k??m,p=N??p,v={...v,[x]:{...v[x],...C}},R&&b<=50&&(b++,typeof R=="object"&&(R.placement&&(g=R.placement),R.rects&&(f=R.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):R.rects),{x:m,y:p}=Nk(f,g,u)),w=-1)}return{x:m,y:p,placement:g,strategy:s,middlewareData:v}};async function gl(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:a,elements:c,strategy:u}=e,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:g=!1,padding:v=0}=Fr(t,e),b=aO(v),x=c[g?p==="floating"?"reference":"floating":p],S=xd(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:f,rootBoundary:m,strategy:u})),k=p==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,N=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),C=await(o.isElement==null?void 0:o.isElement(N))?await(o.getScale==null?void 0:o.getScale(N))||{x:1,y:1}:{x:1,y:1},R=xd(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:k,offsetParent:N,strategy:u}):k);return{top:(S.top-R.top+b.top)/C.y,bottom:(R.bottom-S.bottom+b.bottom)/C.y,left:(S.left-R.left+b.left)/C.x,right:(R.right-S.right+b.right)/C.x}}const gW=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:a,elements:c,middlewareData:u}=t,{element:f,padding:m=0}=Fr(e,t)||{};if(f==null)return{};const p=aO(m),g={x:n,y:r},v=ab(s),b=ob(v),w=await a.getDimensions(f),x=v==="y",S=x?"top":"left",k=x?"bottom":"right",N=x?"clientHeight":"clientWidth",C=o.reference[b]+o.reference[v]-g[v]-o.floating[b],R=g[v]-o.reference[v],T=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let I=T?T[N]:0;(!I||!await(a.isElement==null?void 0:a.isElement(T)))&&(I=c.floating[N]||o.floating[b]);const O=C/2-R/2,P=I/2-w[b]/2-1,B=Es(p[S],P),M=Es(p[k],P),L=B,U=I-w[b]-M,$=I/2-w[b]/2+O,z=Q0(L,$,U),V=!u.arrow&&Do(s)!=null&&$!==z&&o.reference[b]/2-($<L?B:M)-w[b]/2<0,G=V?$<L?$-L:$-U:0;return{[v]:g[v]+G,data:{[v]:z,centerOffset:$-z-G,...V&&{alignmentOffset:G}},reset:V}}}),yW=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:a,initialPlacement:c,platform:u,elements:f}=t,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...x}=Fr(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const S=Br(s),k=lr(c),N=Br(c)===c,C=await(u.isRTL==null?void 0:u.isRTL(f.floating)),R=g||(N||!w?[vd(c)]:cW(c)),T=b!=="none";!g&&T&&R.push(...hW(c,w,b,C));const I=[c,...R],O=await gl(t,x),P=[];let B=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&P.push(O[S]),p){const $=lW(s,a,C);P.push(O[$[0]],O[$[1]])}if(B=[...B,{placement:s,overflows:P}],!P.every($=>$<=0)){var M,L;const $=(((M=o.flip)==null?void 0:M.index)||0)+1,z=I[$];if(z&&(!(p==="alignment"?k!==lr(z):!1)||B.every(F=>lr(F.placement)===k?F.overflows[0]>0:!0)))return{data:{index:$,overflows:B},reset:{placement:z}};let V=(L=B.filter(G=>G.overflows[0]<=0).sort((G,F)=>G.overflows[1]-F.overflows[1])[0])==null?void 0:L.placement;if(!V)switch(v){case"bestFit":{var U;const G=(U=B.filter(F=>{if(T){const q=lr(F.placement);return q===k||q==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(q=>q>0).reduce((q,X)=>q+X,0)]).sort((F,q)=>F[1]-q[1])[0])==null?void 0:U[0];G&&(V=G);break}case"initialPlacement":V=c;break}if(s!==V)return{reset:{placement:V}}}return{}}}};function kk(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ck(e){return sW.some(t=>e[t]>=0)}const vW=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Fr(e,t);switch(r){case"referenceHidden":{const o=await gl(t,{...s,elementContext:"reference"}),a=kk(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Ck(a)}}}case"escaped":{const o=await gl(t,{...s,altBoundary:!0}),a=kk(o,n.floating);return{data:{escapedOffsets:a,escaped:Ck(a)}}}default:return{}}}}},lO=new Set(["left","top"]);async function xW(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Br(n),c=Do(n),u=lr(n)==="y",f=lO.has(a)?-1:1,m=o&&u?-1:1,p=Fr(t,e);let{mainAxis:g,crossAxis:v,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof b=="number"&&(v=c==="end"?b*-1:b),u?{x:v*m,y:g*f}:{x:g*f,y:v*m}}const wW=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:a,middlewareData:c}=t,u=await xW(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:o+u.y,data:{...u,placement:a}}}}},bW=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:c={fn:x=>{let{x:S,y:k}=x;return{x:S,y:k}}},...u}=Fr(e,t),f={x:n,y:r},m=await gl(t,u),p=lr(Br(s)),g=ib(p);let v=f[g],b=f[p];if(o){const x=g==="y"?"top":"left",S=g==="y"?"bottom":"right",k=v+m[x],N=v-m[S];v=Q0(k,v,N)}if(a){const x=p==="y"?"top":"left",S=p==="y"?"bottom":"right",k=b+m[x],N=b-m[S];b=Q0(k,b,N)}const w=c.fn({...t,[g]:v,[p]:b});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[g]:o,[p]:a}}}}}},SW=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:a}=t,{offset:c=0,mainAxis:u=!0,crossAxis:f=!0}=Fr(e,t),m={x:n,y:r},p=lr(s),g=ib(p);let v=m[g],b=m[p];const w=Fr(c,t),x=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(u){const N=g==="y"?"height":"width",C=o.reference[g]-o.floating[N]+x.mainAxis,R=o.reference[g]+o.reference[N]-x.mainAxis;v<C?v=C:v>R&&(v=R)}if(f){var S,k;const N=g==="y"?"width":"height",C=lO.has(Br(s)),R=o.reference[p]-o.floating[N]+(C&&((S=a.offset)==null?void 0:S[p])||0)+(C?0:x.crossAxis),T=o.reference[p]+o.reference[N]+(C?0:((k=a.offset)==null?void 0:k[p])||0)-(C?x.crossAxis:0);b<R?b=R:b>T&&(b=T)}return{[g]:v,[p]:b}}}},_W=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:a,elements:c}=t,{apply:u=()=>{},...f}=Fr(e,t),m=await gl(t,f),p=Br(s),g=Do(s),v=lr(s)==="y",{width:b,height:w}=o.floating;let x,S;p==="top"||p==="bottom"?(x=p,S=g===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(S=p,x=g==="end"?"top":"bottom");const k=w-m.top-m.bottom,N=b-m.left-m.right,C=Es(w-m[x],k),R=Es(b-m[S],N),T=!t.middlewareData.shift;let I=C,O=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=k),T&&!g){const B=cn(m.left,0),M=cn(m.right,0),L=cn(m.top,0),U=cn(m.bottom,0);v?O=b-2*(B!==0||M!==0?B+M:cn(m.left,m.right)):I=w-2*(L!==0||U!==0?L+U:cn(m.top,m.bottom))}await u({...t,availableWidth:O,availableHeight:I});const P=await a.getDimensions(c.floating);return b!==P.width||w!==P.height?{reset:{rects:!0}}:{}}}};function Jd(){return typeof window<"u"}function $o(e){return cO(e)?(e.nodeName||"").toLowerCase():"#document"}function dn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vr(e){var t;return(t=(cO(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function cO(e){return Jd()?e instanceof Node||e instanceof dn(e).Node:!1}function Un(e){return Jd()?e instanceof Element||e instanceof dn(e).Element:!1}function mr(e){return Jd()?e instanceof HTMLElement||e instanceof dn(e).HTMLElement:!1}function Ek(e){return!Jd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof dn(e).ShadowRoot}const NW=new Set(["inline","contents"]);function ql(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Hn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!NW.has(s)}const kW=new Set(["table","td","th"]);function CW(e){return kW.has($o(e))}const EW=[":popover-open",":modal"];function Zd(e){return EW.some(t=>{try{return e.matches(t)}catch{return!1}})}const jW=["transform","translate","scale","rotate","perspective"],RW=["transform","translate","scale","rotate","perspective","filter"],TW=["paint","layout","strict","content"];function lb(e){const t=cb(),n=Un(e)?Hn(e):e;return jW.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||RW.some(r=>(n.willChange||"").includes(r))||TW.some(r=>(n.contain||"").includes(r))}function IW(e){let t=js(e);for(;mr(t)&&!Eo(t);){if(lb(t))return t;if(Zd(t))return null;t=js(t)}return null}function cb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const AW=new Set(["html","body","#document"]);function Eo(e){return AW.has($o(e))}function Hn(e){return dn(e).getComputedStyle(e)}function ef(e){return Un(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function js(e){if($o(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ek(e)&&e.host||vr(e);return Ek(t)?t.host:t}function uO(e){const t=js(e);return Eo(t)?e.ownerDocument?e.ownerDocument.body:e.body:mr(t)&&ql(t)?t:uO(t)}function yl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=uO(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),a=dn(s);if(o){const c=Z0(a);return t.concat(a,a.visualViewport||[],ql(s)?s:[],c&&n?yl(c):[])}return t.concat(s,yl(s,[],n))}function Z0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function dO(e){const t=Hn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=mr(e),o=s?e.offsetWidth:n,a=s?e.offsetHeight:r,c=yd(n)!==o||yd(r)!==a;return c&&(n=o,r=a),{width:n,height:r,$:c}}function ub(e){return Un(e)?e:e.contextElement}function po(e){const t=ub(e);if(!mr(t))return ur(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=dO(t);let a=(o?yd(n.width):n.width)/r,c=(o?yd(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const MW=ur(0);function fO(e){const t=dn(e);return!cb()||!t.visualViewport?MW:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function OW(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==dn(e)?!1:t}function li(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=ub(e);let a=ur(1);t&&(r?Un(r)&&(a=po(r)):a=po(e));const c=OW(o,n,r)?fO(o):ur(0);let u=(s.left+c.x)/a.x,f=(s.top+c.y)/a.y,m=s.width/a.x,p=s.height/a.y;if(o){const g=dn(o),v=r&&Un(r)?dn(r):r;let b=g,w=Z0(b);for(;w&&r&&v!==b;){const x=po(w),S=w.getBoundingClientRect(),k=Hn(w),N=S.left+(w.clientLeft+parseFloat(k.paddingLeft))*x.x,C=S.top+(w.clientTop+parseFloat(k.paddingTop))*x.y;u*=x.x,f*=x.y,m*=x.x,p*=x.y,u+=N,f+=C,b=dn(w),w=Z0(b)}}return xd({width:m,height:p,x:u,y:f})}function tf(e,t){const n=ef(e).scrollLeft;return t?t.left+n:li(vr(e)).left+n}function hO(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-tf(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function PW(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",a=vr(r),c=t?Zd(t.floating):!1;if(r===a||c&&o)return n;let u={scrollLeft:0,scrollTop:0},f=ur(1);const m=ur(0),p=mr(r);if((p||!p&&!o)&&(($o(r)!=="body"||ql(a))&&(u=ef(r)),mr(r))){const v=li(r);f=po(r),m.x=v.x+r.clientLeft,m.y=v.y+r.clientTop}const g=a&&!p&&!o?hO(a,u):ur(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-u.scrollLeft*f.x+m.x+g.x,y:n.y*f.y-u.scrollTop*f.y+m.y+g.y}}function LW(e){return Array.from(e.getClientRects())}function DW(e){const t=vr(e),n=ef(e),r=e.ownerDocument.body,s=cn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=cn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+tf(e);const c=-n.scrollTop;return Hn(r).direction==="rtl"&&(a+=cn(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:a,y:c}}const jk=25;function $W(e,t){const n=dn(e),r=vr(e),s=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,c=0,u=0;if(s){o=s.width,a=s.height;const m=cb();(!m||m&&t==="fixed")&&(c=s.offsetLeft,u=s.offsetTop)}const f=tf(r);if(f<=0){const m=r.ownerDocument,p=m.body,g=getComputedStyle(p),v=m.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(r.clientWidth-p.clientWidth-v);b<=jk&&(o-=b)}else f<=jk&&(o+=f);return{width:o,height:a,x:c,y:u}}const qW=new Set(["absolute","fixed"]);function FW(e,t){const n=li(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=mr(e)?po(e):ur(1),a=e.clientWidth*o.x,c=e.clientHeight*o.y,u=s*o.x,f=r*o.y;return{width:a,height:c,x:u,y:f}}function Rk(e,t,n){let r;if(t==="viewport")r=$W(e,n);else if(t==="document")r=DW(vr(e));else if(Un(t))r=FW(t,n);else{const s=fO(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return xd(r)}function pO(e,t){const n=js(e);return n===t||!Un(n)||Eo(n)?!1:Hn(n).position==="fixed"||pO(n,t)}function BW(e,t){const n=t.get(e);if(n)return n;let r=yl(e,[],!1).filter(c=>Un(c)&&$o(c)!=="body"),s=null;const o=Hn(e).position==="fixed";let a=o?js(e):e;for(;Un(a)&&!Eo(a);){const c=Hn(a),u=lb(a);!u&&c.position==="fixed"&&(s=null),(o?!u&&!s:!u&&c.position==="static"&&!!s&&qW.has(s.position)||ql(a)&&!u&&pO(e,a))?r=r.filter(m=>m!==a):s=c,a=js(a)}return t.set(e,r),r}function zW(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?Zd(t)?[]:BW(t,this._c):[].concat(n),r],c=a[0],u=a.reduce((f,m)=>{const p=Rk(t,m,s);return f.top=cn(p.top,f.top),f.right=Es(p.right,f.right),f.bottom=Es(p.bottom,f.bottom),f.left=cn(p.left,f.left),f},Rk(t,c,s));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function VW(e){const{width:t,height:n}=dO(e);return{width:t,height:n}}function UW(e,t,n){const r=mr(t),s=vr(t),o=n==="fixed",a=li(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const u=ur(0);function f(){u.x=tf(s)}if(r||!r&&!o)if(($o(t)!=="body"||ql(s))&&(c=ef(t)),r){const v=li(t,!0,o,t);u.x=v.x+t.clientLeft,u.y=v.y+t.clientTop}else s&&f();o&&!r&&s&&f();const m=s&&!r&&!o?hO(s,c):ur(0),p=a.left+c.scrollLeft-u.x-m.x,g=a.top+c.scrollTop-u.y-m.y;return{x:p,y:g,width:a.width,height:a.height}}function Qp(e){return Hn(e).position==="static"}function Tk(e,t){if(!mr(e)||Hn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return vr(e)===n&&(n=n.ownerDocument.body),n}function mO(e,t){const n=dn(e);if(Zd(e))return n;if(!mr(e)){let s=js(e);for(;s&&!Eo(s);){if(Un(s)&&!Qp(s))return s;s=js(s)}return n}let r=Tk(e,t);for(;r&&CW(r)&&Qp(r);)r=Tk(r,t);return r&&Eo(r)&&Qp(r)&&!lb(r)?n:r||IW(e)||n}const HW=async function(e){const t=this.getOffsetParent||mO,n=this.getDimensions,r=await n(e.floating);return{reference:UW(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function WW(e){return Hn(e).direction==="rtl"}const KW={convertOffsetParentRelativeRectToViewportRelativeRect:PW,getDocumentElement:vr,getClippingRect:zW,getOffsetParent:mO,getElementRects:HW,getClientRects:LW,getDimensions:VW,getScale:po,isElement:Un,isRTL:WW};function gO(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function GW(e,t){let n=null,r;const s=vr(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),o();const f=e.getBoundingClientRect(),{left:m,top:p,width:g,height:v}=f;if(c||t(),!g||!v)return;const b=Iu(p),w=Iu(s.clientWidth-(m+g)),x=Iu(s.clientHeight-(p+v)),S=Iu(m),N={rootMargin:-b+"px "+-w+"px "+-x+"px "+-S+"px",threshold:cn(0,Es(1,u))||1};let C=!0;function R(T){const I=T[0].intersectionRatio;if(I!==u){if(!C)return a();I?a(!1,I):r=setTimeout(()=>{a(!1,1e-7)},1e3)}I===1&&!gO(f,e.getBoundingClientRect())&&a(),C=!1}try{n=new IntersectionObserver(R,{...N,root:s.ownerDocument})}catch{n=new IntersectionObserver(R,N)}n.observe(e)}return a(!0),o}function YW(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,f=ub(e),m=s||o?[...f?yl(f):[],...yl(t)]:[];m.forEach(S=>{s&&S.addEventListener("scroll",n,{passive:!0}),o&&S.addEventListener("resize",n)});const p=f&&c?GW(f,n):null;let g=-1,v=null;a&&(v=new ResizeObserver(S=>{let[k]=S;k&&k.target===f&&v&&(v.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var N;(N=v)==null||N.observe(t)})),n()}),f&&!u&&v.observe(f),v.observe(t));let b,w=u?li(e):null;u&&x();function x(){const S=li(e);w&&!gO(w,S)&&n(),w=S,b=requestAnimationFrame(x)}return n(),()=>{var S;m.forEach(k=>{s&&k.removeEventListener("scroll",n),o&&k.removeEventListener("resize",n)}),p==null||p(),(S=v)==null||S.disconnect(),v=null,u&&cancelAnimationFrame(b)}}const XW=wW,QW=bW,JW=yW,ZW=_W,e7=vW,Ik=gW,t7=SW,n7=(e,t,n)=>{const r=new Map,s={platform:KW,...n},o={...s.platform,_c:r};return mW(e,t,{...s,platform:o})};var r7=typeof document<"u",s7=function(){},Ku=r7?j.useLayoutEffect:s7;function wd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!wd(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!wd(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function yO(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ak(e,t){const n=yO(e);return Math.round(t*n)/n}function Jp(e){const t=j.useRef(e);return Ku(()=>{t.current=e}),t}function i7(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:a}={},transform:c=!0,whileElementsMounted:u,open:f}=e,[m,p]=j.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,v]=j.useState(r);wd(g,r)||v(r);const[b,w]=j.useState(null),[x,S]=j.useState(null),k=j.useCallback(F=>{F!==T.current&&(T.current=F,w(F))},[]),N=j.useCallback(F=>{F!==I.current&&(I.current=F,S(F))},[]),C=o||b,R=a||x,T=j.useRef(null),I=j.useRef(null),O=j.useRef(m),P=u!=null,B=Jp(u),M=Jp(s),L=Jp(f),U=j.useCallback(()=>{if(!T.current||!I.current)return;const F={placement:t,strategy:n,middleware:g};M.current&&(F.platform=M.current),n7(T.current,I.current,F).then(q=>{const X={...q,isPositioned:L.current!==!1};$.current&&!wd(O.current,X)&&(O.current=X,Cw.flushSync(()=>{p(X)}))})},[g,t,n,M,L]);Ku(()=>{f===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,p(F=>({...F,isPositioned:!1})))},[f]);const $=j.useRef(!1);Ku(()=>($.current=!0,()=>{$.current=!1}),[]),Ku(()=>{if(C&&(T.current=C),R&&(I.current=R),C&&R){if(B.current)return B.current(C,R,U);U()}},[C,R,U,B,P]);const z=j.useMemo(()=>({reference:T,floating:I,setReference:k,setFloating:N}),[k,N]),V=j.useMemo(()=>({reference:C,floating:R}),[C,R]),G=j.useMemo(()=>{const F={position:n,left:0,top:0};if(!V.floating)return F;const q=Ak(V.floating,m.x),X=Ak(V.floating,m.y);return c?{...F,transform:"translate("+q+"px, "+X+"px)",...yO(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:X}},[n,c,V.floating,m.x,m.y]);return j.useMemo(()=>({...m,update:U,refs:z,elements:V,floatingStyles:G}),[m,U,z,V,G])}const o7=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Ik({element:r.current,padding:s}).fn(n):{}:r?Ik({element:r,padding:s}).fn(n):{}}}},a7=(e,t)=>({...XW(e),options:[e,t]}),l7=(e,t)=>({...QW(e),options:[e,t]}),c7=(e,t)=>({...t7(e),options:[e,t]}),u7=(e,t)=>({...JW(e),options:[e,t]}),d7=(e,t)=>({...ZW(e),options:[e,t]}),f7=(e,t)=>({...e7(e),options:[e,t]}),h7=(e,t)=>({...o7(e),options:[e,t]});var p7="Arrow",vO=j.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return d.jsx(tt.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});vO.displayName=p7;var m7=vO;function g7(e){const[t,n]=j.useState(void 0);return ks(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let a,c;if("borderBoxSize"in o){const u=o.borderBoxSize,f=Array.isArray(u)?u[0]:u;a=f.inlineSize,c=f.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var db="Popper",[xO,wO]=ci(db),[y7,bO]=xO(db),SO=e=>{const{__scopePopper:t,children:n}=e,[r,s]=j.useState(null);return d.jsx(y7,{scope:t,anchor:r,onAnchorChange:s,children:n})};SO.displayName=db;var _O="PopperAnchor",NO=j.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=bO(_O,n),a=j.useRef(null),c=jt(t,a),u=j.useRef(null);return j.useEffect(()=>{const f=u.current;u.current=(r==null?void 0:r.current)||a.current,f!==u.current&&o.onAnchorChange(u.current)}),r?null:d.jsx(tt.div,{...s,ref:c})});NO.displayName=_O;var fb="PopperContent",[v7,x7]=xO(fb),kO=j.forwardRef((e,t)=>{var Y,ee,ie,ue,ge,xe;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:v="optimized",onPlaced:b,...w}=e,x=bO(fb,n),[S,k]=j.useState(null),N=jt(t,pe=>k(pe)),[C,R]=j.useState(null),T=g7(C),I=(T==null?void 0:T.width)??0,O=(T==null?void 0:T.height)??0,P=r+(o!=="center"?"-"+o:""),B=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},M=Array.isArray(f)?f:[f],L=M.length>0,U={padding:B,boundary:M.filter(b7),altBoundary:L},{refs:$,floatingStyles:z,placement:V,isPositioned:G,middlewareData:F}=i7({strategy:"fixed",placement:P,whileElementsMounted:(...pe)=>YW(...pe,{animationFrame:v==="always"}),elements:{reference:x.anchor},middleware:[a7({mainAxis:s+O,alignmentAxis:a}),u&&l7({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?c7():void 0,...U}),u&&u7({...U}),d7({...U,apply:({elements:pe,rects:be,availableWidth:ve,availableHeight:Re})=>{const{width:ke,height:ze}=be.reference,Ue=pe.floating.style;Ue.setProperty("--radix-popper-available-width",`${ve}px`),Ue.setProperty("--radix-popper-available-height",`${Re}px`),Ue.setProperty("--radix-popper-anchor-width",`${ke}px`),Ue.setProperty("--radix-popper-anchor-height",`${ze}px`)}}),C&&h7({element:C,padding:c}),S7({arrowWidth:I,arrowHeight:O}),g&&f7({strategy:"referenceHidden",...U})]}),[q,X]=jO(V),D=hr(b);ks(()=>{G&&(D==null||D())},[G,D]);const W=(Y=F.arrow)==null?void 0:Y.x,oe=(ee=F.arrow)==null?void 0:ee.y,K=((ie=F.arrow)==null?void 0:ie.centerOffset)!==0,[J,te]=j.useState();return ks(()=>{S&&te(window.getComputedStyle(S).zIndex)},[S]),d.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:G?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[(ue=F.transformOrigin)==null?void 0:ue.x,(ge=F.transformOrigin)==null?void 0:ge.y].join(" "),...((xe=F.hide)==null?void 0:xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(v7,{scope:n,placedSide:q,onArrowChange:R,arrowX:W,arrowY:oe,shouldHideArrow:K,children:d.jsx(tt.div,{"data-side":q,"data-align":X,...w,ref:N,style:{...w.style,animation:G?void 0:"none"}})})})});kO.displayName=fb;var CO="PopperArrow",w7={top:"bottom",right:"left",bottom:"top",left:"right"},EO=j.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=x7(CO,r),a=w7[o.placedSide];return d.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:d.jsx(m7,{...s,ref:n,style:{...s.style,display:"block"}})})});EO.displayName=CO;function b7(e){return e!==null}var S7=e=>({name:"transformOrigin",options:e,fn(t){var x,S,k;const{placement:n,rects:r,middlewareData:s}=t,a=((x=s.arrow)==null?void 0:x.centerOffset)!==0,c=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[f,m]=jO(n),p={start:"0%",center:"50%",end:"100%"}[m],g=(((S=s.arrow)==null?void 0:S.x)??0)+c/2,v=(((k=s.arrow)==null?void 0:k.y)??0)+u/2;let b="",w="";return f==="bottom"?(b=a?p:`${g}px`,w=`${-u}px`):f==="top"?(b=a?p:`${g}px`,w=`${r.floating.height+u}px`):f==="right"?(b=`${-u}px`,w=a?p:`${v}px`):f==="left"&&(b=`${r.floating.width+u}px`,w=a?p:`${v}px`),{data:{x:b,y:w}}}});function jO(e){const[t,n="center"]=e.split("-");return[t,n]}var _7=SO,N7=NO,k7=kO,C7=EO,ew=["Enter"," "],E7=["ArrowDown","PageUp","Home"],RO=["ArrowUp","PageDown","End"],j7=[...E7,...RO],R7={ltr:[...ew,"ArrowRight"],rtl:[...ew,"ArrowLeft"]},T7={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Fl="Menu",[vl,I7,A7]=KA(Fl),[di,TO]=ci(Fl,[A7,wO,Bd]),nf=wO(),IO=Bd(),[M7,fi]=di(Fl),[O7,Bl]=di(Fl),AO=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:a=!0}=e,c=nf(t),[u,f]=j.useState(null),m=j.useRef(!1),p=hr(o),g=Bw(s);return j.useEffect(()=>{const v=()=>{m.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>m.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),d.jsx(_7,{...c,children:d.jsx(M7,{scope:t,open:n,onOpenChange:p,content:u,onContentChange:f,children:d.jsx(O7,{scope:t,onClose:j.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:m,dir:g,modal:a,children:r})})})};AO.displayName=Fl;var P7="MenuAnchor",hb=j.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=nf(n);return d.jsx(N7,{...s,...r,ref:t})});hb.displayName=P7;var pb="MenuPortal",[L7,MO]=di(pb,{forceMount:void 0}),OO=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=fi(pb,t);return d.jsx(L7,{scope:t,forceMount:n,children:d.jsx(Ur,{present:n||o.open,children:d.jsx(Pw,{asChild:!0,container:s,children:r})})})};OO.displayName=pb;var Cn="MenuContent",[D7,mb]=di(Cn),PO=j.forwardRef((e,t)=>{const n=MO(Cn,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=fi(Cn,e.__scopeMenu),a=Bl(Cn,e.__scopeMenu);return d.jsx(vl.Provider,{scope:e.__scopeMenu,children:d.jsx(Ur,{present:r||o.open,children:d.jsx(vl.Slot,{scope:e.__scopeMenu,children:a.modal?d.jsx($7,{...s,ref:t}):d.jsx(q7,{...s,ref:t})})})})}),$7=j.forwardRef((e,t)=>{const n=fi(Cn,e.__scopeMenu),r=j.useRef(null),s=jt(t,r);return j.useEffect(()=>{const o=r.current;if(o)return kA(o)},[]),d.jsx(gb,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ae(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),q7=j.forwardRef((e,t)=>{const n=fi(Cn,e.__scopeMenu);return d.jsx(gb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),F7=fl("MenuContent.ScrollLock"),gb=j.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:v,disableOutsideScroll:b,...w}=e,x=fi(Cn,n),S=Bl(Cn,n),k=nf(n),N=IO(n),C=I7(n),[R,T]=j.useState(null),I=j.useRef(null),O=jt(t,I,x.onContentChange),P=j.useRef(0),B=j.useRef(""),M=j.useRef(0),L=j.useRef(null),U=j.useRef("right"),$=j.useRef(0),z=b?Lw:j.Fragment,V=b?{as:F7,allowPinchZoom:!0}:void 0,G=q=>{var Y,ee;const X=B.current+q,D=C().filter(ie=>!ie.disabled),W=document.activeElement,oe=(Y=D.find(ie=>ie.ref.current===W))==null?void 0:Y.textValue,K=D.map(ie=>ie.textValue),J=J7(K,X,oe),te=(ee=D.find(ie=>ie.textValue===J))==null?void 0:ee.ref.current;(function ie(ue){B.current=ue,window.clearTimeout(P.current),ue!==""&&(P.current=window.setTimeout(()=>ie(""),1e3))})(X),te&&setTimeout(()=>te.focus())};j.useEffect(()=>()=>window.clearTimeout(P.current),[]),gA();const F=j.useCallback(q=>{var D,W;return U.current===((D=L.current)==null?void 0:D.side)&&eK(q,(W=L.current)==null?void 0:W.area)},[]);return d.jsx(D7,{scope:n,searchRef:B,onItemEnter:j.useCallback(q=>{F(q)&&q.preventDefault()},[F]),onItemLeave:j.useCallback(q=>{var X;F(q)||((X=I.current)==null||X.focus(),T(null))},[F]),onTriggerLeave:j.useCallback(q=>{F(q)&&q.preventDefault()},[F]),pointerGraceTimerRef:M,onPointerGraceIntentChange:j.useCallback(q=>{L.current=q},[]),children:d.jsx(z,{...V,children:d.jsx(Ow,{asChild:!0,trapped:s,onMountAutoFocus:Ae(o,q=>{var X;q.preventDefault(),(X=I.current)==null||X.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:d.jsx(Mw,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:v,children:d.jsx(ZA,{asChild:!0,...N,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:R,onCurrentTabStopIdChange:T,onEntryFocus:Ae(u,q=>{S.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:d.jsx(k7,{role:"menu","aria-orientation":"vertical","data-state":QO(x.open),"data-radix-menu-content":"",dir:S.dir,...k,...w,ref:O,style:{outline:"none",...w.style},onKeyDown:Ae(w.onKeyDown,q=>{const D=q.target.closest("[data-radix-menu-content]")===q.currentTarget,W=q.ctrlKey||q.altKey||q.metaKey,oe=q.key.length===1;D&&(q.key==="Tab"&&q.preventDefault(),!W&&oe&&G(q.key));const K=I.current;if(q.target!==K||!j7.includes(q.key))return;q.preventDefault();const te=C().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);RO.includes(q.key)&&te.reverse(),X7(te)}),onBlur:Ae(e.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(P.current),B.current="")}),onPointerMove:Ae(e.onPointerMove,xl(q=>{const X=q.target,D=$.current!==q.clientX;if(q.currentTarget.contains(X)&&D){const W=q.clientX>$.current?"right":"left";U.current=W,$.current=q.clientX}}))})})})})})})});PO.displayName=Cn;var B7="MenuGroup",yb=j.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(tt.div,{role:"group",...r,ref:t})});yb.displayName=B7;var z7="MenuLabel",LO=j.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(tt.div,{...r,ref:t})});LO.displayName=z7;var bd="MenuItem",Mk="menu.itemSelect",rf=j.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=j.useRef(null),a=Bl(bd,e.__scopeMenu),c=mb(bd,e.__scopeMenu),u=jt(t,o),f=j.useRef(!1),m=()=>{const p=o.current;if(!n&&p){const g=new CustomEvent(Mk,{bubbles:!0,cancelable:!0});p.addEventListener(Mk,v=>r==null?void 0:r(v),{once:!0}),fA(p,g),g.defaultPrevented?f.current=!1:a.onClose()}};return d.jsx(DO,{...s,ref:u,disabled:n,onClick:Ae(e.onClick,m),onPointerDown:p=>{var g;(g=e.onPointerDown)==null||g.call(e,p),f.current=!0},onPointerUp:Ae(e.onPointerUp,p=>{var g;f.current||(g=p.currentTarget)==null||g.click()}),onKeyDown:Ae(e.onKeyDown,p=>{const g=c.searchRef.current!=="";n||g&&p.key===" "||ew.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});rf.displayName=bd;var DO=j.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,a=mb(bd,n),c=IO(n),u=j.useRef(null),f=jt(t,u),[m,p]=j.useState(!1),[g,v]=j.useState("");return j.useEffect(()=>{const b=u.current;b&&v((b.textContent??"").trim())},[o.children]),d.jsx(vl.ItemSlot,{scope:n,disabled:r,textValue:s??g,children:d.jsx(eM,{asChild:!0,...c,focusable:!r,children:d.jsx(tt.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:f,onPointerMove:Ae(e.onPointerMove,xl(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ae(e.onPointerLeave,xl(b=>a.onItemLeave(b))),onFocus:Ae(e.onFocus,()=>p(!0)),onBlur:Ae(e.onBlur,()=>p(!1))})})})}),V7="MenuCheckboxItem",$O=j.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return d.jsx(VO,{scope:e.__scopeMenu,checked:n,children:d.jsx(rf,{role:"menuitemcheckbox","aria-checked":Sd(n)?"mixed":n,...s,ref:t,"data-state":xb(n),onSelect:Ae(s.onSelect,()=>r==null?void 0:r(Sd(n)?!0:!n),{checkForDefaultPrevented:!1})})})});$O.displayName=V7;var qO="MenuRadioGroup",[U7,H7]=di(qO,{value:void 0,onValueChange:()=>{}}),FO=j.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=hr(r);return d.jsx(U7,{scope:e.__scopeMenu,value:n,onValueChange:o,children:d.jsx(yb,{...s,ref:t})})});FO.displayName=qO;var BO="MenuRadioItem",zO=j.forwardRef((e,t)=>{const{value:n,...r}=e,s=H7(BO,e.__scopeMenu),o=n===s.value;return d.jsx(VO,{scope:e.__scopeMenu,checked:o,children:d.jsx(rf,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":xb(o),onSelect:Ae(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});zO.displayName=BO;var vb="MenuItemIndicator",[VO,W7]=di(vb,{checked:!1}),UO=j.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=W7(vb,n);return d.jsx(Ur,{present:r||Sd(o.checked)||o.checked===!0,children:d.jsx(tt.span,{...s,ref:t,"data-state":xb(o.checked)})})});UO.displayName=vb;var K7="MenuSeparator",HO=j.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(tt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});HO.displayName=K7;var G7="MenuArrow",WO=j.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=nf(n);return d.jsx(C7,{...s,...r,ref:t})});WO.displayName=G7;var Y7="MenuSub",[GJ,KO]=di(Y7),Va="MenuSubTrigger",GO=j.forwardRef((e,t)=>{const n=fi(Va,e.__scopeMenu),r=Bl(Va,e.__scopeMenu),s=KO(Va,e.__scopeMenu),o=mb(Va,e.__scopeMenu),a=j.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,f={__scopeMenu:e.__scopeMenu},m=j.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return j.useEffect(()=>m,[m]),j.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),u(null)}},[c,u]),d.jsx(hb,{asChild:!0,...f,children:d.jsx(DO,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":QO(n.open),...e,ref:Iw(t,s.onTriggerChange),onClick:p=>{var g;(g=e.onClick)==null||g.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ae(e.onPointerMove,xl(p=>{o.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:Ae(e.onPointerLeave,xl(p=>{var v,b;m();const g=(v=n.content)==null?void 0:v.getBoundingClientRect();if(g){const w=(b=n.content)==null?void 0:b.dataset.side,x=w==="right",S=x?-5:5,k=g[x?"left":"right"],N=g[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:p.clientX+S,y:p.clientY},{x:k,y:g.top},{x:N,y:g.top},{x:N,y:g.bottom},{x:k,y:g.bottom}],side:w}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(p),p.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Ae(e.onKeyDown,p=>{var v;const g=o.searchRef.current!=="";e.disabled||g&&p.key===" "||R7[r.dir].includes(p.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),p.preventDefault())})})})});GO.displayName=Va;var YO="MenuSubContent",XO=j.forwardRef((e,t)=>{const n=MO(Cn,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=fi(Cn,e.__scopeMenu),a=Bl(Cn,e.__scopeMenu),c=KO(YO,e.__scopeMenu),u=j.useRef(null),f=jt(t,u);return d.jsx(vl.Provider,{scope:e.__scopeMenu,children:d.jsx(Ur,{present:r||o.open,children:d.jsx(vl.Slot,{scope:e.__scopeMenu,children:d.jsx(gb,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:f,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var p;a.isUsingKeyboardRef.current&&((p=u.current)==null||p.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Ae(e.onFocusOutside,m=>{m.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Ae(e.onEscapeKeyDown,m=>{a.onClose(),m.preventDefault()}),onKeyDown:Ae(e.onKeyDown,m=>{var v;const p=m.currentTarget.contains(m.target),g=T7[a.dir].includes(m.key);p&&g&&(o.onOpenChange(!1),(v=c.trigger)==null||v.focus(),m.preventDefault())})})})})})});XO.displayName=YO;function QO(e){return e?"open":"closed"}function Sd(e){return e==="indeterminate"}function xb(e){return Sd(e)?"indeterminate":e?"checked":"unchecked"}function X7(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Q7(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function J7(e,t,n){const s=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=Q7(e,Math.max(o,0));s.length===1&&(a=a.filter(f=>f!==n));const u=a.find(f=>f.toLowerCase().startsWith(s.toLowerCase()));return u!==n?u:void 0}function Z7(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const c=t[o],u=t[a],f=c.x,m=c.y,p=u.x,g=u.y;m>r!=g>r&&n<(p-f)*(r-m)/(g-m)+f&&(s=!s)}return s}function eK(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Z7(n,t)}function xl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var tK=AO,nK=hb,rK=OO,sK=PO,iK=yb,oK=LO,aK=rf,lK=$O,cK=FO,uK=zO,dK=UO,fK=HO,hK=WO,pK=GO,mK=XO,wb="ContextMenu",[gK]=ci(wb,[TO]),Vt=TO(),[yK,JO]=gK(wb),ZO=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:s,modal:o=!0}=e,[a,c]=j.useState(!1),u=Vt(t),f=hr(r),m=j.useCallback(p=>{c(p),f(p)},[f]);return d.jsx(yK,{scope:t,open:a,onOpenChange:m,modal:o,children:d.jsx(tK,{...u,dir:s,open:a,onOpenChange:m,modal:o,children:n})})};ZO.displayName=wb;var eP="ContextMenuTrigger",tP=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=e,o=JO(eP,n),a=Vt(n),c=j.useRef({x:0,y:0}),u=j.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),f=j.useRef(0),m=j.useCallback(()=>window.clearTimeout(f.current),[]),p=g=>{c.current={x:g.clientX,y:g.clientY},o.onOpenChange(!0)};return j.useEffect(()=>m,[m]),j.useEffect(()=>void(r&&m()),[r,m]),d.jsxs(d.Fragment,{children:[d.jsx(nK,{...a,virtualRef:u}),d.jsx(tt.span,{"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Ae(e.onContextMenu,g=>{m(),p(g),g.preventDefault()}),onPointerDown:r?e.onPointerDown:Ae(e.onPointerDown,Au(g=>{m(),f.current=window.setTimeout(()=>p(g),700)})),onPointerMove:r?e.onPointerMove:Ae(e.onPointerMove,Au(m)),onPointerCancel:r?e.onPointerCancel:Ae(e.onPointerCancel,Au(m)),onPointerUp:r?e.onPointerUp:Ae(e.onPointerUp,Au(m))})]})});tP.displayName=eP;var vK="ContextMenuPortal",nP=e=>{const{__scopeContextMenu:t,...n}=e,r=Vt(t);return d.jsx(rK,{...r,...n})};nP.displayName=vK;var rP="ContextMenuContent",sP=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=JO(rP,n),o=Vt(n),a=j.useRef(!1);return d.jsx(sK,{...o,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var u;(u=e.onCloseAutoFocus)==null||u.call(e,c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{var u;(u=e.onInteractOutside)==null||u.call(e,c),!c.defaultPrevented&&!s.modal&&(a.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});sP.displayName=rP;var xK="ContextMenuGroup",wK=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Vt(n);return d.jsx(iK,{...s,...r,ref:t})});wK.displayName=xK;var bK="ContextMenuLabel",iP=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Vt(n);return d.jsx(oK,{...s,...r,ref:t})});iP.displayName=bK;var SK="ContextMenuItem",oP=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Vt(n);return d.jsx(aK,{...s,...r,ref:t})});oP.displayName=SK;var _K="ContextMenuCheckboxItem",aP=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Vt(n);return d.jsx(lK,{...s,...r,ref:t})});aP.displayName=_K;var NK="ContextMenuRadioGroup",kK=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Vt(n);return d.jsx(cK,{...s,...r,ref:t})});kK.displayName=NK;var CK="ContextMenuRadioItem",lP=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Vt(n);return d.jsx(uK,{...s,...r,ref:t})});lP.displayName=CK;var EK="ContextMenuItemIndicator",cP=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Vt(n);return d.jsx(dK,{...s,...r,ref:t})});cP.displayName=EK;var jK="ContextMenuSeparator",uP=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Vt(n);return d.jsx(fK,{...s,...r,ref:t})});uP.displayName=jK;var RK="ContextMenuArrow",TK=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Vt(n);return d.jsx(hK,{...s,...r,ref:t})});TK.displayName=RK;var IK="ContextMenuSubTrigger",dP=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Vt(n);return d.jsx(pK,{...s,...r,ref:t})});dP.displayName=IK;var AK="ContextMenuSubContent",fP=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Vt(n);return d.jsx(mK,{...s,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});fP.displayName=AK;function Au(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var MK=ZO,OK=tP,PK=nP,hP=sP,pP=iP,mP=oP,gP=aP,yP=lP,vP=cP,xP=uP,wP=dP,bP=fP;const LK=MK,DK=OK,$K=j.forwardRef(({className:e,inset:t,children:n,...r},s)=>d.jsxs(wP,{ref:s,className:zt("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","focus:bg-white/10 data-[state=open]:bg-white/10",t&&"pl-8",e),...r,children:[n,d.jsx("span",{className:"ml-auto text-xs",children:"▶"})]}));$K.displayName=wP.displayName;const qK=j.forwardRef(({className:e,...t},n)=>d.jsx(bP,{ref:n,className:zt("z-50 min-w-[8rem] overflow-hidden rounded-md border border-node-border bg-panel-bg p-1 shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...t}));qK.displayName=bP.displayName;const SP=j.forwardRef(({className:e,...t},n)=>d.jsx(PK,{children:d.jsx(hP,{ref:n,className:zt("z-50 min-w-[12rem] overflow-hidden rounded-md border border-node-border bg-panel-bg p-1 shadow-lg","animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...t})}));SP.displayName=hP.displayName;const eo=j.forwardRef(({className:e,inset:t,destructive:n,...r},s)=>d.jsx(mP,{ref:s,className:zt("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","focus:bg-white/10 focus:text-white","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"text-error focus:bg-error/10 focus:text-error",t&&"pl-8",e),...r}));eo.displayName=mP.displayName;const FK=j.forwardRef(({className:e,children:t,checked:n,...r},s)=>d.jsxs(gP,{ref:s,className:zt("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-white/10 focus:text-white","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[d.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(vP,{children:d.jsx("span",{className:"text-primary",children:"✓"})})}),t]}));FK.displayName=gP.displayName;const BK=j.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(yP,{ref:r,className:zt("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-white/10 focus:text-white","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[d.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(vP,{children:d.jsx("span",{className:"h-2 w-2 rounded-full bg-primary"})})}),t]}));BK.displayName=yP.displayName;const zK=j.forwardRef(({className:e,inset:t,...n},r)=>d.jsx(pP,{ref:r,className:zt("px-2 py-1.5 text-xs font-semibold text-gray-400",t&&"pl-8",e),...n}));zK.displayName=pP.displayName;const tw=j.forwardRef(({className:e,...t},n)=>d.jsx(xP,{ref:n,className:zt("-mx-1 my-1 h-px bg-node-border",e),...t}));tw.displayName=xP.displayName;const Ua=({className:e,...t})=>d.jsx("span",{className:zt("ml-auto text-xs tracking-widest text-gray-500",e),...t});Ua.displayName="ContextMenuShortcut";function bb(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Zp,Ok;function VK(){if(Ok)return Zp;Ok=1;function e(){this.__data__=[],this.size=0}return Zp=e,Zp}var em,Pk;function qo(){if(Pk)return em;Pk=1;function e(t,n){return t===n||t!==t&&n!==n}return em=e,em}var tm,Lk;function sf(){if(Lk)return tm;Lk=1;var e=qo();function t(n,r){for(var s=n.length;s--;)if(e(n[s][0],r))return s;return-1}return tm=t,tm}var nm,Dk;function UK(){if(Dk)return nm;Dk=1;var e=sf(),t=Array.prototype,n=t.splice;function r(s){var o=this.__data__,a=e(o,s);if(a<0)return!1;var c=o.length-1;return a==c?o.pop():n.call(o,a,1),--this.size,!0}return nm=r,nm}var rm,$k;function HK(){if($k)return rm;$k=1;var e=sf();function t(n){var r=this.__data__,s=e(r,n);return s<0?void 0:r[s][1]}return rm=t,rm}var sm,qk;function WK(){if(qk)return sm;qk=1;var e=sf();function t(n){return e(this.__data__,n)>-1}return sm=t,sm}var im,Fk;function KK(){if(Fk)return im;Fk=1;var e=sf();function t(n,r){var s=this.__data__,o=e(s,n);return o<0?(++this.size,s.push([n,r])):s[o][1]=r,this}return im=t,im}var om,Bk;function of(){if(Bk)return om;Bk=1;var e=VK(),t=UK(),n=HK(),r=WK(),s=KK();function o(a){var c=-1,u=a==null?0:a.length;for(this.clear();++c<u;){var f=a[c];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=s,om=o,om}var am,zk;function GK(){if(zk)return am;zk=1;var e=of();function t(){this.__data__=new e,this.size=0}return am=t,am}var lm,Vk;function YK(){if(Vk)return lm;Vk=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return lm=e,lm}var cm,Uk;function XK(){if(Uk)return cm;Uk=1;function e(t){return this.__data__.get(t)}return cm=e,cm}var um,Hk;function QK(){if(Hk)return um;Hk=1;function e(t){return this.__data__.has(t)}return um=e,um}var dm,Wk;function _P(){if(Wk)return dm;Wk=1;var e=typeof lu=="object"&&lu&&lu.Object===Object&&lu;return dm=e,dm}var fm,Kk;function Xn(){if(Kk)return fm;Kk=1;var e=_P(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return fm=n,fm}var hm,Gk;function Fo(){if(Gk)return hm;Gk=1;var e=Xn(),t=e.Symbol;return hm=t,hm}var pm,Yk;function JK(){if(Yk)return pm;Yk=1;var e=Fo(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,s=e?e.toStringTag:void 0;function o(a){var c=n.call(a,s),u=a[s];try{a[s]=void 0;var f=!0}catch{}var m=r.call(a);return f&&(c?a[s]=u:delete a[s]),m}return pm=o,pm}var mm,Xk;function ZK(){if(Xk)return mm;Xk=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return mm=n,mm}var gm,Qk;function hi(){if(Qk)return gm;Qk=1;var e=Fo(),t=JK(),n=ZK(),r="[object Null]",s="[object Undefined]",o=e?e.toStringTag:void 0;function a(c){return c==null?c===void 0?s:r:o&&o in Object(c)?t(c):n(c)}return gm=a,gm}var ym,Jk;function Rn(){if(Jk)return ym;Jk=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return ym=e,ym}var vm,Zk;function zl(){if(Zk)return vm;Zk=1;var e=hi(),t=Rn(),n="[object AsyncFunction]",r="[object Function]",s="[object GeneratorFunction]",o="[object Proxy]";function a(c){if(!t(c))return!1;var u=e(c);return u==r||u==s||u==n||u==o}return vm=a,vm}var xm,eC;function eG(){if(eC)return xm;eC=1;var e=Xn(),t=e["__core-js_shared__"];return xm=t,xm}var wm,tC;function tG(){if(tC)return wm;tC=1;var e=eG(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return wm=n,wm}var bm,nC;function NP(){if(nC)return bm;nC=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return bm=n,bm}var Sm,rC;function nG(){if(rC)return Sm;rC=1;var e=zl(),t=tG(),n=Rn(),r=NP(),s=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,a=Function.prototype,c=Object.prototype,u=a.toString,f=c.hasOwnProperty,m=RegExp("^"+u.call(f).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(g){if(!n(g)||t(g))return!1;var v=e(g)?m:o;return v.test(r(g))}return Sm=p,Sm}var _m,sC;function rG(){if(sC)return _m;sC=1;function e(t,n){return t==null?void 0:t[n]}return _m=e,_m}var Nm,iC;function pi(){if(iC)return Nm;iC=1;var e=nG(),t=rG();function n(r,s){var o=t(r,s);return e(o)?o:void 0}return Nm=n,Nm}var km,oC;function Sb(){if(oC)return km;oC=1;var e=pi(),t=Xn(),n=e(t,"Map");return km=n,km}var Cm,aC;function af(){if(aC)return Cm;aC=1;var e=pi(),t=e(Object,"create");return Cm=t,Cm}var Em,lC;function sG(){if(lC)return Em;lC=1;var e=af();function t(){this.__data__=e?e(null):{},this.size=0}return Em=t,Em}var jm,cC;function iG(){if(cC)return jm;cC=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return jm=e,jm}var Rm,uC;function oG(){if(uC)return Rm;uC=1;var e=af(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function s(o){var a=this.__data__;if(e){var c=a[o];return c===t?void 0:c}return r.call(a,o)?a[o]:void 0}return Rm=s,Rm}var Tm,dC;function aG(){if(dC)return Tm;dC=1;var e=af(),t=Object.prototype,n=t.hasOwnProperty;function r(s){var o=this.__data__;return e?o[s]!==void 0:n.call(o,s)}return Tm=r,Tm}var Im,fC;function lG(){if(fC)return Im;fC=1;var e=af(),t="__lodash_hash_undefined__";function n(r,s){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&s===void 0?t:s,this}return Im=n,Im}var Am,hC;function cG(){if(hC)return Am;hC=1;var e=sG(),t=iG(),n=oG(),r=aG(),s=lG();function o(a){var c=-1,u=a==null?0:a.length;for(this.clear();++c<u;){var f=a[c];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=s,Am=o,Am}var Mm,pC;function uG(){if(pC)return Mm;pC=1;var e=cG(),t=of(),n=Sb();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Mm=r,Mm}var Om,mC;function dG(){if(mC)return Om;mC=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return Om=e,Om}var Pm,gC;function lf(){if(gC)return Pm;gC=1;var e=dG();function t(n,r){var s=n.__data__;return e(r)?s[typeof r=="string"?"string":"hash"]:s.map}return Pm=t,Pm}var Lm,yC;function fG(){if(yC)return Lm;yC=1;var e=lf();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return Lm=t,Lm}var Dm,vC;function hG(){if(vC)return Dm;vC=1;var e=lf();function t(n){return e(this,n).get(n)}return Dm=t,Dm}var $m,xC;function pG(){if(xC)return $m;xC=1;var e=lf();function t(n){return e(this,n).has(n)}return $m=t,$m}var qm,wC;function mG(){if(wC)return qm;wC=1;var e=lf();function t(n,r){var s=e(this,n),o=s.size;return s.set(n,r),this.size+=s.size==o?0:1,this}return qm=t,qm}var Fm,bC;function _b(){if(bC)return Fm;bC=1;var e=uG(),t=fG(),n=hG(),r=pG(),s=mG();function o(a){var c=-1,u=a==null?0:a.length;for(this.clear();++c<u;){var f=a[c];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=s,Fm=o,Fm}var Bm,SC;function gG(){if(SC)return Bm;SC=1;var e=of(),t=Sb(),n=_b(),r=200;function s(o,a){var c=this.__data__;if(c instanceof e){var u=c.__data__;if(!t||u.length<r-1)return u.push([o,a]),this.size=++c.size,this;c=this.__data__=new n(u)}return c.set(o,a),this.size=c.size,this}return Bm=s,Bm}var zm,_C;function cf(){if(_C)return zm;_C=1;var e=of(),t=GK(),n=YK(),r=XK(),s=QK(),o=gG();function a(c){var u=this.__data__=new e(c);this.size=u.size}return a.prototype.clear=t,a.prototype.delete=n,a.prototype.get=r,a.prototype.has=s,a.prototype.set=o,zm=a,zm}var Vm,NC;function Nb(){if(NC)return Vm;NC=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r<s&&n(t[r],r,t)!==!1;);return t}return Vm=e,Vm}var Um,kC;function kP(){if(kC)return Um;kC=1;var e=pi(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return Um=t,Um}var Hm,CC;function uf(){if(CC)return Hm;CC=1;var e=kP();function t(n,r,s){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:s,writable:!0}):n[r]=s}return Hm=t,Hm}var Wm,EC;function df(){if(EC)return Wm;EC=1;var e=uf(),t=qo(),n=Object.prototype,r=n.hasOwnProperty;function s(o,a,c){var u=o[a];(!(r.call(o,a)&&t(u,c))||c===void 0&&!(a in o))&&e(o,a,c)}return Wm=s,Wm}var Km,jC;function Vl(){if(jC)return Km;jC=1;var e=df(),t=uf();function n(r,s,o,a){var c=!o;o||(o={});for(var u=-1,f=s.length;++u<f;){var m=s[u],p=a?a(o[m],r[m],m,o,r):void 0;p===void 0&&(p=r[m]),c?t(o,m,p):e(o,m,p)}return o}return Km=n,Km}var Gm,RC;function yG(){if(RC)return Gm;RC=1;function e(t,n){for(var r=-1,s=Array(t);++r<t;)s[r]=n(r);return s}return Gm=e,Gm}var Ym,TC;function xr(){if(TC)return Ym;TC=1;function e(t){return t!=null&&typeof t=="object"}return Ym=e,Ym}var Xm,IC;function vG(){if(IC)return Xm;IC=1;var e=hi(),t=xr(),n="[object Arguments]";function r(s){return t(s)&&e(s)==n}return Xm=r,Xm}var Qm,AC;function Ul(){if(AC)return Qm;AC=1;var e=vG(),t=xr(),n=Object.prototype,r=n.hasOwnProperty,s=n.propertyIsEnumerable,o=e((function(){return arguments})())?e:function(a){return t(a)&&r.call(a,"callee")&&!s.call(a,"callee")};return Qm=o,Qm}var Jm,MC;function yt(){if(MC)return Jm;MC=1;var e=Array.isArray;return Jm=e,Jm}var Ha={exports:{}},Zm,OC;function xG(){if(OC)return Zm;OC=1;function e(){return!1}return Zm=e,Zm}Ha.exports;var PC;function Bo(){return PC||(PC=1,(function(e,t){var n=Xn(),r=xG(),s=t&&!t.nodeType&&t,o=s&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===s,c=a?n.Buffer:void 0,u=c?c.isBuffer:void 0,f=u||r;e.exports=f})(Ha,Ha.exports)),Ha.exports}var eg,LC;function ff(){if(LC)return eg;LC=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,s){var o=typeof r;return s=s??e,!!s&&(o=="number"||o!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<s}return eg=n,eg}var tg,DC;function kb(){if(DC)return tg;DC=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return tg=t,tg}var ng,$C;function wG(){if($C)return ng;$C=1;var e=hi(),t=kb(),n=xr(),r="[object Arguments]",s="[object Array]",o="[object Boolean]",a="[object Date]",c="[object Error]",u="[object Function]",f="[object Map]",m="[object Number]",p="[object Object]",g="[object RegExp]",v="[object Set]",b="[object String]",w="[object WeakMap]",x="[object ArrayBuffer]",S="[object DataView]",k="[object Float32Array]",N="[object Float64Array]",C="[object Int8Array]",R="[object Int16Array]",T="[object Int32Array]",I="[object Uint8Array]",O="[object Uint8ClampedArray]",P="[object Uint16Array]",B="[object Uint32Array]",M={};M[k]=M[N]=M[C]=M[R]=M[T]=M[I]=M[O]=M[P]=M[B]=!0,M[r]=M[s]=M[x]=M[o]=M[S]=M[a]=M[c]=M[u]=M[f]=M[m]=M[p]=M[g]=M[v]=M[b]=M[w]=!1;function L(U){return n(U)&&t(U.length)&&!!M[e(U)]}return ng=L,ng}var rg,qC;function hf(){if(qC)return rg;qC=1;function e(t){return function(n){return t(n)}}return rg=e,rg}var Wa={exports:{}};Wa.exports;var FC;function Cb(){return FC||(FC=1,(function(e,t){var n=_P(),r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===r,a=o&&n.process,c=(function(){try{var u=s&&s.require&&s.require("util").types;return u||a&&a.binding&&a.binding("util")}catch{}})();e.exports=c})(Wa,Wa.exports)),Wa.exports}var sg,BC;function Hl(){if(BC)return sg;BC=1;var e=wG(),t=hf(),n=Cb(),r=n&&n.isTypedArray,s=r?t(r):e;return sg=s,sg}var ig,zC;function CP(){if(zC)return ig;zC=1;var e=yG(),t=Ul(),n=yt(),r=Bo(),s=ff(),o=Hl(),a=Object.prototype,c=a.hasOwnProperty;function u(f,m){var p=n(f),g=!p&&t(f),v=!p&&!g&&r(f),b=!p&&!g&&!v&&o(f),w=p||g||v||b,x=w?e(f.length,String):[],S=x.length;for(var k in f)(m||c.call(f,k))&&!(w&&(k=="length"||v&&(k=="offset"||k=="parent")||b&&(k=="buffer"||k=="byteLength"||k=="byteOffset")||s(k,S)))&&x.push(k);return x}return ig=u,ig}var og,VC;function pf(){if(VC)return og;VC=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,s=typeof r=="function"&&r.prototype||e;return n===s}return og=t,og}var ag,UC;function EP(){if(UC)return ag;UC=1;function e(t,n){return function(r){return t(n(r))}}return ag=e,ag}var lg,HC;function bG(){if(HC)return lg;HC=1;var e=EP(),t=e(Object.keys,Object);return lg=t,lg}var cg,WC;function Eb(){if(WC)return cg;WC=1;var e=pf(),t=bG(),n=Object.prototype,r=n.hasOwnProperty;function s(o){if(!e(o))return t(o);var a=[];for(var c in Object(o))r.call(o,c)&&c!="constructor"&&a.push(c);return a}return cg=s,cg}var ug,KC;function Hr(){if(KC)return ug;KC=1;var e=zl(),t=kb();function n(r){return r!=null&&t(r.length)&&!e(r)}return ug=n,ug}var dg,GC;function Rs(){if(GC)return dg;GC=1;var e=CP(),t=Eb(),n=Hr();function r(s){return n(s)?e(s):t(s)}return dg=r,dg}var fg,YC;function SG(){if(YC)return fg;YC=1;var e=Vl(),t=Rs();function n(r,s){return r&&e(s,t(s),r)}return fg=n,fg}var hg,XC;function _G(){if(XC)return hg;XC=1;function e(t){var n=[];if(t!=null)for(var r in Object(t))n.push(r);return n}return hg=e,hg}var pg,QC;function NG(){if(QC)return pg;QC=1;var e=Rn(),t=pf(),n=_G(),r=Object.prototype,s=r.hasOwnProperty;function o(a){if(!e(a))return n(a);var c=t(a),u=[];for(var f in a)f=="constructor"&&(c||!s.call(a,f))||u.push(f);return u}return pg=o,pg}var mg,JC;function mi(){if(JC)return mg;JC=1;var e=CP(),t=NG(),n=Hr();function r(s){return n(s)?e(s,!0):t(s)}return mg=r,mg}var gg,ZC;function kG(){if(ZC)return gg;ZC=1;var e=Vl(),t=mi();function n(r,s){return r&&e(s,t(s),r)}return gg=n,gg}var Ka={exports:{}};Ka.exports;var e2;function jP(){return e2||(e2=1,(function(e,t){var n=Xn(),r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===r,a=o?n.Buffer:void 0,c=a?a.allocUnsafe:void 0;function u(f,m){if(m)return f.slice();var p=f.length,g=c?c(p):new f.constructor(p);return f.copy(g),g}e.exports=u})(Ka,Ka.exports)),Ka.exports}var yg,t2;function RP(){if(t2)return yg;t2=1;function e(t,n){var r=-1,s=t.length;for(n||(n=Array(s));++r<s;)n[r]=t[r];return n}return yg=e,yg}var vg,n2;function TP(){if(n2)return vg;n2=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,o=0,a=[];++r<s;){var c=t[r];n(c,r,t)&&(a[o++]=c)}return a}return vg=e,vg}var xg,r2;function IP(){if(r2)return xg;r2=1;function e(){return[]}return xg=e,xg}var wg,s2;function jb(){if(s2)return wg;s2=1;var e=TP(),t=IP(),n=Object.prototype,r=n.propertyIsEnumerable,s=Object.getOwnPropertySymbols,o=s?function(a){return a==null?[]:(a=Object(a),e(s(a),function(c){return r.call(a,c)}))}:t;return wg=o,wg}var bg,i2;function CG(){if(i2)return bg;i2=1;var e=Vl(),t=jb();function n(r,s){return e(r,t(r),s)}return bg=n,bg}var Sg,o2;function Rb(){if(o2)return Sg;o2=1;function e(t,n){for(var r=-1,s=n.length,o=t.length;++r<s;)t[o+r]=n[r];return t}return Sg=e,Sg}var _g,a2;function mf(){if(a2)return _g;a2=1;var e=EP(),t=e(Object.getPrototypeOf,Object);return _g=t,_g}var Ng,l2;function AP(){if(l2)return Ng;l2=1;var e=Rb(),t=mf(),n=jb(),r=IP(),s=Object.getOwnPropertySymbols,o=s?function(a){for(var c=[];a;)e(c,n(a)),a=t(a);return c}:r;return Ng=o,Ng}var kg,c2;function EG(){if(c2)return kg;c2=1;var e=Vl(),t=AP();function n(r,s){return e(r,t(r),s)}return kg=n,kg}var Cg,u2;function MP(){if(u2)return Cg;u2=1;var e=Rb(),t=yt();function n(r,s,o){var a=s(r);return t(r)?a:e(a,o(r))}return Cg=n,Cg}var Eg,d2;function OP(){if(d2)return Eg;d2=1;var e=MP(),t=jb(),n=Rs();function r(s){return e(s,n,t)}return Eg=r,Eg}var jg,f2;function jG(){if(f2)return jg;f2=1;var e=MP(),t=AP(),n=mi();function r(s){return e(s,n,t)}return jg=r,jg}var Rg,h2;function RG(){if(h2)return Rg;h2=1;var e=pi(),t=Xn(),n=e(t,"DataView");return Rg=n,Rg}var Tg,p2;function TG(){if(p2)return Tg;p2=1;var e=pi(),t=Xn(),n=e(t,"Promise");return Tg=n,Tg}var Ig,m2;function PP(){if(m2)return Ig;m2=1;var e=pi(),t=Xn(),n=e(t,"Set");return Ig=n,Ig}var Ag,g2;function IG(){if(g2)return Ag;g2=1;var e=pi(),t=Xn(),n=e(t,"WeakMap");return Ag=n,Ag}var Mg,y2;function zo(){if(y2)return Mg;y2=1;var e=RG(),t=Sb(),n=TG(),r=PP(),s=IG(),o=hi(),a=NP(),c="[object Map]",u="[object Object]",f="[object Promise]",m="[object Set]",p="[object WeakMap]",g="[object DataView]",v=a(e),b=a(t),w=a(n),x=a(r),S=a(s),k=o;return(e&&k(new e(new ArrayBuffer(1)))!=g||t&&k(new t)!=c||n&&k(n.resolve())!=f||r&&k(new r)!=m||s&&k(new s)!=p)&&(k=function(N){var C=o(N),R=C==u?N.constructor:void 0,T=R?a(R):"";if(T)switch(T){case v:return g;case b:return c;case w:return f;case x:return m;case S:return p}return C}),Mg=k,Mg}var Og,v2;function AG(){if(v2)return Og;v2=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r){var s=r.length,o=new r.constructor(s);return s&&typeof r[0]=="string"&&t.call(r,"index")&&(o.index=r.index,o.input=r.input),o}return Og=n,Og}var Pg,x2;function LP(){if(x2)return Pg;x2=1;var e=Xn(),t=e.Uint8Array;return Pg=t,Pg}var Lg,w2;function Tb(){if(w2)return Lg;w2=1;var e=LP();function t(n){var r=new n.constructor(n.byteLength);return new e(r).set(new e(n)),r}return Lg=t,Lg}var Dg,b2;function MG(){if(b2)return Dg;b2=1;var e=Tb();function t(n,r){var s=r?e(n.buffer):n.buffer;return new n.constructor(s,n.byteOffset,n.byteLength)}return Dg=t,Dg}var $g,S2;function OG(){if(S2)return $g;S2=1;var e=/\w*$/;function t(n){var r=new n.constructor(n.source,e.exec(n));return r.lastIndex=n.lastIndex,r}return $g=t,$g}var qg,_2;function PG(){if(_2)return qg;_2=1;var e=Fo(),t=e?e.prototype:void 0,n=t?t.valueOf:void 0;function r(s){return n?Object(n.call(s)):{}}return qg=r,qg}var Fg,N2;function DP(){if(N2)return Fg;N2=1;var e=Tb();function t(n,r){var s=r?e(n.buffer):n.buffer;return new n.constructor(s,n.byteOffset,n.length)}return Fg=t,Fg}var Bg,k2;function LG(){if(k2)return Bg;k2=1;var e=Tb(),t=MG(),n=OG(),r=PG(),s=DP(),o="[object Boolean]",a="[object Date]",c="[object Map]",u="[object Number]",f="[object RegExp]",m="[object Set]",p="[object String]",g="[object Symbol]",v="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",x="[object Float64Array]",S="[object Int8Array]",k="[object Int16Array]",N="[object Int32Array]",C="[object Uint8Array]",R="[object Uint8ClampedArray]",T="[object Uint16Array]",I="[object Uint32Array]";function O(P,B,M){var L=P.constructor;switch(B){case v:return e(P);case o:case a:return new L(+P);case b:return t(P,M);case w:case x:case S:case k:case N:case C:case R:case T:case I:return s(P,M);case c:return new L;case u:case p:return new L(P);case f:return n(P);case m:return new L;case g:return r(P)}}return Bg=O,Bg}var zg,C2;function $P(){if(C2)return zg;C2=1;var e=Rn(),t=Object.create,n=(function(){function r(){}return function(s){if(!e(s))return{};if(t)return t(s);r.prototype=s;var o=new r;return r.prototype=void 0,o}})();return zg=n,zg}var Vg,E2;function qP(){if(E2)return Vg;E2=1;var e=$P(),t=mf(),n=pf();function r(s){return typeof s.constructor=="function"&&!n(s)?e(t(s)):{}}return Vg=r,Vg}var Ug,j2;function DG(){if(j2)return Ug;j2=1;var e=zo(),t=xr(),n="[object Map]";function r(s){return t(s)&&e(s)==n}return Ug=r,Ug}var Hg,R2;function $G(){if(R2)return Hg;R2=1;var e=DG(),t=hf(),n=Cb(),r=n&&n.isMap,s=r?t(r):e;return Hg=s,Hg}var Wg,T2;function qG(){if(T2)return Wg;T2=1;var e=zo(),t=xr(),n="[object Set]";function r(s){return t(s)&&e(s)==n}return Wg=r,Wg}var Kg,I2;function FG(){if(I2)return Kg;I2=1;var e=qG(),t=hf(),n=Cb(),r=n&&n.isSet,s=r?t(r):e;return Kg=s,Kg}var Gg,A2;function FP(){if(A2)return Gg;A2=1;var e=cf(),t=Nb(),n=df(),r=SG(),s=kG(),o=jP(),a=RP(),c=CG(),u=EG(),f=OP(),m=jG(),p=zo(),g=AG(),v=LG(),b=qP(),w=yt(),x=Bo(),S=$G(),k=Rn(),N=FG(),C=Rs(),R=mi(),T=1,I=2,O=4,P="[object Arguments]",B="[object Array]",M="[object Boolean]",L="[object Date]",U="[object Error]",$="[object Function]",z="[object GeneratorFunction]",V="[object Map]",G="[object Number]",F="[object Object]",q="[object RegExp]",X="[object Set]",D="[object String]",W="[object Symbol]",oe="[object WeakMap]",K="[object ArrayBuffer]",J="[object DataView]",te="[object Float32Array]",Y="[object Float64Array]",ee="[object Int8Array]",ie="[object Int16Array]",ue="[object Int32Array]",ge="[object Uint8Array]",xe="[object Uint8ClampedArray]",pe="[object Uint16Array]",be="[object Uint32Array]",ve={};ve[P]=ve[B]=ve[K]=ve[J]=ve[M]=ve[L]=ve[te]=ve[Y]=ve[ee]=ve[ie]=ve[ue]=ve[V]=ve[G]=ve[F]=ve[q]=ve[X]=ve[D]=ve[W]=ve[ge]=ve[xe]=ve[pe]=ve[be]=!0,ve[U]=ve[$]=ve[oe]=!1;function Re(ke,ze,Ue,vt,Pe,ft){var He,hn=ze&T,Zt=ze&I,en=ze&O;if(Ue&&(He=Pe?Ue(ke,vt,Pe,ft):Ue(ke)),He!==void 0)return He;if(!k(ke))return ke;var Lt=w(ke);if(Lt){if(He=g(ke),!hn)return a(ke,He)}else{var bt=p(ke),wr=bt==$||bt==z;if(x(ke))return o(ke,hn);if(bt==F||bt==P||wr&&!Pe){if(He=Zt||wr?{}:b(ke),!hn)return Zt?u(ke,s(He,ke)):c(ke,r(He,ke))}else{if(!ve[bt])return Pe?ke:{};He=v(ke,bt,hn)}}ft||(ft=new e);var kt=ft.get(ke);if(kt)return kt;ft.set(ke,He),N(ke)?ke.forEach(function(Rt){He.add(Re(Rt,ze,Ue,Rt,ke,ft))}):S(ke)&&ke.forEach(function(Rt,Dt){He.set(Dt,Re(Rt,ze,Ue,Dt,ke,ft))});var tn=en?Zt?m:f:Zt?R:C,Kr=Lt?void 0:tn(ke);return t(Kr||ke,function(Rt,Dt){Kr&&(Dt=Rt,Rt=ke[Dt]),n(He,Dt,Re(Rt,ze,Ue,Dt,ke,ft))}),He}return Gg=Re,Gg}var Yg,M2;function BG(){if(M2)return Yg;M2=1;var e=FP(),t=4;function n(r){return e(r,t)}return Yg=n,Yg}var Xg,O2;function Ib(){if(O2)return Xg;O2=1;function e(t){return function(){return t}}return Xg=e,Xg}var Qg,P2;function zG(){if(P2)return Qg;P2=1;function e(t){return function(n,r,s){for(var o=-1,a=Object(n),c=s(n),u=c.length;u--;){var f=c[t?u:++o];if(r(a[f],f,a)===!1)break}return n}}return Qg=e,Qg}var Jg,L2;function Ab(){if(L2)return Jg;L2=1;var e=zG(),t=e();return Jg=t,Jg}var Zg,D2;function Mb(){if(D2)return Zg;D2=1;var e=Ab(),t=Rs();function n(r,s){return r&&e(r,s,t)}return Zg=n,Zg}var ey,$2;function VG(){if($2)return ey;$2=1;var e=Hr();function t(n,r){return function(s,o){if(s==null)return s;if(!e(s))return n(s,o);for(var a=s.length,c=r?a:-1,u=Object(s);(r?c--:++c<a)&&o(u[c],c,u)!==!1;);return s}}return ey=t,ey}var ty,q2;function gf(){if(q2)return ty;q2=1;var e=Mb(),t=VG(),n=t(e);return ty=n,ty}var ny,F2;function gi(){if(F2)return ny;F2=1;function e(t){return t}return ny=e,ny}var ry,B2;function BP(){if(B2)return ry;B2=1;var e=gi();function t(n){return typeof n=="function"?n:e}return ry=t,ry}var sy,z2;function zP(){if(z2)return sy;z2=1;var e=Nb(),t=gf(),n=BP(),r=yt();function s(o,a){var c=r(o)?e:t;return c(o,n(a))}return sy=s,sy}var iy,V2;function VP(){return V2||(V2=1,iy=zP()),iy}var oy,U2;function UG(){if(U2)return oy;U2=1;var e=gf();function t(n,r){var s=[];return e(n,function(o,a,c){r(o,a,c)&&s.push(o)}),s}return oy=t,oy}var ay,H2;function HG(){if(H2)return ay;H2=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return ay=t,ay}var ly,W2;function WG(){if(W2)return ly;W2=1;function e(t){return this.__data__.has(t)}return ly=e,ly}var cy,K2;function UP(){if(K2)return cy;K2=1;var e=_b(),t=HG(),n=WG();function r(s){var o=-1,a=s==null?0:s.length;for(this.__data__=new e;++o<a;)this.add(s[o])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,cy=r,cy}var uy,G2;function KG(){if(G2)return uy;G2=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r<s;)if(n(t[r],r,t))return!0;return!1}return uy=e,uy}var dy,Y2;function HP(){if(Y2)return dy;Y2=1;function e(t,n){return t.has(n)}return dy=e,dy}var fy,X2;function WP(){if(X2)return fy;X2=1;var e=UP(),t=KG(),n=HP(),r=1,s=2;function o(a,c,u,f,m,p){var g=u&r,v=a.length,b=c.length;if(v!=b&&!(g&&b>v))return!1;var w=p.get(a),x=p.get(c);if(w&&x)return w==c&&x==a;var S=-1,k=!0,N=u&s?new e:void 0;for(p.set(a,c),p.set(c,a);++S<v;){var C=a[S],R=c[S];if(f)var T=g?f(R,C,S,c,a,p):f(C,R,S,a,c,p);if(T!==void 0){if(T)continue;k=!1;break}if(N){if(!t(c,function(I,O){if(!n(N,O)&&(C===I||m(C,I,u,f,p)))return N.push(O)})){k=!1;break}}else if(!(C===R||m(C,R,u,f,p))){k=!1;break}}return p.delete(a),p.delete(c),k}return fy=o,fy}var hy,Q2;function GG(){if(Q2)return hy;Q2=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s,o){r[++n]=[o,s]}),r}return hy=e,hy}var py,J2;function Ob(){if(J2)return py;J2=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s){r[++n]=s}),r}return py=e,py}var my,Z2;function YG(){if(Z2)return my;Z2=1;var e=Fo(),t=LP(),n=qo(),r=WP(),s=GG(),o=Ob(),a=1,c=2,u="[object Boolean]",f="[object Date]",m="[object Error]",p="[object Map]",g="[object Number]",v="[object RegExp]",b="[object Set]",w="[object String]",x="[object Symbol]",S="[object ArrayBuffer]",k="[object DataView]",N=e?e.prototype:void 0,C=N?N.valueOf:void 0;function R(T,I,O,P,B,M,L){switch(O){case k:if(T.byteLength!=I.byteLength||T.byteOffset!=I.byteOffset)return!1;T=T.buffer,I=I.buffer;case S:return!(T.byteLength!=I.byteLength||!M(new t(T),new t(I)));case u:case f:case g:return n(+T,+I);case m:return T.name==I.name&&T.message==I.message;case v:case w:return T==I+"";case p:var U=s;case b:var $=P&a;if(U||(U=o),T.size!=I.size&&!$)return!1;var z=L.get(T);if(z)return z==I;P|=c,L.set(T,I);var V=r(U(T),U(I),P,B,M,L);return L.delete(T),V;case x:if(C)return C.call(T)==C.call(I)}return!1}return my=R,my}var gy,eE;function XG(){if(eE)return gy;eE=1;var e=OP(),t=1,n=Object.prototype,r=n.hasOwnProperty;function s(o,a,c,u,f,m){var p=c&t,g=e(o),v=g.length,b=e(a),w=b.length;if(v!=w&&!p)return!1;for(var x=v;x--;){var S=g[x];if(!(p?S in a:r.call(a,S)))return!1}var k=m.get(o),N=m.get(a);if(k&&N)return k==a&&N==o;var C=!0;m.set(o,a),m.set(a,o);for(var R=p;++x<v;){S=g[x];var T=o[S],I=a[S];if(u)var O=p?u(I,T,S,a,o,m):u(T,I,S,o,a,m);if(!(O===void 0?T===I||f(T,I,c,u,m):O)){C=!1;break}R||(R=S=="constructor")}if(C&&!R){var P=o.constructor,B=a.constructor;P!=B&&"constructor"in o&&"constructor"in a&&!(typeof P=="function"&&P instanceof P&&typeof B=="function"&&B instanceof B)&&(C=!1)}return m.delete(o),m.delete(a),C}return gy=s,gy}var yy,tE;function QG(){if(tE)return yy;tE=1;var e=cf(),t=WP(),n=YG(),r=XG(),s=zo(),o=yt(),a=Bo(),c=Hl(),u=1,f="[object Arguments]",m="[object Array]",p="[object Object]",g=Object.prototype,v=g.hasOwnProperty;function b(w,x,S,k,N,C){var R=o(w),T=o(x),I=R?m:s(w),O=T?m:s(x);I=I==f?p:I,O=O==f?p:O;var P=I==p,B=O==p,M=I==O;if(M&&a(w)){if(!a(x))return!1;R=!0,P=!1}if(M&&!P)return C||(C=new e),R||c(w)?t(w,x,S,k,N,C):n(w,x,I,S,k,N,C);if(!(S&u)){var L=P&&v.call(w,"__wrapped__"),U=B&&v.call(x,"__wrapped__");if(L||U){var $=L?w.value():w,z=U?x.value():x;return C||(C=new e),N($,z,S,k,C)}}return M?(C||(C=new e),r(w,x,S,k,N,C)):!1}return yy=b,yy}var vy,nE;function KP(){if(nE)return vy;nE=1;var e=QG(),t=xr();function n(r,s,o,a,c){return r===s?!0:r==null||s==null||!t(r)&&!t(s)?r!==r&&s!==s:e(r,s,o,a,n,c)}return vy=n,vy}var xy,rE;function JG(){if(rE)return xy;rE=1;var e=cf(),t=KP(),n=1,r=2;function s(o,a,c,u){var f=c.length,m=f,p=!u;if(o==null)return!m;for(o=Object(o);f--;){var g=c[f];if(p&&g[2]?g[1]!==o[g[0]]:!(g[0]in o))return!1}for(;++f<m;){g=c[f];var v=g[0],b=o[v],w=g[1];if(p&&g[2]){if(b===void 0&&!(v in o))return!1}else{var x=new e;if(u)var S=u(b,w,v,o,a,x);if(!(S===void 0?t(w,b,n|r,u,x):S))return!1}}return!0}return xy=s,xy}var wy,sE;function GP(){if(sE)return wy;sE=1;var e=Rn();function t(n){return n===n&&!e(n)}return wy=t,wy}var by,iE;function ZG(){if(iE)return by;iE=1;var e=GP(),t=Rs();function n(r){for(var s=t(r),o=s.length;o--;){var a=s[o],c=r[a];s[o]=[a,c,e(c)]}return s}return by=n,by}var Sy,oE;function YP(){if(oE)return Sy;oE=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return Sy=e,Sy}var _y,aE;function eY(){if(aE)return _y;aE=1;var e=JG(),t=ZG(),n=YP();function r(s){var o=t(s);return o.length==1&&o[0][2]?n(o[0][0],o[0][1]):function(a){return a===s||e(a,s,o)}}return _y=r,_y}var Ny,lE;function Vo(){if(lE)return Ny;lE=1;var e=hi(),t=xr(),n="[object Symbol]";function r(s){return typeof s=="symbol"||t(s)&&e(s)==n}return Ny=r,Ny}var ky,cE;function Pb(){if(cE)return ky;cE=1;var e=yt(),t=Vo(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function s(o,a){if(e(o))return!1;var c=typeof o;return c=="number"||c=="symbol"||c=="boolean"||o==null||t(o)?!0:r.test(o)||!n.test(o)||a!=null&&o in Object(a)}return ky=s,ky}var Cy,uE;function tY(){if(uE)return Cy;uE=1;var e=_b(),t="Expected a function";function n(r,s){if(typeof r!="function"||s!=null&&typeof s!="function")throw new TypeError(t);var o=function(){var a=arguments,c=s?s.apply(this,a):a[0],u=o.cache;if(u.has(c))return u.get(c);var f=r.apply(this,a);return o.cache=u.set(c,f)||u,f};return o.cache=new(n.Cache||e),o}return n.Cache=e,Cy=n,Cy}var Ey,dE;function nY(){if(dE)return Ey;dE=1;var e=tY(),t=500;function n(r){var s=e(r,function(a){return o.size===t&&o.clear(),a}),o=s.cache;return s}return Ey=n,Ey}var jy,fE;function rY(){if(fE)return jy;fE=1;var e=nY(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(s){var o=[];return s.charCodeAt(0)===46&&o.push(""),s.replace(t,function(a,c,u,f){o.push(u?f.replace(n,"$1"):c||a)}),o});return jy=r,jy}var Ry,hE;function yf(){if(hE)return Ry;hE=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,o=Array(s);++r<s;)o[r]=n(t[r],r,t);return o}return Ry=e,Ry}var Ty,pE;function sY(){if(pE)return Ty;pE=1;var e=Fo(),t=yf(),n=yt(),r=Vo(),s=e?e.prototype:void 0,o=s?s.toString:void 0;function a(c){if(typeof c=="string")return c;if(n(c))return t(c,a)+"";if(r(c))return o?o.call(c):"";var u=c+"";return u=="0"&&1/c==-1/0?"-0":u}return Ty=a,Ty}var Iy,mE;function XP(){if(mE)return Iy;mE=1;var e=sY();function t(n){return n==null?"":e(n)}return Iy=t,Iy}var Ay,gE;function vf(){if(gE)return Ay;gE=1;var e=yt(),t=Pb(),n=rY(),r=XP();function s(o,a){return e(o)?o:t(o,a)?[o]:n(r(o))}return Ay=s,Ay}var My,yE;function Wl(){if(yE)return My;yE=1;var e=Vo();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return My=t,My}var Oy,vE;function xf(){if(vE)return Oy;vE=1;var e=vf(),t=Wl();function n(r,s){s=e(s,r);for(var o=0,a=s.length;r!=null&&o<a;)r=r[t(s[o++])];return o&&o==a?r:void 0}return Oy=n,Oy}var Py,xE;function iY(){if(xE)return Py;xE=1;var e=xf();function t(n,r,s){var o=n==null?void 0:e(n,r);return o===void 0?s:o}return Py=t,Py}var Ly,wE;function oY(){if(wE)return Ly;wE=1;function e(t,n){return t!=null&&n in Object(t)}return Ly=e,Ly}var Dy,bE;function QP(){if(bE)return Dy;bE=1;var e=vf(),t=Ul(),n=yt(),r=ff(),s=kb(),o=Wl();function a(c,u,f){u=e(u,c);for(var m=-1,p=u.length,g=!1;++m<p;){var v=o(u[m]);if(!(g=c!=null&&f(c,v)))break;c=c[v]}return g||++m!=p?g:(p=c==null?0:c.length,!!p&&s(p)&&r(v,p)&&(n(c)||t(c)))}return Dy=a,Dy}var $y,SE;function JP(){if(SE)return $y;SE=1;var e=oY(),t=QP();function n(r,s){return r!=null&&t(r,s,e)}return $y=n,$y}var qy,_E;function aY(){if(_E)return qy;_E=1;var e=KP(),t=iY(),n=JP(),r=Pb(),s=GP(),o=YP(),a=Wl(),c=1,u=2;function f(m,p){return r(m)&&s(p)?o(a(m),p):function(g){var v=t(g,m);return v===void 0&&v===p?n(g,m):e(p,v,c|u)}}return qy=f,qy}var Fy,NE;function ZP(){if(NE)return Fy;NE=1;function e(t){return function(n){return n==null?void 0:n[t]}}return Fy=e,Fy}var By,kE;function lY(){if(kE)return By;kE=1;var e=xf();function t(n){return function(r){return e(r,n)}}return By=t,By}var zy,CE;function cY(){if(CE)return zy;CE=1;var e=ZP(),t=lY(),n=Pb(),r=Wl();function s(o){return n(o)?e(r(o)):t(o)}return zy=s,zy}var Vy,EE;function Wr(){if(EE)return Vy;EE=1;var e=eY(),t=aY(),n=gi(),r=yt(),s=cY();function o(a){return typeof a=="function"?a:a==null?n:typeof a=="object"?r(a)?t(a[0],a[1]):e(a):s(a)}return Vy=o,Vy}var Uy,jE;function eL(){if(jE)return Uy;jE=1;var e=TP(),t=UG(),n=Wr(),r=yt();function s(o,a){var c=r(o)?e:t;return c(o,n(a,3))}return Uy=s,Uy}var Hy,RE;function uY(){if(RE)return Hy;RE=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,s){return r!=null&&t.call(r,s)}return Hy=n,Hy}var Wy,TE;function tL(){if(TE)return Wy;TE=1;var e=uY(),t=QP();function n(r,s){return r!=null&&t(r,s,e)}return Wy=n,Wy}var Ky,IE;function dY(){if(IE)return Ky;IE=1;var e=Eb(),t=zo(),n=Ul(),r=yt(),s=Hr(),o=Bo(),a=pf(),c=Hl(),u="[object Map]",f="[object Set]",m=Object.prototype,p=m.hasOwnProperty;function g(v){if(v==null)return!0;if(s(v)&&(r(v)||typeof v=="string"||typeof v.splice=="function"||o(v)||c(v)||n(v)))return!v.length;var b=t(v);if(b==u||b==f)return!v.size;if(a(v))return!e(v).length;for(var w in v)if(p.call(v,w))return!1;return!0}return Ky=g,Ky}var Gy,AE;function nL(){if(AE)return Gy;AE=1;function e(t){return t===void 0}return Gy=e,Gy}var Yy,ME;function rL(){if(ME)return Yy;ME=1;var e=gf(),t=Hr();function n(r,s){var o=-1,a=t(r)?Array(r.length):[];return e(r,function(c,u,f){a[++o]=s(c,u,f)}),a}return Yy=n,Yy}var Xy,OE;function sL(){if(OE)return Xy;OE=1;var e=yf(),t=Wr(),n=rL(),r=yt();function s(o,a){var c=r(o)?e:n;return c(o,t(a,3))}return Xy=s,Xy}var Qy,PE;function fY(){if(PE)return Qy;PE=1;function e(t,n,r,s){var o=-1,a=t==null?0:t.length;for(s&&a&&(r=t[++o]);++o<a;)r=n(r,t[o],o,t);return r}return Qy=e,Qy}var Jy,LE;function hY(){if(LE)return Jy;LE=1;function e(t,n,r,s,o){return o(t,function(a,c,u){r=s?(s=!1,a):n(r,a,c,u)}),r}return Jy=e,Jy}var Zy,DE;function iL(){if(DE)return Zy;DE=1;var e=fY(),t=gf(),n=Wr(),r=hY(),s=yt();function o(a,c,u){var f=s(a)?e:r,m=arguments.length<3;return f(a,n(c,4),u,m,t)}return Zy=o,Zy}var ev,$E;function pY(){if($E)return ev;$E=1;var e=hi(),t=yt(),n=xr(),r="[object String]";function s(o){return typeof o=="string"||!t(o)&&n(o)&&e(o)==r}return ev=s,ev}var tv,qE;function mY(){if(qE)return tv;qE=1;var e=ZP(),t=e("length");return tv=t,tv}var nv,FE;function gY(){if(FE)return nv;FE=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,o="\\ufe0e\\ufe0f",a="\\u200d",c=RegExp("["+a+e+s+o+"]");function u(f){return c.test(f)}return nv=u,nv}var rv,BE;function yY(){if(BE)return rv;BE=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,o="\\ufe0e\\ufe0f",a="["+e+"]",c="["+s+"]",u="\\ud83c[\\udffb-\\udfff]",f="(?:"+c+"|"+u+")",m="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",b=f+"?",w="["+o+"]?",x="(?:"+v+"(?:"+[m,p,g].join("|")+")"+w+b+")*",S=w+b+x,k="(?:"+[m+c+"?",c,p,g,a].join("|")+")",N=RegExp(u+"(?="+u+")|"+k+S,"g");function C(R){for(var T=N.lastIndex=0;N.test(R);)++T;return T}return rv=C,rv}var sv,zE;function vY(){if(zE)return sv;zE=1;var e=mY(),t=gY(),n=yY();function r(s){return t(s)?n(s):e(s)}return sv=r,sv}var iv,VE;function xY(){if(VE)return iv;VE=1;var e=Eb(),t=zo(),n=Hr(),r=pY(),s=vY(),o="[object Map]",a="[object Set]";function c(u){if(u==null)return 0;if(n(u))return r(u)?s(u):u.length;var f=t(u);return f==o||f==a?u.size:e(u).length}return iv=c,iv}var ov,UE;function wY(){if(UE)return ov;UE=1;var e=Nb(),t=$P(),n=Mb(),r=Wr(),s=mf(),o=yt(),a=Bo(),c=zl(),u=Rn(),f=Hl();function m(p,g,v){var b=o(p),w=b||a(p)||f(p);if(g=r(g,4),v==null){var x=p&&p.constructor;w?v=b?new x:[]:u(p)?v=c(x)?t(s(p)):{}:v={}}return(w?e:n)(p,function(S,k,N){return g(v,S,k,N)}),v}return ov=m,ov}var av,HE;function bY(){if(HE)return av;HE=1;var e=Fo(),t=Ul(),n=yt(),r=e?e.isConcatSpreadable:void 0;function s(o){return n(o)||t(o)||!!(r&&o&&o[r])}return av=s,av}var lv,WE;function Lb(){if(WE)return lv;WE=1;var e=Rb(),t=bY();function n(r,s,o,a,c){var u=-1,f=r.length;for(o||(o=t),c||(c=[]);++u<f;){var m=r[u];s>0&&o(m)?s>1?n(m,s-1,o,a,c):e(c,m):a||(c[c.length]=m)}return c}return lv=n,lv}var cv,KE;function SY(){if(KE)return cv;KE=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return cv=e,cv}var uv,GE;function oL(){if(GE)return uv;GE=1;var e=SY(),t=Math.max;function n(r,s,o){return s=t(s===void 0?r.length-1:s,0),function(){for(var a=arguments,c=-1,u=t(a.length-s,0),f=Array(u);++c<u;)f[c]=a[s+c];c=-1;for(var m=Array(s+1);++c<s;)m[c]=a[c];return m[s]=o(f),e(r,this,m)}}return uv=n,uv}var dv,YE;function _Y(){if(YE)return dv;YE=1;var e=Ib(),t=kP(),n=gi(),r=t?function(s,o){return t(s,"toString",{configurable:!0,enumerable:!1,value:e(o),writable:!0})}:n;return dv=r,dv}var fv,XE;function NY(){if(XE)return fv;XE=1;var e=800,t=16,n=Date.now;function r(s){var o=0,a=0;return function(){var c=n(),u=t-(c-a);if(a=c,u>0){if(++o>=e)return arguments[0]}else o=0;return s.apply(void 0,arguments)}}return fv=r,fv}var hv,QE;function aL(){if(QE)return hv;QE=1;var e=_Y(),t=NY(),n=t(e);return hv=n,hv}var pv,JE;function wf(){if(JE)return pv;JE=1;var e=gi(),t=oL(),n=aL();function r(s,o){return n(t(s,o,e),s+"")}return pv=r,pv}var mv,ZE;function lL(){if(ZE)return mv;ZE=1;function e(t,n,r,s){for(var o=t.length,a=r+(s?1:-1);s?a--:++a<o;)if(n(t[a],a,t))return a;return-1}return mv=e,mv}var gv,ej;function kY(){if(ej)return gv;ej=1;function e(t){return t!==t}return gv=e,gv}var yv,tj;function CY(){if(tj)return yv;tj=1;function e(t,n,r){for(var s=r-1,o=t.length;++s<o;)if(t[s]===n)return s;return-1}return yv=e,yv}var vv,nj;function EY(){if(nj)return vv;nj=1;var e=lL(),t=kY(),n=CY();function r(s,o,a){return o===o?n(s,o,a):e(s,t,a)}return vv=r,vv}var xv,rj;function jY(){if(rj)return xv;rj=1;var e=EY();function t(n,r){var s=n==null?0:n.length;return!!s&&e(n,r,0)>-1}return xv=t,xv}var wv,sj;function RY(){if(sj)return wv;sj=1;function e(t,n,r){for(var s=-1,o=t==null?0:t.length;++s<o;)if(r(n,t[s]))return!0;return!1}return wv=e,wv}var bv,ij;function TY(){if(ij)return bv;ij=1;function e(){}return bv=e,bv}var Sv,oj;function IY(){if(oj)return Sv;oj=1;var e=PP(),t=TY(),n=Ob(),r=1/0,s=e&&1/n(new e([,-0]))[1]==r?function(o){return new e(o)}:t;return Sv=s,Sv}var _v,aj;function AY(){if(aj)return _v;aj=1;var e=UP(),t=jY(),n=RY(),r=HP(),s=IY(),o=Ob(),a=200;function c(u,f,m){var p=-1,g=t,v=u.length,b=!0,w=[],x=w;if(m)b=!1,g=n;else if(v>=a){var S=f?null:s(u);if(S)return o(S);b=!1,g=r,x=new e}else x=f?[]:w;e:for(;++p<v;){var k=u[p],N=f?f(k):k;if(k=m||k!==0?k:0,b&&N===N){for(var C=x.length;C--;)if(x[C]===N)continue e;f&&x.push(N),w.push(k)}else g(x,N,m)||(x!==w&&x.push(N),w.push(k))}return w}return _v=c,_v}var Nv,lj;function cL(){if(lj)return Nv;lj=1;var e=Hr(),t=xr();function n(r){return t(r)&&e(r)}return Nv=n,Nv}var kv,cj;function MY(){if(cj)return kv;cj=1;var e=Lb(),t=wf(),n=AY(),r=cL(),s=t(function(o){return n(e(o,1,r,!0))});return kv=s,kv}var Cv,uj;function OY(){if(uj)return Cv;uj=1;var e=yf();function t(n,r){return e(r,function(s){return n[s]})}return Cv=t,Cv}var Ev,dj;function uL(){if(dj)return Ev;dj=1;var e=OY(),t=Rs();function n(r){return r==null?[]:e(r,t(r))}return Ev=n,Ev}var jv,fj;function Tn(){if(fj)return jv;fj=1;var e;if(typeof bb=="function")try{e={clone:BG(),constant:Ib(),each:VP(),filter:eL(),has:tL(),isArray:yt(),isEmpty:dY(),isFunction:zl(),isUndefined:nL(),keys:Rs(),map:sL(),reduce:iL(),size:xY(),transform:wY(),union:MY(),values:uL()}}catch{}return e||(e=window._),jv=e,jv}var Rv,hj;function Db(){if(hj)return Rv;hj=1;var e=Tn();Rv=s;var t="\0",n="\0",r="";function s(m){this._isDirected=e.has(m,"directed")?m.directed:!0,this._isMultigraph=e.has(m,"multigraph")?m.multigraph:!1,this._isCompound=e.has(m,"compound")?m.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[n]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(m){return this._label=m,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(m){return e.isFunction(m)||(m=e.constant(m)),this._defaultNodeLabelFn=m,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return e.keys(this._nodes)},s.prototype.sources=function(){var m=this;return e.filter(this.nodes(),function(p){return e.isEmpty(m._in[p])})},s.prototype.sinks=function(){var m=this;return e.filter(this.nodes(),function(p){return e.isEmpty(m._out[p])})},s.prototype.setNodes=function(m,p){var g=arguments,v=this;return e.each(m,function(b){g.length>1?v.setNode(b,p):v.setNode(b)}),this},s.prototype.setNode=function(m,p){return e.has(this._nodes,m)?(arguments.length>1&&(this._nodes[m]=p),this):(this._nodes[m]=arguments.length>1?p:this._defaultNodeLabelFn(m),this._isCompound&&(this._parent[m]=n,this._children[m]={},this._children[n][m]=!0),this._in[m]={},this._preds[m]={},this._out[m]={},this._sucs[m]={},++this._nodeCount,this)},s.prototype.node=function(m){return this._nodes[m]},s.prototype.hasNode=function(m){return e.has(this._nodes,m)},s.prototype.removeNode=function(m){var p=this;if(e.has(this._nodes,m)){var g=function(v){p.removeEdge(p._edgeObjs[v])};delete this._nodes[m],this._isCompound&&(this._removeFromParentsChildList(m),delete this._parent[m],e.each(this.children(m),function(v){p.setParent(v)}),delete this._children[m]),e.each(e.keys(this._in[m]),g),delete this._in[m],delete this._preds[m],e.each(e.keys(this._out[m]),g),delete this._out[m],delete this._sucs[m],--this._nodeCount}return this},s.prototype.setParent=function(m,p){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(p))p=n;else{p+="";for(var g=p;!e.isUndefined(g);g=this.parent(g))if(g===m)throw new Error("Setting "+p+" as parent of "+m+" would create a cycle");this.setNode(p)}return this.setNode(m),this._removeFromParentsChildList(m),this._parent[m]=p,this._children[p][m]=!0,this},s.prototype._removeFromParentsChildList=function(m){delete this._children[this._parent[m]][m]},s.prototype.parent=function(m){if(this._isCompound){var p=this._parent[m];if(p!==n)return p}},s.prototype.children=function(m){if(e.isUndefined(m)&&(m=n),this._isCompound){var p=this._children[m];if(p)return e.keys(p)}else{if(m===n)return this.nodes();if(this.hasNode(m))return[]}},s.prototype.predecessors=function(m){var p=this._preds[m];if(p)return e.keys(p)},s.prototype.successors=function(m){var p=this._sucs[m];if(p)return e.keys(p)},s.prototype.neighbors=function(m){var p=this.predecessors(m);if(p)return e.union(p,this.successors(m))},s.prototype.isLeaf=function(m){var p;return this.isDirected()?p=this.successors(m):p=this.neighbors(m),p.length===0},s.prototype.filterNodes=function(m){var p=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});p.setGraph(this.graph());var g=this;e.each(this._nodes,function(w,x){m(x)&&p.setNode(x,w)}),e.each(this._edgeObjs,function(w){p.hasNode(w.v)&&p.hasNode(w.w)&&p.setEdge(w,g.edge(w))});var v={};function b(w){var x=g.parent(w);return x===void 0||p.hasNode(x)?(v[w]=x,x):x in v?v[x]:b(x)}return this._isCompound&&e.each(p.nodes(),function(w){p.setParent(w,b(w))}),p},s.prototype.setDefaultEdgeLabel=function(m){return e.isFunction(m)||(m=e.constant(m)),this._defaultEdgeLabelFn=m,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return e.values(this._edgeObjs)},s.prototype.setPath=function(m,p){var g=this,v=arguments;return e.reduce(m,function(b,w){return v.length>1?g.setEdge(b,w,p):g.setEdge(b,w),w}),this},s.prototype.setEdge=function(){var m,p,g,v,b=!1,w=arguments[0];typeof w=="object"&&w!==null&&"v"in w?(m=w.v,p=w.w,g=w.name,arguments.length===2&&(v=arguments[1],b=!0)):(m=w,p=arguments[1],g=arguments[3],arguments.length>2&&(v=arguments[2],b=!0)),m=""+m,p=""+p,e.isUndefined(g)||(g=""+g);var x=c(this._isDirected,m,p,g);if(e.has(this._edgeLabels,x))return b&&(this._edgeLabels[x]=v),this;if(!e.isUndefined(g)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(m),this.setNode(p),this._edgeLabels[x]=b?v:this._defaultEdgeLabelFn(m,p,g);var S=u(this._isDirected,m,p,g);return m=S.v,p=S.w,Object.freeze(S),this._edgeObjs[x]=S,o(this._preds[p],m),o(this._sucs[m],p),this._in[p][x]=S,this._out[m][x]=S,this._edgeCount++,this},s.prototype.edge=function(m,p,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):c(this._isDirected,m,p,g);return this._edgeLabels[v]},s.prototype.hasEdge=function(m,p,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):c(this._isDirected,m,p,g);return e.has(this._edgeLabels,v)},s.prototype.removeEdge=function(m,p,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):c(this._isDirected,m,p,g),b=this._edgeObjs[v];return b&&(m=b.v,p=b.w,delete this._edgeLabels[v],delete this._edgeObjs[v],a(this._preds[p],m),a(this._sucs[m],p),delete this._in[p][v],delete this._out[m][v],this._edgeCount--),this},s.prototype.inEdges=function(m,p){var g=this._in[m];if(g){var v=e.values(g);return p?e.filter(v,function(b){return b.v===p}):v}},s.prototype.outEdges=function(m,p){var g=this._out[m];if(g){var v=e.values(g);return p?e.filter(v,function(b){return b.w===p}):v}},s.prototype.nodeEdges=function(m,p){var g=this.inEdges(m,p);if(g)return g.concat(this.outEdges(m,p))};function o(m,p){m[p]?m[p]++:m[p]=1}function a(m,p){--m[p]||delete m[p]}function c(m,p,g,v){var b=""+p,w=""+g;if(!m&&b>w){var x=b;b=w,w=x}return b+r+w+r+(e.isUndefined(v)?t:v)}function u(m,p,g,v){var b=""+p,w=""+g;if(!m&&b>w){var x=b;b=w,w=x}var S={v:b,w};return v&&(S.name=v),S}function f(m,p){return c(m,p.v,p.w,p.name)}return Rv}var Tv,pj;function PY(){return pj||(pj=1,Tv="2.1.8"),Tv}var Iv,mj;function LY(){return mj||(mj=1,Iv={Graph:Db(),version:PY()}),Iv}var Av,gj;function DY(){if(gj)return Av;gj=1;var e=Tn(),t=Db();Av={write:n,read:o};function n(a){var c={options:{directed:a.isDirected(),multigraph:a.isMultigraph(),compound:a.isCompound()},nodes:r(a),edges:s(a)};return e.isUndefined(a.graph())||(c.value=e.clone(a.graph())),c}function r(a){return e.map(a.nodes(),function(c){var u=a.node(c),f=a.parent(c),m={v:c};return e.isUndefined(u)||(m.value=u),e.isUndefined(f)||(m.parent=f),m})}function s(a){return e.map(a.edges(),function(c){var u=a.edge(c),f={v:c.v,w:c.w};return e.isUndefined(c.name)||(f.name=c.name),e.isUndefined(u)||(f.value=u),f})}function o(a){var c=new t(a.options).setGraph(a.value);return e.each(a.nodes,function(u){c.setNode(u.v,u.value),u.parent&&c.setParent(u.v,u.parent)}),e.each(a.edges,function(u){c.setEdge({v:u.v,w:u.w,name:u.name},u.value)}),c}return Av}var Mv,yj;function $Y(){if(yj)return Mv;yj=1;var e=Tn();Mv=t;function t(n){var r={},s=[],o;function a(c){e.has(r,c)||(r[c]=!0,o.push(c),e.each(n.successors(c),a),e.each(n.predecessors(c),a))}return e.each(n.nodes(),function(c){o=[],a(c),o.length&&s.push(o)}),s}return Mv}var Ov,vj;function dL(){if(vj)return Ov;vj=1;var e=Tn();Ov=t;function t(){this._arr=[],this._keyIndices={}}return t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map(function(n){return n.key})},t.prototype.has=function(n){return e.has(this._keyIndices,n)},t.prototype.priority=function(n){var r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority},t.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(n,r){var s=this._keyIndices;if(n=String(n),!e.has(s,n)){var o=this._arr,a=o.length;return s[n]=a,o.push({key:n,priority:r}),this._decrease(a),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key},t.prototype.decrease=function(n,r){var s=this._keyIndices[n];if(r>this._arr[s].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[s].priority+" New: "+r);this._arr[s].priority=r,this._decrease(s)},t.prototype._heapify=function(n){var r=this._arr,s=2*n,o=s+1,a=n;s<r.length&&(a=r[s].priority<r[a].priority?s:a,o<r.length&&(a=r[o].priority<r[a].priority?o:a),a!==n&&(this._swap(n,a),this._heapify(a)))},t.prototype._decrease=function(n){for(var r=this._arr,s=r[n].priority,o;n!==0&&(o=n>>1,!(r[o].priority<s));)this._swap(n,o),n=o},t.prototype._swap=function(n,r){var s=this._arr,o=this._keyIndices,a=s[n],c=s[r];s[n]=c,s[r]=a,o[c.key]=n,o[a.key]=r},Ov}var Pv,xj;function fL(){if(xj)return Pv;xj=1;var e=Tn(),t=dL();Pv=r;var n=e.constant(1);function r(o,a,c,u){return s(o,String(a),c||n,u||function(f){return o.outEdges(f)})}function s(o,a,c,u){var f={},m=new t,p,g,v=function(b){var w=b.v!==p?b.v:b.w,x=f[w],S=c(b),k=g.distance+S;if(S<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+b+" Weight: "+S);k<x.distance&&(x.distance=k,x.predecessor=p,m.decrease(w,k))};for(o.nodes().forEach(function(b){var w=b===a?0:Number.POSITIVE_INFINITY;f[b]={distance:w},m.add(b,w)});m.size()>0&&(p=m.removeMin(),g=f[p],g.distance!==Number.POSITIVE_INFINITY);)u(p).forEach(v);return f}return Pv}var Lv,wj;function qY(){if(wj)return Lv;wj=1;var e=fL(),t=Tn();Lv=n;function n(r,s,o){return t.transform(r.nodes(),function(a,c){a[c]=e(r,c,s,o)},{})}return Lv}var Dv,bj;function hL(){if(bj)return Dv;bj=1;var e=Tn();Dv=t;function t(n){var r=0,s=[],o={},a=[];function c(u){var f=o[u]={onStack:!0,lowlink:r,index:r++};if(s.push(u),n.successors(u).forEach(function(g){e.has(o,g)?o[g].onStack&&(f.lowlink=Math.min(f.lowlink,o[g].index)):(c(g),f.lowlink=Math.min(f.lowlink,o[g].lowlink))}),f.lowlink===f.index){var m=[],p;do p=s.pop(),o[p].onStack=!1,m.push(p);while(u!==p);a.push(m)}}return n.nodes().forEach(function(u){e.has(o,u)||c(u)}),a}return Dv}var $v,Sj;function FY(){if(Sj)return $v;Sj=1;var e=Tn(),t=hL();$v=n;function n(r){return e.filter(t(r),function(s){return s.length>1||s.length===1&&r.hasEdge(s[0],s[0])})}return $v}var qv,_j;function BY(){if(_j)return qv;_j=1;var e=Tn();qv=n;var t=e.constant(1);function n(s,o,a){return r(s,o||t,a||function(c){return s.outEdges(c)})}function r(s,o,a){var c={},u=s.nodes();return u.forEach(function(f){c[f]={},c[f][f]={distance:0},u.forEach(function(m){f!==m&&(c[f][m]={distance:Number.POSITIVE_INFINITY})}),a(f).forEach(function(m){var p=m.v===f?m.w:m.v,g=o(m);c[f][p]={distance:g,predecessor:f}})}),u.forEach(function(f){var m=c[f];u.forEach(function(p){var g=c[p];u.forEach(function(v){var b=g[f],w=m[v],x=g[v],S=b.distance+w.distance;S<x.distance&&(x.distance=S,x.predecessor=w.predecessor)})})}),c}return qv}var Fv,Nj;function pL(){if(Nj)return Fv;Nj=1;var e=Tn();Fv=t,t.CycleException=n;function t(r){var s={},o={},a=[];function c(u){if(e.has(o,u))throw new n;e.has(s,u)||(o[u]=!0,s[u]=!0,e.each(r.predecessors(u),c),delete o[u],a.push(u))}if(e.each(r.sinks(),c),e.size(s)!==r.nodeCount())throw new n;return a}function n(){}return n.prototype=new Error,Fv}var Bv,kj;function zY(){if(kj)return Bv;kj=1;var e=pL();Bv=t;function t(n){try{e(n)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}return Bv}var zv,Cj;function mL(){if(Cj)return zv;Cj=1;var e=Tn();zv=t;function t(r,s,o){e.isArray(s)||(s=[s]);var a=(r.isDirected()?r.successors:r.neighbors).bind(r),c=[],u={};return e.each(s,function(f){if(!r.hasNode(f))throw new Error("Graph does not have node: "+f);n(r,f,o==="post",u,a,c)}),c}function n(r,s,o,a,c,u){e.has(a,s)||(a[s]=!0,o||u.push(s),e.each(c(s),function(f){n(r,f,o,a,c,u)}),o&&u.push(s))}return zv}var Vv,Ej;function VY(){if(Ej)return Vv;Ej=1;var e=mL();Vv=t;function t(n,r){return e(n,r,"post")}return Vv}var Uv,jj;function UY(){if(jj)return Uv;jj=1;var e=mL();Uv=t;function t(n,r){return e(n,r,"pre")}return Uv}var Hv,Rj;function HY(){if(Rj)return Hv;Rj=1;var e=Tn(),t=Db(),n=dL();Hv=r;function r(s,o){var a=new t,c={},u=new n,f;function m(g){var v=g.v===f?g.w:g.v,b=u.priority(v);if(b!==void 0){var w=o(g);w<b&&(c[v]=f,u.decrease(v,w))}}if(s.nodeCount()===0)return a;e.each(s.nodes(),function(g){u.add(g,Number.POSITIVE_INFINITY),a.setNode(g)}),u.decrease(s.nodes()[0],0);for(var p=!1;u.size()>0;){if(f=u.removeMin(),e.has(c,f))a.setEdge(f,c[f]);else{if(p)throw new Error("Input graph is not connected: "+s);p=!0}s.nodeEdges(f).forEach(m)}return a}return Hv}var Wv,Tj;function WY(){return Tj||(Tj=1,Wv={components:$Y(),dijkstra:fL(),dijkstraAll:qY(),findCycles:FY(),floydWarshall:BY(),isAcyclic:zY(),postorder:VY(),preorder:UY(),prim:HY(),tarjan:hL(),topsort:pL()}),Wv}var Kv,Ij;function KY(){if(Ij)return Kv;Ij=1;var e=LY();return Kv={Graph:e.Graph,json:DY(),alg:WY(),version:e.version},Kv}var Gv,Aj;function Wn(){if(Aj)return Gv;Aj=1;var e;if(typeof bb=="function")try{e=KY()}catch{}return e||(e=window.graphlib),Gv=e,Gv}var Yv,Mj;function GY(){if(Mj)return Yv;Mj=1;var e=FP(),t=1,n=4;function r(s){return e(s,t|n)}return Yv=r,Yv}var Xv,Oj;function bf(){if(Oj)return Xv;Oj=1;var e=qo(),t=Hr(),n=ff(),r=Rn();function s(o,a,c){if(!r(c))return!1;var u=typeof a;return(u=="number"?t(c)&&n(a,c.length):u=="string"&&a in c)?e(c[a],o):!1}return Xv=s,Xv}var Qv,Pj;function YY(){if(Pj)return Qv;Pj=1;var e=wf(),t=qo(),n=bf(),r=mi(),s=Object.prototype,o=s.hasOwnProperty,a=e(function(c,u){c=Object(c);var f=-1,m=u.length,p=m>2?u[2]:void 0;for(p&&n(u[0],u[1],p)&&(m=1);++f<m;)for(var g=u[f],v=r(g),b=-1,w=v.length;++b<w;){var x=v[b],S=c[x];(S===void 0||t(S,s[x])&&!o.call(c,x))&&(c[x]=g[x])}return c});return Qv=a,Qv}var Jv,Lj;function XY(){if(Lj)return Jv;Lj=1;var e=Wr(),t=Hr(),n=Rs();function r(s){return function(o,a,c){var u=Object(o);if(!t(o)){var f=e(a,3);o=n(o),a=function(p){return f(u[p],p,u)}}var m=s(o,a,c);return m>-1?u[f?o[m]:m]:void 0}}return Jv=r,Jv}var Zv,Dj;function QY(){if(Dj)return Zv;Dj=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Zv=t,Zv}var ex,$j;function JY(){if($j)return ex;$j=1;var e=QY(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return ex=n,ex}var tx,qj;function ZY(){if(qj)return tx;qj=1;var e=JY(),t=Rn(),n=Vo(),r=NaN,s=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,c=parseInt;function u(f){if(typeof f=="number")return f;if(n(f))return r;if(t(f)){var m=typeof f.valueOf=="function"?f.valueOf():f;f=t(m)?m+"":m}if(typeof f!="string")return f===0?f:+f;f=e(f);var p=o.test(f);return p||a.test(f)?c(f.slice(2),p?2:8):s.test(f)?r:+f}return tx=u,tx}var nx,Fj;function gL(){if(Fj)return nx;Fj=1;var e=ZY(),t=1/0,n=17976931348623157e292;function r(s){if(!s)return s===0?s:0;if(s=e(s),s===t||s===-t){var o=s<0?-1:1;return o*n}return s===s?s:0}return nx=r,nx}var rx,Bj;function eX(){if(Bj)return rx;Bj=1;var e=gL();function t(n){var r=e(n),s=r%1;return r===r?s?r-s:r:0}return rx=t,rx}var sx,zj;function tX(){if(zj)return sx;zj=1;var e=lL(),t=Wr(),n=eX(),r=Math.max;function s(o,a,c){var u=o==null?0:o.length;if(!u)return-1;var f=c==null?0:n(c);return f<0&&(f=r(u+f,0)),e(o,t(a,3),f)}return sx=s,sx}var ix,Vj;function nX(){if(Vj)return ix;Vj=1;var e=XY(),t=tX(),n=e(t);return ix=n,ix}var ox,Uj;function yL(){if(Uj)return ox;Uj=1;var e=Lb();function t(n){var r=n==null?0:n.length;return r?e(n,1):[]}return ox=t,ox}var ax,Hj;function rX(){if(Hj)return ax;Hj=1;var e=Ab(),t=BP(),n=mi();function r(s,o){return s==null?s:e(s,t(o),n)}return ax=r,ax}var lx,Wj;function sX(){if(Wj)return lx;Wj=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return lx=e,lx}var cx,Kj;function iX(){if(Kj)return cx;Kj=1;var e=uf(),t=Mb(),n=Wr();function r(s,o){var a={};return o=n(o,3),t(s,function(c,u,f){e(a,u,o(c,u,f))}),a}return cx=r,cx}var ux,Gj;function $b(){if(Gj)return ux;Gj=1;var e=Vo();function t(n,r,s){for(var o=-1,a=n.length;++o<a;){var c=n[o],u=r(c);if(u!=null&&(f===void 0?u===u&&!e(u):s(u,f)))var f=u,m=c}return m}return ux=t,ux}var dx,Yj;function oX(){if(Yj)return dx;Yj=1;function e(t,n){return t>n}return dx=e,dx}var fx,Xj;function aX(){if(Xj)return fx;Xj=1;var e=$b(),t=oX(),n=gi();function r(s){return s&&s.length?e(s,n,t):void 0}return fx=r,fx}var hx,Qj;function vL(){if(Qj)return hx;Qj=1;var e=uf(),t=qo();function n(r,s,o){(o!==void 0&&!t(r[s],o)||o===void 0&&!(s in r))&&e(r,s,o)}return hx=n,hx}var px,Jj;function lX(){if(Jj)return px;Jj=1;var e=hi(),t=mf(),n=xr(),r="[object Object]",s=Function.prototype,o=Object.prototype,a=s.toString,c=o.hasOwnProperty,u=a.call(Object);function f(m){if(!n(m)||e(m)!=r)return!1;var p=t(m);if(p===null)return!0;var g=c.call(p,"constructor")&&p.constructor;return typeof g=="function"&&g instanceof g&&a.call(g)==u}return px=f,px}var mx,Zj;function xL(){if(Zj)return mx;Zj=1;function e(t,n){if(!(n==="constructor"&&typeof t[n]=="function")&&n!="__proto__")return t[n]}return mx=e,mx}var gx,eR;function cX(){if(eR)return gx;eR=1;var e=Vl(),t=mi();function n(r){return e(r,t(r))}return gx=n,gx}var yx,tR;function uX(){if(tR)return yx;tR=1;var e=vL(),t=jP(),n=DP(),r=RP(),s=qP(),o=Ul(),a=yt(),c=cL(),u=Bo(),f=zl(),m=Rn(),p=lX(),g=Hl(),v=xL(),b=cX();function w(x,S,k,N,C,R,T){var I=v(x,k),O=v(S,k),P=T.get(O);if(P){e(x,k,P);return}var B=R?R(I,O,k+"",x,S,T):void 0,M=B===void 0;if(M){var L=a(O),U=!L&&u(O),$=!L&&!U&&g(O);B=O,L||U||$?a(I)?B=I:c(I)?B=r(I):U?(M=!1,B=t(O,!0)):$?(M=!1,B=n(O,!0)):B=[]:p(O)||o(O)?(B=I,o(I)?B=b(I):(!m(I)||f(I))&&(B=s(O))):M=!1}M&&(T.set(O,B),C(B,O,N,R,T),T.delete(O)),e(x,k,B)}return yx=w,yx}var vx,nR;function dX(){if(nR)return vx;nR=1;var e=cf(),t=vL(),n=Ab(),r=uX(),s=Rn(),o=mi(),a=xL();function c(u,f,m,p,g){u!==f&&n(f,function(v,b){if(g||(g=new e),s(v))r(u,f,b,m,c,p,g);else{var w=p?p(a(u,b),v,b+"",u,f,g):void 0;w===void 0&&(w=v),t(u,b,w)}},o)}return vx=c,vx}var xx,rR;function fX(){if(rR)return xx;rR=1;var e=wf(),t=bf();function n(r){return e(function(s,o){var a=-1,c=o.length,u=c>1?o[c-1]:void 0,f=c>2?o[2]:void 0;for(u=r.length>3&&typeof u=="function"?(c--,u):void 0,f&&t(o[0],o[1],f)&&(u=c<3?void 0:u,c=1),s=Object(s);++a<c;){var m=o[a];m&&r(s,m,a,u)}return s})}return xx=n,xx}var wx,sR;function hX(){if(sR)return wx;sR=1;var e=dX(),t=fX(),n=t(function(r,s,o){e(r,s,o)});return wx=n,wx}var bx,iR;function wL(){if(iR)return bx;iR=1;function e(t,n){return t<n}return bx=e,bx}var Sx,oR;function pX(){if(oR)return Sx;oR=1;var e=$b(),t=wL(),n=gi();function r(s){return s&&s.length?e(s,n,t):void 0}return Sx=r,Sx}var _x,aR;function mX(){if(aR)return _x;aR=1;var e=$b(),t=Wr(),n=wL();function r(s,o){return s&&s.length?e(s,t(o,2),n):void 0}return _x=r,_x}var Nx,lR;function gX(){if(lR)return Nx;lR=1;var e=Xn(),t=function(){return e.Date.now()};return Nx=t,Nx}var kx,cR;function yX(){if(cR)return kx;cR=1;var e=df(),t=vf(),n=ff(),r=Rn(),s=Wl();function o(a,c,u,f){if(!r(a))return a;c=t(c,a);for(var m=-1,p=c.length,g=p-1,v=a;v!=null&&++m<p;){var b=s(c[m]),w=u;if(b==="__proto__"||b==="constructor"||b==="prototype")return a;if(m!=g){var x=v[b];w=f?f(x,b,v):void 0,w===void 0&&(w=r(x)?x:n(c[m+1])?[]:{})}e(v,b,w),v=v[b]}return a}return kx=o,kx}var Cx,uR;function vX(){if(uR)return Cx;uR=1;var e=xf(),t=yX(),n=vf();function r(s,o,a){for(var c=-1,u=o.length,f={};++c<u;){var m=o[c],p=e(s,m);a(p,m)&&t(f,n(m,s),p)}return f}return Cx=r,Cx}var Ex,dR;function xX(){if(dR)return Ex;dR=1;var e=vX(),t=JP();function n(r,s){return e(r,s,function(o,a){return t(r,a)})}return Ex=n,Ex}var jx,fR;function wX(){if(fR)return jx;fR=1;var e=yL(),t=oL(),n=aL();function r(s){return n(t(s,void 0,e),s+"")}return jx=r,jx}var Rx,hR;function bX(){if(hR)return Rx;hR=1;var e=xX(),t=wX(),n=t(function(r,s){return r==null?{}:e(r,s)});return Rx=n,Rx}var Tx,pR;function SX(){if(pR)return Tx;pR=1;var e=Math.ceil,t=Math.max;function n(r,s,o,a){for(var c=-1,u=t(e((s-r)/(o||1)),0),f=Array(u);u--;)f[a?u:++c]=r,r+=o;return f}return Tx=n,Tx}var Ix,mR;function _X(){if(mR)return Ix;mR=1;var e=SX(),t=bf(),n=gL();function r(s){return function(o,a,c){return c&&typeof c!="number"&&t(o,a,c)&&(a=c=void 0),o=n(o),a===void 0?(a=o,o=0):a=n(a),c=c===void 0?o<a?1:-1:n(c),e(o,a,c,s)}}return Ix=r,Ix}var Ax,gR;function NX(){if(gR)return Ax;gR=1;var e=_X(),t=e();return Ax=t,Ax}var Mx,yR;function kX(){if(yR)return Mx;yR=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return Mx=e,Mx}var Ox,vR;function CX(){if(vR)return Ox;vR=1;var e=Vo();function t(n,r){if(n!==r){var s=n!==void 0,o=n===null,a=n===n,c=e(n),u=r!==void 0,f=r===null,m=r===r,p=e(r);if(!f&&!p&&!c&&n>r||c&&u&&m&&!f&&!p||o&&u&&m||!s&&m||!a)return 1;if(!o&&!c&&!p&&n<r||p&&s&&a&&!o&&!c||f&&s&&a||!u&&a||!m)return-1}return 0}return Ox=t,Ox}var Px,xR;function EX(){if(xR)return Px;xR=1;var e=CX();function t(n,r,s){for(var o=-1,a=n.criteria,c=r.criteria,u=a.length,f=s.length;++o<u;){var m=e(a[o],c[o]);if(m){if(o>=f)return m;var p=s[o];return m*(p=="desc"?-1:1)}}return n.index-r.index}return Px=t,Px}var Lx,wR;function jX(){if(wR)return Lx;wR=1;var e=yf(),t=xf(),n=Wr(),r=rL(),s=kX(),o=hf(),a=EX(),c=gi(),u=yt();function f(m,p,g){p.length?p=e(p,function(w){return u(w)?function(x){return t(x,w.length===1?w[0]:w)}:w}):p=[c];var v=-1;p=e(p,o(n));var b=r(m,function(w,x,S){var k=e(p,function(N){return N(w)});return{criteria:k,index:++v,value:w}});return s(b,function(w,x){return a(w,x,g)})}return Lx=f,Lx}var Dx,bR;function RX(){if(bR)return Dx;bR=1;var e=Lb(),t=jX(),n=wf(),r=bf(),s=n(function(o,a){if(o==null)return[];var c=a.length;return c>1&&r(o,a[0],a[1])?a=[]:c>2&&r(a[0],a[1],a[2])&&(a=[a[0]]),t(o,e(a,1),[])});return Dx=s,Dx}var $x,SR;function TX(){if(SR)return $x;SR=1;var e=XP(),t=0;function n(r){var s=++t;return e(r)+s}return $x=n,$x}var qx,_R;function IX(){if(_R)return qx;_R=1;function e(t,n,r){for(var s=-1,o=t.length,a=n.length,c={};++s<o;){var u=s<a?n[s]:void 0;r(c,t[s],u)}return c}return qx=e,qx}var Fx,NR;function AX(){if(NR)return Fx;NR=1;var e=df(),t=IX();function n(r,s){return t(r||[],s||[],e)}return Fx=n,Fx}var Bx,kR;function nt(){if(kR)return Bx;kR=1;var e;if(typeof bb=="function")try{e={cloneDeep:GY(),constant:Ib(),defaults:YY(),each:VP(),filter:eL(),find:nX(),flatten:yL(),forEach:zP(),forIn:rX(),has:tL(),isUndefined:nL(),last:sX(),map:sL(),mapValues:iX(),max:aX(),merge:hX(),min:pX(),minBy:mX(),now:gX(),pick:bX(),range:NX(),reduce:iL(),sortBy:RX(),uniqueId:TX(),values:uL(),zipObject:AX()}}catch{}return e||(e=window._),Bx=e,Bx}var zx,CR;function MX(){if(CR)return zx;CR=1,zx=e;function e(){var r={};r._next=r._prev=r,this._sentinel=r}e.prototype.dequeue=function(){var r=this._sentinel,s=r._prev;if(s!==r)return t(s),s},e.prototype.enqueue=function(r){var s=this._sentinel;r._prev&&r._next&&t(r),r._next=s._next,s._next._prev=r,s._next=r,r._prev=s},e.prototype.toString=function(){for(var r=[],s=this._sentinel,o=s._prev;o!==s;)r.push(JSON.stringify(o,n)),o=o._prev;return"["+r.join(", ")+"]"};function t(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function n(r,s){if(r!=="_next"&&r!=="_prev")return s}return zx}var Vx,ER;function OX(){if(ER)return Vx;ER=1;var e=nt(),t=Wn().Graph,n=MX();Vx=s;var r=e.constant(1);function s(f,m){if(f.nodeCount()<=1)return[];var p=c(f,m||r),g=o(p.graph,p.buckets,p.zeroIdx);return e.flatten(e.map(g,function(v){return f.outEdges(v.v,v.w)}),!0)}function o(f,m,p){for(var g=[],v=m[m.length-1],b=m[0],w;f.nodeCount();){for(;w=b.dequeue();)a(f,m,p,w);for(;w=v.dequeue();)a(f,m,p,w);if(f.nodeCount()){for(var x=m.length-2;x>0;--x)if(w=m[x].dequeue(),w){g=g.concat(a(f,m,p,w,!0));break}}}return g}function a(f,m,p,g,v){var b=v?[]:void 0;return e.forEach(f.inEdges(g.v),function(w){var x=f.edge(w),S=f.node(w.v);v&&b.push({v:w.v,w:w.w}),S.out-=x,u(m,p,S)}),e.forEach(f.outEdges(g.v),function(w){var x=f.edge(w),S=w.w,k=f.node(S);k.in-=x,u(m,p,k)}),f.removeNode(g.v),b}function c(f,m){var p=new t,g=0,v=0;e.forEach(f.nodes(),function(x){p.setNode(x,{v:x,in:0,out:0})}),e.forEach(f.edges(),function(x){var S=p.edge(x.v,x.w)||0,k=m(x),N=S+k;p.setEdge(x.v,x.w,N),v=Math.max(v,p.node(x.v).out+=k),g=Math.max(g,p.node(x.w).in+=k)});var b=e.range(v+g+3).map(function(){return new n}),w=g+1;return e.forEach(p.nodes(),function(x){u(b,w,p.node(x))}),{graph:p,buckets:b,zeroIdx:w}}function u(f,m,p){p.out?p.in?f[p.out-p.in+m].enqueue(p):f[f.length-1].enqueue(p):f[0].enqueue(p)}return Vx}var Ux,jR;function PX(){if(jR)return Ux;jR=1;var e=nt(),t=OX();Ux={run:n,undo:s};function n(o){var a=o.graph().acyclicer==="greedy"?t(o,c(o)):r(o);e.forEach(a,function(u){var f=o.edge(u);o.removeEdge(u),f.forwardName=u.name,f.reversed=!0,o.setEdge(u.w,u.v,f,e.uniqueId("rev"))});function c(u){return function(f){return u.edge(f).weight}}}function r(o){var a=[],c={},u={};function f(m){e.has(u,m)||(u[m]=!0,c[m]=!0,e.forEach(o.outEdges(m),function(p){e.has(c,p.w)?a.push(p):f(p.w)}),delete c[m])}return e.forEach(o.nodes(),f),a}function s(o){e.forEach(o.edges(),function(a){var c=o.edge(a);if(c.reversed){o.removeEdge(a);var u=c.forwardName;delete c.reversed,delete c.forwardName,o.setEdge(a.w,a.v,c,u)}})}return Ux}var Hx,RR;function Jt(){if(RR)return Hx;RR=1;var e=nt(),t=Wn().Graph;Hx={addDummyNode:n,simplify:r,asNonCompoundGraph:s,successorWeights:o,predecessorWeights:a,intersectRect:c,buildLayerMatrix:u,normalizeRanks:f,removeEmptyRanks:m,addBorderNode:p,maxRank:g,partition:v,time:b,notime:w};function n(x,S,k,N){var C;do C=e.uniqueId(N);while(x.hasNode(C));return k.dummy=S,x.setNode(C,k),C}function r(x){var S=new t().setGraph(x.graph());return e.forEach(x.nodes(),function(k){S.setNode(k,x.node(k))}),e.forEach(x.edges(),function(k){var N=S.edge(k.v,k.w)||{weight:0,minlen:1},C=x.edge(k);S.setEdge(k.v,k.w,{weight:N.weight+C.weight,minlen:Math.max(N.minlen,C.minlen)})}),S}function s(x){var S=new t({multigraph:x.isMultigraph()}).setGraph(x.graph());return e.forEach(x.nodes(),function(k){x.children(k).length||S.setNode(k,x.node(k))}),e.forEach(x.edges(),function(k){S.setEdge(k,x.edge(k))}),S}function o(x){var S=e.map(x.nodes(),function(k){var N={};return e.forEach(x.outEdges(k),function(C){N[C.w]=(N[C.w]||0)+x.edge(C).weight}),N});return e.zipObject(x.nodes(),S)}function a(x){var S=e.map(x.nodes(),function(k){var N={};return e.forEach(x.inEdges(k),function(C){N[C.v]=(N[C.v]||0)+x.edge(C).weight}),N});return e.zipObject(x.nodes(),S)}function c(x,S){var k=x.x,N=x.y,C=S.x-k,R=S.y-N,T=x.width/2,I=x.height/2;if(!C&&!R)throw new Error("Not possible to find intersection inside of the rectangle");var O,P;return Math.abs(R)*T>Math.abs(C)*I?(R<0&&(I=-I),O=I*C/R,P=I):(C<0&&(T=-T),O=T,P=T*R/C),{x:k+O,y:N+P}}function u(x){var S=e.map(e.range(g(x)+1),function(){return[]});return e.forEach(x.nodes(),function(k){var N=x.node(k),C=N.rank;e.isUndefined(C)||(S[C][N.order]=k)}),S}function f(x){var S=e.min(e.map(x.nodes(),function(k){return x.node(k).rank}));e.forEach(x.nodes(),function(k){var N=x.node(k);e.has(N,"rank")&&(N.rank-=S)})}function m(x){var S=e.min(e.map(x.nodes(),function(R){return x.node(R).rank})),k=[];e.forEach(x.nodes(),function(R){var T=x.node(R).rank-S;k[T]||(k[T]=[]),k[T].push(R)});var N=0,C=x.graph().nodeRankFactor;e.forEach(k,function(R,T){e.isUndefined(R)&&T%C!==0?--N:N&&e.forEach(R,function(I){x.node(I).rank+=N})})}function p(x,S,k,N){var C={width:0,height:0};return arguments.length>=4&&(C.rank=k,C.order=N),n(x,"border",C,S)}function g(x){return e.max(e.map(x.nodes(),function(S){var k=x.node(S).rank;if(!e.isUndefined(k))return k}))}function v(x,S){var k={lhs:[],rhs:[]};return e.forEach(x,function(N){S(N)?k.lhs.push(N):k.rhs.push(N)}),k}function b(x,S){var k=e.now();try{return S()}finally{console.log(x+" time: "+(e.now()-k)+"ms")}}function w(x,S){return S()}return Hx}var Wx,TR;function LX(){if(TR)return Wx;TR=1;var e=nt(),t=Jt();Wx={run:n,undo:s};function n(o){o.graph().dummyChains=[],e.forEach(o.edges(),function(a){r(o,a)})}function r(o,a){var c=a.v,u=o.node(c).rank,f=a.w,m=o.node(f).rank,p=a.name,g=o.edge(a),v=g.labelRank;if(m!==u+1){o.removeEdge(a);var b,w,x;for(x=0,++u;u<m;++x,++u)g.points=[],w={width:0,height:0,edgeLabel:g,edgeObj:a,rank:u},b=t.addDummyNode(o,"edge",w,"_d"),u===v&&(w.width=g.width,w.height=g.height,w.dummy="edge-label",w.labelpos=g.labelpos),o.setEdge(c,b,{weight:g.weight},p),x===0&&o.graph().dummyChains.push(b),c=b;o.setEdge(c,f,{weight:g.weight},p)}}function s(o){e.forEach(o.graph().dummyChains,function(a){var c=o.node(a),u=c.edgeLabel,f;for(o.setEdge(c.edgeObj,u);c.dummy;)f=o.successors(a)[0],o.removeNode(a),u.points.push({x:c.x,y:c.y}),c.dummy==="edge-label"&&(u.x=c.x,u.y=c.y,u.width=c.width,u.height=c.height),a=f,c=o.node(a)})}return Wx}var Kx,IR;function _d(){if(IR)return Kx;IR=1;var e=nt();Kx={longestPath:t,slack:n};function t(r){var s={};function o(a){var c=r.node(a);if(e.has(s,a))return c.rank;s[a]=!0;var u=e.min(e.map(r.outEdges(a),function(f){return o(f.w)-r.edge(f).minlen}));return(u===Number.POSITIVE_INFINITY||u===void 0||u===null)&&(u=0),c.rank=u}e.forEach(r.sources(),o)}function n(r,s){return r.node(s.w).rank-r.node(s.v).rank-r.edge(s).minlen}return Kx}var Gx,AR;function bL(){if(AR)return Gx;AR=1;var e=nt(),t=Wn().Graph,n=_d().slack;Gx=r;function r(c){var u=new t({directed:!1}),f=c.nodes()[0],m=c.nodeCount();u.setNode(f,{});for(var p,g;s(u,c)<m;)p=o(u,c),g=u.hasNode(p.v)?n(c,p):-n(c,p),a(u,c,g);return u}function s(c,u){function f(m){e.forEach(u.nodeEdges(m),function(p){var g=p.v,v=m===g?p.w:g;!c.hasNode(v)&&!n(u,p)&&(c.setNode(v,{}),c.setEdge(m,v,{}),f(v))})}return e.forEach(c.nodes(),f),c.nodeCount()}function o(c,u){return e.minBy(u.edges(),function(f){if(c.hasNode(f.v)!==c.hasNode(f.w))return n(u,f)})}function a(c,u,f){e.forEach(c.nodes(),function(m){u.node(m).rank+=f})}return Gx}var Yx,MR;function DX(){if(MR)return Yx;MR=1;var e=nt(),t=bL(),n=_d().slack,r=_d().longestPath,s=Wn().alg.preorder,o=Wn().alg.postorder,a=Jt().simplify;Yx=c,c.initLowLimValues=p,c.initCutValues=u,c.calcCutValue=m,c.leaveEdge=v,c.enterEdge=b,c.exchangeEdges=w;function c(N){N=a(N),r(N);var C=t(N);p(C),u(C,N);for(var R,T;R=v(C);)T=b(C,N,R),w(C,N,R,T)}function u(N,C){var R=o(N,N.nodes());R=R.slice(0,R.length-1),e.forEach(R,function(T){f(N,C,T)})}function f(N,C,R){var T=N.node(R),I=T.parent;N.edge(R,I).cutvalue=m(N,C,R)}function m(N,C,R){var T=N.node(R),I=T.parent,O=!0,P=C.edge(R,I),B=0;return P||(O=!1,P=C.edge(I,R)),B=P.weight,e.forEach(C.nodeEdges(R),function(M){var L=M.v===R,U=L?M.w:M.v;if(U!==I){var $=L===O,z=C.edge(M).weight;if(B+=$?z:-z,S(N,R,U)){var V=N.edge(R,U).cutvalue;B+=$?-V:V}}}),B}function p(N,C){arguments.length<2&&(C=N.nodes()[0]),g(N,{},1,C)}function g(N,C,R,T,I){var O=R,P=N.node(T);return C[T]=!0,e.forEach(N.neighbors(T),function(B){e.has(C,B)||(R=g(N,C,R,B,T))}),P.low=O,P.lim=R++,I?P.parent=I:delete P.parent,R}function v(N){return e.find(N.edges(),function(C){return N.edge(C).cutvalue<0})}function b(N,C,R){var T=R.v,I=R.w;C.hasEdge(T,I)||(T=R.w,I=R.v);var O=N.node(T),P=N.node(I),B=O,M=!1;O.lim>P.lim&&(B=P,M=!0);var L=e.filter(C.edges(),function(U){return M===k(N,N.node(U.v),B)&&M!==k(N,N.node(U.w),B)});return e.minBy(L,function(U){return n(C,U)})}function w(N,C,R,T){var I=R.v,O=R.w;N.removeEdge(I,O),N.setEdge(T.v,T.w,{}),p(N),u(N,C),x(N,C)}function x(N,C){var R=e.find(N.nodes(),function(I){return!C.node(I).parent}),T=s(N,R);T=T.slice(1),e.forEach(T,function(I){var O=N.node(I).parent,P=C.edge(I,O),B=!1;P||(P=C.edge(O,I),B=!0),C.node(I).rank=C.node(O).rank+(B?P.minlen:-P.minlen)})}function S(N,C,R){return N.hasEdge(C,R)}function k(N,C,R){return R.low<=C.lim&&C.lim<=R.lim}return Yx}var Xx,OR;function $X(){if(OR)return Xx;OR=1;var e=_d(),t=e.longestPath,n=bL(),r=DX();Xx=s;function s(u){switch(u.graph().ranker){case"network-simplex":c(u);break;case"tight-tree":a(u);break;case"longest-path":o(u);break;default:c(u)}}var o=t;function a(u){t(u),n(u)}function c(u){r(u)}return Xx}var Qx,PR;function qX(){if(PR)return Qx;PR=1;var e=nt();Qx=t;function t(s){var o=r(s);e.forEach(s.graph().dummyChains,function(a){for(var c=s.node(a),u=c.edgeObj,f=n(s,o,u.v,u.w),m=f.path,p=f.lca,g=0,v=m[g],b=!0;a!==u.w;){if(c=s.node(a),b){for(;(v=m[g])!==p&&s.node(v).maxRank<c.rank;)g++;v===p&&(b=!1)}if(!b){for(;g<m.length-1&&s.node(v=m[g+1]).minRank<=c.rank;)g++;v=m[g]}s.setParent(a,v),a=s.successors(a)[0]}})}function n(s,o,a,c){var u=[],f=[],m=Math.min(o[a].low,o[c].low),p=Math.max(o[a].lim,o[c].lim),g,v;g=a;do g=s.parent(g),u.push(g);while(g&&(o[g].low>m||p>o[g].lim));for(v=g,g=c;(g=s.parent(g))!==v;)f.push(g);return{path:u.concat(f.reverse()),lca:v}}function r(s){var o={},a=0;function c(u){var f=a;e.forEach(s.children(u),c),o[u]={low:f,lim:a++}}return e.forEach(s.children(),c),o}return Qx}var Jx,LR;function FX(){if(LR)return Jx;LR=1;var e=nt(),t=Jt();Jx={run:n,cleanup:a};function n(c){var u=t.addDummyNode(c,"root",{},"_root"),f=s(c),m=e.max(e.values(f))-1,p=2*m+1;c.graph().nestingRoot=u,e.forEach(c.edges(),function(v){c.edge(v).minlen*=p});var g=o(c)+1;e.forEach(c.children(),function(v){r(c,u,p,g,m,f,v)}),c.graph().nodeRankFactor=p}function r(c,u,f,m,p,g,v){var b=c.children(v);if(!b.length){v!==u&&c.setEdge(u,v,{weight:0,minlen:f});return}var w=t.addBorderNode(c,"_bt"),x=t.addBorderNode(c,"_bb"),S=c.node(v);c.setParent(w,v),S.borderTop=w,c.setParent(x,v),S.borderBottom=x,e.forEach(b,function(k){r(c,u,f,m,p,g,k);var N=c.node(k),C=N.borderTop?N.borderTop:k,R=N.borderBottom?N.borderBottom:k,T=N.borderTop?m:2*m,I=C!==R?1:p-g[v]+1;c.setEdge(w,C,{weight:T,minlen:I,nestingEdge:!0}),c.setEdge(R,x,{weight:T,minlen:I,nestingEdge:!0})}),c.parent(v)||c.setEdge(u,w,{weight:0,minlen:p+g[v]})}function s(c){var u={};function f(m,p){var g=c.children(m);g&&g.length&&e.forEach(g,function(v){f(v,p+1)}),u[m]=p}return e.forEach(c.children(),function(m){f(m,1)}),u}function o(c){return e.reduce(c.edges(),function(u,f){return u+c.edge(f).weight},0)}function a(c){var u=c.graph();c.removeNode(u.nestingRoot),delete u.nestingRoot,e.forEach(c.edges(),function(f){var m=c.edge(f);m.nestingEdge&&c.removeEdge(f)})}return Jx}var Zx,DR;function BX(){if(DR)return Zx;DR=1;var e=nt(),t=Jt();Zx=n;function n(s){function o(a){var c=s.children(a),u=s.node(a);if(c.length&&e.forEach(c,o),e.has(u,"minRank")){u.borderLeft=[],u.borderRight=[];for(var f=u.minRank,m=u.maxRank+1;f<m;++f)r(s,"borderLeft","_bl",a,u,f),r(s,"borderRight","_br",a,u,f)}}e.forEach(s.children(),o)}function r(s,o,a,c,u,f){var m={width:0,height:0,rank:f,borderType:o},p=u[o][f-1],g=t.addDummyNode(s,"border",m,a);u[o][f]=g,s.setParent(g,c),p&&s.setEdge(p,g,{weight:1})}return Zx}var e0,$R;function zX(){if($R)return e0;$R=1;var e=nt();e0={adjust:t,undo:n};function t(f){var m=f.graph().rankdir.toLowerCase();(m==="lr"||m==="rl")&&r(f)}function n(f){var m=f.graph().rankdir.toLowerCase();(m==="bt"||m==="rl")&&o(f),(m==="lr"||m==="rl")&&(c(f),r(f))}function r(f){e.forEach(f.nodes(),function(m){s(f.node(m))}),e.forEach(f.edges(),function(m){s(f.edge(m))})}function s(f){var m=f.width;f.width=f.height,f.height=m}function o(f){e.forEach(f.nodes(),function(m){a(f.node(m))}),e.forEach(f.edges(),function(m){var p=f.edge(m);e.forEach(p.points,a),e.has(p,"y")&&a(p)})}function a(f){f.y=-f.y}function c(f){e.forEach(f.nodes(),function(m){u(f.node(m))}),e.forEach(f.edges(),function(m){var p=f.edge(m);e.forEach(p.points,u),e.has(p,"x")&&u(p)})}function u(f){var m=f.x;f.x=f.y,f.y=m}return e0}var t0,qR;function VX(){if(qR)return t0;qR=1;var e=nt();t0=t;function t(n){var r={},s=e.filter(n.nodes(),function(f){return!n.children(f).length}),o=e.max(e.map(s,function(f){return n.node(f).rank})),a=e.map(e.range(o+1),function(){return[]});function c(f){if(!e.has(r,f)){r[f]=!0;var m=n.node(f);a[m.rank].push(f),e.forEach(n.successors(f),c)}}var u=e.sortBy(s,function(f){return n.node(f).rank});return e.forEach(u,c),a}return t0}var n0,FR;function UX(){if(FR)return n0;FR=1;var e=nt();n0=t;function t(r,s){for(var o=0,a=1;a<s.length;++a)o+=n(r,s[a-1],s[a]);return o}function n(r,s,o){for(var a=e.zipObject(o,e.map(o,function(g,v){return v})),c=e.flatten(e.map(s,function(g){return e.sortBy(e.map(r.outEdges(g),function(v){return{pos:a[v.w],weight:r.edge(v).weight}}),"pos")}),!0),u=1;u<o.length;)u<<=1;var f=2*u-1;u-=1;var m=e.map(new Array(f),function(){return 0}),p=0;return e.forEach(c.forEach(function(g){var v=g.pos+u;m[v]+=g.weight;for(var b=0;v>0;)v%2&&(b+=m[v+1]),v=v-1>>1,m[v]+=g.weight;p+=g.weight*b})),p}return n0}var r0,BR;function HX(){if(BR)return r0;BR=1;var e=nt();r0=t;function t(n,r){return e.map(r,function(s){var o=n.inEdges(s);if(o.length){var a=e.reduce(o,function(c,u){var f=n.edge(u),m=n.node(u.v);return{sum:c.sum+f.weight*m.order,weight:c.weight+f.weight}},{sum:0,weight:0});return{v:s,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:s}})}return r0}var s0,zR;function WX(){if(zR)return s0;zR=1;var e=nt();s0=t;function t(s,o){var a={};e.forEach(s,function(u,f){var m=a[u.v]={indegree:0,in:[],out:[],vs:[u.v],i:f};e.isUndefined(u.barycenter)||(m.barycenter=u.barycenter,m.weight=u.weight)}),e.forEach(o.edges(),function(u){var f=a[u.v],m=a[u.w];!e.isUndefined(f)&&!e.isUndefined(m)&&(m.indegree++,f.out.push(a[u.w]))});var c=e.filter(a,function(u){return!u.indegree});return n(c)}function n(s){var o=[];function a(f){return function(m){m.merged||(e.isUndefined(m.barycenter)||e.isUndefined(f.barycenter)||m.barycenter>=f.barycenter)&&r(f,m)}}function c(f){return function(m){m.in.push(f),--m.indegree===0&&s.push(m)}}for(;s.length;){var u=s.pop();o.push(u),e.forEach(u.in.reverse(),a(u)),e.forEach(u.out,c(u))}return e.map(e.filter(o,function(f){return!f.merged}),function(f){return e.pick(f,["vs","i","barycenter","weight"])})}function r(s,o){var a=0,c=0;s.weight&&(a+=s.barycenter*s.weight,c+=s.weight),o.weight&&(a+=o.barycenter*o.weight,c+=o.weight),s.vs=o.vs.concat(s.vs),s.barycenter=a/c,s.weight=c,s.i=Math.min(o.i,s.i),o.merged=!0}return s0}var i0,VR;function KX(){if(VR)return i0;VR=1;var e=nt(),t=Jt();i0=n;function n(o,a){var c=t.partition(o,function(w){return e.has(w,"barycenter")}),u=c.lhs,f=e.sortBy(c.rhs,function(w){return-w.i}),m=[],p=0,g=0,v=0;u.sort(s(!!a)),v=r(m,f,v),e.forEach(u,function(w){v+=w.vs.length,m.push(w.vs),p+=w.barycenter*w.weight,g+=w.weight,v=r(m,f,v)});var b={vs:e.flatten(m,!0)};return g&&(b.barycenter=p/g,b.weight=g),b}function r(o,a,c){for(var u;a.length&&(u=e.last(a)).i<=c;)a.pop(),o.push(u.vs),c++;return c}function s(o){return function(a,c){return a.barycenter<c.barycenter?-1:a.barycenter>c.barycenter?1:o?c.i-a.i:a.i-c.i}}return i0}var o0,UR;function GX(){if(UR)return o0;UR=1;var e=nt(),t=HX(),n=WX(),r=KX();o0=s;function s(c,u,f,m){var p=c.children(u),g=c.node(u),v=g?g.borderLeft:void 0,b=g?g.borderRight:void 0,w={};v&&(p=e.filter(p,function(R){return R!==v&&R!==b}));var x=t(c,p);e.forEach(x,function(R){if(c.children(R.v).length){var T=s(c,R.v,f,m);w[R.v]=T,e.has(T,"barycenter")&&a(R,T)}});var S=n(x,f);o(S,w);var k=r(S,m);if(v&&(k.vs=e.flatten([v,k.vs,b],!0),c.predecessors(v).length)){var N=c.node(c.predecessors(v)[0]),C=c.node(c.predecessors(b)[0]);e.has(k,"barycenter")||(k.barycenter=0,k.weight=0),k.barycenter=(k.barycenter*k.weight+N.order+C.order)/(k.weight+2),k.weight+=2}return k}function o(c,u){e.forEach(c,function(f){f.vs=e.flatten(f.vs.map(function(m){return u[m]?u[m].vs:m}),!0)})}function a(c,u){e.isUndefined(c.barycenter)?(c.barycenter=u.barycenter,c.weight=u.weight):(c.barycenter=(c.barycenter*c.weight+u.barycenter*u.weight)/(c.weight+u.weight),c.weight+=u.weight)}return o0}var a0,HR;function YX(){if(HR)return a0;HR=1;var e=nt(),t=Wn().Graph;a0=n;function n(s,o,a){var c=r(s),u=new t({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(function(f){return s.node(f)});return e.forEach(s.nodes(),function(f){var m=s.node(f),p=s.parent(f);(m.rank===o||m.minRank<=o&&o<=m.maxRank)&&(u.setNode(f),u.setParent(f,p||c),e.forEach(s[a](f),function(g){var v=g.v===f?g.w:g.v,b=u.edge(v,f),w=e.isUndefined(b)?0:b.weight;u.setEdge(v,f,{weight:s.edge(g).weight+w})}),e.has(m,"minRank")&&u.setNode(f,{borderLeft:m.borderLeft[o],borderRight:m.borderRight[o]}))}),u}function r(s){for(var o;s.hasNode(o=e.uniqueId("_root")););return o}return a0}var l0,WR;function XX(){if(WR)return l0;WR=1;var e=nt();l0=t;function t(n,r,s){var o={},a;e.forEach(s,function(c){for(var u=n.parent(c),f,m;u;){if(f=n.parent(u),f?(m=o[f],o[f]=u):(m=a,a=u),m&&m!==u){r.setEdge(m,u);return}u=f}})}return l0}var c0,KR;function QX(){if(KR)return c0;KR=1;var e=nt(),t=VX(),n=UX(),r=GX(),s=YX(),o=XX(),a=Wn().Graph,c=Jt();c0=u;function u(g){var v=c.maxRank(g),b=f(g,e.range(1,v+1),"inEdges"),w=f(g,e.range(v-1,-1,-1),"outEdges"),x=t(g);p(g,x);for(var S=Number.POSITIVE_INFINITY,k,N=0,C=0;C<4;++N,++C){m(N%2?b:w,N%4>=2),x=c.buildLayerMatrix(g);var R=n(g,x);R<S&&(C=0,k=e.cloneDeep(x),S=R)}p(g,k)}function f(g,v,b){return e.map(v,function(w){return s(g,w,b)})}function m(g,v){var b=new a;e.forEach(g,function(w){var x=w.graph().root,S=r(w,x,b,v);e.forEach(S.vs,function(k,N){w.node(k).order=N}),o(w,b,S.vs)})}function p(g,v){e.forEach(v,function(b){e.forEach(b,function(w,x){g.node(w).order=x})})}return c0}var u0,GR;function JX(){if(GR)return u0;GR=1;var e=nt(),t=Wn().Graph,n=Jt();u0={positionX:b,findType1Conflicts:r,findType2Conflicts:s,addConflict:a,hasConflict:c,verticalAlignment:u,horizontalCompaction:f,alignCoordinates:g,findSmallestWidthAlignment:p,balance:v};function r(S,k){var N={};function C(R,T){var I=0,O=0,P=R.length,B=e.last(T);return e.forEach(T,function(M,L){var U=o(S,M),$=U?S.node(U).order:P;(U||M===B)&&(e.forEach(T.slice(O,L+1),function(z){e.forEach(S.predecessors(z),function(V){var G=S.node(V),F=G.order;(F<I||$<F)&&!(G.dummy&&S.node(z).dummy)&&a(N,V,z)})}),O=L+1,I=$)}),T}return e.reduce(k,C),N}function s(S,k){var N={};function C(T,I,O,P,B){var M;e.forEach(e.range(I,O),function(L){M=T[L],S.node(M).dummy&&e.forEach(S.predecessors(M),function(U){var $=S.node(U);$.dummy&&($.order<P||$.order>B)&&a(N,U,M)})})}function R(T,I){var O=-1,P,B=0;return e.forEach(I,function(M,L){if(S.node(M).dummy==="border"){var U=S.predecessors(M);U.length&&(P=S.node(U[0]).order,C(I,B,L,O,P),B=L,O=P)}C(I,B,I.length,P,T.length)}),I}return e.reduce(k,R),N}function o(S,k){if(S.node(k).dummy)return e.find(S.predecessors(k),function(N){return S.node(N).dummy})}function a(S,k,N){if(k>N){var C=k;k=N,N=C}var R=S[k];R||(S[k]=R={}),R[N]=!0}function c(S,k,N){if(k>N){var C=k;k=N,N=C}return e.has(S[k],N)}function u(S,k,N,C){var R={},T={},I={};return e.forEach(k,function(O){e.forEach(O,function(P,B){R[P]=P,T[P]=P,I[P]=B})}),e.forEach(k,function(O){var P=-1;e.forEach(O,function(B){var M=C(B);if(M.length){M=e.sortBy(M,function(V){return I[V]});for(var L=(M.length-1)/2,U=Math.floor(L),$=Math.ceil(L);U<=$;++U){var z=M[U];T[B]===B&&P<I[z]&&!c(N,B,z)&&(T[z]=B,T[B]=R[B]=R[z],P=I[z])}}})}),{root:R,align:T}}function f(S,k,N,C,R){var T={},I=m(S,k,N,R),O=R?"borderLeft":"borderRight";function P(L,U){for(var $=I.nodes(),z=$.pop(),V={};z;)V[z]?L(z):(V[z]=!0,$.push(z),$=$.concat(U(z))),z=$.pop()}function B(L){T[L]=I.inEdges(L).reduce(function(U,$){return Math.max(U,T[$.v]+I.edge($))},0)}function M(L){var U=I.outEdges(L).reduce(function(z,V){return Math.min(z,T[V.w]-I.edge(V))},Number.POSITIVE_INFINITY),$=S.node(L);U!==Number.POSITIVE_INFINITY&&$.borderType!==O&&(T[L]=Math.max(T[L],U))}return P(B,I.predecessors.bind(I)),P(M,I.successors.bind(I)),e.forEach(C,function(L){T[L]=T[N[L]]}),T}function m(S,k,N,C){var R=new t,T=S.graph(),I=w(T.nodesep,T.edgesep,C);return e.forEach(k,function(O){var P;e.forEach(O,function(B){var M=N[B];if(R.setNode(M),P){var L=N[P],U=R.edge(L,M);R.setEdge(L,M,Math.max(I(S,B,P),U||0))}P=B})}),R}function p(S,k){return e.minBy(e.values(k),function(N){var C=Number.NEGATIVE_INFINITY,R=Number.POSITIVE_INFINITY;return e.forIn(N,function(T,I){var O=x(S,I)/2;C=Math.max(T+O,C),R=Math.min(T-O,R)}),C-R})}function g(S,k){var N=e.values(k),C=e.min(N),R=e.max(N);e.forEach(["u","d"],function(T){e.forEach(["l","r"],function(I){var O=T+I,P=S[O],B;if(P!==k){var M=e.values(P);B=I==="l"?C-e.min(M):R-e.max(M),B&&(S[O]=e.mapValues(P,function(L){return L+B}))}})})}function v(S,k){return e.mapValues(S.ul,function(N,C){if(k)return S[k.toLowerCase()][C];var R=e.sortBy(e.map(S,C));return(R[1]+R[2])/2})}function b(S){var k=n.buildLayerMatrix(S),N=e.merge(r(S,k),s(S,k)),C={},R;e.forEach(["u","d"],function(I){R=I==="u"?k:e.values(k).reverse(),e.forEach(["l","r"],function(O){O==="r"&&(R=e.map(R,function(L){return e.values(L).reverse()}));var P=(I==="u"?S.predecessors:S.successors).bind(S),B=u(S,R,N,P),M=f(S,R,B.root,B.align,O==="r");O==="r"&&(M=e.mapValues(M,function(L){return-L})),C[I+O]=M})});var T=p(S,C);return g(C,T),v(C,S.graph().align)}function w(S,k,N){return function(C,R,T){var I=C.node(R),O=C.node(T),P=0,B;if(P+=I.width/2,e.has(I,"labelpos"))switch(I.labelpos.toLowerCase()){case"l":B=-I.width/2;break;case"r":B=I.width/2;break}if(B&&(P+=N?B:-B),B=0,P+=(I.dummy?k:S)/2,P+=(O.dummy?k:S)/2,P+=O.width/2,e.has(O,"labelpos"))switch(O.labelpos.toLowerCase()){case"l":B=O.width/2;break;case"r":B=-O.width/2;break}return B&&(P+=N?B:-B),B=0,P}}function x(S,k){return S.node(k).width}return u0}var d0,YR;function ZX(){if(YR)return d0;YR=1;var e=nt(),t=Jt(),n=JX().positionX;d0=r;function r(o){o=t.asNonCompoundGraph(o),s(o),e.forEach(n(o),function(a,c){o.node(c).x=a})}function s(o){var a=t.buildLayerMatrix(o),c=o.graph().ranksep,u=0;e.forEach(a,function(f){var m=e.max(e.map(f,function(p){return o.node(p).height}));e.forEach(f,function(p){o.node(p).y=u+m/2}),u+=m+c})}return d0}var f0,XR;function eQ(){if(XR)return f0;XR=1;var e=nt(),t=PX(),n=LX(),r=$X(),s=Jt().normalizeRanks,o=qX(),a=Jt().removeEmptyRanks,c=FX(),u=BX(),f=zX(),m=QX(),p=ZX(),g=Jt(),v=Wn().Graph;f0=b;function b(K,J){var te=J&&J.debugTiming?g.time:g.notime;te("layout",function(){var Y=te(" buildLayoutGraph",function(){return P(K)});te(" runLayout",function(){w(Y,te)}),te(" updateInputGraph",function(){x(K,Y)})})}function w(K,J){J(" makeSpaceForEdgeLabels",function(){B(K)}),J(" removeSelfEdges",function(){q(K)}),J(" acyclic",function(){t.run(K)}),J(" nestingGraph.run",function(){c.run(K)}),J(" rank",function(){r(g.asNonCompoundGraph(K))}),J(" injectEdgeLabelProxies",function(){M(K)}),J(" removeEmptyRanks",function(){a(K)}),J(" nestingGraph.cleanup",function(){c.cleanup(K)}),J(" normalizeRanks",function(){s(K)}),J(" assignRankMinMax",function(){L(K)}),J(" removeEdgeLabelProxies",function(){U(K)}),J(" normalize.run",function(){n.run(K)}),J(" parentDummyChains",function(){o(K)}),J(" addBorderSegments",function(){u(K)}),J(" order",function(){m(K)}),J(" insertSelfEdges",function(){X(K)}),J(" adjustCoordinateSystem",function(){f.adjust(K)}),J(" position",function(){p(K)}),J(" positionSelfEdges",function(){D(K)}),J(" removeBorderNodes",function(){F(K)}),J(" normalize.undo",function(){n.undo(K)}),J(" fixupEdgeLabelCoords",function(){V(K)}),J(" undoCoordinateSystem",function(){f.undo(K)}),J(" translateGraph",function(){$(K)}),J(" assignNodeIntersects",function(){z(K)}),J(" reversePoints",function(){G(K)}),J(" acyclic.undo",function(){t.undo(K)})}function x(K,J){e.forEach(K.nodes(),function(te){var Y=K.node(te),ee=J.node(te);Y&&(Y.x=ee.x,Y.y=ee.y,J.children(te).length&&(Y.width=ee.width,Y.height=ee.height))}),e.forEach(K.edges(),function(te){var Y=K.edge(te),ee=J.edge(te);Y.points=ee.points,e.has(ee,"x")&&(Y.x=ee.x,Y.y=ee.y)}),K.graph().width=J.graph().width,K.graph().height=J.graph().height}var S=["nodesep","edgesep","ranksep","marginx","marginy"],k={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},N=["acyclicer","ranker","rankdir","align"],C=["width","height"],R={width:0,height:0},T=["minlen","weight","width","height","labeloffset"],I={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},O=["labelpos"];function P(K){var J=new v({multigraph:!0,compound:!0}),te=oe(K.graph());return J.setGraph(e.merge({},k,W(te,S),e.pick(te,N))),e.forEach(K.nodes(),function(Y){var ee=oe(K.node(Y));J.setNode(Y,e.defaults(W(ee,C),R)),J.setParent(Y,K.parent(Y))}),e.forEach(K.edges(),function(Y){var ee=oe(K.edge(Y));J.setEdge(Y,e.merge({},I,W(ee,T),e.pick(ee,O)))}),J}function B(K){var J=K.graph();J.ranksep/=2,e.forEach(K.edges(),function(te){var Y=K.edge(te);Y.minlen*=2,Y.labelpos.toLowerCase()!=="c"&&(J.rankdir==="TB"||J.rankdir==="BT"?Y.width+=Y.labeloffset:Y.height+=Y.labeloffset)})}function M(K){e.forEach(K.edges(),function(J){var te=K.edge(J);if(te.width&&te.height){var Y=K.node(J.v),ee=K.node(J.w),ie={rank:(ee.rank-Y.rank)/2+Y.rank,e:J};g.addDummyNode(K,"edge-proxy",ie,"_ep")}})}function L(K){var J=0;e.forEach(K.nodes(),function(te){var Y=K.node(te);Y.borderTop&&(Y.minRank=K.node(Y.borderTop).rank,Y.maxRank=K.node(Y.borderBottom).rank,J=e.max(J,Y.maxRank))}),K.graph().maxRank=J}function U(K){e.forEach(K.nodes(),function(J){var te=K.node(J);te.dummy==="edge-proxy"&&(K.edge(te.e).labelRank=te.rank,K.removeNode(J))})}function $(K){var J=Number.POSITIVE_INFINITY,te=0,Y=Number.POSITIVE_INFINITY,ee=0,ie=K.graph(),ue=ie.marginx||0,ge=ie.marginy||0;function xe(pe){var be=pe.x,ve=pe.y,Re=pe.width,ke=pe.height;J=Math.min(J,be-Re/2),te=Math.max(te,be+Re/2),Y=Math.min(Y,ve-ke/2),ee=Math.max(ee,ve+ke/2)}e.forEach(K.nodes(),function(pe){xe(K.node(pe))}),e.forEach(K.edges(),function(pe){var be=K.edge(pe);e.has(be,"x")&&xe(be)}),J-=ue,Y-=ge,e.forEach(K.nodes(),function(pe){var be=K.node(pe);be.x-=J,be.y-=Y}),e.forEach(K.edges(),function(pe){var be=K.edge(pe);e.forEach(be.points,function(ve){ve.x-=J,ve.y-=Y}),e.has(be,"x")&&(be.x-=J),e.has(be,"y")&&(be.y-=Y)}),ie.width=te-J+ue,ie.height=ee-Y+ge}function z(K){e.forEach(K.edges(),function(J){var te=K.edge(J),Y=K.node(J.v),ee=K.node(J.w),ie,ue;te.points?(ie=te.points[0],ue=te.points[te.points.length-1]):(te.points=[],ie=ee,ue=Y),te.points.unshift(g.intersectRect(Y,ie)),te.points.push(g.intersectRect(ee,ue))})}function V(K){e.forEach(K.edges(),function(J){var te=K.edge(J);if(e.has(te,"x"))switch((te.labelpos==="l"||te.labelpos==="r")&&(te.width-=te.labeloffset),te.labelpos){case"l":te.x-=te.width/2+te.labeloffset;break;case"r":te.x+=te.width/2+te.labeloffset;break}})}function G(K){e.forEach(K.edges(),function(J){var te=K.edge(J);te.reversed&&te.points.reverse()})}function F(K){e.forEach(K.nodes(),function(J){if(K.children(J).length){var te=K.node(J),Y=K.node(te.borderTop),ee=K.node(te.borderBottom),ie=K.node(e.last(te.borderLeft)),ue=K.node(e.last(te.borderRight));te.width=Math.abs(ue.x-ie.x),te.height=Math.abs(ee.y-Y.y),te.x=ie.x+te.width/2,te.y=Y.y+te.height/2}}),e.forEach(K.nodes(),function(J){K.node(J).dummy==="border"&&K.removeNode(J)})}function q(K){e.forEach(K.edges(),function(J){if(J.v===J.w){var te=K.node(J.v);te.selfEdges||(te.selfEdges=[]),te.selfEdges.push({e:J,label:K.edge(J)}),K.removeEdge(J)}})}function X(K){var J=g.buildLayerMatrix(K);e.forEach(J,function(te){var Y=0;e.forEach(te,function(ee,ie){var ue=K.node(ee);ue.order=ie+Y,e.forEach(ue.selfEdges,function(ge){g.addDummyNode(K,"selfedge",{width:ge.label.width,height:ge.label.height,rank:ue.rank,order:ie+ ++Y,e:ge.e,label:ge.label},"_se")}),delete ue.selfEdges})})}function D(K){e.forEach(K.nodes(),function(J){var te=K.node(J);if(te.dummy==="selfedge"){var Y=K.node(te.e.v),ee=Y.x+Y.width/2,ie=Y.y,ue=te.x-ee,ge=Y.height/2;K.setEdge(te.e,te.label),K.removeNode(J),te.label.points=[{x:ee+2*ue/3,y:ie-ge},{x:ee+5*ue/6,y:ie-ge},{x:ee+ue,y:ie},{x:ee+5*ue/6,y:ie+ge},{x:ee+2*ue/3,y:ie+ge}],te.label.x=te.x,te.label.y=te.y}})}function W(K,J){return e.mapValues(e.pick(K,J),Number)}function oe(K){var J={};return e.forEach(K,function(te,Y){J[Y.toLowerCase()]=te}),J}return f0}var h0,QR;function tQ(){if(QR)return h0;QR=1;var e=nt(),t=Jt(),n=Wn().Graph;h0={debugOrdering:r};function r(s){var o=t.buildLayerMatrix(s),a=new n({compound:!0,multigraph:!0}).setGraph({});return e.forEach(s.nodes(),function(c){a.setNode(c,{label:c}),a.setParent(c,"layer"+s.node(c).rank)}),e.forEach(s.edges(),function(c){a.setEdge(c.v,c.w,{},c.name)}),e.forEach(o,function(c,u){var f="layer"+u;a.setNode(f,{rank:"same"}),e.reduce(c,function(m,p){return a.setEdge(m,p,{style:"invis"}),p})}),a}return h0}var p0,JR;function nQ(){return JR||(JR=1,p0="0.8.5"),p0}var m0,ZR;function rQ(){return ZR||(ZR=1,m0={graphlib:Wn(),layout:eQ(),debug:tQ(),util:{time:Jt().time,notime:Jt().notime},version:nQ()}),m0}var sQ=rQ();const eT=wl(sQ);function SL(){const{nodes:e,edges:t,setNodes:n,setEdges:r,updateNodeData:s,clearCanvas:o}=No(),a=jo(),c=j.useMemo(()=>e.filter(M=>M.selected),[e]),u=j.useMemo(()=>t.filter(M=>M.selected),[t]),f=j.useCallback(M=>e.find(L=>L.id===M),[e]),m=j.useCallback(M=>t.find(L=>L.id===M),[t]),p=j.useCallback(M=>{n([...e,M])},[e,n]),g=j.useCallback(M=>{n(e.filter(L=>L.id!==M)),r(t.filter(L=>L.source!==M&&L.target!==M))},[e,t,n,r]),v=j.useCallback(()=>{const M=[],L=new Map;for(const $ of c){const z=`${$.id}-copy-${Date.now()}`;L.set($.id,z),M.push({...$,id:z,position:{x:$.position.x+50,y:$.position.y+50},selected:!1,data:{...$.data,id:z}})}n([...e,...M]);const U=[];for(const $ of t)L.has($.source)&&L.has($.target)&&U.push({...$,id:`${$.id}-copy-${Date.now()}`,source:L.get($.source),target:L.get($.target)});U.length>0&&r([...t,...U])},[c,e,t,n,r]),b=j.useCallback(()=>{const M=new Set(c.map(U=>U.id)),L=new Set(u.map(U=>U.id));n(e.filter(U=>!M.has(U.id))),r(t.filter(U=>!L.has(U.id)&&!M.has(U.source)&&!M.has(U.target)))},[c,u,e,t,n,r]),w=j.useCallback(()=>{const M=new eT.graphlib.Graph;M.setDefaultEdgeLabel(()=>({})),M.setGraph({rankdir:"TB",nodesep:50,ranksep:80});for(const U of e)M.setNode(U.id,{width:200,height:100});for(const U of t)M.setEdge(U.source,U.target);eT.layout(M);const L=e.map(U=>{const $=M.node(U.id);return{...U,position:{x:$.x-100,y:$.y-50}}});n(L),setTimeout(()=>{a.fitView({padding:.2})},50)},[e,t,n,a]),x=j.useCallback(()=>{a.fitView({padding:.2})},[a]),S=j.useCallback(M=>{const L=f(M);L&&a.setCenter(L.position.x+100,L.position.y+50,{zoom:1.5,duration:300})},[f,a]),k=j.useCallback((M,L=!1)=>{n(e.map(U=>({...U,selected:L&&U.selected||U.id===M})))},[e,n]),N=j.useCallback(()=>{n(e.map(M=>({...M,selected:!1}))),r(t.map(M=>({...M,selected:!1})))},[e,t,n,r]),{undo:C,redo:R,canUndo:T,canRedo:I,copySelected:O,paste:P,canPaste:B}=No();return{nodes:e,edges:t,selectedNodes:c,selectedEdges:u,getNode:f,getEdge:m,addNode:p,removeNode:g,updateNodeData:s,setNodes:n,setEdges:r,clearCanvas:o,selectNode:k,clearSelection:N,duplicateSelected:v,deleteSelected:b,autoLayout:w,fitView:x,zoomToNode:S,undo:C,redo:R,canUndo:T,canRedo:I,copySelected:O,paste:P,canPaste:B}}const iQ={step:O8,subworkflow:L8,trigger:$8,output:F8,if:z8,for_each:U8,while:W8,switch:G8,parallel:X8,try:J8,map:Ap,filter:Ap,reduce:Ap};function oQ(){const{nodes:e,edges:t,onNodesChange:n,onEdgesChange:r,onConnect:s,setNodes:o}=No(),{autoLayout:a,deleteSelected:c,duplicateSelected:u}=SL(),f=qr(Y=>Y.currentWorkflow),{screenToFlowPosition:m}=jo(),p=Tl(),[g,v]=j.useState(null),[b,w]=j.useState(!1),[x,S]=j.useState(null),[k,N]=j.useState(!1),[C,R]=j.useState(null),T=j.useRef(null),I=j.useCallback((Y,ee)=>{if(Y.preventDefault(),ee.type==="trigger"||ee.type==="output")return;const ie=f==null?void 0:f.steps.find(ue=>ue.id===ee.data.id);ie&&(v(ie),w(!0))},[f]),O=j.useCallback(()=>{if(!f)return null;const Y=["step","if","for_each","while","switch","parallel","try","map","filter","reduce"],ee=e.find(ie=>ie.selected&&Y.includes(ie.type||""));return ee&&f.steps.find(ie=>ie.id===ee.data.id)||null},[f,e]),{undo:P,redo:B,canUndo:M,canRedo:L,copySelected:U,paste:$,canPaste:z}=No(),V=j.useCallback(Y=>{const ee=Y.metaKey||Y.ctrlKey;if((Y.key==="Backspace"||Y.key==="Delete")&&c(),ee&&Y.key==="d"&&(Y.preventDefault(),u()),ee&&Y.key==="l"&&(Y.preventDefault(),a()),ee&&Y.key==="z"&&!Y.shiftKey&&(Y.preventDefault(),M()&&P()),(ee&&Y.shiftKey&&Y.key==="z"||ee&&Y.key==="y")&&(Y.preventDefault(),L()&&B()),ee&&Y.key==="c"&&(Y.preventDefault(),U()),ee&&Y.key==="v"&&(Y.preventDefault(),z()&&$()),Y.key==="e"&&!ee&&!Y.shiftKey&&!Y.altKey){Y.preventDefault();const ie=O();ie&&(v(ie),w(!0))}if(Y.key==="y"&&!ee&&!Y.shiftKey&&!Y.altKey){Y.preventDefault();const ie=O();ie&&(S(ie),N(!0))}},[c,u,a,O,P,B,M,L,U,$,z]),G=j.useCallback(Y=>{console.log("Saving step:",Y),w(!1),v(null)},[]),F=j.useCallback(()=>{if(!C||!f)return;const Y=f.steps.find(ee=>ee.id===C.data.id);Y&&(v(Y),w(!0)),R(null)},[C,f]),q=j.useCallback(()=>{if(!C||!f)return;const Y=f.steps.find(ee=>ee.id===C.data.id);Y&&(S(Y),N(!0)),R(null)},[C,f]),X=j.useCallback(()=>{C&&u(),R(null)},[C,u]),D=j.useCallback(()=>{C&&c(),R(null)},[C,c]),W=j.useCallback(()=>{C&&console.log("Execute step:",C.data.id),R(null)},[C]),oe=j.useCallback((Y,ee)=>{Y.preventDefault(),["step","if","for_each","while","switch","parallel","try","map","filter","reduce","subworkflow"].includes(ee.type||"")&&R(ee)},[]),K=j.useCallback(Y=>{Y.preventDefault(),Y.dataTransfer.dropEffect="copy"},[]),J=j.useCallback(Y=>{var ie;Y.preventDefault();const ee=Y.dataTransfer.getData("application/marktoflow-tool");if(ee)try{const ue=JSON.parse(ee),ge=m({x:Y.clientX,y:Y.clientY}),xe=ue.id+"-"+Date.now().toString(36),pe={id:xe,type:"step",position:ge,data:{id:xe,name:ue.name+" Action",action:ue.id+"."+(((ie=ue.actions)==null?void 0:ie[0])||"action"),status:"pending"}};o([...e,pe])}catch(ue){console.error("Failed to parse dropped tool data:",ue)}},[e,o,m]),te=j.useCallback(()=>{if(!f||!g)return[];const Y=[];if(f.inputs)for(const ie of Object.keys(f.inputs))Y.push(`inputs.${ie}`);const ee=f.steps.findIndex(ie=>ie.id===g.id);for(let ie=0;ie<ee;ie++){const ue=f.steps[ie];ue.outputVariable&&Y.push(ue.outputVariable)}return Y},[f,g]);return d.jsxs(LK,{children:[d.jsx(DK,{asChild:!0,children:d.jsx("div",{ref:T,className:"w-full h-full",onKeyDown:V,onDragOver:K,onDrop:J,tabIndex:0,children:d.jsxs(o6,{nodes:e,edges:t,onNodesChange:n,onEdgesChange:r,onConnect:s,onNodeDoubleClick:I,onNodeContextMenu:oe,nodeTypes:iQ,fitView:!0,snapToGrid:!0,snapGrid:[16,16],defaultEdgeOptions:{type:"smoothstep",animated:!0,style:{stroke:"#ff6d5a",strokeWidth:2}},proOptions:{hideAttribution:!0},children:[d.jsx(d6,{variant:Or.Dots,gap:24,size:1,color:"#3d3d5c"}),d.jsx(v6,{}),d.jsx(I6,{nodeColor:Y=>{var ee;switch((ee=Y.data)==null?void 0:ee.status){case"running":return"#f0ad4e";case"completed":return"#5cb85c";case"failed":return"#d9534f";default:return"#2d2d4a"}},maskColor:"rgba(26, 26, 46, 0.8)"})]})})}),d.jsxs(SP,{children:[d.jsxs(eo,{onClick:F,children:[d.jsx(y8,{className:"w-4 h-4 mr-2"}),"Edit Step",d.jsx(Ua,{children:"E"})]}),d.jsxs(eo,{onClick:q,children:[d.jsx(jw,{className:"w-4 h-4 mr-2"}),"View YAML",d.jsx(Ua,{children:"Y"})]}),d.jsx(tw,{}),d.jsxs(eo,{onClick:W,children:[d.jsx(To,{className:"w-4 h-4 mr-2"}),"Execute Step"]}),d.jsx(tw,{}),d.jsxs(eo,{onClick:X,children:[d.jsx(So,{className:"w-4 h-4 mr-2"}),"Duplicate",d.jsxs(Ua,{children:[p,"D"]})]}),d.jsxs(eo,{onClick:D,destructive:!0,children:[d.jsx(Io,{className:"w-4 h-4 mr-2"}),"Delete",d.jsx(Ua,{children:"⌫"})]})]}),d.jsx(ZH,{open:b,onOpenChange:w,step:g,onSave:G,availableVariables:te()}),d.jsx(Cs,{open:k,onOpenChange:N,title:`YAML: ${(x==null?void 0:x.name)||(x==null?void 0:x.id)}`,size:"lg",children:d.jsx("div",{className:"p-4",children:d.jsx(GH,{value:x})})})]})}const _L=Vr((e,t)=>({editingStep:null,isEditorOpen:!1,yamlViewStep:null,isYamlViewOpen:!1,isNewStepOpen:!1,newStepPosition:null,copiedNodes:[],undoStack:[],redoStack:[],openEditor:n=>e({editingStep:n,isEditorOpen:!0}),closeEditor:()=>e({editingStep:null,isEditorOpen:!1}),openYamlViewer:n=>e({yamlViewStep:n,isYamlViewOpen:!0}),closeYamlViewer:()=>e({yamlViewStep:null,isYamlViewOpen:!1}),openNewStepWizard:n=>e({isNewStepOpen:!0,newStepPosition:n??null}),closeNewStepWizard:()=>e({isNewStepOpen:!1,newStepPosition:null}),copyNodes:n=>e({copiedNodes:n.map(r=>({...r}))}),clearClipboard:()=>e({copiedNodes:[]}),pushUndo:n=>{const{undoStack:r}=t();e({undoStack:[...r,n],redoStack:[]})},undo:()=>{const{undoStack:n,redoStack:r}=t();if(n.length===0)return null;const s=n[n.length-1];return e({undoStack:n.slice(0,-1),redoStack:[...r,s]}),s},redo:()=>{const{undoStack:n,redoStack:r}=t();if(r.length===0)return null;const s=r[r.length-1];return e({redoStack:r.slice(0,-1),undoStack:[...n,s]}),s},clearHistory:()=>e({undoStack:[],redoStack:[]})})),NL=Vr((e,t)=>({providers:[],activeProviderId:null,isLoading:!1,error:null,loadProviders:async()=>{e({isLoading:!0,error:null});try{const n=await fetch("/api/ai/providers");if(!n.ok)throw new Error("Failed to load providers");const r=await n.json();e({providers:r.providers,activeProviderId:r.activeProvider,isLoading:!1})}catch(n){console.error("Error loading providers:",n),e({error:n instanceof Error?n.message:"Unknown error",isLoading:!1})}},setProvider:async(n,r)=>{e({isLoading:!0,error:null});try{const s=await fetch(`/api/ai/providers/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r||{})});if(!s.ok){const a=await s.json();throw new Error(a.message||"Failed to set provider")}const o=await s.json();return o.success&&o.status?(e({providers:o.status.providers,activeProviderId:o.status.activeProvider,isLoading:!1}),!0):!1}catch(s){return console.error("Error setting provider:",s),e({error:s instanceof Error?s.message:"Unknown error",isLoading:!1}),!1}},refreshStatus:async()=>{await t().loadProviders()}}));function aQ({open:e,onOpenChange:t}){var k,N,C;const{providers:n,activeProviderId:r,isLoading:s,error:o,loadProviders:a,setProvider:c}=NL(),[u,f]=j.useState(null),[m,p]=j.useState(!1),[g,v]=j.useState({apiKey:"",baseUrl:"",model:""});j.useEffect(()=>{e&&a()},[e,a]);const b=async R=>{const T=n.find(I=>I.id===R);T&&(T.status==="needs_config"?(f(R),p(!0)):T.status==="ready"&&await c(R)&&t(!1))},w=async()=>{if(!u)return;await c(u,g)&&(p(!1),v({apiKey:"",baseUrl:"",model:""}),t(!1))},x=R=>{switch(R){case"ready":return d.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500"});case"needs_config":return d.jsx("div",{className:"w-2 h-2 rounded-full bg-yellow-500"});case"unavailable":return d.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500"});default:return d.jsx("div",{className:"w-2 h-2 rounded-full bg-gray-500"})}},S=R=>{switch(R){case"ready":return"Ready";case"needs_config":return"Needs Configuration";case"unavailable":return"Unavailable";default:return"Unknown"}};if(m){const R=n.find(T=>T.id===u);return R?d.jsxs(Cs,{open:m,onOpenChange:p,title:`Configure ${R.name}`,description:"Enter configuration details for this provider",size:"md",children:[d.jsxs("div",{className:"p-4 space-y-4",children:[((k=R.configOptions)==null?void 0:k.apiKey)&&d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"API Key"}),d.jsx("input",{type:"password",value:g.apiKey,onChange:T=>v({...g,apiKey:T.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"Enter API key"})]}),((N=R.configOptions)==null?void 0:N.baseUrl)&&d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Base URL"}),d.jsx("input",{type:"text",value:g.baseUrl,onChange:T=>v({...g,baseUrl:T.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"Enter base URL"})]}),((C=R.configOptions)==null?void 0:C.model)&&d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Model"}),d.jsx("input",{type:"text",value:g.model,onChange:T=>v({...g,model:T.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"Enter model name"})]})]}),d.jsxs(oi,{children:[d.jsx(Be,{variant:"secondary",onClick:()=>p(!1),children:"Cancel"}),d.jsx(Be,{variant:"primary",onClick:w,disabled:s,children:s?d.jsx(Dr,{className:"w-4 h-4 animate-spin"}):"Save & Activate"})]})]}):null}return d.jsxs(Cs,{open:e,onOpenChange:t,title:"AI Provider",description:"Select which AI provider to use for agent prompts",size:"md",children:[d.jsxs("div",{className:"p-4 space-y-2",children:[o&&d.jsxs("div",{className:"flex items-center gap-2 p-3 bg-error/10 border border-error/30 rounded text-error text-sm",children:[d.jsx(Ro,{className:"w-4 h-4 flex-shrink-0"}),d.jsx("span",{children:o})]}),s&&n.length===0?d.jsx("div",{className:"flex items-center justify-center py-8",children:d.jsx(Dr,{className:"w-6 h-6 animate-spin text-gray-500"})}):d.jsx("div",{className:"space-y-2",children:n.map(R=>{const T=R.status==="unavailable"||R.status!=="ready"&&R.status!=="needs_config";return d.jsxs("button",{onClick:()=>b(R.id),disabled:T,className:`
698
+ w-full flex items-center justify-between p-3 rounded border transition-all
699
+ ${R.isActive?"bg-primary/10 border-primary text-white":"bg-node-bg border-node-border text-gray-300 hover:bg-white/5"}
700
+ ${T?"opacity-50 cursor-not-allowed":"cursor-pointer"}
701
+ `,children:[d.jsxs("div",{className:"flex items-center gap-3",children:[x(R.status),d.jsxs("div",{className:"text-left",children:[d.jsx("div",{className:"font-medium",children:R.name}),R.description&&d.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:R.description})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[R.isActive&&d.jsx(si,{className:"w-4 h-4 text-primary"}),R.status==="needs_config"&&d.jsx($d,{className:"w-4 h-4 text-yellow-500"}),d.jsx("span",{className:"text-xs text-gray-500",children:S(R.status)})]})]},R.id)})})]}),d.jsx(oi,{children:d.jsx(Be,{variant:"secondary",onClick:()=>t(!1),children:"Close"})})]})}function lQ({onAddStep:e,onExecute:t,onSave:n,onValidate:r,isExecuting:s=!1}){const{autoLayout:o,fitView:a,selectedNodes:c,deleteSelected:u,duplicateSelected:f}=SL(),{undo:m,redo:p,undoStack:g,redoStack:v}=_L(),{zoomIn:b,zoomOut:w}=jo(),x=Tl(),{providers:S,activeProviderId:k,loadProviders:N}=NL(),[C,R]=j.useState(!1),T=g.length>0,I=v.length>0,O=c.length>0;j.useEffect(()=>{N()},[N]);const P=S.find(B=>B.id===k);return d.jsxs("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 z-10 flex items-center gap-1 px-2 py-1.5 bg-bg-panel/95 backdrop-blur border border-border-default rounded-lg shadow-lg",children:[d.jsx($n,{icon:d.jsx(Dd,{className:"w-4 h-4"}),label:"Add Step",onClick:e,shortcut:"N"}),d.jsx(La,{}),d.jsx($n,{icon:d.jsx(x8,{className:"w-4 h-4"}),label:"Undo",onClick:()=>m(),disabled:!T,shortcut:`${x}Z`}),d.jsx($n,{icon:d.jsx(d8,{className:"w-4 h-4"}),label:"Redo",onClick:()=>p(),disabled:!I,shortcut:`${x}⇧Z`}),d.jsx(La,{}),d.jsx($n,{icon:d.jsx(So,{className:"w-4 h-4"}),label:"Duplicate",onClick:f,disabled:!O,shortcut:`${x}D`}),d.jsx($n,{icon:d.jsx(Io,{className:"w-4 h-4"}),label:"Delete",onClick:u,disabled:!O,shortcut:"⌫"}),d.jsx(La,{}),d.jsx($n,{icon:d.jsx(c8,{className:"w-4 h-4"}),label:"Auto Layout",onClick:o,shortcut:`${x}L`}),d.jsx($n,{icon:d.jsx(S8,{className:"w-4 h-4"}),label:"Zoom In",onClick:()=>b(),shortcut:`${x}+`}),d.jsx($n,{icon:d.jsx(_8,{className:"w-4 h-4"}),label:"Zoom Out",onClick:()=>w(),shortcut:`${x}-`}),d.jsx($n,{icon:d.jsx(r8,{className:"w-4 h-4"}),label:"Fit View",onClick:a,shortcut:`${x}0`}),d.jsx(La,{}),d.jsxs("button",{onClick:()=>R(!0),className:"flex items-center gap-1.5 px-2 py-1.5 rounded text-sm text-text-secondary hover:text-text-primary hover:bg-bg-hover transition-colors",title:"Select AI Provider",children:[d.jsx(Bu,{className:"w-4 h-4"}),d.jsx("span",{className:"hidden sm:inline text-xs",children:(P==null?void 0:P.name)||"No Provider"}),d.jsx(bs,{className:"w-3 h-3"})]}),d.jsx(La,{}),r&&d.jsx($n,{icon:d.jsx(Pt,{className:"w-4 h-4"}),label:"Validate",onClick:r,shortcut:`${x}T`}),t&&d.jsxs("button",{onClick:()=>t(),className:`flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${s?"bg-error hover:bg-error/90 text-text-inverse":"bg-accent hover:bg-accent-hover text-text-inverse"}`,title:`${s?"Stop":"Execute"} (${x}⏎)`,children:[s?d.jsx(aA,{className:"w-4 h-4"}):d.jsx(To,{className:"w-4 h-4"}),d.jsx("span",{className:"hidden sm:inline",children:s?"Stop":"Execute"})]}),n&&d.jsx($n,{icon:d.jsx(h8,{className:"w-4 h-4"}),label:"Save",onClick:n,shortcut:`${x}S`}),d.jsx(aQ,{open:C,onOpenChange:R})]})}function $n({icon:e,label:t,onClick:n,disabled:r,shortcut:s,variant:o="default"}){const a={default:"text-text-secondary hover:text-text-primary hover:bg-bg-hover",primary:"text-accent hover:text-accent-hover hover:bg-accent-muted",destructive:"text-error hover:text-error hover:bg-error-bg"};return d.jsxs("button",{onClick:n,disabled:r,className:`relative group p-2 rounded transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${a[o]}`,title:`${t}${s?` (${s})`:""}`,children:[e,d.jsxs("div",{className:"absolute top-full left-1/2 -translate-x-1/2 mt-2 px-2 py-1 bg-bg-elevated border border-border-default rounded text-xs text-text-primary whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-tooltip shadow-lg",children:[t,s&&d.jsx("span",{className:"ml-2 text-text-muted",children:s})]})]})}function La(){return d.jsx("div",{className:"w-px h-6 bg-border-default mx-1"})}function cQ({isExecuting:e,isPaused:t,workflowStatus:n,currentStepId:r,steps:s,logs:o,onPause:a,onResume:c,onStop:u,onStepOver:f,onClose:m,debug:p,onToggleDebugMode:g,onToggleBreakpoint:v,onStepInto:b,onStepOut:w,onClearBreakpoints:x,onAddWatchExpression:S,onRemoveWatchExpression:k}){const[N,C]=j.useState("steps"),R=(p==null?void 0:p.enabled)??!1,T=s.filter(P=>P.status==="completed").length,I=s.filter(P=>P.status==="failed").length,O=s.length>0?T/s.length*100:0;return!e&&n==="pending"?null:d.jsxs("div",{className:"absolute bottom-20 left-4 right-4 z-20 bg-bg-panel border border-border-default rounded-lg shadow-xl max-h-[400px] flex flex-col",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border-default",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(hQ,{status:n}),d.jsxs("div",{children:[d.jsx("div",{className:"text-sm font-medium text-text-primary",children:mQ(n)}),d.jsxs("div",{className:"text-xs text-text-secondary",children:[T,"/",s.length," steps completed",I>0&&` • ${I} failed`]})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[g&&d.jsx(Be,{variant:R?"primary":"ghost",size:"sm",onClick:g,icon:d.jsx(RN,{className:"w-4 h-4"}),title:R?"Disable debug mode":"Enable debug mode",children:"Debug"}),e&&d.jsxs(d.Fragment,{children:[t?d.jsx(Be,{variant:"secondary",size:"sm",onClick:c,icon:d.jsx(To,{className:"w-4 h-4"}),children:"Resume"}):d.jsx(Be,{variant:"secondary",size:"sm",onClick:a,icon:d.jsx(aA,{className:"w-4 h-4"}),children:"Pause"}),R&&t&&d.jsxs(d.Fragment,{children:[d.jsx(Be,{variant:"secondary",size:"sm",onClick:f,icon:d.jsx(dl,{className:"w-4 h-4"}),title:"Step Over (F10)",children:"Over"}),b&&d.jsx(Be,{variant:"secondary",size:"sm",onClick:b,icon:d.jsx(q6,{className:"w-4 h-4"}),title:"Step Into (F11)",children:"Into"}),w&&d.jsx(Be,{variant:"secondary",size:"sm",onClick:w,icon:d.jsx(F6,{className:"w-4 h-4"}),title:"Step Out (Shift+F11)",children:"Out"})]}),!R&&d.jsx(Be,{variant:"secondary",size:"sm",onClick:f,icon:d.jsx(cA,{className:"w-4 h-4"}),disabled:!t,children:"Step"}),d.jsx(Be,{variant:"destructive",size:"sm",onClick:u,icon:d.jsx(uA,{className:"w-4 h-4"}),children:"Stop"})]}),!e&&d.jsx(Be,{variant:"secondary",size:"sm",onClick:m,children:"Close"})]})]}),d.jsx("div",{className:"h-1 bg-bg-surface",children:d.jsx("div",{className:`h-full transition-all duration-300 ${n==="failed"?"bg-error":n==="completed"?"bg-success":"bg-primary"}`,style:{width:`${O}%`}})}),d.jsxs("div",{className:"flex border-b border-border-default",children:[d.jsx("button",{onClick:()=>C("steps"),className:`px-4 py-2 text-sm font-medium transition-colors ${N==="steps"?"text-primary border-b-2 border-primary -mb-px":"text-text-secondary hover:text-text-primary"}`,children:"Steps"}),d.jsx("button",{onClick:()=>C("variables"),className:`px-4 py-2 text-sm font-medium transition-colors ${N==="variables"?"text-primary border-b-2 border-primary -mb-px":"text-text-secondary hover:text-text-primary"}`,children:"Variables"}),d.jsx("button",{onClick:()=>C("logs"),className:`px-4 py-2 text-sm font-medium transition-colors ${N==="logs"?"text-primary border-b-2 border-primary -mb-px":"text-text-secondary hover:text-text-primary"}`,children:"Logs"}),R&&d.jsxs("button",{onClick:()=>C("debug"),className:`px-4 py-2 text-sm font-medium transition-colors flex items-center gap-1 ${N==="debug"?"text-primary border-b-2 border-primary -mb-px":"text-text-secondary hover:text-text-primary"}`,children:[d.jsx(RN,{className:"w-3 h-3"}),"Debug"]})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[N==="steps"&&d.jsx(uQ,{steps:s,currentStepId:r,debugEnabled:R,breakpoints:p==null?void 0:p.breakpoints,onToggleBreakpoint:v}),N==="variables"&&d.jsx(fQ,{steps:s}),N==="logs"&&d.jsx(dQ,{logs:o}),N==="debug"&&R&&d.jsx(gQ,{debug:p,onClearBreakpoints:x,onAddWatchExpression:S,onRemoveWatchExpression:k})]})]})}function uQ({steps:e,currentStepId:t,debugEnabled:n,breakpoints:r,onToggleBreakpoint:s}){return d.jsx("div",{className:"space-y-2",children:e.map(o=>{const a=r==null?void 0:r.has(o.stepId);return d.jsxs("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${o.stepId===t?"bg-primary/10 border-primary":a?"bg-error/10 border-error/50":"bg-bg-surface border-border-default"}`,children:[n&&s&&d.jsx("button",{onClick:()=>s(o.stepId),className:`w-4 h-4 rounded-full flex items-center justify-center transition-colors ${a?"bg-error":"bg-transparent border border-gray-500 hover:border-error hover:bg-error/20"}`,title:a?"Remove breakpoint":"Add breakpoint",children:a&&d.jsx(D0,{className:"w-2 h-2 fill-current text-text-primary"})}),d.jsx(pQ,{status:o.status}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-sm font-medium text-text-primary truncate",children:o.stepName||o.stepId}),o.error&&d.jsx("div",{className:"text-xs text-error mt-1 truncate",children:typeof o.error=="string"?o.error:o.error.message||JSON.stringify(o.error)})]}),o.duration!==void 0&&d.jsxs("div",{className:"text-xs text-text-secondary",children:[o.duration,"ms"]})]},o.stepId)})})}function dQ({logs:e}){return d.jsx("div",{className:"font-mono text-xs space-y-1",children:e.length===0?d.jsx("div",{className:"text-text-muted",children:"No logs yet..."}):e.map((t,n)=>d.jsx("div",{className:"text-text-primary",children:t},n))})}function fQ({steps:e}){const[t,n]=j.useState(new Set),[r,s]=j.useState(new Set),[o,a]=j.useState(null),c=e.filter(p=>p.inputs!==void 0||p.output!==void 0&&p.outputVariable),u=p=>{n(g=>{const v=new Set(g);return v.has(p)?v.delete(p):v.add(p),v})},f=p=>{s(g=>{const v=new Set(g);return v.has(p)?v.delete(p):v.add(p),v})},m=async(p,g)=>{try{const v=typeof g=="string"?g:JSON.stringify(g,null,2);await navigator.clipboard.writeText(v),a(p),setTimeout(()=>a(null),2e3)}catch(v){console.error("Failed to copy:",v)}};return c.length===0?d.jsxs("div",{className:"text-center py-8 text-text-muted text-sm",children:["No data available yet.",d.jsx("br",{}),d.jsx("span",{className:"text-xs",children:"Step inputs and outputs will appear as steps execute."})]}):d.jsx("div",{className:"space-y-2",children:c.map(p=>{const g=t.has(p.stepId),v=p.inputs&&Object.keys(p.inputs).length>0,b=p.output!==void 0&&p.outputVariable;return d.jsxs("div",{className:"border border-border-default rounded-lg overflow-hidden",children:[d.jsxs("button",{onClick:()=>u(p.stepId),className:"w-full flex items-center gap-2 px-3 py-2 bg-bg-surface hover:bg-white/5 transition-colors",children:[g?d.jsx(bs,{className:"w-4 h-4 text-text-secondary"}):d.jsx(Qt,{className:"w-4 h-4 text-text-secondary"}),d.jsx("code",{className:"text-sm text-text-primary font-mono",children:p.stepName||p.stepId}),d.jsxs("span",{className:"text-xs text-text-muted ml-auto",children:[v&&`${Object.keys(p.inputs).length} inputs`,v&&b&&" • ",b&&p.outputVariable]})]}),g&&d.jsxs("div",{className:"bg-bg-panel border-t border-border-default",children:[v&&d.jsxs("div",{className:"border-b border-border-default",children:[d.jsxs("button",{onClick:()=>f(`${p.stepId}-inputs`),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-white/5 transition-colors",children:[r.has(`${p.stepId}-inputs`)?d.jsx(bs,{className:"w-3 h-3 text-text-secondary"}):d.jsx(Qt,{className:"w-3 h-3 text-text-secondary"}),d.jsxs("span",{className:"text-xs font-medium text-text-secondary",children:["Inputs (",Object.keys(p.inputs).length,")"]})]}),r.has(`${p.stepId}-inputs`)&&d.jsx("div",{className:"px-3 pb-3",children:d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx("div",{className:"flex-1 overflow-x-auto",children:d.jsx(Nd,{value:p.inputs,onCopy:(w,x)=>m(w,x),copiedKey:o,path:"inputs"})}),d.jsx("button",{onClick:()=>m(`${p.stepId}-inputs`,p.inputs),className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy inputs",children:o===`${p.stepId}-inputs`?d.jsx(si,{className:"w-4 h-4 text-success"}):d.jsx(So,{className:"w-4 h-4 text-text-secondary"})})]})})]}),b&&d.jsxs("div",{children:[d.jsxs("button",{onClick:()=>f(`${p.stepId}-output`),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-white/5 transition-colors",children:[r.has(`${p.stepId}-output`)?d.jsx(bs,{className:"w-3 h-3 text-text-secondary"}):d.jsx(Qt,{className:"w-3 h-3 text-text-secondary"}),d.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"Output"}),d.jsx("code",{className:"text-xs text-primary font-mono ml-auto",children:p.outputVariable})]}),r.has(`${p.stepId}-output`)&&d.jsx("div",{className:"px-3 pb-3",children:d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx("div",{className:"flex-1 overflow-x-auto",children:d.jsx(Nd,{value:p.output,onCopy:(w,x)=>m(w,x),copiedKey:o,path:p.outputVariable||"output"})}),d.jsx("button",{onClick:()=>m(p.outputVariable||"",p.output),className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy output",children:o===p.outputVariable?d.jsx(si,{className:"w-4 h-4 text-success"}):d.jsx(So,{className:"w-4 h-4 text-text-secondary"})})]})})]})]})]},p.stepId)})})}function Nd({value:e,onCopy:t,copiedKey:n,path:r,depth:s=0}){const[o,a]=j.useState(s<2);if(e===null)return d.jsx("span",{className:"text-text-muted font-mono text-xs",children:"null"});if(e===void 0)return d.jsx("span",{className:"text-text-muted font-mono text-xs",children:"undefined"});if(typeof e=="boolean")return d.jsx("span",{className:`font-mono text-xs ${e?"text-success":"text-error"}`,children:String(e)});if(typeof e=="number")return d.jsx("span",{className:"text-warning font-mono text-xs",children:e});if(typeof e=="string"){const c=e.length>200?e.substring(0,200)+"...":e;return d.jsxs("span",{className:"text-success font-mono text-xs",children:['"',c,'"']})}if(Array.isArray(e))return e.length===0?d.jsx("span",{className:"text-text-secondary font-mono text-xs",children:"[]"}):d.jsxs("div",{className:"space-y-1",children:[d.jsxs("button",{onClick:()=>a(!o),className:"flex items-center gap-1 text-text-secondary hover:text-text-primary transition-colors",children:[o?d.jsx(bs,{className:"w-3 h-3"}):d.jsx(Qt,{className:"w-3 h-3"}),d.jsxs("span",{className:"text-xs font-mono",children:["Array(",e.length,")"]})]}),o&&d.jsxs("div",{className:"ml-4 pl-2 border-l border-border-default space-y-1",children:[e.slice(0,20).map((c,u)=>d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsxs("span",{className:"text-text-muted font-mono text-xs",children:["[",u,"]:"]}),d.jsx(Nd,{value:c,onCopy:t,copiedKey:n,path:`${r}[${u}]`,depth:s+1})]},u)),e.length>20&&d.jsxs("div",{className:"text-text-muted text-xs",children:["... and ",e.length-20," more items"]})]})]});if(typeof e=="object"){const c=Object.entries(e);return c.length===0?d.jsx("span",{className:"text-text-secondary font-mono text-xs",children:"{}"}):d.jsxs("div",{className:"space-y-1",children:[d.jsxs("button",{onClick:()=>a(!o),className:"flex items-center gap-1 text-text-secondary hover:text-text-primary transition-colors",children:[o?d.jsx(bs,{className:"w-3 h-3"}):d.jsx(Qt,{className:"w-3 h-3"}),d.jsxs("span",{className:"text-xs font-mono",children:["Object(",c.length," keys)"]})]}),o&&d.jsxs("div",{className:"ml-4 pl-2 border-l border-border-default space-y-1",children:[c.slice(0,30).map(([u,f])=>d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsxs("span",{className:"text-primary font-mono text-xs",children:[u,":"]}),d.jsx(Nd,{value:f,onCopy:t,copiedKey:n,path:`${r}.${u}`,depth:s+1})]},u)),c.length>30&&d.jsxs("div",{className:"text-text-muted text-xs",children:["... and ",c.length-30," more keys"]})]})]})}return d.jsx("span",{className:"text-text-secondary font-mono text-xs",children:String(e)})}function hQ({status:e}){switch(e){case"running":return d.jsx(Dr,{className:"w-5 h-5 text-primary animate-spin"});case"completed":return d.jsx(Pt,{className:"w-5 h-5 text-success"});case"failed":return d.jsx(ot,{className:"w-5 h-5 text-error"});case"cancelled":return d.jsx(uA,{className:"w-5 h-5 text-text-secondary"});default:return d.jsx("div",{className:"w-5 h-5 rounded-full bg-gray-500"})}}function pQ({status:e}){switch(e){case"running":return d.jsx(Dr,{className:"w-4 h-4 text-warning animate-spin"});case"completed":return d.jsx(Pt,{className:"w-4 h-4 text-success"});case"failed":return d.jsx(ot,{className:"w-4 h-4 text-error"});case"skipped":return d.jsx(cA,{className:"w-4 h-4 text-text-secondary"});default:return d.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-gray-500"})}}function mQ(e){switch(e){case"pending":return"Pending";case"running":return"Executing Workflow...";case"completed":return"Workflow Completed";case"failed":return"Workflow Failed";case"cancelled":return"Workflow Cancelled";default:return"Unknown"}}function gQ({debug:e,onClearBreakpoints:t,onAddWatchExpression:n,onRemoveWatchExpression:r}){const[s,o]=j.useState(""),a=()=>{s.trim()&&n&&(n(s.trim()),o(""))};return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("h4",{className:"text-sm font-medium text-text-primary flex items-center gap-2",children:[d.jsx(D0,{className:"w-3 h-3 text-error"}),"Breakpoints (",e.breakpoints.size,")"]}),e.breakpoints.size>0&&t&&d.jsxs("button",{onClick:t,className:"text-xs text-text-secondary hover:text-text-primary flex items-center gap-1",children:[d.jsx(Io,{className:"w-3 h-3"}),"Clear all"]})]}),d.jsx("div",{className:"bg-bg-surface rounded-lg p-3",children:e.breakpoints.size===0?d.jsx("div",{className:"text-xs text-text-muted",children:"No breakpoints set. Click the dot next to a step to add one."}):d.jsx("div",{className:"space-y-1",children:Array.from(e.breakpoints).map(c=>d.jsxs("div",{className:"flex items-center gap-2 text-xs text-text-primary",children:[d.jsx(D0,{className:"w-2 h-2 fill-current text-error"}),d.jsx("span",{className:"font-mono",children:c})]},c))})})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("h4",{className:"text-sm font-medium text-text-primary",children:"Call Stack"}),d.jsx("div",{className:"bg-bg-surface rounded-lg p-3",children:e.callStack.length===0?d.jsx("div",{className:"text-xs text-text-muted",children:"No active call stack"}):d.jsx("div",{className:"space-y-1",children:e.callStack.map((c,u)=>d.jsxs("div",{className:`flex items-center gap-2 text-xs ${u===0?"text-primary":"text-text-secondary"}`,children:[d.jsx(dl,{className:"w-3 h-3"}),d.jsx("span",{className:"font-mono",children:c})]},u))})})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("h4",{className:"text-sm font-medium text-text-primary",children:"Watch Expressions"}),d.jsxs("div",{className:"bg-bg-surface rounded-lg p-3 space-y-2",children:[n&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{type:"text",value:s,onChange:c=>o(c.target.value),onKeyDown:c=>c.key==="Enter"&&a(),placeholder:"Add expression...",className:"flex-1 bg-transparent border border-border-default rounded px-2 py-1 text-xs text-text-primary placeholder-gray-500 focus:outline-none focus:border-primary"}),d.jsx("button",{onClick:a,disabled:!s.trim(),className:"p-1 text-text-secondary hover:text-text-primary disabled:opacity-50",children:d.jsx(Dd,{className:"w-4 h-4"})})]}),e.watchExpressions.length===0?d.jsx("div",{className:"text-xs text-text-muted",children:"No watch expressions. Add an expression to monitor its value."}):d.jsx("div",{className:"space-y-1",children:e.watchExpressions.map(c=>d.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs group",children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx("span",{className:"text-primary font-mono truncate",children:c}),d.jsx("span",{className:"text-text-muted",children:"="}),d.jsx("span",{className:"text-text-primary font-mono truncate",children:"(not evaluated)"})]}),r&&d.jsx("button",{onClick:()=>r(c),className:"p-1 text-text-muted hover:text-error opacity-0 group-hover:opacity-100 transition-opacity",children:d.jsx($r,{className:"w-3 h-3"})})]},c))})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("h4",{className:"text-sm font-medium text-text-primary",children:"Debug State"}),d.jsxs("div",{className:"bg-bg-surface rounded-lg p-3 text-xs space-y-1",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-text-secondary",children:"Current Step:"}),d.jsx("span",{className:"text-text-primary font-mono",children:e.currentStepId||"(none)"})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-text-secondary",children:"Paused at Breakpoint:"}),d.jsx("span",{className:e.pausedAtBreakpoint?"text-error":"text-text-muted",children:e.pausedAtBreakpoint?"Yes":"No"})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-text-secondary",children:"Step Over Pending:"}),d.jsx("span",{className:e.stepOverPending?"text-warning":"text-text-muted",children:e.stepOverPending?"Yes":"No"})]})]})]})]})}function yQ({open:e,onOpenChange:t,inputs:n,onExecute:r,workflowName:s="Workflow"}){const[o,a]=j.useState(()=>{const v={};return Object.entries(n).forEach(([b,w])=>{v[b]=w.default??""}),v}),[c,u]=j.useState({}),f=j.useCallback(()=>{const v={};return Object.entries(n).forEach(([b,w])=>{var S;const x=o[b];if(w.required&&(x===""||x===null||x===void 0)){v[b]=`${w.description||b} is required`;return}if(x!==""&&x!==null&&x!==void 0)switch(w.type){case"number":isNaN(Number(x))&&(v[b]="Must be a valid number");break;case"boolean":typeof x!="boolean"&&x!=="true"&&x!=="false"&&(v[b]="Must be true or false");break}if((S=w.validation)!=null&&S.pattern&&x)try{new RegExp(w.validation.pattern).test(String(x))||(v[b]=w.validation.message||"Invalid format")}catch{console.warn("Invalid regex pattern:",w.validation.pattern)}}),u(v),Object.keys(v).length===0},[n,o]),m=j.useCallback(()=>{if(!f())return;const v={};Object.entries(o).forEach(([b,w])=>{const x=n[b];if(x&&!(w===""&&!x.required))switch(x.type){case"number":v[b]=Number(w);break;case"boolean":v[b]=w===!0||w==="true";break;default:v[b]=w}}),r(v),t(!1)},[f,o,n,r,t]),p=j.useCallback((v,b)=>{a(w=>({...w,[v]:b})),u(w=>{const x={...w};return delete x[v],x})},[]);if(!e)return null;const g=Object.values(n).some(v=>v.required);return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 bg-black/60 z-modal-backdrop backdrop-blur-sm",onClick:()=>t(!1)}),d.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-modal p-4",children:d.jsxs("div",{className:"bg-bg-elevated border border-border-default rounded-xl shadow-xl max-w-lg w-full max-h-[80vh] flex flex-col animate-fade-in",children:[d.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Execute Workflow"}),d.jsx("p",{className:"text-sm text-text-secondary mt-1",children:s})]}),d.jsx("button",{onClick:()=>t(!1),className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors text-text-secondary","aria-label":"Close dialog",children:d.jsx($r,{className:"w-4 h-4"})})]}),d.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:Object.keys(n).length===0?d.jsx("div",{className:"text-center py-8 text-text-muted",children:"This workflow has no input parameters"}):Object.entries(n).map(([v,b])=>{var w;return d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm font-medium text-text-primary mb-2",children:[b.description||v,b.required&&d.jsx("span",{className:"text-error ml-1",children:"*"})]}),b.type==="boolean"?d.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:o[v]===!0||o[v]==="true",onChange:x=>p(v,x.target.checked),className:"w-4 h-4 rounded border-border-default bg-bg-surface text-accent focus:ring-2 focus:ring-accent/50"}),d.jsx("span",{className:"text-sm text-text-secondary",children:b.description||"Enable this option"})]}):d.jsx("input",{type:b.type==="number"?"number":"text",value:o[v]??"",onChange:x=>p(v,x.target.value),placeholder:b.default!==void 0?String(b.default):"",className:`w-full px-3 py-2 bg-bg-surface border rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 transition-colors ${c[v]?"border-error focus:ring-error/50":"border-border-default focus:ring-accent/50"}`}),c[v]&&d.jsxs("div",{className:"flex items-center gap-1.5 mt-1.5 text-xs text-error",children:[d.jsx(Ro,{className:"w-3 h-3"}),d.jsx("span",{children:c[v]})]}),!c[v]&&((w=b.validation)==null?void 0:w.message)&&d.jsx("p",{className:"text-xs text-text-muted mt-1.5",children:b.validation.message})]},v)})}),d.jsxs("div",{className:"flex items-center justify-between p-6 border-t border-border-subtle",children:[d.jsx("div",{className:"text-xs text-text-muted",children:g&&d.jsx("span",{children:"* Required field"})}),d.jsxs("div",{className:"flex gap-3",children:[d.jsx("button",{onClick:()=>t(!1),className:"px-4 py-2 bg-bg-surface border border-border-default hover:bg-bg-hover text-text-primary rounded-lg text-sm font-medium transition-colors",children:"Cancel"}),d.jsxs("button",{onClick:m,className:"px-4 py-2 bg-accent hover:bg-accent-hover text-text-inverse rounded-lg text-sm font-medium transition-colors flex items-center gap-2",children:[d.jsx(To,{className:"w-4 h-4"}),"Execute"]})]})]})]})})]})}function vQ({workflowPath:e,onClose:t}){const[n,r]=j.useState(!1),[s,o]=j.useState(null);j.useEffect(()=>{e&&a(e)},[e]);const a=async c=>{r(!0),o(null);try{const u=await fetch(`/api/execute/${encodeURIComponent(c)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dryRun:!0})}),f=await u.json();u.ok?o(f):o({valid:!1,error:f.message||"Validation failed"})}catch(u){o({valid:!1,error:u instanceof Error?u.message:"Unknown error"})}finally{r(!1)}};return e?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 bg-black/60 z-modal-backdrop backdrop-blur-sm",onClick:t}),d.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-modal p-4",children:d.jsxs("div",{className:"bg-bg-elevated border border-border-default rounded-xl shadow-xl max-w-2xl w-full max-h-[80vh] flex flex-col animate-fade-in",children:[d.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Workflow Validation"}),d.jsx("p",{className:"text-sm text-text-secondary mt-1",children:"Dry-run analysis results"})]}),d.jsx("button",{onClick:t,className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors text-text-secondary","aria-label":"Close validation panel",children:d.jsx($r,{className:"w-4 h-4"})})]}),d.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:n?d.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[d.jsx(Dr,{className:"w-12 h-12 text-accent animate-spin mb-4"}),d.jsx("p",{className:"text-sm text-text-secondary",children:"Validating workflow..."})]}):s?d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:`flex items-start gap-3 p-4 rounded-lg border ${s.valid?"bg-success-bg border-success/30":"bg-error-bg border-error/30"}`,children:[s.valid?d.jsx(Pt,{className:"w-5 h-5 text-success flex-shrink-0 mt-0.5"}):d.jsx(ot,{className:"w-5 h-5 text-error flex-shrink-0 mt-0.5"}),d.jsxs("div",{className:"flex-1",children:[d.jsx("h3",{className:`text-sm font-medium ${s.valid?"text-success":"text-error"}`,children:s.valid?"Workflow is valid":"Validation failed"}),s.error&&d.jsx("p",{className:"text-sm text-text-secondary mt-1",children:s.error})]})]}),s.workflow&&d.jsxs("div",{className:"space-y-3",children:[d.jsx("h3",{className:"text-sm font-medium text-text-primary",children:"Workflow Details"}),d.jsxs("div",{className:"bg-bg-surface border border-border-default rounded-lg p-4 space-y-2",children:[d.jsxs("div",{className:"flex justify-between text-sm",children:[d.jsx("span",{className:"text-text-secondary",children:"Name:"}),d.jsx("span",{className:"text-text-primary font-medium",children:s.workflow.name})]}),s.workflow.version&&d.jsxs("div",{className:"flex justify-between text-sm",children:[d.jsx("span",{className:"text-text-secondary",children:"Version:"}),d.jsx("span",{className:"text-text-primary",children:s.workflow.version})]}),s.workflow.description&&d.jsxs("div",{className:"text-sm",children:[d.jsx("span",{className:"text-text-secondary",children:"Description:"}),d.jsx("p",{className:"text-text-primary mt-1",children:s.workflow.description})]})]})]}),s.steps&&s.steps.length>0&&d.jsxs("div",{className:"space-y-3",children:[d.jsxs("h3",{className:"text-sm font-medium text-text-primary",children:["Steps (",s.steps.length,")"]}),d.jsx("div",{className:"space-y-2",children:s.steps.map((c,u)=>d.jsx("div",{className:"bg-bg-surface border border-border-default rounded-lg p-3",children:d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-accent/10 text-accent text-xs font-medium flex items-center justify-center",children:u+1}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-text-primary",children:c.action}),c.description&&d.jsx("p",{className:"text-xs text-text-secondary mt-1",children:c.description})]})]})},c.id))})]}),s.warnings&&s.warnings.length>0&&d.jsxs("div",{className:"space-y-3",children:[d.jsxs("h3",{className:"text-sm font-medium text-text-primary flex items-center gap-2",children:[d.jsx(jl,{className:"w-4 h-4 text-warning"}),"Warnings (",s.warnings.length,")"]}),d.jsx("div",{className:"space-y-2",children:s.warnings.map((c,u)=>d.jsx("div",{className:"bg-warning-bg border border-warning/30 rounded-lg p-3",children:d.jsx("p",{className:"text-sm text-text-primary",children:c})},u))})]}),s.inputs&&Object.keys(s.inputs).length>0&&d.jsxs("div",{className:"space-y-3",children:[d.jsxs("h3",{className:"text-sm font-medium text-text-primary",children:["Required Inputs (",Object.keys(s.inputs).length,")"]}),d.jsx("div",{className:"bg-bg-surface border border-border-default rounded-lg p-4 space-y-2",children:Object.entries(s.inputs).map(([c,u])=>d.jsxs("div",{className:"flex justify-between text-sm",children:[d.jsxs("span",{className:"text-text-secondary",children:[c,u.required&&d.jsx("span",{className:"text-error ml-1",children:"*"})]}),d.jsx("span",{className:"text-text-primary font-mono text-xs",children:u.type||"string"})]},c))})]})]}):null}),d.jsx("div",{className:"flex items-center justify-end p-6 border-t border-border-subtle",children:d.jsx("button",{onClick:t,className:"px-4 py-2 bg-accent hover:bg-accent-hover text-text-inverse rounded-lg text-sm font-medium transition-colors",children:"Close"})})]})})]}):null}function xQ(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var o;const a=u=>u===null?null:JSON.parse(u,void 0),c=(o=n.getItem(s))!=null?o:null;return c instanceof Promise?c.then(a):a(c)},setItem:(s,o)=>n.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>n.removeItem(s)}}const nw=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return nw(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return nw(r)(n)}}}},wQ=(e,t)=>(n,r,s)=>{let o={storage:xQ(()=>localStorage),partialize:x=>x,version:0,merge:(x,S)=>({...S,...x}),...t},a=!1,c=0;const u=new Set,f=new Set;let m=o.storage;if(!m)return e((...x)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...x)},r,s);const p=()=>{const x=o.partialize({...r()});return m.setItem(o.name,{state:x,version:o.version})},g=s.setState;s.setState=(x,S)=>(g(x,S),p());const v=e((...x)=>(n(...x),p()),r,s);s.getInitialState=()=>v;let b;const w=()=>{var x,S;if(!m)return;const k=++c;a=!1,u.forEach(C=>{var R;return C((R=r())!=null?R:v)});const N=((S=o.onRehydrateStorage)==null?void 0:S.call(o,(x=r())!=null?x:v))||void 0;return nw(m.getItem.bind(m))(o.name).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==o.version){if(o.migrate){const R=o.migrate(C.state,C.version);return R instanceof Promise?R.then(T=>[!0,T]):[!0,R]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,C.state];return[!1,void 0]}).then(C=>{var R;if(k!==c)return;const[T,I]=C;if(b=o.merge(I,(R=r())!=null?R:v),n(b,!0),T)return p()}).then(()=>{k===c&&(N==null||N(b,void 0),b=r(),a=!0,f.forEach(C=>C(b)))}).catch(C=>{k===c&&(N==null||N(void 0,C))})};return s.persist={setOptions:x=>{o={...o,...x},x.storage&&(m=x.storage)},clearStorage:()=>{m==null||m.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>w(),hasHydrated:()=>a,onHydrate:x=>(u.add(x),()=>{u.delete(x)}),onFinishHydration:x=>(f.add(x),()=>{f.delete(x)})},o.skipHydration||w(),b||v},kL=wQ,tT={tablet:768,desktop:1024};function bQ(e){return e>=tT.desktop?"desktop":e>=tT.tablet?"tablet":"mobile"}const qb=Vr()(kL((e,t)=>({sidebarOpen:!0,propertiesPanelOpen:!0,mobileMenuOpen:!1,breakpoint:"desktop",toggleSidebar:()=>e(n=>({sidebarOpen:!n.sidebarOpen})),setSidebarOpen:n=>e({sidebarOpen:n}),togglePropertiesPanel:()=>e(n=>({propertiesPanelOpen:!n.propertiesPanelOpen})),setPropertiesPanelOpen:n=>e({propertiesPanelOpen:n}),toggleMobileMenu:()=>e(n=>({mobileMenuOpen:!n.mobileMenuOpen})),setMobileMenuOpen:n=>e({mobileMenuOpen:n}),setBreakpoint:n=>{t(),e(n==="mobile"?{breakpoint:n,sidebarOpen:!1,propertiesPanelOpen:!1}:n==="tablet"?{breakpoint:n,sidebarOpen:!0,propertiesPanelOpen:!1}:{breakpoint:n,sidebarOpen:!0,propertiesPanelOpen:!0})},closeAllPanels:()=>e({sidebarOpen:!1,propertiesPanelOpen:!1,mobileMenuOpen:!1})}),{name:"marktoflow-layout",partialize:e=>({sidebarOpen:e.sidebarOpen,propertiesPanelOpen:e.propertiesPanelOpen})}));function SQ({open:e,onOpenChange:t,onImportComplete:n}){const[r,s]=j.useState(null),[o,a]=j.useState(!1),[c,u]=j.useState([]),[f,m]=j.useState(!1),p=j.useRef(null),g=C=>{var T;const R=(T=C.target.files)==null?void 0:T[0];R&&(s(R),u([]))},v=C=>{C.preventDefault(),C.stopPropagation(),m(!0)},b=C=>{C.preventDefault(),C.stopPropagation(),m(!1)},w=C=>{var T;C.preventDefault(),C.stopPropagation(),m(!1);const R=(T=C.dataTransfer.files)==null?void 0:T[0];R&&(s(R),u([]))},x=async()=>{if(r){a(!0),u([]);try{const C=new FormData;C.append("file",r);const R=await fetch("/api/workflows/import",{method:"POST",body:C});if(!R.ok){const I=await R.json();throw new Error(I.message||"Upload failed")}const T=await R.json();Array.isArray(T.results)?u(T.results):T.success&&u([{success:!0,filename:T.filename||r.name,message:T.message}]),setTimeout(()=>{n&&n()},1500)}catch(C){u([{success:!1,filename:r.name,message:C instanceof Error?C.message:"Unknown error"}])}finally{a(!1)}}},S=()=>{s(null),u([]),t(!1)},k=C=>C?[".md",".yaml",".yml",".zip"].some(T=>C.name.toLowerCase().endsWith(T)):!1,N=C=>C.endsWith(".zip")?d.jsx($6,{className:"w-5 h-5 text-purple-400"}):d.jsx(_o,{className:"w-5 h-5 text-blue-400"});return d.jsxs(Cs,{open:e,onOpenChange:t,title:"Import Workflow",description:"Upload workflow files from your computer",size:"md",children:[d.jsxs("div",{className:"p-4 space-y-4",children:[!r&&c.length===0&&d.jsxs("div",{onClick:()=>{var C;return(C=p.current)==null?void 0:C.click()},onDragOver:v,onDragLeave:b,onDrop:w,className:`
702
+ border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors
703
+ ${f?"border-primary bg-primary/10":"border-node-border hover:border-primary/50 hover:bg-white/5"}
704
+ `,children:[d.jsx(dA,{className:"w-12 h-12 mx-auto mb-4 text-gray-500"}),d.jsx("p",{className:"text-sm text-gray-300 mb-2",children:"Drag and drop a file here, or click to browse"}),d.jsx("p",{className:"text-xs text-gray-500",children:"Supported formats: .md, .yaml, .yml, .zip"}),d.jsx("input",{ref:p,type:"file",accept:".md,.yaml,.yml,.zip",onChange:g,className:"hidden"})]}),r&&c.length===0&&d.jsxs("div",{className:"border border-node-border rounded-lg p-4",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[N(r.name),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-white truncate",children:r.name}),d.jsxs("p",{className:"text-xs text-gray-500",children:[(r.size/1024).toFixed(2)," KB"]})]}),!k(r)&&d.jsx(Ro,{className:"w-5 h-5 text-error flex-shrink-0"})]}),!k(r)&&d.jsx("p",{className:"text-xs text-error mt-2",children:"Invalid file type. Please select a .md, .yaml, .yml, or .zip file."})]}),c.length>0&&d.jsxs("div",{className:"space-y-2",children:[d.jsx("h4",{className:"text-sm font-medium text-white",children:"Import Results:"}),c.map((C,R)=>d.jsxs("div",{className:`
705
+ flex items-start gap-3 p-3 rounded-lg border
706
+ ${C.success?"border-success/30 bg-success/10":"border-error/30 bg-error/10"}
707
+ `,children:[C.success?d.jsx(Pt,{className:"w-5 h-5 text-success flex-shrink-0 mt-0.5"}):d.jsx(ot,{className:"w-5 h-5 text-error flex-shrink-0 mt-0.5"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-white truncate",children:C.filename}),C.message&&d.jsx("p",{className:"text-xs text-gray-400 mt-1",children:C.message})]})]},R))]})]}),d.jsx(oi,{children:c.length>0?d.jsx(Be,{variant:"secondary",onClick:S,children:"Close"}):d.jsxs(d.Fragment,{children:[d.jsx(Be,{variant:"secondary",onClick:S,disabled:o,children:"Cancel"}),d.jsx(Be,{variant:"primary",onClick:x,disabled:!r||!k(r)||o,children:o?"Uploading...":"Import"})]})})]})}const _Q=[{id:"blank",name:"Blank Workflow",description:"Start from scratch with an empty workflow",icon:d.jsx(_o,{className:"w-5 h-5"}),category:"General"},{id:"slack-notification",name:"Slack Notification",description:"Send messages to Slack channels",icon:d.jsx(oA,{className:"w-5 h-5"}),category:"Communication"},{id:"github-pr",name:"GitHub Pull Request",description:"Create and manage GitHub pull requests",icon:d.jsx(Z6,{className:"w-5 h-5"}),category:"Development"},{id:"http-request",name:"HTTP Request",description:"Make HTTP API calls and process responses",icon:d.jsx(sA,{className:"w-5 h-5"}),category:"Integration"},{id:"scheduled-task",name:"Scheduled Task",description:"Run workflows on a schedule with cron triggers",icon:d.jsx(jn,{className:"w-5 h-5"}),category:"Automation"}];function NQ({open:e,onOpenChange:t,onCreate:n}){const[r,s]=j.useState(""),[o,a]=j.useState("blank"),[c,u]=j.useState(""),f=j.useCallback(()=>{if(!r.trim()){u("Workflow name is required");return}n(r.trim(),o),s(""),a("blank"),u(""),t(!1)},[r,o,n,t]),m=j.useCallback(()=>{s(""),a("blank"),u(""),t(!1)},[t]);return e?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 bg-black/60 z-modal-backdrop backdrop-blur-sm",onClick:m}),d.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-modal p-4",children:d.jsxs("div",{className:"bg-bg-elevated border border-border-default rounded-xl shadow-xl max-w-2xl w-full max-h-[80vh] flex flex-col animate-fade-in",children:[d.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Create New Workflow"}),d.jsx("p",{className:"text-sm text-text-secondary mt-1",children:"Choose a template to get started quickly"})]}),d.jsx("button",{onClick:m,className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors text-text-secondary","aria-label":"Close dialog",children:d.jsx($r,{className:"w-4 h-4"})})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm font-medium text-text-primary mb-2",children:["Workflow Name ",d.jsx("span",{className:"text-error",children:"*"})]}),d.jsx("input",{type:"text",value:r,onChange:p=>{s(p.target.value),u("")},placeholder:"e.g., Daily Standup Reminder",className:`w-full px-3 py-2 bg-bg-surface border rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 transition-colors ${c?"border-error focus:ring-error/50":"border-border-default focus:ring-accent/50"}`,autoFocus:!0}),c&&d.jsx("p",{className:"text-xs text-error mt-1.5",children:c})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-text-primary mb-3",children:"Template"}),d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:_Q.map(p=>d.jsx("button",{onClick:()=>a(p.id),className:`p-4 rounded-lg border-2 text-left transition-all ${o===p.id?"border-accent bg-accent-muted":"border-border-default hover:border-border-strong bg-bg-surface"}`,children:d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("div",{className:`flex-shrink-0 w-10 h-10 rounded-lg flex items-center justify-center ${o===p.id?"bg-accent text-text-inverse":"bg-bg-elevated text-text-secondary"}`,children:p.icon}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsx("h3",{className:"text-sm font-medium text-text-primary truncate",children:p.name}),o===p.id&&d.jsx("div",{className:"flex-shrink-0 w-2 h-2 rounded-full bg-accent"})]}),d.jsx("p",{className:"text-xs text-text-secondary line-clamp-2",children:p.description})]})]})},p.id))})]})]}),d.jsxs("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-border-subtle",children:[d.jsx("button",{onClick:m,className:"px-4 py-2 bg-bg-surface border border-border-default hover:bg-bg-hover text-text-primary rounded-lg text-sm font-medium transition-colors",children:"Cancel"}),d.jsx("button",{onClick:f,className:"px-4 py-2 bg-accent hover:bg-accent-hover text-text-inverse rounded-lg text-sm font-medium transition-colors",children:"Create Workflow"})]})]})})]}):null}function kQ(){const[e,t]=j.useState("workflows"),{workflows:n,selectedWorkflow:r,selectWorkflow:s}=qr(),{resetNavigation:o}=Tw(),{sidebarOpen:a,setSidebarOpen:c,breakpoint:u}=qb(),f=j.useCallback(m=>{o(),s(m),u==="mobile"&&c(!1)},[o,s,u,c]);return!a&&u!=="mobile"?d.jsxs("button",{onClick:()=>c(!0),className:"w-12 bg-bg-panel border-r border-border-default flex flex-col items-center py-4 gap-4 hover:bg-bg-hover transition-colors","aria-label":"Expand sidebar",children:[d.jsx(Qt,{className:"w-4 h-4 text-text-secondary"}),d.jsx(rA,{className:"w-5 h-5 text-accent"})]}):u==="mobile"?a?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 md:hidden",onClick:()=>c(!1)}),d.jsx("div",{className:"fixed inset-y-0 left-0 w-72 bg-bg-panel border-r border-border-default flex flex-col z-50 md:hidden animate-slide-in-left",children:d.jsx(nT,{activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:f,onClose:()=>c(!1),showClose:!0})})]}):null:d.jsx("div",{className:"w-64 bg-bg-panel border-r border-border-default flex flex-col",children:d.jsx(nT,{activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:f,onClose:()=>c(!1),showClose:u==="tablet"})})}function nT({activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:s,onClose:o,showClose:a}){const[c,u]=j.useState(!1),[f,m]=j.useState(!1),[p,g]=j.useState(""),{fetchWorkflows:v}=qr(),b=j.useCallback(async(x,S)=>{try{const k=await fetch("/api/workflows",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:x,template:S})});if(!k.ok){const C=await k.json();console.error("Failed to create workflow:",C);return}const N=await k.json();console.log("Created workflow:",N),await v(),N.path&&s(N.path)}catch(k){console.error("Failed to create workflow:",k)}},[v,s]),w=n.filter(x=>{if(!p.trim())return!0;const S=p.toLowerCase();return x.name.toLowerCase().includes(S)||x.path.toLowerCase().includes(S)});return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"p-4 border-b border-border-default flex items-center justify-between",children:[d.jsxs("h1",{className:"text-lg font-semibold text-text-primary flex items-center gap-2",children:[d.jsx(rA,{className:"w-5 h-5 text-accent"}),"Marktoflow"]}),a&&d.jsx("button",{onClick:o,className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors","aria-label":"Close sidebar",children:d.jsx($r,{className:"w-4 h-4 text-text-secondary"})})]}),d.jsxs("div",{className:"flex border-b border-border-default",children:[d.jsx("button",{onClick:()=>t("workflows"),className:`flex-1 px-4 py-2 text-sm font-medium transition-colors ${e==="workflows"?"text-accent border-b-2 border-accent":"text-text-secondary hover:text-text-primary"}`,children:"Workflows"}),d.jsx("button",{onClick:()=>t("tools"),className:`flex-1 px-4 py-2 text-sm font-medium transition-colors ${e==="tools"?"text-accent border-b-2 border-accent":"text-text-secondary hover:text-text-primary"}`,children:"Tools"})]}),d.jsx("div",{className:"p-3 border-b border-border-default",children:d.jsxs("div",{className:"relative",children:[d.jsx(ud,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-text-muted"}),d.jsx("input",{type:"text",value:p,onChange:x=>g(x.target.value),placeholder:`Search ${e}...`,className:"w-full pl-9 pr-3 py-2 bg-bg-surface border border-border-default rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-accent/50 focus:border-accent transition-colors"}),p&&d.jsx("button",{onClick:()=>g(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary","aria-label":"Clear search",children:d.jsx($r,{className:"w-4 h-4"})})]})}),d.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:e==="workflows"?d.jsx(CQ,{workflows:w,selectedWorkflow:r,onSelect:s,searchQuery:p}):d.jsx(jQ,{})}),e==="workflows"&&d.jsxs("div",{className:"p-3 border-t border-border-default space-y-2",children:[d.jsxs("button",{onClick:()=>m(!0),className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-accent hover:bg-accent-hover text-text-inverse rounded-lg text-sm font-medium transition-colors shadow-sm",children:[d.jsx(Dd,{className:"w-4 h-4"}),"New Workflow"]}),d.jsxs("button",{onClick:()=>u(!0),className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-bg-surface border border-border-default hover:bg-bg-hover text-text-primary rounded-lg text-sm font-medium transition-colors",children:[d.jsx(dA,{className:"w-4 h-4"}),"Import"]})]}),d.jsx(SQ,{open:c,onOpenChange:u,onImportComplete:()=>v()}),d.jsx(NQ,{open:f,onOpenChange:m,onCreate:b})]})}function CQ({workflows:e,selectedWorkflow:t,onSelect:n,searchQuery:r=""}){return e.length===0?d.jsx("div",{className:"text-center py-8 text-text-muted text-sm",children:r?d.jsxs(d.Fragment,{children:[d.jsx(ud,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),d.jsxs("p",{children:['No workflows match "',r,'"']})]}):d.jsxs(d.Fragment,{children:[d.jsx(_o,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),d.jsx("p",{children:"No workflows found"}),d.jsx("p",{className:"text-xs mt-1 text-text-muted",children:"Create your first workflow to get started"})]})}):d.jsx("div",{className:"space-y-1",children:e.map(s=>d.jsxs("button",{onClick:()=>n(s.path),className:`w-full flex items-center gap-2 px-3 py-2 rounded-lg text-left transition-colors ${t===s.path?"bg-accent-muted text-accent border border-accent/20":"text-text-secondary hover:bg-bg-hover hover:text-text-primary"}`,children:[d.jsx(_o,{className:"w-4 h-4 flex-shrink-0"}),d.jsx("span",{className:"text-sm truncate",children:s.name}),d.jsx(Qt,{className:"w-4 h-4 ml-auto flex-shrink-0 opacity-50"})]},s.path))})}const EQ=[{id:"slack",name:"Slack",icon:"💬",category:"Communication",sdk:"@slack/web-api"},{id:"github",name:"GitHub",icon:"🐙",category:"Development",sdk:"@octokit/rest"},{id:"jira",name:"Jira",icon:"📋",category:"Project Management",sdk:"jira.js"},{id:"gmail",name:"Gmail",icon:"📧",category:"Communication",sdk:"googleapis"},{id:"http",name:"HTTP",icon:"🌐",category:"Network"},{id:"claude",name:"Claude",icon:"🤖",category:"AI"}];function jQ(){const[e,t]=j.useState(EQ),[n,r]=j.useState(!0),[s,o]=j.useState("");j.useEffect(()=>{async function f(){try{const m=await fetch("/api/tools");if(m.ok){const p=await m.json();t(p.tools)}}catch(m){console.error("Failed to fetch tools:",m)}finally{r(!1)}}f()},[]);const a=s?e.filter(f=>{var m;return f.name.toLowerCase().includes(s.toLowerCase())||f.category.toLowerCase().includes(s.toLowerCase())||((m=f.description)==null?void 0:m.toLowerCase().includes(s.toLowerCase()))}):e,c=[...new Set(a.map(f=>f.category))],u=(f,m)=>{f.dataTransfer.setData("application/marktoflow-tool",JSON.stringify(m)),f.dataTransfer.effectAllowed="copy"};return n?d.jsx("div",{className:"flex items-center justify-center py-8",children:d.jsx(Dr,{className:"w-5 h-5 text-gray-500 animate-spin"})}):d.jsxs("div",{className:"space-y-4",children:[c.map(f=>d.jsxs("div",{children:[d.jsx("h3",{className:"text-xs font-medium text-gray-500 uppercase tracking-wider px-2 mb-2",children:f}),d.jsx("div",{className:"space-y-1",children:a.filter(m=>m.category===f).map(m=>d.jsxs("div",{draggable:!0,onDragStart:p=>u(p,m),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-gray-300 hover:bg-white/5 cursor-grab active:cursor-grabbing transition-colors group",title:m.description||(m.sdk?"SDK: "+m.sdk:void 0),children:[d.jsx("span",{className:"text-lg",children:m.icon}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("span",{className:"text-sm block truncate",children:m.name}),m.actionCount!==void 0&&d.jsxs("span",{className:"text-xs text-gray-500",children:[m.actionCount," actions"]})]})]},m.id))})]},f)),a.length===0&&d.jsx("div",{className:"text-center py-8 text-gray-500 text-sm",children:"No tools found"})]})}const rT={enabled:!1,breakpoints:new Set,currentStepId:null,pausedAtBreakpoint:!1,stepOverPending:!1,watchExpressions:[],callStack:[]},CL=Vr((e,t)=>({runs:[],currentRunId:null,isExecuting:!1,isPaused:!1,isLoadingHistory:!1,debug:rT,startExecution:(n,r,s,o)=>{const a=o||"run-"+Date.now()+"-"+Math.random().toString(36).slice(2,8),c={id:a,workflowId:n,workflowName:r,status:"running",startTime:new Date().toISOString(),steps:[],logs:["Starting workflow execution: "+r],inputs:s};return e({runs:[c,...t().runs].slice(0,50),currentRunId:a,isExecuting:!0,isPaused:!1}),a},updateStepStatus:(n,r,s,o,a,c,u)=>{const{debug:f}=t(),m=f.enabled&&s==="running"&&f.breakpoints.has(r);e({runs:t().runs.map(p=>{if(p.id!==n)return p;const g=p.steps.find(b=>b.stepId===r),v=new Date().toISOString();return g?{...p,steps:p.steps.map(b=>{if(b.stepId!==r)return b;const w=s!=="running"?v:void 0,x=w&&b.startTime?new Date(w).getTime()-new Date(b.startTime).getTime():void 0;return{...b,status:s,endTime:w,duration:x,inputs:u??b.inputs,output:o??b.output,outputVariable:c??b.outputVariable,error:a??b.error}})}:{...p,steps:[...p.steps,{stepId:r,stepName:r,status:s,startTime:v,inputs:u,output:o,outputVariable:c,error:a}]}}),...m?{isPaused:!0,debug:{...t().debug,currentStepId:r,pausedAtBreakpoint:!0,stepOverPending:!1}}:{debug:{...t().debug,currentStepId:s==="running"?r:t().debug.currentStepId}}}),m&&t().addLog(n,`⏸️ Paused at breakpoint: ${r}`)},completeExecution:(n,r,s)=>{const o=new Date().toISOString();e({runs:t().runs.map(a=>{if(a.id!==n)return a;const c=new Date(o).getTime()-new Date(a.startTime).getTime();return{...a,status:r,endTime:o,duration:c,outputs:s,logs:[...a.logs,r==="completed"?"Workflow completed successfully":r==="failed"?"Workflow execution failed":"Workflow execution cancelled"]}}),currentRunId:null,isExecuting:!1,isPaused:!1})},addLog:(n,r)=>{e({runs:t().runs.map(s=>s.id===n?{...s,logs:[...s.logs,"["+new Date().toLocaleTimeString()+"] "+r]}:s)})},pauseExecution:()=>{e({isPaused:!0});const{currentRunId:n,runs:r}=t();n&&r.find(o=>o.id===n)&&t().addLog(n,"Execution paused")},resumeExecution:()=>{e({isPaused:!1});const{currentRunId:n}=t();n&&t().addLog(n,"Execution resumed")},cancelExecution:n=>{t().addLog(n,"Execution cancelled by user"),t().completeExecution(n,"cancelled")},clearHistory:()=>{e({runs:[]})},getRun:n=>t().runs.find(r=>r.id===n),enableDebugMode:()=>{e({debug:{...t().debug,enabled:!0}});const{currentRunId:n}=t();n&&t().addLog(n,"🐛 Debug mode enabled")},disableDebugMode:()=>{e({debug:{...rT,breakpoints:t().debug.breakpoints}});const{currentRunId:n}=t();n&&t().addLog(n,"🐛 Debug mode disabled")},toggleBreakpoint:n=>{const{debug:r}=t(),s=new Set(r.breakpoints);s.has(n)?s.delete(n):s.add(n),e({debug:{...r,breakpoints:s}})},hasBreakpoint:n=>t().debug.breakpoints.has(n),clearAllBreakpoints:()=>{e({debug:{...t().debug,breakpoints:new Set}});const{currentRunId:n}=t();n&&t().addLog(n,"All breakpoints cleared")},stepOver:()=>{const{debug:n,currentRunId:r,isPaused:s}=t();!s||!n.enabled||(e({isPaused:!1,debug:{...n,stepOverPending:!0,pausedAtBreakpoint:!1}}),r&&t().addLog(r,"➡️ Step over"))},stepInto:()=>{const{debug:n,currentRunId:r,isPaused:s}=t();!s||!n.enabled||(e({isPaused:!1,debug:{...n,stepOverPending:!0,pausedAtBreakpoint:!1}}),r&&t().addLog(r,"⬇️ Step into"))},stepOut:()=>{const{debug:n,currentRunId:r,isPaused:s}=t();!s||!n.enabled||(e({isPaused:!1,debug:{...n,stepOverPending:!1,pausedAtBreakpoint:!1}}),r&&t().addLog(r,"⬆️ Step out"))},setCurrentDebugStep:n=>{e({debug:{...t().debug,currentStepId:n}})},addWatchExpression:n=>{const{debug:r}=t();r.watchExpressions.includes(n)||e({debug:{...r,watchExpressions:[...r.watchExpressions,n]}})},removeWatchExpression:n=>{const{debug:r}=t();e({debug:{...r,watchExpressions:r.watchExpressions.filter(s=>s!==n)}})},updateCallStack:n=>{e({debug:{...t().debug,callStack:n}})},loadHistory:async n=>{e({isLoadingHistory:!0});try{const r=n?`/api/executions?workflowId=${encodeURIComponent(n)}&limit=50`:"/api/executions?limit=50",s=await fetch(r);if(!s.ok)throw new Error("Failed to load execution history");const a=(await s.json()).map(f=>{var m;return{id:f.runId,workflowId:f.workflowId,workflowName:((m=f.workflowPath.split("/").pop())==null?void 0:m.replace(".md",""))||f.workflowId,status:f.status,startTime:f.startedAt,endTime:f.completedAt||void 0,duration:f.completedAt?new Date(f.completedAt).getTime()-new Date(f.startedAt).getTime():void 0,steps:[],logs:[],inputs:f.inputs||void 0,outputs:f.outputs||void 0}}),c=new Set(t().runs.map(f=>f.id)),u=a.filter(f=>!c.has(f.id));e({runs:[...t().runs,...u].slice(0,50),isLoadingHistory:!1})}catch(r){console.error("Error loading execution history:",r),e({isLoadingHistory:!1})}},syncRunWithBackend:async n=>{console.log("Syncing run with backend:",n)}}));function rw(e){if(e<1e3)return e+"ms";if(e<6e4)return(e/1e3).toFixed(1)+"s";const t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3);return t+"m "+n+"s"}function RQ(e){const t=new Date,n=new Date(e),r=t.getTime()-n.getTime(),s=Math.floor(r/1e3),o=Math.floor(s/60),a=Math.floor(o/60),c=Math.floor(a/24);return s<60?"just now":o<60?o+" min ago":a<24?a+" hour"+(a>1?"s":"")+" ago":c<7?c+" day"+(c>1?"s":"")+" ago":n.toLocaleDateString()}function TQ(){const[e,t]=j.useState("properties"),n=No(u=>u.nodes),r=j.useMemo(()=>n.filter(u=>u.selected),[n]),s=qr(u=>u.currentWorkflow),{propertiesPanelOpen:o,setPropertiesPanelOpen:a,breakpoint:c}=qb();return c==="mobile"?o?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:()=>a(!1)}),d.jsx("div",{className:"fixed inset-y-0 right-0 w-80 max-w-[85vw] bg-bg-panel border-l border-border-default flex flex-col z-50 animate-slide-in-right",children:d.jsx(sT,{activeTab:e,setActiveTab:t,selectedNodes:r,workflow:s,onClose:()=>a(!1),showClose:!0})})]}):null:o?d.jsx("div",{className:"w-80 bg-bg-panel border-l border-border-default flex flex-col",children:d.jsx(sT,{activeTab:e,setActiveTab:t,selectedNodes:r,workflow:s,onClose:()=>a(!1),showClose:c==="tablet"})}):d.jsxs("button",{onClick:()=>a(!0),className:"w-10 bg-bg-panel border-l border-border-default flex flex-col items-center py-4 gap-4 hover:bg-bg-hover transition-colors","aria-label":"Expand properties panel",children:[d.jsx(B6,{className:"w-4 h-4 text-text-secondary"}),d.jsx($d,{className:"w-5 h-5 text-text-secondary"})]})}function sT({activeTab:e,setActiveTab:t,selectedNodes:n,workflow:r,onClose:s,showClose:o}){return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border-default",children:[d.jsx("h2",{className:"text-sm font-medium text-text-primary",children:"Properties"}),o&&d.jsx("button",{onClick:s,className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors","aria-label":"Close properties panel",children:d.jsx($r,{className:"w-4 h-4 text-text-secondary"})})]}),d.jsxs("div",{className:"flex border-b border-border-default",children:[d.jsx(g0,{active:e==="properties",onClick:()=>t("properties"),icon:d.jsx($d,{className:"w-4 h-4"}),label:"Properties"}),d.jsx(g0,{active:e==="variables",onClick:()=>t("variables"),icon:d.jsx(Rl,{className:"w-4 h-4"}),label:"Variables"}),d.jsx(g0,{active:e==="history",onClick:()=>t("history"),icon:d.jsx(Rw,{className:"w-4 h-4"}),label:"History"})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="properties"&&d.jsx(IQ,{selectedNodes:n,workflow:r}),e==="variables"&&d.jsx(AQ,{workflow:r}),e==="history"&&d.jsx(MQ,{})]})]})}function g0({active:e,onClick:t,icon:n,label:r}){return d.jsxs("button",{onClick:t,className:`flex-1 flex items-center justify-center gap-1.5 px-3 py-2.5 text-xs font-medium transition-colors ${e?"text-accent border-b-2 border-accent -mb-px":"text-text-secondary hover:text-text-primary"}`,children:[n,r]})}function IQ({selectedNodes:e,workflow:t}){var n,r,s,o,a,c,u,f,m,p,g,v,b,w,x;if(e.length===0)return d.jsxs("div",{className:"p-4 space-y-4",children:[d.jsx(Zi,{title:"Workflow",children:t?d.jsxs("div",{className:"space-y-3",children:[d.jsx(ys,{label:"Name",value:((n=t.metadata)==null?void 0:n.name)||"Untitled"}),d.jsx(ys,{label:"Version",value:((r=t.metadata)==null?void 0:r.version)||"1.0.0"}),d.jsx(ys,{label:"Author",value:((s=t.metadata)==null?void 0:s.author)||"Unknown"}),d.jsx(ys,{label:"Steps",value:`${((o=t.steps)==null?void 0:o.length)||0} steps`})]}):d.jsx("div",{className:"text-sm text-text-muted",children:"No workflow loaded"})}),((a=t==null?void 0:t.metadata)==null?void 0:a.description)&&d.jsx(Zi,{title:"Description",children:d.jsx("p",{className:"text-sm text-text-primary",children:t.metadata.description})}),((c=t==null?void 0:t.metadata)==null?void 0:c.tags)&&t.metadata.tags.length>0&&d.jsx(Zi,{title:"Tags",children:d.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.metadata.tags.map(S=>d.jsx("span",{className:"px-2 py-0.5 bg-primary/10 text-primary text-xs rounded-full",children:S},S))})})]});if(e.length===1){const S=e[0];return d.jsxs("div",{className:"p-4 space-y-4",children:[d.jsx(Zi,{title:"Step",children:d.jsxs("div",{className:"space-y-3",children:[d.jsx(ys,{label:"ID",value:((u=S.data)==null?void 0:u.id)||S.id}),d.jsx(ys,{label:"Name",value:((f=S.data)==null?void 0:f.name)||"(unnamed)"}),d.jsx(ys,{label:"Action",value:((m=S.data)==null?void 0:m.action)||((p=S.data)==null?void 0:p.workflowPath)||"-"}),d.jsx(ys,{label:"Status",value:((g=S.data)==null?void 0:g.status)||"pending",badge:!0,badgeColor:((v=S.data)==null?void 0:v.status)==="completed"?"success":((b=S.data)==null?void 0:b.status)==="failed"?"error":((w=S.data)==null?void 0:w.status)==="running"?"warning":"default"})]})}),((x=S.data)==null?void 0:x.error)&&d.jsx(Zi,{title:"Error",children:d.jsx("div",{className:"p-2 bg-error/10 border border-error/20 rounded text-xs text-error font-mono",children:S.data.error})}),d.jsx(Zi,{title:"Actions",children:d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{className:"flex-1 px-3 py-1.5 bg-bg-surface border border-border-default rounded text-xs text-text-primary hover:border-accent transition-colors",children:"Edit"}),d.jsx("button",{className:"flex-1 px-3 py-1.5 bg-bg-surface border border-border-default rounded text-xs text-text-primary hover:border-accent transition-colors",children:"View YAML"})]})})]})}return d.jsx("div",{className:"p-4",children:d.jsxs("div",{className:"text-sm text-text-secondary",children:[e.length," nodes selected"]})})}function AQ({workflow:e}){const t=j.useMemo(()=>{const n=[];return e!=null&&e.inputs&&Object.entries(e.inputs).forEach(([r,s])=>{n.push({name:`inputs.${r}`,value:s.default!==void 0?String(s.default):"(no default)",type:s.type||"string",source:"input"})}),e!=null&&e.steps&&e.steps.forEach(r=>{r.outputVariable&&n.push({name:r.outputVariable,value:`Output from step: ${r.name||r.id}`,type:"any",source:"output"})}),n},[e]);return t.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4 text-center",children:[d.jsx(Rl,{className:"w-12 h-12 text-text-muted mb-3"}),d.jsx("p",{className:"text-sm text-text-secondary mb-1",children:"No variables yet"}),d.jsx("p",{className:"text-xs text-text-muted",children:"Define workflow inputs or add output variables to steps"})]}):d.jsx("div",{className:"p-4 space-y-2",children:t.map(n=>d.jsxs("div",{className:"p-3 bg-bg-surface rounded-lg border border-border-default",children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("span",{className:"text-xs font-mono text-primary",children:n.name}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-bg-hover text-text-secondary",children:n.source==="input"?"input":"output"}),d.jsx("span",{className:"text-xs text-text-muted",children:n.type})]})]}),d.jsx("div",{className:"text-sm text-text-primary font-mono truncate",title:n.value,children:n.value})]},n.name))})}function MQ(){const{runs:e,clearHistory:t}=CL(),[n,r]=j.useState(null);return n?d.jsx(OQ,{run:n,onBack:()=>r(null)}):e.length===0?d.jsxs("div",{className:"p-4 text-center",children:[d.jsx("div",{className:"w-12 h-12 mx-auto mb-3 rounded-full bg-bg-surface flex items-center justify-center",children:d.jsx(Rw,{className:"w-6 h-6 text-text-muted"})}),d.jsx("p",{className:"text-sm text-text-secondary mb-1",children:"No execution history"}),d.jsx("p",{className:"text-xs text-text-muted",children:"Run a workflow to see execution history here"})]}):d.jsxs("div",{className:"flex flex-col h-full",children:[d.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-2",children:e.map(s=>d.jsxs("button",{onClick:()=>r(s),className:"w-full p-3 bg-bg-surface rounded-lg border border-border-default cursor-pointer hover:border-accent transition-colors text-left",children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("span",{className:"text-xs font-medium text-white truncate max-w-[140px]",children:s.workflowName}),d.jsx(EL,{status:s.status})]}),d.jsxs("div",{className:"flex items-center justify-between text-xs text-text-secondary",children:[d.jsx("span",{children:s.duration?rw(s.duration):"-"}),d.jsx("span",{children:RQ(s.startTime)})]}),s.steps.length>0&&d.jsxs("div",{className:"mt-2 flex items-center gap-1",children:[s.steps.slice(0,5).map(o=>d.jsx(LQ,{status:o.status},o.stepId)),s.steps.length>5&&d.jsxs("span",{className:"text-xs text-text-muted",children:["+",s.steps.length-5]})]})]},s.id))}),e.length>0&&d.jsx("div",{className:"p-3 border-t border-border-default",children:d.jsxs("button",{onClick:t,className:"w-full flex items-center justify-center gap-2 px-3 py-2 text-xs text-text-secondary hover:text-error transition-colors",children:[d.jsx(Io,{className:"w-3.5 h-3.5"}),"Clear History"]})})]})}function OQ({run:e,onBack:t}){const[n,r]=j.useState(!1);return d.jsxs("div",{className:"flex flex-col h-full",children:[d.jsxs("div",{className:"p-3 border-b border-border-default",children:[d.jsxs("button",{onClick:t,className:"flex items-center gap-1 text-xs text-text-secondary hover:text-text-primary mb-2",children:[d.jsx(Qt,{className:"w-3 h-3 rotate-180"}),"Back to history"]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-sm font-medium text-white truncate max-w-[180px]",children:e.workflowName}),d.jsx(EL,{status:e.status})]}),d.jsxs("div",{className:"flex items-center justify-between mt-1 text-xs text-text-secondary",children:[d.jsx("span",{children:e.duration?rw(e.duration):"Running..."}),d.jsx("span",{children:new Date(e.startTime).toLocaleString()})]})]}),d.jsxs("div",{className:"flex border-b border-border-default",children:[d.jsxs("button",{onClick:()=>r(!1),className:`flex-1 px-3 py-2 text-xs font-medium transition-colors ${n?"text-text-secondary hover:text-text-primary":"text-primary border-b-2 border-primary -mb-px"}`,children:["Steps (",e.steps.length,")"]}),d.jsxs("button",{onClick:()=>r(!0),className:`flex-1 px-3 py-2 text-xs font-medium transition-colors ${n?"text-primary border-b-2 border-primary -mb-px":"text-text-secondary hover:text-text-primary"}`,children:["Logs (",e.logs.length,")"]})]}),d.jsx("div",{className:"flex-1 overflow-y-auto p-3",children:n?d.jsx("div",{className:"space-y-1 font-mono text-xs",children:e.logs.map((s,o)=>d.jsx("div",{className:"text-text-primary break-words",children:s},o))}):d.jsx("div",{className:"space-y-2",children:e.steps.map(s=>d.jsxs("div",{className:"p-2 bg-bg-surface rounded border border-border-default",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-xs font-medium text-white truncate",children:s.stepName}),d.jsx(PQ,{status:s.status})]}),s.duration&&d.jsx("div",{className:"text-xs text-text-muted mt-1",children:rw(s.duration)}),s.error&&d.jsx("div",{className:"mt-2 p-2 bg-error/10 border border-error/20 rounded text-xs text-error",children:s.error})]},s.stepId))})})]})}function EL({status:e}){const t={running:{bg:"bg-warning/10",text:"text-warning",icon:Dr},completed:{bg:"bg-success/10",text:"text-success",icon:Pt},failed:{bg:"bg-error/10",text:"text-error",icon:ot},cancelled:{bg:"bg-gray-500/10",text:"text-text-secondary",icon:ot},pending:{bg:"bg-gray-500/10",text:"text-text-secondary",icon:jn}},{bg:n,text:r,icon:s}=t[e]||t.pending;return d.jsxs("span",{className:`flex items-center gap-1 text-xs px-2 py-0.5 rounded-full ${n} ${r}`,children:[d.jsx(s,{className:`w-3 h-3 ${e==="running"?"animate-spin":""}`}),e]})}function PQ({status:e}){const t={running:{bg:"bg-warning/10",text:"text-warning"},completed:{bg:"bg-success/10",text:"text-success"},failed:{bg:"bg-error/10",text:"text-error"},pending:{bg:"bg-gray-500/10",text:"text-text-secondary"}},{bg:n,text:r}=t[e]||t.pending;return d.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${n} ${r}`,children:e})}function LQ({status:e}){const t={running:"bg-warning",completed:"bg-success",failed:"bg-error",pending:"bg-gray-500"};return d.jsx("div",{className:`w-2 h-2 rounded-full ${t[e]||t.pending} ${e==="running"?"animate-pulse":""}`,title:e})}function Zi({title:e,children:t}){return d.jsxs("div",{children:[d.jsx("h3",{className:"text-xs font-medium text-text-muted uppercase tracking-wider mb-2",children:e}),t]})}function ys({label:e,value:t,badge:n,badgeColor:r="default"}){const s={default:"bg-gray-500/10 text-text-secondary",success:"bg-success/10 text-success",error:"bg-error/10 text-error",warning:"bg-warning/10 text-warning"};return d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-xs text-text-secondary",children:e}),n?d.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${s[r]}`,children:t}):d.jsx("span",{className:"text-sm text-text-primary font-mono truncate max-w-[180px]",children:t})]})}const Fb=Vr((e,t)=>({isProcessing:!1,history:[],lastError:null,pendingChanges:null,sendPrompt:async n=>{e({isProcessing:!0,lastError:null});const r=qr.getState().currentWorkflow;try{const s=await fetch("/api/ai/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:n,workflow:r})});if(!s.ok)throw new Error("Failed to process prompt");const o=await s.json(),a={prompt:n,response:o.explanation,timestamp:new Date,success:!0};e({history:[a,...t().history].slice(0,20),pendingChanges:o.workflow,isProcessing:!1}),o.workflow&&t().acceptChanges()}catch(s){const o=s instanceof Error?s.message:"Unknown error";e({history:[{prompt:n,response:o,timestamp:new Date,success:!1},...t().history].slice(0,20),lastError:o,isProcessing:!1}),console.log("AI Prompt (demo mode):",n),console.log("Current workflow:",r)}},acceptChanges:()=>{const n=t().pendingChanges;n&&(qr.getState().saveWorkflow(n),e({pendingChanges:null}))},rejectChanges:()=>{e({pendingChanges:null})},clearHistory:()=>{e({history:[]})}}));function DQ({onSelectPrompt:e}){const[t,n]=j.useState(!1),[r,s]=j.useState(null),[o,a]=j.useState(null),{history:c,clearHistory:u,sendPrompt:f,isProcessing:m}=Fb(),p=async b=>{m||await f(b)},g=async(b,w)=>{try{await navigator.clipboard.writeText(b),a(w),setTimeout(()=>a(null),2e3)}catch(x){console.error("Failed to copy:",x)}},v=b=>{const x=new Date().getTime()-new Date(b).getTime();return x<6e4?"Just now":x<36e5?`${Math.floor(x/6e4)}m ago`:x<864e5?`${Math.floor(x/36e5)}h ago`:new Date(b).toLocaleDateString()};return c.length===0?null:d.jsxs("div",{className:"border-t border-node-border",children:[d.jsxs("button",{onClick:()=>n(!t),className:"w-full flex items-center justify-between px-4 py-2 bg-panel-bg hover:bg-white/5 transition-colors",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Rw,{className:"w-4 h-4 text-gray-400"}),d.jsx("span",{className:"text-sm text-gray-300",children:"Prompt History"}),d.jsxs("span",{className:"text-xs text-gray-500",children:["(",c.length,")"]})]}),t?d.jsx(bs,{className:"w-4 h-4 text-gray-400"}):d.jsx(z6,{className:"w-4 h-4 text-gray-400"})]}),t&&d.jsxs("div",{className:"bg-panel-bg",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-node-border",children:[d.jsxs("span",{className:"text-xs text-gray-500",children:[c.filter(b=>b.success).length," successful,"," ",c.filter(b=>!b.success).length," failed"]}),d.jsx(Be,{variant:"ghost",size:"sm",onClick:u,icon:d.jsx(Io,{className:"w-3 h-3"}),children:"Clear"})]}),d.jsx("div",{className:"max-h-64 overflow-y-auto",children:c.map((b,w)=>{const x=`${w}-${b.timestamp}`,S=r===b;return d.jsxs("div",{className:"border-b border-node-border last:border-b-0",children:[d.jsxs("div",{className:`flex items-start gap-3 px-4 py-3 cursor-pointer transition-colors ${S?"bg-primary/10":"hover:bg-white/5"}`,onClick:()=>s(S?null:b),children:[b.success?d.jsx(Pt,{className:"w-4 h-4 text-success flex-shrink-0 mt-0.5"}):d.jsx(ot,{className:"w-4 h-4 text-error flex-shrink-0 mt-0.5"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-sm text-gray-300 line-clamp-2",children:b.prompt}),d.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[d.jsx(jn,{className:"w-3 h-3 text-gray-500"}),d.jsx("span",{className:"text-xs text-gray-500",children:v(b.timestamp)})]})]}),d.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[d.jsx("button",{onClick:k=>{k.stopPropagation(),g(b.prompt,x)},className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy prompt",children:o===x?d.jsx(si,{className:"w-3.5 h-3.5 text-success"}):d.jsx(So,{className:"w-3.5 h-3.5 text-gray-400"})}),d.jsx("button",{onClick:k=>{k.stopPropagation(),p(b.prompt)},disabled:m,className:"p-1.5 hover:bg-white/10 rounded transition-colors disabled:opacity-50",title:"Re-run prompt",children:d.jsx(f8,{className:`w-3.5 h-3.5 text-gray-400 ${m?"animate-spin":""}`})}),e&&d.jsx("button",{onClick:k=>{k.stopPropagation(),e(b.prompt)},className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Edit prompt",children:d.jsx("span",{className:"text-xs text-gray-400",children:"Edit"})})]})]}),S&&d.jsx("div",{className:"px-4 pb-3 pl-11",children:d.jsxs("div",{className:"bg-node-bg rounded-lg p-3",children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("span",{className:"text-xs font-medium text-gray-500 uppercase",children:"Response"}),d.jsx("button",{onClick:()=>g(b.response,`${x}-response`),className:"p-1 hover:bg-white/10 rounded transition-colors",children:o===`${x}-response`?d.jsx(si,{className:"w-3 h-3 text-success"}):d.jsx(So,{className:"w-3 h-3 text-gray-400"})})]}),d.jsx("div",{className:`text-xs font-mono ${b.success?"text-gray-300":"text-error"}`,children:b.response||"No response"})]})})]},x)})})]})]})}function $Q(){const[e,t]=j.useState(""),n=j.useRef(null),{isProcessing:r,history:s,sendPrompt:o}=Fb(),a=Tl();j.useEffect(()=>{n.current&&(n.current.style.height="auto",n.current.style.height=`${Math.min(n.current.scrollHeight,200)}px`)},[e]);const c=async()=>{!e.trim()||r||(await o(e),t(""))},u=m=>{m.key==="Enter"&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),c()),m.key==="ArrowUp"&&!e&&s.length>0&&t(s[0].prompt)},f=["Add a Slack notification step","Add error handling with 3 retries","Convert to a sub-workflow","Add a condition to skip if draft"];return d.jsxs("div",{className:"bg-bg-panel",children:[d.jsx(DQ,{onSelectPrompt:t}),!e&&!r&&d.jsx("div",{className:"px-4 py-2 border-t border-border-default/50",children:d.jsxs("div",{className:"flex items-center gap-2 overflow-x-auto pb-1",children:[d.jsx(m8,{className:"w-4 h-4 text-primary flex-shrink-0"}),f.map(m=>d.jsx("button",{onClick:()=>t(m),className:"px-3 py-1 bg-bg-surface border border-border-default rounded-full text-xs text-text-primary hover:border-accent hover:text-accent transition-colors whitespace-nowrap",children:m},m))]})}),d.jsxs("div",{className:"p-4 flex items-end gap-3 border-t border-border-default",children:[d.jsxs("div",{className:"flex-1 relative",children:[d.jsx("textarea",{ref:n,value:e,onChange:m=>t(m.target.value),onKeyDown:u,placeholder:"Describe the changes you want to make to the workflow...",disabled:r,rows:1,className:"w-full px-4 py-3 bg-bg-surface border border-border-default rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:border-accent focus:ring-2 focus:ring-accent/50 resize-none disabled:opacity-50"}),r&&d.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2",children:d.jsx(Dr,{className:"w-5 h-5 text-primary animate-spin"})})]}),d.jsx("button",{onClick:c,disabled:!e.trim()||r,className:"w-10 h-10 rounded-lg bg-primary hover:bg-primary-dark disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center transition-colors",children:d.jsx(lA,{className:"w-5 h-5 text-text-primary"})})]}),d.jsxs("div",{className:"px-4 pb-2 text-xs text-text-muted",children:["Press ",d.jsx("kbd",{className:"px-1.5 py-0.5 bg-bg-surface rounded text-text-secondary",children:a})," +"," ",d.jsx("kbd",{className:"px-1.5 py-0.5 bg-bg-surface rounded text-text-secondary",children:"Enter"})," to send",s.length>0&&d.jsxs("span",{className:"ml-4",children:[d.jsx("kbd",{className:"px-1.5 py-0.5 bg-bg-surface rounded text-text-secondary",children:"↑"})," for last prompt"]})]})]})}function qQ({open:e,onOpenChange:t,originalWorkflow:n,modifiedWorkflow:r,explanation:s,onAccept:o,onReject:a}){const[c,u]=j.useState("explanation"),f=n?gd(n,{indent:2}):"",m=r?gd(r,{indent:2}):"",p=()=>{o(),t(!1)},g=()=>{a(),t(!1)};return d.jsxs(Cs,{open:e,onOpenChange:t,title:"Review Changes",description:"The AI has suggested the following changes to your workflow",size:"xl",children:[d.jsxs(pM,{value:c,onValueChange:u,children:[d.jsxs(Vw,{children:[d.jsxs(ir,{value:"explanation",children:[d.jsx(G6,{className:"w-4 h-4 mr-1.5"}),"Explanation"]}),d.jsxs(ir,{value:"diff",children:[d.jsx(J6,{className:"w-4 h-4 mr-1.5"}),"Side by Side"]}),d.jsxs(ir,{value:"modified",children:[d.jsx(jw,{className:"w-4 h-4 mr-1.5"}),"Modified YAML"]})]}),d.jsxs("div",{className:"p-4",children:[d.jsx(or,{value:"explanation",children:d.jsxs("div",{className:"prose prose-invert max-w-none",children:[d.jsx("div",{className:"p-4 bg-node-bg rounded-lg border border-node-border",children:d.jsx("p",{className:"text-gray-300 whitespace-pre-wrap",children:s})}),r&&d.jsxs("div",{className:"mt-4",children:[d.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Changes Summary"}),d.jsx("ul",{className:"space-y-2",children:FQ(n,r).map((v,b)=>d.jsxs("li",{className:`flex items-start gap-2 text-sm ${v.type==="added"?"text-success":v.type==="removed"?"text-error":"text-warning"}`,children:[d.jsx("span",{className:"flex-shrink-0",children:v.type==="added"?"+":v.type==="removed"?"-":"~"}),d.jsx("span",{children:v.description})]},b))})]})]})}),d.jsx(or,{value:"diff",children:d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Original"}),d.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:d.jsx(Za,{height:"400px",language:"yaml",value:f,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1}})})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Modified"}),d.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:d.jsx(Za,{height:"400px",language:"yaml",value:m,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1}})})]})]})}),d.jsx(or,{value:"modified",children:d.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:d.jsx(Za,{height:"500px",language:"yaml",value:m,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, Consolas, monospace",lineNumbers:"on",scrollBeyondLastLine:!1}})})})]})]}),d.jsxs(oi,{children:[d.jsx(Be,{variant:"secondary",onClick:g,icon:d.jsx($r,{className:"w-4 h-4"}),children:"Reject"}),d.jsx(Be,{onClick:p,icon:d.jsx(si,{className:"w-4 h-4"}),children:"Accept Changes"})]})]})}function FQ(e,t){const n=[];if(!e||!t)return n;const r=new Set(e.steps.map(o=>o.id)),s=new Set(t.steps.map(o=>o.id));for(const o of t.steps)r.has(o.id)||n.push({type:"added",description:`Added step "${o.name||o.id}"`});for(const o of e.steps)s.has(o.id)||n.push({type:"removed",description:`Removed step "${o.name||o.id}"`});for(const o of t.steps)if(r.has(o.id)){const a=e.steps.find(c=>c.id===o.id);if(a&&JSON.stringify(a)!==JSON.stringify(o)){const c=[];a.action!==o.action&&c.push("action"),JSON.stringify(a.inputs)!==JSON.stringify(o.inputs)&&c.push("inputs"),JSON.stringify(a.errorHandling)!==JSON.stringify(o.errorHandling)&&c.push("error handling"),JSON.stringify(a.conditions)!==JSON.stringify(o.conditions)&&c.push("conditions"),c.length>0&&n.push({type:"modified",description:`Modified "${o.name||o.id}": ${c.join(", ")}`})}}return e.metadata.name!==t.metadata.name&&n.push({type:"modified",description:`Renamed workflow to "${t.metadata.name}"`}),n}const Ir={WORKFLOW_UPDATED:"workflow:updated",EXECUTION_STEP:"execution:step",EXECUTION_COMPLETED:"execution:completed",AI_PROCESSING:"ai:processing",AI_RESPONSE:"ai:response",WORKFLOW_SUBSCRIBE:"workflow:subscribe",WORKFLOW_UNSUBSCRIBE:"workflow:unsubscribe",EXECUTION_SUBSCRIBE:"execution:subscribe",EXECUTION_UNSUBSCRIBE:"execution:unsubscribe"},Mu={slack:{name:"Slack",icon:"slack",methods:["chat.postMessage","chat.update","chat.delete","conversations.list","conversations.create","files.upload","users.info"]},github:{name:"GitHub",icon:"github",methods:["pulls.get","pulls.list","pulls.create","pulls.createReview","pulls.listFiles","issues.get","issues.create","issues.createComment","repos.getContent","search.code"]},jira:{name:"Jira",icon:"jira",methods:["issues.getIssue","issues.createIssue","issues.editIssue","issues.search","issues.addComment","issues.transition"]},gmail:{name:"Gmail",icon:"gmail",methods:["messages.list","messages.get","messages.send","drafts.create","labels.list"]},outlook:{name:"Outlook",icon:"outlook",methods:["messages.list","messages.get","messages.send","calendar.events.list","calendar.events.create"]},linear:{name:"Linear",icon:"linear",methods:["issues.get","issues.create","issues.update","issues.search","projects.list"]},notion:{name:"Notion",icon:"notion",methods:["pages.get","pages.create","pages.update","databases.query","search"]},discord:{name:"Discord",icon:"discord",methods:["messages.send","messages.edit","messages.delete","channels.get","webhooks.execute"]},airtable:{name:"Airtable",icon:"airtable",methods:["records.list","records.get","records.create","records.update","records.delete"]},confluence:{name:"Confluence",icon:"confluence",methods:["pages.list","pages.get","pages.create","pages.update","search"]},http:{name:"HTTP",icon:"http",methods:["request","get","post","put","patch","delete"]},claude:{name:"Claude",icon:"claude",methods:["analyze","generate","summarize","chat"]},opencode:{name:"OpenCode",icon:"opencode",methods:["chat","complete","analyze"]},ollama:{name:"Ollama",icon:"ollama",methods:["generate","chat","embeddings"]}};function BQ({open:e,onOpenChange:t,onCreateStep:n,position:r}){var P,B;const[s,o]=j.useState("select-type"),[a,c]=j.useState(""),[u,f]=j.useState("action"),[m,p]=j.useState(null),[g,v]=j.useState(null),[b,w]=j.useState({id:"",name:""}),x=()=>{o("select-type"),c(""),f("action"),p(null),v(null),w({id:"",name:""})},S=()=>{x(),t(!1)},k=M=>{f(M),o(M==="action"?"select-service":"configure")},N=M=>{p(M),o("select-method")},C=M=>{v(M);const L=Mu[m];w({id:`${m}-${Date.now()}`,name:`${(L==null?void 0:L.name)||m} - ${M}`}),o("configure")},R=()=>{const M={id:b.id||`step-${Date.now()}`,name:b.name||void 0,inputs:{}};u==="action"&&m&&g&&(M.action=`${m}.${g}`),n(M),S()},T=Object.entries(Mu).filter(([M,L])=>L.name.toLowerCase().includes(a.toLowerCase())||M.toLowerCase().includes(a.toLowerCase())),O=(m?((P=Mu[m])==null?void 0:P.methods)||[]:[]).filter(M=>M.toLowerCase().includes(a.toLowerCase()));return d.jsxs(Cs,{open:e,onOpenChange:S,title:"Add New Step",description:zQ(s),size:"lg",children:[d.jsxs("div",{className:"p-4",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-4 text-sm",children:[d.jsx("button",{onClick:()=>o("select-type"),className:`${s==="select-type"?"text-primary":"text-gray-400 hover:text-white"}`,children:"Type"}),u==="action"&&d.jsxs(d.Fragment,{children:[d.jsx(Qt,{className:"w-4 h-4 text-gray-600"}),d.jsx("button",{onClick:()=>m&&o("select-service"),className:`${s==="select-service"?"text-primary":m?"text-gray-400 hover:text-white":"text-gray-600"}`,disabled:!m,children:"Service"}),d.jsx(Qt,{className:"w-4 h-4 text-gray-600"}),d.jsx("button",{onClick:()=>g&&o("select-method"),className:`${s==="select-method"?"text-primary":g?"text-gray-400 hover:text-white":"text-gray-600"}`,disabled:!g,children:"Method"})]}),d.jsx(Qt,{className:"w-4 h-4 text-gray-600"}),d.jsx("span",{className:`${s==="configure"?"text-primary":"text-gray-600"}`,children:"Configure"})]}),s==="select-type"&&d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("button",{onClick:()=>k("action"),className:"p-6 bg-node-bg border border-node-border rounded-lg hover:border-primary transition-colors text-left",children:[d.jsx(dd,{className:"w-8 h-8 text-primary mb-3"}),d.jsx("h3",{className:"text-lg font-medium text-white mb-1",children:"Action Step"}),d.jsx("p",{className:"text-sm text-gray-400",children:"Execute an action using a service SDK (Slack, GitHub, etc.)"})]}),d.jsxs("button",{onClick:()=>k("subworkflow"),className:"p-6 bg-node-bg border border-node-border rounded-lg hover:border-info transition-colors text-left",children:[d.jsx(cd,{className:"w-8 h-8 text-info mb-3"}),d.jsx("h3",{className:"text-lg font-medium text-white mb-1",children:"Sub-workflow"}),d.jsx("p",{className:"text-sm text-gray-400",children:"Reference another workflow file for modular composition"})]})]}),s==="select-service"&&d.jsxs("div",{children:[d.jsxs("div",{className:"relative mb-4",children:[d.jsx(ud,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),d.jsx("input",{type:"text",value:a,onChange:M=>c(M.target.value),placeholder:"Search services...",className:"w-full pl-10 pr-4 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",autoFocus:!0})]}),d.jsx("div",{className:"grid grid-cols-3 gap-3 max-h-[400px] overflow-y-auto",children:T.map(([M,L])=>{const U=F0(M);return d.jsxs("button",{onClick:()=>N(M),className:"flex flex-col items-center gap-2 p-4 bg-node-bg border border-node-border rounded-lg hover:border-primary transition-colors",children:[d.jsx(U,{className:"w-8 h-8 text-primary"}),d.jsx("span",{className:"text-sm text-white",children:L.name})]},M)})})]}),s==="select-method"&&m&&d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-3 mb-4 p-3 bg-node-bg rounded-lg border border-node-border",children:[(()=>{const M=F0(m);return d.jsx(M,{className:"w-6 h-6 text-primary"})})(),d.jsxs("div",{children:[d.jsx("div",{className:"text-sm font-medium text-white",children:(B=Mu[m])==null?void 0:B.name}),d.jsx("div",{className:"text-xs text-gray-400",children:"Select a method"})]})]}),d.jsxs("div",{className:"relative mb-4",children:[d.jsx(ud,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),d.jsx("input",{type:"text",value:a,onChange:M=>c(M.target.value),placeholder:"Search methods...",className:"w-full pl-10 pr-4 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",autoFocus:!0})]}),d.jsx("div",{className:"space-y-2 max-h-[350px] overflow-y-auto",children:O.map(M=>d.jsxs("button",{onClick:()=>C(M),className:"w-full flex items-center justify-between px-4 py-3 bg-node-bg border border-node-border rounded-lg hover:border-primary transition-colors text-left",children:[d.jsx("span",{className:"text-sm font-mono text-white",children:M}),d.jsx(Qt,{className:"w-4 h-4 text-gray-500"})]},M))})]}),s==="configure"&&d.jsxs("div",{className:"space-y-4",children:[u==="action"&&m&&g&&d.jsxs("div",{className:"p-3 bg-node-bg rounded-lg border border-node-border",children:[d.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Action"}),d.jsxs("div",{className:"text-sm font-mono text-primary",children:[m,".",g]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step ID"}),d.jsx("input",{type:"text",value:b.id,onChange:M=>w(L=>({...L,id:M.target.value})),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary",placeholder:"unique-step-id"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step Name (optional)"}),d.jsx("input",{type:"text",value:b.name,onChange:M=>w(L=>({...L,name:M.target.value})),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",placeholder:"Human-readable name"})]}),r&&d.jsx("div",{className:"text-xs text-gray-500",children:r.afterStepId?`Will be inserted after "${r.afterStepId}"`:r.beforeStepId?`Will be inserted before "${r.beforeStepId}"`:"Will be added at the end"})]})]}),d.jsxs(oi,{children:[s!=="select-type"&&d.jsx(Be,{variant:"ghost",onClick:()=>{s==="select-service"?o("select-type"):s==="select-method"?o("select-service"):s==="configure"&&o(u==="action"?"select-method":"select-type"),c("")},children:"Back"}),d.jsx(Be,{variant:"secondary",onClick:S,children:"Cancel"}),s==="configure"&&d.jsx(Be,{onClick:R,disabled:!b.id,children:"Create Step"})]})]})}function zQ(e){switch(e){case"select-type":return"Choose what type of step to add";case"select-service":return"Select a service to use";case"select-method":return"Choose the method to call";case"configure":return"Configure your new step";default:return""}}const iT=[{keys:["⌘","S"],description:"Save workflow",category:"General"},{keys:["⌘","Z"],description:"Undo",category:"General"},{keys:["⌘","⇧","Z"],description:"Redo",category:"General"},{keys:["⌘","?"],description:"Show keyboard shortcuts",category:"General"},{keys:["N"],description:"Add new step",category:"Canvas"},{keys:["⌘","L"],description:"Auto-layout canvas",category:"Canvas"},{keys:["⌘","0"],description:"Fit view",category:"Canvas"},{keys:["⌘","+"],description:"Zoom in",category:"Canvas"},{keys:["⌘","-"],description:"Zoom out",category:"Canvas"},{keys:["⌫"],description:"Delete selected",category:"Canvas"},{keys:["⌘","D"],description:"Duplicate selected",category:"Canvas"},{keys:["Double-click"],description:"Edit step",category:"Editing"},{keys:["E"],description:"Edit selected step",category:"Editing"},{keys:["Y"],description:"View YAML",category:"Editing"},{keys:["Escape"],description:"Close modal / deselect",category:"Editing"},{keys:["⌘","←"],description:"Back to parent workflow",category:"Navigation"},{keys:["⌘","↑"],description:"Go to root workflow",category:"Navigation"},{keys:["⌘","↵"],description:"Execute workflow",category:"Execution"},{keys:["F9"],description:"Toggle debug mode",category:"Debugging"},{keys:["F5"],description:"Continue execution",category:"Debugging"},{keys:["F10"],description:"Step over",category:"Debugging"},{keys:["F11"],description:"Step into",category:"Debugging"},{keys:["⇧","F11"],description:"Step out",category:"Debugging"}];function VQ({open:e,onOpenChange:t}){const n=[...new Set(iT.map(s=>s.category))],r=Tl();return d.jsxs(Cs,{open:e,onOpenChange:t,title:"Keyboard Shortcuts",description:"Quick reference for all keyboard shortcuts",size:"md",children:[d.jsx("div",{className:"p-4 space-y-6 max-h-[60vh] overflow-y-auto",children:n.map(s=>d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-medium text-gray-400 uppercase tracking-wider mb-3",children:s}),d.jsx("div",{className:"space-y-2",children:iT.filter(o=>o.category===s).map((o,a)=>d.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-node-border last:border-0",children:[d.jsx("span",{className:"text-sm text-gray-300",children:o.description}),d.jsx("div",{className:"flex items-center gap-1",children:o.keys.map((c,u)=>d.jsx("kbd",{className:"px-2 py-1 bg-node-bg border border-node-border rounded text-xs font-mono text-gray-300",children:c==="⌘"?r:c},u))})]},a))})]},s))}),d.jsx(oi,{children:d.jsx(Be,{variant:"secondary",onClick:()=>t(!1),children:"Close"})})]})}function UQ(){const[e,t]=j.useState(!1);return j.useEffect(()=>{const n=r=>{(r.metaKey||r.ctrlKey)&&r.key==="/"&&(r.preventDefault(),t(!0))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),{isOpen:e,setIsOpen:t,openShortcuts:()=>t(!0)}}function HQ({onClick:e}){const t=Tl();return d.jsxs("button",{onClick:e,className:"flex items-center gap-1.5 px-2 py-1 text-xs text-gray-500 hover:text-gray-300 transition-colors",title:`Keyboard shortcuts (${t}/)`,children:[d.jsx(n8,{className:"w-3.5 h-3.5"}),d.jsx("span",{className:"hidden sm:inline",children:"Shortcuts"})]})}function y0(){return typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function v0(e){if(typeof document>"u")return;const t=document.documentElement;e==="dark"?(t.classList.add("dark"),t.classList.remove("light")):(t.classList.add("light"),t.classList.remove("dark"))}const jL=Vr()(kL((e,t)=>({theme:"dark",resolvedTheme:"dark",setTheme:n=>{const r=n==="system"?y0():n;v0(r),e({theme:n,resolvedTheme:r})},toggleTheme:()=>{const{theme:n}=t(),r=n==="dark"?"light":"dark",s=r==="system"?y0():r;v0(s),e({theme:r,resolvedTheme:s})}}),{name:"marktoflow-theme",onRehydrateStorage:()=>e=>{if(e){const t=e.theme==="system"?y0():e.theme;v0(t),e.resolvedTheme=t}}}));typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{const{theme:t,setTheme:n}=jL.getState();t==="system"&&n("system")});function WQ({showLabel:e=!1}){const{theme:t,toggleTheme:n}=jL();return d.jsxs("button",{onClick:n,className:"flex items-center gap-2 px-2 py-1.5 rounded-lg hover:bg-white/10 dark:hover:bg-white/10 light:hover:bg-black/5 transition-colors",title:`Switch to ${t==="dark"?"light":"dark"} mode`,children:[t==="dark"?d.jsx(a8,{className:"w-4 h-4 text-gray-400"}):d.jsx(v8,{className:"w-4 h-4 text-yellow-500"}),e&&d.jsx("span",{className:"text-xs text-gray-400",children:t==="dark"?"Dark":"Light"})]})}function KQ({items:e,onNavigate:t}){return e.length<=1?null:d.jsx("nav",{className:"flex items-center gap-1 px-4 py-2 bg-panel-bg border-b border-node-border",children:e.map((n,r)=>d.jsxs("div",{className:"flex items-center",children:[r>0&&d.jsx(Qt,{className:"w-4 h-4 text-gray-600 mx-1"}),d.jsxs("button",{onClick:()=>t(n,r),className:`flex items-center gap-1.5 px-2 py-1 rounded text-sm transition-colors ${r===e.length-1?"text-white font-medium cursor-default":"text-gray-400 hover:text-white hover:bg-white/5"}`,disabled:r===e.length-1,children:[r===0&&d.jsx(t8,{className:"w-3.5 h-3.5"}),d.jsx("span",{className:"max-w-[150px] truncate",children:n.name})]})]},n.id))})}const gr=Object.create(null);gr.open="0";gr.close="1";gr.ping="2";gr.pong="3";gr.message="4";gr.upgrade="5";gr.noop="6";const Gu=Object.create(null);Object.keys(gr).forEach(e=>{Gu[gr[e]]=e});const sw={type:"error",data:"parser error"},RL=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",TL=typeof ArrayBuffer=="function",IL=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Bb=({type:e,data:t},n,r)=>RL&&t instanceof Blob?n?r(t):oT(t,r):TL&&(t instanceof ArrayBuffer||IL(t))?n?r(t):oT(new Blob([t]),r):r(gr[e]+(t||"")),oT=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function aT(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let x0;function GQ(e,t){if(RL&&e.data instanceof Blob)return e.data.arrayBuffer().then(aT).then(t);if(TL&&(e.data instanceof ArrayBuffer||IL(e.data)))return t(aT(e.data));Bb(e,!1,n=>{x0||(x0=new TextEncoder),t(x0.encode(n))})}const lT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ga=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<lT.length;e++)Ga[lT.charCodeAt(e)]=e;const YQ=e=>{let t=e.length*.75,n=e.length,r,s=0,o,a,c,u;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),m=new Uint8Array(f);for(r=0;r<n;r+=4)o=Ga[e.charCodeAt(r)],a=Ga[e.charCodeAt(r+1)],c=Ga[e.charCodeAt(r+2)],u=Ga[e.charCodeAt(r+3)],m[s++]=o<<2|a>>4,m[s++]=(a&15)<<4|c>>2,m[s++]=(c&3)<<6|u&63;return f},XQ=typeof ArrayBuffer=="function",zb=(e,t)=>{if(typeof e!="string")return{type:"message",data:AL(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:QQ(e.substring(1),t)}:Gu[n]?e.length>1?{type:Gu[n],data:e.substring(1)}:{type:Gu[n]}:sw},QQ=(e,t)=>{if(XQ){const n=YQ(e);return AL(n,t)}else return{base64:!0,data:e}},AL=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},ML="",JQ=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((o,a)=>{Bb(o,!1,c=>{r[a]=c,++s===n&&t(r.join(ML))})})},ZQ=(e,t)=>{const n=e.split(ML),r=[];for(let s=0;s<n.length;s++){const o=zb(n[s],t);if(r.push(o),o.type==="error")break}return r};function eJ(){return new TransformStream({transform(e,t){GQ(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const o=new DataView(s.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{s=new Uint8Array(9);const o=new DataView(s.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let w0;function Ou(e){return e.reduce((t,n)=>t+n.length,0)}function Pu(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function tJ(e,t){w0||(w0=new TextDecoder);const n=[];let r=0,s=-1,o=!1;return new TransformStream({transform(a,c){for(n.push(a);;){if(r===0){if(Ou(n)<1)break;const u=Pu(n,1);o=(u[0]&128)===128,s=u[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(Ou(n)<2)break;const u=Pu(n,2);s=new DataView(u.buffer,u.byteOffset,u.length).getUint16(0),r=3}else if(r===2){if(Ou(n)<8)break;const u=Pu(n,8),f=new DataView(u.buffer,u.byteOffset,u.length),m=f.getUint32(0);if(m>Math.pow(2,21)-1){c.enqueue(sw);break}s=m*Math.pow(2,32)+f.getUint32(4),r=3}else{if(Ou(n)<s)break;const u=Pu(n,s);c.enqueue(zb(o?u:w0.decode(u),t)),r=0}if(s===0||s>e){c.enqueue(sw);break}}}})}const OL=4;function mt(e){if(e)return nJ(e)}function nJ(e){for(var t in mt.prototype)e[t]=mt.prototype[t];return e}mt.prototype.on=mt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};mt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};mt.prototype.off=mt.prototype.removeListener=mt.prototype.removeAllListeners=mt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};mt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};mt.prototype.emitReserved=mt.prototype.emit;mt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};mt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Sf=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),_n=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),rJ="arraybuffer";function PL(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const sJ=_n.setTimeout,iJ=_n.clearTimeout;function _f(e,t){t.useNativeTimers?(e.setTimeoutFn=sJ.bind(_n),e.clearTimeoutFn=iJ.bind(_n)):(e.setTimeoutFn=_n.setTimeout.bind(_n),e.clearTimeoutFn=_n.clearTimeout.bind(_n))}const oJ=1.33;function aJ(e){return typeof e=="string"?lJ(e):Math.ceil((e.byteLength||e.size)*oJ)}function lJ(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function LL(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function cJ(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function uJ(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class dJ extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Vb extends mt{constructor(t){super(),this.writable=!1,_f(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new dJ(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=zb(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_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(t){const n=cJ(t);return n.length?"?"+n:""}}class fJ extends Vb{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};ZQ(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,JQ(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=LL()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let DL=!1;try{DL=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const hJ=DL;function pJ(){}class mJ extends fJ{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,o)=>{this.onError("xhr post error",s,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class dr extends mt{constructor(t,n,r){super(),this.createRequest=t,_f(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=PL(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=dr.requestsCount++,dr.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=pJ,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete dr.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}dr.requestsCount=0;dr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",cT);else if(typeof addEventListener=="function"){const e="onpagehide"in _n?"pagehide":"unload";addEventListener(e,cT,!1)}}function cT(){for(let e in dr.requests)dr.requests.hasOwnProperty(e)&&dr.requests[e].abort()}const gJ=(function(){const e=$L({xdomain:!1});return e&&e.responseType!==null})();class yJ extends mJ{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=gJ&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new dr($L,this.uri(),t)}}function $L(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||hJ))return new XMLHttpRequest}catch{}if(!t)try{return new _n[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const qL=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class vJ extends Vb{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=qL?{}:PL(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;Bb(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}s&&Sf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=LL()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const b0=_n.WebSocket||_n.MozWebSocket;class xJ extends vJ{createSocket(t,n,r){return qL?new b0(t,n,r):n?new b0(t,n):new b0(t)}doWrite(t,n){this.ws.send(n)}}class wJ extends Vb{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=tJ(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=eJ();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const o=()=>{r.read().then(({done:c,value:u})=>{c||(this.onPacket(u),o())}).catch(c=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&Sf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const bJ={websocket:xJ,webtransport:wJ,polling:yJ},SJ=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,_J=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function iw(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=SJ.exec(e||""),o={},a=14;for(;a--;)o[_J[a]]=s[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=NJ(o,o.path),o.queryKey=kJ(o,o.query),o}function NJ(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function kJ(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,o){s&&(n[s]=o)}),n}const ow=typeof addEventListener=="function"&&typeof removeEventListener=="function",Yu=[];ow&&addEventListener("offline",()=>{Yu.forEach(e=>e())},!1);class Ns extends mt{constructor(t,n){if(super(),this.binaryType=rJ,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=iw(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=iw(n.host).host);_f(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),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},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=uJ(this.opts.query)),ow&&(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"})},Yu.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=OL,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ns.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ns.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),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 t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=aJ(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Sf(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Ns.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){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(),ow&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Yu.indexOf(this._offlineEventListener);r!==-1&&Yu.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ns.protocol=OL;class CJ extends Ns{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Ns.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!r)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ns.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(m(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const g=new Error("probe error");g.transport=n.name,this.emitReserved("upgradeError",g)}}))};function o(){r||(r=!0,m(),n.close(),n=null)}const a=p=>{const g=new Error("probe error: "+p);g.transport=n.name,o(),this.emitReserved("upgradeError",g)};function c(){a("transport closed")}function u(){a("socket closed")}function f(p){n&&p.name!==n.name&&o()}const m=()=>{n.removeListener("open",s),n.removeListener("error",a),n.removeListener("close",c),this.off("close",u),this.off("upgrading",f)};n.once("open",s),n.once("error",a),n.once("close",c),this.once("close",u),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let EJ=class extends CJ{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(s=>bJ[s]).filter(s=>!!s)),super(t,r)}};function jJ(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=iw(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const RJ=typeof ArrayBuffer=="function",TJ=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,FL=Object.prototype.toString,IJ=typeof Blob=="function"||typeof Blob<"u"&&FL.call(Blob)==="[object BlobConstructor]",AJ=typeof File=="function"||typeof File<"u"&&FL.call(File)==="[object FileConstructor]";function Ub(e){return RJ&&(e instanceof ArrayBuffer||TJ(e))||IJ&&e instanceof Blob||AJ&&e instanceof File}function Xu(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Xu(e[n]))return!0;return!1}if(Ub(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Xu(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Xu(e[n]))return!0;return!1}function MJ(e){const t=[],n=e.data,r=e;return r.data=aw(n,t),r.attachments=t.length,{packet:r,buffers:t}}function aw(e,t){if(!e)return e;if(Ub(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=aw(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=aw(e[r],t));return n}return e}function OJ(e,t){return e.data=lw(e.data,t),delete e.attachments,e}function lw(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=lw(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=lw(e[n],t));return e}const PJ=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Le;(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"})(Le||(Le={}));class LJ{constructor(t){this.replacer=t}encode(t){return(t.type===Le.EVENT||t.type===Le.ACK)&&Xu(t)?this.encodeAsBinary({type:t.type===Le.EVENT?Le.BINARY_EVENT:Le.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Le.BINARY_EVENT||t.type===Le.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=MJ(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}}class Hb extends mt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Le.BINARY_EVENT;r||n.type===Le.BINARY_ACK?(n.type=r?Le.EVENT:Le.ACK,this.reconstructor=new DJ(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Ub(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Le[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Le.BINARY_EVENT||r.type===Le.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(o,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const o=n+1;for(;++n;){const a=t.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(Hb.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Le.CONNECT:return uT(n);case Le.DISCONNECT:return n===void 0;case Le.CONNECT_ERROR:return typeof n=="string"||uT(n);case Le.EVENT:case Le.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&PJ.indexOf(n[0])===-1);case Le.ACK:case Le.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class DJ{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=OJ(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function uT(e){return Object.prototype.toString.call(e)==="[object Object]"}const $J=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Hb,Encoder:LJ,get PacketType(){return Le}},Symbol.toStringTag,{value:"Module"}));function Fn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const qJ=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class BL extends mt{constructor(t,n,r){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=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Fn(t,"open",this.onopen.bind(this)),Fn(t,"packet",this.onpacket.bind(this)),Fn(t,"error",this.onerror.bind(this)),Fn(t,"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(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,o;if(qJ.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const a={type:Le.EVENT,data:n};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const m=this.ids++,p=n.pop();this._registerAckCallback(m,p),a.id=m}const c=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,u=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!c||(u?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===t&&this.sendBuffer.splice(c,1);n.call(this,new Error("operation has timed out"))},s),a=(...c)=>{this.io.clearTimeoutFn(o),n.apply(this,c)};a.withError=!0,this.acks[t]=a}emitWithAck(t,...n){return new Promise((r,s)=>{const o=(a,c)=>a?s(a):r(c);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...o)=>(this._queue[0],s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Le.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Le.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.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 Le.EVENT:case Le.BINARY_EVENT:this.onevent(t);break;case Le.ACK:case Le.BINARY_ACK:this.onack(t);break;case Le.DISCONNECT:this.ondisconnect();break;case Le.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:Le.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Le.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Uo(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}Uo.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};Uo.prototype.reset=function(){this.attempts=0};Uo.prototype.setMin=function(e){this.ms=e};Uo.prototype.setMax=function(e){this.max=e};Uo.prototype.setJitter=function(e){this.jitter=e};class cw extends mt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,_f(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Uo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||$J;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new EJ(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=Fn(n,"open",function(){r.onopen(),t&&t()}),o=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),t?t(c):this.maybeReconnectOnOpen()},a=Fn(n,"error",o);if(this._timeout!==!1){const c=this._timeout,u=this.setTimeoutFn(()=>{s(),o(new Error("timeout")),n.close()},c);this.opts.autoUnref&&u.unref(),this.subs.push(()=>{this.clearTimeoutFn(u)})}return this.subs.push(s),this.subs.push(a),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Fn(t,"ping",this.onping.bind(this)),Fn(t,"data",this.ondata.bind(this)),Fn(t,"error",this.onerror.bind(this)),Fn(t,"close",this.onclose.bind(this)),Fn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Sf(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new BL(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Da={};function Qu(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=jJ(e,t.path||"/socket.io"),r=n.source,s=n.id,o=n.path,a=Da[s]&&o in Da[s].nsps,c=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let u;return c?u=new cw(r,t):(Da[s]||(Da[s]=new cw(r,t)),u=Da[s]),n.query&&!t.query&&(t.query=n.queryKey),u.socket(n.path,t)}Object.assign(Qu,{Manager:cw,Socket:BL,io:Qu,connect:Qu});function zL(e={}){const{autoConnect:t=!0,onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:s,onAIProcessing:o,onAIResponse:a}=e,c=j.useRef(null),[u,f]=j.useState(!1),m=j.useRef({onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:s,onAIProcessing:o,onAIResponse:a});j.useEffect(()=>{m.current={onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:s,onAIProcessing:o,onAIResponse:a}},[n,r,s,o,a]);const p=j.useCallback(()=>{var k;if((k=c.current)!=null&&k.connected)return;const S=Qu({reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3});S.on("connect",()=>{console.log("WebSocket connected"),f(!0)}),S.on("disconnect",()=>{console.log("WebSocket disconnected"),f(!1)}),S.on("connect_error",N=>{console.error("WebSocket connection error:",N),f(!1)}),S.on(Ir.WORKFLOW_UPDATED,N=>{var C,R;(R=(C=m.current).onWorkflowUpdated)==null||R.call(C,N)}),S.on(Ir.EXECUTION_STEP,N=>{var C,R;(R=(C=m.current).onExecutionStep)==null||R.call(C,N)}),S.on(Ir.EXECUTION_COMPLETED,N=>{var C,R;(R=(C=m.current).onExecutionCompleted)==null||R.call(C,N)}),S.on(Ir.AI_PROCESSING,({processing:N})=>{var C,R;(R=(C=m.current).onAIProcessing)==null||R.call(C,N)}),S.on(Ir.AI_RESPONSE,N=>{var C,R;(R=(C=m.current).onAIResponse)==null||R.call(C,N)}),c.current=S},[]),g=j.useCallback(()=>{c.current&&(c.current.disconnect(),c.current=null,f(!1))},[]),v=j.useCallback(S=>{var k;(k=c.current)==null||k.emit(Ir.WORKFLOW_SUBSCRIBE,S)},[]),b=j.useCallback(S=>{var k;(k=c.current)==null||k.emit(Ir.WORKFLOW_UNSUBSCRIBE,S)},[]),w=j.useCallback(S=>{var k;(k=c.current)==null||k.emit(Ir.EXECUTION_SUBSCRIBE,S)},[]),x=j.useCallback(S=>{var k;(k=c.current)==null||k.emit(Ir.EXECUTION_UNSUBSCRIBE,S)},[]);return j.useEffect(()=>(t&&p(),()=>{g()}),[t,p,g]),{connected:u,socket:c.current,subscribeToWorkflow:v,unsubscribeFromWorkflow:b,subscribeToExecution:w,unsubscribeFromExecution:x,connect:p,disconnect:g}}function FJ(e){if(!e)return[];const t=[],n=/```yaml\s*\n([\s\S]*?)\n```/g;let r,s=0;for(;(r=n.exec(e))!==null;){const o=r[1];try{const a=oO(o);if(a&&a.type&&["while","for_each","for","switch","parallel","try","if","map","filter","reduce"].includes(a.type)){const c=a.id||`control-flow-${a.type}-${s++}`,u={...a,id:c,inputs:a.inputs||{}};t.push(u)}}catch(a){console.warn("Failed to parse control flow YAML block:",a)}}return t}function BJ(e){const t=[],n=[],o=FJ(e.markdown),a=[...e.steps,...o],c=(g,v,b,w)=>{let x=b,S=null;return g.forEach((k,N)=>{var B,M,L,U,$;k.id||(k.id=w?`${w}-step-${N}`:`step-${Date.now()}-${N}`);const C=!!k.workflow,R=!!k.type&&["while","for_each","for","switch","parallel","try","if","map","filter","reduce"].includes(k.type);let T="step";C?T="subworkflow":R&&(T=k.type);const I={id:k.id,name:k.name,action:k.action,workflowPath:k.workflow,status:"pending"};let O={...I};if(k.type==="while")O={...I,condition:k.condition||"true",maxIterations:k.maxIterations||100,variables:k.variables};else if(k.type==="for_each"||k.type==="for"){const z=k.items||"[]";O={...I,items:z==="unknown"?"[]":z,itemVariable:(B=k.inputs)==null?void 0:B.itemVariable}}else if(k.type==="switch")O={...I,expression:((M=k.inputs)==null?void 0:M.expression)||k.condition||"",cases:{},hasDefault:!0};else if(k.type==="parallel")O={...I,branches:[],maxConcurrent:0};else if(k.type==="try")O={...I,hasCatch:!0,hasFinally:!1};else if(k.type==="if")O={...I,condition:k.condition||"true",hasElse:!0};else if(k.type==="map"||k.type==="filter"||k.type==="reduce"){const z=k.items||((L=k.inputs)==null?void 0:L.items)||"[]";O={...I,transformType:k.type,items:z==="unknown"?"[]":z,itemVariable:(U=k.inputs)==null?void 0:U.itemVariable,expression:($=k.inputs)==null?void 0:$.expression,condition:k.condition}}else O={...I,condition:k.condition,items:k.items,maxIterations:k.maxIterations,variables:k.variables};const P={id:k.id,type:T,position:{x:v,y:x},data:O};if(t.push(P),S){const z={id:`e-${S}-${k.id}`,source:S,target:k.id,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}};k.conditions&&k.conditions.length>0&&(z.label="conditional",z.labelStyle={fill:"#a0a0c0",fontSize:10},z.labelBgStyle={fill:"#232340"}),n.push(z)}if((k.type==="while"||k.type==="for_each"||k.type==="for")&&k.steps&&k.steps.length>0){const z=v+350,V=x+20,{lastNodeId:G,endY:F}=c(k.steps,z,V,k.id),q=k.type==="while"?"#fb923c":"#f093fb";n.push({id:`e-${k.id}-body-start`,source:k.id,target:k.steps[0].id,sourceHandle:"body",type:"smoothstep",animated:!0,style:{stroke:q,strokeWidth:2},label:k.type==="while"?"do":"each",labelStyle:{fill:q,fontSize:10},labelBgStyle:{fill:"#1a1a2e",fillOpacity:.8}}),G&&n.push({id:`e-${G}-${k.id}-loop-back`,source:G,target:k.id,targetHandle:"loop-back",type:"smoothstep",animated:!0,style:{stroke:q,strokeWidth:2,strokeDasharray:"5,5"}}),x=Math.max(x+180,F)}else x+=180;S=k.id}),{lastNodeId:S,endY:x}};let u=0,f=null;if(e.triggers&&e.triggers.length>0){const g=e.triggers[0];f=`trigger-${e.metadata.id}`,t.push({id:f,type:"trigger",position:{x:250,y:u},data:{id:f,name:e.metadata.name,type:g.type||"manual",cron:g.cron,path:g.path,events:g.events,active:!0}}),u+=180}const{lastNodeId:m,endY:p}=c(a,250,u);if(f&&a.length>0&&n.push({id:`e-${f}-${a[0].id}`,source:f,target:a[0].id,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}}),a.length>0){const g=`output-${e.metadata.id}`,v=S=>{let k=[];return S.forEach(N=>{k.push(N),N.steps&&(k=k.concat(v(N.steps)))}),k},b=v(a),w=b.filter(S=>S.outputVariable).map(S=>S.outputVariable);t.push({id:g,type:"output",position:{x:250,y:p},data:{id:g,name:"Workflow Output",variables:w,status:"pending"}}),m&&n.push({id:`e-${m}-${g}`,source:m,target:g,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}});const x=zJ(b);n.push(...x)}return{nodes:t,edges:n}}function zJ(e){const t=[],n=new Map;return e.forEach(r=>{r.outputVariable&&n.set(r.outputVariable,r.id)}),e.forEach(r=>{VJ(r.inputs).forEach(o=>{const a=o.split(".")[0],c=n.get(a);if(c&&c!==r.id){const u=`data-${c}-${r.id}-${a}`;t.find(f=>f.id===u)||t.push({id:u,source:c,target:r.id,type:"smoothstep",animated:!0,style:{stroke:"#5bc0de",strokeWidth:1,strokeDasharray:"5,5"},label:a,labelStyle:{fill:"#5bc0de",fontSize:9},labelBgStyle:{fill:"#1a1a2e",fillOpacity:.8}})}})}),t}function VJ(e){const t=[];if(!e)return t;const n=/\{\{\s*([^}]+)\s*\}\}/g;function r(s){if(typeof s=="string"){let o;for(;(o=n.exec(s))!==null;){const c=o[1].trim().split(".")[0].replace(/\[.*\]/,"");c!=="inputs"&&!t.includes(c)&&t.push(c)}}else Array.isArray(s)?s.forEach(r):s&&typeof s=="object"&&Object.values(s).forEach(r)}return Object.values(e).forEach(r),t}function UJ(){const{workflows:e,selectedWorkflow:t,currentWorkflow:n,isLoading:r,error:s,loadWorkflows:o,selectWorkflow:a,loadWorkflow:c,saveWorkflow:u,createWorkflow:f,deleteWorkflow:m}=qr(),{setNodes:p,setEdges:g}=No(),{subscribeToWorkflow:v,unsubscribeFromWorkflow:b,connected:w}=zL({onWorkflowUpdated:R=>{R.path===t&&c(R.path),(R.event==="add"||R.event==="remove")&&o()}});j.useEffect(()=>{o()},[o]),j.useEffect(()=>{if(w&&t)return v(t),()=>{b(t)}},[w,t,v,b]),j.useEffect(()=>{if(n){const{nodes:R,edges:T}=BJ(n);p(R),g(T)}},[n,p,g]);const x=j.useCallback(R=>{a(R)},[a]),S=j.useCallback(async R=>{R&&await u(R)},[u]),k=j.useCallback(async R=>{await f(R)},[f]),N=j.useCallback(async R=>{await m(R)},[m]),C=j.useCallback(R=>{if(!n)return[];const T=[];if(n.inputs)for(const I of Object.keys(n.inputs))T.push(`inputs.${I}`);for(let I=0;I<R&&I<n.steps.length;I++){const O=n.steps[I];O.outputVariable&&T.push(O.outputVariable)}return T},[n]);return{workflows:e,selectedWorkflow:t,currentWorkflow:n,isLoading:r,error:s,selectWorkflow:x,saveWorkflow:S,createWorkflow:k,deleteWorkflow:N,refreshWorkflows:o,getAvailableVariables:C}}function HJ(){var yi;const{currentWorkflow:e,selectedWorkflow:t,saveWorkflow:n,refreshWorkflows:r}=UJ(),{isNewStepOpen:s,newStepPosition:o,openNewStepWizard:a,closeNewStepWizard:c}=_L(),{pendingChanges:u,acceptChanges:f,rejectChanges:m}=Fb(),{isOpen:p,setIsOpen:g,openShortcuts:v}=UQ(),{breadcrumbs:b,popToIndex:w,resetNavigation:x}=Tw(),{loadWorkflow:S}=qr(),k=j.useCallback((_e,Ce)=>{w(Ce),S(_e.path||"")},[w,S]),{connected:N,subscribeToExecution:C,unsubscribeFromExecution:R}=zL({onWorkflowUpdated:()=>{r()},onExecutionStep:_e=>{vt(_e.stepId),Re(Ce=>Ce.map(We=>We.stepId===_e.stepId?{...We,status:_e.status,duration:_e.duration,error:_e.error}:We)),ze(Ce=>[...Ce,`Step "${_e.stepName||_e.stepId}": ${_e.status}${_e.error?` - ${_e.error}`:""}`]),Pe.current&&(M(Pe.current,_e.stepId,_e.status,_e.output,_e.error),U(Pe.current,`Step "${_e.stepName||_e.stepId}": ${_e.status}`))},onExecutionCompleted:_e=>{be(_e.status),vt(null),ze(Ce=>[...Ce,_e.status==="completed"?"Workflow completed successfully!":_e.error||"Workflow execution failed"]),Pe.current&&(L(Pe.current,_e.status),_e.error&&U(Pe.current,`Error: ${_e.error}`)),_e.runId&&R(_e.runId),Pe.current=null}}),{isExecuting:T,isPaused:I,currentRunId:O,runs:P,startExecution:B,updateStepStatus:M,completeExecution:L,addLog:U,pauseExecution:$,resumeExecution:z,cancelExecution:V,debug:G,enableDebugMode:F,disableDebugMode:q,toggleBreakpoint:X,clearAllBreakpoints:D,stepOver:W,stepInto:oe,stepOut:K,addWatchExpression:J,removeWatchExpression:te}=CL(),{breakpoint:Y,setBreakpoint:ee,sidebarOpen:ie,setSidebarOpen:ue,propertiesPanelOpen:ge,setPropertiesPanelOpen:xe}=qb();j.useEffect(()=>{const _e=()=>{const Ce=bQ(window.innerWidth);Ce!==Y&&ee(Ce)};return _e(),window.addEventListener("resize",_e),()=>window.removeEventListener("resize",_e)},[Y,ee]);const[pe,be]=j.useState("pending"),[ve,Re]=j.useState([]),[ke,ze]=j.useState([]),[Ue,vt]=j.useState(null),Pe=j.useRef(null),[ft,He]=j.useState(!1),[hn,Zt]=j.useState({}),[en,Lt]=j.useState(!1),bt=j.useCallback(()=>{a()},[a]),wr=j.useCallback(_e=>{if(!e)return;const Ce={...e,steps:[...e.steps,_e]};n(Ce),console.log("Created step:",_e)},[e,n]),kt=j.useCallback(async _e=>{var Ce;if(T){if(Pe.current)try{(await fetch(`/api/execute/cancel/${Pe.current}`,{method:"POST"})).ok&&(V(Pe.current),be("cancelled"),ze(pn=>[...pn,"Execution cancelled by user"]),Pe.current=null)}catch(We){console.error("Failed to cancel execution:",We),ze(pn=>[...pn,"Failed to cancel execution"])}return}if(!(!e||!t)){if(!_e&&e.inputs&&Object.keys(e.inputs).length>0){He(!0);return}try{be("running"),vt(null),ze(["Starting workflow execution..."]),Re(e.steps.map(Tt=>({stepId:Tt.id,stepName:Tt.name||Tt.id,status:"pending"})));const We=await fetch(`/api/execute/${encodeURIComponent(t)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({inputs:_e||{},dryRun:!1})});if(!We.ok){const Tt=await We.json();throw new Error(Tt.message||"Failed to start execution")}const mn=(await We.json()).runId,Qn=((Ce=e.metadata)==null?void 0:Ce.name)||"Untitled Workflow";B(t,Qn,{},mn),Pe.current=mn,C(mn),ze(Tt=>[...Tt,`Execution started: ${mn}`])}catch(We){const pn=We instanceof Error?We.message:"Unknown error";console.error("Failed to execute workflow:",We),be("failed"),ze(mn=>[...mn,`Error: ${pn}`]),Pe.current&&(L(Pe.current,"failed"),Pe.current=null)}}},[T,e,t,B,V,C,M,U,L]),tn=j.useCallback(()=>{e&&n(e)},[e,n]),Kr=j.useCallback(()=>{t&&Lt(!0)},[t]),Rt=j.useCallback(()=>{if(b.length>1){const _e=b.length-2,Ce=b[_e];w(_e),S(Ce.path)}},[b,w,S]),Dt=j.useCallback(()=>{if(b.length>1){const _e=b[0];w(0),S(_e.path)}},[b,w,S]);return j.useEffect(()=>{const _e=Ce=>{if(Ce.target instanceof HTMLInputElement||Ce.target instanceof HTMLTextAreaElement)return;const We=Ce.metaKey||Ce.ctrlKey;We&&Ce.key==="s"&&(Ce.preventDefault(),tn()),We&&Ce.key==="Enter"&&(Ce.preventDefault(),kt()),Ce.key==="n"&&!We&&!Ce.shiftKey&&!Ce.altKey&&(Ce.preventDefault(),bt()),We&&Ce.key==="ArrowLeft"&&(Ce.preventDefault(),Rt()),We&&Ce.key==="ArrowUp"&&(Ce.preventDefault(),Dt()),Ce.key==="F9"&&(Ce.preventDefault(),G.enabled?q():F()),Ce.key==="F10"&&G.enabled&&I&&(Ce.preventDefault(),W()),Ce.key==="F11"&&!Ce.shiftKey&&G.enabled&&I&&(Ce.preventDefault(),oe()),Ce.key==="F11"&&Ce.shiftKey&&G.enabled&&I&&(Ce.preventDefault(),K()),Ce.key==="F5"&&I&&(Ce.preventDefault(),z())};return window.addEventListener("keydown",_e),()=>window.removeEventListener("keydown",_e)},[tn,kt,bt,Rt,Dt,G.enabled,I,F,q,W,oe,K,z]),d.jsx(QI,{children:d.jsxs("div",{className:"flex h-screen w-screen overflow-hidden bg-bg-canvas",children:[d.jsx(kQ,{}),d.jsxs("div",{className:"flex flex-1 flex-col relative",children:[Y==="mobile"&&d.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border-default bg-bg-panel",children:[d.jsx("button",{onClick:()=>ue(!0),className:"w-10 h-10 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors","aria-label":"Open menu",children:d.jsx(s8,{className:"w-5 h-5 text-text-secondary"})}),d.jsx("h1",{className:"text-sm font-medium text-text-primary",children:"Marktoflow"}),d.jsx("button",{onClick:()=>xe(!0),className:"w-10 h-10 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors","aria-label":"Open properties",children:d.jsx(l8,{className:"w-5 h-5 text-text-secondary"})})]}),Y!=="mobile"&&d.jsxs("div",{className:"absolute top-4 right-4 z-10 flex items-center gap-2",children:[d.jsx(WQ,{showLabel:!0}),d.jsx(HQ,{onClick:v}),d.jsxs("div",{className:`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs ${N?"bg-success/10 text-success":"bg-error/10 text-error"}`,children:[d.jsx("div",{className:`w-2 h-2 rounded-full ${N?"bg-success":"bg-error"}`}),N?"Connected":"Disconnected"]})]}),d.jsx(lQ,{onAddStep:bt,onExecute:kt,onSave:tn,onValidate:Kr,isExecuting:T}),d.jsx(KQ,{items:b,onNavigate:k}),d.jsxs("div",{className:"flex-1 relative",children:[d.jsx(oQ,{}),d.jsx(cQ,{isExecuting:T,isPaused:I,workflowStatus:pe,currentStepId:Ue,steps:ve,logs:ke,onPause:()=>$(),onResume:()=>z(),onStop:()=>{Pe.current&&(V(Pe.current),Pe.current=null),be("cancelled")},onStepOver:()=>W(),onClose:()=>{be("pending"),Re([]),ze([])},debug:G,onToggleDebugMode:()=>{G.enabled?q():F()},onToggleBreakpoint:_e=>X(_e),onStepInto:()=>oe(),onStepOut:()=>K(),onClearBreakpoints:()=>D(),onAddWatchExpression:_e=>J(_e),onRemoveWatchExpression:_e=>te(_e)})]}),d.jsx($Q,{})]}),d.jsx(TQ,{}),d.jsx(BQ,{open:s,onOpenChange:_e=>{_e||c()},onCreateStep:wr,position:o||void 0}),u&&d.jsx(qQ,{open:!!u,onOpenChange:()=>m(),originalWorkflow:e,modifiedWorkflow:u,explanation:"AI has suggested the following changes to your workflow.",onAccept:f,onReject:m}),(e==null?void 0:e.inputs)&&d.jsx(yQ,{open:ft,onOpenChange:He,inputs:e.inputs,onExecute:kt,workflowName:(yi=e.metadata)==null?void 0:yi.name}),d.jsx(vQ,{workflowPath:en?t:null,onClose:()=>Lt(!1)}),d.jsx(VQ,{open:p,onOpenChange:g})]})})}T4.createRoot(document.getElementById("root")).render(d.jsx(pt.StrictMode,{children:d.jsx(HJ,{})}));
708
+ //# sourceMappingURL=index-DIjBDUL-.js.map