@ansible-flow/designer 0.0.0-stage → 0.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +9 -2
- package/THIRD_PARTY_NOTICES.md +41 -0
- package/dist/index.css +2 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +200 -0
- package/dist/transport.d.ts +16 -0
- package/package.json +31 -4
package/dist/index.js
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
var dA=Object.create,mk=Object.defineProperty,uA=Object.getOwnPropertyDescriptor,cA=Object.getOwnPropertyNames,fA=Object.getPrototypeOf,gk=Object.prototype.hasOwnProperty,wn=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),hA=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=cA(t),s=0,l=a.length,f;s<l;s++)f=a[s],!gk.call(e,f)&&f!==n&&mk(e,f,{get:(p=>t[p]).bind(null,f),enumerable:!(r=uA(t,f))||r.enumerable});return e},yk=(e,t,n)=>(n=e==null?{}:dA(fA(e)),hA(t||!e||!e.__esModule||!gk.call(e,"default")?mk(n,"default",{value:e,enumerable:!0}):n,e)),pA=wn((e=>{function t(I,U){var W=I.length;I.push(U);e:for(;0<W;){var re=W-1>>>1,le=I[re];if(0<a(le,U))I[re]=U,I[W]=le,W=re;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var U=I[0],W=I.pop();if(W!==U){I[0]=W;e:for(var re=0,le=I.length,pe=le>>>1;re<pe;){var xe=2*(re+1)-1,Ne=I[xe],we=xe+1,R=I[we];if(0>a(Ne,W))we<le&&0>a(R,Ne)?(I[re]=R,I[we]=W,re=we):(I[re]=Ne,I[xe]=W,re=xe);else if(we<le&&0>a(R,W))I[re]=R,I[we]=W,re=we;else break e}}return U}function a(I,U){var W=I.sortIndex-U.sortIndex;return W===0?I.id-U.id:W}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,f=l.now();e.unstable_now=function(){return l.now()-f}}var p=[],h=[],v=1,g=null,m=3,b=!1,w=!1,k=!1,S=!1,N=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function $(I){for(var U=n(h);U!==null;){if(U.callback===null)r(h);else if(U.startTime<=I)r(h),U.sortIndex=U.expirationTime,t(p,U);else break;U=n(h)}}function L(I){if(k=!1,$(I),!w)if(n(p)!==null)w=!0,z||(z=!0,V());else{var U=n(h);U!==null&&J(L,U.startTime-I)}}var z=!1,A=-1,M=5,O=-1;function K(){return S?!0:!(e.unstable_now()-O<M)}function B(){if(S=!1,z){var I=e.unstable_now();O=I;var U=!0;try{e:{w=!1,k&&(k=!1,E(A),A=-1),b=!0;var W=m;try{t:{for($(I),g=n(p);g!==null&&!(g.expirationTime>I&&K());){var re=g.callback;if(typeof re=="function"){g.callback=null,m=g.priorityLevel;var le=re(g.expirationTime<=I);if(I=e.unstable_now(),typeof le=="function"){g.callback=le,$(I),U=!0;break t}g===n(p)&&r(p),$(I)}else r(p);g=n(p)}if(g!==null)U=!0;else{var pe=n(h);pe!==null&&J(L,pe.startTime-I),U=!1}}break e}finally{g=null,m=W,b=!1}U=void 0}}finally{U?V():z=!1}}}var V;if(typeof j=="function")V=function(){j(B)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,F=oe.port2;oe.port1.onmessage=B,V=function(){F.postMessage(null)}}else V=function(){N(B,0)};function J(I,U){A=N(function(){I(e.unstable_now())},U)}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(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_next=function(I){switch(m){case 1:case 2:case 3:var U=3;break;default:U=m}var W=m;m=U;try{return I()}finally{m=W}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(I,U){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var W=m;m=I;try{return U()}finally{m=W}},e.unstable_scheduleCallback=function(I,U,W){var re=e.unstable_now();switch(typeof W=="object"&&W?(W=W.delay,W=typeof W=="number"&&0<W?re+W:re):W=re,I){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=W+le,I={id:v++,callback:U,priorityLevel:I,startTime:W,expirationTime:le,sortIndex:-1},W>re?(I.sortIndex=W,t(h,I),n(p)===null&&I===n(h)&&(k?(E(A),A=-1):k=!0,J(L,W-re))):(I.sortIndex=le,t(p,I),w||b||(w=!0,z||(z=!0,V()))),I},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(I){var U=m;return function(){var W=m;m=U;try{return I.apply(this,arguments)}finally{m=W}}}})),mA=wn(((e,t)=>{t.exports=pA()})),gA=wn((e=>{var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),b=Symbol.for("react.view_transition"),w=Symbol.iterator;function k(R){return typeof R!="object"||!R?null:(R=w&&R[w]||R["@@iterator"],typeof R=="function"?R:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,E={};function j(R,Q,fe){this.props=R,this.context=Q,this.refs=E,this.updater=fe||S}j.prototype.isReactComponent={},j.prototype.setState=function(R,Q){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,Q,"setState")},j.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function $(){}$.prototype=j.prototype;function L(R,Q,fe){this.props=R,this.context=Q,this.refs=E,this.updater=fe||S}var z=L.prototype=new $;z.constructor=L,N(z,j.prototype),z.isPureReactComponent=!0;var A=Array.isArray;function M(){}var O={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function B(R,Q,fe){var X=fe.ref;return{$$typeof:t,type:R,key:Q,ref:X===void 0?null:X,props:fe}}function V(R,Q){return B(R.type,Q,R.props)}function oe(R){return typeof R=="object"&&!!R&&R.$$typeof===t}function F(R){var Q={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(fe){return Q[fe]})}var J=/\/+/g;function I(R,Q){return typeof R=="object"&&R&&R.key!=null?F(""+R.key):Q.toString(36)}function U(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(M,M):(R.status="pending",R.then(function(Q){R.status==="pending"&&(R.status="fulfilled",R.value=Q)},function(Q){R.status==="pending"&&(R.status="rejected",R.reason=Q)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function W(R,Q,fe,X,he){var Z=typeof R;(Z==="undefined"||Z==="boolean")&&(R=null);var q=!1;if(R===null)q=!0;else switch(Z){case"bigint":case"string":case"number":q=!0;break;case"object":switch(R.$$typeof){case t:case n:q=!0;break;case g:return q=R._init,W(q(R._payload),Q,fe,X,he)}}if(q)return he=he(R),q=X===""?"."+I(R,0):X,A(he)?(fe="",q!=null&&(fe=q.replace(J,"$&/")+"/"),W(he,Q,fe,"",function(me){return me})):he!=null&&(oe(he)&&(he=V(he,fe+(he.key==null||R&&R.key===he.key?"":(""+he.key).replace(J,"$&/")+"/")+q)),Q.push(he)),1;q=0;var ee=X===""?".":X+":";if(A(R))for(var de=0;de<R.length;de++)X=R[de],Z=ee+I(X,de),q+=W(X,Q,fe,Z,he);else if(de=k(R),typeof de=="function")for(R=de.call(R),de=0;!(X=R.next()).done;)X=X.value,Z=ee+I(X,de++),q+=W(X,Q,fe,Z,he);else if(Z==="object"){if(typeof R.then=="function")return W(U(R),Q,fe,X,he);throw Q=String(R),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return q}function re(R,Q,fe){if(R==null)return R;var X=[],he=0;return W(R,X,"","",function(Z){return Q.call(fe,Z,he++)}),X}function le(R){if(R._status===-1){var Q=R._result,fe=Q();fe.then(function(X){(R._status===0||R._status===-1)&&(R._status=1,R._result=X,fe.status===void 0&&(fe.status="fulfilled",fe.value=X))},function(X){(R._status===0||R._status===-1)&&(R._status=2,R._result=X,fe.status===void 0&&(fe.status="rejected",fe.reason=X))}),R._status===-1&&(R._status=0,R._result=fe)}if(R._status===1)return R._result.default;throw R._result}var pe=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)};function xe(R){var Q=O.T,fe={};fe.types=Q===null?null:Q.types,O.T=fe;try{var X=R(),he=O.S;he!==null&&he(fe,X),typeof X=="object"&&X&&typeof X.then=="function"&&X.then(M,pe)}catch(Z){pe(Z)}finally{Q!==null&&fe.types!==null&&(Q.types=fe.types),O.T=Q}}function Ne(R){var Q=O.T;if(Q!==null){var fe=Q.types;fe===null?Q.types=[R]:fe.indexOf(R)===-1&&fe.push(R)}else xe(Ne.bind(null,R))}var we={map:re,forEach:function(R,Q,fe){re(R,function(){Q.apply(this,arguments)},fe)},count:function(R){var Q=0;return re(R,function(){Q++}),Q},toArray:function(R){return re(R,function(Q){return Q})||[]},only:function(R){if(!oe(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};e.Activity=m,e.Children=we,e.Component=j,e.Fragment=r,e.Profiler=s,e.PureComponent=L,e.StrictMode=a,e.Suspense=h,e.ViewTransition=b,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,e.__COMPILER_RUNTIME={__proto__:null,c:function(R){return O.H.useMemoCache(R)}},e.addTransitionType=Ne,e.cache=function(R){return function(){return R.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(R,Q,fe){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var X=N({},R.props),he=R.key;if(Q!=null)for(Z in Q.key!==void 0&&(he=""+Q.key),Q)!K.call(Q,Z)||Z==="key"||Z==="__self"||Z==="__source"||Z==="ref"&&Q.ref===void 0||(X[Z]=Q[Z]);var Z=arguments.length-2;if(Z===1)X.children=fe;else if(1<Z){for(var q=Array(Z),ee=0;ee<Z;ee++)q[ee]=arguments[ee+2];X.children=q}return B(R.type,he,X)},e.createContext=function(R){return R={$$typeof:f,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:l,_context:R},R},e.createElement=function(R,Q,fe){var X,he={},Z=null;if(Q!=null)for(X in Q.key!==void 0&&(Z=""+Q.key),Q)K.call(Q,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(he[X]=Q[X]);var q=arguments.length-2;if(q===1)he.children=fe;else if(1<q){for(var ee=Array(q),de=0;de<q;de++)ee[de]=arguments[de+2];he.children=ee}if(R&&R.defaultProps)for(X in q=R.defaultProps,q)he[X]===void 0&&(he[X]=q[X]);return B(R,Z,he)},e.createRef=function(){return{current:null}},e.forwardRef=function(R){return{$$typeof:p,render:R}},e.isValidElement=oe,e.lazy=function(R){return{$$typeof:g,_payload:{_status:-1,_result:R},_init:le}},e.memo=function(R,Q){return{$$typeof:v,type:R,compare:Q===void 0?null:Q}},e.startTransition=xe,e.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},e.use=function(R){return O.H.use(R)},e.useActionState=function(R,Q,fe){return O.H.useActionState(R,Q,fe)},e.useCallback=function(R,Q){return O.H.useCallback(R,Q)},e.useContext=function(R){return O.H.useContext(R)},e.useDebugValue=function(){},e.useDeferredValue=function(R,Q){return O.H.useDeferredValue(R,Q)},e.useEffect=function(R,Q){return O.H.useEffect(R,Q)},e.useEffectEvent=function(R){return O.H.useEffectEvent(R)},e.useId=function(){return O.H.useId()},e.useImperativeHandle=function(R,Q,fe){return O.H.useImperativeHandle(R,Q,fe)},e.useInsertionEffect=function(R,Q){return O.H.useInsertionEffect(R,Q)},e.useLayoutEffect=function(R,Q){return O.H.useLayoutEffect(R,Q)},e.useMemo=function(R,Q){return O.H.useMemo(R,Q)},e.useOptimistic=function(R,Q){return O.H.useOptimistic(R,Q)},e.useReducer=function(R,Q,fe){return O.H.useReducer(R,Q,fe)},e.useRef=function(R){return O.H.useRef(R)},e.useState=function(R){return O.H.useState(R)},e.useSyncExternalStore=function(R,Q,fe){return O.H.useSyncExternalStore(R,Q,fe)},e.useTransition=function(){return O.H.useTransition()},e.version="19.3.1"})),ed=wn(((e,t)=>{t.exports=gA()})),yA=wn((e=>{var t=ed();function n(g){var m="https://react.dev/errors/"+g;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)m+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal"),l=Symbol.for("react.recoverable"),f=Symbol.for("react.optimistic_key");function p(g,m,b){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:w==null?null:w===f?f:""+w,children:g,containerInfo:m,implementation:b}}var h=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(g){return{$$typeof:l,_reason:g}},e.createPortal=function(g,m){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(n(299));return p(g,m,null,b)},e.flushSync=function(g){var m=h.T,b=a.p;try{if(h.T=null,a.p=2,g)return g()}finally{h.T=m,a.p=b,a.d.f()}},e.preconnect=function(g,m){typeof g=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(g,m))},e.prefetchDNS=function(g){typeof g=="string"&&a.d.D(g)},e.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var b=m.as,w=v(b,m.crossOrigin),k=typeof m.integrity=="string"?m.integrity:void 0,S=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?a.d.S(g,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:w,integrity:k,fetchPriority:S}):b==="script"&&a.d.X(g,{crossOrigin:w,integrity:k,fetchPriority:S,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},e.preinitModule=function(g,m){if(typeof g=="string")if(typeof m=="object"&&m){if(m.as==null||m.as==="script"){var b=v(m.as,m.crossOrigin);a.d.M(g,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0})}}else m??a.d.M(g)},e.preload=function(g,m){if(typeof g=="string"&&typeof m=="object"&&m&&typeof m.as=="string"){var b=m.as,w=v(b,m.crossOrigin);a.d.L(g,b,{crossOrigin:w,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},e.preloadModule=function(g,m){if(typeof g=="string")if(m){var b=v(m.as,m.crossOrigin);a.d.m(g,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0})}else a.d.m(g)},e.requestFormReset=function(g){a.d.r(g)},e.unstable_batchedUpdates=function(g,m){return g(m)},e.useFormState=function(g,m,b){return h.H.useFormState(g,m,b)},e.useFormStatus=function(){return h.H.useHostTransitionStatus()},e.version="19.3.1"})),vk=wn(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE=="function")try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}n(),t.exports=yA()})),vA=wn((e=>{var t=mA(),n=ed(),r=vk();function a(o){var i="https://react.dev/errors/"+o;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)i+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+o+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function l(o){for(var i=o,d=i;d&&!d.alternate;)i=d,i.flags&4098&&(o=i.return),d=i.return;for(;i.return;)i=i.return;return i.tag===3?o:null}function f(o){if(o.tag===13){var i=o.memoizedState;if(i===null&&(o=o.alternate,o!==null&&(i=o.memoizedState)),i!==null)return i.dehydrated}return null}function p(o){if(o.tag===31){var i=o.memoizedState;if(i===null&&(o=o.alternate,o!==null&&(i=o.memoizedState)),i!==null)return i.dehydrated}return null}function h(o){if(l(o)!==o)throw Error(a(188))}function v(o){var i=o.alternate;if(!i){if(i=l(o),i===null)throw Error(a(188));return i===o?o:null}for(var d=o,u=i;;){var y=d.return;if(y===null)break;var x=y.alternate;if(x===null){if(u=y.return,u!==null){d=u;continue}break}if(y.child===x.child){for(x=y.child;x;){if(x===d)return h(y),o;if(x===u)return h(y),i;x=x.sibling}throw Error(a(188))}if(d.return!==u.return)d=y,u=x;else{for(var C=!1,P=y.child;P;){if(P===d){C=!0,d=y,u=x;break}if(P===u){C=!0,u=y,d=x;break}P=P.sibling}if(!C){for(P=x.child;P;){if(P===d){C=!0,d=x,u=y;break}if(P===u){C=!0,u=x,d=y;break}P=P.sibling}if(!C)throw Error(a(189))}}if(d.alternate!==u)throw Error(a(190))}if(d.tag!==3)throw Error(a(188));return d.stateNode.current===d?o:i}function g(o){var i=o.tag;if(i===5||i===26||i===27||i===6)return o;for(o=o.child;o!==null;){if(i=g(o),i!==null)return i;o=o.sibling}return null}function m(o,i,d,u,y,x){for(;o!==null;){if((o.tag===5||o.tag===27||o.tag===6)&&d(o,u,y,x)||(o.tag!==22||o.memoizedState===null)&&(i||o.tag!==5&&o.tag!==27)&&m(o.child,i,d,u,y,x))return!0;o=o.sibling}return!1}function b(o){for(o=o.return;o!==null;){if(o.tag===3||o.tag===5||o.tag===27)return o;o=o.return}return null}function w(o){var i=!1;for(o=o.return;o!==null&&(o.tag===4&&(i=!0),o.tag!==3&&o.tag!==5&&o.tag!==27);)o=o.return;return i}function k(o){var i=[null,null],d=b(o);return d===null||S(i,o,d.child,{foundSelf:!1}),i}function S(o,i,d,u){for(;d!==null;){if(d===i)u.foundSelf=!0;else if(d.tag===5||d.tag===27||d.tag===6){if(u.foundSelf)return o[1]=d,!0;o[0]=d}else if((d.tag!==22||d.memoizedState===null)&&S(o,i,d.child,u))return!0;d=d.sibling}return!1}function N(o){switch(o.tag){case 5:case 27:case 6:return o.stateNode;case 3:return o.stateNode.containerInfo;default:throw Error(a(559))}}var E=null,j=null;function $(o,i,d){return o===d||o===i&&(E=o,!0)}function L(o,i,d){return o===d?(j=o,!1):o===i&&(j!==null&&(E=o),!0)}function z(o){if(o===null)return null;do o=o===null?null:o.return;while(o&&o.tag!==5&&o.tag!==27&&o.tag!==3);return o||null}function A(o,i,d){for(var u=0,y=o;y;y=d(y))u++;y=0;for(var x=i;x;x=d(x))y++;for(;0<u-y;)o=d(o),u--;for(;0<y-u;)i=d(i),y--;for(;u--;){if(o===i||i!==null&&o===i.alternate)return o;o=d(o),i=d(i)}return null}var M=Object.assign,O=Symbol.for("react.element"),K=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),oe=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),J=Symbol.for("react.consumer"),I=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),re=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),pe=Symbol.for("react.lazy"),xe=Symbol.for("react.activity"),Ne=Symbol.for("react.legacy_hidden"),we=Symbol.for("react.memo_cache_sentinel"),R=Symbol.for("react.view_transition"),Q=Symbol.for("react.recoverable"),fe=Symbol.iterator;function X(o){return typeof o!="object"||!o?null:(o=fe&&o[fe]||o["@@iterator"],typeof o=="function"?o:null)}var he=Symbol.for("react.client.reference");function Z(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===he?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case V:return"Fragment";case F:return"Profiler";case oe:return"StrictMode";case W:return"Suspense";case re:return"SuspenseList";case xe:return"Activity";case R:return"ViewTransition"}if(typeof o=="object")switch(o.$$typeof){case B:return"Portal";case I:return o.displayName||"Context";case J:return(o._context.displayName||"Context")+".Consumer";case U:var i=o.render;return o=o.displayName,o||=(o=i.displayName||i.name||"",o===""?"ForwardRef":"ForwardRef("+o+")"),o;case le:return i=o.displayName||null,i===null?Z(o.type)||"Memo":i;case pe:i=o._payload,o=o._init;try{return Z(o(i))}catch{}}return null}var q=Array.isArray,ee=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me={pending:!1,data:null,method:null,action:null},De=[],Fe=-1;function Ye(o){return{current:o}}function Ie(o){0>Fe||(o.current=De[Fe],De[Fe]=null,Fe--)}function Be(o,i){Fe++,De[Fe]=o.current,o.current=i}var ut=Ye(null),kt=Ye(null),Lt=Ye(null),zt=Ye(null);function hn(o,i){switch(Be(Lt,i),Be(kt,o),Be(ut,null),i.nodeType){case 9:case 11:o=(o=i.documentElement)&&(o=o.namespaceURI)?Cw(o):0;break;default:if(o=i.tagName,i=i.namespaceURI)i=Cw(i),o=Ew(i,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}Ie(ut),Be(ut,o)}function Ft(){Ie(ut),Ie(kt),Ie(Lt)}function Bt(o){var i=o.memoizedState;i!==null&&(gs._currentValue=i.memoizedState,Be(zt,o)),i=ut.current;var d=Ew(i,o.type);i!==d&&(Be(kt,o),Be(ut,d))}function nn(o){kt.current===o&&(Ie(ut),Ie(kt)),zt.current===o&&(Ie(zt),gs._currentValue=me)}var pn,bt;function mn(o){if(pn===void 0)try{throw Error()}catch(d){var i=d.stack.trim().match(/\n( *(at )?)/);pn=i&&i[1]||"",bt=-1<d.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+pn+o+bt}var Uo=!1;function Cr(o,i){if(!o||Uo)return"";Uo=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(i){var ye=function(){throw Error()};if(Object.defineProperty(ye.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ye,[])}catch(Se){var te=Se}Reflect.construct(o,[],ye)}else{try{ye.call()}catch(Se){te=Se}ye=!1;try{var ue=Object.getOwnPropertyDescriptor(o.prototype,"props");Object.defineProperty(o.prototype,"props",{configurable:!0,set:function(){throw Error()}}),ye=!0,new o}finally{ye&&(ue===void 0?delete o.prototype.props:Object.defineProperty(o.prototype,"props",ue))}}}else{try{throw Error()}catch(Se){te=Se}(ye=o())&&typeof ye.catch=="function"&&ye.catch(function(){})}}catch(Se){if(Se&&te&&typeof Se.stack=="string")return[Se.stack,te.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=u.DetermineComponentFrameRoot(),C=x[0],P=x[1];if(C&&P){var H=C.split(`
|
|
4
|
+
`),ie=P.split(`
|
|
5
|
+
`);for(y=u=0;u<H.length&&!H[u].includes("DetermineComponentFrameRoot");)u++;for(;y<ie.length&&!ie[y].includes("DetermineComponentFrameRoot");)y++;if(u===H.length||y===ie.length)for(u=H.length-1,y=ie.length-1;1<=u&&0<=y&&H[u]!==ie[y];)y--;for(;1<=u&&0<=y;u--,y--)if(H[u]!==ie[y]){if(u!==1||y!==1)do if(u--,y--,0>y||H[u]!==ie[y]){var ce=`
|
|
6
|
+
`+H[u].replace(" at new "," at ");return o.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",o.displayName)),ce}while(1<=u&&0<=y);break}}}finally{Uo=!1,Error.prepareStackTrace=d}return(d=o?o.displayName||o.name:"")?mn(d):""}function ja(o,i){switch(o.tag){case 26:case 27:case 5:return mn(o.type);case 16:return mn("Lazy");case 13:return o.child!==i&&i!==null?mn("Suspense Fallback"):mn("Suspense");case 19:return mn("SuspenseList");case 0:case 15:return Cr(o.type,!1);case 11:return Cr(o.type.render,!1);case 1:return Cr(o.type,!0);case 31:return mn("Activity");case 30:return mn("ViewTransition");default:return""}}function Er(o){try{var i="",d=null;do i+=ja(o,d),d=o,o=o.return;while(o);return i}catch(u){return`
|
|
7
|
+
Error generating stack: `+u.message+`
|
|
8
|
+
`+u.stack}}var rn=Object.prototype.hasOwnProperty,Yo=t.unstable_scheduleCallback,Sn=t.unstable_cancelCallback,Ca=t.unstable_shouldYield,dl=t.unstable_requestPaint,Xt=t.unstable_now,Ea=t.unstable_getCurrentPriorityLevel,$r=t.unstable_ImmediatePriority,Ni=t.unstable_UserBlockingPriority,Xo=t.unstable_NormalPriority,$a=t.unstable_LowPriority,_a=t.unstable_IdlePriority,ul=t.log,ji=t.unstable_setDisableYieldValue,Dn=null,jt=null;function Ln(o){if(typeof ul=="function"&&ji(o),jt&&typeof jt.setStrictMode=="function")try{jt.setStrictMode(Dn,o)}catch{}}var qt=Math.clz32?Math.clz32:cl,Ta=Math.log,Ci=Math.LN2;function cl(o){return o>>>=0,o===0?32:31-(Ta(o)/Ci|0)|0}var _r=256,bo=262144,Tr=4194304;function Qn(o){var i=o&42;if(i!==0)return i;switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return o&-o;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function Ar(o,i,d){var u=o.pendingLanes;if(u===0)return 0;var y=0,x=o.suspendedLanes,C=o.pingedLanes;o=o.warmLanes;var P=u&134217727;return P===0?(P=u&~x,P===0?C===0?d||(d=u&~o,d!==0&&(y=Qn(d))):y=Qn(C):y=Qn(P)):(u=P&~x,u===0?(C&=P,C===0?d||(d=P&~o,d!==0&&(y=Qn(d))):y=Qn(C)):y=Qn(u)),y===0?0:i!==0&&i!==y&&(i&x)===0&&(x=y&-y,d=i&-i,x>=d||x===32&&d&4194048)?i:y}function Zt(o,i){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&i)===0}function Ei(o,i){i&8&&(i|=i&32);var d=o.entangledLanes;if(d!==0)for(o=o.entanglements,d&=i;0<d;){var u=31-qt(d),y=1<<u;i|=o[u],d&=~y}return i}function Mr(o,i){switch(o){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $i(){var o=Tr;return Tr<<=1,!(Tr&62914560)&&(Tr=4194304),o}function Or(o){for(var i=[],d=0;31>d;d++)i.push(o);return i}function Zo(o,i){o.pendingLanes|=i,i!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function Aa(o,i,d,u,y,x){var C=o.pendingLanes;o.pendingLanes=d,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=d,o.entangledLanes&=d,o.errorRecoveryDisabledLanes&=d,o.shellSuspendCounter=0;var P=o.entanglements,H=o.expirationTimes,ie=o.hiddenUpdates;for(d=C&~d;0<d;){var ce=31-qt(d),ye=1<<ce;P[ce]=0,H[ce]=-1;var te=ie[ce];if(te!==null)for(ie[ce]=null,ce=0;ce<te.length;ce++){var ue=te[ce];ue!==null&&(ue.lane&=-536870913)}d&=~ye}u!==0&&Go(o,u,0),x!==0&&y===0&&o.tag!==0&&(o.suspendedLanes|=x&~(C&~i))}function Go(o,i,d){o.pendingLanes|=i,o.suspendedLanes&=~i;var u=31-qt(i);o.entangledLanes|=i,o.entanglements[u]=o.entanglements[u]|1073741824|d&261930}function _i(o,i){var d=o.entangledLanes|=i;for(o=o.entanglements;d;){var u=31-qt(d),y=1<<u;y&i|o[u]&i&&(o[u]|=i),d&=~y}}function Pr(o,i){var d=i&-i;return d=d&42?1:Ma(d),(d&(o.suspendedLanes|i))===0?d:0}function Ma(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function D(o){return o&=-o,2<o?8<o?o&134217727?32:268435456:8:2}function G(){var o=de.p;return o===0?(o=window.event,o===void 0?32:dk(o.type)):o}function ve(o,i){var d=de.p;try{return de.p=o,i()}finally{de.p=d}}var be=Math.random().toString(36).slice(2),ke="__reactFiber$"+be,Ae="__reactProps$"+be,Xe="__reactContainer$"+be,Re="__reactEvents$"+be,Ue="__reactListeners$"+be,mt="__reactHandles$"+be,ze="__reactResources$"+be,Ht="__reactMarker$"+be,xt="__reactLoad$"+be;function xo(o){delete o[ke],delete o[Ae],delete o[Ue],delete o[mt]}function Qo(o){var i;if(i=o[ke])return i;for(var d=o.parentNode;d;){if(i=d[Xe]||d[ke]){if(d=i.alternate,i.child!==null||d!==null&&d.child!==null)for(o=Kw(o);o!==null;){if(d=o[ke])return d;o=Kw(o)}return i}o=d,d=o.parentNode}return null}function Dr(o){if(o=o[ke]||o[Xe]){var i=o.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return o}return null}function Lr(o){var i=o.tag;if(i===5||i===26||i===27||i===6)return o.stateNode;throw Error(a(33))}function Ir(o){var i=o[ze];return i||=o[ze]={hoistableStyles:new Map,hoistableScripts:new Map},i}function Ct(o){o[Ht]=!0}function cu(o){o[xt]=void 0}var fu=new Set,Oa={};function Jo(o,i){Rr(o,i),Rr(o+"Capture",i)}function Rr(o,i){for(Oa[o]=i,o=0;o<i.length;o++)fu.add(i[o])}var hu=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),fv={},hv={};function L_(o){return rn.call(hv,o)?!0:rn.call(fv,o)?!1:hu.test(o)?hv[o]=!0:(fv[o]=!0,!1)}var tt=!1;function pv(){var o=tt;return tt=!1,o}function pu(o,i,d){if(L_(i))if(d===null)o.removeAttribute(i);else{switch(typeof d){case"undefined":case"function":case"symbol":o.removeAttribute(i);return;case"boolean":var u=i.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){o.removeAttribute(i);return}}o.setAttribute(i,d)}}function mu(o,i,d){if(d===null)o.removeAttribute(i);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(i);return}o.setAttribute(i,d)}}function er(o,i,d,u){if(u===null)o.removeAttribute(d);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(d);return}o.setAttributeNS(i,d,u)}}function Nn(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function mv(o){var i=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function I_(o,i,d){var u=Object.getOwnPropertyDescriptor(o.constructor.prototype,i);if(!o.hasOwnProperty(i)&&u!==void 0&&typeof u.get=="function"&&typeof u.set=="function"){var y=u.get,x=u.set;return Object.defineProperty(o,i,{configurable:!0,get:function(){return y.call(this)},set:function(C){d=""+C,x.call(this,C)}}),Object.defineProperty(o,i,{enumerable:u.enumerable}),{getValue:function(){return d},setValue:function(C){d=""+C},stopTracking:function(){o._valueTracker=null,delete o[i]}}}}function Oh(o){if(!o._valueTracker){var i=mv(o)?"checked":"value";o._valueTracker=I_(o,i,""+o[i])}}function gv(o){if(!o)return!1;var i=o._valueTracker;if(!i)return!0;var d=i.getValue(),u="";return o&&(u=mv(o)?o.checked?"true":"false":o.value),o=u,o!==d&&(i.setValue(o),!0)}var R_=/[\n"\\]/g;function Jn(o){return o.replace(R_,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Ph(o,i,d,u,y,x,C,P){o.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?o.type=C:o.removeAttribute("type"),i==null?C!=="submit"&&C!=="reset"||o.removeAttribute("value"):C==="number"?(i===0&&o.value===""||o.value!=i)&&(o.value=""+Nn(i)):o.value!==""+Nn(i)&&(o.value=""+Nn(i)),i==null?d==null?u!=null&&o.removeAttribute("value"):Dh(o,Nn(d)):C==="number"&&o.value==i?Dh(o,Nn(o.value)):Dh(o,Nn(i)),y==null&&x!=null&&(o.defaultChecked=!!x),y!=null&&(o.checked=y&&typeof y!="function"&&typeof y!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?o.name=""+Nn(P):o.removeAttribute("name")}function yv(o,i,d,u,y,x,C,P){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(o.type=x),i!=null||d!=null){if(!(x!=="submit"&&x!=="reset"||i!=null)){Oh(o);return}d=d==null?"":""+Nn(d),i=i==null?d:""+Nn(i),P||i===o.value||(o.value=i),o.defaultValue=i}u??=y,u=typeof u!="function"&&typeof u!="symbol"&&!!u,o.checked=P?o.checked:!!u,o.defaultChecked=!!u,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(o.name=C),Oh(o)}function Dh(o,i){o.defaultValue!==""+i&&(o.defaultValue=""+i)}function Pa(o,i,d,u){if(o=o.options,i){i={};for(var y=0;y<d.length;y++)i["$"+d[y]]=!0;for(d=0;d<o.length;d++)y=i.hasOwnProperty("$"+o[d].value),o[d].selected!==y&&(o[d].selected=y),y&&u&&(o[d].defaultSelected=!0)}else{for(d=""+Nn(d),i=null,y=0;y<o.length;y++){if(o[y].value===d){o[y].selected=!0,u&&(o[y].defaultSelected=!0);return}i!==null||o[y].disabled||(i=o[y])}i!==null&&(i.selected=!0)}}function vv(o,i,d){i!=null&&(i=""+Nn(i),i!==o.value&&(o.value=i),d==null)?o.defaultValue!==i&&(o.defaultValue=i):o.defaultValue=d==null?"":""+Nn(d)}function bv(o,i,d,u){if(i==null){if(u!=null){if(d!=null)throw Error(a(92));if(q(u)){if(1<u.length)throw Error(a(93));u=u[0]}d=u}d??="",i=d}d=Nn(i),o.defaultValue=d,u=o.textContent,u===d&&u!==""&&u!==null&&(o.value=u),Oh(o)}function Da(o,i){if(i){var d=o.firstChild;if(d&&d===o.lastChild&&d.nodeType===3){d.nodeValue=i;return}}o.textContent=i}var z_=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function xv(o,i,d){var u=i.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?u?o.setProperty(i,""):i==="float"?o.cssFloat="":o[i]="":u?o.setProperty(i,d):typeof d!="number"||d===0||z_.has(i)?i==="float"?o.cssFloat=d:o[i]=(""+d).trim():o[i]=d+"px"}function wv(o,i,d){if(i!=null&&typeof i!="object")throw Error(a(62));if(o=o.style,d!=null){for(var u in d)!d.hasOwnProperty(u)||i!=null&&i.hasOwnProperty(u)||(u.indexOf("--")===0?o.setProperty(u,""):u==="float"?o.cssFloat="":o[u]="",tt=!0);for(var y in i)u=i[y],i.hasOwnProperty(y)&&d[y]!==u&&(xv(o,y,u),tt=!0)}else for(var x in i)i.hasOwnProperty(x)&&xv(o,x,i[x])}function Lh(o){if(o.indexOf("-")===-1)return!1;switch(o){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 F_=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),B_=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function gu(o){return B_.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function wo(){}var Ih=null;function Rh(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var La=null,Ia=null;function kv(o){var i=Dr(o);if(i&&(o=i.stateNode)){var d=o[Ae]||null;e:switch(o=i.stateNode,i.type){case"input":if(Ph(o,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),i=d.name,d.type==="radio"&&i!=null){for(d=o;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+Jn(""+i)+'"][type="radio"]'),i=0;i<d.length;i++){var u=d[i];if(u!==o&&u.form===o.form){var y=u[Ae]||null;if(!y)throw Error(a(90));Ph(u,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(i=0;i<d.length;i++)u=d[i],u.form===o.form&&gv(u)}break e;case"textarea":vv(o,d.value,d.defaultValue);break e;case"select":i=d.value,i!=null&&Pa(o,!!d.multiple,i,!1)}}}var zh=!1;function Sv(o,i,d){if(zh)return o(i,d);zh=!0;try{return o(i)}finally{if(zh=!1,(La!==null||Ia!==null)&&(gc(),La&&(i=La,o=Ia,Ia=La=null,kv(i),o)))for(i=0;i<o.length;i++)kv(o[i])}}function fl(o,i){var d=o.stateNode;if(d===null)return null;var u=d[Ae]||null;if(u===null)return null;d=u[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(o=o.type,u=o!=="button"&&o!=="input"&&o!=="select"&&o!=="textarea"),o=!u;break e;default:o=!1}if(o)return null;if(d&&typeof d!="function")throw Error(a(231,i,typeof d));return d}var tr=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Fh=!1;if(tr)try{var hl={};Object.defineProperty(hl,"passive",{get:function(){Fh=!0}}),window.addEventListener("test",hl,hl),window.removeEventListener("test",hl,hl)}catch{Fh=!1}var zr=null,Bh=null,yu=null;function Nv(){if(yu)return yu;var o,i=Bh,d=i.length,u,y="value"in zr?zr.value:zr.textContent,x=y.length;for(o=0;o<d&&i[o]===y[o];o++);var C=d-o;for(u=1;u<=C&&i[d-u]===y[x-u];u++);return yu=y.slice(o,1<u?1-u:void 0)}function vu(o){var i=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&i===13&&(o=13)):o=i,o===10&&(o=13),32<=o||o===13?o:0}function bu(){return!0}function jv(){return!1}function an(o){function i(d,u,y,x,C){for(var P in this._reactName=d,this._targetInst=y,this.type=u,this.nativeEvent=x,this.target=C,this.currentTarget=null,o)o.hasOwnProperty(P)&&(d=o[P],this[P]=d?d(x):x[P]);return this.isDefaultPrevented=(x.defaultPrevented==null?x.returnValue===!1:x.defaultPrevented)?bu:jv,this.isPropagationStopped=jv,this}return M(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=bu)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=bu)},persist:function(){},isPersistent:bu}),i}var Fr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xu=an(Fr),pl=M({},Fr,{view:0,detail:0}),q_=an(pl),qh,Hh,ml,wu=M({},pl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kh,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==ml&&(ml&&o.type==="mousemove"?(qh=o.screenX-ml.screenX,Hh=o.screenY-ml.screenY):Hh=qh=0,ml=o),qh)},movementY:function(o){return"movementY"in o?o.movementY:Hh}}),Cv=an(wu),H_=an(M({},wu,{dataTransfer:0})),Vh=an(M({},pl,{relatedTarget:0})),V_=an(M({},Fr,{animationName:0,elapsedTime:0,pseudoElement:0})),K_=an(M({},Fr,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}})),Ev=an(M({},Fr,{data:0})),W_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},U_={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"},Y_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function X_(o){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(o):(o=Y_[o])?!!i[o]:!1}function Kh(){return X_}var Z_=an(M({},pl,{key:function(o){if(o.key){var i=W_[o.key]||o.key;if(i!=="Unidentified")return i}return o.type==="keypress"?(o=vu(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?U_[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kh,charCode:function(o){return o.type==="keypress"?vu(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?vu(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}})),$v=an(M({},wu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),G_=an(M({},Fr,{submitter:0})),Q_=an(M({},pl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kh})),J_=an(M({},Fr,{propertyName:0,elapsedTime:0,pseudoElement:0})),e2=an(M({},wu,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0})),t2=an(M({},Fr,{newState:0,oldState:0,source:0})),n2=[9,13,27,32],Wh=tr&&"CompositionEvent"in window,gl=null;tr&&"documentMode"in document&&(gl=document.documentMode);var o2=tr&&"TextEvent"in window&&!gl,_v=tr&&(!Wh||gl&&8<gl&&11>=gl),Tv=" ",Av=!1;function Mv(o,i){switch(o){case"keyup":return n2.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ov(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Ra=!1;function r2(o,i){switch(o){case"compositionend":return Ov(i);case"keypress":return i.which===32?(Av=!0,Tv):null;case"textInput":return o=i.data,o===Tv&&Av?null:o;default:return null}}function i2(o,i){if(Ra)return o==="compositionend"||!Wh&&Mv(o,i)?(o=Nv(),yu=Bh=zr=null,Ra=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return _v&&i.locale!=="ko"?null:i.data;default:return null}}var a2={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 Pv(o){var i=o&&o.nodeName&&o.nodeName.toLowerCase();return i==="input"?!!a2[o.type]:i==="textarea"}function Dv(o,i,d,u){La?Ia?Ia.push(u):Ia=[u]:La=u,i=kc(i,"onChange"),0<i.length&&(d=new xu("onChange","change",null,d,u),o.push({event:d,listeners:i}))}var yl=null,vl=null;function s2(o){bw(o,0)}function ku(o){if(gv(Lr(o)))return o}function Lv(o,i){if(o==="change")return i}var Iv=!1;if(tr){var Uh;if(tr){var Yh="oninput"in document;if(!Yh){var Rv=document.createElement("div");Rv.setAttribute("oninput","return;"),Yh=typeof Rv.oninput=="function"}Uh=Yh}else Uh=!1;Iv=Uh&&(!document.documentMode||9<document.documentMode)}function zv(){yl&&(yl.detachEvent("onpropertychange",Fv),vl=yl=null)}function Fv(o){if(o.propertyName==="value"&&ku(vl)){var i=[];Dv(i,vl,o,Rh(o)),Sv(s2,i)}}function l2(o,i,d){o==="focusin"?(zv(),yl=i,vl=d,yl.attachEvent("onpropertychange",Fv)):o==="focusout"&&zv()}function d2(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return ku(vl)}function u2(o,i){if(o==="click")return ku(i)}function c2(o,i){if(o==="input"||o==="change")return ku(i)}function f2(o,i){return o===i&&(o!==0||1/o==1/i)||o!==o&&i!==i}var jn=typeof Object.is=="function"?Object.is:f2;function bl(o,i){if(jn(o,i))return!0;if(typeof o!="object"||!o||typeof i!="object"||!i)return!1;var d=Object.keys(o),u=Object.keys(i);if(d.length!==u.length)return!1;for(u=0;u<d.length;u++){var y=d[u];if(!rn.call(i,y)||!jn(o[y],i[y]))return!1}return!0}function Xh(o){if(o||=typeof document<"u"?document:void 0,o===void 0)return null;try{return o.activeElement||o.body}catch{return o.body}}function Bv(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function qv(o,i){var d=Bv(o);o=0;for(var u;d;){if(d.nodeType===3){if(u=o+d.textContent.length,o<=i&&u>=i)return{node:d,offset:i-o};o=u}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=Bv(d)}}function Hv(o,i){return o&&i?o===i?!0:o&&o.nodeType===3?!1:i&&i.nodeType===3?Hv(o,i.parentNode):"contains"in o?o.contains(i):o.compareDocumentPosition?!!(o.compareDocumentPosition(i)&16):!1:!1}function Vv(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var i=Xh(o.document);i instanceof o.HTMLIFrameElement;){try{var d=typeof i.contentWindow.location.href=="string"}catch{d=!1}if(d)o=i.contentWindow;else break;i=Xh(o.document)}return i}function Zh(o){var i=o&&o.nodeName&&o.nodeName.toLowerCase();return i&&(i==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||i==="textarea"||o.contentEditable==="true")}var h2=tr&&"documentMode"in document&&11>=document.documentMode,za=null,Gh=null,xl=null,Qh=!1;function Kv(o,i,d){var u=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Qh||za==null||za!==Xh(u)||(u=za,"selectionStart"in u&&Zh(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),xl&&bl(xl,u)||(xl=u,u=kc(Gh,"onSelect"),0<u.length&&(i=new xu("onSelect","select",null,i,d),o.push({event:i,listeners:u}),i.target=za)))}function Ti(o,i){var d={};return d[o.toLowerCase()]=i.toLowerCase(),d["Webkit"+o]="webkit"+i,d["Moz"+o]="moz"+i,d}var Fa={animationend:Ti("Animation","AnimationEnd"),animationiteration:Ti("Animation","AnimationIteration"),animationstart:Ti("Animation","AnimationStart"),transitionrun:Ti("Transition","TransitionRun"),transitionstart:Ti("Transition","TransitionStart"),transitioncancel:Ti("Transition","TransitionCancel"),transitionend:Ti("Transition","TransitionEnd")},Jh={},Wv={};tr&&(Wv=document.createElement("div").style,"AnimationEvent"in window||(delete Fa.animationend.animation,delete Fa.animationiteration.animation,delete Fa.animationstart.animation),"TransitionEvent"in window||delete Fa.transitionend.transition);function Ai(o){if(Jh[o])return Jh[o];if(!Fa[o])return o;var i=Fa[o],d;for(d in i)if(i.hasOwnProperty(d)&&d in Wv)return Jh[o]=i[d];return o}var Uv=Ai("animationend"),Yv=Ai("animationiteration"),Xv=Ai("animationstart"),p2=Ai("transitionrun"),m2=Ai("transitionstart"),g2=Ai("transitioncancel"),Zv=Ai("transitionend"),Gv=new Map,ep="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");ep.push("scrollEnd");function eo(o,i){Gv.set(o,i),Jo(i,[o])}var y2=0;function nr(o,i){if(o.name!=null&&o.name!=="auto")return o.name;if(i.autoName!==null)return i.autoName;o=ro.identifierPrefix;var d=y2++;return o="_"+o+"t_"+d.toString(32)+"_",i.autoName=o}function Qv(o){if(o==null||typeof o=="string")return o;var i=null,d=as;if(d!==null)for(var u=0;u<d.length;u++){var y=o[d[u]];if(y!=null){if(y==="none")return"none";i=i==null?y:i+(" "+y)}}return i??o.default}function or(o,i){return o=Qv(o),i=Qv(i),i==null?o==="auto"?null:o:i==="auto"?null:i}var Su=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},In=[],Ba=0,tp=0;function Nu(){for(var o=Ba,i=tp=Ba=0;i<o;){var d=In[i];In[i++]=null;var u=In[i];In[i++]=null;var y=In[i];In[i++]=null;var x=In[i];if(In[i++]=null,u!==null&&y!==null){var C=u.pending;C===null?y.next=y:(y.next=C.next,C.next=y),u.pending=y}x!==0&&Jv(d,y,x)}}function ju(o,i,d,u){In[Ba++]=o,In[Ba++]=i,In[Ba++]=d,In[Ba++]=u,tp|=u,o.lanes|=u,o=o.alternate,o!==null&&(o.lanes|=u)}function np(o,i,d,u){return ju(o,i,d,u),Cu(o)}function Mi(o,i){return ju(o,null,null,i),Cu(o)}function Jv(o,i,d){o.lanes|=d;var u=o.alternate;u!==null&&(u.lanes|=d);for(var y=!1,x=o.return;x!==null;)x.childLanes|=d,u=x.alternate,u!==null&&(u.childLanes|=d),x.tag===22&&(o=x.stateNode,o===null||o._visibility&1||(y=!0)),o=x,x=x.return;return o.tag===3?(x=o.stateNode,y&&i!==null&&(y=31-qt(d),o=x.hiddenUpdates,u=o[y],u===null?o[y]=[i]:u.push(i),i.lane=d|536870912),x):null}function Cu(o){if(50<ql)throw ql=0,mc=null,Error(a(185));for(var i=o.return;i!==null;)o=i,i=o.return;return o.tag===3?o.stateNode:null}var qa={};function v2(o,i,d,u){this.tag=o,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gn(o,i,d,u){return new v2(o,i,d,u)}function op(o){return o=o.prototype,!(!o||!o.isReactComponent)}function rr(o,i){var d=o.alternate;return d===null?(d=gn(o.tag,i,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=i,d.type=o.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=o.flags&1206910976,d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,i=o.dependencies,d.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d.refCleanup=o.refCleanup,d}function eb(o,i){o.flags&=1206910978;var d=o.alternate;return d===null?(o.childLanes=0,o.lanes=i,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=d.childLanes,o.lanes=d.lanes,o.child=d.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=d.memoizedProps,o.memoizedState=d.memoizedState,o.updateQueue=d.updateQueue,o.type=d.type,i=d.dependencies,o.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),o}function Eu(o,i,d,u,y,x){var C=0;if(u=o,typeof u=="function")op(u)&&(C=1);else if(typeof u=="string")C=UT(o,d,ut.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(u){case xe:return o=gn(31,d,i,y),o.elementType=xe,o.lanes=x,o;case V:return Oi(d.children,y,x,i);case oe:C=8,y|=24;break;case F:return o=gn(12,d,i,y|2),o.elementType=F,o.lanes=x,o;case W:return o=gn(13,d,i,y),o.elementType=W,o.lanes=x,o;case re:return o=gn(19,d,i,y),o.elementType=re,o.lanes=x,o;case Ne:case R:return o=y|32,o=gn(30,d,i,o),o.elementType=R,o.lanes=x,o.stateNode={autoName:null,paired:null,clones:null,ref:null},o;default:if(typeof u=="object"&&u)switch(u.$$typeof){case I:C=10;break e;case J:C=9;break e;case U:C=11;break e;case le:C=14;break e;case pe:C=16,u=null;break e}C=29,d=Error(a(130,o===null?"null":typeof o,"")),u=null}return i=gn(C,d,i,y),i.elementType=o,i.type=u,i.lanes=x,i}function Oi(o,i,d,u){return o=gn(7,o,u,i),o.lanes=d,o}function rp(o,i,d){return o=gn(6,o,null,i),o.lanes=d,o}function tb(o){var i=gn(18,null,null,0);return i.stateNode=o,i}function ip(o,i,d){return i=gn(4,o.children===null?[]:o.children,o.key,i),i.lanes=d,i.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},i}var nb=new WeakMap;function Rn(o,i){if(typeof o=="object"&&o){var d=nb.get(o);return d===void 0?(i={value:o,source:i,stack:Er(i)},nb.set(o,i),i):d}return{value:o,source:i,stack:Er(i)}}var Ha=[],Va=0,$u=null,wl=0,zn=[],Fn=0,Br=null,ko=1,So="";function ir(o,i){Ha[Va++]=wl,Ha[Va++]=$u,$u=o,wl=i}function ob(o,i,d){zn[Fn++]=ko,zn[Fn++]=So,zn[Fn++]=Br,Br=o;var u=ko;o=So;var y=32-qt(u)-1;u&=~(1<<y),d+=1;var x=32-qt(i)+y;if(30<x){var C=y-y%5;x=(u&(1<<C)-1).toString(32),u>>=C,y-=C,ko=1<<32-qt(i)+y|d<<y|u,So=x+o}else ko=1<<x|d<<y|u,So=o}function _u(o){o.return!==null&&(ir(o,1),ob(o,1,0))}function ap(o){for(;o===$u;)$u=Ha[--Va],Ha[Va]=null,wl=Ha[--Va],Ha[Va]=null;for(;o===Br;)Br=zn[--Fn],zn[Fn]=null,So=zn[--Fn],zn[Fn]=null,ko=zn[--Fn],zn[Fn]=null}function rb(o,i){zn[Fn++]=ko,zn[Fn++]=So,zn[Fn++]=Br,ko=i.id,So=i.overflow,Br=o}var Vt=null,ft=null,We=!1,qr=null,Bn=!1,sp=Error(a(519));function Hr(o){throw kl(Rn(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML","")),o)),sp}function ib(o){var i=o.stateNode,d=o.type,u=o.memoizedProps;switch(i[ke]=o,i[Ae]=u,d){case"dialog":Ge("cancel",i),Ge("close",i);break;case"iframe":case"object":case"embed":Ge("load",i);break;case"video":case"audio":for(d=0;d<Vl.length;d++)Ge(Vl[d],i);break;case"source":Ge("error",i);break;case"img":case"image":case"link":Ge("error",i),Ge("load",i);break;case"details":Ge("toggle",i);break;case"input":Ge("invalid",i),yv(i,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Ge("invalid",i);break;case"textarea":Ge("invalid",i),bv(i,u.value,u.defaultValue,u.children)}d=u.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||i.textContent===""+d||u.suppressHydrationWarning===!0||Nw(i.textContent,d)?(u.popover!=null&&(Ge("beforetoggle",i),Ge("toggle",i)),u.onScroll!=null&&Ge("scroll",i),u.onScrollEnd!=null&&Ge("scrollend",i),u.onClick!=null&&(i.onclick=wo),i=!0):i=!1,i||Hr(o,!0)}function Tu(o){for(Vt=o.return;Vt;)switch(Vt.tag){case 5:case 31:case 13:Bn=!1;return;case 27:case 3:Bn=!0;return;default:Vt=Vt.return}}function Ka(o){if(o!==Vt)return!1;if(!We)return Tu(o),We=!0,!1;var i=o.tag,d;if((d=i!==3&&i!==27)&&((d=i===5)&&(d=o.type,d=d==="form"||d==="button"||Lm(o.type,o.memoizedProps)),d=!d),d&&ft&&Hr(o),Tu(o),i===13){if(o=o.memoizedState,o=o===null?null:o.dehydrated,!o)throw Error(a(317));ft=Vw(o)}else if(i===31){if(o=o.memoizedState,o=o===null?null:o.dehydrated,!o)throw Error(a(317));ft=Vw(o)}else i===27?(i=ft,oi(o.type)?(o=Km,Km=null,ft=o):ft=i):ft=Vt?Vn(o.stateNode.nextSibling):null;return!0}function Pi(){ft=Vt=null,We=!1}function lp(){var o=qr;return o!==null&&(bn===null?bn=o:bn.push.apply(bn,o),qr=null),o}function kl(o){qr===null?qr=[o]:qr.push(o)}var dp=Ye(null),Di=null,ar=null;function Vr(o,i,d){Be(dp,i._currentValue),i._currentValue=d}function sr(o){o._currentValue=dp.current,Ie(dp)}function Au(o,i,d){for(;o!==null;){var u=o.alternate;if((o.childLanes&i)===i?u!==null&&(u.childLanes&i)!==i&&(u.childLanes|=i):(o.childLanes|=i,u!==null&&(u.childLanes|=i)),o===d)break;o=o.return}}function up(o,i,d,u){var y=o.child;for(y!==null&&(y.return=o);y!==null;){var x=y.dependencies;if(x!==null){var C=y.child;x=x.firstContext;e:for(;x!==null;){var P=x;x=y;for(var H=0;H<i.length;H++)if(P.context===i[H]){x.lanes|=d,P=x.alternate,P!==null&&(P.lanes|=d),Au(x.return,d,o),u||(C=null);break e}x=P.next}}else if(y.tag===18){if(C=y.return,C===null)throw Error(a(341));C.lanes|=d,x=C.alternate,x!==null&&(x.lanes|=d),Au(C,d,o),C=null}else y.tag===13&&y.memoizedState!==null&&y.memoizedState.dehydrated===null?(y.lanes|=d,C=y.alternate,C!==null&&(C.lanes|=d),Au(y.return,d,o),C=y.child,C=C===null?null:C.sibling):C=y.child;if(C!==null)C.return=y;else for(C=y;C!==null;){if(C===o){C=null;break}if(y=C.sibling,y!==null){y.return=C.return,C=y;break}C=C.return}y=C}}function Li(o,i,d,u){o=null;for(var y=i,x=!1;y!==null;){if(!x){if(y.flags&524288)x=!0;else if(y.flags&262144)break}if(y.tag===10){var C=y.alternate;if(C===null)throw Error(a(387));if(C=C.memoizedProps,C!==null){var P=y.type;jn(y.pendingProps.value,C.value)||(o===null?o=[P]:o.push(P))}}else if(y===zt.current){if(C=y.alternate,C===null)throw Error(a(387));C.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(o===null?o=[gs]:o.push(gs))}y=y.return}return o!==null&&up(i,o,d,u),i.flags|=262144,o!==null}function Mu(o){for(o=o.firstContext;o!==null;){if(!jn(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Ii(o){Di=o,ar=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Gt(o){return ab(Di,o)}function Ou(o,i){return Di===null&&Ii(o),ab(o,i)}function ab(o,i){var d=i._currentValue;if(i={context:i,memoizedValue:d,next:null},ar===null){if(o===null)throw Error(a(308));ar=i,o.dependencies={lanes:0,firstContext:i},o.flags|=524288}else ar=ar.next=i;return d}var b2=typeof AbortController<"u"?AbortController:function(){var o=[],i=this.signal={aborted:!1,addEventListener:function(d,u){o.push(u)}};this.abort=function(){i.aborted=!0,o.forEach(function(d){return d()})}},x2=t.unstable_scheduleCallback,w2=t.unstable_NormalPriority,At={$$typeof:I,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function cp(){return{controller:new b2,data:new Map,refCount:0}}function Sl(o){o.refCount--,o.refCount===0&&x2(w2,function(){o.controller.abort()})}function sb(o,i){if(o.pendingLanes&4194048){var d=o.transitionTypes;for(d===null&&(d=o.transitionTypes=[]),o=0;o<i.length;o++){var u=i[o];d.indexOf(u)===-1&&d.push(u)}}}var Nl=null;function k2(o){var i=o.transitionTypes;return o.transitionTypes=null,i}var jl=null,fp=0,Ri=0,Wa=null;function S2(o,i){if(jl===null){var d=jl=[];fp=0,Ri=$m(),Wa={status:"pending",value:void 0,then:function(u){d.push(u)}}}return fp++,i.then(lb,lb),i}function lb(){if(--fp===0&&(Nl=null,jl!==null)){Wa!==null&&(Wa.status="fulfilled");var o=jl;jl=null,Ri=0,Wa=null;for(var i=0;i<o.length;i++)(0,o[i])()}}function N2(o,i){var d=[],u={status:"pending",value:null,reason:null,then:function(y){d.push(y)}};return o.then(function(){u.status="fulfilled",u.value=i;for(var y=0;y<d.length;y++)(0,d[y])(i)},function(y){for(u.status="rejected",u.reason=y,y=0;y<d.length;y++)(0,d[y])(void 0)}),u}var db=ee.S;ee.S=function(o,i){if(Qx=Xt(),typeof i=="object"&&i&&typeof i.then=="function"&&S2(o,i),Nl!==null)for(var d=us;d!==null;)sb(d,Nl),d=d.next;if(d=o.types,d!==null){for(var u=us;u!==null;)sb(u,d),u=u.next;if(Ri!==0){u=Nl,u===null&&(u=Nl=[]);for(var y=0;y<d.length;y++){var x=d[y];u.indexOf(x)===-1&&u.push(x)}}}db!==null&&db(o,i)};var zi=Ye(null);function hp(){var o=zi.current;return o===null?ct.pooledCache:o}function Pu(o,i){i===null?Be(zi,zi.current):Be(zi,i.pool)}function ub(){var o=hp();return o===null?null:{parent:At._currentValue,pool:o}}var Ua=Error(a(460)),pp=Error(a(474)),Du=Error(a(542)),Lu={then:function(){}};function cb(o){return o=o.status,o==="fulfilled"||o==="rejected"}function fb(o,i,d){switch(d=o[d],d===void 0?o.push(i):d!==i&&(i.then(wo,wo),i=d),i.status){case"fulfilled":return i.value;case"rejected":throw o=i.reason,pb(o),o===void 0&&!("reason"in i)?Error(a(600)):o;default:if(typeof i.status=="string")i.then(wo,wo);else{if(o=ct,o!==null&&100<o.shellSuspendCounter)throw Error(a(482));o=i,o.status="pending",o.then(function(u){if(i.status==="pending"){var y=i;y.status="fulfilled",y.value=u}},function(u){if(i.status==="pending"){var y=i;y.status="rejected",y.reason=u}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw o=i.reason,pb(o),o}throw Bi=i,Ua}}function Fi(o){try{var i=o._init;return i(o._payload)}catch(d){throw typeof d=="object"&&d&&typeof d.then=="function"?(Bi=d,Ua):d}}var Bi=null;function hb(){if(Bi===null)throw Error(a(459));var o=Bi;return Bi=null,o}function pb(o){if(o===Ua||o===Du)throw Error(a(483))}var Ya=null,Cl=0;function Iu(o){var i=Cl;return Cl+=1,Ya===null&&(Ya=[]),fb(Ya,o,i)}function Kr(o,i){i=i.props.ref,o.ref=i===void 0?null:i}function Ru(o,i){throw i.$$typeof===O?Error(a(525)):(o=Object.prototype.toString.call(i),Error(a(31,o==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":o)))}function mb(o){function i(ne,Y){if(o){var se=ne.deletions;se===null?(ne.deletions=[Y],ne.flags|=16):se.push(Y)}}function d(ne,Y){if(!o)return null;for(;Y!==null;)i(ne,Y),Y=Y.sibling;return null}function u(ne){for(var Y=new Map;ne!==null;)ne.key===null?Y.set(ne.index,ne):Y.set(ne.key,ne),ne=ne.sibling;return Y}function y(ne,Y){return ne=rr(ne,Y),ne.index=0,ne.sibling=null,ne}function x(ne,Y,se){return ne.index=se,o?(se=ne.alternate,se===null?(ne.flags|=134217730,Y):(se=se.index,se<Y?(ne.flags|=2,Y):se)):(ne.flags|=1048576,Y)}function C(ne){return o&&ne.alternate===null&&(ne.flags|=134217730),ne}function P(ne,Y,se,ge){return Y===null||Y.tag!==6?(Y=rp(se,ne.mode,ge),Y.return=ne,Y):(Y=y(Y,se),Y.return=ne,Y)}function H(ne,Y,se,ge){var _e=se.type;return _e===V?(ne=ce(ne,Y,se.props.children,ge,se.key),Kr(ne,se),ne):Y!==null&&(Y.elementType===_e||typeof _e=="object"&&_e&&_e.$$typeof===pe&&Fi(_e)===Y.type)?(Y=y(Y,se.props),Kr(Y,se),Y.return=ne,Y):(Y=Eu(se.type,se.key,se.props,null,ne.mode,ge),Kr(Y,se),Y.return=ne,Y)}function ie(ne,Y,se,ge){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==se.containerInfo||Y.stateNode.implementation!==se.implementation?(Y=ip(se,ne.mode,ge),Y.return=ne,Y):(Y=y(Y,se.children||[]),Y.return=ne,Y)}function ce(ne,Y,se,ge,_e){return Y===null||Y.tag!==7?(Y=Oi(se,ne.mode,ge,_e),Y.return=ne,Y):(Y=y(Y,se),Y.return=ne,Y)}function ye(ne,Y,se){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=rp(""+Y,ne.mode,se),Y.return=ne,Y;if(typeof Y=="object"&&Y){switch(Y.$$typeof){case K:return se=Eu(Y.type,Y.key,Y.props,null,ne.mode,se),Kr(se,Y),se.return=ne,se;case B:return Y=ip(Y,ne.mode,se),Y.return=ne,Y;case pe:return Y=Fi(Y),ye(ne,Y,se)}if(q(Y)||X(Y))return Y=Oi(Y,ne.mode,se,null),Y.return=ne,Y;if(typeof Y.then=="function")return ye(ne,Iu(Y),se);if(Y.$$typeof===I)return ye(ne,Ou(ne,Y),se);Ru(ne,Y)}return null}function te(ne,Y,se,ge){var _e=Y===null?null:Y.key;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return _e===null?P(ne,Y,""+se,ge):null;if(typeof se=="object"&&se){switch(se.$$typeof){case K:return se.key===_e?H(ne,Y,se,ge):null;case B:return se.key===_e?ie(ne,Y,se,ge):null;case pe:return se=Fi(se),te(ne,Y,se,ge)}if(q(se)||X(se))return _e===null?ce(ne,Y,se,ge,null):null;if(typeof se.then=="function")return te(ne,Y,Iu(se),ge);if(se.$$typeof===I)return te(ne,Y,Ou(ne,se),ge);Ru(ne,se)}return null}function ue(ne,Y,se,ge,_e){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return ne=ne.get(se)||null,P(Y,ne,""+ge,_e);if(typeof ge=="object"&&ge){switch(ge.$$typeof){case K:return ne=ne.get(ge.key===null?se:ge.key)||null,H(Y,ne,ge,_e);case B:return ne=ne.get(ge.key===null?se:ge.key)||null,ie(Y,ne,ge,_e);case pe:return ge=Fi(ge),ue(ne,Y,se,ge,_e)}if(q(ge)||X(ge))return ne=ne.get(se)||null,ce(Y,ne,ge,_e,null);if(typeof ge.then=="function")return ue(ne,Y,se,Iu(ge),_e);if(ge.$$typeof===I)return ue(ne,Y,se,Ou(Y,ge),_e);Ru(Y,ge)}return null}function Se(ne,Y,se,ge){for(var _e=null,Je=null,Oe=Y,Le=Y=0,Pt=null;Oe!==null&&Le<se.length;Le++){Oe.index>Le?(Pt=Oe,Oe=null):Pt=Oe.sibling;var et=te(ne,Oe,se[Le],ge);if(et===null){Oe===null&&(Oe=Pt);break}o&&Oe&&et.alternate===null&&i(ne,Oe),Y=x(et,Y,Le),Je===null?_e=et:Je.sibling=et,Je=et,Oe=Pt}if(Le===se.length)return d(ne,Oe),We&&ir(ne,Le),_e;if(Oe===null){for(;Le<se.length;Le++)Oe=ye(ne,se[Le],ge),Oe!==null&&(Y=x(Oe,Y,Le),Je===null?_e=Oe:Je.sibling=Oe,Je=Oe);return We&&ir(ne,Le),_e}for(Oe=u(Oe);Le<se.length;Le++)Pt=ue(Oe,ne,Le,se[Le],ge),Pt!==null&&(o&&(et=Pt.alternate,et!==null&&Oe.delete(et.key===null?Le:et.key)),Y=x(Pt,Y,Le),Je===null?_e=Pt:Je.sibling=Pt,Je=Pt);return o&&Oe.forEach(function(li){return i(ne,li)}),We&&ir(ne,Le),_e}function Me(ne,Y,se,ge){if(se==null)throw Error(a(151));for(var _e=null,Je=null,Oe=Y,Le=Y=0,Pt=null,et=se.next();Oe!==null&&!et.done;Le++,et=se.next()){Oe.index>Le?(Pt=Oe,Oe=null):Pt=Oe.sibling;var li=te(ne,Oe,et.value,ge);if(li===null){Oe===null&&(Oe=Pt);break}o&&Oe&&li.alternate===null&&i(ne,Oe),Y=x(li,Y,Le),Je===null?_e=li:Je.sibling=li,Je=li,Oe=Pt}if(et.done)return d(ne,Oe),We&&ir(ne,Le),_e;if(Oe===null){for(;!et.done;Le++,et=se.next())et=ye(ne,et.value,ge),et!==null&&(Y=x(et,Y,Le),Je===null?_e=et:Je.sibling=et,Je=et);return We&&ir(ne,Le),_e}for(Oe=u(Oe);!et.done;Le++,et=se.next())et=ue(Oe,ne,Le,et.value,ge),et!==null&&(o&&(Pt=et.alternate,Pt!==null&&Oe.delete(Pt.key===null?Le:Pt.key)),Y=x(et,Y,Le),Je===null?_e=et:Je.sibling=et,Je=et);return o&&Oe.forEach(function(lA){return i(ne,lA)}),We&&ir(ne,Le),_e}function Ve(ne,Y,se,ge){if(typeof se=="object"&&se&&se.type===V&&se.key===null&&se.props.ref===void 0&&(se=se.props.children),typeof se=="object"&&se){switch(se.$$typeof){case K:e:{for(var _e=se.key;Y!==null;){if(Y.key===_e){if(_e=se.type,_e===V){if(Y.tag===7){d(ne,Y.sibling),ge=y(Y,se.props.children),Kr(ge,se),ge.return=ne,ne=ge;break e}}else if(Y.elementType===_e||typeof _e=="object"&&_e&&_e.$$typeof===pe&&Fi(_e)===Y.type){d(ne,Y.sibling),ge=y(Y,se.props),Kr(ge,se),ge.return=ne,ne=ge;break e}d(ne,Y);break}i(ne,Y),Y=Y.sibling}se.type===V?(ge=Oi(se.props.children,ne.mode,ge,se.key),Kr(ge,se),ge.return=ne,ne=ge):(ge=Eu(se.type,se.key,se.props,null,ne.mode,ge),Kr(ge,se),ge.return=ne,ne=ge)}return C(ne);case B:e:{for(_e=se.key;Y!==null;){if(Y.key===_e){if(Y.tag===4&&Y.stateNode.containerInfo===se.containerInfo&&Y.stateNode.implementation===se.implementation){d(ne,Y.sibling),ge=y(Y,se.children||[]),ge.return=ne,ne=ge;break e}d(ne,Y);break}i(ne,Y),Y=Y.sibling}ge=ip(se,ne.mode,ge),ge.return=ne,ne=ge}return C(ne);case pe:return se=Fi(se),Ve(ne,Y,se,ge)}if(q(se))return Se(ne,Y,se,ge);if(X(se)){if(_e=X(se),typeof _e!="function")throw Error(a(150));return se=_e.call(se),Me(ne,Y,se,ge)}if(typeof se.then=="function")return Ve(ne,Y,Iu(se),ge);if(se.$$typeof===I)return Ve(ne,Y,Ou(ne,se),ge);Ru(ne,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,Y!==null&&Y.tag===6?(d(ne,Y.sibling),ge=y(Y,se),ge.return=ne,ne=ge):(d(ne,Y),ge=rp(se,ne.mode,ge),ge.return=ne,ne=ge),C(ne)):d(ne,Y)}return function(ne,Y,se,ge){try{Cl=0;var _e=Ve(ne,Y,se,ge);return Ya=null,_e}catch(Oe){if(Oe===Ua||Oe===Du)throw Oe;var Je=gn(29,Oe,null,ne.mode);return Je.lanes=ge,Je.return=ne,Je}}}var qi=mb(!0),gb=mb(!1),Wr=!1;function mp(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gp(o,i){o=o.updateQueue,i.updateQueue===o&&(i.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function Hi(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function Vi(o,i,d){var u=o.updateQueue;if(u===null)return null;if(u=u.shared,nt&2){var y=u.pending;return y===null?i.next=i:(i.next=y.next,y.next=i),u.pending=i,i=Cu(o),Jv(o,null,d),i}return ju(o,u,i,d),Cu(o)}function El(o,i,d){if(i=i.updateQueue,i!==null&&(i=i.shared,d&4194048)){var u=i.lanes;u&=o.pendingLanes,d|=u,i.lanes=d,_i(o,d)}}function yp(o,i){var d=o.updateQueue,u=o.alternate;if(u!==null&&(u=u.updateQueue,d===u)){var y=null,x=null;if(d=d.firstBaseUpdate,d!==null){do{var C={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};x===null?y=x=C:x=x.next=C,d=d.next}while(d!==null);x===null?y=x=i:x=x.next=i}else y=x=i;d={baseState:u.baseState,firstBaseUpdate:y,lastBaseUpdate:x,shared:u.shared,callbacks:u.callbacks},o.updateQueue=d}else o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=i:o.next=i,d.lastBaseUpdate=i}var vp=!1;function $l(){if(vp){var o=Wa;if(o!==null)throw o}}function _l(o,i,d,u){vp=!1;var y=o.updateQueue;Wr=!1;var x=y.firstBaseUpdate,C=y.lastBaseUpdate,P=y.shared.pending;if(P!==null){y.shared.pending=null;var H=P,ie=H.next;H.next=null,C===null?x=ie:C.next=ie,C=H;var ce=o.alternate;ce!==null&&(ce=ce.updateQueue,P=ce.lastBaseUpdate,P!==C&&(P===null?ce.firstBaseUpdate=ie:P.next=ie,ce.lastBaseUpdate=H))}if(x!==null){var ye=y.baseState;C=0,ce=ie=H=null,P=x;do{var te=P.lane&-536870913,ue=te!==P.lane;if(ue?(Qe&te)===te:(u&te)===te){te!==0&&te===Ri&&(vp=!0),ce!==null&&(ce=ce.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Se=o,Me=P;te=i;var Ve=d;switch(Me.tag){case 1:if(Se=Me.payload,typeof Se=="function"){ye=Se.call(Ve,ye,te);break e}ye=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Me.payload,te=typeof Se=="function"?Se.call(Ve,ye,te):Se,te==null)break e;ye=M({},ye,te);break e;case 2:Wr=!0}}te=P.callback,te!==null&&(o.flags|=64,ue&&(o.flags|=8192),ue=y.callbacks,ue===null?y.callbacks=[te]:ue.push(te))}else ue={lane:te,tag:P.tag,payload:P.payload,callback:P.callback,next:null},ce===null?(ie=ce=ue,H=ye):ce=ce.next=ue,C|=te;if(P=P.next,P===null){if(P=y.shared.pending,P===null)break;ue=P,P=ue.next,ue.next=null,y.lastBaseUpdate=ue,y.shared.pending=null}}while(!0);ce===null&&(H=ye),y.baseState=H,y.firstBaseUpdate=ie,y.lastBaseUpdate=ce,x===null&&(y.shared.lanes=0),Jr|=C,o.lanes=C,o.memoizedState=ye}}function yb(o,i){if(typeof o!="function")throw Error(a(191,o));o.call(i)}function vb(o,i){var d=o.callbacks;if(d!==null)for(o.callbacks=null,o=0;o<d.length;o++)yb(d[o],i)}var Ur=Ye(null),zu=Ye(0);function bb(o,i){o=fr,Be(zu,o),Be(Ur,i),fr=o|i.baseLanes}function bp(){Be(zu,fr),Be(Ur,Ur.current)}function xp(){fr=zu.current,Ie(Ur),Ie(zu)}var Qt=Ye(null),sn=null;function Yr(o){var i=o.alternate;Be(Jt,Jt.current&1),Be(Qt,o),sn===null&&(i===null||Ur.current!==null||i.memoizedState!==null)&&(sn=o)}function wp(o){Be(Jt,Jt.current),Be(Qt,o),sn===null&&(sn=o)}function xb(o){o.tag===22?(Be(Jt,Jt.current),Be(Qt,o),sn===null&&(sn=o)):Xr()}function Xr(){Be(Jt,Jt.current),Be(Qt,Qt.current)}function Cn(o){Ie(Qt),sn===o&&(sn=null),Ie(Jt)}var Jt=Ye(0);function Tl(o,i){Be(Qt,Qt.current),Be(Jt,i)}function kp(o){Ie(Jt),Ie(Qt),sn===o&&(sn=null)}function Fu(o){for(var i=o;i!==null;){if(i.tag===13){var d=i.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||Hm(d)||Vm(d)))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!=="independent"){if(i.flags&128)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break;for(;i.sibling===null;){if(i.return===null||i.return===o)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var lr=0,He=null,lt=null,Mt=null,Bu=!1,Xa=!1,Ki=!1,qu=0,Al=0,Za=null,j2=0;function St(){throw Error(a(321))}function Sp(o,i){if(i===null)return!1;for(var d=0;d<i.length&&d<o.length;d++)if(!jn(o[d],i[d]))return!1;return!0}function Np(o,i,d,u,y,x){return lr=x,He=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,ee.H=o===null||o.memoizedState===null?ox:rx,Ki=!1,x=d(u,y),Ki=!1,Xa&&(x=kb(i,d,u,y)),wb(o),x}function wb(o){ee.H=Xu;var i=lt!==null&<.next!==null;if(lr=0,Mt=lt=He=null,Bu=!1,Al=0,Za=null,i)throw Error(a(300));o===null||Ot||(o=o.dependencies,o!==null&&Mu(o)&&(Ot=!0))}function kb(o,i,d,u){He=o;var y=0;do{if(Xa&&(Za=null),Al=0,Xa=!1,25<=y)throw Error(a(301));if(y+=1,Mt=lt=null,o.updateQueue!=null){var x=o.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}ee.H=O2,x=i(d,u)}while(Xa);return x}function C2(){var o=ee.H,i=o.useState()[0];return i=typeof i.then=="function"?Ml(i):i,o=o.useState()[0],(lt===null?null:lt.memoizedState)!==o&&(He.flags|=1024),i}function jp(){var o=qu!==0;return qu=0,o}function Cp(o,i,d){i.updateQueue=o.updateQueue,i.flags&=-2053,o.lanes&=~d}function Ep(o){if(Bu){for(o=o.memoizedState;o!==null;){var i=o.queue;i!==null&&(i.pending=null),o=o.next}Bu=!1}lr=0,Mt=lt=He=null,Xa=!1,Al=qu=0,Za=null}function ln(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?He.memoizedState=Mt=o:Mt=Mt.next=o,Mt}function Et(){if(lt===null){var o=He.alternate;o=o===null?null:o.memoizedState}else o=lt.next;var i=Mt===null?He.memoizedState:Mt.next;if(i!==null)Mt=i,lt=o;else{if(o===null)throw He.alternate===null?Error(a(467)):Error(a(310));lt=o,o={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},Mt===null?He.memoizedState=Mt=o:Mt=Mt.next=o}return Mt}function Hu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ml(o){var i=Al;return Al+=1,Za===null&&(Za=[]),o=fb(Za,o,i),i=He,(Mt===null?i.memoizedState:Mt.next)===null&&(i=i.alternate,ee.H=i===null||i.memoizedState===null?ox:rx),o}function Vu(o){if(typeof o=="object"&&o){if(typeof o.then=="function")return Ml(o);if(o.$$typeof===Q)return;if(o.$$typeof===I)return Gt(o)}throw Error(a(438,String(o)))}function $p(o){var i=null,d=He.updateQueue;if(d!==null&&(i=d.memoCache),i==null){var u=He.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(i={data:u.data.map(function(y){return y.slice()}),index:0})))}if(i??={data:[],index:0},d===null&&(d=Hu(),He.updateQueue=d),d.memoCache=i,d=i.data[i.index],d===void 0)for(d=i.data[i.index]=Array(o),u=0;u<o;u++)d[u]=we;return i.index++,d}function dr(o,i){return typeof i=="function"?i(o):i}function Ku(o){return _p(Et(),lt,o)}function _p(o,i,d){var u=o.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=d;var y=o.baseQueue,x=u.pending;if(x!==null){if(y!==null){var C=y.next;y.next=x.next,x.next=C}i.baseQueue=y=x,u.pending=null}if(x=o.baseState,y===null)o.memoizedState=x;else{i=y.next;var P=C=null,H=null,ie=i,ce=!1;do{var ye=ie.lane&-536870913;if(ye===ie.lane?(lr&ye)===ye:(Qe&ye)===ye){var te=ie.revertLane;if(te===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),ye===Ri&&(ce=!0);else if((lr&te)===te){ie=ie.next,te===Ri&&(ce=!0);continue}else ye={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},H===null?(P=H=ye,C=x):H=H.next=ye,He.lanes|=te,Jr|=te;ye=ie.action,Ki&&d(x,ye),x=ie.hasEagerState?ie.eagerState:d(x,ye)}else te={lane:ye,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},H===null?(P=H=te,C=x):H=H.next=te,He.lanes|=ye,Jr|=ye;ie=ie.next}while(ie!==null&&ie!==i);if(H===null?C=x:H.next=P,!jn(x,o.memoizedState)&&(Ot=!0,ce&&(d=Wa,d!==null)))throw d;o.memoizedState=x,o.baseState=C,o.baseQueue=H,u.lastRenderedState=x}return y===null&&(u.lanes=0),[o.memoizedState,u.dispatch]}function Tp(o){var i=Et(),d=i.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=o;var u=d.dispatch,y=d.pending,x=i.memoizedState;if(y!==null){d.pending=null;var C=y=y.next;do x=o(x,C.action),C=C.next;while(C!==y);jn(x,i.memoizedState)||(Ot=!0),i.memoizedState=x,i.baseQueue===null&&(i.baseState=x),d.lastRenderedState=x}return[x,u]}function Sb(o,i,d){var u=He,y=Et(),x=We;if(x){if(d===void 0)throw Error(a(407));d=d()}else d=i();var C=!jn((lt||y).memoizedState,d);if(C&&(y.memoizedState=d,Ot=!0),y=y.queue,Op(Cb.bind(null,u,y,o),[o]),o=y.getSnapshot!==i||C||Mt!==null&&!!(Mt.memoizedState.tag&1),Ga(o?9:8,{destroy:void 0},jb.bind(null,u,y,d,i),null),o){if(u.flags|=2048,ct===null)throw Error(a(349));x||lr&127||Nb(u,i,d)}return d}function Nb(o,i,d){o.flags|=16384,o={getSnapshot:i,value:d},i=He.updateQueue,i===null?(i=Hu(),He.updateQueue=i,i.stores=[o]):(d=i.stores,d===null?i.stores=[o]:d.push(o))}function jb(o,i,d,u){i.value=d,i.getSnapshot=u,Eb(i)&&$b(o)}function Cb(o,i,d){return d(function(){Eb(i)&&$b(o)})}function Eb(o){var i=o.getSnapshot;o=o.value;try{var d=i();return!jn(o,d)}catch{return!0}}function $b(o){var i=Mi(o,2);i!==null&&xn(i,o,2)}function Ap(o){var i=ln();if(typeof o=="function"){var d=o;if(o=d(),Ki){Ln(!0);try{d()}finally{Ln(!1)}}}return i.memoizedState=i.baseState=o,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dr,lastRenderedState:o},i}function _b(o,i,d,u){return o.baseState=d,_p(o,lt,typeof u=="function"?u:dr)}function E2(o,i,d,u,y){if(Yu(o))throw Error(a(485));if(o=i.action,o!==null){var x={payload:y,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){x.listeners.push(C)}};ee.T===null?x.isTransition=!1:d(!0),u(x),d=i.pending,d===null?(x.next=i.pending=x,Tb(i,x)):(x.next=d.next,i.pending=d.next=x)}}function Tb(o,i){var d=i.action,u=i.payload,y=o.state;if(i.isTransition){var x=ee.T,C={};C.types=x===null?null:x.types,ee.T=C;try{var P=d(y,u),H=ee.S;H!==null&&H(C,P),Ab(o,i,P)}catch(ie){Mp(o,i,ie)}finally{x!==null&&C.types!==null&&(x.types=C.types),ee.T=x}}else try{x=d(y,u),Ab(o,i,x)}catch(ie){Mp(o,i,ie)}}function Ab(o,i,d){typeof d=="object"&&d&&typeof d.then=="function"?d.then(function(u){Mb(o,i,u)},function(u){return Mp(o,i,u)}):Mb(o,i,d)}function Mb(o,i,d){i.status="fulfilled",i.value=d,Ob(i),o.state=d,i=o.pending,i!==null&&(d=i.next,d===i?o.pending=null:(d=d.next,i.next=d,Tb(o,d)))}function Mp(o,i,d){var u=o.pending;if(o.pending=null,u!==null){u=u.next;do i.status="rejected",i.reason=d,Ob(i),i=i.next;while(i!==u)}o.action=null}function Ob(o){o=o.listeners;for(var i=0;i<o.length;i++)(0,o[i])()}function Pb(o,i){return i}function Db(o,i){if(We){var d=ct.formState;if(d!==null){e:{var u=He;if(We){if(ft){t:{for(var y=ft,x=Bn;y.nodeType!==8;)if(!x||(y=Vn(y.nextSibling),y===null)){y=null;break t}x=y.data,y=x==="F!"||x==="F"?y:null}if(y){ft=Vn(y.nextSibling),u=y.data==="F!";break e}}Hr(u)}u=!1}u&&(i=d[0])}}return d=ln(),d.memoizedState=d.baseState=i,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pb,lastRenderedState:i},d.queue=u,d=ex.bind(null,He,u),u.dispatch=d,u=Ap(!1),x=Rp.bind(null,He,!1,u.queue),u=ln(),y={state:i,dispatch:null,action:o,pending:null},u.queue=y,d=E2.bind(null,He,y,x,d),y.dispatch=d,u.memoizedState=o,[i,d,!1]}function Lb(o){return Ib(Et(),lt,o)}function Ib(o,i,d){if(i=_p(o,i,Pb)[0],o=Ku(dr)[0],typeof i=="object"&&i&&typeof i.then=="function")try{var u=Ml(i)}catch(C){throw C===Ua?Du:C}else u=i;i=Et();var y=i.queue,x=y.dispatch;return d!==i.memoizedState&&(He.flags|=2048,Ga(9,{destroy:void 0},$2.bind(null,y,d),null)),[u,x,o]}function $2(o,i){o.action=i}function Rb(o){var i=Et(),d=lt;if(d!==null)return Ib(i,d,o);Et(),i=i.memoizedState,d=Et();var u=d.queue.dispatch;return d.memoizedState=o,[i,u,!1]}function Ga(o,i,d,u){return o={tag:o,create:d,deps:u,inst:i,next:null},i=He.updateQueue,i===null&&(i=Hu(),He.updateQueue=i),d=i.lastEffect,d===null?i.lastEffect=o.next=o:(u=d.next,d.next=o,o.next=u,i.lastEffect=o),o}function zb(){return Et().memoizedState}function Wu(o,i,d,u){var y=ln();He.flags|=o,y.memoizedState=Ga(1|i,{destroy:void 0},d,u===void 0?null:u)}function Uu(o,i,d,u){var y=Et();u=u===void 0?null:u;var x=y.memoizedState.inst;lt!==null&&u!==null&&Sp(u,lt.memoizedState.deps)?y.memoizedState=Ga(i,x,d,u):(He.flags|=o,y.memoizedState=Ga(1|i,x,d,u))}function Fb(o,i){Wu(8390656,8,o,i)}function Op(o,i){Uu(2048,8,o,i)}function _2(o){He.flags|=4;var i=He.updateQueue;if(i===null)i=Hu(),He.updateQueue=i,i.events=[o];else{var d=i.events;d===null?i.events=[o]:d.push(o)}}function Bb(o){var i=Et().memoizedState;return _2({ref:i,nextImpl:o}),function(){if(nt&2)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function qb(o,i){return Uu(4,2,o,i)}function Hb(o,i){return Uu(4,4,o,i)}function Vb(o,i){if(typeof i=="function"){o=o();var d=i(o);return function(){typeof d=="function"?d():i(null)}}if(i!=null)return o=o(),i.current=o,function(){i.current=null}}function Kb(o,i,d){d=d==null?null:d.concat([o]),Uu(4,4,Vb.bind(null,i,o),d)}function Pp(){}function Wb(o,i){var d=Et();i=i===void 0?null:i;var u=d.memoizedState;return i!==null&&Sp(i,u[1])?u[0]:(d.memoizedState=[o,i],o)}function Ub(o,i){var d=Et();i=i===void 0?null:i;var u=d.memoizedState;if(i!==null&&Sp(i,u[1]))return u[0];if(u=o(),Ki){Ln(!0);try{o()}finally{Ln(!1)}}return d.memoizedState=[u,i],u}function Dp(o,i,d){return d===void 0||lr&1073741824&&!(Qe&261930)?o.memoizedState=i:(o.memoizedState=d,o=ew(),He.lanes|=o,Jr|=o,d)}function Yb(o,i,d,u){return jn(d,i)?d:Ur.current===null?!(lr&106)||lr&1073741824&&!(Qe&261930)?(Ot=!0,o.memoizedState=d):(o=ew(),He.lanes|=o,Jr|=o,i):(o=Dp(o,d,u),jn(o,i)||(Ot=!0),o)}function Xb(o,i,d,u,y){var x=de.p;de.p=x!==0&&8>x?x:8;var C=ee.T,P={};P.types=C===null?null:C.types,ee.T=P,Rp(o,!1,i,d);try{var H=y(),ie=ee.S;ie!==null&&ie(P,H),typeof H=="object"&&H&&typeof H.then=="function"?Ol(o,i,N2(H,u),Hn(o)):Ol(o,i,u,Hn(o))}catch(ce){Ol(o,i,{then:function(){},status:"rejected",reason:ce},Hn())}finally{de.p=x,C!==null&&P.types!==null&&(C.types=P.types),ee.T=C}}function T2(){}function Lp(o,i,d,u){if(o.tag!==5)throw Error(a(476));var y=Zb(o).queue;Xb(o,y,i,me,d===null?T2:function(){return Gb(o),d(u)})}function Zb(o){var i=o.memoizedState;if(i!==null)return i;i={memoizedState:me,baseState:me,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dr,lastRenderedState:me},next:null};var d={};return i.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dr,lastRenderedState:d},next:null},o.memoizedState=i,o=o.alternate,o!==null&&(o.memoizedState=i),i}function Gb(o){var i=Zb(o);i.next===null&&(i=o.alternate.memoizedState),Ol(o,i.next.queue,{},Hn())}function Ip(){return Gt(gs)}function Qb(){return Et().memoizedState}function Jb(){return Et().memoizedState}function A2(o){for(var i=o.return;i!==null;){switch(i.tag){case 24:case 3:var d=Hn();o=Hi(d);var u=Vi(i,o,d);u!==null&&(xn(u,i,d),El(u,i,d)),i={cache:cp()},o.payload=i;return}i=i.return}}function M2(o,i,d){var u=Hn();d={lane:u,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Yu(o)?tx(i,d):(d=np(o,i,d,u),d!==null&&(xn(d,o,u),nx(d,i,u)))}function ex(o,i,d){Ol(o,i,d,Hn())}function Ol(o,i,d,u){var y={lane:u,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(Yu(o))tx(i,y);else{var x=o.alternate;if(o.lanes===0&&(x===null||x.lanes===0)&&(x=i.lastRenderedReducer,x!==null))try{var C=i.lastRenderedState,P=x(C,d);if(y.hasEagerState=!0,y.eagerState=P,jn(P,C))return ju(o,i,y,0),ct===null&&Nu(),!1}catch{}if(d=np(o,i,y,u),d!==null)return xn(d,o,u),nx(d,i,u),!0}return!1}function Rp(o,i,d,u){if(u={lane:2,revertLane:$m(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Yu(o)){if(i)throw Error(a(479))}else i=np(o,d,u,2),i!==null&&xn(i,o,2)}function Yu(o){var i=o.alternate;return o===He||i!==null&&i===He}function tx(o,i){Xa=Bu=!0;var d=o.pending;d===null?i.next=i:(i.next=d.next,d.next=i),o.pending=i}function nx(o,i,d){if(d&4194048){var u=i.lanes;u&=o.pendingLanes,d|=u,i.lanes=d,_i(o,d)}}var Xu={readContext:Gt,use:Vu,useCallback:St,useContext:St,useEffect:St,useImperativeHandle:St,useLayoutEffect:St,useInsertionEffect:St,useMemo:St,useReducer:St,useRef:St,useState:St,useDebugValue:St,useDeferredValue:St,useTransition:St,useSyncExternalStore:St,useId:St,useHostTransitionStatus:St,useFormState:St,useActionState:St,useOptimistic:St,useMemoCache:St,useCacheRefresh:St,useEffectEvent:St},ox={readContext:Gt,use:Vu,useCallback:function(o,i){return ln().memoizedState=[o,i===void 0?null:i],o},useContext:Gt,useEffect:Fb,useImperativeHandle:function(o,i,d){d=d==null?null:d.concat([o]),Wu(4194308,4,Vb.bind(null,i,o),d)},useLayoutEffect:function(o,i){return Wu(4194308,4,o,i)},useInsertionEffect:function(o,i){Wu(4,2,o,i)},useMemo:function(o,i){var d=ln();i=i===void 0?null:i;var u=o();if(Ki){Ln(!0);try{o()}finally{Ln(!1)}}return d.memoizedState=[u,i],u},useReducer:function(o,i,d){var u=ln();if(d!==void 0){var y=d(i);if(Ki){Ln(!0);try{d(i)}finally{Ln(!1)}}}else y=i;return u.memoizedState=u.baseState=y,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:y},u.queue=o,o=o.dispatch=M2.bind(null,He,o),[u.memoizedState,o]},useRef:function(o){var i=ln();return o={current:o},i.memoizedState=o},useState:function(o){o=Ap(o);var i=o.queue,d=ex.bind(null,He,i);return i.dispatch=d,[o.memoizedState,d]},useDebugValue:Pp,useDeferredValue:function(o,i){return Dp(ln(),o,i)},useTransition:function(){var o=Ap(!1);return o=Xb.bind(null,He,o.queue,!0,!1),ln().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,i,d){var u=He,y=ln();if(We){if(d===void 0)throw Error(a(407));d=d()}else{if(d=i(),ct===null)throw Error(a(349));Qe&127||Nb(u,i,d)}y.memoizedState=d;var x={value:d,getSnapshot:i};return y.queue=x,Fb(Cb.bind(null,u,x,o),[o]),u.flags|=2048,Ga(9,{destroy:void 0},jb.bind(null,u,x,d,i),null),d},useId:function(){var o=ln(),i=ct.identifierPrefix;if(We){var d=So,u=ko;d=(u&~(1<<32-qt(u)-1)).toString(32)+d,i="_"+i+"R_"+d,d=qu++,0<d&&(i+="H"+d.toString(32)),i+="_"}else d=j2++,i="_"+i+"r_"+d.toString(32)+"_";return o.memoizedState=i},useHostTransitionStatus:Ip,useFormState:Db,useActionState:Db,useOptimistic:function(o){var i=ln();i.memoizedState=i.baseState=o;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=d,i=Rp.bind(null,He,!0,d),d.dispatch=i,[o,i]},useMemoCache:$p,useCacheRefresh:function(){return ln().memoizedState=A2.bind(null,He)},useEffectEvent:function(o){var i=ln(),d={impl:o};return i.memoizedState=d,function(){if(nt&2)throw Error(a(440));return d.impl.apply(void 0,arguments)}}},rx={readContext:Gt,use:Vu,useCallback:Wb,useContext:Gt,useEffect:Op,useImperativeHandle:Kb,useInsertionEffect:qb,useLayoutEffect:Hb,useMemo:Ub,useReducer:Ku,useRef:zb,useState:function(){return Ku(dr)},useDebugValue:Pp,useDeferredValue:function(o,i){return Yb(Et(),lt.memoizedState,o,i)},useTransition:function(){var o=Ku(dr)[0],i=Et().memoizedState;return[typeof o=="boolean"?o:Ml(o),i]},useSyncExternalStore:Sb,useId:Qb,useHostTransitionStatus:Ip,useFormState:Lb,useActionState:Lb,useOptimistic:function(o,i){return _b(Et(),lt,o,i)},useMemoCache:$p,useCacheRefresh:Jb,useEffectEvent:Bb},O2={readContext:Gt,use:Vu,useCallback:Wb,useContext:Gt,useEffect:Op,useImperativeHandle:Kb,useInsertionEffect:qb,useLayoutEffect:Hb,useMemo:Ub,useReducer:Tp,useRef:zb,useState:function(){return Tp(dr)},useDebugValue:Pp,useDeferredValue:function(o,i){var d=Et();return lt===null?Dp(d,o,i):Yb(d,lt.memoizedState,o,i)},useTransition:function(){var o=Tp(dr)[0],i=Et().memoizedState;return[typeof o=="boolean"?o:Ml(o),i]},useSyncExternalStore:Sb,useId:Qb,useHostTransitionStatus:Ip,useFormState:Rb,useActionState:Rb,useOptimistic:function(o,i){var d=Et();return lt===null?(d.baseState=o,[o,d.queue.dispatch]):_b(d,lt,o,i)},useMemoCache:$p,useCacheRefresh:Jb,useEffectEvent:Bb};function zp(o,i,d,u){i=o.memoizedState,d=d(u,i),d=d==null?i:M({},i,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var Fp={enqueueSetState:function(o,i,d){o=o._reactInternals;var u=Hn(),y=Hi(u);y.payload=i,d!=null&&(y.callback=d),i=Vi(o,y,u),i!==null&&(xn(i,o,u),El(i,o,u))},enqueueReplaceState:function(o,i,d){o=o._reactInternals;var u=Hn(),y=Hi(u);y.tag=1,y.payload=i,d!=null&&(y.callback=d),i=Vi(o,y,u),i!==null&&(xn(i,o,u),El(i,o,u))},enqueueForceUpdate:function(o,i){o=o._reactInternals;var d=Hn(),u=Hi(d);u.tag=2,i!=null&&(u.callback=i),i=Vi(o,u,d),i!==null&&(xn(i,o,d),El(i,o,d))}};function ix(o,i,d,u,y,x,C){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(u,x,C):i.prototype&&i.prototype.isPureReactComponent?!bl(d,u)||!bl(y,x):!0}function ax(o,i,d,u){o=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(d,u),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(d,u),i.state!==o&&Fp.enqueueReplaceState(i,i.state,null)}function Wi(o,i){var d=i;if("ref"in i)for(var u in d={},i)u!=="ref"&&(d[u]=i[u]);if(o=o.defaultProps)for(var y in d===i&&(d=M({},d)),o)d[y]===void 0&&(d[y]=o[y]);return d}function P2(o){Su(o)}function D2(o){console.error(o)}function L2(o){Su(o)}function Zu(o,i){try{var d=o.onUncaughtError;d(i.value,{componentStack:i.stack})}catch(u){setTimeout(function(){throw u})}}function sx(o,i,d){try{var u=o.onCaughtError;u(d.value,{componentStack:d.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Bp(o,i,d){return d=Hi(d),d.tag=3,d.payload={element:null},d.callback=function(){Zu(o,i)},d}function lx(o){return o=Hi(o),o.tag=3,o}function dx(o,i,d,u){var y=d.type.getDerivedStateFromError;if(typeof y=="function"){var x=u.value;o.payload=function(){return y(x)},o.callback=function(){sx(i,d,u)}}var C=d.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(o.callback=function(){sx(i,d,u),typeof y!="function"&&(ei===null?ei=new Set([this]):ei.add(this));var P=u.stack;this.componentDidCatch(u.value,{componentStack:P===null?"":P})})}function I2(o,i,d,u,y){if(d.flags|=32768,typeof u=="object"&&u&&typeof u.then=="function"){if(i=d.alternate,i!==null&&Li(i,d,y,!0),d=Qt.current,d!==null){switch(d.tag){case 31:case 13:case 19:return sn===null?yc():d.alternate===null&&Nt===0&&(Nt=3),d.flags&=-257,d.flags|=65536,d.lanes=y,u===Lu?d.flags|=16384:(i=d.updateQueue,i===null?d.updateQueue=new Set([u]):i.add(u),jm(o,u,y)),!1;case 22:return d.flags|=65536,u===Lu?d.flags|=16384:(i=d.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([u])},d.updateQueue=i):(d=i.retryQueue,d===null?i.retryQueue=new Set([u]):d.add(u)),jm(o,u,y)),!1}throw Error(a(435,d.tag))}return jm(o,u,y),yc(),!1}if(We)return i=Qt.current,i===null?(u!==sp&&(i=Error(a(423),{cause:u}),kl(Rn(i,d))),o=o.current.alternate,o.flags|=65536,y&=-y,o.lanes|=y,u=Rn(u,d),y=Bp(o.stateNode,u,y),yp(o,y),Nt!==4&&(Nt=2)):(!(i.flags&65536)&&(i.flags|=256),i.flags|=65536,i.lanes=y,u!==sp&&(o=Error(a(422),{cause:u}),kl(Rn(o,d)))),!1;var x=Error(a(520),{cause:u});if(x=Rn(x,d),Bl===null?Bl=[x]:Bl.push(x),Nt!==4&&(Nt=2),i===null)return!0;u=Rn(u,d),d=i;do{switch(d.tag){case 3:return d.flags|=65536,o=y&-y,d.lanes|=o,o=Bp(d.stateNode,u,o),yp(d,o),!1;case 1:if(i=d.type,x=d.stateNode,!(d.flags&128)&&(typeof i.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(ei===null||!ei.has(x))))return d.flags|=65536,y&=-y,d.lanes|=y,y=lx(y),dx(y,o,d,u),yp(d,y),!1;break;case 22:if(d.memoizedState!==null)return d.flags|=65536,!1}d=d.return}while(d!==null);return!1}var qp=Error(a(461)),Ot=!1;function It(o,i,d,u){i.child=o===null?gb(i,null,d,u):qi(i,o.child,d,u)}function ux(o,i,d,u,y){d=d.render;var x=i.ref;if("ref"in u){var C={};for(var P in u)P!=="ref"&&(C[P]=u[P])}else C=u;return Ii(i),u=Np(o,i,d,C,x,y),P=jp(),o!==null&&!Ot?(Cp(o,i,y),ur(o,i,y)):(We&&P&&_u(i),i.flags|=1,It(o,i,u,y),i.child)}function cx(o,i,d,u,y){if(o===null){var x=d.type;return typeof x=="function"&&!op(x)&&x.defaultProps===void 0&&d.compare===null?(i.tag=15,i.type=x,fx(o,i,x,u,y)):(o=Eu(d.type,null,u,i,i.mode,y),o.ref=i.ref,o.return=i,i.child=o)}if(x=o.child,!Zp(o,y)){var C=x.memoizedProps;if(d=d.compare,d=d===null?bl:d,d(C,u)&&o.ref===i.ref)return ur(o,i,y)}return i.flags|=1,o=rr(x,u),o.ref=i.ref,o.return=i,i.child=o}function fx(o,i,d,u,y){if(o!==null){var x=o.memoizedProps;if(bl(x,u)&&o.ref===i.ref)if(Ot=!1,i.pendingProps=u=x,Zp(o,y))o.flags&131072&&(Ot=!0);else return i.lanes=o.lanes,ur(o,i,y)}return Hp(o,i,d,u,y)}function hx(o,i,d,u){var y=u.children,x=o===null?null:o.memoizedState;if(o===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if(i.flags&128){if(x=x===null?d:x.baseLanes|d,o!==null){for(u=i.child=o.child,y=0;u!==null;)y=y|u.lanes|u.childLanes,u=u.sibling;u=y&~x}else u=0,i.child=null;return px(o,i,x,d,u)}if(d&536870912)i.memoizedState={baseLanes:0,cachePool:null},o!==null&&Pu(i,x===null?null:x.cachePool),x===null?bp():bb(i,x),xb(i);else return u=i.lanes=536870912,px(o,i,x===null?d:x.baseLanes|d,d,u)}else x===null?(o!==null&&Pu(i,null),bp(),Xr()):(Pu(i,x.cachePool),bb(i,x),Xr(),i.memoizedState=null);return It(o,i,y,d),i.child}function Pl(o,i){return o!==null&&o.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function px(o,i,d,u,y){var x=hp();return x=x===null?null:{parent:At._currentValue,pool:x},i.memoizedState={baseLanes:d,cachePool:x},o!==null&&Pu(i,null),bp(),xb(i),o!==null&&Li(o,i,u,!0),i.childLanes=y,null}function Gu(o,i){return i=Qu({mode:i.mode,children:i.children},o.mode),i.ref=o.ref,o.child=i,i.return=o,i}function mx(o,i,d){return qi(i,o.child,null,d),o=Gu(i,i.pendingProps),o.flags|=2,Cn(i),i.memoizedState=null,o}function R2(o,i,d){var u=i.pendingProps,y=!!(i.flags&128);if(i.flags&=-129,o===null){if(We){if(u.mode==="hidden")return o=Gu(i,u),i.lanes=536870912,o.memoizedState={baseLanes:0,cachePool:null},Pl(null,o);if(wp(i),(o=ft)?(o=Hw(o,Bn),o=o!==null&&o.data==="&"?o:null,o!==null&&(i.memoizedState={dehydrated:o,treeContext:Br===null?null:{id:ko,overflow:So},retryLane:536870912,hydrationErrors:null},d=tb(o),d.return=i,i.child=d,Vt=i,ft=null)):o=null,o===null)throw Hr(i);return i.lanes=536870912,null}return Gu(i,u)}var x=o.memoizedState;if(x!==null){var C=x.dehydrated;if(wp(i),y)if(i.flags&256)i.flags&=-257,i=mx(o,i,d);else if(i.memoizedState!==null)i.child=o.child,i.flags|=128,i=null;else throw Error(a(558));else if(Ot||Li(o,i,d,!1),y=(d&o.childLanes)!==0,Ot||y){if(Ur.current===null){if(u=ct,u!==null&&(C=Pr(u,d),C!==0&&C!==x.retryLane))throw x.retryLane=C,Mi(o,C),xn(u,o,C),qp;yc()}i=mx(o,i,d)}else o=x.treeContext,ft=Vn(C.nextSibling),Vt=i,We=!0,qr=null,Bn=!1,o!==null&&rb(i,o),i=Gu(i,u),i.flags|=134221824;return i}return o=rr(o.child,{mode:u.mode,children:u.children}),o.ref=i.ref,i.child=o,o.return=i,o}function Qa(o,i){var d=i.ref;if(d===null)o!==null&&o.ref!==null&&(i.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(a(284));(o===null||o.ref!==d)&&(i.flags|=4194816)}}function Hp(o,i,d,u,y){return Ii(i),d=Np(o,i,d,u,void 0,y),u=jp(),o!==null&&!Ot?(Cp(o,i,y),ur(o,i,y)):(We&&u&&_u(i),i.flags|=1,It(o,i,d,y),i.child)}function gx(o,i,d,u,y,x){return Ii(i),i.updateQueue=null,d=kb(i,u,d,y),wb(o),u=jp(),o!==null&&!Ot?(Cp(o,i,x),ur(o,i,x)):(We&&u&&_u(i),i.flags|=1,It(o,i,d,x),i.child)}function yx(o,i,d,u,y){if(Ii(i),i.stateNode===null){var x=qa,C=d.contextType;typeof C=="object"&&C&&(x=Gt(C)),x=new d(u,x),i.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Fp,i.stateNode=x,x._reactInternals=i,x=i.stateNode,x.props=u,x.state=i.memoizedState,x.refs={},mp(i),C=d.contextType,x.context=typeof C=="object"&&C?Gt(C):qa,x.state=i.memoizedState,C=d.getDerivedStateFromProps,typeof C=="function"&&(zp(i,d,C,u),x.state=i.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(C=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),C!==x.state&&Fp.enqueueReplaceState(x,x.state,null),_l(i,u,x,y),$l(),x.state=i.memoizedState),typeof x.componentDidMount=="function"&&(i.flags|=4194308),u=!0}else if(o===null){x=i.stateNode;var P=i.memoizedProps,H=Wi(d,P);x.props=H;var ie=x.context,ce=d.contextType;C=qa,typeof ce=="object"&&ce&&(C=Gt(ce));var ye=d.getDerivedStateFromProps;ce=typeof ye=="function"||typeof x.getSnapshotBeforeUpdate=="function",P=i.pendingProps!==P,ce||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(P||ie!==C)&&ax(i,x,u,C),Wr=!1;var te=i.memoizedState;x.state=te,_l(i,u,x,y),$l(),ie=i.memoizedState,P||te!==ie||Wr?(typeof ye=="function"&&(zp(i,d,ye,u),ie=i.memoizedState),(H=Wr||ix(i,d,H,u,te,ie,C))?(ce||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(i.flags|=4194308)):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=u,i.memoizedState=ie),x.props=u,x.state=ie,x.context=C,u=H):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),u=!1)}else{x=i.stateNode,gp(o,i),C=i.memoizedProps,ce=Wi(d,C),x.props=ce,ye=i.pendingProps,te=x.context,ie=d.contextType,H=qa,typeof ie=="object"&&ie&&(H=Gt(ie)),P=d.getDerivedStateFromProps,(ie=typeof P=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(C!==ye||te!==H)&&ax(i,x,u,H),Wr=!1,te=i.memoizedState,x.state=te,_l(i,u,x,y),$l();var ue=i.memoizedState;C!==ye||te!==ue||Wr||o!==null&&o.dependencies!==null&&Mu(o.dependencies)?(typeof P=="function"&&(zp(i,d,P,u),ue=i.memoizedState),(ce=Wr||ix(i,d,ce,u,te,ue,H)||o!==null&&o.dependencies!==null&&Mu(o.dependencies))?(ie||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(u,ue,H),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(u,ue,H)),typeof x.componentDidUpdate=="function"&&(i.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof x.componentDidUpdate!="function"||C===o.memoizedProps&&te===o.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||C===o.memoizedProps&&te===o.memoizedState||(i.flags|=1024),i.memoizedProps=u,i.memoizedState=ue),x.props=u,x.state=ue,x.context=H,u=ce):(typeof x.componentDidUpdate!="function"||C===o.memoizedProps&&te===o.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||C===o.memoizedProps&&te===o.memoizedState||(i.flags|=1024),u=!1)}return x=u,Qa(o,i),u=!!(i.flags&128),x||u?(x=i.stateNode,d=u&&typeof d.getDerivedStateFromError!="function"?null:x.render(),i.flags|=1,o!==null&&u?(i.child=qi(i,o.child,null,y),i.child=qi(i,null,d,y)):It(o,i,d,y),i.memoizedState=x.state,o=i.child):o=ur(o,i,y),o}function vx(o,i,d,u){return Pi(),i.flags|=256,It(o,i,d,u),i.child}var Vp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kp(o){return{baseLanes:o,cachePool:ub()}}function Wp(o,i,d){return o=o===null?0:o.childLanes&~d,i&&(o|=_n),o}function bx(o,i,d){var u=i.pendingProps,y=!1,x=!!(i.flags&128),C;if((C=x)||(C=o!==null&&o.memoizedState===null?!1:!!(Jt.current&2)),C&&(y=!0,i.flags&=-129),C=!!(i.flags&32),i.flags&=-33,o===null){if(We){if(y?Yr(i):Xr(),(o=ft)?(o=Hw(o,Bn),o=o!==null&&o.data!=="&"?o:null,o!==null&&(i.memoizedState={dehydrated:o,treeContext:Br===null?null:{id:ko,overflow:So},retryLane:536870912,hydrationErrors:null},d=tb(o),d.return=i,i.child=d,Vt=i,ft=null)):o=null,o===null)throw Hr(i);return i.lanes=Vm(o)?32:536870912,null}return x=u.children,u=u.fallback,y?(Xr(),y=i.mode,x=Qu({mode:"hidden",children:x},y),u=Oi(u,y,d,null),x.return=i,u.return=i,x.sibling=u,i.child=x,u=i.child,u.memoizedState=Kp(d),u.childLanes=Wp(o,C,d),i.memoizedState=Vp,Pl(null,u)):(Yr(i),Up(i,x))}var P=o.memoizedState;if(P!==null){var H=P.dehydrated;if(H!==null)return z2(o,i,x,C,u,H,P,d)}return y?(Xr(),y=u.fallback,x=i.mode,P=o.child,H=P.sibling,u=rr(P,{mode:"hidden",children:u.children}),u.subtreeFlags=P.subtreeFlags&1206910976,H===null?(y=Oi(y,x,d,null),y.flags|=2):y=rr(H,y),y.return=i,u.return=i,u.sibling=y,i.child=u,Pl(null,u),u=i.child,y=o.child.memoizedState,y===null?y=Kp(d):(x=y.cachePool,x===null?x=ub():(P=At._currentValue,x=x.parent===P?x:{parent:P,pool:P}),y={baseLanes:y.baseLanes|d,cachePool:x}),u.memoizedState=y,u.childLanes=Wp(o,C,d),i.memoizedState=Vp,Pl(o.child,u)):(Yr(i),d=o.child,o=d.sibling,d=rr(d,{mode:"visible",children:u.children}),d.return=i,d.sibling=null,o!==null&&(C=i.deletions,C===null?(i.deletions=[o],i.flags|=16):C.push(o)),i.child=d,i.memoizedState=null,d)}function Up(o,i){return i=Qu({mode:"visible",children:i},o.mode),i.return=o,o.child=i}function Qu(o,i){return o=gn(22,o,null,i),o.lanes=0,o}function Ju(o,i,d){return qi(i,o.child,null,d),o=Up(i,i.pendingProps.children),o.flags|=2,i.memoizedState=null,o}function z2(o,i,d,u,y,x,C,P){if(d)return i.flags&256?(Yr(i),i.flags&=-257,Ju(o,i,P)):i.memoizedState===null?(Xr(),x=y.fallback,C=i.mode,y=Qu({mode:"visible",children:y.children},C),x=Oi(x,C,P,null),x.flags|=2,y.return=i,x.return=i,y.sibling=x,i.child=y,qi(i,o.child,null,P),y=i.child,y.memoizedState=Kp(P),y.childLanes=Wp(o,u,P),i.memoizedState=Vp,Pl(null,y)):(Xr(),i.child=o.child,i.flags|=128,null);if(Yr(i),Vm(x)){if(u=x.nextSibling&&x.nextSibling.dataset,u)var H=u.dgst;return u=H,u!==""&&(y=Error(a(419)),y.stack="",y.digest=u,kl({value:y,source:null,stack:null})),Ju(o,i,P)}if(Ot||Li(o,i,P,!1),u=(P&o.childLanes)!==0,Ot||u){if(Ur.current!==null)return Ju(o,i,P);if(u=ct,u!==null&&(y=Pr(u,P),y!==0&&y!==C.retryLane))throw C.retryLane=y,Mi(o,y),xn(u,o,y),qp;return Hm(x)||yc(),Ju(o,i,P)}return Hm(x)?(i.flags|=192,i.child=o.child,null):(o=C.treeContext,ft=Vn(x.nextSibling),Vt=i,We=!0,qr=null,Bn=!1,o!==null&&rb(i,o),i=Up(i,y.children),i.flags|=134221824,i)}function xx(o,i,d){o.lanes|=i;var u=o.alternate;u!==null&&(u.lanes|=i),Au(o.return,i,d)}function wx(o){for(var i=null;o!==null;){var d=o.alternate;d!==null&&Fu(d)===null&&(i=o),o=o.sibling}return i}function ec(o,i,d,u,y,x){var C=o.memoizedState;C===null?o.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:u,tail:d,tailMode:y,treeForkCount:x}:(C.isBackwards=i,C.rendering=null,C.renderingStartTime=0,C.last=u,C.tail=d,C.tailMode=y,C.treeForkCount=x)}function Yp(o){var i=o.child;for(o.child=null;i!==null;){var d=i.sibling;i.sibling=o.child,o.child=i,i=d}}function Xp(o,i,d){var u=i.pendingProps,y=u.revealOrder,x=u.tail;u=u.children;var C=Jt.current;if(i.flags&128)return Tl(i,C),null;var P=!!(C&2);if(P?(C=C&1|2,i.flags|=128):C&=1,Tl(i,C),y==="backwards"&&o!==null?(Yp(o),It(o,i,u,d),Yp(o)):It(o,i,u,d),u=We?wl:0,!P&&o!==null&&o.flags&128)e:for(o=i.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&xx(o,d,i);else if(o.tag===19)xx(o,d,i);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break e;for(;o.sibling===null;){if(o.return===null||o.return===i)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(y){case"backwards":d=wx(i.child),d===null?(y=i.child,i.child=null):(y=d.sibling,d.sibling=null,Yp(i)),ec(i,!0,y,null,x,u);break;case"unstable_legacy-backwards":for(d=null,y=i.child,i.child=null;y!==null;){if(o=y.alternate,o!==null&&Fu(o)===null){i.child=y;break}o=y.sibling,y.sibling=d,d=y,y=o}ec(i,!0,d,null,x,u);break;case"together":ec(i,!1,null,null,void 0,u);break;case"independent":i.memoizedState=null;break;default:d=wx(i.child),d===null?(y=i.child,i.child=null):(y=d.sibling,d.sibling=null),ec(i,!1,y,d,x,u)}return i.child}function kx(o,i,d){var u=i.pendingProps;return Vr(i,i.type,u.value),It(o,i,u.children,d),i.child}function ur(o,i,d){if(o!==null&&(i.dependencies=o.dependencies),Jr|=i.lanes,(d&i.childLanes)===0)if(o!==null){if(Li(o,i,d,!1),(d&i.childLanes)===0)return null}else return null;if(o!==null&&i.child!==o.child)throw Error(a(153));if(i.child!==null){for(o=i.child,d=rr(o,o.pendingProps),i.child=d,d.return=i;o.sibling!==null;)o=o.sibling,d=d.sibling=rr(o,o.pendingProps),d.return=i;d.sibling=null}return i.child}function Zp(o,i){return(o.lanes&i)!==0||(o=o.dependencies,!!(o!==null&&Mu(o)))}function F2(o,i,d){switch(i.tag){case 3:hn(i,i.stateNode.containerInfo),Vr(i,At,o.memoizedState.cache),Pi();break;case 27:case 5:Bt(i);break;case 4:hn(i,i.stateNode.containerInfo);break;case 10:Vr(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,wp(i),null;break;case 13:var u=i.memoizedState;if(u!==null){if(u.dehydrated!==null)return Yr(i),i.flags|=128,null;u=Li(o,i,d,!1);var y=i.child.childLanes;return u||(d&y)!==0?bx(o,i,d):(Yr(i),o=ur(o,i,d),o===null?null:o.sibling)}Yr(i);break;case 19:if(i.flags&128)return Xp(o,i,d);if(y=!!(o.flags&128),u=(d&i.childLanes)!==0,u||=(Li(o,i,d,!1),(d&i.childLanes)!==0),y){if(u)return Xp(o,i,d);i.flags|=128}if(y=i.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),Tl(i,Jt.current),u)break;return null;case 22:return i.lanes=0,hx(o,i,d,i.pendingProps);case 24:Vr(i,At,o.memoizedState.cache)}return ur(o,i,d)}function Sx(o,i,d){if(o!==null)if(o.memoizedProps!==i.pendingProps)Ot=!0;else{if(!Zp(o,d)&&!(i.flags&128))return Ot=!1,F2(o,i,d);Ot=!!(o.flags&131072)}else Ot=!1,We&&i.flags&1048576&&ob(i,wl,i.index);switch(i.lanes=0,i.tag){case 16:e:{var u=i.pendingProps;if(o=Fi(i.elementType),i.type=o,typeof o=="function")op(o)?(u=Wi(o,u),i.tag=1,i=yx(null,i,o,u,d)):(i.tag=0,i=Hp(null,i,o,u,d));else{if(o!=null){var y=o.$$typeof;if(y===U){i.tag=11,i=ux(null,i,o,u,d);break e}if(y===le){i.tag=14,i=cx(null,i,o,u,d);break e}if(y===I){i.tag=10,i.type=o,i=kx(null,i,d);break e}}throw i=Z(o)||o,Error(a(306,i,""))}}return i;case 0:return Hp(o,i,i.type,i.pendingProps,d);case 1:return u=i.type,y=Wi(u,i.pendingProps),yx(o,i,u,y,d);case 3:e:{if(hn(i,i.stateNode.containerInfo),o===null)throw Error(a(387));u=i.pendingProps;var x=i.memoizedState;y=x.element,gp(o,i),_l(i,u,null,d);var C=i.memoizedState;if(u=C.cache,Vr(i,At,u),u!==x.cache&&up(i,[At],d,!0),$l(),u=C.element,x.isDehydrated){if(x={element:u,isDehydrated:!1,cache:C.cache},i.updateQueue.baseState=x,i.memoizedState=x,i.flags&256){i=vx(o,i,u,d);break e}if(u!==y){y=Rn(Error(a(424)),i),kl(y),i=vx(o,i,u,d);break e}for((o=i.stateNode.containerInfo,o.nodeType)===9?o=o.body:o=o.nodeName==="HTML"?o.ownerDocument.body:o,ft=Vn(o.firstChild),Vt=i,We=!0,qr=null,Bn=!0,d=gb(i,null,u,d),i.child=d;d;)d.flags=d.flags&-3|134221824,d=d.sibling}else{if(Pi(),u===y){i=ur(o,i,d);break e}It(o,i,u,d)}i=i.child}return i;case 26:return Qa(o,i),o===null?(d=Zw(i.type,null,i.pendingProps,null))?i.memoizedState=d:We||(i.stateNode=$w(i.type,i.pendingProps,Lt.current,i)):i.memoizedState=Zw(i.type,o.memoizedProps,i.pendingProps,o.memoizedState),null;case 27:return Bt(i),o===null&&We&&(u=i.stateNode=Ww(i.type,i.pendingProps,Lt.current),Vt=i,Bn=!0,y=ft,oi(i.type)?(Km=y,ft=Vn(u.firstChild)):ft=y),It(o,i,i.pendingProps.children,d),Qa(o,i),o===null&&(i.flags|=4194304),i.child;case 5:return o===null&&We&&((y=u=ft)&&(u=MT(u,i.type,i.pendingProps,Bn),u===null?y=!1:(i.stateNode=u,Vt=i,ft=Vn(u.firstChild),Bn=!1,y=!0)),y||Hr(i)),Bt(i),y=i.type,x=i.pendingProps,C=o===null?null:o.memoizedProps,u=x.children,Lm(y,x)?u=null:C!==null&&Lm(y,C)&&(i.flags|=32),i.memoizedState!==null&&(y=Np(o,i,C2,null,null,d),gs._currentValue=y),Qa(o,i),It(o,i,u,d),i.child;case 6:return o===null&&We&&((o=d=ft)&&(d=OT(d,i.pendingProps,Bn),d===null?o=!1:(i.stateNode=d,Vt=i,ft=null,o=!0)),o||Hr(i)),null;case 13:return bx(o,i,d);case 4:return hn(i,i.stateNode.containerInfo),u=i.pendingProps,o===null?i.child=qi(i,null,u,d):It(o,i,u,d),i.child;case 11:return ux(o,i,i.type,i.pendingProps,d);case 7:return u=i.pendingProps,Qa(o,i),It(o,i,u,d),i.child;case 8:return It(o,i,i.pendingProps.children,d),i.child;case 12:return It(o,i,i.pendingProps.children,d),i.child;case 10:return kx(o,i,d);case 9:return y=i.type._context,u=i.pendingProps.children,Ii(i),y=Gt(y),u=u(y),i.flags|=1,It(o,i,u,d),i.child;case 14:return cx(o,i,i.type,i.pendingProps,d);case 15:return fx(o,i,i.type,i.pendingProps,d);case 19:return Xp(o,i,d);case 31:return R2(o,i,d);case 22:return hx(o,i,d,i.pendingProps);case 24:return Ii(i),u=Gt(At),o===null?(y=hp(),y===null&&(y=ct,x=cp(),y.pooledCache=x,x.refCount++,x!==null&&(y.pooledCacheLanes|=d),y=x),i.memoizedState={parent:u,cache:y},mp(i),Vr(i,At,y)):((o.lanes&d)!==0&&(gp(o,i),_l(i,null,null,d),$l()),y=o.memoizedState,x=i.memoizedState,y.parent===u?(u=x.cache,Vr(i,At,u),u!==y.cache&&up(i,[At],d,!0)):(y={parent:u,cache:u},i.memoizedState=y,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=y),Vr(i,At,u))),It(o,i,i.pendingProps.children,d),i.child;case 30:return i.stateNode===null&&(i.stateNode={autoName:null,paired:null,clones:null,ref:null}),u=i.pendingProps,u.name!=null&&u.name!=="auto"?i.flags|=o===null?18882560:18874368:We&&_u(i),o!==null&&o.memoizedProps.name!==u.name?i.flags|=4194816:Qa(o,i),It(o,i,u.children,d),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function cr(o){o.flags|=4}function Gp(o,i,d,u,y){var x;if((x=!!(o.mode&32))&&(x=d===null?ek(i,u):ek(i,u)&&(u.src!==d.src||u.srcSet!==d.srcSet)),x){if(o.flags|=16777216,(y&335544128)===y)if(o.stateNode.complete)o.flags|=8192;else if(rw())o.flags|=8192;else throw Bi=Lu,pp}else o.flags&=-16777217}function Nx(o,i){if(i.type!=="stylesheet"||i.state.loading&4)o.flags&=-16777217;else if(o.flags|=16777216,!tk(i))if(rw())o.flags|=8192;else throw Bi=Lu,pp}function tc(o,i){i!==null&&(o.flags|=4),o.flags&16384&&(i=o.tag===22?536870912:$i(),o.lanes|=i,os|=i)}function Dl(o,i){if(!We)switch(o.tailMode){case"visible":break;case"collapsed":for(var d=o.tail,u=null;d!==null;)d.alternate!==null&&(u=d),d=d.sibling;u===null?i||o.tail===null?o.tail=null:o.tail.sibling=null:u.sibling=null;break;default:for(i=o.tail,d=null;i!==null;)i.alternate!==null&&(d=i),i=i.sibling;d===null?o.tail=null:d.sibling=null}}function ht(o){var i=o.alternate!==null&&o.alternate.child===o.child,d=0,u=0;if(i)for(var y=o.child;y!==null;)d|=y.lanes|y.childLanes,u|=y.subtreeFlags&1206910976,u|=y.flags&1206910976,y.return=o,y=y.sibling;else for(y=o.child;y!==null;)d|=y.lanes|y.childLanes,u|=y.subtreeFlags,u|=y.flags,y.return=o,y=y.sibling;return o.subtreeFlags|=u,o.childLanes=d,i}function B2(o,i,d){var u=i.pendingProps;switch(ap(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ht(i),null;case 1:return ht(i),null;case 3:return d=i.stateNode,u=null,o!==null&&(u=o.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),sr(At),Ft(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(o===null||o.child===null)&&(Ka(i)?cr(i):o===null||o.memoizedState.isDehydrated&&!(i.flags&256)||(i.flags|=1024,lp())),ht(i),null;case 26:var y=i.type,x=i.memoizedState;return o===null?(cr(i),x===null?(ht(i),Gp(i,y,null,u,d)):(ht(i),Nx(i,x))):x?x===o.memoizedState?(ht(i),i.flags&=-16777217):(cr(i),ht(i),Nx(i,x)):(o=o.memoizedProps,o!==u&&cr(i),ht(i),Gp(i,y,o,u,d)),null;case 27:if(nn(i),d=Lt.current,y=i.type,o!==null&&i.stateNode!=null)o.memoizedProps!==u&&cr(i);else{if(!u){if(i.stateNode===null)throw Error(a(166));return ht(i),i.subtreeFlags&=-33554433,null}o=ut.current,Ka(i)?ib(i,o):(o=Ww(y,u,d),i.stateNode=o,cr(i))}return ht(i),i.subtreeFlags&=-33554433,null;case 5:if(nn(i),y=i.type,o!==null&&i.stateNode!=null)o.memoizedProps!==u&&cr(i);else{if(!u){if(i.stateNode===null)throw Error(a(166));return ht(i),i.subtreeFlags&=-33554433,null}if(x=ut.current,Ka(i))ib(i,x);else{var C=Wl(Lt.current);switch(x){case 1:x=C.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:x=C.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":x=C.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":x=C.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":x=C.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof u.is=="string"?C.createElement("select",{is:u.is}):C.createElement("select"),u.multiple?x.multiple=!0:u.size&&(x.size=u.size);break;default:x=typeof u.is=="string"?C.createElement(y,{is:u.is}):C.createElement(y)}}x[ke]=i,x[Ae]=u;e:for(C=i.child;C!==null;){if(C.tag===5||C.tag===6)x.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===i)break e;for(;C.sibling===null;){if(C.return===null||C.return===i)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}i.stateNode=x;e:switch(tn(x,y,u),y){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&cr(i)}}return ht(i),i.subtreeFlags&=-33554433,Gp(i,i.type,o===null?null:o.memoizedProps,i.pendingProps,d),null;case 6:if(o&&i.stateNode!=null)o.memoizedProps!==u&&cr(i);else{if(typeof u!="string"&&i.stateNode===null)throw Error(a(166));if(o=Lt.current,Ka(i)){if(o=i.stateNode,d=i.memoizedProps,u=null,y=Vt,y!==null)switch(y.tag){case 27:case 5:u=y.memoizedProps}o[ke]=i,o=!!(o.nodeValue===d||u!==null&&u.suppressHydrationWarning===!0||Nw(o.nodeValue,d)),o||Hr(i,!0)}else o=Wl(o).createTextNode(u),o[ke]=i,i.stateNode=o}return ht(i),null;case 31:if(d=i.memoizedState,o===null||o.memoizedState!==null){if(u=Ka(i),d!==null){if(o===null){if(!u)throw Error(a(318));if(o=i.memoizedState,o=o===null?null:o.dehydrated,!o)throw Error(a(557));o[ke]=i}else Pi(),!(i.flags&128)&&(i.memoizedState=null),i.flags|=4;ht(i),o=!1}else d=lp(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=d),o=!0;if(!o)return i.flags&256?(Cn(i),i):(Cn(i),null);if(i.flags&128)throw Error(a(558))}return ht(i),null;case 13:if(u=i.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(y=Ka(i),u!==null&&u.dehydrated!==null){if(o===null){if(!y)throw Error(a(318));if(y=i.memoizedState,y=y===null?null:y.dehydrated,!y)throw Error(a(317));y[ke]=i}else Pi(),!(i.flags&128)&&(i.memoizedState=null),i.flags|=4;ht(i),y=!1}else y=lp(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=y),y=!0;if(!y)return i.flags&256?(Cn(i),i):(Cn(i),null)}return Cn(i),i.flags&128?(i.lanes=d,i):(d=u!==null,o=o!==null&&o.memoizedState!==null,d&&(u=i.child,y=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(y=u.alternate.memoizedState.cachePool.pool),x=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(x=u.memoizedState.cachePool.pool),x!==y&&(u.flags|=2048)),d!==o&&d&&(i.child.flags|=8192),tc(i,i.updateQueue),ht(i),null);case 4:return Ft(),o===null&&xw(i.stateNode.containerInfo),i.flags|=67108864,ht(i),null;case 10:return sr(i.type),ht(i),null;case 19:if(kp(i),u=i.memoizedState,u===null)return ht(i),null;if(y=!!(i.flags&128),x=u.rendering,x===null)if(y)Dl(u,!1);else{if(Nt!==0||o!==null&&o.flags&128)for(o=i.child;o!==null;){if(x=Fu(o),x!==null){for(i.flags|=128,Dl(u,!1),o=x.updateQueue,i.updateQueue=o,tc(i,o),i.subtreeFlags=0,o=d,d=i.child;d!==null;)eb(d,o),d=d.sibling;return Tl(i,Jt.current&1|2),We&&ir(i,u.treeForkCount),i.child}o=o.sibling}u.tail!==null&&Xt()>hc&&(i.flags|=128,y=!0,Dl(u,!1),i.lanes=4194304)}else{if(!y)if(o=Fu(x),o!==null){if(i.flags|=128,y=!0,o=o.updateQueue,i.updateQueue=o,tc(i,o),Dl(u,!0),u.tail===null&&u.tailMode!=="collapsed"&&u.tailMode!=="visible"&&!x.alternate&&!We)return ht(i),null}else 2*Xt()-u.renderingStartTime>hc&&d!==536870912&&(i.flags|=128,y=!0,Dl(u,!1),i.lanes=4194304);u.isBackwards?(x.sibling=i.child,i.child=x):(o=u.last,o===null?i.child=x:o.sibling=x,u.last=x)}if(u.tail!==null){o=u.tail;e:{for(d=o;d!==null;){if(d.alternate!==null){d=!1;break e}d=d.sibling}d=!0}return u.rendering=o,u.tail=o.sibling,u.renderingStartTime=Xt(),o.sibling=null,x=Jt.current,x=y?x&1|2:x&1,u.tailMode==="visible"||u.tailMode==="collapsed"||!d||We?Tl(i,x):(d=x,Be(Qt,i),Be(Jt,d),sn===null&&(sn=i)),We&&ir(i,u.treeForkCount),o}return ht(i),null;case 22:case 23:return Cn(i),xp(),u=i.memoizedState!==null,o===null?u&&(i.flags|=8192):o.memoizedState!==null!==u&&(i.flags|=8192),u?d&536870912&&!(i.flags&128)&&(ht(i),i.subtreeFlags&6&&(i.flags|=8192)):ht(i),d=i.updateQueue,d!==null&&tc(i,d.retryQueue),d=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),u=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),u!==d&&(i.flags|=2048),o!==null&&Ie(zi),null;case 24:return d=null,o!==null&&(d=o.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),sr(At),ht(i),null;case 25:return null;case 30:return i.flags|=33554432,ht(i),null}throw Error(a(156,i.tag))}function q2(o,i){switch(ap(i),i.tag){case 1:return o=i.flags,o&65536?(i.flags=o&-65537|128,i):null;case 3:return sr(At),Ft(),o=i.flags,o&65536&&!(o&128)?(i.flags=o&-65537|128,i):null;case 26:case 27:case 5:return nn(i),null;case 31:if(i.memoizedState!==null){if(Cn(i),i.alternate===null)throw Error(a(340));Pi()}return o=i.flags,o&65536?(i.flags=o&-65537|128,i):null;case 13:if(Cn(i),o=i.memoizedState,o!==null&&o.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Pi()}return o=i.flags,o&65536?(i.flags=o&-65537|128,i):null;case 19:return kp(i),o=i.flags,o&65536?(i.flags=o&-65537|128,o=i.memoizedState,o!==null&&(o.rendering=null,o.tail=null),i.flags|=4,i):null;case 4:return Ft(),null;case 10:return sr(i.type),null;case 22:case 23:return Cn(i),xp(),o!==null&&Ie(zi),o=i.flags,o&65536?(i.flags=o&-65537|128,i):null;case 24:return sr(At),null;case 25:return null;default:return null}}function jx(o,i){switch(ap(i),i.tag){case 3:sr(At),Ft();break;case 26:case 27:case 5:nn(i);break;case 4:Ft();break;case 31:i.memoizedState!==null&&Cn(i);break;case 13:Cn(i);break;case 19:kp(i);break;case 10:sr(i.type);break;case 22:case 23:Cn(i),xp(),o!==null&&Ie(zi);break;case 24:sr(At)}}function Ll(o,i){try{var d=i.updateQueue,u=d===null?null:d.lastEffect;if(u!==null){var y=u.next;d=y;do{if((d.tag&o)===o){u=void 0;var x=d.create,C=d.inst;u=x(),C.destroy=u}d=d.next}while(d!==y)}}catch(P){at(i,i.return,P)}}function Zr(o,i,d){try{var u=i.updateQueue,y=u===null?null:u.lastEffect;if(y!==null){var x=y.next;u=x;do{if((u.tag&o)===o){var C=u.inst,P=C.destroy;if(P!==void 0){C.destroy=void 0,y=i;var H=d,ie=P;try{ie()}catch(ce){at(y,H,ce)}}}u=u.next}while(u!==x)}}catch(ce){at(i,i.return,ce)}}function Cx(o){var i=o.updateQueue;if(i!==null){var d=o.stateNode;try{vb(i,d)}catch(u){at(o,o.return,u)}}}function Ex(o,i,d){d.props=Wi(o.type,o.memoizedProps),d.state=o.memoizedState;try{d.componentWillUnmount()}catch(u){at(o,i,u)}}function No(o,i){try{var d=o.ref;if(d!==null){switch(o.tag){case 26:case 27:case 5:var u=o.stateNode;break;case 30:var y=o.stateNode,x=nr(o.memoizedProps,y);(y.ref===null||y.ref.name!==x)&&(y.ref=Lw(x)),u=y.ref;break;case 7:if(o.stateNode===null){var C=new Tn(o);m(o.child,!1,TT,C,void 0,void 0),o.stateNode=C}u=o.stateNode;break;default:u=o.stateNode}typeof d=="function"?o.refCleanup=d(u):d.current=u}}catch(P){at(o,i,P)}}function en(o,i){var d=o.ref,u=o.refCleanup;if(d!==null)if(typeof u=="function")try{u()}catch(y){at(o,i,y)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(y){at(o,i,y)}else d.current=null}function nc(o,i){if((o.tag===5||o.tag===27||o.tag===6)&&o.alternate===null&&i!==null)for(var d=0;d<i.length;d++)qw(o.stateNode,i[d])}function $x(o){for(var i=o.return;i!==null&&(Jp(i)&&qw(o.stateNode,i.stateNode),!Qp(i));)i=i.return}function Il(o){for(var i=o.return;i!==null&&(Jp(i)&&AT(o.stateNode,i.stateNode),!Qp(i));)i=i.return}function Qp(o){return o.tag===5||o.tag===3||o.tag===27}function Jp(o){return o&&o.tag===7&&o.stateNode!==null}function em(o){var i=o.type,d=o.memoizedProps,u=o.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":d.autoFocus&&u.focus();break e;case"img":d.src?u.src=d.src:d.srcSet&&(u.srcset=d.srcSet)}}catch(y){at(o,o.return,y)}}function tm(o,i,d){try{var u=o.stateNode;fT(u,o.type,d,i),u[Ae]=i}catch(y){at(o,o.return,y)}}function _x(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&oi(o.type)||o.tag===4}function nm(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||_x(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&oi(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function om(o,i,d,u){var y=o.tag;if(y===5||y===6)y=o.stateNode,i?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(y,i):(i=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,i.appendChild(y),d=d._reactRootContainer,d!=null||i.onclick!==null||(i.onclick=wo)),nc(o,u),tt=!0;else if(y!==4&&(y===27&&(nc(o,u),u=null,oi(o.type)&&(d=o.stateNode,i=null)),o=o.child,o!==null))for(om(o,i,d,u),o=o.sibling;o!==null;)om(o,i,d,u),o=o.sibling}function oc(o,i,d,u){var y=o.tag;if(y===5||y===6)y=o.stateNode,i?d.insertBefore(y,i):d.appendChild(y),nc(o,u),tt=!0;else if(y!==4&&(y===27&&(nc(o,u),u=null,oi(o.type)&&(d=o.stateNode)),o=o.child,o!==null))for(oc(o,i,d,u),o=o.sibling;o!==null;)oc(o,i,d,u),o=o.sibling}function Tx(o){var i=o.stateNode,d=o.memoizedProps;try{for(var u=o.type,y=i.attributes;y.length;)i.removeAttributeNode(y[0]);tn(i,u,d),i[ke]=o,i[Ae]=d}catch(x){at(o,o.return,x)}}var rc=!1,En=null;function Ax(o){(o.tag===30||o.subtreeFlags&33554432)&&(rc=!0)}var jo=null;function Mx(){var o=jo;return jo=null,o}var yn=0;function Ja(o,i,d,u,y){return yn=0,Ox(o.child,i,d,u,y)}function Ox(o,i,d,u,y){for(var x=!1;o!==null;){if(o.tag===5){var C=o.stateNode;if(u!==null){var P=zm(C);u.push(P),P.view&&(x=!0)}else x||zm(C).view&&(x=!0);rc=!0,Ow(C,yn===0?i:i+"_"+yn,d),yn++}else o.tag===22&&o.memoizedState!==null||o.tag===30&&y||Ox(o.child,i,d,u,y)&&(x=!0);o=o.sibling}return x}function Co(o,i){for(;o!==null;)o.tag===5?Pw(o.stateNode,o.memoizedProps):o.tag===22&&o.memoizedState!==null||o.tag===30&&i||Co(o.child,i),o=o.sibling}function ic(o){if(o.subtreeFlags&18874368)for(o=o.child;o!==null;){if((o.tag!==22||o.memoizedState===null)&&(ic(o),o.tag===30&&o.flags&18874368&&o.stateNode.paired)){var i=o.memoizedProps;if(i.name==null||i.name==="auto")throw Error(a(544));var d=i.name;i=or(i.default,i.share),i!=="none"&&(Ja(o,d,i,null,!1)||Co(o.child,!1))}o=o.sibling}}function rm(o,i){if(o.tag===30){var d=o.stateNode,u=o.memoizedProps,y=nr(u,d),x=or(u.default,d.paired?u.share:u.enter);x==="none"?ic(o):Ja(o,y,x,null,!1)?(ic(o),d.paired||i||ss(o,u.onEnter)):Co(o.child,!1)}else if(o.subtreeFlags&33554432)for(o=o.child;o!==null;)rm(o,i),o=o.sibling;else ic(o)}function im(o){if(En!==null&&En.size!==0){var i=En;if(o.subtreeFlags&18874368)for(o=o.child;o!==null;){if(o.tag!==22||o.memoizedState===null){if(o.tag===30&&o.flags&18874368){var d=o.memoizedProps,u=d.name;if(u!=null&&u!=="auto"){var y=i.get(u);if(y!==void 0){var x=or(d.default,d.share);if(x!=="none"&&(Ja(o,u,x,null,!1)?(x=o.stateNode,y.paired=x,x.paired=y,ss(o,d.onShare)):Co(o.child,!1)),i.delete(u),i.size===0)break}}}im(o)}o=o.sibling}}}function am(o){if(o.tag===30){var i=o.memoizedProps,d=nr(i,o.stateNode),u=En===null?void 0:En.get(d),y=or(i.default,u===void 0?i.exit:i.share);y!=="none"&&(Ja(o,d,y,null,!1)?u===void 0?ss(o,i.onExit):(y=o.stateNode,u.paired=y,y.paired=u,En.delete(d),ss(o,i.onShare)):Co(o.child,!1)),En!==null&&im(o)}else if(o.subtreeFlags&33554432)for(o=o.child;o!==null;)am(o),o=o.sibling;else En!==null&&im(o)}function Px(o){for(o=o.child;o!==null;){if(o.tag===30){var i=o.memoizedProps,d=nr(i,o.stateNode);i=or(i.default,i.update),o.flags&=-5,i!=="none"&&Ja(o,d,i,o.memoizedState=[],!1)}else o.subtreeFlags&33554432&&Px(o);o=o.sibling}}function sm(o){if(o.subtreeFlags&18874368)for(o=o.child;o!==null;){if(o.tag!==22||o.memoizedState===null){if(o.tag===30&&o.flags&18874368){var i=o.stateNode;i.paired!==null&&(i.paired=null,Co(o.child,!1))}sm(o)}o=o.sibling}}function ac(o){if(o.tag===30)o.stateNode.paired=null,Co(o.child,!1),sm(o);else if(o.subtreeFlags&33554432)for(o=o.child;o!==null;)ac(o),o=o.sibling;else sm(o)}function Dx(o){for(o=o.child;o!==null;)o.tag===30?Co(o.child,!1):o.subtreeFlags&33554432&&Dx(o),o=o.sibling}function lm(o,i,d,u,y,x,C){for(var P=!1;i!==null;){if(i.tag===5){var H=i.stateNode;if(x!==null&&yn<x.length){var ie=x[yn],ce=zm(H);(ie.view||ce.view)&&(P=!0);var ye;if(ye=!(o.flags&4))if(ce.clip)ye=!0;else{ye=ie.rect;var te=ce.rect;ye=ye.y!==te.y||ye.x!==te.x||ye.height!==te.height||ye.width!==te.width}ye&&(o.flags|=4),ce.abs?ce=!ie.abs:(ie=ie.rect,ce=ce.rect,ce=ie.height!==ce.height||ie.width!==ce.width),ce&&(o.flags|=32)}else o.flags|=32;o.flags&4&&Ow(H,yn===0?d:d+"_"+yn,y),P&&o.flags&4||(jo===null&&(jo=[]),jo.push(H,yn===0?u:u+"_"+yn,i.memoizedProps)),yn++}else(i.tag!==22||i.memoizedState===null)&&(i.tag===30&&C?o.flags|=i.flags&32:lm(o,i.child,d,u,y,x,C)&&(P=!0));i=i.sibling}return P}function Lx(o,i){for(o=o.child;o!==null;){if(o.tag===30){var d=o.memoizedProps,u=o.stateNode,y=nr(d,u),x=or(d.default,d.update);if(i){u=u.clones;var C=u===null?null:u.map(vT)}else C=o.memoizedState,o.memoizedState=null;u=o;var P=o.child;yn=0,y=lm(u,P,y,y,x,C,!1),o.flags&4&&y&&(i||ss(o,d.onUpdate))}else o.subtreeFlags&33554432&&Lx(o,i);o=o.sibling}}var Kt=!1,ot=!1,Eo=!1,dm=!1,Ix=typeof WeakSet=="function"?WeakSet:Set,Wt=null,$o=!1,Rl=!1,sc=!1,um=!1;function H2(o,i,d){if(o=o.containerInfo,Pm=ys,o=Vv(o),Zh(o)){if("selectionStart"in o)var u={start:o.selectionStart,end:o.selectionEnd};else e:{u=(u=o.ownerDocument)&&u.defaultView||window;var y=u.getSelection&&u.getSelection();if(y&&y.rangeCount!==0){u=y.anchorNode;var x=y.anchorOffset,C=y.focusNode;y=y.focusOffset;try{u.nodeType,C.nodeType}catch{u=null;break e}var P=0,H=-1,ie=-1,ce=0,ye=0,te=o,ue=null;t:for(;;){for(var Se;te!==u||x!==0&&te.nodeType!==3||(H=P+x),te!==C||y!==0&&te.nodeType!==3||(ie=P+y),te.nodeType===3&&(P+=te.nodeValue.length),(Se=te.firstChild)!==null;)ue=te,te=Se;for(;;){if(te===o)break t;if(ue===u&&++ce===x&&(H=P),ue===C&&++ye===y&&(ie=P),(Se=te.nextSibling)!==null)break;te=ue,ue=te.parentNode}te=Se}u=H===-1||ie===-1?null:{start:H,end:ie}}else u=null}u||={start:0,end:0}}else u=null;for(Dm={focusedElem:o,selectionRange:u},ys=!1,d=(d&335544064)===d,Wt=i,i=d?9270:1024;Wt!==null;){if(o=Wt,d&&(u=o.deletions,u!==null))for(x=0;x<u.length;x++)d&&am(u[x]);if(o.alternate===null&&o.flags&2)d&&Ax(o),lc(d);else{if(o.tag===22){if(u=o.alternate,o.memoizedState!==null){u!==null&&u.memoizedState===null&&d&&am(u),lc(d);continue}if(u!==null&&u.memoizedState!==null){d&&Ax(o),lc(d);continue}}u=o.child,(o.subtreeFlags&i)!==0&&u!==null?(u.return=o,Wt=u):(d&&Px(o),lc(d))}}En=null}function lc(o){for(;Wt!==null;){var i=Wt,d=o,u=i.alternate,y=i.flags;switch(i.tag){case 0:case 11:case 15:break;case 1:if(y&1024&&u!==null){d=void 0,y=u.memoizedProps,u=u.memoizedState;var x=i.stateNode;try{var C=Wi(i.type,y);d=x.getSnapshotBeforeUpdate(C,u),x.__reactInternalSnapshotBeforeUpdate=d}catch(P){at(i,i.return,P)}}break;case 3:if(y&1024){if(u=i.stateNode.containerInfo,d=u.nodeType,d===9)qm(u);else if(d===1)switch(u.nodeName){case"HEAD":case"HTML":case"BODY":qm(u);break;default:u.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:d&&u!==null&&(d=nr(u.memoizedProps,u.stateNode),y=i.memoizedProps,y=or(y.default,y.update),y!=="none"&&Ja(u,d,y,u.memoizedState=[],!0));break;default:if(y&1024)throw Error(a(163))}if(u=i.sibling,u!==null){u.return=i.return,Wt=u;break}Wt=i.return}}function Rx(o,i,d){var u=d.flags;switch(d.tag){case 0:case 11:case 15:_o(o,d),u&4&&Ll(5,d);break;case 1:if(_o(o,d),u&4)if(o=d.stateNode,i===null)try{o.componentDidMount()}catch(C){at(d,d.return,C)}else{var y=Wi(d.type,i.memoizedProps);i=i.memoizedState;try{o.componentDidUpdate(y,i,o.__reactInternalSnapshotBeforeUpdate)}catch(C){at(d,d.return,C)}}u&64&&Cx(d),u&512&&No(d,d.return);break;case 3:if(_o(o,d),u&64&&(o=d.updateQueue,o!==null)){if(i=null,d.child!==null)switch(d.child.tag){case 27:case 5:i=d.child.stateNode;break;case 1:i=d.child.stateNode}try{vb(o,i)}catch(C){at(d,d.return,C)}}break;case 27:i===null&&u&4&&Tx(d);case 26:case 5:_o(o,d),i===null&&u&4&&em(d),u&512&&No(d,d.return);break;case 12:_o(o,d);break;case 31:_o(o,d),u&4&&qx(o,d);break;case 13:_o(o,d),u&4&&Hx(o,d),u&64&&(o=d.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(d=tT.bind(null,d),PT(o,d))));break;case 22:if(u=d.memoizedState!==null||Kt,!u){var x=i!==null&&i.memoizedState!==null||ot;i=Kt,y=ot,Kt=u,(ot=x)&&!y?(u=2,d.subtreeFlags&8772&&(u|=1),oo(o,d,u)):_o(o,d),Kt=i,ot=y}break;case 30:_o(o,d),u&512&&No(d,d.return);break;case 7:u&512&&No(d,d.return);default:_o(o,d)}}function cm(o,i){for(o=o.child;o!==null;)zx(o,i),o=o.sibling}function zx(o,i){switch(o.tag){case 5:case 26:try{var d=o.stateNode;if(i){var u=d.style;typeof u.setProperty=="function"?u.setProperty("display","none","important"):u.display="none"}else{var y=o.stateNode,x=o.memoizedProps.style,C=x!=null&&x.hasOwnProperty("display")?x.display:null;y.style.display=C==null||typeof C=="boolean"?"":(""+C).trim()}}catch(H){at(o,o.return,H)}fm(o,i);break;case 6:try{o.stateNode.nodeValue=i?"":o.memoizedProps,tt=!0}catch(H){at(o,o.return,H)}break;case 18:try{var P=o.stateNode;i?Mw(P,!0):Mw(o.stateNode,!1)}catch(H){at(o,o.return,H)}break;case 22:case 23:o.memoizedState===null&&cm(o,i);break;default:cm(o,i)}}function fm(o,i){if(o.subtreeFlags&67108864)for(o=o.child;o!==null;){e:{var d=o,u=i;switch(d.tag){case 4:zx(d,u);break e;case 22:d.memoizedState===null&&fm(d,u);break e;default:fm(d,u)}}o=o.sibling}}function Fx(o){var i=o.alternate;i!==null&&(o.alternate=null,Fx(i)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(i=o.stateNode,i!==null&&xo(i)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var gt=null,vn=!1;function to(o,i,d){for(d=d.child;d!==null;)Bx(o,i,d),d=d.sibling}function Bx(o,i,d){if(jt&&typeof jt.onCommitFiberUnmount=="function")try{jt.onCommitFiberUnmount(Dn,d)}catch{}switch(d.tag){case 26:ot||en(d,i),to(o,i,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&!ot&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:ot||en(d,i),Il(d);var u=gt,y=vn;oi(d.type)&&(gt=d.stateNode,vn=!1),to(o,i,d),Uw(d.stateNode,d.type,d.memoizedProps),gt=u,vn=y;break;case 5:ot||en(d,i),Il(d);case 6:if(d.tag===6&&Il(d),u=gt,y=vn,gt=null,to(o,i,d),gt=u,vn=y,gt!==null)if(vn)try{(gt.nodeType===9?gt.body:gt.nodeName==="HTML"?gt.ownerDocument.body:gt).removeChild(d.stateNode),tt=!0}catch(x){at(d,i,x)}else try{gt.removeChild(d.stateNode),tt=!0}catch(x){at(d,i,x)}break;case 18:gt!==null&&(vn?(o=gt,Aw(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,d.stateNode),vs(o)):Aw(gt,d.stateNode));break;case 4:u=gt,y=vn,gt=d.stateNode.containerInfo,vn=!0,to(o,i,d),gt=u,vn=y;break;case 0:case 11:case 14:case 15:Zr(2,d,i),ot||Zr(4,d,i),to(o,i,d);break;case 1:ot||(en(d,i),u=d.stateNode,typeof u.componentWillUnmount=="function"&&Ex(d,i,u)),to(o,i,d);break;case 21:to(o,i,d);break;case 22:ot=(u=ot)||d.memoizedState!==null,to(o,i,d),ot=u;break;case 30:en(d,i),to(o,i,d);break;case 7:ot||en(d,i),to(o,i,d);break;default:to(o,i,d)}}function qx(o,i){if(i.memoizedState===null&&(o=i.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{vs(o)}catch(d){at(i,i.return,d)}}}function Hx(o,i){if(i.memoizedState===null&&(o=i.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{vs(o)}catch(d){at(i,i.return,d)}}function V2(o){switch(o.tag){case 31:case 13:case 19:var i=o.stateNode;return i===null&&(i=o.stateNode=new Ix),i;case 22:return o=o.stateNode,i=o._retryCache,i===null&&(i=o._retryCache=new Ix),i;default:throw Error(a(435,o.tag))}}function dc(o,i){var d=V2(o);i.forEach(function(u){if(!d.has(u)){d.add(u);var y=nT.bind(null,o,u);u.then(y,y)}})}function dn(o,i,d){var u=i.deletions;if(u!==null)for(var y=0;y<u.length;y++){var x=u[y],C=o,P=i,H=P;e:for(;H!==null;){switch(H.tag){case 27:if(oi(H.type)){gt=H.stateNode,vn=!1;break e}break;case 5:gt=H.stateNode,vn=!1;break e;case 3:case 4:gt=H.stateNode.containerInfo,vn=!0;break e}H=H.return}if(gt===null)throw Error(a(160));Bx(C,P,x),gt=null,vn=!1,C=x.alternate,C!==null&&(C.return=null),x.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Vx(i,o,d),i=i.sibling}var no=null;function Vx(o,i,d){var u=o.alternate,y=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(y&4&&(u=o.updateQueue,u=u===null?null:u.events,u!==null))for(var x=0;x<u.length;x++){var C=u[x];C.ref.impl=C.nextImpl}dn(i,o,d),un(o),y&4&&(Zr(3,o,o.return),Ll(3,o),Zr(5,o,o.return));break;case 1:dn(i,o,d),un(o),y&512&&(ot||u===null||en(u,u.return)),y&64&&Kt&&(o=o.updateQueue,o!==null&&(i=o.callbacks,i!==null&&(d=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=d===null?i:d.concat(i))));break;case 26:if(x=no,dn(i,o,d),un(o),y&512&&(ot||u===null||en(u,u.return)),y&4)if(y=u===null?null:u.memoizedState,d=o.memoizedState,u===null)if(d===null)if(o.stateNode===null)if(Kt)o.stateNode=$w(o.type,o.memoizedProps,i.containerInfo,o);else{e:{i=o.type,d=o.memoizedProps,y=x.ownerDocument||x;t:switch(i){case"title":u=y.getElementsByTagName("title")[0],(!u||u[Ht]||u[ke]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=y.createElement(i),y.head.insertBefore(u,y.querySelector("head > title"))),tn(u,i,d),u[ke]=o,Ct(u),i=u;break e;case"link":if(x=Jw("link","href",y).get(i+(d.href||""))){for(C=0;C<x.length;C++)if(u=x[C],u.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&u.getAttribute("rel")===(d.rel==null?null:d.rel)&&u.getAttribute("title")===(d.title==null?null:d.title)&&u.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){x.splice(C,1);break t}}u=y.createElement(i),tn(u,i,d),y.head.appendChild(u);break;case"meta":if(x=Jw("meta","content",y).get(i+(d.content||""))){for(C=0;C<x.length;C++)if(u=x[C],u.getAttribute("content")===(d.content==null?null:""+d.content)&&u.getAttribute("name")===(d.name==null?null:d.name)&&u.getAttribute("property")===(d.property==null?null:d.property)&&u.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&u.getAttribute("charset")===(d.charSet==null?null:d.charSet)){x.splice(C,1);break t}}u=y.createElement(i),tn(u,i,d),y.head.appendChild(u);break;default:throw Error(a(468,i))}u[ke]=o,Ct(u),i=u}o.stateNode=i}else Kt||Xm(x,o.type,o.stateNode);else o.stateNode=Qw(x,d,o.memoizedProps);else y===d?d===null&&o.stateNode!==null&&tm(o,o.memoizedProps,u.memoizedProps):(y===null?(i=u.stateNode,i===null||ot||i.parentNode.removeChild(i)):y.count--,d===null?Kt||Xm(x,o.type,o.stateNode):Qw(x,d,o.memoizedProps));break;case 27:dn(i,o,d),un(o),y&512&&(ot||u===null||en(u,u.return)),u!==null&&y&4&&tm(o,o.memoizedProps,u.memoizedProps);break;case 5:if(x=Eo,Eo=!1,dn(i,o,d),Eo=x,un(o),y&512&&(ot||u===null||en(u,u.return)),o.flags&32){i=o.stateNode;try{Da(i,""),tt=!0}catch(ce){at(o,o.return,ce)}}y&4&&o.stateNode!=null&&(i=o.memoizedProps,tm(o,i,u===null?i:u.memoizedProps)),y&1024&&(dm=!0);break;case 6:if(dn(i,o,d),un(o),y&4){if(o.stateNode===null)throw Error(a(162));i=o.memoizedProps,d=o.stateNode;try{d.nodeValue=i,tt=!0}catch(ce){at(o,o.return,ce)}}break;case 3:if(tt=!1,Nc=null,x=no,no=Ul(i.containerInfo),dn(i,o,d),no=x,un(o),y&4&&u!==null&&u.memoizedState.isDehydrated)try{vs(i.containerInfo)}catch(ce){at(o,o.return,ce)}dm&&(dm=!1,Kx(o)),tt=!1;break;case 4:y=Eo,Eo=Kt,u=pv(),x=no,no=Ul(o.stateNode.containerInfo),dn(i,o,d),un(o),no=x,tt&&Rl&&(sc=!0),tt=u,Eo=y;break;case 12:dn(i,o,d),un(o);break;case 31:dn(i,o,d),un(o),y&4&&(i=o.updateQueue,i!==null&&(o.updateQueue=null,dc(o,i)));break;case 13:dn(i,o,d),un(o),o.child.flags&8192&&o.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(fc=Xt()),y&4&&(i=o.updateQueue,i!==null&&(o.updateQueue=null,dc(o,i)));break;case 22:x=o.memoizedState!==null,C=u!==null&&u.memoizedState!==null;var P=Kt,H=ot,ie=Eo;Kt=P||x,Eo=ie||x,ot=H||C,dn(i,o,d),ot=H,Eo=ie,Kt=P,un(o),y&8192&&(i=o.stateNode,i._visibility=x?i._visibility&-2:i._visibility|1,!x||u===null||C||Kt||ot||(i=C||ot,d=Kt,u=ot,Kt=x||Kt,ot=i,Gr(o,2),Kt=d,ot=u),!x&&Eo||cm(o,x)),y&4&&(i=o.updateQueue,i!==null&&(d=i.retryQueue,d!==null&&(i.retryQueue=null,dc(o,d))));break;case 19:dn(i,o,d),un(o),y&4&&(i=o.updateQueue,i!==null&&(o.updateQueue=null,dc(o,i)));break;case 30:y&512&&(ot||u===null||en(u,u.return)),y=pv(),x=Rl,C=(d&335544064)===d,P=o.memoizedProps,Rl=C&&or(P.default,P.update)!=="none",dn(i,o,d),un(o),C&&u!==null&&tt&&(o.flags|=4),Rl=x,tt=y;break;case 21:break;case 7:y&512&&(ot||u===null||en(u,u.return)),u&&u.stateNode!==null&&(u.stateNode._fragmentFiber=o);default:dn(i,o,d),un(o)}}function un(o){var i=o.flags;if(i&2){try{for(var d,u=o.return;u!==null;){if(_x(u)){d=u;break}u=u.return}u=null;for(var y=o.return;y!==null;){if(Jp(y)){var x=y.stateNode;u===null?u=[x]:u.push(x)}if(Qp(y))break;y=y.return}var C=u;if(d==null)throw Error(a(160));switch(d.tag){case 27:var P=d.stateNode;oc(o,nm(o),P,C);break;case 5:var H=d.stateNode;d.flags&32&&(Da(H,""),d.flags&=-33),oc(o,nm(o),H,C);break;case 3:case 4:var ie=d.stateNode.containerInfo;om(o,nm(o),ie,C);break;default:throw Error(a(161))}}catch(ce){at(o,o.return,ce)}o.flags&=-3}i&4096&&(o.flags&=-4097)}function Kx(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var i=o;Kx(i),i.tag===5&&i.flags&1024&&(i=i.stateNode,ys=!0,i.reset(),ys=!1),o=o.sibling}}function es(o,i){if(i.subtreeFlags&9270)for(i=i.child;i!==null;)Wx(i,o),i=i.sibling;else Lx(i,!1)}function Wx(o,i){var d=o.alternate;if(d===null)rm(o,!1);else switch(o.tag){case 3:if(um=$o=!1,Mx(),es(i,o),!$o&&!sc){if(o=jo,o!==null)for(var u=0;u<o.length;u+=3){d=o[u];var y=o[u+1];Pw(d,o[u+2]),d=d.ownerDocument.documentElement,d!==null&&d.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+y+")"})}o=i.containerInfo,o=o.nodeType===9?o.documentElement:o.ownerDocument.documentElement,o!==null&&o.style.viewTransitionName===""&&(o.style.viewTransitionName="none",o.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),o.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),um=!0}jo=null;break;case 5:es(i,o);break;case 4:u=$o,$o=!1,es(i,o),$o&&(sc=!0),$o=u;break;case 22:o.memoizedState===null&&(d.memoizedState===null?es(i,o):rm(o,!1));break;case 30:u=$o,y=Mx(),$o=!1,es(i,o),$o&&(o.flags|=4);var x=o.memoizedProps,C=o.stateNode;i=nr(x,C),C=nr(d.memoizedProps,C);var P=or(x.default,x.update);P==="none"?i=!1:(x=d.memoizedState,d.memoizedState=null,d=o.child,yn=0,i=lm(o,d,i,C,P,x,!0),yn!==(x===null?0:x.length)&&(o.flags|=32)),o.flags&4&&i?(ss(o,o.memoizedProps.onUpdate),jo=y):y!==null&&(y.push.apply(y,jo),jo=y),$o=o.flags&32?!0:u;break;default:es(i,o)}}function _o(o,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Rx(o,i.alternate,i),i=i.sibling}function Gr(o,i){for(o=o.child;o!==null;){var d=o,u=i;switch(d.tag){case 0:case 11:case 14:case 15:Zr(4,d,d.return),Gr(d,u);break;case 1:en(d,d.return);var y=d.stateNode;typeof y.componentWillUnmount=="function"&&Ex(d,d.return,y),Gr(d,u);break;case 27:u&2&&Uw(d.stateNode,d.type,d.memoizedProps);case 5:en(d,d.return),d.tag!==5&&d.tag!==27||Il(d),Gr(d,u);break;case 6:Il(d);break;case 26:en(d,d.return),y=d.stateNode,d.memoizedState!==null||y===null||ot||y.parentNode.removeChild(y),Gr(d,u);break;case 22:d.memoizedState===null&&Gr(d,u);break;case 30:en(d,d.return),Gr(d,u);break;case 7:en(d,d.return);default:Gr(d,u)}o=o.sibling}}function oo(o,i,d){for(d=i.subtreeFlags&8772?d:d&-2,i=i.child;i!==null;){var u=i.alternate,y=o,x=i,C=x.flags,P=!!(d&1);switch(x.tag){case 0:case 11:case 15:oo(y,x,d),Ll(4,x);break;case 1:if(oo(y,x,d),u=x,y=u.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(ce){at(u,u.return,ce)}if(u=x,y=u.updateQueue,y!==null){var H=u.stateNode;try{var ie=y.shared.hiddenCallbacks;if(ie!==null)for(y.shared.hiddenCallbacks=null,y=0;y<ie.length;y++)yb(ie[y],H)}catch(ce){at(u,u.return,ce)}}P&&C&64&&Cx(x),No(x,x.return);break;case 27:d&2&&Tx(x);case 5:x.tag!==5&&x.tag!==27||$x(x),oo(y,x,d),P&&u===null&&C&4&&em(x),No(x,x.return);break;case 6:$x(x);break;case 26:H=x.stateNode,x.memoizedState!==null||H===null||Kt||Xm(Ul(H.ownerDocument),x.type,H),oo(y,x,d),P&&u===null&&C&4&&em(x),No(x,x.return);break;case 12:oo(y,x,d);break;case 31:oo(y,x,d),P&&C&4&&qx(y,x);break;case 13:oo(y,x,d),P&&C&4&&Hx(y,x);break;case 22:x.memoizedState===null&&oo(y,x,d),No(x,x.return);break;case 30:oo(y,x,d),No(x,x.return);break;case 7:No(x,x.return);default:oo(y,x,d)}i=i.sibling}}function hm(o,i){var d=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==d&&(o!=null&&o.refCount++,d!=null&&Sl(d))}function pm(o,i){o=null,i.alternate!==null&&(o=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==o&&(i.refCount++,o!=null&&Sl(o))}function qn(o,i,d,u){var y=(d&335544064)===d;if(i.subtreeFlags&(y?10262:10256))for(i=i.child;i!==null;)Ux(o,i,d,u),i=i.sibling;else y&&Dx(i)}function Ux(o,i,d,u){var y=(d&335544064)===d;y&&i.alternate===null&&i.return!==null&&i.return.alternate!==null&&ac(i);var x=i.flags;switch(i.tag){case 0:case 11:case 15:qn(o,i,d,u),x&2048&&Ll(9,i);break;case 1:qn(o,i,d,u);break;case 3:qn(o,i,d,u),y&&um&&(o=o.containerInfo,o=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,o.style.viewTransitionName==="root"&&(o.style.viewTransitionName=""),o=o.ownerDocument.documentElement,o!==null&&o.style.viewTransitionName==="none"&&(o.style.viewTransitionName="")),x&2048&&(x=null,i.alternate!==null&&(x=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==x&&(i.refCount++,x!=null&&Sl(x)));break;case 12:if(x&2048){qn(o,i,d,u),x=i.stateNode;try{var C=i.memoizedProps,P=C.id,H=C.onPostCommit;typeof H=="function"&&H(P,i.alternate===null?"mount":"update",x.passiveEffectDuration,-0)}catch(ie){at(i,i.return,ie)}}else qn(o,i,d,u);break;case 31:qn(o,i,d,u);break;case 13:qn(o,i,d,u);break;case 23:break;case 22:C=i.stateNode,P=i.alternate,i.memoizedState===null?(y&&P!==null&&P.memoizedState!==null&&ac(i),C._visibility&2?qn(o,i,d,u):(C._visibility|=2,ts(o,i,d,u,!!(i.subtreeFlags&10256)||!1))):(y&&P!==null&&P.memoizedState===null&&ac(P),C._visibility&2?qn(o,i,d,u):zl(o,i)),x&2048&&hm(P,i);break;case 24:qn(o,i,d,u),x&2048&&pm(i.alternate,i);break;case 30:y&&(x=i.alternate,x!==null&&(Co(x.child,!0),Co(i.child,!0))),qn(o,i,d,u);break;default:qn(o,i,d,u)}}function ts(o,i,d,u,y){for(y&&=!!(i.subtreeFlags&10256)||!1,i=i.child;i!==null;){var x=o,C=i,P=d,H=u,ie=C.flags;switch(C.tag){case 0:case 11:case 15:ts(x,C,P,H,y),Ll(8,C);break;case 23:break;case 22:var ce=C.stateNode;C.memoizedState===null?(ce._visibility|=2,ts(x,C,P,H,y)):ce._visibility&2?ts(x,C,P,H,y):zl(x,C),y&&ie&2048&&hm(C.alternate,C);break;case 24:ts(x,C,P,H,y),y&&ie&2048&&pm(C.alternate,C);break;default:ts(x,C,P,H,y)}i=i.sibling}}function zl(o,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var d=o,u=i,y=u.flags;switch(u.tag){case 22:zl(d,u),y&2048&&hm(u.alternate,u);break;case 24:zl(d,u),y&2048&&pm(u.alternate,u);break;default:zl(d,u)}i=i.sibling}}var Ui=8192;function Yi(o,i,d){if(o.subtreeFlags&Ui)for(o=o.child;o!==null;)Yx(o,i,d),o=o.sibling}function Yx(o,i,d){switch(o.tag){case 26:Yi(o,i,d),o.flags&Ui&&(o.memoizedState===null?(o=o.stateNode,(i&335544128)===i&&ok(d,o)):YT(d,no,o.memoizedState,o.memoizedProps));break;case 5:Yi(o,i,d),o.flags&Ui&&(o=o.stateNode,(i&335544128)===i&&ok(d,o));break;case 3:case 4:var u=no;no=Ul(o.stateNode.containerInfo),Yi(o,i,d),no=u;break;case 22:o.memoizedState===null&&(u=o.alternate,u!==null&&u.memoizedState!==null?(u=Ui,Ui=16777216,Yi(o,i,d),Ui=u):Yi(o,i,d));break;case 30:if((o.flags&Ui)!==0&&(u=o.memoizedProps.name,u!=null&&u!=="auto")){var y=o.stateNode;y.paired=null,En===null&&(En=new Map),En.set(u,y)}Yi(o,i,d);break;default:Yi(o,i,d)}}function Xx(o){var i=o.alternate;if(i!==null&&(o=i.child,o!==null)){i.child=null;do i=o.sibling,o.sibling=null,o=i;while(o!==null)}}function Fl(o){var i=o.deletions;if(o.flags&16){if(i!==null)for(var d=0;d<i.length;d++){var u=i[d];Wt=u,Gx(u,o)}Xx(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)Zx(o),o=o.sibling}function Zx(o){switch(o.tag){case 0:case 11:case 15:Fl(o),o.flags&2048&&Zr(9,o,o.return);break;case 3:Fl(o);break;case 12:Fl(o);break;case 22:var i=o.stateNode;o.memoizedState!==null&&i._visibility&2&&(o.return===null||o.return.tag!==13)?(i._visibility&=-3,uc(o)):Fl(o);break;default:Fl(o)}}function uc(o){var i=o.deletions;if(o.flags&16){if(i!==null)for(var d=0;d<i.length;d++){var u=i[d];Wt=u,Gx(u,o)}Xx(o)}for(o=o.child;o!==null;){switch(i=o,i.tag){case 0:case 11:case 15:Zr(8,i,i.return),uc(i);break;case 22:d=i.stateNode,d._visibility&2&&(d._visibility&=-3,uc(i));break;default:uc(i)}o=o.sibling}}function Gx(o,i){for(;Wt!==null;){var d=Wt;switch(d.tag){case 0:case 11:case 15:Zr(8,d,i);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var u=d.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Sl(d.memoizedState.cache)}if(u=d.child,u!==null)u.return=d,Wt=u;else e:for(d=o;Wt!==null;){u=Wt;var y=u.sibling,x=u.return;if(Fx(u),u===d){Wt=null;break e}if(y!==null){y.return=x,Wt=y;break e}Wt=x}}}var K2={getCacheForType:function(o){var i=Gt(At),d=i.data.get(o);return d===void 0&&(d=o(),i.data.set(o,d)),d},cacheSignal:function(){return Gt(At).controller.signal}},W2=typeof WeakMap=="function"?WeakMap:Map,nt=0,ct=null,Ze=null,Qe=0,it=0,$n=null,Qr=!1,ns=!1,mm=!1,fr=0,Nt=0,Jr=0,Xi=0,cc=0,_n=0,os=0,Bl=null,bn=null,gm=!1,fc=0,Qx=0,hc=1/0,pc=null,ei=null,wt=0,ro=null,Zi=null,To=0,ym=0,vm=null,Jx=null,rs=null,is=null,as=null,ql=0,mc=null;function Hn(){return nt&2&&Qe!==0?Qe&-Qe:ee.T===null?G():$m()}function ew(){if(_n===0)if(!(Qe&536870912)||We){var o=bo;bo<<=1,!(bo&3932160)&&(bo=262144),_n=o}else _n=536870912;return o=Qt.current,o!==null&&(o.flags|=32),_n}function ss(o,i){if(i!=null){var d=o.stateNode,u=d.ref;u===null&&(u=d.ref=Lw(nr(o.memoizedProps,d))),is===null&&(is=[]),is.push(i.bind(null,u))}}function xn(o,i,d){(o===ct&&(it===2||it===9)||o.cancelPendingCommit!==null)&&(ls(o,0),ti(o,Qe,_n,!1)),Zo(o,d),nt&2&&o===ct||(o===ct&&(!(nt&2)&&(Xi|=d),Nt===4&&ti(o,Qe,_n,!1)),hr(o))}function tw(o,i,d){if(nt&6)throw Error(a(327));var u=!d&&!(i&127)&&(i&o.expiredLanes)===0||Zt(o,i),y=u?X2(o,i):xm(o,i,!0),x=u;do{if(y===0){ns&&!u&&ti(o,i,0,!1);break}if(d=o.current.alternate,x&&!U2(d))y=xm(o,i,!1),x=!1;else{if(y===2){if(x=i,o.errorRecoveryDisabledLanes&x)var C=0;else C=o.pendingLanes&-536870913,C=C===0?C&536870912?536870912:0:C;if(C!==0){i=C;e:{var P=o;y=Bl;var H=P.current.memoizedState.isDehydrated;if(H&&(ls(P,C).flags|=256),C=xm(P,C,!1),C!==2&&C!==6){if(mm&&!H){P.errorRecoveryDisabledLanes|=x,Xi|=x,y=4;break e}x=bn,bn=y,x!==null&&(bn===null?bn=x:bn.push.apply(bn,x))}y=C}if(x=!1,y!==2)continue}}if(y===1){ls(o,0),ti(o,i,0,!0);break}e:{switch(u=o,x=y,x){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i&&(i&62914560)!==i)break;case 6:ti(u,i,_n,!Qr);break e;case 2:bn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(y=fc+300-Xt(),10<y)){if(ti(u,i,_n,!Qr),Ar(u,0,!0)!==0)break e;To=i,u.timeoutHandle=Rm(nw.bind(null,u,d,bn,pc,gm,i,_n,Xi,os,Qr,x,"Throttled",-0,0),y);break e}nw(u,d,bn,pc,gm,i,_n,Xi,os,Qr,x,null,-0,0)}break}}while(!0);hr(o)}function nw(o,i,d,u,y,x,C,P,H,ie,ce,ye,te,ue){o.timeoutHandle=-1;var Se=i.subtreeFlags,Me=(x&335544064)===x;ye=null,(Me||Se&8192||(Se&16785408)==16785408)&&(ye={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:wo},En=null,Yx(i,x,ye),Me&&(Se=ye,Me=o.containerInfo,Me=(Me.nodeType===9?Me:Me.ownerDocument).__reactViewTransition,Me!=null&&(Se.count++,Se.waitingForViewTransition=!0,Se=Zl.bind(Se),Me.finished.then(Se,Se))),Se=(x&62914560)===x?fc-Xt():(x&4194048)===x?Qx-Xt():0,Se=XT(ye,Se),Se!==null)?(To=x,o.cancelPendingCommit=Se(uw.bind(null,o,i,x,d,u,y,C,P,H,ie,ce,ye,null,te,ue)),ti(o,x,C,!ie)):uw(o,i,x,d,u,y,C,P,H,ie,ce,ye)}function U2(o){for(var i=o;;){var d=i.tag;if((d===0||d===11||d===15)&&i.flags&16384&&(d=i.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var u=0;u<d.length;u++){var y=d[u],x=y.getSnapshot;y=y.value;try{if(!jn(x(),y))return!1}catch{return!1}}if(d=i.child,i.subtreeFlags&16384&&d!==null)d.return=i,i=d;else{if(i===o)break;for(;i.sibling===null;){if(i.return===null||i.return===o)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ti(o,i,d,u){i=Ei(o,i),i&=~cc,i&=~Xi,o.suspendedLanes|=i,o.pingedLanes&=~i,u&&(o.warmLanes|=i),u=o.expirationTimes;for(var y=i;0<y;){var x=31-qt(y),C=1<<x;u[x]=-1,y&=~C}d!==0&&Go(o,d,i)}function gc(){return nt&6?!0:(Hl(0,!1),!1)}function bm(){if(Ze!==null){if(it===0)var o=Ze.return;else o=Ze,ar=Di=null,Ep(o),Ya=null,Cl=0,o=Ze;for(;o!==null;)jx(o.alternate,o),o=o.return;Ze=null}}function ls(o,i){var d=o.timeoutHandle;return d!==-1&&(o.timeoutHandle=-1,mT(d)),d=o.cancelPendingCommit,d!==null&&(o.cancelPendingCommit=null,d()),To=0,bm(),ct=o,Ze=d=rr(o.current,null),Qe=i,it=0,$n=null,Qr=!1,ns=Zt(o,i),mm=!1,os=_n=cc=Xi=Jr=Nt=0,bn=Bl=null,gm=!1,fr=Ei(o,i),Nu(),d}function ow(o,i){He=null,ee.H=Xu,i===Ua||i===Du?(i=hb(),it=3):i===pp?(i=hb(),it=4):it=i===qp?8:typeof i=="object"&&i&&typeof i.then=="function"?6:1,$n=i,Ze===null&&(Nt=1,Zu(o,Rn(i,o.current)))}function rw(){var o=Qt.current;return o===null?!0:(Qe&4194048)===Qe?sn===null:(Qe&62914560)===Qe||Qe&536870912?o===sn:!1}function iw(){var o=ee.H;return ee.H=Xu,o===null?Xu:o}function aw(){var o=ee.A;return ee.A=K2,o}function yc(){Nt=4,Qr||(Qe&4194048)!==Qe&&Qt.current!==null||(ns=!0),!(Jr&134217727)&&!(Xi&134217727)||ct===null||ti(ct,Qe,_n,!1)}function xm(o,i,d){var u=nt;nt|=2;var y=iw(),x=aw();(ct!==o||Qe!==i)&&(pc=null,ls(o,i)),i=!1;var C=Nt;e:do try{if(it!==0&&Ze!==null){var P=Ze,H=$n;switch(it){case 8:bm(),C=6;break e;case 3:case 2:case 9:case 6:Qt.current===null&&(i=!0);var ie=it;if(it=0,$n=null,ds(o,P,H,ie),d&&ns){C=0;break e}break;default:ie=it,it=0,$n=null,ds(o,P,H,ie)}}Y2(),C=Nt;break}catch(ce){ow(o,ce)}while(!0);return i&&o.shellSuspendCounter++,ar=Di=null,nt=u,ee.H=y,ee.A=x,Ze===null&&(ct=null,Qe=0,Nu()),C}function Y2(){for(;Ze!==null;)sw(Ze)}function X2(o,i){var d=nt;nt|=2;var u=iw(),y=aw();ct!==o||Qe!==i?(pc=null,hc=Xt()+500,ls(o,i)):ns=Zt(o,i);e:do try{if(it!==0&&Ze!==null){i=Ze;var x=$n;t:switch(it){case 1:it=0,$n=null,ds(o,i,x,1);break;case 2:case 9:if(cb(x)){it=0,$n=null,lw(i);break}i=function(){it!==2&&it!==9||ct!==o||(it=7),hr(o)},x.then(i,i);break e;case 3:it=7;break e;case 4:it=5;break e;case 7:cb(x)?(it=0,$n=null,lw(i)):(it=0,$n=null,ds(o,i,x,7));break;case 5:var C=null;switch(Ze.tag){case 26:C=Ze.memoizedState;case 5:case 27:var P=Ze;if(C?tk(C):P.stateNode.complete){it=0,$n=null;var H=P.sibling;if(H!==null)Ze=H;else{var ie=P.return;ie===null?Ze=null:(Ze=ie,vc(ie))}break t}}it=0,$n=null,ds(o,i,x,5);break;case 6:it=0,$n=null,ds(o,i,x,6);break;case 8:bm(),Nt=6;break e;default:throw Error(a(462))}}Z2();break}catch(ce){ow(o,ce)}while(!0);return ar=Di=null,ee.H=u,ee.A=y,nt=d,Ze===null?(ct=null,Qe=0,Nu(),Nt):0}function Z2(){for(;Ze!==null&&!Ca();)sw(Ze)}function sw(o){var i=Sx(o.alternate,o,fr);o.memoizedProps=o.pendingProps,i===null?vc(o):Ze=i}function lw(o){var i=o,d=i.alternate;switch(i.tag){case 15:case 0:i=gx(d,i,i.pendingProps,i.type,void 0,Qe);break;case 11:i=gx(d,i,i.pendingProps,i.type.render,i.ref,Qe);break;case 5:Ep(i);var u=i;u===Vt&&(We?(Tu(u),u.tag===5&&u.stateNode!=null&&(ft=u.stateNode)):(Tu(u),We=!0));default:jx(d,i),i=Ze=eb(i,fr),i=Sx(d,i,fr)}o.memoizedProps=o.pendingProps,i===null?vc(o):Ze=i}function ds(o,i,d,u){ar=Di=null,Ep(i),Ya=null,Cl=0;var y=i.return;try{if(I2(o,y,i,d,Qe)){Nt=1,Zu(o,Rn(d,o.current)),Ze=null;return}}catch(x){if(y!==null)throw Ze=y,x;Nt=1,Zu(o,Rn(d,o.current)),Ze=null;return}i.flags&32768?(We||u===1?o=!0:ns||Qe&536870912?o=!1:(Qr=o=!0,(u===2||u===9||u===3||u===6)&&(u=Qt.current,u!==null&&u.tag===13&&(u.flags|=16384))),dw(i,o)):vc(i)}function vc(o){var i=o;do{if(i.flags&32768){dw(i,Qr);return}o=i.return;var d=B2(i.alternate,i,fr);if(d!==null){Ze=d;return}if(i=i.sibling,i!==null){Ze=i;return}Ze=i=o}while(i!==null);Nt===0&&(Nt=5)}function dw(o,i){do{var d=q2(o.alternate,o);if(d!==null){d.flags&=32767,Ze=d;return}if(d=o.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!i&&(o=o.sibling,o!==null)){Ze=o;return}Ze=o=d}while(o!==null);Nt=6,Ze=null}function uw(o,i,d,u,y,x,C,P,H,ie,ce,ye){o.cancelPendingCommit=null;do bc();while(wt!==0);if(nt&6)throw Error(a(327));if(i!==null){if(i===o.current)throw Error(a(177));o===ct&&(Ze=ct=null,Qe=0),Zi=i,ro=o,To=d,vm=y,Jx=u,G2(o,i,d,C,P,H,ye)}}function G2(o,i,d,u,y,x,C){var P=i.lanes|i.childLanes;if(ym=P,P|=tp,Aa(o,d,P,u,y,x),is=null,(d&335544064)===d?(as=k2(o),u=10262):(as=null,u=10256),(i.subtreeFlags&u)!==0||(i.flags&u)!==0?(o.callbackNode=null,o.callbackPriority=0,oT(Xo,function(){return Nm(),null})):(o.callbackNode=null,o.callbackPriority=0),rc=!1,u=!!(i.flags&13878),i.subtreeFlags&13878||u){u=ee.T,ee.T=null,y=de.p,de.p=2,x=nt,nt|=4;try{H2(o,i,d)}finally{nt=x,de.p=y,ee.T=u}}wt=1,rc?rs=wT(C,o.containerInfo,as,wm,km,J2,Sm,Nm,Q2,null,null):(wm(),km(),Sm())}function Q2(o){if(wt!==0){var i=ro.onRecoverableError;i(o,{componentStack:null})}}function J2(){wt===3&&(wt=0,Wx(Zi,ro),wt=4)}function wm(){if(wt===1){wt=0;var o=ro,i=Zi,d=To,u=!!(i.flags&13878);if(i.subtreeFlags&13878||u){u=ee.T,ee.T=null;var y=de.p;de.p=2;var x=nt;nt|=4;try{Rl=sc=!1,Vx(i,o,d),d=Dm;var C=Vv(o.containerInfo),P=d.focusedElem,H=d.selectionRange;if(C!==P&&P&&P.ownerDocument&&Hv(P.ownerDocument.documentElement,P)){if(H!==null&&Zh(P)){var ie=H.start,ce=H.end;if(ce===void 0&&(ce=ie),"selectionStart"in P)P.selectionStart=ie,P.selectionEnd=Math.min(ce,P.value.length);else{var ye=P.ownerDocument||document,te=ye&&ye.defaultView||window;if(te.getSelection){var ue=te.getSelection(),Se=P.textContent.length,Me=Math.min(H.start,Se),Ve=H.end===void 0?Me:Math.min(H.end,Se);!ue.extend&&Me>Ve&&(C=Ve,Ve=Me,Me=C);var ne=qv(P,Me),Y=qv(P,Ve);if(ne&&Y&&(ue.rangeCount!==1||ue.anchorNode!==ne.node||ue.anchorOffset!==ne.offset||ue.focusNode!==Y.node||ue.focusOffset!==Y.offset)){var se=ye.createRange();se.setStart(ne.node,ne.offset),ue.removeAllRanges(),Me>Ve?(ue.addRange(se),ue.extend(Y.node,Y.offset)):(se.setEnd(Y.node,Y.offset),ue.addRange(se))}}}}for(ye=[],ue=P;ue=ue.parentNode;)ue.nodeType===1&&ye.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<ye.length;P++){var ge=ye[P];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}ys=!!Pm,Dm=Pm=null}finally{nt=x,de.p=y,ee.T=u}}o.current=i,wt=2}}function km(){if(wt===2){wt=0;var o=ro,i=Zi,d=!!(i.flags&8772);if(i.subtreeFlags&8772||d){d=ee.T,ee.T=null;var u=de.p;de.p=2;var y=nt;nt|=4;try{Rx(o,i.alternate,i)}finally{nt=y,de.p=u,ee.T=d}}wt=3}}function Sm(){if(wt===4||wt===3){wt=0;var o=rs;rs=null,dl();var i=ro,d=Zi,u=To,y=Jx,x=(u&335544064)===u?10262:10256;if((d.subtreeFlags&x)!==0||(d.flags&x)!==0?wt=5:(wt=0,Zi=ro=null,cw(i,i.pendingLanes)),x=i.pendingLanes,x===0&&(ei=null),D(u),d=d.stateNode,jt&&typeof jt.onCommitFiberRoot=="function")try{jt.onCommitFiberRoot(Dn,d,void 0,(d.current.flags&128)==128)}catch{}if(y!==null){d=ee.T,x=de.p,de.p=2,ee.T=null;try{for(var C=i.onRecoverableError,P=0;P<y.length;P++){var H=y[P];C(H.value,{componentStack:H.stack})}}finally{ee.T=d,de.p=x}}if(y=is,C=as,as=null,y!==null&&(is=null,C===null&&(C=[]),o!==null))for(H=0;H<y.length;H++)d=(0,y[H])(C),d!==void 0&&o.finished.finally(d);To&3&&bc(),hr(i),x=i.pendingLanes,u&261930&&x&42?i===mc?ql++:(ql=0,mc=i):(ql=0,mc=null),Hl(0,!1)}}function cw(o,i){(o.pooledCacheLanes&=i)===0&&(i=o.pooledCache,i!=null&&(o.pooledCache=null,Sl(i)))}function bc(){return rs!==null&&(rs.skipTransition(),rs=null),wm(),km(),Sm(),Nm()}function Nm(){if(wt!==5)return!1;var o=ro,i=ym;ym=0;var d=D(To),u=ee.T,y=de.p;try{de.p=32>d?32:d,ee.T=null,d=vm,vm=null;var x=ro,C=To;if(wt=0,Zi=ro=null,To=0,nt&6)throw Error(a(331));var P=nt;if(nt|=4,Zx(x.current),Ux(x,x.current,C,d),nt=P,Hl(0,!1),jt&&typeof jt.onPostCommitFiberRoot=="function")try{jt.onPostCommitFiberRoot(Dn,x)}catch{}return!0}finally{de.p=y,ee.T=u,cw(o,i)}}function fw(o,i,d){i=Rn(d,i),i=Bp(o.stateNode,i,2),o=Vi(o,i,2),o!==null&&(Zo(o,2),hr(o))}function at(o,i,d){if(o.tag===3)fw(o,o,d);else for(;i!==null;){if(i.tag===3){fw(i,o,d);break}if(i.tag===1){var u=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(ei===null||!ei.has(u))){o=Rn(d,o),d=lx(2),u=Vi(i,d,2),u!==null&&(dx(d,u,i,o),Zo(u,2),hr(u));break}}i=i.return}}function jm(o,i,d){var u=o.pingCache;if(u===null){u=o.pingCache=new W2;var y=new Set;u.set(i,y)}else y=u.get(i),y===void 0&&(y=new Set,u.set(i,y));y.has(d)||(mm=!0,y.add(d),o=eT.bind(null,o,i,d),i.then(o,o))}function eT(o,i,d){var u=o.pingCache;u!==null&&u.delete(i),o.pingedLanes|=o.suspendedLanes&d,o.warmLanes&=~d,ct===o&&(Qe&d)===d&&(Nt===4||Nt===3&&(Qe&62914560)===Qe&&300>Xt()-fc?nt&2?cc|=d:ls(o,0):cc|=d,os===Qe&&(os=0)),hr(o)}function hw(o,i){i===0&&(i=$i()),o=Mi(o,i),o!==null&&(Zo(o,i),hr(o))}function tT(o){var i=o.memoizedState,d=0;i!==null&&(d=i.retryLane),hw(o,d)}function nT(o,i){var d=0;switch(o.tag){case 31:case 13:var u=o.stateNode,y=o.memoizedState;y!==null&&(d=y.retryLane);break;case 19:u=o.stateNode;break;case 22:u=o.stateNode._retryCache;break;default:throw Error(a(314))}u!==null&&u.delete(i),hw(o,d)}function oT(o,i){return Yo(o,i)}var us=null,cs=null,Cm=!1,xc=!1,Em=!1,ni=0;function hr(o){o!==cs&&o.next===null&&(cs===null?us=cs=o:cs=cs.next=o),xc=!0,Cm||(Cm=!0,iT())}function Hl(o,i){if(!Em&&xc){Em=!0;do for(var d=!1,u=us;u!==null;){if(!i)if(o!==0){var y=u.pendingLanes;if(y===0)var x=0;else{var C=u.suspendedLanes,P=u.pingedLanes;x=(1<<31-qt(42|o)+1)-1,x&=y&~(C&~P),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(d=!0,yw(u,x))}else x=Qe,x=Ar(u,u===ct?x:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),!(x&3)||Zt(u,x)||(d=!0,yw(u,x));u=u.next}while(d);Em=!1}}function rT(){pw()}function pw(){xc=Cm=!1;var o=0;ni!==0&&pT()&&(o=ni);for(var i=Xt(),d=null,u=us;u!==null;){var y=u.next,x=mw(u,i);x===0?(u.next=null,d===null?us=y:d.next=y,y===null&&(cs=d)):(d=u,(o!==0||x&3)&&(xc=!0)),u=y}wt!==0&&wt!==5||Hl(o,!1),ni!==0&&(ni=0)}function mw(o,i){for(var d=o.suspendedLanes,u=o.pingedLanes,y=o.expirationTimes,x=o.pendingLanes&-62914561;0<x;){var C=31-qt(x),P=1<<C,H=y[C];H===-1?((P&d)===0||(P&u)!==0)&&(y[C]=Mr(P,i)):H<=i&&(o.expiredLanes|=P),x&=~P}if(i=ct,d=Qe,d=Ar(o,o===i?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),u=o.callbackNode,d===0||o===i&&(it===2||it===9)||o.cancelPendingCommit!==null)return u!==null&&u!==null&&Sn(u),o.callbackNode=null,o.callbackPriority=0;if(!(d&3)||Zt(o,d)){if(i=d&-d,i===o.callbackPriority)return i;switch(u!==null&&Sn(u),D(d)){case 2:case 8:d=Ni;break;case 32:d=Xo;break;case 268435456:d=_a;break;default:d=Xo}return u=gw.bind(null,o),d=Yo(d,u),o.callbackPriority=i,o.callbackNode=d,i}return u!==null&&u!==null&&Sn(u),o.callbackPriority=2,o.callbackNode=null,2}function gw(o,i){if(wt!==0&&wt!==5)return o.callbackNode=null,o.callbackPriority=0,null;var d=o.callbackNode;if(bc()&&o.callbackNode!==d)return null;var u=Qe;return u=Ar(o,o===ct?u:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),u===0?null:(tw(o,u,i),mw(o,Xt()),o.callbackNode!=null&&o.callbackNode===d?gw.bind(null,o):null)}function yw(o,i){if(bc())return null;tw(o,i,!0)}function iT(){gT(function(){nt&6?Yo($r,rT):pw()})}function $m(){if(ni===0){var o=Ri;o===0&&(o=_r,_r<<=1,!(_r&261888)&&(_r=256)),ni=o}return ni}function vw(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:gu(o)}function aT(o,i,d,u,y){if(i==="submit"&&d&&d.stateNode===y){var x=vw((y[Ae]||null).action),C=u.submitter;C&&(i=(i=C[Ae]||null)?vw(i.formAction):C.getAttribute("formAction"),i!==null&&(x=i,C=null));var P=new xu("action","action",null,u,y);o.push({event:P,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(ni!==0){var H=new FormData(y,C);Lp(d,{pending:!0,data:H,method:y.method,action:x},null,H)}}else typeof x=="function"&&(P.preventDefault(),H=new FormData(y,C),Lp(d,{pending:!0,data:H,method:y.method,action:x},x,H))},currentTarget:y}]})}}for(var _m=0;_m<ep.length;_m++){var Tm=ep[_m];eo(Tm.toLowerCase(),"on"+(Tm[0].toUpperCase()+Tm.slice(1)))}eo(Uv,"onAnimationEnd"),eo(Yv,"onAnimationIteration"),eo(Xv,"onAnimationStart"),eo("dblclick","onDoubleClick"),eo("focusin","onFocus"),eo("focusout","onBlur"),eo(p2,"onTransitionRun"),eo(m2,"onTransitionStart"),eo(g2,"onTransitionCancel"),eo(Zv,"onTransitionEnd"),Rr("onMouseEnter",["mouseout","mouseover"]),Rr("onMouseLeave",["mouseout","mouseover"]),Rr("onPointerEnter",["pointerout","pointerover"]),Rr("onPointerLeave",["pointerout","pointerover"]),Jo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Jo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Jo("onBeforeInput",["compositionend","keypress","textInput","paste"]),Jo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Jo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Jo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vl="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(" "),sT=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Vl));function bw(o,i){i=!!(i&4);for(var d=0;d<o.length;d++){var u=o[d],y=u.event;u=u.listeners;e:{var x=void 0;if(i)for(var C=u.length-1;0<=C;C--){var P=u[C],H=P.instance,ie=P.currentTarget;if(P=P.listener,H!==x&&y.isPropagationStopped())break e;x=P,y.currentTarget=ie;try{x(y)}catch(ce){Su(ce)}y.currentTarget=null,x=H}else for(C=0;C<u.length;C++){if(P=u[C],H=P.instance,ie=P.currentTarget,P=P.listener,H!==x&&y.isPropagationStopped())break e;x=P,y.currentTarget=ie;try{x(y)}catch(ce){Su(ce)}y.currentTarget=null,x=H}}}}function Ge(o,i){var d=i[Re];d===void 0&&(d=i[Re]=new Set);var u=o+"__bubble";d.has(u)||(ww(i,o,2,!1),d.add(u))}function Am(o,i,d){var u=0;i&&(u|=4),ww(d,o,u,i)}var wc="_reactListening"+Math.random().toString(36).slice(2);function xw(o){if(!o[wc]){o[wc]=!0,fu.forEach(function(d){d!=="selectionchange"&&(sT.has(d)||Am(d,!1,o),Am(d,!0,o))});var i=o.nodeType===9?o:o.ownerDocument;i===null||i[wc]||(i[wc]=!0,Am("selectionchange",!1,i))}}function ww(o,i,d,u){switch(dk(i)){case 2:var y=tA;break;case 8:y=nA;break;default:y=Gm}d=y.bind(null,i,d,o),y=void 0,!Fh||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(y=!0),u?y===void 0?o.addEventListener(i,d,!0):o.addEventListener(i,d,{capture:!0,passive:y}):y===void 0?o.addEventListener(i,d,!1):o.addEventListener(i,d,{passive:y})}function Mm(o,i,d,u,y){var x=u;if(!(i&1)&&!(i&2)&&u!==null)e:for(;;){if(u===null)return;var C=u.tag;if(C===3||C===4){var P=u.stateNode.containerInfo;if(P===y)break;if(C===4)for(C=u.return;C!==null;){var H=C.tag;if((H===3||H===4)&&C.stateNode.containerInfo===y)return;C=C.return}for(;P!==null;){if(C=Qo(P),C===null)return;if(H=C.tag,H===5||H===6||H===26||H===27){u=x=C;continue e}P=P.parentNode}}u=u.return}Sv(function(){var ie=x,ce=Rh(d),ye=[];e:{var te=Gv.get(o);if(te!==void 0){var ue=xu,Se=o;switch(o){case"keypress":if(vu(d)===0)break e;case"keydown":case"keyup":ue=Z_;break;case"focusin":Se="focus",ue=Vh;break;case"focusout":Se="blur",ue=Vh;break;case"beforeblur":case"afterblur":ue=Vh;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=Cv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=H_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=Q_;break;case Uv:case Yv:case Xv:ue=V_;break;case Zv:ue=J_;break;case"scroll":case"scrollend":ue=q_;break;case"wheel":ue=e2;break;case"copy":case"cut":case"paste":ue=K_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=$v;break;case"submit":ue=G_;break;case"toggle":case"beforetoggle":ue=t2}var Me=!!(i&4),Ve=!Me&&(o==="scroll"||o==="scrollend"),ne=Me?te===null?null:te+"Capture":te;Me=[];for(var Y=ie,se;Y!==null;){var ge=Y;if(se=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||se===null||ne===null||(ge=fl(Y,ne),ge!=null&&Me.push(Kl(Y,ge,se))),Ve)break;Y=Y.return}0<Me.length&&(te=new ue(te,Se,null,d,ce),ye.push({event:te,listeners:Me}))}}if(!(i&7)){e:{if(ue=o==="mouseover"||o==="pointerover",te=o==="mouseout"||o==="pointerout",ue&&d!==Ih&&(Se=d.relatedTarget||d.fromElement)&&(Qo(Se)||Se[Xe]))break e;(te||ue)&&(Se=ce.window===ce?ce:(ue=ce.ownerDocument)?ue.defaultView||ue.parentWindow:window,te?(ue=d.relatedTarget||d.toElement,te=ie,ue=ue?Qo(ue):null,ue!==null&&(Ve=l(ue),Me=ue.tag,ue!==Ve||Me!==5&&Me!==27&&Me!==6)&&(ue=null)):(te=null,ue=ie),te!==ue&&(Me=Cv,ge="onMouseLeave",ne="onMouseEnter",Y="mouse",(o==="pointerout"||o==="pointerover")&&(Me=$v,ge="onPointerLeave",ne="onPointerEnter",Y="pointer"),Ve=te==null?Se:Lr(te),se=ue==null?Se:Lr(ue),Se=new Me(ge,Y+"leave",te,d,ce),Se.target=Ve,Se.relatedTarget=se,ge=null,Qo(ce)===ie&&(Me=new Me(ne,Y+"enter",ue,d,ce),Me.target=se,Me.relatedTarget=Ve,ge=Me),Ve=ge,Me=te&&ue?A(te,ue,lT):null,te!==null&&kw(ye,Se,te,Me,!1),ue!==null&&Ve!==null&&kw(ye,Ve,ue,Me,!0)))}e:{if(te=ie?Lr(ie):window,ue=te.nodeName&&te.nodeName.toLowerCase(),ue==="select"||ue==="input"&&te.type==="file")var _e=Lv;else if(Pv(te))if(Iv)_e=c2;else{_e=d2;var Je=l2}else ue=te.nodeName,!ue||ue.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?ie&&Lh(ie.elementType)&&(_e=Lv):_e=u2;if(_e&&=_e(o,ie)){Dv(ye,_e,d,ce);break e}Je&&Je(o,te,ie)}switch(Je=ie?Lr(ie):window,o){case"focusin":(Pv(Je)||Je.contentEditable==="true")&&(za=Je,Gh=ie,xl=null);break;case"focusout":xl=Gh=za=null;break;case"mousedown":Qh=!0;break;case"contextmenu":case"mouseup":case"dragend":Qh=!1,Kv(ye,d,ce);break;case"selectionchange":if(h2)break;case"keydown":case"keyup":Kv(ye,d,ce)}var Oe;if(Wh)e:{switch(o){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else Ra?Mv(o,d)&&(Le="onCompositionEnd"):o==="keydown"&&d.keyCode===229&&(Le="onCompositionStart");Le&&(_v&&d.locale!=="ko"&&(Ra||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&Ra&&(Oe=Nv()):(zr=ce,Bh="value"in zr?zr.value:zr.textContent,Ra=!0)),Je=kc(ie,Le),0<Je.length&&(Le=new Ev(Le,o,null,d,ce),ye.push({event:Le,listeners:Je}),Oe?Le.data=Oe:(Oe=Ov(d),Oe!==null&&(Le.data=Oe)))),(Oe=o2?r2(o,d):i2(o,d))&&(Le=kc(ie,"onBeforeInput"),0<Le.length&&(Je=new Ev("onBeforeInput","beforeinput",null,d,ce),ye.push({event:Je,listeners:Le}),Je.data=Oe)),aT(ye,o,ie,d,ce)}bw(ye,i)})}function Kl(o,i,d){return{instance:o,listener:i,currentTarget:d}}function kc(o,i){for(var d=i+"Capture",u=[];o!==null;){var y=o,x=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||x===null||(y=fl(o,d),y!=null&&u.unshift(Kl(o,y,x)),y=fl(o,i),y!=null&&u.push(Kl(o,y,x))),o.tag===3)return u;o=o.return}return[]}function lT(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function kw(o,i,d,u,y){for(var x=i._reactName,C=[];d!==null&&d!==u;){var P=d,H=P.alternate,ie=P.stateNode;if(P=P.tag,H!==null&&H===u)break;P!==5&&P!==26&&P!==27||ie===null||(H=ie,y?(ie=fl(d,x),ie!=null&&C.unshift(Kl(d,ie,H))):y||(ie=fl(d,x),ie!=null&&C.push(Kl(d,ie,H)))),d=d.return}C.length!==0&&o.push({event:i,listeners:C})}var dT=/\r\n?/g,uT=/\u0000|\uFFFD/g;function Sw(o){return(typeof o=="string"?o:""+o).replace(dT,`
|
|
9
|
+
`).replace(uT,"")}function Nw(o,i){return i=Sw(i),Sw(o)===i}function st(o,i,d,u,y,x){switch(d){case"children":if(typeof u=="string")i==="body"||i==="textarea"&&u===""||Da(o,u);else if(typeof u=="number"||typeof u=="bigint")i!=="body"&&Da(o,""+u);else return;break;case"className":mu(o,"class",u);break;case"tabIndex":mu(o,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":mu(o,d,u);break;case"style":wv(o,u,x);return;case"data":if(i!=="object"){mu(o,"data",u);break}case"src":case"href":if(u===""&&(i!=="a"||d!=="href")||u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){o.removeAttribute(d);break}u=gu(u),o.setAttribute(d,u);break;case"action":case"formAction":if(typeof u=="function"){o.setAttribute(d,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}if(typeof x=="function"&&(d==="formAction"?(i!=="input"&&st(o,i,"name",y.name,y,null),st(o,i,"formEncType",y.formEncType,y,null),st(o,i,"formMethod",y.formMethod,y,null),st(o,i,"formTarget",y.formTarget,y,null)):(st(o,i,"encType",y.encType,y,null),st(o,i,"method",y.method,y,null),st(o,i,"target",y.target,y,null))),u==null||typeof u=="symbol"||typeof u=="boolean"){o.removeAttribute(d);break}u=gu(u),o.setAttribute(d,u);break;case"onClick":u!=null&&(o.onclick=wo);return;case"onScroll":u!=null&&Ge("scroll",o);return;case"onScrollEnd":u!=null&&Ge("scrollend",o);return;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(d=u.__html,d!=null){if(y.children!=null)throw Error(a(60));x?.__html!==d&&(o.innerHTML=d)}}break;case"multiple":o.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":o.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){o.removeAttribute("xlink:href");break}d=gu(u),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?o.setAttribute(d,u):o.removeAttribute(d);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?o.setAttribute(d,""):o.removeAttribute(d);break;case"capture":case"download":u===!0?o.setAttribute(d,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?o.setAttribute(d,u):o.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?o.setAttribute(d,u):o.removeAttribute(d);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?o.removeAttribute(d):o.setAttribute(d,u);break;case"popover":Ge("beforetoggle",o),Ge("toggle",o),pu(o,"popover",u);break;case"xlinkActuate":er(o,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":er(o,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":er(o,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":er(o,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":er(o,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":er(o,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":er(o,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":er(o,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":er(o,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":pu(o,"is",u);break;case"innerText":case"textContent":return;default:if(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")d=F_.get(d)||d,pu(o,d,u);else return}tt=!0}function Om(o,i,d,u,y,x){switch(d){case"style":wv(o,u,x);return;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(d=u.__html,d!=null){if(y.children!=null)throw Error(a(60));x?.__html!==d&&(o.innerHTML=d)}}break;case"children":if(typeof u=="string")Da(o,u);else if(typeof u=="number"||typeof u=="bigint")Da(o,""+u);else return;break;case"onScroll":u!=null&&Ge("scroll",o);return;case"onScrollEnd":u!=null&&Ge("scrollend",o);return;case"onClick":u!=null&&(o.onclick=wo);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Oa.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(y=d.endsWith("Capture"),x=d.slice(2,y?d.length-7:void 0),i=o[Ae]||null,i=i==null?null:i[d],typeof i=="function"&&o.removeEventListener(x,i,y),typeof u=="function")){typeof i!="function"&&i!==null&&(d in o?o[d]=null:o.hasAttribute(d)&&o.removeAttribute(d)),o.addEventListener(x,u,y);break e}tt=!0,d in o?o[d]=u:u===!0?o.setAttribute(d,""):pu(o,d,u)}return}tt=!0}function tn(o,i,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ge("error",o),Ge("load",o);var u=!1,y=!1,x;for(x in d)if(d.hasOwnProperty(x)){var C=d[x];if(C!=null)switch(x){case"src":u=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:st(o,i,x,C,d,null)}}y&&st(o,i,"srcSet",d.srcSet,d,null),u&&st(o,i,"src",d.src,d,null);return;case"input":Ge("invalid",o);var P=x=C=y=null,H=null,ie=null;for(u in d)if(d.hasOwnProperty(u)){var ce=d[u];if(ce!=null)switch(u){case"name":y=ce;break;case"type":C=ce;break;case"checked":H=ce;break;case"defaultChecked":ie=ce;break;case"value":x=ce;break;case"defaultValue":P=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(a(137,i));break;default:st(o,i,u,ce,d,null)}}yv(o,x,P,H,ie,C,y,!1);return;case"select":for(y in Ge("invalid",o),u=C=x=null,d)if(d.hasOwnProperty(y)&&(P=d[y],P!=null))switch(y){case"value":x=P;break;case"defaultValue":C=P;break;case"multiple":u=P;default:st(o,i,y,P,d,null)}i=x,d=C,o.multiple=!!u,i==null?d!=null&&Pa(o,!!u,d,!0):Pa(o,!!u,i,!1);return;case"textarea":for(C in Ge("invalid",o),x=y=u=null,d)if(d.hasOwnProperty(C)&&(P=d[C],P!=null))switch(C){case"value":u=P;break;case"defaultValue":y=P;break;case"children":x=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(a(91));break;default:st(o,i,C,P,d,null)}bv(o,u,y,x);return;case"option":for(H in d)d.hasOwnProperty(H)&&(u=d[H],u!=null)&&(H==="selected"?o.selected=u&&typeof u!="function"&&typeof u!="symbol":st(o,i,H,u,d,null));return;case"dialog":Ge("beforetoggle",o),Ge("toggle",o),Ge("cancel",o),Ge("close",o);break;case"iframe":case"object":Ge("load",o);break;case"video":case"audio":for(u=0;u<Vl.length;u++)Ge(Vl[u],o);break;case"image":Ge("error",o),Ge("load",o);break;case"details":Ge("toggle",o);break;case"embed":case"source":case"link":Ge("error",o),Ge("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in d)if(d.hasOwnProperty(ie)&&(u=d[ie],u!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:st(o,i,ie,u,d,null)}return;default:if(Lh(i)){for(ce in d)d.hasOwnProperty(ce)&&(u=d[ce],u!==void 0&&Om(o,i,ce,u,d,void 0));return}}for(P in d)d.hasOwnProperty(P)&&(u=d[P],u!=null&&st(o,i,P,u,d,null))}var cT={};function fT(o,i,d,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,x=null,C=null,P=null,H=null,ie=null,ce=null;for(ue in d){var ye=d[ue];if(d.hasOwnProperty(ue)&&ye!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":H=ye;default:u.hasOwnProperty(ue)||st(o,i,ue,null,u,ye)}}for(var te in u){var ue=u[te];if(ye=d[te],u.hasOwnProperty(te)&&(ue!=null||ye!=null))switch(te){case"type":ue!==ye&&(tt=!0),x=ue;break;case"name":ue!==ye&&(tt=!0),y=ue;break;case"checked":ue!==ye&&(tt=!0),ie=ue;break;case"defaultChecked":ue!==ye&&(tt=!0),ce=ue;break;case"value":ue!==ye&&(tt=!0),C=ue;break;case"defaultValue":ue!==ye&&(tt=!0),P=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(a(137,i));break;default:ue!==ye&&st(o,i,te,ue,u,ye)}}Ph(o,C,P,H,ie,ce,x,y);return;case"select":for(x in ue=C=P=te=null,d)if(H=d[x],d.hasOwnProperty(x)&&H!=null)switch(x){case"value":break;case"multiple":ue=H;default:u.hasOwnProperty(x)||st(o,i,x,null,u,H)}for(y in u)if(x=u[y],H=d[y],u.hasOwnProperty(y)&&(x!=null||H!=null))switch(y){case"value":x!==H&&(tt=!0),te=x;break;case"defaultValue":x!==H&&(tt=!0),P=x;break;case"multiple":x!==H&&(tt=!0),C=x;default:x!==H&&st(o,i,y,x,u,H)}i=P,d=C,u=ue,te==null?!!u!=!!d&&(i==null?Pa(o,!!d,d?[]:"",!1):Pa(o,!!d,i,!0)):Pa(o,!!d,te,!1);return;case"textarea":for(P in ue=te=null,d)if(y=d[P],d.hasOwnProperty(P)&&y!=null&&!u.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:st(o,i,P,null,u,y)}for(C in u)if(y=u[C],x=d[C],u.hasOwnProperty(C)&&(y!=null||x!=null))switch(C){case"value":y!==x&&(tt=!0),te=y;break;case"defaultValue":y!==x&&(tt=!0),ue=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(a(91));break;default:y!==x&&st(o,i,C,y,u,x)}vv(o,te,ue);return;case"option":for(var Se in d)te=d[Se],d.hasOwnProperty(Se)&&te!=null&&!u.hasOwnProperty(Se)&&(Se==="selected"?o.selected=!1:st(o,i,Se,null,u,te));for(H in u)te=u[H],ue=d[H],u.hasOwnProperty(H)&&te!==ue&&(te!=null||ue!=null)&&(H==="selected"?(te!==ue&&(tt=!0),o.selected=te&&typeof te!="function"&&typeof te!="symbol"):st(o,i,H,te,u,ue));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Me in d)te=d[Me],d.hasOwnProperty(Me)&&te!=null&&!u.hasOwnProperty(Me)&&st(o,i,Me,null,u,te);for(ie in u)if(te=u[ie],ue=d[ie],u.hasOwnProperty(ie)&&te!==ue&&(te!=null||ue!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(a(137,i));break;default:st(o,i,ie,te,u,ue)}return;default:if(Lh(i)){for(var Ve in d)te=d[Ve],d.hasOwnProperty(Ve)&&te!==void 0&&!u.hasOwnProperty(Ve)&&Om(o,i,Ve,void 0,u,te);for(ce in u)te=u[ce],ue=d[ce],!u.hasOwnProperty(ce)||te===ue||te===void 0&&ue===void 0||Om(o,i,ce,te,u,ue);return}}for(var ne in d)te=d[ne],d.hasOwnProperty(ne)&&te!=null&&!u.hasOwnProperty(ne)&&st(o,i,ne,null,u,te);for(ye in u)te=u[ye],ue=d[ye],!u.hasOwnProperty(ye)||te===ue||te==null&&ue==null||st(o,i,ye,te,u,ue)}function jw(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function hT(){if(typeof performance.getEntriesByType=="function"){for(var o=0,i=0,d=performance.getEntriesByType("resource"),u=0;u<d.length;u++){var y=d[u],x=y.transferSize,C=y.initiatorType,P=y.duration;if(x&&P&&jw(C)){for(C=0,P=y.responseEnd,u+=1;u<d.length;u++){var H=d[u],ie=H.startTime;if(ie>P)break;var ce=H.transferSize,ye=H.initiatorType;ce&&jw(ye)&&(H=H.responseEnd,C+=ce*(H<P?1:(P-ie)/(H-ie)))}if(--u,i+=8*(x+C)/(y.duration/1e3),o++,10<o)break}}if(0<o)return i/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var Pm=null,Dm=null;function Wl(o){return o.nodeType===9?o:o.ownerDocument}function Cw(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ew(o,i){if(o===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&i==="foreignObject"?0:o}function $w(o,i,d,u){return d=Wl(d).createElement(o),d[ke]=u,d[Ae]=i,tn(d,o,i),Ct(d),d}function Lm(o,i){return o==="textarea"||o==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Im=null;function pT(){var o=window.event;return o&&o.type==="popstate"?o!==Im&&(Im=o,!0):(Im=null,!1)}var Rm=typeof setTimeout=="function"?setTimeout:void 0,mT=typeof clearTimeout=="function"?clearTimeout:void 0,_w=typeof Promise=="function"?Promise:void 0,Tw=typeof requestAnimationFrame=="function"?requestAnimationFrame:Rm,gT=typeof queueMicrotask=="function"?queueMicrotask:_w===void 0?Rm:function(o){return _w.resolve(null).then(o).catch(yT)};function yT(o){setTimeout(function(){throw o})}function oi(o){return o==="head"}function Aw(o,i){var d=i,u=0;do{var y=d.nextSibling;if(o.removeChild(d),y&&y.nodeType===8)if(d=y.data,d==="/$"||d==="/&"){if(u===0){o.removeChild(y),vs(i);return}u--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")u++;else if(d==="html")Wm(o.ownerDocument.documentElement);else if(d==="head"){d=o.ownerDocument.head,Wm(d);for(var x=d.firstChild;x;){var C=x.nextSibling,P=x.nodeName;x[Ht]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&x.rel.toLowerCase()==="stylesheet"||d.removeChild(x),x=C}}else d==="body"&&Wm(o.ownerDocument.body);d=y}while(d);vs(i)}function Mw(o,i){var d=o;o=0;do{var u=d.nextSibling;if(d.nodeType===1?i?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(i?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),u&&u.nodeType===8)if(d=u.data,d==="/$"){if(o===0)break;o--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||o++;d=u}while(d)}function Ow(o,i,d){if(i=CSS.escape(i)===i?i:"r-"+btoa(i).replace(/=/g,""),o.style.viewTransitionName=i,d!=null&&(o.style.viewTransitionClass=d),d=getComputedStyle(o),d.display==="inline"){if(i=o.getClientRects(),i.length===1)var u=1;else for(var y=u=0;y<i.length;y++){var x=i[y];0<x.width&&0<x.height&&u++}u===1&&(o=o.style,o.display=i.length===1?"inline-block":"block",o.marginTop="-"+d.paddingTop,o.marginBottom="-"+d.paddingBottom)}}function Pw(o,i){o=o.style,i=i.style;var d=i==null?null:i.hasOwnProperty("viewTransitionName")?i.viewTransitionName:i.hasOwnProperty("view-transition-name")?i["view-transition-name"]:null;o.viewTransitionName=d==null||typeof d=="boolean"?"":(""+d).trim(),d=i==null?null:i.hasOwnProperty("viewTransitionClass")?i.viewTransitionClass:i.hasOwnProperty("view-transition-class")?i["view-transition-class"]:null,o.viewTransitionClass=d==null||typeof d=="boolean"?"":(""+d).trim(),o.display==="inline-block"&&(i==null?o.display=o.margin="":(d=i.display,o.display=d==null||typeof d=="boolean"?"":d,d=i.margin,d==null?(d=i.hasOwnProperty("marginTop")?i.marginTop:i["margin-top"],o.marginTop=d==null||typeof d=="boolean"?"":d,i=i.hasOwnProperty("marginBottom")?i.marginBottom:i["margin-bottom"],o.marginBottom=i==null||typeof i=="boolean"?"":i):o.margin=d))}function Dw(o,i,d){return d=d.ownerDocument.defaultView,{rect:o,abs:i.position==="absolute"||i.position==="fixed",clip:i.clipPath!=="none"||i.overflow!=="visible"||i.filter!=="none"||i.mask!=="none"||i.mask!=="none"||i.borderRadius!=="0px",view:0<=o.bottom&&0<=o.right&&o.top<=d.innerHeight&&o.left<=d.innerWidth}}function zm(o){return Dw(o.getBoundingClientRect(),getComputedStyle(o),o)}function vT(o){var i=o.getBoundingClientRect();i=new DOMRect(i.x+2e4,i.y+2e4,i.width,i.height);var d=getComputedStyle(o);return Dw(i,d,o)}function bT(o){return o.documentElement.clientHeight}function xT(o){this.addEventListener("load",o),this.addEventListener("error",o)}function wT(o,i,d,u,y,x,C,P,H){var ie=i.nodeType===9?i:i.ownerDocument;try{var ce=ie.startViewTransition({update:function(){var te=ie.defaultView,ue=te.navigation&&te.navigation.transition,Se=ie.fonts.status;u();var Me=[];if(Se==="loaded"&&(bT(ie),ie.fonts.status==="loading"&&Me.push(ie.fonts.ready)),Se=Me.length,o!==null)for(var Ve=o.suspenseyImages,ne=0,Y=0;Y<Ve.length;Y++){var se=Ve[Y];if(!se.complete){var ge=se.getBoundingClientRect();if(0<ge.bottom&&0<ge.right&&ge.top<te.innerHeight&&ge.left<te.innerWidth){if(ne+=nk(se),ne>jc){Me.length=Se;break}se=new Promise(xT.bind(se)),Me.push(se)}}}if(0<Me.length)return te=Promise.race([Promise.all(Me),new Promise(function(_e){return setTimeout(_e,500)})]).then(y,y),(ue?Promise.allSettled([ue.finished,te]):te).then(x,x);if(y(),ue)return ue.finished.then(x,x);x()},types:d});ie.__reactViewTransition=ce;var ye=[];return ce.ready.then(function(){for(var te=ie.documentElement.getAnimations({subtree:!0}),ue=0;ue<te.length;ue++){var Se=te[ue],Me=Se.effect,Ve=Me.pseudoElement;if(Ve!=null&&Ve.startsWith("::view-transition")){ye.push(Se),Se=Me.getKeyframes();for(var ne=Ve=void 0,Y=!0,se=0;se<Se.length;se++){var ge=Se[se],_e=ge.width;if(Ve===void 0)Ve=_e;else if(Ve!==_e){Y=!1;break}if(_e=ge.height,ne===void 0)ne=_e;else if(ne!==_e){Y=!1;break}delete ge.width,delete ge.height,ge.transform==="none"&&delete ge.transform}Y&&Ve!==void 0&&ne!==void 0&&(Me.setKeyframes(Se),Y=getComputedStyle(Me.target,Me.pseudoElement),Y.width!==Ve||Y.height!==ne)&&(Y=Se[0],Y.width=Ve,Y.height=ne,Y=Se[Se.length-1],Y.width=Ve,Y.height=ne,Me.setKeyframes(Se))}}C()},function(te){ie.__reactViewTransition===ce&&(ie.__reactViewTransition=null);try{typeof te=="object"&&te&&te.name==="InvalidStateError"&&(te.message==="View transition was skipped because document visibility state is hidden."||te.message==="Skipping view transition because document visibility state has become hidden."||te.message==="Skipping view transition because viewport size changed."||te.message==="Transition was aborted because of invalid state")&&(te=null),te!==null&&H(te)}finally{u(),y(),C()}}),ce.finished.finally(function(){for(var te=0;te<ye.length;te++)ye[te].cancel();ie.__reactViewTransition===ce&&(ie.__reactViewTransition=null),P()}),ce}catch{return u(),y(),C(),null}}function Gi(o,i){this._scope=document.documentElement,this._selector="::view-transition-"+o+"("+i+")"}Gi.prototype.animate=function(o,i){return i=typeof i=="number"?{duration:i}:M({},i),i.pseudoElement=this._selector,this._scope.animate(o,i)},Gi.prototype.getAnimations=function(){for(var o=this._scope,i=this._selector,d=o.getAnimations({subtree:!0}),u=[],y=0;y<d.length;y++){var x=d[y].effect;x!==null&&x.target===o&&x.pseudoElement===i&&u.push(d[y])}return u},Gi.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Lw(o){return{name:o,group:new Gi("group",o),imagePair:new Gi("image-pair",o),old:new Gi("old",o),new:new Gi("new",o)}}function Tn(o){this._fragmentFiber=o,this._observers=this._eventListeners=null}Tn.prototype.addEventListener=function(o,i,d){var u=null,y=null;if(!(d!=null&&typeof d!="boolean"&&(u=d.signal||null,u!==null&&u.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var x=this._eventListeners;if(Rw(x,o,i,d)===-1){var C=this,P=i;d!=null&&typeof d!="boolean"&&d.once===!0&&(P=function(H){C.removeEventListener(o,i,d),typeof i=="function"?i.call(this,H):i.handleEvent(H)}),u!==null&&(y=C.removeEventListener.bind(C,o,i,d),u.addEventListener("abort",y,{once:!0}),y=u.removeEventListener.bind(u,"abort",y)),u=fs(d),x.push({type:o,listener:i,optionsOrUseCapture:d,attachedListener:P,cleanup:y}),m(this._fragmentFiber.child,!1,kT,o,P,u)}this._eventListeners=x}};function kT(o,i,d,u){return N(o).addEventListener(i,d,u),!1}Tn.prototype.removeEventListener=function(o,i,d){var u=this._eventListeners;if(u!==null&&(i=Rw(u,o,i,d),i!==-1)){var y=u[i];d=y.attachedListener;var x=y.cleanup;y=fs(y.optionsOrUseCapture),m(this._fragmentFiber.child,!1,ST,o,d,y),u.splice(i,1),x!==null&&x()}};function ST(o,i,d,u){return N(o).removeEventListener(i,d,u),!1}function fs(o){return o!=null&&typeof o!="boolean"&&(o.once===!0||o.signal instanceof AbortSignal)?{capture:o.capture,passive:o.passive}:o}function Iw(o){return o==null?"c=0":typeof o=="boolean"?"c="+(o?"1":"0"):"c="+(o.capture?"1":"0")}function Rw(o,i,d,u){if(o.length===0)return-1;u=Iw(u);for(var y=0;y<o.length;y++){var x=o[y];if(x.type===i&&x.listener===d&&Iw(x.optionsOrUseCapture)===u)return y}return-1}Tn.prototype.dispatchEvent=function(o){var i=b(this._fragmentFiber);if(i===null)return!0;i=N(i);var d=this._eventListeners;if(d!==null&&0<d.length||!o.bubbles){var u=i.nodeType===9?i.createComment(""):document.createTextNode("");if(d)for(var y=0;y<d.length;y++){var x=d[y];u.addEventListener(x.type,x.attachedListener,fs(x.optionsOrUseCapture))}if(i.appendChild(u),o=u.dispatchEvent(o),d)for(y=0;y<d.length;y++)x=d[y],u.removeEventListener(x.type,x.attachedListener,fs(x.optionsOrUseCapture));return i.removeChild(u),o}return i.dispatchEvent(o)},Tn.prototype.focus=function(o){m(this._fragmentFiber.child,!0,zw,o,void 0,void 0)};function zw(o,i){return o.tag!==6&&(o=N(o),DT(o,i))}Tn.prototype.focusLast=function(o){var i=[];m(this._fragmentFiber.child,!0,Fm,i,void 0,void 0);for(var d=i.length-1;0<=d&&!zw(i[d],o);d--);};function Fm(o,i){return i.push(o),!1}Tn.prototype.blur=function(){var o=b(this._fragmentFiber);o!==null&&(o=N(o),o=Wl(o).activeElement,o!==null&&m(this._fragmentFiber.child,!1,NT,o,void 0,void 0))};function NT(o,i){return o.tag!==6&&(o=N(o),o===i||o.contains(i)?(i.blur(),!0):!1)}Tn.prototype.observeUsing=function(o){this._observers===null&&(this._observers=new Set),this._observers.add(o),m(this._fragmentFiber.child,!1,jT,o,void 0,void 0)};function jT(o,i){return o.tag===6||(o=N(o),i.observe(o)),!1}Tn.prototype.unobserveUsing=function(o){var i=this._observers;if(i!==null&&i.has(o)){i.delete(o),m(this._fragmentFiber.child,!1,CT,o,void 0,void 0);for(var d=i=0;d<io.length;d++){var u=io[d];u.fragmentInstance===this&&u.observer===o?o.unobserve(u.instance):io[i++]=u}io.length=i}};function CT(o,i){return o.tag===6||(o=N(o),i.unobserve(o)),!1}var io=[],Bm=!1;function ET(o,i,d){io.push({fragmentInstance:o,observer:i,instance:d}),Bm||(Bm=!0,LT(function(){Bm=!1;var u=io;io=[];for(var y=0;y<u.length;y++){var x=u[y];x.observer.unobserve(x.instance)}}))}Tn.prototype.getClientRects=function(){var o=[];return m(this._fragmentFiber.child,!1,$T,o,void 0,void 0),o};function $T(o,i){if(o.tag===6){o=o.stateNode;var d=o.ownerDocument.createRange();d.selectNodeContents(o),i.push.apply(i,d.getClientRects())}else o=N(o),i.push.apply(i,o.getClientRects());return!1}Tn.prototype.getRootNode=function(o){var i=b(this._fragmentFiber);return i===null?this:N(i).getRootNode(o)},Tn.prototype.compareDocumentPosition=function(o){var i=b(this._fragmentFiber);if(i===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var d=[];m(this._fragmentFiber.child,!1,Fm,d,void 0,void 0);var u=N(i);if(d.length===0){if(d=u,w(this._fragmentFiber)){e:{for(i=this._fragmentFiber.return;i!==null;){if(i.tag===4){i=i.stateNode.containerInfo;break e}if(i.tag===3||i.tag===5||i.tag===27)break;i=i.return}i=null}i!=null&&(d=i)}i=this._fragmentFiber;var y=u=d.compareDocumentPosition(o);return d===o?y=Node.DOCUMENT_POSITION_CONTAINS:u&Node.DOCUMENT_POSITION_CONTAINED_BY&&(d=k(i)[1],d===null?y=Node.DOCUMENT_POSITION_PRECEDING:(o=N(d).compareDocumentPosition(o),y=o===0||o&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),y|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}i=N(d[0]),y=N(d[d.length-1]);var x=w(this._fragmentFiber)?i.parentElement:u;if(x==null)return Node.DOCUMENT_POSITION_DISCONNECTED;u=x.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY,x=x.compareDocumentPosition(y)&Node.DOCUMENT_POSITION_CONTAINED_BY;var C=i.compareDocumentPosition(o),P=y.compareDocumentPosition(o),H=C&Node.DOCUMENT_POSITION_CONTAINED_BY||P&Node.DOCUMENT_POSITION_CONTAINED_BY;return P=u&&x&&C&Node.DOCUMENT_POSITION_FOLLOWING&&P&Node.DOCUMENT_POSITION_PRECEDING,i=u&&i===o||x&&y===o||H||P?Node.DOCUMENT_POSITION_CONTAINED_BY:!u&&i===o||!x&&y===o?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:C,i&Node.DOCUMENT_POSITION_DISCONNECTED||i&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||_T(i,this._fragmentFiber,d[0],d[d.length-1],o)?i:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function _T(o,i,d,u,y){var x=Qo(y);if(o&Node.DOCUMENT_POSITION_CONTAINED_BY){if(d=!!x)e:{for(;x!==null;){if(x.tag===7&&(x===i||x.alternate===i)){d=!0;break e}x=x.return}d=!1}return d}if(o&Node.DOCUMENT_POSITION_CONTAINS){if(x===null)return x=y.ownerDocument,y===x||y===x.documentElement||y===x.body;e:{for(x=i,i=b(i);x!==null;){if(!(x.tag!==5&&x.tag!==3&&x.tag!==27||x!==i&&x.alternate!==i)){x=!0;break e}x=x.return}x=!1}return x}return o&Node.DOCUMENT_POSITION_PRECEDING?((i=!!x)&&!(i=x===d)&&(i=A(d,x,z),i===null?i=!1:(m(i,!0,$,x,d),x=E,E=null,i=x!==null)),i):o&Node.DOCUMENT_POSITION_FOLLOWING?((i=!!x)&&!(i=x===u)&&(i=A(u,x,z),i===null?i=!1:(m(i,!0,L,x,u),x=E,j=E=null,i=x!==null)),i):!1}function Fw(o,i){var d=o.ownerDocument.createRange();d.selectNodeContents(o),o=d.getBoundingClientRect(),window.scrollTo(window.scrollX+o.left,i?window.scrollY+o.top:window.scrollY+o.bottom-window.innerHeight)}Tn.prototype.scrollIntoView=function(o){if(typeof o=="object")throw Error(a(566));var i=[];m(this._fragmentFiber.child,!1,Fm,i,void 0,void 0);var d=o!==!1;if(i.length===0){var u=k(this._fragmentFiber);if(u=d?u[1]||u[0]||b(this._fragmentFiber):u[0]||u[1],u===null)return;if(u.tag===6){o=N(u),Fw(o,d);return}if(u=N(u),u.nodeType!==9){if(u.nodeType===11){d="host"in u?u.host:null,d!==null&&d.scrollIntoView(o);return}u.scrollIntoView(o)}}for(u=d?i.length-1:0;u!==(d?-1:i.length);){var y=i[u];y.tag===6?(y=N(y),Fw(y,d)):N(y).scrollIntoView(o),u+=d?-1:1}};function TT(o,i){return o=N(o),Bw(o,i),!1}function Bw(o,i){o.reactFragments??=new Set,o.reactFragments.add(i)}function qw(o,i){var d=i._eventListeners;if(d!==null)for(var u=0;u<d.length;u++){var y=d[u];o.addEventListener(y.type,y.attachedListener,fs(y.optionsOrUseCapture))}o.nodeType!==3&&(d=i._observers,d!==null&&d.forEach(function(x){for(var C=0,P=0;P<io.length;P++){var H=io[P];(H.fragmentInstance!==i||H.observer!==x||H.instance!==o)&&(io[C++]=H)}io.length=C,x.observe(o)}),Bw(o,i))}function AT(o,i){var d=i._eventListeners;if(d!==null)for(var u=0;u<d.length;u++){var y=d[u];o.removeEventListener(y.type,y.attachedListener,fs(y.optionsOrUseCapture))}o.nodeType!==3&&(d=i._observers,d!==null&&d.forEach(function(x){typeof x.rootMargin=="string"?ET(i,x,o):x.unobserve(o)}),o.reactFragments!=null&&o.reactFragments.delete(i))}function qm(o){var i=o.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var d=i;switch(i=i.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":qm(d),xo(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}o.removeChild(d)}}function MT(o,i,d,u){for(;o.nodeType===1;){var y=d;if(o.nodeName.toLowerCase()!==i.toLowerCase()){if(!u&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(u){if(!o[Ht])switch(i){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(x=o.getAttribute("rel"),x==="stylesheet"&&o.hasAttribute("data-precedence")||x!==y.rel||o.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||o.getAttribute("title")!==(y.title==null?null:y.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(x=o.getAttribute("src"),(x!==(y.src==null?null:y.src)||o.getAttribute("type")!==(y.type==null?null:y.type)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&x&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(i==="input"&&o.type==="hidden"){var x=y.name==null?null:""+y.name;if(y.type==="hidden"&&o.getAttribute("name")===x)return o}else return o;if(o=Vn(o.nextSibling),o===null)break}return null}function OT(o,i,d){if(i==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!d||(o=Vn(o.nextSibling),o===null))return null;return o}function Hw(o,i){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!i||(o=Vn(o.nextSibling),o===null))return null;return o}function Hm(o){return o.data==="$?"||o.data==="$~"}function Vm(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function PT(o,i){var d=o.ownerDocument;if(o.data==="$~")o._reactRetry=i;else if(o.data!=="$?"||d.readyState!=="loading")i();else{var u=function(){i(),d.removeEventListener("DOMContentLoaded",u)};d.addEventListener("DOMContentLoaded",u),o._reactRetry=u}}function Vn(o){for(;o!=null;o=o.nextSibling){var i=o.nodeType;if(i===1||i===3)break;if(i===8){if(i=o.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return o}var Km=null;function Vw(o){o=o.nextSibling;for(var i=0;o;){if(o.nodeType===8){var d=o.data;if(d==="/$"||d==="/&"){if(i===0)return Vn(o.nextSibling);i--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||i++}o=o.nextSibling}return null}function Kw(o){o=o.previousSibling;for(var i=0;o;){if(o.nodeType===8){var d=o.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(i===0)return o;i--}else d!=="/$"&&d!=="/&"||i++}o=o.previousSibling}return null}function DT(o,i){function d(){u=!0}if(o.ownerDocument.activeElement===o)return!0;var u=!1;try{o.ownerDocument.addEventListener("focus",d,!0),(o.focus||HTMLElement.prototype.focus).call(o,i)}finally{o.ownerDocument.removeEventListener("focus",d,!0)}return u}function LT(o){Tw(function(){Tw(function(i){return o(i)})})}function Ww(o,i,d){switch(i=Wl(d),o){case"html":if(o=i.documentElement,!o)throw Error(a(452));return o;case"head":if(o=i.head,!o)throw Error(a(453));return o;case"body":if(o=i.body,!o)throw Error(a(454));return o;default:throw Error(a(451))}}function Uw(o,i,d){for(var u in d){var y=d[u];d.hasOwnProperty(u)&&y!=null&&st(o,i,u,null,cT,y)}d.dangerouslySetInnerHTML!=null&&(o.textContent=""),o.onclick===wo&&(o.onclick=null),xo(o)}function Wm(o){for(var i=o.attributes;i.length;)o.removeAttributeNode(i[0]);xo(o)}var Kn=new Map,Yw=new Set;function Ul(o){if(typeof o.getRootNode=="function"){var i=o.getRootNode();if(i.nodeType===9||i.nodeType===11)return i}return o.nodeType===9?o:o.ownerDocument}var pr=de.d;de.d={f:IT,r:RT,D:zT,C:FT,L:BT,m:qT,X:VT,S:HT,M:KT};function IT(){var o=pr.f(),i=gc();return o||i}function RT(o){var i=Dr(o);i!==null&&i.tag===5&&i.type==="form"?Gb(i):pr.r(o)}var hs=typeof document>"u"?null:document;function Xw(o,i,d){var u=hs;if(u&&typeof i=="string"&&i){var y=Jn(i);y='link[rel="'+o+'"][href="'+y+'"]',typeof d=="string"&&(y+='[crossorigin="'+d+'"]'),Yw.has(y)||(Yw.add(y),o={rel:o,crossOrigin:d,href:i},u.querySelector(y)===null&&(i=u.createElement("link"),tn(i,"link",o),Ct(i),u.head.appendChild(i)))}}function zT(o){pr.D(o),Xw("dns-prefetch",o,null)}function FT(o,i){pr.C(o,i),Xw("preconnect",o,i)}function BT(o,i,d){pr.L(o,i,d);var u=hs;if(u&&o&&i){var y='link[rel="preload"][as="'+Jn(i)+'"]';i==="image"&&d&&d.imageSrcSet?(y+='[imagesrcset="'+Jn(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(y+='[imagesizes="'+Jn(d.imageSizes)+'"]')):y+='[href="'+Jn(o)+'"]';var x=y;switch(i){case"style":x=ps(o);break;case"script":x=ms(o)}if(!(Kn.has(x)||(o=M({rel:"preload",href:i==="image"&&d&&d.imageSrcSet?void 0:o,as:i},d),Kn.set(x,o),u.querySelector(y)!==null||i==="style"&&u.querySelector(Yl(x))||i==="script"&&u.querySelector(Xl(x))))){var C=u.createElement("link");tn(C,"link",o),i==="style"&&(C[xt]=!0,C.onload=C.onerror=function(){cu(C)}),Ct(C),u.head.appendChild(C)}}}function qT(o,i){pr.m(o,i);var d=hs;if(d&&o){var u=i&&typeof i.as=="string"?i.as:"script",y='link[rel="modulepreload"][as="'+Jn(u)+'"][href="'+Jn(o)+'"]',x=y;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=ms(o)}if(!Kn.has(x)&&(o=M({rel:"modulepreload",href:o},i),Kn.set(x,o),d.querySelector(y)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(Xl(x)))return}u=d.createElement("link"),tn(u,"link",o),Ct(u),d.head.appendChild(u)}}}function HT(o,i,d){pr.S(o,i,d);var u=hs;if(u&&o){var y=Ir(u).hoistableStyles,x=ps(o);i||="default";var C=y.get(x);if(!C){var P={loading:0,preload:null};if(C=u.querySelector(Yl(x)))P.loading=5;else{o=M({rel:"stylesheet",href:o,"data-precedence":i},d),(d=Kn.get(x))&&Um(o,d);var H=C=u.createElement("link");Ct(H),tn(H,"link",o),H._p=new Promise(function(ie,ce){H.onload=ie,H.onerror=ce}),H.addEventListener("load",function(){P.loading|=1}),H.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Sc(C,i,u)}C={type:"stylesheet",instance:C,count:1,state:P},y.set(x,C)}}}function VT(o,i){pr.X(o,i);var d=hs;if(d&&o){var u=Ir(d).hoistableScripts,y=ms(o),x=u.get(y);x||(x=d.querySelector(Xl(y)),x||(o=M({src:o,async:!0},i),(i=Kn.get(y))&&Ym(o,i),x=d.createElement("script"),Ct(x),tn(x,"link",o),d.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},u.set(y,x))}}function KT(o,i){pr.M(o,i);var d=hs;if(d&&o){var u=Ir(d).hoistableScripts,y=ms(o),x=u.get(y);x||(x=d.querySelector(Xl(y)),x||(o=M({src:o,async:!0,type:"module"},i),(i=Kn.get(y))&&Ym(o,i),x=d.createElement("script"),Ct(x),tn(x,"link",o),d.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},u.set(y,x))}}function Zw(o,i,d,u){var y=(y=Lt.current)?Ul(y):null;if(!y)throw Error(a(446));switch(o){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(d=ps(d.href),i=Ir(y).hoistableStyles,u=i.get(d),u||(u={type:"style",instance:null,count:0,state:null},i.set(d,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){o=ps(d.href);var x=Ir(y).hoistableStyles,C=x.get(o);if(C||(y=y.ownerDocument||y,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(o,C),(x=y.querySelector(Yl(o)))?x._p||(C.instance=x,C.state.loading=5):(x=Kn.get(o),x||(x={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},Kn.set(o,x)),WT(y,o,x,C.state))),i&&u===null)throw Error(a(528,""));return C}if(i&&u!==null)throw Error(a(529,""));return null;case"script":return i=d.async,d=d.src,typeof d=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(d=ms(d),i=Ir(y).hoistableScripts,u=i.get(d),u||(u={type:"script",instance:null,count:0,state:null},i.set(d,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,o))}}function ps(o){return'href="'+Jn(o)+'"'}function Yl(o){return'link[rel="stylesheet"]['+o+"]"}function Gw(o){return M({},o,{"data-precedence":o.precedence,precedence:null})}function WT(o,i,d,u){if(i=o.querySelector('link[rel="preload"][as="style"]['+i+"]")){if(i[xt]!==!0){u.loading=1;return}}else i=o.createElement("link"),i[xt]=!0,i.onload=i.onerror=cu.bind(null,i),tn(i,"link",d),Ct(i),o.head.appendChild(i);u.preload=i,i.addEventListener("load",function(){return u.loading|=1}),i.addEventListener("error",function(){return u.loading|=2})}function ms(o){return'[src="'+Jn(o)+'"]'}function Xl(o){return"script[async]"+o}function Qw(o,i,d){if(i.count++,i.instance===null)switch(i.type){case"style":var u=o.querySelector('style[data-href~="'+Jn(d.href)+'"]');if(u)return i.instance=u,Ct(u),u;var y=M({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return u=(o.ownerDocument||o).createElement("style"),Ct(u),tn(u,"style",y),Sc(u,d.precedence,o),i.instance=u;case"stylesheet":y=ps(d.href);var x=o.querySelector(Yl(y));if(x)return i.state.loading|=4,i.instance=x,Ct(x),x;u=Gw(d),(y=Kn.get(y))&&Um(u,y),x=(o.ownerDocument||o).createElement("link"),Ct(x);var C=x;return C._p=new Promise(function(P,H){C.onload=P,C.onerror=H}),tn(x,"link",u),i.state.loading|=4,Sc(x,d.precedence,o),i.instance=x;case"script":return x=ms(d.src),(y=o.querySelector(Xl(x)))?(i.instance=y,Ct(y),y):(u=d,(y=Kn.get(x))&&(u=M({},d),Ym(u,y)),o=o.ownerDocument||o,y=o.createElement("script"),Ct(y),tn(y,"link",u),o.head.appendChild(y),i.instance=y);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&!(i.state.loading&4)&&(u=i.instance,i.state.loading|=4,Sc(u,d.precedence,o));return i.instance}function Sc(o,i,d){for(var u=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=u.length?u[u.length-1]:null,x=y,C=0;C<u.length;C++){var P=u[C];if(P.dataset.precedence===i)x=P;else if(x!==y)break}x?x.parentNode.insertBefore(o,x.nextSibling):(i=d.nodeType===9?d.head:d,i.insertBefore(o,i.firstChild))}function Um(o,i){o.crossOrigin??=i.crossOrigin,o.referrerPolicy??=i.referrerPolicy,o.title??=i.title}function Ym(o,i){o.crossOrigin??=i.crossOrigin,o.referrerPolicy??=i.referrerPolicy,o.integrity??=i.integrity}var Nc=null;function Jw(o,i,d){if(Nc===null){var u=new Map,y=Nc=new Map;y.set(d,u)}else y=Nc,u=y.get(d),u||(u=new Map,y.set(d,u));if(u.has(o))return u;for(u.set(o,null),d=d.getElementsByTagName(o),y=0;y<d.length;y++){var x=d[y];if(!(x[Ht]||x[ke]||o==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var C=x.getAttribute(i)||"";C=o+C;var P=u.get(C);P?P.push(x):u.set(C,[x])}}return u}function Xm(o,i,d){o=o.ownerDocument||o,o.head.insertBefore(d,i==="title"?o.querySelector("head > title"):null)}function UT(o,i,d){if(d===1||i.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(o=i.disabled,typeof i.precedence=="string"&&o==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function ek(o,i){return o==="img"&&i.src!=null&&i.src!==""&&i.onLoad==null&&i.loading!=="lazy"}function tk(o){return!(o.type==="stylesheet"&&!(o.state.loading&3))}function nk(o){return(o.width||100)*(o.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function ok(o,i){typeof i.decode=="function"&&(o.imgCount++,i.complete||(o.imgBytes+=nk(i),o.suspenseyImages.push(i)),o=ZT.bind(o),i.decode().then(o,o))}function YT(o,i,d,u){if(d.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&!(d.state.loading&4)){if(d.instance===null){var y=ps(u.href),x=i.querySelector(Yl(y));if(x){i=x._p,typeof i=="object"&&i&&typeof i.then=="function"&&(o.count++,o=Zl.bind(o),i.then(o,o)),d.state.loading|=4,d.instance=x,Ct(x);return}x=i.ownerDocument||i,u=Gw(u),(y=Kn.get(y))&&Um(u,y),x=x.createElement("link"),Ct(x);var C=x;C._p=new Promise(function(P,H){C.onload=P,C.onerror=H}),tn(x,"link",u),d.instance=x}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(d,i),(i=d.state.preload)&&!(d.state.loading&3)&&(o.count++,d=Zl.bind(o),i.addEventListener("load",d),i.addEventListener("error",d))}}var jc=0;function XT(o,i){return o.stylesheets&&o.count===0&&Ec(o,o.stylesheets),0<o.count||0<o.imgCount?function(d){var u=setTimeout(function(){if(o.stylesheets&&Ec(o,o.stylesheets),o.unsuspend){var x=o.unsuspend;o.unsuspend=null,x()}},6e4+i);0<o.imgBytes&&jc===0&&(jc=62500*hT());var y=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Ec(o,o.stylesheets),o.unsuspend)){var x=o.unsuspend;o.unsuspend=null,x()}},(o.imgBytes>jc?50:800)+i);return o.unsuspend=d,function(){o.unsuspend=null,clearTimeout(u),clearTimeout(y)}}:null}function rk(o){if(o.count===0&&(o.imgCount===0||!o.waitingForImages)){if(o.stylesheets)Ec(o,o.stylesheets);else if(o.unsuspend){var i=o.unsuspend;o.unsuspend=null,i()}}}function Zl(){this.count--,rk(this)}function ZT(){this.imgCount--,rk(this)}var Cc=null;function Ec(o,i){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Cc=new Map,i.forEach(GT,o),Cc=null,Zl.call(o))}function GT(o,i){if(!(i.state.loading&4)){var d=Cc.get(o);if(d)var u=d.get(null);else{d=new Map,Cc.set(o,d);for(var y=o.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<y.length;x++){var C=y[x];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(d.set(C.dataset.precedence,C),u=C)}u&&d.set(null,u)}y=i.instance,C=y.getAttribute("data-precedence"),x=d.get(C)||u,x===u&&d.set(null,y),d.set(C,y),this.count++,u=Zl.bind(this),y.addEventListener("load",u),y.addEventListener("error",u),x?x.parentNode.insertBefore(y,x.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(y,o.firstChild)),i.state.loading|=4}}var gs={$$typeof:I,Provider:null,Consumer:null,_currentValue:me,_currentValue2:me,_threadCount:0};function QT(o,i,d,u,y,x,C,P,H){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Or(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Or(0),this.hiddenUpdates=Or(null),this.identifierPrefix=u,this.onUncaughtError=y,this.onCaughtError=x,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.transitionTypes=null,this.incompleteTransitions=new Map}function JT(o,i,d,u,y,x,C,P,H,ie,ce,ye){return o=new QT(o,i,d,C,H,ie,ce,ye,P),i=1,x===!0&&(i|=24),x=gn(3,null,null,i),o.current=x,x.stateNode=o,i=cp(),i.refCount++,o.pooledCache=i,i.refCount++,x.memoizedState={element:u,isDehydrated:d,cache:i},mp(x),o}function eA(o){return o?(o=qa,o):qa}function ik(o,i,d,u,y,x){y=eA(y),u.context===null?u.context=y:u.pendingContext=y,u=Hi(i),u.payload={element:d},x=x===void 0?null:x,x!==null&&(u.callback=x),d=Vi(o,u,i),d!==null&&(xn(d,o,i),El(d,o,i))}function ak(o,i){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<i?d:i}}function Zm(o,i){ak(o,i),(o=o.alternate)&&ak(o,i)}function sk(o){if(o.tag===13||o.tag===31){var i=Mi(o,67108864);i!==null&&xn(i,o,67108864),Zm(o,67108864)}}function lk(o){if(o.tag===13||o.tag===31){var i=Hn();i=Ma(i);var d=Mi(o,i);d!==null&&xn(d,o,i),Zm(o,i)}}var ys=!0;function tA(o,i,d,u){var y=ee.T;ee.T=null;var x=de.p;try{de.p=2,Gm(o,i,d,u)}finally{de.p=x,ee.T=y}}function nA(o,i,d,u){var y=ee.T;ee.T=null;var x=de.p;try{de.p=8,Gm(o,i,d,u)}finally{de.p=x,ee.T=y}}function Gm(o,i,d,u){if(ys){var y=Qm(u);if(y===null)Mm(o,i,u,$c,d),uk(o,u);else if(rA(y,o,i,d,u))u.stopPropagation();else if(uk(o,u),i&4&&-1<oA.indexOf(o)){for(;y!==null;){var x=Dr(y);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var C=Qn(x.pendingLanes);if(C!==0){var P=x;for(P.pendingLanes|=2,P.entangledLanes|=2;C;){var H=1<<31-qt(C);P.entanglements[1]|=H,C&=~H}hr(x),!(nt&6)&&(hc=Xt()+500,Hl(0,!1))}}break;case 31:case 13:P=Mi(x,2),P!==null&&xn(P,x,2),gc(),Zm(x,2)}if(x=Qm(u),x===null&&Mm(o,i,u,$c,d),x===y)break;y=x}y!==null&&u.stopPropagation()}else Mm(o,i,u,null,d)}}function Qm(o){return o=Rh(o),Jm(o)}var $c=null;function Jm(o){if($c=null,o=Qo(o),o!==null){var i=l(o);if(i===null)o=null;else{var d=i.tag;if(d===13){if(o=f(i),o!==null)return o;o=null}else if(d===31){if(o=p(i),o!==null)return o;o=null}else if(d===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;o=null}else i!==o&&(o=null)}}return $c=o,null}function dk(o){switch(o){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ea()){case $r:return 2;case Ni:return 8;case Xo:case $a:return 32;case _a:return 268435456;default:return 32}default:return 32}}var eg=!1,ri=null,ii=null,ai=null,Gl=new Map,Ql=new Map,si=[],oA="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function uk(o,i){switch(o){case"focusin":case"focusout":ri=null;break;case"dragenter":case"dragleave":ii=null;break;case"mouseover":case"mouseout":ai=null;break;case"pointerover":case"pointerout":Gl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ql.delete(i.pointerId)}}function Jl(o,i,d,u,y,x){return o===null||o.nativeEvent!==x?(o={blockedOn:i,domEventName:d,eventSystemFlags:u,nativeEvent:x,targetContainers:[y]},i!==null&&(i=Dr(i),i!==null&&sk(i)),o):(o.eventSystemFlags|=u,i=o.targetContainers,y!==null&&i.indexOf(y)===-1&&i.push(y),o)}function rA(o,i,d,u,y){switch(i){case"focusin":return ri=Jl(ri,o,i,d,u,y),!0;case"dragenter":return ii=Jl(ii,o,i,d,u,y),!0;case"mouseover":return ai=Jl(ai,o,i,d,u,y),!0;case"pointerover":var x=y.pointerId;return Gl.set(x,Jl(Gl.get(x)||null,o,i,d,u,y)),!0;case"gotpointercapture":return x=y.pointerId,Ql.set(x,Jl(Ql.get(x)||null,o,i,d,u,y)),!0}return!1}function ck(o){var i=Qo(o.target);if(i!==null){var d=l(i);if(d!==null){if(i=d.tag,i===13){if(i=f(d),i!==null){o.blockedOn=i,ve(o.priority,function(){lk(d)});return}}else if(i===31){if(i=p(d),i!==null){o.blockedOn=i,ve(o.priority,function(){lk(d)});return}}else if(i===3&&d.stateNode.current.memoizedState.isDehydrated){o.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}o.blockedOn=null}function _c(o){if(o.blockedOn!==null)return!1;for(var i=o.targetContainers;0<i.length;){var d=Qm(o.nativeEvent);if(d===null){d=o.nativeEvent;var u=new d.constructor(d.type,d);Ih=u,d.target.dispatchEvent(u),Ih=null}else return i=Dr(d),i!==null&&sk(i),o.blockedOn=d,!1;i.shift()}return!0}function fk(o,i,d){_c(o)&&d.delete(i)}function iA(){eg=!1,ri!==null&&_c(ri)&&(ri=null),ii!==null&&_c(ii)&&(ii=null),ai!==null&&_c(ai)&&(ai=null),Gl.forEach(fk),Ql.forEach(fk)}function Tc(o,i){o.blockedOn===i&&(o.blockedOn=null,eg||(eg=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,iA)))}var Ac=null;function hk(o){Ac!==o&&(Ac=o,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Ac===o&&(Ac=null);for(var i=0;i<o.length;i+=3){var d=o[i],u=o[i+1],y=o[i+2];if(typeof u!="function"){if(Jm(u||d)===null)continue;break}var x=Dr(d);x!==null&&(o.splice(i,3),i-=3,Lp(x,{pending:!0,data:y,method:d.method,action:u},u,y))}}))}function vs(o){function i(H){return Tc(H,o)}ri!==null&&Tc(ri,o),ii!==null&&Tc(ii,o),ai!==null&&Tc(ai,o),Gl.forEach(i),Ql.forEach(i);for(var d=0;d<si.length;d++){var u=si[d];u.blockedOn===o&&(u.blockedOn=null)}for(;0<si.length&&(d=si[0],d.blockedOn===null);)ck(d),d.blockedOn===null&&si.shift();if(d=(o.ownerDocument||o).$$reactFormReplay,d!=null)for(u=0;u<d.length;u+=3){var y=d[u],x=d[u+1],C=y[Ae]||null;if(typeof x=="function")C||hk(d);else if(C){var P=null;if(x&&x.hasAttribute("formAction")){if(y=x,C=x[Ae]||null)P=C.formAction;else if(Jm(y)!==null)continue}else P=C.action;typeof P=="function"?d[u+1]=P:(d.splice(u,3),u-=3),hk(d)}}}function aA(){function o(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(C){return y=C})},focusReset:"manual",scroll:"manual"})}function i(){y!==null&&(y(),y=null),u||setTimeout(d,20)}function d(){if(!u&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,y=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(d,100),function(){u=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),y!==null&&(y(),y=null)}}}function tg(o){this._internalRoot=o}ng.prototype.render=tg.prototype.render=function(o){var i=this._internalRoot;if(i===null)throw Error(a(409));var d=i.current;ik(d,Hn(),o,i,null,null)},ng.prototype.unmount=tg.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var i=o.containerInfo;ik(o.current,2,null,o,null,null),gc(),i[Xe]=null}};function ng(o){this._internalRoot=o}ng.prototype.unstable_scheduleHydration=function(o){if(o){var i=G();o={blockedOn:null,target:o,priority:i};for(var d=0;d<si.length&&i!==0&&i<si[d].priority;d++);si.splice(d,0,o),d===0&&ck(o)}};var pk=n.version;if(pk!=="19.3.1")throw Error(a(527,pk,"19.3.1"));de.findDOMNode=function(o){var i=o._reactInternals;if(i===void 0)throw typeof o.render=="function"?Error(a(188)):(o=Object.keys(o).join(","),Error(a(268,o)));return o=v(i),o=o===null?null:g(o),o=o===null?null:o.stateNode,o};var sA={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:ee,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Mc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mc.isDisabled&&Mc.supportsFiber)try{Dn=Mc.inject(sA),jt=Mc}catch{}}e.createRoot=function(o,i){if(!s(o))throw Error(a(299));var d=!1,u="",y=P2,x=D2,C=L2;return i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(u=i.identifierPrefix),i.onUncaughtError!==void 0&&(y=i.onUncaughtError),i.onCaughtError!==void 0&&(x=i.onCaughtError),i.onRecoverableError!==void 0&&(C=i.onRecoverableError)),i=JT(o,1,!1,null,null,d,u,null,y,x,C,aA),o[Xe]=i.current,xw(o),new tg(i)}})),bA=wn(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE=="function")try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}n(),t.exports=vA()})),xA=wn((e=>{var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(a,s,l){var f=null;if(l!==void 0&&(f=""+l),s.key!==void 0&&(f=""+s.key),"key"in s)for(var p in l={},s)p!=="key"&&(l[p]=s[p]);else l=s;return s=l.ref,{$$typeof:t,type:a,key:f,ref:s===void 0?null:s,props:l}}e.Fragment=n,e.jsx=r,e.jsxs=r})),wA=wn(((e,t)=>{t.exports=xA()})),T=yk(ed(),1),kA=bA(),c=wA();function Dt(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=Dt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var SA={value:()=>{}};function Oc(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw Error("illegal type: "+r);n[r]=[]}return new Pc(n)}function Pc(e){this._=e}function NA(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",a=n.indexOf(".");if(a>=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw Error("unknown type: "+n);return{type:n,name:r}})}Pc.prototype=Oc.prototype={constructor:Pc,on:function(e,t){var n=this._,r=NA(e+"",n),a,s=-1,l=r.length;if(arguments.length<2){for(;++s<l;)if((a=(e=r[s]).type)&&(a=jA(n[a],e.name)))return a}else{if(t!=null&&typeof t!="function")throw Error("invalid callback: "+t);for(;++s<l;)if(a=(e=r[s]).type)n[a]=bk(n[a],e.name,t);else if(t==null)for(a in n)n[a]=bk(n[a],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Pc(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=Array(a),r=0,a,s;r<a;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(s=this._[e],r=0,a=s.length;r<a;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(var r=this._[e],a=0,s=r.length;a<s;++a)r[a].value.apply(t,n)}};function jA(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function bk(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=SA,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var xk={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Dc(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),xk.hasOwnProperty(t)?{space:xk[t],local:e}:e}function CA(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n==="http://www.w3.org/1999/xhtml"&&t.documentElement.namespaceURI==="http://www.w3.org/1999/xhtml"?t.createElement(e):t.createElementNS(n,e)}}function EA(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function wk(e){var t=Dc(e);return(t.local?EA:CA)(t)}function $A(){}function og(e){return e==null?$A:function(){return this.querySelector(e)}}function _A(e){typeof e!="function"&&(e=og(e));for(var t=this._groups,n=t.length,r=Array(n),a=0;a<n;++a)for(var s=t[a],l=s.length,f=r[a]=Array(l),p,h,v=0;v<l;++v)(p=s[v])&&(h=e.call(p,p.__data__,v,s))&&("__data__"in p&&(h.__data__=p.__data__),f[v]=h);return new An(r,this._parents)}function TA(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function AA(){return[]}function kk(e){return e==null?AA:function(){return this.querySelectorAll(e)}}function MA(e){return function(){return TA(e.apply(this,arguments))}}function OA(e){e=typeof e=="function"?MA(e):kk(e);for(var t=this._groups,n=t.length,r=[],a=[],s=0;s<n;++s)for(var l=t[s],f=l.length,p,h=0;h<f;++h)(p=l[h])&&(r.push(e.call(p,p.__data__,h,l)),a.push(p));return new An(r,a)}function Sk(e){return function(){return this.matches(e)}}function Nk(e){return function(t){return t.matches(e)}}var PA=Array.prototype.find;function DA(e){return function(){return PA.call(this.children,e)}}function LA(){return this.firstElementChild}function IA(e){return this.select(e==null?LA:DA(typeof e=="function"?e:Nk(e)))}var RA=Array.prototype.filter;function zA(){return Array.from(this.children)}function FA(e){return function(){return RA.call(this.children,e)}}function BA(e){return this.selectAll(e==null?zA:FA(typeof e=="function"?e:Nk(e)))}function qA(e){typeof e!="function"&&(e=Sk(e));for(var t=this._groups,n=t.length,r=Array(n),a=0;a<n;++a)for(var s=t[a],l=s.length,f=r[a]=[],p,h=0;h<l;++h)(p=s[h])&&e.call(p,p.__data__,h,s)&&f.push(p);return new An(r,this._parents)}function jk(e){return Array(e.length)}function HA(){return new An(this._enter||this._groups.map(jk),this._parents)}function Lc(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Lc.prototype={constructor:Lc,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 VA(e){return function(){return e}}function KA(e,t,n,r,a,s){for(var l=0,f,p=t.length,h=s.length;l<h;++l)(f=t[l])?(f.__data__=s[l],r[l]=f):n[l]=new Lc(e,s[l]);for(;l<p;++l)(f=t[l])&&(a[l]=f)}function WA(e,t,n,r,a,s,l){var f,p,h=new Map,v=t.length,g=s.length,m=Array(v),b;for(f=0;f<v;++f)(p=t[f])&&(m[f]=b=l.call(p,p.__data__,f,t)+"",h.has(b)?a[f]=p:h.set(b,p));for(f=0;f<g;++f)b=l.call(e,s[f],f,s)+"",(p=h.get(b))?(r[f]=p,p.__data__=s[f],h.delete(b)):n[f]=new Lc(e,s[f]);for(f=0;f<v;++f)(p=t[f])&&h.get(m[f])===p&&(a[f]=p)}function UA(e){return e.__data__}function YA(e,t){if(!arguments.length)return Array.from(this,UA);var n=t?WA:KA,r=this._parents,a=this._groups;typeof e!="function"&&(e=VA(e));for(var s=a.length,l=Array(s),f=Array(s),p=Array(s),h=0;h<s;++h){var v=r[h],g=a[h],m=g.length,b=XA(e.call(v,v&&v.__data__,h,r)),w=b.length,k=f[h]=Array(w),S=l[h]=Array(w);n(v,g,k,S,p[h]=Array(m),b,t);for(var N=0,E=0,j,$;N<w;++N)if(j=k[N]){for(N>=E&&(E=N+1);!($=S[E])&&++E<w;);j._next=$||null}}return l=new An(l,r),l._enter=f,l._exit=p,l}function XA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ZA(){return new An(this._exit||this._groups.map(jk),this._parents)}function GA(e,t,n){var r=this.enter(),a=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&=r.selection()):r=r.append(e+""),t!=null&&(a=t(a),a&&=a.selection()),n==null?s.remove():n(s),r&&a?r.merge(a).order():a}function QA(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,s=r.length,l=Math.min(a,s),f=Array(a),p=0;p<l;++p)for(var h=n[p],v=r[p],g=h.length,m=f[p]=Array(g),b,w=0;w<g;++w)(b=h[w]||v[w])&&(m[w]=b);for(;p<a;++p)f[p]=n[p];return new An(f,this._parents)}function JA(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],a=r.length-1,s=r[a],l;--a>=0;)(l=r[a])&&(s&&l.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(l,s),s=l);return this}function eM(e){e||=tM;function t(g,m){return g&&m?e(g.__data__,m.__data__):!g-!m}for(var n=this._groups,r=n.length,a=Array(r),s=0;s<r;++s){for(var l=n[s],f=l.length,p=a[s]=Array(f),h,v=0;v<f;++v)(h=l[v])&&(p[v]=h);p.sort(t)}return new An(a,this._parents).order()}function tM(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function nM(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function oM(){return Array.from(this)}function rM(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,s=r.length;a<s;++a){var l=r[a];if(l)return l}return null}function iM(){let e=0;for(let t of this)++e;return e}function aM(){return!this.node()}function sM(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a=t[n],s=0,l=a.length,f;s<l;++s)(f=a[s])&&e.call(f,f.__data__,s,a);return this}function lM(e){return function(){this.removeAttribute(e)}}function dM(e){return function(){this.removeAttributeNS(e.space,e.local)}}function uM(e,t){return function(){this.setAttribute(e,t)}}function cM(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function fM(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function hM(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 pM(e,t){var n=Dc(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?dM:lM:typeof t=="function"?n.local?hM:fM:n.local?cM:uM)(n,t))}function Ck(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function mM(e){return function(){this.style.removeProperty(e)}}function gM(e,t,n){return function(){this.style.setProperty(e,t,n)}}function yM(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function vM(e,t,n){return arguments.length>1?this.each((t==null?mM:typeof t=="function"?yM:gM)(e,t,n??"")):bs(this.node(),e)}function bs(e,t){return e.style.getPropertyValue(t)||Ck(e).getComputedStyle(e,null).getPropertyValue(t)}function bM(e){return function(){delete this[e]}}function xM(e,t){return function(){this[e]=t}}function wM(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function kM(e,t){return arguments.length>1?this.each((t==null?bM:typeof t=="function"?wM:xM)(e,t)):this.node()[e]}function Ek(e){return e.trim().split(/^|\s+/)}function rg(e){return e.classList||new $k(e)}function $k(e){this._node=e,this._names=Ek(e.getAttribute("class")||"")}$k.prototype={add:function(e){this._names.indexOf(e)<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 _k(e,t){for(var n=rg(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function Tk(e,t){for(var n=rg(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function SM(e){return function(){_k(this,e)}}function NM(e){return function(){Tk(this,e)}}function jM(e,t){return function(){(t.apply(this,arguments)?_k:Tk)(this,e)}}function CM(e,t){var n=Ek(e+"");if(arguments.length<2){for(var r=rg(this.node()),a=-1,s=n.length;++a<s;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?jM:t?SM:NM)(n,t))}function EM(){this.textContent=""}function $M(e){return function(){this.textContent=e}}function _M(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function TM(e){return arguments.length?this.each(e==null?EM:(typeof e=="function"?_M:$M)(e)):this.node().textContent}function AM(){this.innerHTML=""}function MM(e){return function(){this.innerHTML=e}}function OM(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function PM(e){return arguments.length?this.each(e==null?AM:(typeof e=="function"?OM:MM)(e)):this.node().innerHTML}function DM(){this.nextSibling&&this.parentNode.appendChild(this)}function LM(){return this.each(DM)}function IM(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function RM(){return this.each(IM)}function zM(e){var t=typeof e=="function"?e:wk(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function FM(){return null}function BM(e,t){var n=typeof e=="function"?e:wk(e),r=t==null?FM:typeof t=="function"?t:og(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function qM(){var e=this.parentNode;e&&e.removeChild(this)}function HM(){return this.each(qM)}function VM(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function KM(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function WM(e){return this.select(e?KM:VM)}function UM(e){return arguments.length?this.property("__data__",e):this.node().__data__}function YM(e){return function(t){e.call(this,t,this.__data__)}}function XM(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 ZM(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,s;n<a;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function GM(e,t,n){return function(){var r=this.__on,a,s=YM(t);if(r){for(var l=0,f=r.length;l<f;++l)if((a=r[l]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=s,a.options=n),a.value=t;return}}this.addEventListener(e.type,s,n),a={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(a):this.__on=[a]}}function QM(e,t,n){var r=XM(e+""),a,s=r.length,l;if(arguments.length<2){var f=this.node().__on;if(f){for(var p=0,h=f.length,v;p<h;++p)for(a=0,v=f[p];a<s;++a)if((l=r[a]).type===v.type&&l.name===v.name)return v.value}}else{for(f=t?GM:ZM,a=0;a<s;++a)this.each(f(r[a],t,n));return this}}function Ak(e,t,n){var r=Ck(e),a=r.CustomEvent;typeof a=="function"?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function JM(e,t){return function(){return Ak(this,e,t)}}function eO(e,t){return function(){return Ak(this,e,t.apply(this,arguments))}}function tO(e,t){return this.each((typeof t=="function"?eO:JM)(e,t))}function*nO(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,s=r.length,l;a<s;++a)(l=r[a])&&(yield l)}var Mk=[null];function An(e,t){this._groups=e,this._parents=t}function td(){return new An([[document.documentElement]],Mk)}function oO(){return this}An.prototype=td.prototype={constructor:An,select:_A,selectAll:OA,selectChild:IA,selectChildren:BA,filter:qA,data:YA,enter:HA,exit:ZA,join:GA,merge:QA,selection:oO,order:JA,sort:eM,call:nM,nodes:oM,node:rM,size:iM,empty:aM,each:sM,attr:pM,style:vM,property:kM,classed:CM,text:TM,html:PM,raise:LM,lower:RM,append:zM,insert:BM,remove:HM,clone:WM,datum:UM,on:QM,dispatch:tO,[Symbol.iterator]:nO};function Mn(e){return typeof e=="string"?new An([[document.querySelector(e)]],[document.documentElement]):new An([[e]],Mk)}function rO(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ao(e,t){if(e=rO(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 a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}var iO={passive:!1},nd={capture:!0,passive:!1};function ig(e){e.stopImmediatePropagation()}function xs(e){e.preventDefault(),e.stopImmediatePropagation()}function Ok(e){var t=e.document.documentElement,n=Mn(e).on("dragstart.drag",xs,nd);"onselectstart"in t?n.on("selectstart.drag",xs,nd):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Pk(e,t){var n=e.document.documentElement,r=Mn(e).on("dragstart.drag",null);t&&(r.on("click.drag",xs,nd),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Ic=e=>()=>e;function ag(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:s,x:l,y:f,dx:p,dy:h,dispatch:v}){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:a,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:p,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:v}})}ag.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function aO(e){return!e.ctrlKey&&!e.button}function sO(){return this.parentNode}function lO(e,t){return t??{x:e.x,y:e.y}}function dO(){return navigator.maxTouchPoints||"ontouchstart"in this}function Dk(){var e=aO,t=sO,n=lO,r=dO,a={},s=Oc("start","drag","end"),l=0,f,p,h,v,g=0;function m($){$.on("mousedown.drag",b).filter(r).on("touchstart.drag",S).on("touchmove.drag",N,iO).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b($,L){if(!v&&e.call(this,$,L)){var z=j(this,t.call(this,$,L),$,L,"mouse");z&&(Mn($.view).on("mousemove.drag",w,nd).on("mouseup.drag",k,nd),Ok($.view),ig($),h=!1,f=$.clientX,p=$.clientY,z("start",$))}}function w($){if(xs($),!h){var L=$.clientX-f,z=$.clientY-p;h=L*L+z*z>g}a.mouse("drag",$)}function k($){Mn($.view).on("mousemove.drag mouseup.drag",null),Pk($.view,h),xs($),a.mouse("end",$)}function S($,L){if(e.call(this,$,L))for(var z=$.changedTouches,A=t.call(this,$,L),M=z.length,O=0,K;O<M;++O)(K=j(this,A,$,L,z[O].identifier,z[O]))&&(ig($),K("start",$,z[O]))}function N($){for(var L=$.changedTouches,z=L.length,A=0,M;A<z;++A)(M=a[L[A].identifier])&&(xs($),M("drag",$,L[A]))}function E($){var L=$.changedTouches,z=L.length,A,M;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),A=0;A<z;++A)(M=a[L[A].identifier])&&(ig($),M("end",$,L[A]))}function j($,L,z,A,M,O){var K=s.copy(),B=ao(O||z,L),V,oe,F;if((F=n.call($,new ag("beforestart",{sourceEvent:z,target:m,identifier:M,active:l,x:B[0],y:B[1],dx:0,dy:0,dispatch:K}),A))!=null)return V=F.x-B[0]||0,oe=F.y-B[1]||0,function J(I,U,W){var re=B,le;switch(I){case"start":a[M]=J,le=l++;break;case"end":delete a[M],--l;case"drag":B=ao(W||U,L),le=l}K.call(I,$,new ag(I,{sourceEvent:U,subject:F,target:m,identifier:M,active:le,x:B[0]+V,y:B[1]+oe,dx:B[0]-re[0],dy:B[1]-re[1],dispatch:K}),A)}}return m.filter=function($){return arguments.length?(e=typeof $=="function"?$:Ic(!!$),m):e},m.container=function($){return arguments.length?(t=typeof $=="function"?$:Ic($),m):t},m.subject=function($){return arguments.length?(n=typeof $=="function"?$:Ic($),m):n},m.touchable=function($){return arguments.length?(r=typeof $=="function"?$:Ic(!!$),m):r},m.on=function(){var $=s.on.apply(s,arguments);return $===s?m:$},m.clickDistance=function($){return arguments.length?(g=($=+$)*$,m):Math.sqrt(g)},m}function sg(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Lk(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function od(){}var rd=.7,Rc=1/rd,ws="\\s*([+-]?\\d+)\\s*",id="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ao="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",uO=/^#([0-9a-f]{3,8})$/,cO=RegExp(`^rgb\\(${ws},${ws},${ws}\\)$`),fO=RegExp(`^rgb\\(${Ao},${Ao},${Ao}\\)$`),hO=RegExp(`^rgba\\(${ws},${ws},${ws},${id}\\)$`),pO=RegExp(`^rgba\\(${Ao},${Ao},${Ao},${id}\\)$`),mO=RegExp(`^hsl\\(${id},${Ao},${Ao}\\)$`),gO=RegExp(`^hsla\\(${id},${Ao},${Ao},${id}\\)$`),Ik={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};sg(od,Qi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Rk,formatHex:Rk,formatHex8:yO,formatHsl:vO,formatRgb:zk,toString:zk});function Rk(){return this.rgb().formatHex()}function yO(){return this.rgb().formatHex8()}function vO(){return Vk(this).formatHsl()}function zk(){return this.rgb().formatRgb()}function Qi(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=uO.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Fk(t):n===3?new kn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?zc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?zc(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=cO.exec(e))?new kn(t[1],t[2],t[3],1):(t=fO.exec(e))?new kn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=hO.exec(e))?zc(t[1],t[2],t[3],t[4]):(t=pO.exec(e))?zc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=mO.exec(e))?Hk(t[1],t[2]/100,t[3]/100,1):(t=gO.exec(e))?Hk(t[1],t[2]/100,t[3]/100,t[4]):Ik.hasOwnProperty(e)?Fk(Ik[e]):e==="transparent"?new kn(NaN,NaN,NaN,0):null}function Fk(e){return new kn(e>>16&255,e>>8&255,e&255,1)}function zc(e,t,n,r){return r<=0&&(e=t=n=NaN),new kn(e,t,n,r)}function bO(e){return e instanceof od||(e=Qi(e)),e?(e=e.rgb(),new kn(e.r,e.g,e.b,e.opacity)):new kn}function lg(e,t,n,r){return arguments.length===1?bO(e):new kn(e,t,n,r??1)}function kn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}sg(kn,lg,Lk(od,{brighter(e){return e=e==null?Rc:Rc**+e,new kn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?rd:rd**+e,new kn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new kn(Ji(this.r),Ji(this.g),Ji(this.b),Fc(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:Bk,formatHex:Bk,formatHex8:xO,formatRgb:qk,toString:qk}));function Bk(){return`#${ea(this.r)}${ea(this.g)}${ea(this.b)}`}function xO(){return`#${ea(this.r)}${ea(this.g)}${ea(this.b)}${ea((isNaN(this.opacity)?1:this.opacity)*255)}`}function qk(){let e=Fc(this.opacity);return`${e===1?"rgb(":"rgba("}${Ji(this.r)}, ${Ji(this.g)}, ${Ji(this.b)}${e===1?")":`, ${e})`}`}function Fc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ji(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ea(e){return e=Ji(e),(e<16?"0":"")+e.toString(16)}function Hk(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new so(e,t,n,r)}function Vk(e){if(e instanceof so)return new so(e.h,e.s,e.l,e.opacity);if(e instanceof od||(e=Qi(e)),!e)return new so;if(e instanceof so)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),s=Math.max(t,n,r),l=NaN,f=s-a,p=(s+a)/2;return f?(l=t===s?(n-r)/f+(n<r)*6:n===s?(r-t)/f+2:(t-n)/f+4,f/=p<.5?s+a:2-s-a,l*=60):f=p>0&&p<1?0:l,new so(l,f,p,e.opacity)}function wO(e,t,n,r){return arguments.length===1?Vk(e):new so(e,t,n,r??1)}function so(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}sg(so,wO,Lk(od,{brighter(e){return e=e==null?Rc:Rc**+e,new so(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?rd:rd**+e,new so(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,a=2*n-r;return new kn(dg(e>=240?e-240:e+120,a,r),dg(e,a,r),dg(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new so(Kk(this.h),Bc(this.s),Bc(this.l),Fc(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(){let e=Fc(this.opacity);return`${e===1?"hsl(":"hsla("}${Kk(this.h)}, ${Bc(this.s)*100}%, ${Bc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Kk(e){return e=(e||0)%360,e<0?e+360:e}function Bc(e){return Math.max(0,Math.min(1,e||0))}function dg(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var ug=e=>()=>e;function kO(e,t){return function(n){return e+n*t}}function SO(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function NO(e){return(e=+e)==1?Wk:function(t,n){return n-t?SO(t,n,e):ug(isNaN(t)?n:t)}}function Wk(e,t){var n=t-e;return n?kO(e,n):ug(isNaN(e)?t:e)}var qc=(function e(t){var n=NO(t);function r(a,s){var l=n((a=lg(a)).r,(s=lg(s)).r),f=n(a.g,s.g),p=n(a.b,s.b),h=Wk(a.opacity,s.opacity);return function(v){return a.r=l(v),a.g=f(v),a.b=p(v),a.opacity=h(v),a+""}}return r.gamma=e,r})(1);function jO(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(s){for(a=0;a<n;++a)r[a]=e[a]*(1-s)+t[a]*s;return r}}function CO(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function EO(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=Array(r),s=Array(n),l=0;l<r;++l)a[l]=ad(e[l],t[l]);for(;l<n;++l)s[l]=t[l];return function(f){for(l=0;l<r;++l)s[l]=a[l](f);return s}}function $O(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Mo(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function _O(e,t){var n={},r={},a;for(a in typeof e=="object"&&e||(e={}),typeof t=="object"&&t||(t={}),t)a in e?n[a]=ad(e[a],t[a]):r[a]=t[a];return function(s){for(a in n)r[a]=n[a](s);return r}}var cg=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,fg=new RegExp(cg.source,"g");function TO(e){return function(){return e}}function AO(e){return function(t){return e(t)+""}}function Uk(e,t){var n=cg.lastIndex=fg.lastIndex=0,r,a,s,l=-1,f=[],p=[];for(e+="",t+="";(r=cg.exec(e))&&(a=fg.exec(t));)(s=a.index)>n&&(s=t.slice(n,s),f[l]?f[l]+=s:f[++l]=s),(r=r[0])===(a=a[0])?f[l]?f[l]+=a:f[++l]=a:(f[++l]=null,p.push({i:l,x:Mo(r,a)})),n=fg.lastIndex;return n<t.length&&(s=t.slice(n),f[l]?f[l]+=s:f[++l]=s),f.length<2?p[0]?AO(p[0].x):TO(t):(t=p.length,function(h){for(var v=0,g;v<t;++v)f[(g=p[v]).i]=g.x(h);return f.join("")})}function ad(e,t){var n=typeof t,r;return t==null||n==="boolean"?ug(t):(n==="number"?Mo:n==="string"?(r=Qi(t))?(t=r,qc):Uk:t instanceof Qi?qc:t instanceof Date?$O:CO(t)?jO:Array.isArray(t)?EO:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?_O:Mo)(e,t)}var Yk=180/Math.PI,Xk={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Zk(e,t,n,r,a,s){var l,f,p;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(p=e*n+t*r)&&(n-=e*p,r-=t*p),(f=Math.sqrt(n*n+r*r))&&(n/=f,r/=f,p/=f),e*r<t*n&&(e=-e,t=-t,p=-p,l=-l),{translateX:a,translateY:s,rotate:Math.atan2(t,e)*Yk,skewX:Math.atan(p)*Yk,scaleX:l,scaleY:f}}var hg;function MO(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Xk:Zk(t.a,t.b,t.c,t.d,t.e,t.f)}function OO(e){return e==null||(hg||=document.createElementNS("http://www.w3.org/2000/svg","g"),hg.setAttribute("transform",e),!(e=hg.transform.baseVal.consolidate()))?Xk:(e=e.matrix,Zk(e.a,e.b,e.c,e.d,e.e,e.f))}function Gk(e,t,n,r){function a(h){return h.length?h.pop()+" ":""}function s(h,v,g,m,b,w){if(h!==g||v!==m){var k=b.push("translate(",null,t,null,n);w.push({i:k-4,x:Mo(h,g)},{i:k-2,x:Mo(v,m)})}else(g||m)&&b.push("translate("+g+t+m+n)}function l(h,v,g,m){h===v?v&&g.push(a(g)+"rotate("+v+r):(h-v>180?v+=360:v-h>180&&(h+=360),m.push({i:g.push(a(g)+"rotate(",null,r)-2,x:Mo(h,v)}))}function f(h,v,g,m){h===v?v&&g.push(a(g)+"skewX("+v+r):m.push({i:g.push(a(g)+"skewX(",null,r)-2,x:Mo(h,v)})}function p(h,v,g,m,b,w){if(h!==g||v!==m){var k=b.push(a(b)+"scale(",null,",",null,")");w.push({i:k-4,x:Mo(h,g)},{i:k-2,x:Mo(v,m)})}else(g!==1||m!==1)&&b.push(a(b)+"scale("+g+","+m+")")}return function(h,v){var g=[],m=[];return h=e(h),v=e(v),s(h.translateX,h.translateY,v.translateX,v.translateY,g,m),l(h.rotate,v.rotate,g,m),f(h.skewX,v.skewX,g,m),p(h.scaleX,h.scaleY,v.scaleX,v.scaleY,g,m),h=v=null,function(b){for(var w=-1,k=m.length,S;++w<k;)g[(S=m[w]).i]=S.x(b);return g.join("")}}}var PO=Gk(MO,"px, ","px)","deg)"),DO=Gk(OO,", ",")",")"),LO=1e-12;function Qk(e){return((e=Math.exp(e))+1/e)/2}function IO(e){return((e=Math.exp(e))-1/e)/2}function RO(e){return((e=Math.exp(2*e))-1)/(e+1)}var Hc=(function e(t,n,r){function a(s,l){var f=s[0],p=s[1],h=s[2],v=l[0],g=l[1],m=l[2],b=v-f,w=g-p,k=b*b+w*w,S,N;if(k<LO)N=Math.log(m/h)/t,S=function(z){return[f+z*b,p+z*w,h*Math.exp(t*z*N)]};else{var E=Math.sqrt(k),j=(m*m-h*h+r*k)/(2*h*n*E),$=(m*m-h*h-r*k)/(2*m*n*E),L=Math.log(Math.sqrt(j*j+1)-j);N=(Math.log(Math.sqrt($*$+1)-$)-L)/t,S=function(z){var A=z*N,M=Qk(L),O=h/(n*E)*(M*RO(t*A+L)-IO(L));return[f+O*b,p+O*w,h*M/Qk(t*A+L)]}}return S.duration=N*1e3*t/Math.SQRT2,S}return a.rho=function(s){var l=Math.max(.001,+s),f=l*l;return e(l,f,f*f)},a})(Math.SQRT2,2,4),ks=0,Vc=0,pg=0,Jk=1e3,Kc,sd,Wc=0,Ss=0,Uc=0,ld=typeof performance=="object"&&performance.now?performance:Date,e1=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function mg(){return Ss||=(e1(zO),ld.now()+Uc)}function zO(){Ss=0}function Yc(){this._call=this._time=this._next=null}Yc.prototype=t1.prototype={constructor:Yc,restart:function(e,t,n){if(typeof e!="function")throw TypeError("callback is not a function");n=(n==null?mg():+n)+(t==null?0:+t),!this._next&&sd!==this&&(sd?sd._next=this:Kc=this,sd=this),this._call=e,this._time=n,gg()},stop:function(){this._call&&(this._call=null,this._time=1/0,gg())}};function t1(e,t,n){var r=new Yc;return r.restart(e,t,n),r}function FO(){mg(),++ks;for(var e=Kc,t;e;)(t=Ss-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ks}function n1(){Ss=(Wc=ld.now())+Uc,ks=Vc=0;try{FO()}finally{ks=0,qO(),Ss=0}}function BO(){var e=ld.now(),t=e-Wc;t>Jk&&(Uc-=t,Wc=e)}function qO(){for(var e,t=Kc,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:Kc=n);sd=e,gg(r)}function gg(e){ks||(Vc&&=clearTimeout(Vc),e-Ss>24?(e<1/0&&(Vc=setTimeout(n1,e-ld.now()-Uc)),pg&&=clearInterval(pg)):(pg||=(Wc=ld.now(),setInterval(BO,Jk)),ks=1,e1(n1)))}function o1(e,t,n){var r=new Yc;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var HO=Oc("start","end","cancel","interrupt"),VO=[];function Xc(e,t,n,r,a,s){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;KO(e,n,{name:t,index:r,group:a,on:HO,tween:VO,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:0})}function yg(e,t){var n=lo(e,t);if(n.state>0)throw Error("too late; already scheduled");return n}function Oo(e,t){var n=lo(e,t);if(n.state>3)throw Error("too late; already running");return n}function lo(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error("transition not found");return n}function KO(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=t1(s,0,n.time);function s(h){n.state=1,n.timer.restart(l,n.delay,n.time),n.delay<=h&&l(h-n.delay)}function l(h){var v,g,m,b;if(n.state!==1)return p();for(v in r)if(b=r[v],b.name===n.name){if(b.state===3)return o1(l);b.state===4?(b.state=6,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete r[v]):+v<t&&(b.state=6,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete r[v])}if(o1(function(){n.state===3&&(n.state=4,n.timer.restart(f,n.delay,n.time),f(h))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,a=Array(m=n.tween.length),v=0,g=-1;v<m;++v)(b=n.tween[v].value.call(e,e.__data__,n.index,n.group))&&(a[++g]=b);a.length=g+1}}function f(h){for(var v=h<n.duration?n.ease.call(null,h/n.duration):(n.timer.restart(p),n.state=5,1),g=-1,m=a.length;++g<m;)a[g].call(e,v);n.state===5&&(n.on.call("end",e,e.__data__,n.index,n.group),p())}function p(){for(var h in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function Zc(e,t){var n=e.__transition,r,a,s=!0,l;if(n){for(l in t=t==null?null:t+"",n)(r=n[l]).name===t?(a=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[l]):s=!1;s&&delete e.__transition}}function WO(e){return this.each(function(){Zc(this,e)})}function UO(e,t){var n,r;return function(){var a=Oo(this,e),s=a.tween;if(s!==n){r=n=s;for(var l=0,f=r.length;l<f;++l)if(r[l].name===t){r=r.slice(),r.splice(l,1);break}}a.tween=r}}function YO(e,t,n){var r,a;if(typeof n!="function")throw Error();return function(){var s=Oo(this,e),l=s.tween;if(l!==r){a=(r=l).slice();for(var f={name:t,value:n},p=0,h=a.length;p<h;++p)if(a[p].name===t){a[p]=f;break}p===h&&a.push(f)}s.tween=a}}function XO(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=lo(this.node(),n).tween,a=0,s=r.length,l;a<s;++a)if((l=r[a]).name===e)return l.value;return null}return this.each((t==null?UO:YO)(n,e,t))}function vg(e,t,n){var r=e._id;return e.each(function(){var a=Oo(this,r);(a.value||={})[t]=n.apply(this,arguments)}),function(a){return lo(a,r).value[t]}}function r1(e,t){var n;return(typeof t=="number"?Mo:t instanceof Qi?qc:(n=Qi(t))?(t=n,qc):Uk)(e,t)}function ZO(e){return function(){this.removeAttribute(e)}}function GO(e){return function(){this.removeAttributeNS(e.space,e.local)}}function QO(e,t,n){var r,a=n+"",s;return function(){var l=this.getAttribute(e);return l===a?null:l===r?s:s=t(r=l,n)}}function JO(e,t,n){var r,a=n+"",s;return function(){var l=this.getAttributeNS(e.space,e.local);return l===a?null:l===r?s:s=t(r=l,n)}}function eP(e,t,n){var r,a,s;return function(){var l,f=n(this),p;return f==null?void this.removeAttribute(e):(l=this.getAttribute(e),p=f+"",l===p?null:l===r&&p===a?s:(a=p,s=t(r=l,f)))}}function tP(e,t,n){var r,a,s;return function(){var l,f=n(this),p;return f==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),p=f+"",l===p?null:l===r&&p===a?s:(a=p,s=t(r=l,f)))}}function nP(e,t){var n=Dc(e),r=n==="transform"?DO:r1;return this.attrTween(e,typeof t=="function"?(n.local?tP:eP)(n,r,vg(this,"attr."+e,t)):t==null?(n.local?GO:ZO)(n):(n.local?JO:QO)(n,r,t))}function oP(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function rP(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function iP(e,t){var n,r;function a(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&rP(e,s)),n}return a._value=t,a}function aP(e,t){var n,r;function a(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&oP(e,s)),n}return a._value=t,a}function sP(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 Error();var r=Dc(e);return this.tween(n,(r.local?iP:aP)(r,t))}function lP(e,t){return function(){yg(this,e).delay=+t.apply(this,arguments)}}function dP(e,t){return t=+t,function(){yg(this,e).delay=t}}function uP(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?lP:dP)(t,e)):lo(this.node(),t).delay}function cP(e,t){return function(){Oo(this,e).duration=+t.apply(this,arguments)}}function fP(e,t){return t=+t,function(){Oo(this,e).duration=t}}function hP(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?cP:fP)(t,e)):lo(this.node(),t).duration}function pP(e,t){if(typeof t!="function")throw Error();return function(){Oo(this,e).ease=t}}function mP(e){var t=this._id;return arguments.length?this.each(pP(t,e)):lo(this.node(),t).ease}function gP(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw Error();Oo(this,e).ease=n}}function yP(e){if(typeof e!="function")throw Error();return this.each(gP(this._id,e))}function vP(e){typeof e!="function"&&(e=Sk(e));for(var t=this._groups,n=t.length,r=Array(n),a=0;a<n;++a)for(var s=t[a],l=s.length,f=r[a]=[],p,h=0;h<l;++h)(p=s[h])&&e.call(p,p.__data__,h,s)&&f.push(p);return new mr(r,this._parents,this._name,this._id)}function bP(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,a=n.length,s=Math.min(r,a),l=Array(r),f=0;f<s;++f)for(var p=t[f],h=n[f],v=p.length,g=l[f]=Array(v),m,b=0;b<v;++b)(m=p[b]||h[b])&&(g[b]=m);for(;f<r;++f)l[f]=t[f];return new mr(l,this._parents,this._name,this._id)}function xP(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 wP(e,t,n){var r,a,s=xP(t)?yg:Oo;return function(){var l=s(this,e),f=l.on;f!==r&&(a=(r=f).copy()).on(t,n),l.on=a}}function kP(e,t){var n=this._id;return arguments.length<2?lo(this.node(),n).on.on(e):this.each(wP(n,e,t))}function SP(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function NP(){return this.on("end.remove",SP(this._id))}function jP(e){var t=this._name,n=this._id;typeof e!="function"&&(e=og(e));for(var r=this._groups,a=r.length,s=Array(a),l=0;l<a;++l)for(var f=r[l],p=f.length,h=s[l]=Array(p),v,g,m=0;m<p;++m)(v=f[m])&&(g=e.call(v,v.__data__,m,f))&&("__data__"in v&&(g.__data__=v.__data__),h[m]=g,Xc(h[m],t,n,m,h,lo(v,n)));return new mr(s,this._parents,t,n)}function CP(e){var t=this._name,n=this._id;typeof e!="function"&&(e=kk(e));for(var r=this._groups,a=r.length,s=[],l=[],f=0;f<a;++f)for(var p=r[f],h=p.length,v,g=0;g<h;++g)if(v=p[g]){for(var m=e.call(v,v.__data__,g,p),b,w=lo(v,n),k=0,S=m.length;k<S;++k)(b=m[k])&&Xc(b,t,n,k,m,w);s.push(m),l.push(v)}return new mr(s,l,t,n)}var EP=td.prototype.constructor;function $P(){return new EP(this._groups,this._parents)}function _P(e,t){var n,r,a;return function(){var s=bs(this,e),l=(this.style.removeProperty(e),bs(this,e));return s===l?null:s===n&&l===r?a:a=t(n=s,r=l)}}function i1(e){return function(){this.style.removeProperty(e)}}function TP(e,t,n){var r,a=n+"",s;return function(){var l=bs(this,e);return l===a?null:l===r?s:s=t(r=l,n)}}function AP(e,t,n){var r,a,s;return function(){var l=bs(this,e),f=n(this),p=f+"";return f??(p=f=(this.style.removeProperty(e),bs(this,e))),l===p?null:l===r&&p===a?s:(a=p,s=t(r=l,f))}}function MP(e,t){var n,r,a,s="style."+t,l="end."+s,f;return function(){var p=Oo(this,e),h=p.on,v=p.value[s]==null?f||=i1(t):void 0;(h!==n||a!==v)&&(r=(n=h).copy()).on(l,a=v),p.on=r}}function OP(e,t,n){var r=(e+="")=="transform"?PO:r1;return t==null?this.styleTween(e,_P(e,r)).on("end.style."+e,i1(e)):typeof t=="function"?this.styleTween(e,AP(e,r,vg(this,"style."+e,t))).each(MP(this._id,e)):this.styleTween(e,TP(e,r,t),n).on("end.style."+e,null)}function PP(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function DP(e,t,n){var r,a;function s(){var l=t.apply(this,arguments);return l!==a&&(r=(a=l)&&PP(e,l,n)),r}return s._value=t,s}function LP(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 Error();return this.tween(r,DP(e,t,n??""))}function IP(e){return function(){this.textContent=e}}function RP(e){return function(){var t=e(this);this.textContent=t??""}}function zP(e){return this.tween("text",typeof e=="function"?RP(vg(this,"text",e)):IP(e==null?"":e+""))}function FP(e){return function(t){this.textContent=e.call(this,t)}}function BP(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&FP(a)),t}return r._value=e,r}function qP(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 Error();return this.tween(t,BP(e))}function HP(){for(var e=this._name,t=this._id,n=a1(),r=this._groups,a=r.length,s=0;s<a;++s)for(var l=r[s],f=l.length,p,h=0;h<f;++h)if(p=l[h]){var v=lo(p,t);Xc(p,e,n,h,l,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new mr(r,this._parents,e,n)}function VP(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(s,l){var f={value:l},p={value:function(){--a===0&&s()}};n.each(function(){var h=Oo(this,r),v=h.on;v!==e&&(t=(e=v).copy(),t._.cancel.push(f),t._.interrupt.push(f),t._.end.push(p)),h.on=t}),a===0&&s()})}var KP=0;function mr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function a1(){return++KP}var gr=td.prototype;mr.prototype={constructor:mr,select:jP,selectAll:CP,selectChild:gr.selectChild,selectChildren:gr.selectChildren,filter:vP,merge:bP,selection:$P,transition:HP,call:gr.call,nodes:gr.nodes,node:gr.node,size:gr.size,empty:gr.empty,each:gr.each,on:kP,attr:nP,attrTween:sP,style:OP,styleTween:LP,text:zP,textTween:qP,remove:NP,tween:XO,delay:uP,duration:hP,ease:mP,easeVarying:yP,end:VP,[Symbol.iterator]:gr[Symbol.iterator]};function WP(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var UP={time:null,delay:0,duration:250,ease:WP};function YP(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function XP(e){var t,n;e instanceof mr?(t=e._id,e=e._name):(t=a1(),(n=UP).time=mg(),e=e==null?null:e+"");for(var r=this._groups,a=r.length,s=0;s<a;++s)for(var l=r[s],f=l.length,p,h=0;h<f;++h)(p=l[h])&&Xc(p,e,t,h,l,n||YP(p,t));return new mr(r,this._parents,e,t)}td.prototype.interrupt=WO,td.prototype.transition=XP;var Gc=e=>()=>e;function ZP(e,{sourceEvent:t,target:n,transform:r,dispatch:a}){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:a}})}function yr(e,t,n){this.k=e,this.x=t,this.y=n}yr.prototype={constructor:yr,scale:function(e){return e===1?this:new yr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new yr(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 Qc=new yr(1,0,0);s1.prototype=yr.prototype;function s1(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Qc;return e.__zoom}function bg(e){e.stopImmediatePropagation()}function dd(e){e.preventDefault(),e.stopImmediatePropagation()}function GP(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function QP(){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 l1(){return this.__zoom||Qc}function JP(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function eD(){return navigator.maxTouchPoints||"ontouchstart"in this}function tD(e,t,n){var r=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),l>s?(s+l)/2:Math.min(0,s)||Math.max(0,l))}function d1(){var e=GP,t=QP,n=tD,r=JP,a=eD,s=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],f=250,p=Hc,h=Oc("start","zoom","end"),v,g,m,b=500,w=150,k=0,S=10;function N(F){F.property("__zoom",l1).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",K).filter(a).on("touchstart.zoom",B).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",oe).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}N.transform=function(F,J,I,U){var W=F.selection?F.selection():F;W.property("__zoom",l1),F===W?W.interrupt().each(function(){z(this,arguments).event(U).start().zoom(null,typeof J=="function"?J.apply(this,arguments):J).end()}):L(F,J,I,U)},N.scaleBy=function(F,J,I,U){N.scaleTo(F,function(){return this.__zoom.k*(typeof J=="function"?J.apply(this,arguments):J)},I,U)},N.scaleTo=function(F,J,I,U){N.transform(F,function(){var W=t.apply(this,arguments),re=this.__zoom,le=I==null?$(W):typeof I=="function"?I.apply(this,arguments):I,pe=re.invert(le),xe=typeof J=="function"?J.apply(this,arguments):J;return n(j(E(re,xe),le,pe),W,l)},I,U)},N.translateBy=function(F,J,I,U){N.transform(F,function(){return n(this.__zoom.translate(typeof J=="function"?J.apply(this,arguments):J,typeof I=="function"?I.apply(this,arguments):I),t.apply(this,arguments),l)},null,U)},N.translateTo=function(F,J,I,U,W){N.transform(F,function(){var re=t.apply(this,arguments),le=this.__zoom,pe=U==null?$(re):typeof U=="function"?U.apply(this,arguments):U;return n(Qc.translate(pe[0],pe[1]).scale(le.k).translate(typeof J=="function"?-J.apply(this,arguments):-J,typeof I=="function"?-I.apply(this,arguments):-I),re,l)},U,W)};function E(F,J){return J=Math.max(s[0],Math.min(s[1],J)),J===F.k?F:new yr(J,F.x,F.y)}function j(F,J,I){var U=J[0]-I[0]*F.k,W=J[1]-I[1]*F.k;return U===F.x&&W===F.y?F:new yr(F.k,U,W)}function $(F){return[(+F[0][0]+ +F[1][0])/2,(+F[0][1]+ +F[1][1])/2]}function L(F,J,I,U){F.on("start.zoom",function(){z(this,arguments).event(U).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(U).end()}).tween("zoom",function(){var W=this,re=arguments,le=z(W,re).event(U),pe=t.apply(W,re),xe=I==null?$(pe):typeof I=="function"?I.apply(W,re):I,Ne=Math.max(pe[1][0]-pe[0][0],pe[1][1]-pe[0][1]),we=W.__zoom,R=typeof J=="function"?J.apply(W,re):J,Q=p(we.invert(xe).concat(Ne/we.k),R.invert(xe).concat(Ne/R.k));return function(fe){if(fe===1)fe=R;else{var X=Q(fe),he=Ne/X[2];fe=new yr(he,xe[0]-X[0]*he,xe[1]-X[1]*he)}le.zoom(null,fe)}})}function z(F,J,I){return!I&&F.__zooming||new A(F,J)}function A(F,J){this.that=F,this.args=J,this.active=0,this.sourceEvent=null,this.extent=t.apply(F,J),this.taps=0}A.prototype={event:function(F){return F&&(this.sourceEvent=F),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(F,J){return this.mouse&&F!=="mouse"&&(this.mouse[1]=J.invert(this.mouse[0])),this.touch0&&F!=="touch"&&(this.touch0[1]=J.invert(this.touch0[0])),this.touch1&&F!=="touch"&&(this.touch1[1]=J.invert(this.touch1[0])),this.that.__zoom=J,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(F){var J=Mn(this.that).datum();h.call(F,this.that,new ZP(F,{sourceEvent:this.sourceEvent,target:N,type:F,transform:this.that.__zoom,dispatch:h}),J)}};function M(F,...J){if(!e.apply(this,arguments))return;var I=z(this,J).event(F),U=this.__zoom,W=Math.max(s[0],Math.min(s[1],U.k*2**r.apply(this,arguments))),re=ao(F);if(I.wheel)(I.mouse[0][0]!==re[0]||I.mouse[0][1]!==re[1])&&(I.mouse[1]=U.invert(I.mouse[0]=re)),clearTimeout(I.wheel);else{if(U.k===W)return;I.mouse=[re,U.invert(re)],Zc(this),I.start()}dd(F),I.wheel=setTimeout(le,w),I.zoom("mouse",n(j(E(U,W),I.mouse[0],I.mouse[1]),I.extent,l));function le(){I.wheel=null,I.end()}}function O(F,...J){if(m||!e.apply(this,arguments))return;var I=F.currentTarget,U=z(this,J,!0).event(F),W=Mn(F.view).on("mousemove.zoom",xe,!0).on("mouseup.zoom",Ne,!0),re=ao(F,I),le=F.clientX,pe=F.clientY;Ok(F.view),bg(F),U.mouse=[re,this.__zoom.invert(re)],Zc(this),U.start();function xe(we){if(dd(we),!U.moved){var R=we.clientX-le,Q=we.clientY-pe;U.moved=R*R+Q*Q>k}U.event(we).zoom("mouse",n(j(U.that.__zoom,U.mouse[0]=ao(we,I),U.mouse[1]),U.extent,l))}function Ne(we){W.on("mousemove.zoom mouseup.zoom",null),Pk(we.view,U.moved),dd(we),U.event(we).end()}}function K(F,...J){if(e.apply(this,arguments)){var I=this.__zoom,U=ao(F.changedTouches?F.changedTouches[0]:F,this),W=I.invert(U),re=I.k*(F.shiftKey?.5:2),le=n(j(E(I,re),U,W),t.apply(this,J),l);dd(F),f>0?Mn(this).transition().duration(f).call(L,le,U,F):Mn(this).call(N.transform,le,U,F)}}function B(F,...J){if(e.apply(this,arguments)){var I=F.touches,U=I.length,W=z(this,J,F.changedTouches.length===U).event(F),re,le,pe,xe;for(bg(F),le=0;le<U;++le)pe=I[le],xe=ao(pe,this),xe=[xe,this.__zoom.invert(xe),pe.identifier],W.touch0?!W.touch1&&W.touch0[2]!==xe[2]&&(W.touch1=xe,W.taps=0):(W.touch0=xe,re=!0,W.taps=1+!!v);v&&=clearTimeout(v),re&&(W.taps<2&&(g=xe[0],v=setTimeout(function(){v=null},b)),Zc(this),W.start())}}function V(F,...J){if(this.__zooming){var I=z(this,J).event(F),U=F.changedTouches,W=U.length,re,le,pe,xe;for(dd(F),re=0;re<W;++re)le=U[re],pe=ao(le,this),I.touch0&&I.touch0[2]===le.identifier?I.touch0[0]=pe:I.touch1&&I.touch1[2]===le.identifier&&(I.touch1[0]=pe);if(le=I.that.__zoom,I.touch1){var Ne=I.touch0[0],we=I.touch0[1],R=I.touch1[0],Q=I.touch1[1],fe=(fe=R[0]-Ne[0])*fe+(fe=R[1]-Ne[1])*fe,X=(X=Q[0]-we[0])*X+(X=Q[1]-we[1])*X;le=E(le,Math.sqrt(fe/X)),pe=[(Ne[0]+R[0])/2,(Ne[1]+R[1])/2],xe=[(we[0]+Q[0])/2,(we[1]+Q[1])/2]}else if(I.touch0)pe=I.touch0[0],xe=I.touch0[1];else return;I.zoom("touch",n(j(le,pe,xe),I.extent,l))}}function oe(F,...J){if(this.__zooming){var I=z(this,J).event(F),U=F.changedTouches,W=U.length,re,le;for(bg(F),m&&clearTimeout(m),m=setTimeout(function(){m=null},b),re=0;re<W;++re)le=U[re],I.touch0&&I.touch0[2]===le.identifier?delete I.touch0:I.touch1&&I.touch1[2]===le.identifier&&delete I.touch1;if(I.touch1&&!I.touch0&&(I.touch0=I.touch1,delete I.touch1),I.touch0)I.touch0[1]=this.__zoom.invert(I.touch0[0]);else if(I.end(),I.taps===2&&(le=ao(le,this),Math.hypot(g[0]-le[0],g[1]-le[1])<S)){var pe=Mn(this).on("dblclick.zoom");pe&&pe.apply(this,arguments)}}}return N.wheelDelta=function(F){return arguments.length?(r=typeof F=="function"?F:Gc(+F),N):r},N.filter=function(F){return arguments.length?(e=typeof F=="function"?F:Gc(!!F),N):e},N.touchable=function(F){return arguments.length?(a=typeof F=="function"?F:Gc(!!F),N):a},N.extent=function(F){return arguments.length?(t=typeof F=="function"?F:Gc([[+F[0][0],+F[0][1]],[+F[1][0],+F[1][1]]]),N):t},N.scaleExtent=function(F){return arguments.length?(s[0]=+F[0],s[1]=+F[1],N):[s[0],s[1]]},N.translateExtent=function(F){return arguments.length?(l[0][0]=+F[0][0],l[1][0]=+F[1][0],l[0][1]=+F[0][1],l[1][1]=+F[1][1],N):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},N.constrain=function(F){return arguments.length?(n=F,N):n},N.duration=function(F){return arguments.length?(f=+F,N):f},N.interpolate=function(F){return arguments.length?(p=F,N):p},N.on=function(){var F=h.on.apply(h,arguments);return F===h?N:F},N.clickDistance=function(F){return arguments.length?(k=(F=+F)*F,N):Math.sqrt(k)},N.tapDistance=function(F){return arguments.length?(S=+F,N):S},N}var Wn={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.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 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.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},ud=[[-1/0,-1/0],[1/0,1/0]],u1=["Enter"," ","Escape"],c1={"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"},cd;(function(e){e.Strict="strict",e.Loose="loose"})(cd||={});var Ns;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ns||={});var Jc;(function(e){e.Partial="partial",e.Full="full"})(Jc||={});var f1={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},ta;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ta||={});var na;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(na||={});var Ce;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ce||={});var h1={[Ce.Left]:Ce.Right,[Ce.Right]:Ce.Left,[Ce.Top]:Ce.Bottom,[Ce.Bottom]:Ce.Top},p1=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,nD=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),xg=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),fd=(e,t=[0,0])=>{let{width:n,height:r}=co(e),a=e.origin??t,s=n*a[0],l=r*a[1];return{x:e.position.x-s,y:e.position.y-l}},ef=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((a,s)=>{let l=typeof s=="string",f=!t.nodeLookup&&!l?s:void 0;return t.nodeLookup&&(f=l?t.nodeLookup.get(s):xg(s)?s:t.nodeLookup.get(s.id)),f?(n=!0,tf(a,of(f,t.nodeOrigin))):a},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?nf(r):{x:0,y:0,width:0,height:0}},hd=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(a=>{(t.filter===void 0||t.filter(a))&&(n=tf(n,of(a)),r=!0)}),r?nf(n):{x:0,y:0,width:0,height:0}},wg=(e,t,[n,r,a]=[0,0,1],s=!1,l=!1)=>{let f=(t.x-n)/a,p=(t.y-r)/a,h=t.width/a,v=t.height/a,g=[];for(let m of e.values()){let{measured:b,selectable:w=!0,hidden:k=!1}=m;if(l&&!w||k)continue;let S=b.width??m.width??m.initialWidth??0,N=b.height??m.height??m.initialHeight??0,{x:E,y:j}=m.internals.positionAbsolute,$=b1(f,p,h,v,E,j,S,N),L=S*N,z=s&&$>0;(!m.internals.handleBounds||z||$>=L||m.dragging)&&g.push(m)}return g},oD=(e,t)=>{let n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function rD(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{let s;if(t?.includeHiddenNodes){let{width:l,height:f}=co(a);s=l>0&&f>0}else s=!!(a.measured.width&&a.measured.height&&!a.hidden);s&&(!r||r.has(a.id))&&n.set(a.id,a)}),n}async function iD({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:s},l){if(e.size===0)return!0;let f=Ng(hd(rD(e,l)),t,n,l?.minZoom??a,l?.maxZoom??s,l?.padding??.1);return await r.setViewport(f,{duration:l?.duration,ease:l?.ease,interpolate:l?.interpolate}),!0}function m1({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:a,onError:s}){let l=n.get(e),f=l.parentId?n.get(l.parentId):void 0,{x:p,y:h}=f?f.internals.positionAbsolute:{x:0,y:0},v=l.origin??r,g=l.extent||a;if(l.extent==="parent"&&!l.expandParent)if(!f)s?.("005",Wn.error005());else{let{width:b,height:w}=co(f);b&&w&&(g=[[p,h],[p+b,h+w]])}else f&&ra(l.extent)&&(g=[[l.extent[0][0]+p,l.extent[0][1]+h],[l.extent[1][0]+p,l.extent[1][1]+h]]);let m=ra(g)?oa(t,g,l.measured):t;return(l.measured.width===void 0||l.measured.height===void 0)&&s?.("015",Wn.error015()),{position:{x:m.x-p+(l.measured.width??0)*v[0],y:m.y-h+(l.measured.height??0)*v[1]},positionAbsolute:m}}async function aD({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:a}){let s=new Set(e.map(g=>g.id)),l=[];for(let g of n){if(g.deletable===!1)continue;let m=s.has(g.id),b=!m&&g.parentId&&l.find(w=>w.id===g.parentId);(m||b)&&l.push(g)}let f=new Set(t.map(g=>g.id)),p=r.filter(g=>g.deletable!==!1),h=oD(l,p);for(let g of p)f.has(g.id)&&!h.find(m=>m.id===g.id)&&h.push(g);if(!a)return{edges:h,nodes:l};let v=await a({nodes:l,edges:h});return typeof v=="boolean"?v?{edges:h,nodes:l}:{edges:[],nodes:[]}:v}var js=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),oa=(e={x:0,y:0},t,n)=>({x:js(e.x,t[0][0],t[1][0]-(n?.width??0)),y:js(e.y,t[0][1],t[1][1]-(n?.height??0))});function g1(e,t,n){let{width:r,height:a}=co(n),{x:s,y:l}=n.internals.positionAbsolute;return oa(e,[[s,l],[s+r,l+a]],t)}var y1=(e,t,n)=>e<t?js(Math.abs(e-t),1,t)/t:e>n?-js(Math.abs(e-n),1,t)/t:0,kg=(e,t,n=15,r=40)=>[y1(e.x,r,t.width-r)*n,y1(e.y,r,t.height-r)*n],tf=(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)}),Sg=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),nf=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),pd=(e,t=[0,0])=>{let{x:n,y:r}=xg(e)?e.internals.positionAbsolute:fd(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},of=(e,t=[0,0])=>{let{x:n,y:r}=xg(e)?e.internals.positionAbsolute:fd(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},v1=(e,t)=>nf(tf(Sg(e),Sg(t))),b1=(e,t,n,r,a,s,l,f)=>{let p=Math.max(0,Math.min(e+n,a+l)-Math.max(e,a)),h=Math.max(0,Math.min(t+r,s+f)-Math.max(t,s));return Math.ceil(p*h)},rf=(e,t)=>b1(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),x1=e=>uo(e.width)&&uo(e.height)&&uo(e.x)&&uo(e.y),uo=e=>!isNaN(e)&&isFinite(e),w1=(e,t)=>(n,r)=>{},md=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),gd=({x:e,y:t},[n,r,a],s=!1,l=[1,1])=>{let f={x:(e-n)/a,y:(t-r)/a};return s?md(f,l):f},Cs=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function Es(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function sD(e,t,n){if(typeof e=="string"||typeof e=="number"){let r=Es(e,n),a=Es(e,t);return{top:r,right:a,bottom:r,left:a,x:a*2,y:r*2}}if(typeof e=="object"){let r=Es(e.top??e.y??0,n),a=Es(e.bottom??e.y??0,n),s=Es(e.left??e.x??0,t),l=Es(e.right??e.x??0,t);return{top:r,right:l,bottom:a,left:s,x:s+l,y:r+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function lD(e,t,n,r,a,s){let{x:l,y:f}=Cs(e,[t,n,r]),{x:p,y:h}=Cs({x:e.x+e.width,y:e.y+e.height},[t,n,r]),v=a-p,g=s-h;return{left:Math.floor(l),top:Math.floor(f),right:Math.floor(v),bottom:Math.floor(g)}}var Ng=(e,t,n,r,a,s)=>{let l=sD(s,t,n),f=(t-l.x)/e.width,p=(n-l.y)/e.height,h=js(Math.min(f,p),r,a),v=e.x+e.width/2,g=e.y+e.height/2,m=t/2-v*h,b=n/2-g*h,w=lD(e,m,b,h,t,n),k={left:Math.min(w.left-l.left,0),top:Math.min(w.top-l.top,0),right:Math.min(w.right-l.right,0),bottom:Math.min(w.bottom-l.bottom,0)};return{x:m-k.left+k.right,y:b-k.top+k.bottom,zoom:h}},yd=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function ra(e){return e!=null&&e!=="parent"}function co(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function k1(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function S1(e,t={width:0,height:0},n,r,a){let s={...e},l=r.get(n);if(l){let f=l.origin||a;s.x+=l.internals.positionAbsolute.x-(t.width??0)*f[0],s.y+=l.internals.positionAbsolute.y-(t.height??0)*f[1]}return s}function N1(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function dD(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function uD(e){return{...c1,...e||{}}}function j1(e){return e===null?null:e?"valid":"invalid"}function vd(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){let{x:s,y:l}=fo(e),f=gd({x:s-(a?.left??0),y:l-(a?.top??0)},r),{x:p,y:h}=n?md(f,t):f;return{xSnapped:p,ySnapped:h,...f}}var jg=e=>({width:e.offsetWidth,height:e.offsetHeight}),C1=e=>e?.getRootNode?.()||window?.document,cD=["INPUT","SELECT","TEXTAREA"];function E1(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?cD.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey"):!1}var $1=e=>"clientX"in e,fo=(e,t)=>{let n=$1(e),r=n?e.clientX:e.touches?.[0].clientX,a=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:a-(t?.top??0)}},_1=(e,t,n,r,a)=>{let s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(l=>{let f=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:a,position:l.getAttribute("data-handlepos"),x:(f.left-n.left)/r,y:(f.top-n.top)/r,...jg(l)}})};function T1({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:s,targetControlX:l,targetControlY:f}){let p=e*.125+a*.375+l*.375+n*.125,h=t*.125+s*.375+f*.375+r*.125;return[p,h,Math.abs(p-e),Math.abs(h-t)]}function af(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function A1({pos:e,x1:t,y1:n,x2:r,y2:a,c:s}){switch(e){case Ce.Left:return[t-af(t-r,s),n];case Ce.Right:return[t+af(r-t,s),n];case Ce.Top:return[t,n-af(n-a,s)];case Ce.Bottom:return[t,n+af(a-n,s)]}}function M1({sourceX:e,sourceY:t,sourcePosition:n=Ce.Bottom,targetX:r,targetY:a,targetPosition:s=Ce.Top,curvature:l=.25}){let[f,p]=A1({pos:n,x1:e,y1:t,x2:r,y2:a,c:l}),[h,v]=A1({pos:s,x1:r,y1:a,x2:e,y2:t,c:l}),[g,m,b,w]=T1({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:f,sourceControlY:p,targetControlX:h,targetControlY:v});return[`M${e},${t} C${f},${p} ${h},${v} ${r},${a}`,g,m,b,w]}function O1({sourceX:e,sourceY:t,targetX:n,targetY:r}){let a=Math.abs(n-e)/2,s=n<e?n+a:n-a,l=Math.abs(r-t)/2;return[s,r<t?r+l:r-l,a,l]}function fD({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:a=!1,zIndexMode:s="basic"}){return s==="manual"?r:(a&&n?r+1e3:r)+Math.max(e.parentId||a&&e.selected?e.internals.z:0,t.parentId||a&&t.selected?t.internals.z:0)}function hD({sourceNode:e,targetNode:t,width:n,height:r,transform:a}){let s=tf(of(e),of(t));return s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1),rf({x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:r/a[2]},nf(s))>0}var pD=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,mD=(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)),gD=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.("006",Wn.error006()),t;let r=n.getEdgeId||pD,a;return a=p1(e)?{...e}:{...e,id:r(e)},mD(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function P1({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[a,s,l,f]=O1({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,s,l,f]}var D1={[Ce.Left]:{x:-1,y:0},[Ce.Right]:{x:1,y:0},[Ce.Top]:{x:0,y:-1},[Ce.Bottom]:{x:0,y:1}},yD=({source:e,sourcePosition:t=Ce.Bottom,target:n})=>t===Ce.Left||t===Ce.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},L1=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function vD({source:e,sourcePosition:t=Ce.Bottom,target:n,targetPosition:r=Ce.Top,center:a,offset:s,stepPosition:l}){let f=D1[t],p=D1[r],h={x:e.x+f.x*s,y:e.y+f.y*s},v={x:n.x+p.x*s,y:n.y+p.y*s},g=yD({source:h,sourcePosition:t,target:v}),m=g.x===0?"y":"x",b=g[m],w=[],k,S,N={x:0,y:0},E={x:0,y:0},[,,j,$]=O1({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(f[m]*p[m]===-1){m==="x"?(k=a.x??h.x+(v.x-h.x)*l,S=a.y??(h.y+v.y)/2):(k=a.x??(h.x+v.x)/2,S=a.y??h.y+(v.y-h.y)*l);let A=[{x:k,y:h.y},{x:k,y:v.y}],M=[{x:h.x,y:S},{x:v.x,y:S}];w=f[m]===b?m==="x"?A:M:m==="x"?M:A}else{let A=[{x:h.x,y:v.y}],M=[{x:v.x,y:h.y}];if(w=m==="x"?f.x===b?M:A:f.y===b?A:M,t===r){let B=Math.abs(e[m]-n[m]);if(B<=s){let V=Math.min(s-1,s-B);f[m]===b?N[m]=(h[m]>e[m]?-1:1)*V:E[m]=(v[m]>n[m]?-1:1)*V}}if(t!==r){let B=m==="x"?"y":"x",V=f[m]===p[B],oe=h[B]>v[B],F=h[B]<v[B];(f[m]===1&&(!V&&oe||V&&F)||f[m]!==1&&(!V&&F||V&&oe))&&(w=m==="x"?A:M)}let O={x:h.x+N.x,y:h.y+N.y},K={x:v.x+E.x,y:v.y+E.y};Math.max(Math.abs(O.x-w[0].x),Math.abs(K.x-w[0].x))>=Math.max(Math.abs(O.y-w[0].y),Math.abs(K.y-w[0].y))?(k=(O.x+K.x)/2,S=w[0].y):(k=w[0].x,S=(O.y+K.y)/2)}let L={x:h.x+N.x,y:h.y+N.y},z={x:v.x+E.x,y:v.y+E.y};return[[e,...L.x!==w[0].x||L.y!==w[0].y?[L]:[],...w,...z.x!==w[w.length-1].x||z.y!==w[w.length-1].y?[z]:[],n],k,S,j,$]}function bD(e,t,n,r){let a=Math.min(L1(e,t)/2,L1(t,n)/2,r),{x:s,y:l}=t;if(e.x===s&&s===n.x||e.y===l&&l===n.y)return`L${s} ${l}`;if(e.y===l){let p=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${s+a*p},${l}Q ${s},${l} ${s},${l+a*h}`}let f=e.x<n.x?1:-1;return`L ${s},${l+a*(e.y<n.y?-1:1)}Q ${s},${l} ${s+a*f},${l}`}function sf({sourceX:e,sourceY:t,sourcePosition:n=Ce.Bottom,targetX:r,targetY:a,targetPosition:s=Ce.Top,borderRadius:l=5,centerX:f,centerY:p,offset:h=20,stepPosition:v=.5}){let[g,m,b,w,k]=vD({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:a},targetPosition:s,center:{x:f,y:p},offset:h,stepPosition:v}),S=`M${g[0].x} ${g[0].y}`;for(let N=1;N<g.length-1;N++)S+=bD(g[N-1],g[N],g[N+1],l);return S+=`L${g[g.length-1].x} ${g[g.length-1].y}`,[S,m,b,w,k]}function I1(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function xD(e){let{sourceNode:t,targetNode:n}=e;if(!I1(t)||!I1(n))return null;let r=t.internals.handleBounds||R1(t.handles),a=n.internals.handleBounds||R1(n.handles),s=z1(r?.source??[],e.sourceHandle),l=z1(e.connectionMode===cd.Strict?a?.target??[]:(a?.target??[]).concat(a?.source??[]),e.targetHandle);if(!s||!l)return e.onError?.("008",Wn.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let f=s?.position||Ce.Bottom,p=l?.position||Ce.Top,h=ia(t,s,f),v=ia(n,l,p);return{sourceX:h.x,sourceY:h.y,targetX:v.x,targetY:v.y,sourcePosition:f,targetPosition:p}}function R1(e){if(!e)return null;let t=[],n=[];for(let 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 ia(e,t,n=Ce.Left,r=!1){let a=(t?.x??0)+e.internals.positionAbsolute.x,s=(t?.y??0)+e.internals.positionAbsolute.y,{width:l,height:f}=t??co(e);if(r)return{x:a+l/2,y:s+f/2};switch(t?.position??n){case Ce.Top:return{x:a+l/2,y:s};case Ce.Right:return{x:a+l,y:s+f/2};case Ce.Bottom:return{x:a+l/2,y:s+f};case Ce.Left:return{x:a,y:s+f/2}}}function z1(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Cg(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(n=>`${n}=${e[n]}`).join("&")}`:""}function wD(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:a}){let s=new Set;return e.reduce((l,f)=>([f.markerStart||r,f.markerEnd||a].forEach(p=>{if(p&&typeof p=="object"){let h=Cg(p,t);s.has(h)||(l.push({id:h,color:p.color||n,...p}),s.add(h))}}),l),[]).sort((l,f)=>l.id.localeCompare(f.id))}var F1=1e3,kD=10,Eg={nodeOrigin:[0,0],nodeExtent:ud,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},SD={...Eg,checkEquality:!0};function $g(e,t){let n={...e};for(let r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function ND(e,t,n){let r=$g(Eg,n);for(let a of e.values())if(a.parentId)Ag(a,e,t,r);else{let s=oa(fd(a,r.nodeOrigin),ra(a.extent)?a.extent:r.nodeExtent,co(a));a.internals.positionAbsolute=s}}function jD(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let a of e.handles){let s={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(s):a.type==="target"&&r.push(s)}return{source:n,target:r}}function _g(e){return e==="manual"}function Tg(e,t,n,r={}){let a=$g(SD,r),s={i:0},l=new Map(t),f=a?.elevateNodesOnSelect&&!_g(a.zIndexMode)?F1:0,p=e.length>0,h=!1;t.clear(),n.clear();for(let v of e){let g=l.get(v.id);if(a.checkEquality&&v===g?.internals.userNode)t.set(v.id,g);else{let m=oa(fd(v,a.nodeOrigin),ra(v.extent)?v.extent:a.nodeExtent,co(v));g={...a.defaults,...v,measured:{width:v.measured?.width,height:v.measured?.height},internals:{positionAbsolute:m,handleBounds:jD(v,g),z:B1(v,f,a.zIndexMode),userNode:v}},t.set(v.id,g)}g.measured!==void 0&&g.measured.width!==void 0&&g.measured.height!==void 0||g.hidden||(p=!1),v.parentId&&Ag(g,t,n,r,s),h||=v.selected??!1}return{nodesInitialized:p,hasSelectedNodes:h}}function CD(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Ag(e,t,n,r,a){let{elevateNodesOnSelect:s,nodeOrigin:l,nodeExtent:f,zIndexMode:p}=$g(Eg,r),h=e.parentId,v=t.get(h);if(!v){console.warn(`Parent node ${h} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}CD(e,n),a&&!v.parentId&&v.internals.rootParentIndex===void 0&&p==="auto"&&(v.internals.rootParentIndex=++a.i,v.internals.z=v.internals.z+a.i*kD),a&&v.internals.rootParentIndex!==void 0&&(a.i=v.internals.rootParentIndex);let{x:g,y:m,z:b}=ED(e,v,l,f,s&&!_g(p)?F1:0,p),{positionAbsolute:w}=e.internals,k=g!==w.x||m!==w.y;(k||b!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:k?{x:g,y:m}:w,z:b}})}function B1(e,t,n){let r=uo(e.zIndex)?e.zIndex:0;return _g(n)?r:r+(e.selected?t:0)}function ED(e,t,n,r,a,s){let{x:l,y:f}=t.internals.positionAbsolute,p=co(e),h=fd(e,n),v=ra(e.extent)?oa(h,e.extent,p):h,g=oa({x:l+v.x,y:f+v.y},r,p);e.extent==="parent"&&(g=g1(g,p,t));let m=B1(e,a,s),b=t.internals.z??0;return{x:g.x,y:g.y,z:b>=m?b+1:m}}function Mg(e,t,n,r=[0,0]){let a=[],s=new Map;for(let l of e){let f=t.get(l.parentId);if(!f)continue;let p=v1(s.get(l.parentId)?.expandedRect??pd(f),l.rect);s.set(l.parentId,{expandedRect:p,parent:f})}return s.size>0&&s.forEach(({expandedRect:l,parent:f},p)=>{let h=f.internals.positionAbsolute,v=co(f),g=f.origin??r,m=l.x<h.x?Math.round(Math.abs(h.x-l.x)):0,b=l.y<h.y?Math.round(Math.abs(h.y-l.y)):0,w=Math.max(v.width,Math.round(l.width)),k=Math.max(v.height,Math.round(l.height)),S=(w-v.width)*g[0],N=(k-v.height)*g[1];(m>0||b>0||S||N)&&(a.push({id:p,type:"position",position:{x:f.position.x-m+S,y:f.position.y-b+N}}),n.get(p)?.forEach(E=>{e.some(j=>j.id===E.id)||a.push({id:E.id,type:"position",position:{x:E.position.x+m,y:E.position.y+b}})})),(v.width<l.width||v.height<l.height||m||b)&&a.push({id:p,type:"dimensions",setAttributes:!0,dimensions:{width:w+(m?g[0]*m-S:0),height:k+(b?g[1]*b-N:0)}})}),a}function $D(e,t,n,r,a,s,l){let f=r?.querySelector(".xyflow__viewport"),p=!1;if(!f)return{changes:[],updatedInternals:p};let h=[],v=window.getComputedStyle(f),{m22:g}=new window.DOMMatrixReadOnly(v.transform),m=[];for(let b of e.values()){let w=t.get(b.id);if(!w)continue;if(w.hidden){t.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),p=!0;continue}let k=jg(b.nodeElement),S=w.measured.width!==k.width||w.measured.height!==k.height;if(k.width&&k.height&&(S||!w.internals.handleBounds||b.force)){let N=b.nodeElement.getBoundingClientRect(),E=ra(w.extent)?w.extent:s,{positionAbsolute:j}=w.internals;if(w.parentId&&w.extent==="parent"){let L=t.get(w.parentId);L&&(j=g1(j,k,L))}else E&&(j=oa(j,E,k));let $={...w,measured:k,internals:{...w.internals,positionAbsolute:j,handleBounds:{source:_1("source",b.nodeElement,N,g,w.id),target:_1("target",b.nodeElement,N,g,w.id)}}};t.set(w.id,$),w.parentId&&Ag($,t,n,{nodeOrigin:a,zIndexMode:l}),p=!0,S&&(h.push({id:w.id,type:"dimensions",dimensions:k}),w.expandParent&&w.parentId&&m.push({id:w.id,parentId:w.parentId,rect:pd($,a)}))}}if(m.length>0){let b=Mg(m,t,n,a);h.push(...b)}return{changes:h,updatedInternals:p}}async function _D({delta:e,panZoom:t,transform:n,translateExtent:r,width:a,height:s}){if(!t||!e.x&&!e.y)return!1;let l=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,s]],r);return!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2])}function q1(e,t,n,r,a,s){let l=a,f=r.get(l)||new Map;r.set(l,f.set(n,t)),l=`${a}-${e}`;let p=r.get(l)||new Map;if(r.set(l,p.set(n,t)),s){l=`${a}-${e}-${s}`;let h=r.get(l)||new Map;r.set(l,h.set(n,t))}}function H1(e,t,n){e.clear(),t.clear();for(let r of n){let{source:a,target:s,sourceHandle:l=null,targetHandle:f=null}=r,p={edgeId:r.id,source:a,target:s,sourceHandle:l,targetHandle:f},h=`${a}-${l}--${s}-${f}`;q1("source",p,`${s}-${f}--${a}-${l}`,e,a,l),q1("target",p,h,e,s,f),t.set(r.id,r)}}function V1(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:V1(n,t):!1}function K1(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function TD(e,t,n,r){let a=new Map;for(let[s,l]of e)if((l.selected||l.id===r)&&(!l.parentId||!V1(l,e))&&(l.draggable||t&&l.draggable===void 0)){let f=e.get(s);f&&a.set(s,{id:s,position:f.position||{x:0,y:0},distance:{x:n.x-f.internals.positionAbsolute.x,y:n.y-f.internals.positionAbsolute.y},extent:f.extent,parentId:f.parentId,origin:f.origin,expandParent:f.expandParent,internals:{positionAbsolute:f.internals.positionAbsolute||{x:0,y:0}},measured:{width:f.measured.width??0,height:f.measured.height??0}})}return a}function Og({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let a=[];for(let[l,f]of t){let p=n.get(l)?.internals.userNode;p&&a.push({...p,position:f.position,dragging:r})}if(!e)return[a[0],a];let s=n.get(e)?.internals.userNode;return[s?{...s,position:t.get(e)?.position||s.position,dragging:r}:a[0],a]}function AD({dragItems:e,snapGrid:t,x:n,y:r}){let a=e.values().next().value;if(!a)return null;let s={x:n-a.distance.x,y:r-a.distance.y},l=md(s,t);return{x:l.x-s.x,y:l.y-s.y}}function MD({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let s={x:null,y:null},l=0,f=new Map,p=!1,h={x:0,y:0},v=null,g=!1,m=null,b=!1,w=!1,k=null;function S({noDragClassName:E,handleSelector:j,domNode:$,isSelectable:L,nodeId:z,nodeClickDistance:A=0}){m=Mn($);function M({x:V,y:oe}){let{nodeLookup:F,nodeExtent:J,snapGrid:I,snapToGrid:U,nodeOrigin:W,onNodeDrag:re,onSelectionDrag:le,onError:pe,updateNodePositions:xe}=t();s={x:V,y:oe};let Ne=!1,we=f.size>1,R=we&&J?Sg(hd(f)):null,Q=we&&U?AD({dragItems:f,snapGrid:I,x:V,y:oe}):null;for(let[fe,X]of f){if(!F.has(fe))continue;let he={x:V-X.distance.x,y:oe-X.distance.y};U&&(he=Q?{x:Math.round(he.x+Q.x),y:Math.round(he.y+Q.y)}:md(he,I));let Z=null;if(we&&J&&!X.extent&&R){let{positionAbsolute:de}=X.internals,me=de.x-R.x+J[0][0],De=de.x+X.measured.width-R.x2+J[1][0],Fe=de.y-R.y+J[0][1],Ye=de.y+X.measured.height-R.y2+J[1][1];Z=[[me,Fe],[De,Ye]]}let{position:q,positionAbsolute:ee}=m1({nodeId:fe,nextPosition:he,nodeLookup:F,nodeExtent:Z||J,nodeOrigin:W,onError:pe});Ne=Ne||X.position.x!==q.x||X.position.y!==q.y,X.position=q,X.internals.positionAbsolute=ee}if(w||=Ne,Ne&&(xe(f,!0),k&&(r||re||!z&&le))){let[fe,X]=Og({nodeId:z,dragItems:f,nodeLookup:F});r?.(k,f,fe,X),re?.(k,fe,X),z||le?.(k,X)}}async function O(){if(!v)return;let{transform:V,panBy:oe,autoPanSpeed:F,autoPanOnNodeDrag:J}=t();if(!J){p=!1,cancelAnimationFrame(l);return}let[I,U]=kg(h,v,F);(I!==0||U!==0)&&(s.x=(s.x??0)-I/V[2],s.y=(s.y??0)-U/V[2],await oe({x:I,y:U})&&M(s)),l=requestAnimationFrame(O)}function K(V){let{nodeLookup:oe,multiSelectionActive:F,nodesDraggable:J,transform:I,snapGrid:U,snapToGrid:W,selectNodesOnDrag:re,onNodeDragStart:le,onSelectionDragStart:pe,unselectNodesAndEdges:xe}=t();g=!0,re&&L||F||!z||oe.get(z)?.selected||xe(),L&&re&&z&&e?.(z);let Ne=vd(V.sourceEvent,{transform:I,snapGrid:U,snapToGrid:W,containerBounds:v});if(s=Ne,f=TD(oe,J,Ne,z),f.size>0&&(n||le||!z&&pe)){let[we,R]=Og({nodeId:z,dragItems:f,nodeLookup:oe});n?.(V.sourceEvent,f,we,R),le?.(V.sourceEvent,we,R),z||pe?.(V.sourceEvent,R)}}let B=Dk().clickDistance(A).on("start",V=>{let{domNode:oe,nodeDragThreshold:F,transform:J,snapGrid:I,snapToGrid:U}=t();v=oe?.getBoundingClientRect()||null,b=!1,w=!1,k=V.sourceEvent,F===0&&K(V),s=vd(V.sourceEvent,{transform:J,snapGrid:I,snapToGrid:U,containerBounds:v}),h=fo(V.sourceEvent,v)}).on("drag",V=>{let{autoPanOnNodeDrag:oe,transform:F,snapGrid:J,snapToGrid:I,nodeDragThreshold:U,nodeLookup:W}=t(),re=vd(V.sourceEvent,{transform:F,snapGrid:J,snapToGrid:I,containerBounds:v});if(k=V.sourceEvent,(V.sourceEvent.type==="touchmove"&&V.sourceEvent.touches.length>1||z&&!W.has(z))&&(b=!0),!b){if(!p&&oe&&g&&(p=!0,O()),!g){let le=fo(V.sourceEvent,v),pe=le.x-h.x,xe=le.y-h.y;Math.sqrt(pe*pe+xe*xe)>U&&K(V)}(s.x!==re.xSnapped||s.y!==re.ySnapped)&&f&&g&&(h=fo(V.sourceEvent,v),M(re))}}).on("end",V=>{if(!g||b)b&&f.size>0&&t().updateNodePositions(f,!1);else if(p=!1,g=!1,cancelAnimationFrame(l),f.size>0){let{nodeLookup:oe,updateNodePositions:F,onNodeDragStop:J,onSelectionDragStop:I}=t();if(w&&=(F(f,!1),!1),a||J||!z&&I){let[U,W]=Og({nodeId:z,dragItems:f,nodeLookup:oe,dragging:!1});a?.(V.sourceEvent,f,U,W),J?.(V.sourceEvent,U,W),z||I?.(V.sourceEvent,W)}}}).filter(V=>{let oe=V.target;return!V.button&&(!E||!K1(oe,`.${E}`,$))&&(!j||K1(oe,j,$))});m.call(B)}function N(){m?.on(".drag",null)}return{update:S,destroy:N}}function OD(e,t,n){let r=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let s of t.values())rf(a,pd(s))>0&&r.push(s);return r}var PD=250;function DD(e,t,n,r){let a=[],s=1/0,l=OD(e,n,t+PD);for(let f of l){let p=[...f.internals.handleBounds?.source??[],...f.internals.handleBounds?.target??[]];for(let h of p){if(r.nodeId===h.nodeId&&r.type===h.type&&r.id===h.id)continue;let{x:v,y:g}=ia(f,h,h.position,!0),m=Math.sqrt((v-e.x)**2+(g-e.y)**2);m>t||(m<s?(a=[{...h,x:v,y:g}],s=m):m===s&&a.push({...h,x:v,y:g}))}}if(!a.length)return null;if(a.length>1){let f=r.type==="source"?"target":"source";return a.find(p=>p.type===f)??a[0]}return a[0]}function W1(e,t,n,r,a,s=!1){let l=r.get(e);if(!l)return null;let f=a==="strict"?l.internals.handleBounds?.[t]:[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]],p=(n?f?.find(h=>h.id===n):f?.[0])??null;return p&&s?{...p,...ia(l,p,p.position,!0)}:p}function U1(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function LD(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var Y1=()=>!0;function ID(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:s,isTarget:l,domNode:f,nodeLookup:p,lib:h,autoPanOnConnect:v,flowId:g,panBy:m,cancelConnection:b,onConnectStart:w,onConnect:k,onConnectEnd:S,isValidConnection:N=Y1,onReconnectEnd:E,updateConnection:j,getTransform:$,getFromHandle:L,autoPanSpeed:z,dragThreshold:A=1,handleDomNode:M}){let O=C1(e.target),K=0,B,{x:V,y:oe}=fo(e),F=U1(s,M),J=f?.getBoundingClientRect(),I=!1;if(!J||!F)return;let U=W1(a,F,r,p,t);if(!U)return;let W=fo(e,J),re=!1,le=null,pe=!1,xe=null;function Ne(){if(!v||!J)return;let[Z,q]=kg(W,J,z);m({x:Z,y:q}),K=requestAnimationFrame(Ne)}let we={...U,nodeId:a,type:F,position:U.position},R=p.get(a),Q={inProgress:!0,isValid:null,from:ia(R,we,Ce.Left,!0),fromHandle:we,fromPosition:we.position,fromNode:R,to:W,toHandle:null,toPosition:h1[we.position],toNode:null,pointer:W};function fe(){I=!0,j(Q),w?.(e,{nodeId:a,handleId:r,handleType:F})}A===0&&fe();function X(Z){if(!I){let{x:Fe,y:Ye}=fo(Z),Ie=Fe-V,Be=Ye-oe;if(!(Ie*Ie+Be*Be>A*A))return;fe()}if(!L()||!we){he(Z);return}let q=$();W=fo(Z,J),B=DD(gd(W,q,!1,[1,1]),n,p,we),re||=(Ne(),!0);let ee=X1(Z,{handle:B,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:l?"target":"source",isValidConnection:N,doc:O,lib:h,flowId:g,nodeLookup:p});xe=ee.handleDomNode,le=ee.connection,pe=LD(!!B,ee.isValid);let de=p.get(a),me=de?ia(de,we,Ce.Left,!0):Q.from,De={...Q,from:me,isValid:pe,to:ee.toHandle&&pe?Cs({x:ee.toHandle.x,y:ee.toHandle.y},q):W,toHandle:ee.toHandle,toPosition:pe&&ee.toHandle?ee.toHandle.position:h1[we.position],toNode:ee.toHandle?p.get(ee.toHandle.nodeId):null,pointer:W};j(De),Q=De}function he(Z){if(!("touches"in Z&&Z.touches.length>0)){if(I){(B||xe)&&le&&pe&&k?.(le);let{inProgress:q,...ee}=Q,de={...ee,toPosition:Q.toHandle?Q.toPosition:null};S?.(Z,de),s&&E?.(Z,de)}b(),cancelAnimationFrame(K),re=!1,pe=!1,le=null,xe=null,O.removeEventListener("mousemove",X),O.removeEventListener("mouseup",he),O.removeEventListener("touchmove",X),O.removeEventListener("touchend",he)}}O.addEventListener("mousemove",X),O.addEventListener("mouseup",he),O.addEventListener("touchmove",X),O.addEventListener("touchend",he)}function X1(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:s,doc:l,lib:f,flowId:p,isValidConnection:h=Y1,nodeLookup:v}){let g=s==="target",m=t?l.querySelector(`.${f}-flow__handle[data-id="${p}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:b,y:w}=fo(e),k=l.elementFromPoint(b,w),S=k?.classList.contains(`${f}-flow__handle`)?k:m,N={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){let E=U1(void 0,S),j=S.getAttribute("data-nodeid"),$=S.getAttribute("data-handleid"),L=S.classList.contains("connectable"),z=S.classList.contains("connectableend");if(!j||!E)return N;let A={source:g?j:r,sourceHandle:g?$:a,target:g?r:j,targetHandle:g?a:$};N.connection=A,N.isValid=L&&z&&(n===cd.Strict?g&&E==="source"||!g&&E==="target":j!==r||$!==a)&&h(A),N.toHandle=W1(j,E,$,v,n,!0)}return N}var Pg={onPointerDown:ID,isValid:X1};function RD({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let a=Mn(e);function s({translateExtent:f,width:p,height:h,zoomStep:v=1,pannable:g=!0,zoomable:m=!0,inversePan:b=!1}){let w=N=>{if(N.sourceEvent.type!=="wheel"||!t)return;let E=n(),j=N.sourceEvent.ctrlKey&&yd()?10:1,$=-N.sourceEvent.deltaY*(N.sourceEvent.deltaMode===1?.05:N.sourceEvent.deltaMode?1:.002)*v,L=E[2]*2**($*j);t.scaleTo(L)},k=[0,0],S=d1().on("start",N=>{(N.sourceEvent.type==="mousedown"||N.sourceEvent.type==="touchstart")&&(k=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY])}).on("zoom",g?N=>{let E=n();if(N.sourceEvent.type!=="mousemove"&&N.sourceEvent.type!=="touchmove"||!t)return;let j=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY],$=[j[0]-k[0],j[1]-k[1]];k=j;let L=r()*Math.max(E[2],Math.log(E[2]))*(b?-1:1),z={x:E[0]-$[0]*L,y:E[1]-$[1]*L},A=[[0,0],[p,h]];t.setViewportConstrained({x:z.x,y:z.y,zoom:E[2]},A,f)}:null).on("zoom.wheel",m?w:null);a.call(S,{})}function l(){a.on("zoom",null)}return{update:s,destroy:l,pointer:ao}}var lf=e=>({x:e.x,y:e.y,zoom:e.k}),Dg=({x:e,y:t,zoom:n})=>Qc.translate(e,t).scale(n),di=(e,t)=>e.target.closest(`.${t}`),Z1=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),zD=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Lg=(e,t=0,n=zD,r=()=>{})=>{let a=typeof t=="number"&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},G1=e=>{let t=e.ctrlKey&&yd()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function FD({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:s,zoomOnPinch:l,onPanZoomStart:f,onPanZoom:p,onPanZoomEnd:h}){return v=>{if(di(v,t))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();let g=n.property("__zoom").k||1;if(v.ctrlKey&&l){let S=ao(v),N=g*2**G1(v);r.scaleTo(n,N,S,v);return}let m=v.deltaMode===1?20:1,b=a===Ns.Vertical?0:v.deltaX*m,w=a===Ns.Horizontal?0:v.deltaY*m;!yd()&&v.shiftKey&&a!==Ns.Vertical&&(b=v.deltaY*m,w=0),r.translateBy(n,-(b/g)*s,-(w/g)*s,{internal:!0});let k=lf(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?p?.(v,k):(e.isPanScrolling=!0,f?.(v,k)),e.panScrollTimeout=setTimeout(()=>{h?.(v,k),e.isPanScrolling=!1},150)}}function BD({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){let s=r.type==="wheel",l=!t&&s&&!r.ctrlKey,f=di(r,e);if(r.ctrlKey&&s&&f&&r.preventDefault(),l||f)return null;r.preventDefault(),n.call(this,r,a)}}function qD({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let a=lf(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=a,r.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(r.sourceEvent,a)}}function HD({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return s=>{e.usedRightMouseButton=!!(n&&Z1(t,e.mouseButton??0)),s.sourceEvent?.sync||r([s.transform.x,s.transform.y,s.transform.k]),a&&!s.sourceEvent?.internal&&a?.(s.sourceEvent,lf(s.transform))}}function VD({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:a,onPaneContextMenu:s}){return l=>{if(!l.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,s&&Z1(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&s(l.sourceEvent),e.usedRightMouseButton=!1,r(!1),a)){let f=lf(l.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a?.(l.sourceEvent,f)},n?150:0)}}}function KD({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:a,panOnScroll:s,zoomOnDoubleClick:l,userSelectionActive:f,noWheelClassName:p,noPanClassName:h,lib:v,connectionInProgress:g}){return m=>{let b=t||n,w=r&&m.ctrlKey,k=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(di(m,`${v}-flow__node`)||di(m,`${v}-flow__edge`)||di(m,`${v}-flow__selection`)||di(m,`${v}-flow__nodesselection`)))return!0;if(!a&&!b&&!s&&!l&&!r||f||g&&!k||di(m,p)&&k||di(m,h)&&(!k||s&&k&&!t)||!r&&m.ctrlKey&&k)return!1;if(!r&&m.type==="touchstart"&&m.touches?.length>1)return m.preventDefault(),!1;if(!b&&!s&&!w&&k||!a&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(a)&&!a.includes(m.button)&&m.type==="mousedown")return!1;let S=Array.isArray(a)&&a.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||k||e)&&S}}function WD({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:a,onPanZoom:s,onPanZoomStart:l,onPanZoomEnd:f,onDraggingChange:p}){let h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},v=e.getBoundingClientRect(),g=[[0,0],[v.width,v.height]];(typeof ResizeObserver<"u"?new ResizeObserver(V=>{let oe=V[0];oe&&(g=[[0,0],[oe.contentRect.width,oe.contentRect.height]])}):null)?.observe(e);let m=d1().extent(()=>g).scaleExtent([t,n]).translateExtent(r),b=Mn(e).call(m);j({x:a.x,y:a.y,zoom:js(a.zoom,t,n)},[[0,0],[v.width,v.height]],r);let w=b.on("wheel.zoom"),k=b.on("dblclick.zoom");m.wheelDelta(G1);async function S(V,oe){return b?new Promise(F=>{m?.interpolate(oe?.interpolate==="linear"?ad:Hc).transform(Lg(b,oe?.duration,oe?.ease,()=>F(!0)),V)}):!1}function N({noWheelClassName:V,noPanClassName:oe,onPaneContextMenu:F,userSelectionActive:J,panOnScroll:I,panOnDrag:U,panOnScrollMode:W,panOnScrollSpeed:re,preventScrolling:le,zoomOnPinch:pe,zoomOnScroll:xe,zoomOnDoubleClick:Ne,panActivationKeyPressed:we=!1,zoomActivationKeyPressed:R,lib:Q,onTransformChange:fe,connectionInProgress:X,paneClickDistance:he,selectionOnDrag:Z}){J&&!h.isZoomingOrPanning&&E();let q=I&&!R&&!J;m.clickDistance(Z?1/0:!uo(he)||he<0?0:he);let ee=q?FD({zoomPanValues:h,noWheelClassName:V,d3Selection:b,d3Zoom:m,panOnScrollMode:W,panOnScrollSpeed:re,zoomOnPinch:pe,onPanZoomStart:l,onPanZoom:s,onPanZoomEnd:f}):BD({noWheelClassName:V,preventScrolling:le,d3ZoomHandler:w});b.on("wheel.zoom",ee,{passive:!1});let de=qD({zoomPanValues:h,onDraggingChange:p,onPanZoomStart:l});m.on("start",de);let me=HD({zoomPanValues:h,panOnDrag:U,onPaneContextMenu:!!F,onPanZoom:s,onTransformChange:fe});m.on("zoom",me);let De=VD({zoomPanValues:h,panOnDrag:U,panOnScroll:I,onPaneContextMenu:F,onPanZoomEnd:f,onDraggingChange:p});m.on("end",De);let Fe=KD({panActivationKeyPressed:we,zoomActivationKeyPressed:R,panOnDrag:U,zoomOnScroll:xe,panOnScroll:I,zoomOnDoubleClick:Ne,zoomOnPinch:pe,userSelectionActive:J,noPanClassName:oe,noWheelClassName:V,lib:Q,connectionInProgress:X});m.filter(Fe),Ne?b.on("dblclick.zoom",k):b.on("dblclick.zoom",null)}function E(){m.on("zoom",null)}async function j(V,oe,F){let J=Dg(V),I=m?.constrain()(J,oe,F);return I&&await S(I),I}async function $(V,oe){let F=Dg(V);return await S(F,oe),F}function L(V){if(b){let oe=Dg(V),F=b.property("__zoom");(F.k!==V.zoom||F.x!==V.x||F.y!==V.y)&&m?.transform(b,oe,null,{sync:!0})}}function z(){let V=b?s1(b.node()):{x:0,y:0,k:1};return{x:V.x,y:V.y,zoom:V.k}}async function A(V,oe){return b?new Promise(F=>{m?.interpolate(oe?.interpolate==="linear"?ad:Hc).scaleTo(Lg(b,oe?.duration,oe?.ease,()=>F(!0)),V)}):!1}async function M(V,oe){return b?new Promise(F=>{m?.interpolate(oe?.interpolate==="linear"?ad:Hc).scaleBy(Lg(b,oe?.duration,oe?.ease,()=>F(!0)),V)}):!1}function O(V){m?.scaleExtent(V)}function K(V){m?.translateExtent(V)}function B(V){let oe=!uo(V)||V<0?0:V;m?.clickDistance(oe)}return{update:N,destroy:E,setViewport:$,setViewportConstrained:j,getViewport:z,scaleTo:A,scaleBy:M,setScaleExtent:O,setTranslateExtent:K,syncViewport:L,setClickDistance:B}}var $s;(function(e){e.Line="line",e.Handle="handle"})($s||={});var UD=["top-left","top-right","bottom-left","bottom-right"],YD=["top","right","bottom","left"];function XD({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:a,affectsY:s}){let l=e-t,f=n-r,p=[l>0?1:l<0?-1:0,f>0?1:f<0?-1:0];return l&&a&&(p[0]*=-1),f&&s&&(p[1]*=-1),p}function Q1(e){return{isHorizontal:e.includes("right")||e.includes("left"),isVertical:e.includes("bottom")||e.includes("top"),affectsX:e.includes("left"),affectsY:e.includes("top")}}function ui(e,t){return Math.max(0,t-e)}function ci(e,t){return Math.max(0,e-t)}function df(e,t,n){return Math.max(0,t-e,e-n)}function J1(e,t){return e?!t:t}function ZD(e,t,n,r,a,s,l,f){let{affectsX:p,affectsY:h}=t,{isHorizontal:v,isVertical:g}=t,m=v&&g,{xSnapped:b,ySnapped:w}=n,{minWidth:k,maxWidth:S,minHeight:N,maxHeight:E}=r,{x:j,y:$,width:L,height:z,aspectRatio:A}=e,M=Math.floor(v?b-e.pointerX:0),O=Math.floor(g?w-e.pointerY:0),K=L+(p?-M:M),B=z+(h?-O:O),V=-s[0]*L,oe=-s[1]*z,F=df(K,k,S),J=df(B,N,E);if(l){let W=0,re=0;p&&M<0?W=ui(j+M+V,l[0][0]):!p&&M>0&&(W=ci(j+K+V,l[1][0])),h&&O<0?re=ui($+O+oe,l[0][1]):!h&&O>0&&(re=ci($+B+oe,l[1][1])),F=Math.max(F,W),J=Math.max(J,re)}if(f){let W=0,re=0;p&&M>0?W=ci(j+M,f[0][0]):!p&&M<0&&(W=ui(j+K,f[1][0])),h&&O>0?re=ci($+O,f[0][1]):!h&&O<0&&(re=ui($+B,f[1][1])),F=Math.max(F,W),J=Math.max(J,re)}if(a){if(v){let W=df(K/A,N,E)*A;if(F=Math.max(F,W),l){let re=0;re=!p&&!h||p&&!h&&m?ci($+oe+K/A,l[1][1])*A:ui($+oe+(p?M:-M)/A,l[0][1])*A,F=Math.max(F,re)}if(f){let re=0;re=!p&&!h||p&&!h&&m?ui($+K/A,f[1][1])*A:ci($+(p?M:-M)/A,f[0][1])*A,F=Math.max(F,re)}}if(g){let W=df(B*A,k,S)/A;if(J=Math.max(J,W),l){let re=0;re=!p&&!h||h&&!p&&m?ci(j+B*A+V,l[1][0])/A:ui(j+(h?O:-O)*A+V,l[0][0])/A,J=Math.max(J,re)}if(f){let re=0;re=!p&&!h||h&&!p&&m?ui(j+B*A,f[1][0])/A:ci(j+(h?O:-O)*A,f[0][0])/A,J=Math.max(J,re)}}}O+=O<0?J:-J,M+=M<0?F:-F,a&&(m?K>B*A?O=(J1(p,h)?-M:M)/A:M=(J1(p,h)?-O:O)*A:v?(O=M/A,h=p):(M=O*A,p=h));let I=p?j+M:j,U=h?$+O:$;return{width:L+(p?-M:M),height:z+(h?-O:O),x:s[0]*M*(p?-1:1)+I,y:s[1]*O*(h?-1:1)+U}}var eS={width:0,height:0,x:0,y:0},GD={...eS,pointerX:0,pointerY:0,aspectRatio:1};function QD(e,t,n){let r=t.position.x+e.position.x,a=t.position.y+e.position.y,s=e.measured.width??0,l=e.measured.height??0,f=n[0]*s,p=n[1]*l;return[[r-f,a-p],[r+s-f,a+l-p]]}function JD({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){let s=Mn(e),l={controlDirection:Q1("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function f({controlPosition:h,boundaries:v,keepAspectRatio:g,resizeDirection:m,onResizeStart:b,onResize:w,onResizeEnd:k,shouldResize:S}){let N={...eS},E={...GD};l={boundaries:v,resizeDirection:m,keepAspectRatio:g,controlDirection:Q1(h)};let j,$=null,L=[],z,A,M,O=Dk().on("start",K=>{let{nodeLookup:B,transform:V,snapGrid:oe,snapToGrid:F,nodeOrigin:J,paneDomNode:I}=n();if(j=B.get(t),!j)return;$=I?.getBoundingClientRect()??null;let{xSnapped:U,ySnapped:W}=vd(K.sourceEvent,{transform:V,snapGrid:oe,snapToGrid:F,containerBounds:$});N={width:j.measured.width??0,height:j.measured.height??0,x:j.position.x??0,y:j.position.y??0},E={...N,pointerX:U,pointerY:W,aspectRatio:N.width/N.height},z=void 0,A=ra(j.extent)?j.extent:void 0,j.parentId&&(j.extent==="parent"||j.expandParent)&&(z=B.get(j.parentId)),z&&j.extent==="parent"&&(A=[[0,0],[z.measured.width,z.measured.height]]),L=[],M=void 0;for(let[re,le]of B)if(le.parentId===t&&(L.push({id:re,position:{...le.position},extent:le.extent}),le.extent==="parent"||le.expandParent)){let pe=QD(le,j,le.origin??J);M=M?[[Math.min(pe[0][0],M[0][0]),Math.min(pe[0][1],M[0][1])],[Math.max(pe[1][0],M[1][0]),Math.max(pe[1][1],M[1][1])]]:pe}b?.(K,{...N})}).on("drag",K=>{let{transform:B,snapGrid:V,snapToGrid:oe,nodeOrigin:F}=n(),J=vd(K.sourceEvent,{transform:B,snapGrid:V,snapToGrid:oe,containerBounds:$}),I=[];if(!j)return;let{x:U,y:W,width:re,height:le}=N,pe={},xe=j.origin??F,{width:Ne,height:we,x:R,y:Q}=ZD(E,l.controlDirection,J,l.boundaries,l.keepAspectRatio,xe,A,M),fe=Ne!==re,X=we!==le,he=R!==U&&fe,Z=Q!==W&&X;if(!he&&!Z&&!fe&&!X)return;let q={prevValues:{...N},startX:E.x,startY:E.y,childNodes:L.map(me=>({...me,position:{...me.position}}))};if((he||Z||xe[0]===1||xe[1]===1)&&(pe.x=he?R:N.x,pe.y=Z?Q:N.y,N.x=pe.x,N.y=pe.y,L.length>0)){let me=R-U,De=Q-W;for(let Fe of L)Fe.position={x:Fe.position.x-me+xe[0]*(Ne-re),y:Fe.position.y-De+xe[1]*(we-le)},I.push(Fe)}if((fe||X)&&(pe.width=fe&&(!l.resizeDirection||l.resizeDirection==="horizontal")?Ne:N.width,pe.height=X&&(!l.resizeDirection||l.resizeDirection==="vertical")?we:N.height,N.width=pe.width,N.height=pe.height),z&&j.expandParent){let me=xe[0]*(pe.width??0);pe.x&&pe.x<me&&(N.x=me,E.x-=pe.x-me);let De=xe[1]*(pe.height??0);pe.y&&pe.y<De&&(N.y=De,E.y-=pe.y-De)}let ee=XD({width:N.width,prevWidth:re,height:N.height,prevHeight:le,affectsX:l.controlDirection.affectsX,affectsY:l.controlDirection.affectsY}),de={...N,direction:ee};S?.(K,de)===!1?(N=q.prevValues,E.x=q.startX,E.y=q.startY,L.forEach((me,De)=>{me.position=q.childNodes[De].position})):(w?.(K,de),r(pe,I))}).on("end",K=>{k?.(K,{...N}),a?.({...N})});s.call(O)}function p(){s.on(".drag",null)}return{update:f,destroy:p}}var eL=wn((e=>{var t=ed();function n(m,b){return m===b&&(m!==0||1/m==1/b)||m!==m&&b!==b}var r=typeof Object.is=="function"?Object.is:n,a=t.useState,s=t.useEffect,l=t.useLayoutEffect,f=t.useDebugValue;function p(m,b){var w=b(),k=a({inst:{value:w,getSnapshot:b}}),S=k[0].inst,N=k[1];return l(function(){S.value=w,S.getSnapshot=b,h(S)&&N({inst:S})},[m,w,b]),s(function(){return h(S)&&N({inst:S}),m(function(){h(S)&&N({inst:S})})},[m]),f(w),w}function h(m){var b=m.getSnapshot;m=m.value;try{var w=b();return!r(m,w)}catch{return!0}}function v(m,b){return b()}var g=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?v:p;e.useSyncExternalStore=t.useSyncExternalStore===void 0?g:t.useSyncExternalStore})),tL=wn(((e,t)=>{t.exports=eL()})),nL=wn((e=>{var t=ed(),n=tL();function r(v,g){return v===g&&(v!==0||1/v==1/g)||v!==v&&g!==g}var a=typeof Object.is=="function"?Object.is:r,s=n.useSyncExternalStore,l=t.useRef,f=t.useEffect,p=t.useMemo,h=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(v,g,m,b,w){var k=l(null);if(k.current===null){var S={hasValue:!1,value:null};k.current=S}else S=k.current;k=p(function(){function E(A){if(!j){if(j=!0,$=A,A=b(A),w!==void 0&&S.hasValue){var M=S.value;if(w(M,A))return L=M}return L=A}if(M=L,a($,A))return M;var O=b(A);return w!==void 0&&w(M,O)?($=A,M):($=A,L=O)}var j=!1,$,L,z=m===void 0?null:m;return[function(){return E(g())},z===null?void 0:function(){return E(z())}]},[g,m,b,w]);var N=s(v,k[0],k[1]);return f(function(){S.hasValue=!0,S.value=N},[N]),h(N),N}})),oL=yk(wn(((e,t)=>{t.exports=nL()}))(),1),tS=e=>{let t,n=new Set,r=(f,p)=>{let h=typeof f=="function"?f(t):f;if(!Object.is(h,t)){let v=t;t=p??(typeof h!="object"||!h)?h:Object.assign({},t,h),n.forEach(g=>g(t,v))}},a=()=>t,s={setState:r,getState:a,getInitialState:()=>l,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{n.clear()}},l=t=e(r,a,s);return s},rL=e=>e?tS(e):tS,{useDebugValue:iL}=T.default,{useSyncExternalStoreWithSelector:aL}=oL.default,sL=e=>e;function nS(e,t=sL,n){let r=aL(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return iL(r),r}var oS=(e,t)=>{let n=rL(e),r=(a,s=t)=>nS(n,a,s);return Object.assign(r,n),r},lL=(e,t)=>e?oS(e,t):oS;function yt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[r,a]of e)if(!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var Ig=vk(),uf=(0,T.createContext)(null),dL=uf.Provider,rS=Wn.error001("react");function Ke(e,t){let n=(0,T.useContext)(uf);if(n===null)throw Error(rS);return nS(n,e,t)}function pt(){let e=(0,T.useContext)(uf);if(e===null)throw Error(rS);return(0,T.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var iS={display:"none"},uL={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},aS="react-flow__node-desc",sS="react-flow__edge-desc",cL="react-flow__aria-live",fL=e=>e.ariaLiveMessage,hL=e=>e.ariaLabelConfig;function pL({rfId:e}){let t=Ke(fL);return(0,c.jsx)("div",{id:`${cL}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:uL,children:t})}function mL({rfId:e,disableKeyboardA11y:t}){let n=Ke(hL);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{id:`${aS}-${e}`,style:iS,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),(0,c.jsx)("div",{id:`${sS}-${e}`,style:iS,children:n["edge.a11yDescription.default"]}),!t&&(0,c.jsx)(pL,{rfId:e})]})}var _s=(0,T.forwardRef)(({position:e="top-left",children:t,className:n,style:r,...a},s)=>{let l=`${e}`.split("-");return(0,c.jsx)("div",{className:Dt(["react-flow__panel",n,...l]),style:r,ref:s,...a,children:t})});_s.displayName="Panel";var lS="https://reactflow.dev?utm_source=attribution";function gL({proOptions:e,position:t="bottom-right"}){return(0,T.useEffect)(()=>{},[]),e?.hideAttribution?null:(0,c.jsx)(_s,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${lS}`,children:(0,c.jsx)("a",{href:lS,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}var yL=e=>{let t=[],n=[];for(let[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(let[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},cf=e=>e.id;function vL(e,t){return yt(e.selectedNodes.map(cf),t.selectedNodes.map(cf))&&yt(e.selectedEdges.map(cf),t.selectedEdges.map(cf))}function bL({onSelectionChange:e}){let t=pt(),{selectedNodes:n,selectedEdges:r}=Ke(yL,vL);return(0,T.useEffect)(()=>{let a={nodes:n,edges:r};e?.(a),t.getState().onSelectionChangeHandlers.forEach(s=>s(a))},[n,r,e]),null}var xL=e=>!!e.onSelectionChangeHandlers;function wL({onSelectionChange:e}){let t=Ke(xL);return e||t?(0,c.jsx)(bL,{onSelectionChange:e}):null}var dS=[0,0],kL={x:0,y:0,zoom:1},uS=[..."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".split("."),"rfId"],SL=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}),cS={translateExtent:ud,nodeOrigin:dS,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function NL(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:a,setTranslateExtent:s,setNodeExtent:l,reset:f,setDefaultNodesAndEdges:p}=Ke(SL,yt),h=pt();(0,T.useEffect)(()=>(p(e.defaultNodes,e.defaultEdges),()=>{v.current=cS,f()}),[]);let v=(0,T.useRef)(cS);return(0,T.useEffect)(()=>{for(let g of uS){let m=e[g];m!==v.current[g]&&e[g]!==void 0&&(g==="nodes"?t(m):g==="edges"?n(m):g==="minZoom"?r(m):g==="maxZoom"?a(m):g==="translateExtent"?s(m):g==="nodeExtent"?l(m):g==="ariaLabelConfig"?h.setState({ariaLabelConfig:uD(m)}):g==="fitView"?h.setState({fitViewQueued:m}):g==="fitViewOptions"?h.setState({fitViewOptions:m}):h.setState({[g]:m}))}v.current=e},uS.map(g=>e[g])),null}function fS(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function jL(e){let[t,n]=(0,T.useState)(e==="system"?null:e);return(0,T.useEffect)(()=>{if(e!=="system"){n(e);return}let r=fS(),a=()=>n(r?.matches?"dark":"light");return a(),r?.addEventListener("change",a),()=>{r?.removeEventListener("change",a)}},[e]),t===null?fS()?.matches?"dark":"light":t}var hS=typeof document<"u"?document:null;function bd(e=null,t={target:hS,actInsideInputWithModifier:!0}){let[n,r]=(0,T.useState)(!1),a=(0,T.useRef)(!1),s=(0,T.useRef)(new Set([])),[l,f]=(0,T.useMemo)(()=>{if(e!==null){let p=(Array.isArray(e)?e:[e]).filter(h=>typeof h=="string").map(h=>h.replace(/\+/g,`
|
|
10
|
+
`).replace(`
|
|
11
|
+
|
|
12
|
+
`,`
|
|
13
|
+
+`).split(`
|
|
14
|
+
`));return[p,p.reduce((h,v)=>h.concat(...v),[])]}return[[],[]]},[e]);return(0,T.useEffect)(()=>{let p=t?.target??hS,h=t?.actInsideInputWithModifier??!0;if(e!==null){let v=b=>{if(a.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!a.current||a.current&&!h)&&E1(b))return!1;let w=mS(b.code,f);if(s.current.add(b[w]),pS(l,s.current,!1)){let k=b.composedPath?.()?.[0]||b.target,S=k?.nodeName==="BUTTON"||k?.nodeName==="A";t.preventDefault!==!1&&(a.current||!S)&&b.preventDefault(),r(!0)}},g=b=>{let w=mS(b.code,f);pS(l,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(b[w]),b.key==="Meta"&&s.current.clear(),a.current=!1},m=()=>{s.current.clear(),r(!1)};return p?.addEventListener("keydown",v),p?.addEventListener("keyup",g),window.addEventListener("blur",m),window.addEventListener("contextmenu",m),()=>{p?.removeEventListener("keydown",v),p?.removeEventListener("keyup",g),window.removeEventListener("blur",m),window.removeEventListener("contextmenu",m)}}},[e,r]),n}function pS(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(a=>t.has(a)))}function mS(e,t){return t.includes(e)?"code":"key"}var CL=()=>{let e=pt();return(0,T.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,a,s],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??r,y:t.y??a,zoom:t.zoom??s},n),!0):!1},getViewport:()=>{let[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)=>{let{width:r,height:a,minZoom:s,maxZoom:l,panZoom:f}=e.getState(),p=Ng(t,r,a,s,l,n?.padding??.1);return f?(await f.setViewport(p,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:a,snapToGrid:s,domNode:l}=e.getState();if(!l)return t;let{x:f,y:p}=l.getBoundingClientRect(),h={x:t.x-f,y:t.y-p},v=n.snapGrid??a;return gd(h,r,n.snapToGrid??s,v)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:a,y:s}=r.getBoundingClientRect(),l=Cs(t,n);return{x:l.x+a,y:l.y+s}}}),[])};function gS(e,t){let n=[],r=new Map,a=[];for(let s of e)if(s.type==="add"){a.push(s);continue}else if(s.type==="remove"||s.type==="replace")r.set(s.id,[s]);else{let l=r.get(s.id);l?l.push(s):r.set(s.id,[s])}for(let s of t){let l=r.get(s.id);if(!l){n.push(s);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}let f={...s};for(let p of l)EL(p,f);n.push(f)}return a.length&&a.forEach(s=>{s.index===void 0?n.push({...s.item}):n.splice(s.index,0,{...s.item})}),n}function EL(e,t){switch(e.type){case"select":t.selected=e.selected;break;case"position":e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case"dimensions":e.dimensions!==void 0&&(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)}}function Rg(e,t){return gS(e,t)}function $L(e,t){return gS(e,t)}function aa(e,t){return{id:e,type:"select",selected:t}}function Ts(e,t=new Set,n=!1){let r=[];for(let[a,s]of e){let l=t.has(a);(s.selected!==void 0||l)&&s.selected!==l&&(n&&(s.selected=l),r.push(aa(s.id,l)))}return r}function yS({items:e=[],lookup:t}){let n=[],r=new Map(e.map(a=>[a.id,a]));for(let[a,s]of e.entries()){let l=t.get(s.id),f=l?.internals?.userNode??l;f!==void 0&&f!==s&&n.push({id:s.id,item:s,type:"replace"}),f===void 0&&n.push({item:s,type:"add",index:a})}for(let[a]of t)r.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function vS(e){return{id:e.id,type:"remove"}}var _L=w1("React Flow","https://reactflow.dev/");function TL(e,t,n={}){return gD(e,t,{...n,onError:n.onError??_L})}var bS=e=>nD(e),AL=e=>p1(e);function xS(e){return(0,T.forwardRef)(e)}var wS=typeof window<"u"?T.useLayoutEffect:T.useEffect;function kS(e){let[t,n]=(0,T.useState)(BigInt(0)),[r]=(0,T.useState)(()=>ML(()=>n(a=>a+BigInt(1))));return wS(()=>{let a=r.get();a.length&&(e(a),r.reset())},[t]),r}function ML(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var SS=(0,T.createContext)(null);function OL({children:e}){let t=pt(),n=kS((0,T.useCallback)(s=>{let{nodes:l=[],setNodes:f,hasDefaultNodes:p,onNodesChange:h,nodeLookup:v,fitViewQueued:g,onNodesChangeMiddlewareMap:m}=t.getState(),b=l;for(let k of s)b=typeof k=="function"?k(b):k;let w=yS({items:b,lookup:v});for(let k of m.values())w=k(w);p&&f(b),w.length>0?h?.(w):g&&window.requestAnimationFrame(()=>{let{fitViewQueued:k,nodes:S,setNodes:N}=t.getState();k&&N(S)})},[])),r=kS((0,T.useCallback)(s=>{let{edges:l=[],setEdges:f,hasDefaultEdges:p,onEdgesChange:h,edgeLookup:v}=t.getState(),g=l;for(let m of s)g=typeof m=="function"?m(g):m;p?f(g):h&&h(yS({items:g,lookup:v}))},[])),a=(0,T.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,c.jsx)(SS.Provider,{value:a,children:e})}function PL(){let e=(0,T.useContext)(SS);if(!e)throw Error("useBatchContext must be used within a BatchProvider");return e}var DL=e=>!!e.panZoom;function As(){let e=CL(),t=pt(),n=PL(),r=Ke(DL),a=(0,T.useMemo)(()=>{let s=g=>t.getState().nodeLookup.get(g),l=g=>{n.nodeQueue.push(g)},f=g=>{n.edgeQueue.push(g)},p=g=>{let{nodeLookup:m,nodeOrigin:b}=t.getState(),w=bS(g)?g:m.get(g.id),k=w.parentId?S1(w.position,w.measured,w.parentId,m,b):w.position;return pd({...w,position:k,width:w.measured?.width??w.width,height:w.measured?.height??w.height})},h=(g,m,b={replace:!1})=>{l(w=>w.map(k=>{if(k.id===g){let S=typeof m=="function"?m(k):m;return b.replace&&bS(S)?S:{...k,...S}}return k}))},v=(g,m,b={replace:!1})=>{f(w=>w.map(k=>{if(k.id===g){let S=typeof m=="function"?m(k):m;return b.replace&&AL(S)?S:{...k,...S}}return k}))};return{getNodes:()=>t.getState().nodes.map(g=>({...g})),getNode:g=>s(g)?.internals.userNode,getInternalNode:s,getEdges:()=>{let{edges:g=[]}=t.getState();return g.map(m=>({...m}))},getEdge:g=>t.getState().edgeLookup.get(g),setNodes:l,setEdges:f,addNodes:g=>{let m=Array.isArray(g)?g:[g];n.nodeQueue.push(b=>[...b,...m])},addEdges:g=>{let m=Array.isArray(g)?g:[g];n.edgeQueue.push(b=>[...b,...m])},toObject:()=>{let{nodes:g=[],edges:m=[],transform:b}=t.getState(),[w,k,S]=b;return{nodes:g.map(N=>({...N})),edges:m.map(N=>({...N})),viewport:{x:w,y:k,zoom:S}}},deleteElements:async({nodes:g=[],edges:m=[]})=>{let{nodes:b,edges:w,onNodesDelete:k,onEdgesDelete:S,triggerNodeChanges:N,triggerEdgeChanges:E,onDelete:j,onBeforeDelete:$}=t.getState(),{nodes:L,edges:z}=await aD({nodesToRemove:g,edgesToRemove:m,nodes:b,edges:w,onBeforeDelete:$}),A=z.length>0,M=L.length>0;if(A){let O=z.map(vS);S?.(z),E(O)}if(M){let O=L.map(vS);k?.(L),N(O)}return(M||A)&&j?.({nodes:L,edges:z}),{deletedNodes:L,deletedEdges:z}},getIntersectingNodes:(g,m=!0,b)=>{let w=x1(g),k=w?g:p(g),S=b!==void 0;return k?(b||t.getState().nodes).filter(N=>{let E=t.getState().nodeLookup.get(N.id);if(E&&!w&&(N.id===g.id||!E.internals.positionAbsolute))return!1;let j=pd(S?N:E),$=rf(j,k);return m&&$>0||$>=j.width*j.height||$>=k.width*k.height}):[]},isNodeIntersecting:(g,m,b=!0)=>{let w=x1(g)?g:p(g);if(!w)return!1;let k=rf(w,m);return b&&k>0||k>=m.width*m.height||k>=w.width*w.height},updateNode:h,updateNodeData:(g,m,b={replace:!1})=>{h(g,w=>{let k=typeof m=="function"?m(w):m;return b.replace?{...w,data:k}:{...w,data:{...w.data,...k}}},b)},updateEdge:v,updateEdgeData:(g,m,b={replace:!1})=>{v(g,w=>{let k=typeof m=="function"?m(w):m;return b.replace?{...w,data:k}:{...w,data:{...w.data,...k}}},b)},getNodesBounds:g=>{let{nodeLookup:m,nodeOrigin:b}=t.getState();return ef(g,{nodeLookup:m,nodeOrigin:b})},getHandleConnections:({type:g,id:m,nodeId:b})=>Array.from(t.getState().connectionLookup.get(`${b}-${g}${m?`-${m}`:""}`)?.values()??[]),getNodeConnections:({type:g,handleId:m,nodeId:b})=>Array.from(t.getState().connectionLookup.get(`${b}${g?m?`-${g}-${m}`:`-${g}`:""}`)?.values()??[]),fitView:async g=>{let m=t.getState().fitViewResolver??dD();return t.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:m}),n.nodeQueue.push(b=>[...b]),m.promise}}},[]);return(0,T.useMemo)(()=>({...a,...e,viewportInitialized:r}),[r])}var NS=e=>e.selected,LL=typeof window<"u"?window:void 0;function IL({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=pt(),{deleteElements:r}=As(),a=bd(e,{actInsideInputWithModifier:!1}),s=bd(t,{target:LL});(0,T.useEffect)(()=>{if(a){let{edges:l,nodes:f}=n.getState();r({nodes:f.filter(NS),edges:l.filter(NS)}),n.setState({nodesSelectionActive:!1})}},[a]),(0,T.useEffect)(()=>{n.setState({multiSelectionActive:s})},[s])}function RL(e){let t=pt();(0,T.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let r=jg(e.current);(r.height===0||r.width===0)&&t.getState().onError?.("004",Wn.error004()),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);let r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}var ff={position:"absolute",width:"100%",height:"100%",top:0,left:0},zL=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function FL({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:a,panOnScrollSpeed:s=.5,panOnScrollMode:l=Ns.Free,zoomOnDoubleClick:f=!0,panOnDrag:p=!0,defaultViewport:h,translateExtent:v,minZoom:g,maxZoom:m,zoomActivationKeyCode:b,preventScrolling:w=!0,children:k,noWheelClassName:S,noPanClassName:N,onViewportChange:E,isControlledViewport:j,paneClickDistance:$,selectionOnDrag:L}){let z=pt(),A=(0,T.useRef)(null),{userSelectionActive:M,lib:O,connectionInProgress:K}=Ke(zL,yt),B=bd(b),V=(0,T.useRef)();RL(A);let oe=(0,T.useCallback)(F=>{E?.({x:F[0],y:F[1],zoom:F[2]}),j||z.setState({transform:F})},[E,j]);return(0,T.useEffect)(()=>{if(A.current){V.current=WD({domNode:A.current,minZoom:g,maxZoom:m,translateExtent:v,viewport:h,onDraggingChange:U=>z.setState(W=>W.paneDragging===U?W:{paneDragging:U}),onPanZoomStart:(U,W)=>{let{onViewportChangeStart:re,onMoveStart:le}=z.getState();le?.(U,W),re?.(W)},onPanZoom:(U,W)=>{let{onViewportChange:re,onMove:le}=z.getState();le?.(U,W),re?.(W)},onPanZoomEnd:(U,W)=>{let{onViewportChangeEnd:re,onMoveEnd:le}=z.getState();le?.(U,W),re?.(W)}});let{x:F,y:J,zoom:I}=V.current.getViewport();return z.setState({panZoom:V.current,transform:[F,J,I],domNode:A.current.closest(".react-flow")}),()=>{V.current?.destroy()}}},[]),(0,T.useEffect)(()=>{V.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:a,panOnScrollSpeed:s,panOnScrollMode:l,zoomOnDoubleClick:f,panOnDrag:p,zoomActivationKeyPressed:B,preventScrolling:w,noPanClassName:N,userSelectionActive:M,noWheelClassName:S,lib:O,onTransformChange:oe,connectionInProgress:K,selectionOnDrag:L,paneClickDistance:$})},[e,t,n,r,a,s,l,f,p,B,w,N,M,S,O,oe,K,L,$]),(0,c.jsx)("div",{className:"react-flow__renderer",ref:A,style:ff,children:k})}var BL=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function qL(){let{userSelectionActive:e,userSelectionRect:t}=Ke(BL,yt);return e&&t?(0,c.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}var zg=(e,t)=>n=>{n.target===t.current&&e?.(n)},HL=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function VL({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Jc.Full,panOnDrag:r,autoPanOnSelection:a,paneClickDistance:s,selectionOnDrag:l,onSelectionStart:f,onSelectionEnd:p,onPaneClick:h,onPaneContextMenu:v,onPaneScroll:g,onPaneMouseEnter:m,onPaneMouseMove:b,onPaneMouseLeave:w,children:k}){let S=(0,T.useRef)(0),N=pt(),{userSelectionActive:E,elementsSelectable:j,dragging:$,panBy:L,autoPanSpeed:z}=Ke(HL,yt),A=j&&(e||E),M=(0,T.useRef)(null),O=(0,T.useRef)(),K=(0,T.useRef)(new Set),B=(0,T.useRef)(new Set),V=(0,T.useRef)(!1),oe=(0,T.useRef)(!1),F=(0,T.useRef)({x:0,y:0}),J=(0,T.useRef)(!1),I=X=>{oe.current||V.current||N.getState().connection.inProgress?(oe.current=!1,V.current=!1):(h?.(X),N.getState().resetSelectedElements(),N.setState({nodesSelectionActive:!1}))},U=X=>{Array.isArray(r)&&r?.includes(2)?X.preventDefault():v?.(X)},W=g?X=>g(X):void 0,re=X=>{oe.current&&=(X.stopPropagation(),!1)},le=X=>{if(X.pointerType==="touch"&&r!==!1&&!t)return;let{domNode:he,transform:Z}=N.getState();if(O.current=he?.getBoundingClientRect(),!O.current)return;let q=X.target===M.current;if(!q&&X.target.closest(".nokey")||!e||!(l&&q||t)||X.button!==0||!X.isPrimary)return;X.target?.setPointerCapture?.(X.pointerId),oe.current=!1;let{x:ee,y:de}=fo(X.nativeEvent,O.current),me=gd({x:ee,y:de},Z);N.setState({userSelectionRect:{width:0,height:0,startX:me.x,startY:me.y,x:ee,y:de}}),q||(X.stopPropagation(),X.preventDefault())};function pe(X,he){let{userSelectionRect:Z}=N.getState();if(!Z)return;let{transform:q,nodeLookup:ee,edgeLookup:de,connectionLookup:me,triggerNodeChanges:De,triggerEdgeChanges:Fe,defaultEdgeOptions:Ye}=N.getState(),Ie={x:Z.startX,y:Z.startY},{x:Be,y:ut}=Cs(Ie,q),kt={startX:Ie.x,startY:Ie.y,x:X<Be?X:Be,y:he<ut?he:ut,width:Math.abs(X-Be),height:Math.abs(he-ut)},Lt=K.current,zt=B.current;K.current=new Set(wg(ee,kt,q,n===Jc.Partial,!0).map(Ft=>Ft.id)),B.current=new Set;let hn=Ye?.selectable??!0;for(let Ft of K.current){let Bt=me.get(Ft);if(Bt)for(let{edgeId:nn}of Bt.values()){let pn=de.get(nn);pn&&(pn.selectable??hn)&&B.current.add(nn)}}N1(Lt,K.current)||De(Ts(ee,K.current,!0)),N1(zt,B.current)||Fe(Ts(de,B.current)),N.setState({userSelectionRect:kt,userSelectionActive:!0,nodesSelectionActive:!1})}function xe(){if(!a||!O.current)return;let[X,he]=kg(F.current,O.current,z);L({x:X,y:he}).then(Z=>{if(!oe.current||!Z){S.current=requestAnimationFrame(xe);return}let{x:q,y:ee}=F.current;pe(q,ee),S.current=requestAnimationFrame(xe)})}let Ne=()=>{cancelAnimationFrame(S.current),S.current=0,J.current=!1};(0,T.useEffect)(()=>()=>Ne(),[]);let we=X=>{let{userSelectionRect:he,transform:Z,resetSelectedElements:q}=N.getState();if(!O.current||!he)return;let{x:ee,y:de}=fo(X.nativeEvent,O.current);F.current={x:ee,y:de};let me=Cs({x:he.startX,y:he.startY},Z);if(!oe.current){let De=t?0:s;if(Math.hypot(ee-me.x,de-me.y)<=De)return;q(),f?.(X)}oe.current=!0,J.current||=(xe(),!0),pe(ee,de)},R=X=>{A?X.button===0&&(X.target?.releasePointerCapture?.(X.pointerId),!E&&X.target===M.current&&N.getState().userSelectionRect&&I?.(X),N.setState({userSelectionActive:!1,userSelectionRect:null}),oe.current&&(p?.(X),N.setState({nodesSelectionActive:K.current.size>0})),Ne()):X.target===M.current&&N.getState().connection.inProgress&&(V.current=!0)},Q=X=>{X.target?.releasePointerCapture?.(X.pointerId),Ne()},fe=r===!0||Array.isArray(r)&&r.includes(0);return(0,c.jsxs)("div",{className:Dt(["react-flow__pane",{draggable:fe,dragging:$,selection:e}]),onClick:A?void 0:zg(I,M),onContextMenu:zg(U,M),onWheel:zg(W,M),onPointerEnter:A?void 0:m,onPointerMove:A?we:b,onPointerUp:R,onPointerCancel:A?Q:void 0,onPointerDownCapture:A?le:void 0,onClickCapture:A?re:void 0,onPointerLeave:w,ref:M,style:ff,children:[k,(0,c.jsx)(qL,{})]})}function Fg({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:a,unselectNodesAndEdges:s,multiSelectionActive:l,nodeLookup:f,onError:p}=t.getState(),h=f.get(e);h?(t.setState({nodesSelectionActive:!1}),h.selected?(n||h.selected&&l)&&(s({nodes:[h],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):a([e])):p?.("012",Wn.error012(e))}function jS({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:a,isSelectable:s,nodeClickDistance:l}){let f=pt(),[p,h]=(0,T.useState)(!1),v=(0,T.useRef)();return(0,T.useEffect)(()=>{if(!t)return v.current=MD({getStoreItems:()=>f.getState(),onNodeMouseDown:g=>{Fg({id:g,store:f,nodeRef:e})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}}),()=>{v.current?.destroy(),v.current=void 0}},[t,f,e]),(0,T.useEffect)(()=>{!t&&e.current&&v.current&&v.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:s,nodeId:a,nodeClickDistance:l})},[n,r,t,s,e,a,l]),p}var KL=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function CS(){let e=pt();return(0,T.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:a,nodesDraggable:s,onError:l,updateNodePositions:f,nodeLookup:p,nodeOrigin:h}=e.getState(),v=new Map,g=KL(s),m=r?a[0]:5,b=r?a[1]:5,w=t.direction.x*m*t.factor,k=t.direction.y*b*t.factor;for(let[,S]of p){if(!g(S))continue;let N={x:S.internals.positionAbsolute.x+w,y:S.internals.positionAbsolute.y+k};r&&(N=md(N,a));let{position:E,positionAbsolute:j}=m1({nodeId:S.id,nextPosition:N,nodeLookup:p,nodeExtent:n,nodeOrigin:h,onError:l});S.position=E,S.internals.positionAbsolute=j,v.set(S.id,S)}f(v)},[])}var Bg=(0,T.createContext)(null),WL=Bg.Provider;Bg.Consumer;var ES=()=>(0,T.useContext)(Bg),UL=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),$S=(0,T.createContext)(null);function YL({children:e}){let t=Ke(UL,yt);return(0,c.jsx)($S.Provider,{value:t,children:e})}function XL(){let e=(0,T.useContext)($S);if(!e)throw Error("useHandleConfig must be used within a HandleConfigProvider");return e}var ZL={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},GL=(e,t,n)=>r=>{let{connectionClickStartHandle:a,connectionMode:s,connection:l}=r,{fromHandle:f,toHandle:p,isValid:h}=l;if(!f&&!a)return ZL;let v=p?.nodeId===e&&p?.id===t&&p?.type===n;return{connectingFrom:f?.nodeId===e&&f?.id===t&&f?.type===n,connectingTo:v,clickConnecting:a?.nodeId===e&&a?.id===t&&a?.type===n,isPossibleEndHandle:s===cd.Strict?f?.type!==n:e!==f?.nodeId||t!==f?.id,connectionInProcess:!!f,clickConnectionInProcess:!!a,valid:v&&h}};function QL({type:e="source",position:t=Ce.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:s=!0,id:l,onConnect:f,children:p,className:h,onMouseDown:v,onTouchStart:g,...m},b){let w=l||null,k=e==="target",S=pt(),N=ES(),{connectOnClick:E,noPanClassName:j,rfId:$}=XL(),{connectingFrom:L,connectingTo:z,clickConnecting:A,isPossibleEndHandle:M,connectionInProcess:O,clickConnectionInProcess:K,valid:B}=Ke(GL(N,w,e),yt);N||S.getState().onError?.("010",Wn.error010());let V=F=>{let{defaultEdgeOptions:J,onConnect:I,hasDefaultEdges:U}=S.getState(),W={...J,...F};if(U){let{edges:re,setEdges:le,onError:pe}=S.getState();le(TL(W,re,{onError:pe}))}I?.(W),f?.(W)},oe=F=>{if(!N)return;let J=$1(F.nativeEvent);if(a&&(J&&F.button===0||!J)){let I=S.getState();Pg.onPointerDown(F.nativeEvent,{handleDomNode:F.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:k,handleId:w,nodeId:N,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...U)=>S.getState().onConnectEnd?.(...U),updateConnection:I.updateConnection,onConnect:V,isValidConnection:n||((...U)=>S.getState().isValidConnection?.(...U)??!0),getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}J?v?.(F):g?.(F)};return(0,c.jsx)("div",{"data-handleid":w,"data-nodeid":N,"data-handlepos":t,"data-id":`${$}-${N}-${w}-${e}`,className:Dt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",j,h,{source:!k,target:k,connectable:r,connectablestart:a,connectableend:s,clickconnecting:A,connectingfrom:L,connectingto:z,valid:B,connectionindicator:r&&(!O||M)&&(O||K?s:a)}]),onMouseDown:oe,onTouchStart:oe,onClick:E?F=>{let{onClickConnectStart:J,onClickConnectEnd:I,connectionClickStartHandle:U,connectionMode:W,isValidConnection:re,lib:le,rfId:pe,nodeLookup:xe,connection:Ne}=S.getState();if(!N||!U&&!a)return;if(!U){J?.(F.nativeEvent,{nodeId:N,handleId:w,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:N,type:e,id:w}});return}let we=C1(F.target),R=n||re,{connection:Q,isValid:fe}=Pg.isValid(F.nativeEvent,{handle:{nodeId:N,id:w,type:e},connectionMode:W,fromNodeId:U.nodeId,fromHandleId:U.id||null,fromType:U.type,isValidConnection:R,flowId:pe,doc:we,lib:le,nodeLookup:xe});fe&&Q&&V(Q);let X=structuredClone(Ne);delete X.inProgress,X.toPosition=X.toHandle?X.toHandle.position:null,I?.(F,X),S.setState({connectionClickStartHandle:null})}:void 0,ref:b,...m,children:p})}var vr=(0,T.memo)(xS(QL));function JL({data:e,isConnectable:t,sourcePosition:n=Ce.Bottom}){return(0,c.jsxs)(c.Fragment,{children:[e?.label,(0,c.jsx)(vr,{type:"source",position:n,isConnectable:t})]})}function eI({data:e,isConnectable:t,targetPosition:n=Ce.Top,sourcePosition:r=Ce.Bottom}){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(vr,{type:"target",position:n,isConnectable:t}),e?.label,(0,c.jsx)(vr,{type:"source",position:r,isConnectable:t})]})}function tI(){return null}function nI({data:e,isConnectable:t,targetPosition:n=Ce.Top}){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(vr,{type:"target",position:n,isConnectable:t}),e?.label]})}var hf={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},_S={input:JL,default:eI,output:nI,group:tI};function oI(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var rI=e=>{let{width:t,height:n,x:r,y:a}=hd(e.nodeLookup,{filter:s=>!!s.selected});return{width:uo(t)?t:null,height:uo(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${a}px)`}};function iI({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=pt(),{width:a,height:s,transformString:l,userSelectionActive:f}=Ke(rI,yt),p=CS(),h=(0,T.useRef)(null);(0,T.useEffect)(()=>{n||h.current?.focus({preventScroll:!0})},[n]);let v=!f&&a!==null&&s!==null;if(jS({nodeRef:h,disabled:!v}),!v)return null;let g=e?m=>{e(m,r.getState().nodes.filter(b=>b.selected))}:void 0;return(0,c.jsx)("div",{className:Dt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:(0,c.jsx)("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:n?void 0:-1,onKeyDown:n?void 0:m=>{Object.prototype.hasOwnProperty.call(hf,m.key)&&(m.preventDefault(),p({direction:hf[m.key],factor:m.shiftKey?4:1}))},style:{width:a,height:s}})})}var TS=typeof window<"u"?window:void 0,aI=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function AS({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:s,onPaneScroll:l,paneClickDistance:f,deleteKeyCode:p,selectionKeyCode:h,selectionOnDrag:v,selectionMode:g,onSelectionStart:m,onSelectionEnd:b,multiSelectionKeyCode:w,panActivationKeyCode:k,zoomActivationKeyCode:S,elementsSelectable:N,zoomOnScroll:E,zoomOnPinch:j,panOnScroll:$,panOnScrollSpeed:L,panOnScrollMode:z,zoomOnDoubleClick:A,panOnDrag:M,autoPanOnSelection:O,defaultViewport:K,translateExtent:B,minZoom:V,maxZoom:oe,preventScrolling:F,onSelectionContextMenu:J,noWheelClassName:I,noPanClassName:U,disableKeyboardA11y:W,onViewportChange:re,isControlledViewport:le}){let{nodesSelectionActive:pe,userSelectionActive:xe}=Ke(aI,yt),Ne=bd(h,{target:TS}),we=bd(k,{target:TS}),R=we||M,Q=we||$,fe=v&&R!==!0,X=Ne||xe||fe;return IL({deleteKeyCode:p,multiSelectionKeyCode:w}),(0,c.jsx)(FL,{onPaneContextMenu:s,elementsSelectable:N,zoomOnScroll:E,zoomOnPinch:j,panOnScroll:Q,panActivationKeyPressed:we,panOnScrollSpeed:L,panOnScrollMode:z,zoomOnDoubleClick:A,panOnDrag:!Ne&&R,defaultViewport:K,translateExtent:B,minZoom:V,maxZoom:oe,zoomActivationKeyCode:S,preventScrolling:F,noWheelClassName:I,noPanClassName:U,onViewportChange:re,isControlledViewport:le,paneClickDistance:f,selectionOnDrag:fe,children:(0,c.jsxs)(VL,{onSelectionStart:m,onSelectionEnd:b,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:s,onPaneScroll:l,panOnDrag:R,autoPanOnSelection:O,isSelecting:!!X,selectionMode:g,selectionKeyPressed:Ne,paneClickDistance:f,selectionOnDrag:fe,children:[e,pe&&(0,c.jsx)(iI,{onSelectionContextMenu:J,noPanClassName:U,disableKeyboardA11y:W})]})})}AS.displayName="FlowRenderer";var sI=(0,T.memo)(AS),lI=e=>t=>e?wg(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 dI(e){return Ke((0,T.useCallback)(lI(e),[e]),yt)}var uI=e=>e.updateNodeInternals;function cI(){let e=Ke(uI),[t]=(0,T.useState)(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{let r=new Map;n.forEach(a=>{let s=a.target.getAttribute("data-id");r.set(s,{id:s,nodeElement:a.target,force:!0})}),e(r)}));return(0,T.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function fI({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let a=pt(),s=(0,T.useRef)(null),l=(0,T.useRef)(null),f=(0,T.useRef)(e.sourcePosition),p=(0,T.useRef)(e.targetPosition),h=(0,T.useRef)(t),v=n&&!!e.internals.handleBounds;return(0,T.useEffect)(()=>{!s.current||e.hidden||v&&l.current===s.current||(l.current&&r?.unobserve(l.current),r?.observe(s.current),l.current=s.current)},[v,e.hidden]),(0,T.useEffect)(()=>()=>{l.current&&=(r?.unobserve(l.current),null)},[]),(0,T.useEffect)(()=>{if(s.current){let g=h.current!==t,m=f.current!==e.sourcePosition,b=p.current!==e.targetPosition;(g||m||b)&&(h.current=t,f.current=e.sourcePosition,p.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function hI({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:a,onContextMenu:s,onDoubleClick:l,nodesDraggable:f,elementsSelectable:p,nodesConnectable:h,nodesFocusable:v,resizeObserver:g,noDragClassName:m,noPanClassName:b,disableKeyboardA11y:w,rfId:k,nodeTypes:S,nodeClickDistance:N,onError:E}){let{node:j,internals:$,isParent:L}=Ke(X=>{let he=X.nodeLookup.get(e),Z=X.parentLookup.has(e);return{node:he,internals:he.internals,isParent:Z}},yt),z=j.type||"default",A=S?.[z]||_S[z];A===void 0&&(E?.("003",Wn.error003(z)),z="default",A=S?.default||_S.default);let M=!!(j.draggable||f&&j.draggable===void 0),O=!!(j.selectable||p&&j.selectable===void 0),K=!!(j.connectable||h&&j.connectable===void 0),B=!!(j.focusable||v&&j.focusable===void 0),V=pt(),oe=k1(j),F=fI({node:j,nodeType:z,hasDimensions:oe,resizeObserver:g}),J=jS({nodeRef:F,disabled:j.hidden||!M,noDragClassName:m,handleSelector:j.dragHandle,nodeId:e,isSelectable:O,nodeClickDistance:N}),I=CS();if(j.hidden)return null;let U=co(j),W=oI(j),re=O||M||t||n||r||a,le=n?X=>n(X,{...$.userNode}):void 0,pe=r?X=>r(X,{...$.userNode}):void 0,xe=a?X=>a(X,{...$.userNode}):void 0,Ne=s?X=>s(X,{...$.userNode}):void 0,we=l?X=>l(X,{...$.userNode}):void 0,R=X=>{let{selectNodesOnDrag:he,nodeDragThreshold:Z}=V.getState();O&&(!he||!M||Z>0)&&Fg({id:e,store:V,nodeRef:F}),t&&t(X,{...$.userNode})},Q=X=>{if(!(E1(X.nativeEvent)||w)){if(u1.includes(X.key)&&O){let he=X.key==="Escape";Fg({id:e,store:V,unselect:he,nodeRef:F})}else if(M&&j.selected&&Object.prototype.hasOwnProperty.call(hf,X.key)){X.preventDefault();let{ariaLabelConfig:he}=V.getState();V.setState({ariaLiveMessage:he["node.a11yDescription.ariaLiveMessage"]({direction:X.key.replace("Arrow","").toLowerCase(),x:~~$.positionAbsolute.x,y:~~$.positionAbsolute.y})}),I({direction:hf[X.key],factor:X.shiftKey?4:1})}}},fe=()=>{if(w||!F.current?.matches(":focus-visible"))return;let{transform:X,width:he,height:Z,autoPanOnNodeFocus:q,setCenter:ee}=V.getState();q&&(wg(new Map([[e,j]]),{x:0,y:0,width:he,height:Z},X,!0).length>0||ee(j.position.x+U.width/2,j.position.y+U.height/2,{zoom:X[2]}))};return(0,c.jsx)("div",{className:Dt(["react-flow__node",`react-flow__node-${z}`,{[b]:M},j.className,{selected:j.selected,selectable:O,parent:L,draggable:M,dragging:J}]),ref:F,style:{zIndex:$.z,transform:`translate(${$.positionAbsolute.x}px,${$.positionAbsolute.y}px)`,pointerEvents:re?"all":"none",visibility:oe?"visible":"hidden",...j.style,...W},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:le,onMouseMove:pe,onMouseLeave:xe,onContextMenu:Ne,onClick:R,onDoubleClick:we,onKeyDown:B?Q:void 0,tabIndex:B?0:void 0,onFocus:B?fe:void 0,role:j.ariaRole??(B?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${aS}-${k}`,"aria-label":j.ariaLabel,...j.domAttributes,children:(0,c.jsx)(WL,{value:e,children:(0,c.jsx)(A,{id:e,data:j.data,type:z,positionAbsoluteX:$.positionAbsolute.x,positionAbsoluteY:$.positionAbsolute.y,selected:j.selected??!1,selectable:O,draggable:M,deletable:j.deletable??!0,isConnectable:K,sourcePosition:j.sourcePosition,targetPosition:j.targetPosition,dragging:J,dragHandle:j.dragHandle,zIndex:$.z,parentId:j.parentId,...U})})})}var pI=(0,T.memo)(hI),mI=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function MS(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:a}=Ke(mI,yt),s=dI(e.onlyRenderVisibleElements),l=cI();return(0,c.jsx)("div",{className:"react-flow__nodes",style:ff,children:s.map(f=>(0,c.jsx)(pI,{id:f,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:l,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:a},f))})}MS.displayName="NodeRenderer";var gI=(0,T.memo)(MS);function yI(e){return Ke((0,T.useCallback)(t=>{if(!e)return t.edges.map(r=>r.id);let n=[];if(t.width&&t.height)for(let r of t.edges){let a=t.nodeLookup.get(r.source),s=t.nodeLookup.get(r.target);a&&s&&hD({sourceNode:a,targetNode:s,width:t.width,height:t.height,transform:t.transform})&&n.push(r.id)}return n},[e]),yt)}var vI=({color:e="none",strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,c.jsx)("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},bI=({color:e="none",strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,c.jsx)("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},OS={[na.Arrow]:vI,[na.ArrowClosed]:bI};function xI(e){let t=pt();return(0,T.useMemo)(()=>Object.prototype.hasOwnProperty.call(OS,e)?OS[e]:(t.getState().onError?.("009",Wn.error009(e)),null),[e])}var wI=({id:e,type:t,color:n,width:r=12.5,height:a=12.5,markerUnits:s="strokeWidth",strokeWidth:l,orient:f="auto-start-reverse"})=>{let p=xI(t);return p?(0,c.jsx)("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:f,refX:"0",refY:"0",children:(0,c.jsx)(p,{color:n,strokeWidth:l})}):null},PS=({defaultColor:e,rfId:t})=>{let n=Ke(s=>s.edges),r=Ke(s=>s.defaultEdgeOptions),a=(0,T.useMemo)(()=>wD(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return a.length?(0,c.jsx)("svg",{className:"react-flow__marker","aria-hidden":"true",children:(0,c.jsx)("defs",{children:a.map(s=>(0,c.jsx)(wI,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};PS.displayName="MarkerDefinitions";var kI=(0,T.memo)(PS);function DS({x:e,y:t,label:n,labelStyle:r,labelShowBg:a=!0,labelBgStyle:s,labelBgPadding:l=[2,4],labelBgBorderRadius:f=2,children:p,className:h,...v}){let[g,m]=(0,T.useState)({x:1,y:0,width:0,height:0}),b=Dt(["react-flow__edge-textwrapper",h]),w=(0,T.useRef)(null);return(0,T.useEffect)(()=>{if(w.current){let k=w.current.getBBox();m({x:k.x,y:k.y,width:k.width,height:k.height})}},[n]),n?(0,c.jsxs)("g",{transform:`translate(${e-g.width/2} ${t-g.height/2})`,className:b,visibility:g.width?"visible":"hidden",...v,children:[a&&(0,c.jsx)("rect",{width:g.width+2*l[0],x:-l[0],y:-l[1],height:g.height+2*l[1],className:"react-flow__edge-textbg",style:s,rx:f,ry:f}),(0,c.jsx)("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:w,style:r,children:n}),p]}):null}DS.displayName="EdgeText";var SI=(0,T.memo)(DS);function xd({path:e,labelX:t,labelY:n,label:r,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:f,labelBgBorderRadius:p,interactionWidth:h=20,...v}){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("path",{...v,d:e,fill:"none",className:Dt(["react-flow__edge-path",v.className])}),h?(0,c.jsx)("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,r&&uo(t)&&uo(n)?(0,c.jsx)(SI,{x:t,y:n,label:r,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:f,labelBgBorderRadius:p}):null]})}function LS({pos:e,x1:t,y1:n,x2:r,y2:a}){return e===Ce.Left||e===Ce.Right?[.5*(t+r),n]:[t,.5*(n+a)]}function IS({sourceX:e,sourceY:t,sourcePosition:n=Ce.Bottom,targetX:r,targetY:a,targetPosition:s=Ce.Top}){let[l,f]=LS({pos:n,x1:e,y1:t,x2:r,y2:a}),[p,h]=LS({pos:s,x1:r,y1:a,x2:e,y2:t}),[v,g,m,b]=T1({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:l,sourceControlY:f,targetControlX:p,targetControlY:h});return[`M${e},${t} C${l},${f} ${p},${h} ${r},${a}`,v,g,m,b]}function RS(e){return(0,T.memo)(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:s,sourcePosition:l,targetPosition:f,label:p,labelStyle:h,labelShowBg:v,labelBgStyle:g,labelBgPadding:m,labelBgBorderRadius:b,style:w,markerEnd:k,markerStart:S,interactionWidth:N})=>{let[E,j,$]=IS({sourceX:n,sourceY:r,sourcePosition:l,targetX:a,targetY:s,targetPosition:f}),L=e.isInternal?void 0:t;return(0,c.jsx)(xd,{id:L,path:E,labelX:j,labelY:$,label:p,labelStyle:h,labelShowBg:v,labelBgStyle:g,labelBgPadding:m,labelBgBorderRadius:b,style:w,markerEnd:k,markerStart:S,interactionWidth:N})})}var NI=RS({isInternal:!1}),zS=RS({isInternal:!0});NI.displayName="SimpleBezierEdge",zS.displayName="SimpleBezierEdgeInternal";function FS(e){return(0,T.memo)(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:s,label:l,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:g,style:m,sourcePosition:b=Ce.Bottom,targetPosition:w=Ce.Top,markerEnd:k,markerStart:S,pathOptions:N,interactionWidth:E})=>{let[j,$,L]=sf({sourceX:n,sourceY:r,sourcePosition:b,targetX:a,targetY:s,targetPosition:w,borderRadius:N?.borderRadius,offset:N?.offset,stepPosition:N?.stepPosition}),z=e.isInternal?void 0:t;return(0,c.jsx)(xd,{id:z,path:j,labelX:$,labelY:L,label:l,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:g,style:m,markerEnd:k,markerStart:S,interactionWidth:E})})}var BS=FS({isInternal:!1}),qS=FS({isInternal:!0});BS.displayName="SmoothStepEdge",qS.displayName="SmoothStepEdgeInternal";function HS(e){return(0,T.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,c.jsx)(BS,{...n,id:r,pathOptions:(0,T.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var jI=HS({isInternal:!1}),VS=HS({isInternal:!0});jI.displayName="StepEdge",VS.displayName="StepEdgeInternal";function KS(e){return(0,T.memo)(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:s,label:l,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:g,style:m,markerEnd:b,markerStart:w,interactionWidth:k})=>{let[S,N,E]=P1({sourceX:n,sourceY:r,targetX:a,targetY:s}),j=e.isInternal?void 0:t;return(0,c.jsx)(xd,{id:j,path:S,labelX:N,labelY:E,label:l,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:g,style:m,markerEnd:b,markerStart:w,interactionWidth:k})})}var CI=KS({isInternal:!1}),WS=KS({isInternal:!0});CI.displayName="StraightEdge",WS.displayName="StraightEdgeInternal";function US(e){return(0,T.memo)(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:s,sourcePosition:l=Ce.Bottom,targetPosition:f=Ce.Top,label:p,labelStyle:h,labelShowBg:v,labelBgStyle:g,labelBgPadding:m,labelBgBorderRadius:b,style:w,markerEnd:k,markerStart:S,pathOptions:N,interactionWidth:E})=>{let[j,$,L]=M1({sourceX:n,sourceY:r,sourcePosition:l,targetX:a,targetY:s,targetPosition:f,curvature:N?.curvature}),z=e.isInternal?void 0:t;return(0,c.jsx)(xd,{id:z,path:j,labelX:$,labelY:L,label:p,labelStyle:h,labelShowBg:v,labelBgStyle:g,labelBgPadding:m,labelBgBorderRadius:b,style:w,markerEnd:k,markerStart:S,interactionWidth:E})})}var EI=US({isInternal:!1}),YS=US({isInternal:!0});EI.displayName="BezierEdge",YS.displayName="BezierEdgeInternal";var XS={default:YS,straight:WS,step:VS,smoothstep:qS,simplebezier:zS},ZS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},$I=(e,t,n)=>n===Ce.Left?e-t:n===Ce.Right?e+t:e,_I=(e,t,n)=>n===Ce.Top?e-t:n===Ce.Bottom?e+t:e,GS="react-flow__edgeupdater";function QS({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:a,onMouseEnter:s,onMouseOut:l,type:f}){return(0,c.jsx)("circle",{onMouseDown:a,onMouseEnter:s,onMouseOut:l,className:Dt([GS,`${GS}-${f}`]),cx:$I(t,r,e),cy:_I(n,r,e),r,stroke:"transparent",fill:"transparent"})}function TI({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:a,targetX:s,targetY:l,sourcePosition:f,targetPosition:p,onReconnect:h,onReconnectStart:v,onReconnectEnd:g,setReconnecting:m,setUpdateHover:b}){let w=pt(),k=($,L)=>{if($.button!==0)return;let{autoPanOnConnect:z,domNode:A,connectionMode:M,connectionRadius:O,lib:K,onConnectStart:B,cancelConnection:V,nodeLookup:oe,rfId:F,panBy:J,updateConnection:I}=w.getState(),U=L.type==="target";Pg.onPointerDown($.nativeEvent,{autoPanOnConnect:z,connectionMode:M,connectionRadius:O,domNode:A,handleId:L.id,nodeId:L.nodeId,nodeLookup:oe,isTarget:U,edgeUpdaterType:L.type,lib:K,flowId:F,cancelConnection:V,panBy:J,isValidConnection:(...W)=>w.getState().isValidConnection?.(...W)??!0,onConnect:W=>h?.(n,W),onConnectStart:(W,re)=>{m(!0),v?.($,n,L.type),B?.(W,re)},onConnectEnd:(...W)=>w.getState().onConnectEnd?.(...W),onReconnectEnd:(W,re)=>{m(!1),g?.(W,n,L.type,re)},updateConnection:I,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:$.currentTarget})},S=$=>k($,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),N=$=>k($,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),E=()=>b(!0),j=()=>b(!1);return(0,c.jsxs)(c.Fragment,{children:[(e===!0||e==="source")&&(0,c.jsx)(QS,{position:f,centerX:r,centerY:a,radius:t,onMouseDown:S,onMouseEnter:E,onMouseOut:j,type:"source"}),(e===!0||e==="target")&&(0,c.jsx)(QS,{position:p,centerX:s,centerY:l,radius:t,onMouseDown:N,onMouseEnter:E,onMouseOut:j,type:"target"})]})}function AI({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:a,onDoubleClick:s,onContextMenu:l,onMouseEnter:f,onMouseMove:p,onMouseLeave:h,reconnectRadius:v,onReconnect:g,onReconnectStart:m,onReconnectEnd:b,rfId:w,edgeTypes:k,noPanClassName:S,onError:N,disableKeyboardA11y:E}){let j=Ke(q=>q.edgeLookup.get(e)),$=Ke(q=>q.defaultEdgeOptions);j=$?{...$,...j}:j;let L=j.type||"default",z=k?.[L]||XS[L];z===void 0&&(N?.("011",Wn.error011(L)),L="default",z=k?.default||XS.default);let A=!!(j.focusable||t&&j.focusable===void 0),M=g!==void 0&&(j.reconnectable||n&&j.reconnectable===void 0),O=!!(j.selectable||r&&j.selectable===void 0),K=(0,T.useRef)(null),[B,V]=(0,T.useState)(!1),[oe,F]=(0,T.useState)(!1),J=pt(),{zIndex:I=j.zIndex,sourceX:U,sourceY:W,targetX:re,targetY:le,sourcePosition:pe,targetPosition:xe}=Ke((0,T.useCallback)(q=>{let ee=q.nodeLookup.get(j.source),de=q.nodeLookup.get(j.target);if(!ee||!de)return ZS;let me=xD({id:e,sourceNode:ee,targetNode:de,sourceHandle:j.sourceHandle||null,targetHandle:j.targetHandle||null,connectionMode:q.connectionMode,onError:N}),De=fD({selected:j.selected,zIndex:j.zIndex,sourceNode:ee,targetNode:de,elevateOnSelect:q.elevateEdgesOnSelect,zIndexMode:q.zIndexMode});return{...me||ZS,zIndex:De}},[j.source,j.target,j.sourceHandle,j.targetHandle,j.selected,j.zIndex,N]),yt),Ne=(0,T.useMemo)(()=>j.markerStart?`url('#${Cg(j.markerStart,w)}')`:void 0,[j.markerStart,w]),we=(0,T.useMemo)(()=>j.markerEnd?`url('#${Cg(j.markerEnd,w)}')`:void 0,[j.markerEnd,w]);if(j.hidden||U===null||W===null||re===null||le===null)return null;let R=q=>{let{addSelectedEdges:ee,unselectNodesAndEdges:de,multiSelectionActive:me}=J.getState();O&&(J.setState({nodesSelectionActive:!1}),j.selected&&me?(de({nodes:[],edges:[j]}),K.current?.blur()):ee([e])),a&&a(q,j)},Q=s?q=>{s(q,{...j})}:void 0,fe=l?q=>{l(q,{...j})}:void 0,X=f?q=>{f(q,{...j})}:void 0,he=p?q=>{p(q,{...j})}:void 0,Z=h?q=>{h(q,{...j})}:void 0;return(0,c.jsx)("svg",{style:{zIndex:I},children:(0,c.jsxs)("g",{className:Dt(["react-flow__edge",`react-flow__edge-${L}`,j.className,S,{selected:j.selected,animated:j.animated,inactive:!O&&!a,updating:B,selectable:O}]),onClick:R,onDoubleClick:Q,onContextMenu:fe,onMouseEnter:X,onMouseMove:he,onMouseLeave:Z,onKeyDown:A?q=>{if(!E&&u1.includes(q.key)&&O){let{unselectNodesAndEdges:ee,addSelectedEdges:de}=J.getState();q.key==="Escape"?(K.current?.blur(),ee({edges:[j]})):de([e])}}:void 0,tabIndex:A?0:void 0,role:j.ariaRole??(A?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":j.ariaLabel===null?void 0:j.ariaLabel||`Edge from ${j.source} to ${j.target}`,"aria-describedby":A?`${sS}-${w}`:void 0,ref:K,...j.domAttributes,children:[!oe&&(0,c.jsx)(z,{id:e,source:j.source,target:j.target,type:j.type,selected:j.selected,animated:j.animated,selectable:O,deletable:j.deletable??!0,label:j.label,labelStyle:j.labelStyle,labelShowBg:j.labelShowBg,labelBgStyle:j.labelBgStyle,labelBgPadding:j.labelBgPadding,labelBgBorderRadius:j.labelBgBorderRadius,sourceX:U,sourceY:W,targetX:re,targetY:le,sourcePosition:pe,targetPosition:xe,data:j.data,style:j.style,sourceHandleId:j.sourceHandle,targetHandleId:j.targetHandle,markerStart:Ne,markerEnd:we,pathOptions:"pathOptions"in j?j.pathOptions:void 0,interactionWidth:j.interactionWidth}),M&&(0,c.jsx)(TI,{edge:j,isReconnectable:M,reconnectRadius:v,onReconnect:g,onReconnectStart:m,onReconnectEnd:b,sourceX:U,sourceY:W,targetX:re,targetY:le,sourcePosition:pe,targetPosition:xe,setUpdateHover:V,setReconnecting:F})]})})}var MI=(0,T.memo)(AI),OI=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function JS({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:a,onReconnect:s,onEdgeContextMenu:l,onEdgeMouseEnter:f,onEdgeMouseMove:p,onEdgeMouseLeave:h,onEdgeClick:v,reconnectRadius:g,onEdgeDoubleClick:m,onReconnectStart:b,onReconnectEnd:w,disableKeyboardA11y:k}){let{edgesFocusable:S,edgesReconnectable:N,elementsSelectable:E,onError:j}=Ke(OI,yt),$=yI(t);return(0,c.jsxs)("div",{className:"react-flow__edges",children:[(0,c.jsx)(kI,{defaultColor:e,rfId:n}),$.map(L=>(0,c.jsx)(MI,{id:L,edgesFocusable:S,edgesReconnectable:N,elementsSelectable:E,noPanClassName:a,onReconnect:s,onContextMenu:l,onMouseEnter:f,onMouseMove:p,onMouseLeave:h,onClick:v,reconnectRadius:g,onDoubleClick:m,onReconnectStart:b,onReconnectEnd:w,rfId:n,onError:j,edgeTypes:r,disableKeyboardA11y:k},L))]})}JS.displayName="EdgeRenderer";var PI=(0,T.memo)(JS),eN=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function DI({children:e}){let t=pt(),n=(0,T.useRef)(null),[r]=(0,T.useState)(()=>t.getState().transform);return wS(()=>{let a=null,s=()=>{let l=t.getState().transform;a&&l[0]===a[0]&&l[1]===a[1]&&l[2]===a[2]||(a=l,n.current&&(n.current.style.transform=eN(l)))};return s(),t.subscribe(s)},[t]),(0,c.jsx)("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:eN(r)},children:e})}function LI(e){let t=As(),n=(0,T.useRef)(!1);(0,T.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var II=e=>e.panZoom?.syncViewport;function RI(e){let t=Ke(II),n=pt();return(0,T.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function tN(e){return e.connection.inProgress?{...e.connection,to:gd(e.connection.to,e.transform)}:{...e.connection}}function zI(e){return e?t=>e(tN(t)):tN}function FI(e){return Ke(zI(e),yt)}var BI=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function qI({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:a,width:s,height:l,isValid:f,inProgress:p}=Ke(BI,yt);return s&&a&&p?(0,c.jsx)("svg",{style:e,width:s,height:l,className:"react-flow__connectionline react-flow__container",children:(0,c.jsx)("g",{className:Dt(["react-flow__connection",j1(f)]),children:(0,c.jsx)(nN,{style:t,type:n,CustomComponent:r,isValid:f})})}):null}var nN=({style:e,type:t=ta.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:a,from:s,fromNode:l,fromHandle:f,fromPosition:p,to:h,toNode:v,toHandle:g,toPosition:m,pointer:b}=FI();if(!a)return;if(n)return(0,c.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:f,fromX:s.x,fromY:s.y,toX:h.x,toY:h.y,fromPosition:p,toPosition:m,connectionStatus:j1(r),toNode:v,toHandle:g,pointer:b});let w="",k={sourceX:s.x,sourceY:s.y,sourcePosition:p,targetX:h.x,targetY:h.y,targetPosition:m};switch(t){case ta.Bezier:[w]=M1(k);break;case ta.SimpleBezier:[w]=IS(k);break;case ta.Step:[w]=sf({...k,borderRadius:0});break;case ta.SmoothStep:[w]=sf(k);break;default:[w]=P1(k)}return(0,c.jsx)("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};nN.displayName="ConnectionLine";var HI={};function oN(e=HI){(0,T.useRef)(e),pt(),(0,T.useEffect)(()=>{},[e])}function VI(){pt(),(0,T.useRef)(!1),(0,T.useEffect)(()=>{},[])}function rN({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:a,onNodeDoubleClick:s,onEdgeDoubleClick:l,onNodeMouseEnter:f,onNodeMouseMove:p,onNodeMouseLeave:h,onNodeContextMenu:v,onSelectionContextMenu:g,onSelectionStart:m,onSelectionEnd:b,connectionLineType:w,connectionLineStyle:k,connectionLineComponent:S,connectionLineContainerStyle:N,selectionKeyCode:E,selectionOnDrag:j,selectionMode:$,multiSelectionKeyCode:L,panActivationKeyCode:z,zoomActivationKeyCode:A,deleteKeyCode:M,onlyRenderVisibleElements:O,elementsSelectable:K,defaultViewport:B,translateExtent:V,minZoom:oe,maxZoom:F,preventScrolling:J,defaultMarkerColor:I,zoomOnScroll:U,zoomOnPinch:W,panOnScroll:re,panOnScrollSpeed:le,panOnScrollMode:pe,zoomOnDoubleClick:xe,panOnDrag:Ne,autoPanOnSelection:we,onPaneClick:R,onPaneMouseEnter:Q,onPaneMouseMove:fe,onPaneMouseLeave:X,onPaneScroll:he,onPaneContextMenu:Z,paneClickDistance:q,nodeClickDistance:ee,onEdgeContextMenu:de,onEdgeMouseEnter:me,onEdgeMouseMove:De,onEdgeMouseLeave:Fe,reconnectRadius:Ye,onReconnect:Ie,onReconnectStart:Be,onReconnectEnd:ut,noDragClassName:kt,noWheelClassName:Lt,noPanClassName:zt,disableKeyboardA11y:hn,nodeExtent:Ft,rfId:Bt,viewport:nn,onViewportChange:pn,nodesDraggable:bt}){return oN(e),oN(t),VI(),LI(n),RI(nn),(0,c.jsx)(sI,{onPaneClick:R,onPaneMouseEnter:Q,onPaneMouseMove:fe,onPaneMouseLeave:X,onPaneContextMenu:Z,onPaneScroll:he,paneClickDistance:q,deleteKeyCode:M,selectionKeyCode:E,selectionOnDrag:j,selectionMode:$,onSelectionStart:m,onSelectionEnd:b,multiSelectionKeyCode:L,panActivationKeyCode:z,zoomActivationKeyCode:A,elementsSelectable:K,zoomOnScroll:U,zoomOnPinch:W,zoomOnDoubleClick:xe,panOnScroll:re,panOnScrollSpeed:le,panOnScrollMode:pe,panOnDrag:Ne,autoPanOnSelection:we,defaultViewport:B,translateExtent:V,minZoom:oe,maxZoom:F,onSelectionContextMenu:g,preventScrolling:J,noDragClassName:kt,noWheelClassName:Lt,noPanClassName:zt,disableKeyboardA11y:hn,onViewportChange:pn,isControlledViewport:!!nn,children:(0,c.jsxs)(DI,{children:[(0,c.jsx)(PI,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:l,onReconnect:Ie,onReconnectStart:Be,onReconnectEnd:ut,onlyRenderVisibleElements:O,onEdgeContextMenu:de,onEdgeMouseEnter:me,onEdgeMouseMove:De,onEdgeMouseLeave:Fe,reconnectRadius:Ye,defaultMarkerColor:I,noPanClassName:zt,disableKeyboardA11y:hn,rfId:Bt}),(0,c.jsx)(qI,{style:k,type:w,component:S,containerStyle:N}),(0,c.jsx)("div",{className:"react-flow__edgelabel-renderer"}),(0,c.jsx)(gI,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:s,onNodeMouseEnter:f,onNodeMouseMove:p,onNodeMouseLeave:h,onNodeContextMenu:v,nodeClickDistance:ee,onlyRenderVisibleElements:O,noPanClassName:zt,noDragClassName:kt,disableKeyboardA11y:hn,nodeExtent:Ft,rfId:Bt,nodesDraggable:bt}),(0,c.jsx)("div",{className:"react-flow__viewport-portal"})]})})}rN.displayName="GraphView";var KI=(0,T.memo)(rN),WI=w1("React Flow","https://reactflow.dev/"),iN=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:s,fitView:l,fitViewOptions:f,minZoom:p=.5,maxZoom:h=2,nodeOrigin:v,nodeExtent:g,zIndexMode:m="basic"}={})=>{let b=new Map,w=new Map,k=new Map,S=new Map,N=r??t??[],E=n??e??[],j=v??[0,0],$=g??ud;H1(k,S,N);let{nodesInitialized:L}=Tg(E,b,w,{nodeOrigin:j,nodeExtent:$,zIndexMode:m}),z=[0,0,1];if(l&&a&&s){let{x:A,y:M,zoom:O}=Ng(hd(b,{filter:K=>!(!K.width&&!K.initialWidth||!K.height&&!K.initialHeight)}),a,s,p,h,f?.padding??.1);z=[A,M,O]}return{rfId:"1",width:a??0,height:s??0,transform:z,nodes:E,nodesInitialized:L,nodeLookup:b,parentLookup:w,edges:N,edgeLookup:S,connectionLookup:k,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:p,maxZoom:h,translateExtent:ud,nodeExtent:$,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:cd.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:j,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:l??!1,fitViewOptions:f,fitViewResolver:null,connection:{...f1},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:WI,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:c1,zIndexMode:m,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},UI=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:s,fitView:l,fitViewOptions:f,minZoom:p,maxZoom:h,nodeOrigin:v,nodeExtent:g,zIndexMode:m})=>lL((b,w)=>{async function k(){let{nodeLookup:S,panZoom:N,fitViewOptions:E,fitViewResolver:j,width:$,height:L,minZoom:z,maxZoom:A}=w();N&&(await iD({nodes:S,width:$,height:L,panZoom:N,minZoom:z,maxZoom:A},E),j?.resolve(!0),b({fitViewResolver:null}))}return{...iN({nodes:e,edges:t,width:a,height:s,fitView:l,fitViewOptions:f,minZoom:p,maxZoom:h,nodeOrigin:v,nodeExtent:g,defaultNodes:n,defaultEdges:r,zIndexMode:m}),setNodes:S=>{let{nodeLookup:N,parentLookup:E,nodeOrigin:j,nodeExtent:$,elevateNodesOnSelect:L,fitViewQueued:z,zIndexMode:A,nodesSelectionActive:M}=w(),{nodesInitialized:O,hasSelectedNodes:K}=Tg(S,N,E,{nodeOrigin:j,nodeExtent:$,elevateNodesOnSelect:L,checkEquality:!0,zIndexMode:A}),B=M&&K;z&&O?(k(),b({nodes:S,nodesInitialized:O,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:B})):b({nodes:S,nodesInitialized:O,nodesSelectionActive:B})},setEdges:S=>{let{connectionLookup:N,edgeLookup:E}=w();H1(N,E,S),b({edges:S})},setDefaultNodesAndEdges:(S,N)=>{if(S){let{setNodes:E}=w();E(S),b({hasDefaultNodes:!0})}if(N){let{setEdges:E}=w();E(N),b({hasDefaultEdges:!0})}},updateNodeInternals:S=>{let{triggerNodeChanges:N,nodeLookup:E,parentLookup:j,domNode:$,nodeOrigin:L,nodeExtent:z,debug:A,fitViewQueued:M,zIndexMode:O}=w(),{changes:K,updatedInternals:B}=$D(S,E,j,$,L,z,O);B&&(ND(E,j,{nodeOrigin:L,nodeExtent:z,zIndexMode:O}),M?(k(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),K?.length>0&&(A&&console.log("React Flow: trigger node changes",K),N?.(K)))},updateNodePositions:(S,N=!1)=>{let E=[],j=[],{nodeLookup:$,triggerNodeChanges:L,connection:z,updateConnection:A,onNodesChangeMiddlewareMap:M}=w();for(let[O,K]of S){let B=$.get(O),V=!!(B?.expandParent&&B?.parentId&&K?.position),oe={id:O,type:"position",position:V?{x:Math.max(0,K.position.x),y:Math.max(0,K.position.y)}:K.position,dragging:N};if(B&&z.inProgress&&z.fromNode.id===B.id){let F=ia(B,z.fromHandle,Ce.Left,!0);A({...z,from:F})}V&&B.parentId&&E.push({id:O,parentId:B.parentId,rect:{...K.internals.positionAbsolute,width:K.measured.width??0,height:K.measured.height??0}}),j.push(oe)}if(E.length>0){let{parentLookup:O,nodeOrigin:K}=w(),B=Mg(E,$,O,K);j.push(...B)}for(let O of M.values())j=O(j);L(j)},triggerNodeChanges:S=>{let{onNodesChange:N,setNodes:E,nodes:j,hasDefaultNodes:$,debug:L}=w();S?.length&&($&&E(Rg(S,j)),L&&console.log("React Flow: trigger node changes",S),N?.(S))},triggerEdgeChanges:S=>{let{onEdgesChange:N,setEdges:E,edges:j,hasDefaultEdges:$,debug:L}=w();S?.length&&($&&E($L(S,j)),L&&console.log("React Flow: trigger edge changes",S),N?.(S))},addSelectedNodes:S=>{let{multiSelectionActive:N,edgeLookup:E,nodeLookup:j,triggerNodeChanges:$,triggerEdgeChanges:L}=w();N?$(S.map(z=>aa(z,!0))):($(Ts(j,new Set([...S]),!0)),L(Ts(E)))},addSelectedEdges:S=>{let{multiSelectionActive:N,edgeLookup:E,nodeLookup:j,triggerNodeChanges:$,triggerEdgeChanges:L}=w();N?L(S.map(z=>aa(z,!0))):(L(Ts(E,new Set([...S]))),$(Ts(j,new Set,!0)))},unselectNodesAndEdges:({nodes:S,edges:N}={})=>{let{edges:E,nodes:j,nodeLookup:$,triggerNodeChanges:L,triggerEdgeChanges:z}=w(),A=S||j,M=N||E,O=[];for(let B of A){if(!B.selected)continue;let V=$.get(B.id);V&&(V.selected=!1),O.push(aa(B.id,!1))}let K=[];for(let B of M)B.selected&&K.push(aa(B.id,!1));L(O),z(K)},setMinZoom:S=>{let{panZoom:N,maxZoom:E}=w();N?.setScaleExtent([S,E]),b({minZoom:S})},setMaxZoom:S=>{let{panZoom:N,minZoom:E}=w();N?.setScaleExtent([E,S]),b({maxZoom:S})},setTranslateExtent:S=>{w().panZoom?.setTranslateExtent(S),b({translateExtent:S})},resetSelectedElements:()=>{let{edges:S,nodes:N,triggerNodeChanges:E,triggerEdgeChanges:j,elementsSelectable:$}=w();if(!$)return;let L=N.reduce((A,M)=>M.selected?[...A,aa(M.id,!1)]:A,[]),z=S.reduce((A,M)=>M.selected?[...A,aa(M.id,!1)]:A,[]);E(L),j(z)},setNodeExtent:S=>{let{nodes:N,nodeLookup:E,parentLookup:j,nodeOrigin:$,elevateNodesOnSelect:L,nodeExtent:z,zIndexMode:A}=w();(S[0][0]!==z[0][0]||S[0][1]!==z[0][1]||S[1][0]!==z[1][0]||S[1][1]!==z[1][1])&&(Tg(N,E,j,{nodeOrigin:$,nodeExtent:S,elevateNodesOnSelect:L,checkEquality:!1,zIndexMode:A}),b({nodeExtent:S}))},panBy:S=>{let{transform:N,width:E,height:j,panZoom:$,translateExtent:L}=w();return _D({delta:S,panZoom:$,transform:N,translateExtent:L,width:E,height:j})},setCenter:async(S,N,E)=>{let{width:j,height:$,maxZoom:L,panZoom:z}=w();if(!z)return!1;let A=E?.zoom===void 0?L:E.zoom;return await z.setViewport({x:j/2-S*A,y:$/2-N*A,zoom:A},{duration:E?.duration,ease:E?.ease,interpolate:E?.interpolate}),!0},cancelConnection:()=>{b({connection:{...f1}})},updateConnection:S=>{b({connection:S})},reset:()=>b({...iN()})}},Object.is);function aN({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:a,initialHeight:s,initialMinZoom:l,initialMaxZoom:f,initialFitViewOptions:p,fitView:h,nodeOrigin:v,nodeExtent:g,zIndexMode:m,children:b}){let[w]=(0,T.useState)(()=>UI({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:s,fitView:h,minZoom:l,maxZoom:f,fitViewOptions:p,nodeOrigin:v,nodeExtent:g,zIndexMode:m}));return(0,c.jsx)(dL,{value:w,children:(0,c.jsx)(OL,{children:(0,c.jsx)(YL,{children:b})})})}function YI({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:a,width:s,height:l,fitView:f,fitViewOptions:p,minZoom:h,maxZoom:v,nodeOrigin:g,nodeExtent:m,zIndexMode:b}){return(0,T.useContext)(uf)?(0,c.jsx)(c.Fragment,{children:e}):(0,c.jsx)(aN,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:a,initialWidth:s,initialHeight:l,fitView:f,initialFitViewOptions:p,initialMinZoom:h,initialMaxZoom:v,nodeOrigin:g,nodeExtent:m,zIndexMode:b,children:e})}var XI={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function ZI({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:a,nodeTypes:s,edgeTypes:l,onNodeClick:f,onEdgeClick:p,onInit:h,onMove:v,onMoveStart:g,onMoveEnd:m,onConnect:b,onConnectStart:w,onConnectEnd:k,onClickConnectStart:S,onClickConnectEnd:N,onNodeMouseEnter:E,onNodeMouseMove:j,onNodeMouseLeave:$,onNodeContextMenu:L,onNodeDoubleClick:z,onNodeDragStart:A,onNodeDrag:M,onNodeDragStop:O,onNodesDelete:K,onEdgesDelete:B,onDelete:V,onSelectionChange:oe,onSelectionDragStart:F,onSelectionDrag:J,onSelectionDragStop:I,onSelectionContextMenu:U,onSelectionStart:W,onSelectionEnd:re,onBeforeDelete:le,connectionMode:pe,connectionLineType:xe=ta.Bezier,connectionLineStyle:Ne,connectionLineComponent:we,connectionLineContainerStyle:R,deleteKeyCode:Q="Backspace",selectionKeyCode:fe="Shift",selectionOnDrag:X=!1,selectionMode:he=Jc.Full,panActivationKeyCode:Z="Space",multiSelectionKeyCode:q=yd()?"Meta":"Control",zoomActivationKeyCode:ee=yd()?"Meta":"Control",snapToGrid:de,snapGrid:me,onlyRenderVisibleElements:De=!1,selectNodesOnDrag:Fe,nodesDraggable:Ye,autoPanOnNodeFocus:Ie,nodesConnectable:Be,nodesFocusable:ut,nodeOrigin:kt=dS,edgesFocusable:Lt,edgesReconnectable:zt,elementsSelectable:hn=!0,defaultViewport:Ft=kL,minZoom:Bt=.5,maxZoom:nn=2,translateExtent:pn=ud,preventScrolling:bt=!0,nodeExtent:mn,defaultMarkerColor:Uo="#b1b1b7",zoomOnScroll:Cr=!0,zoomOnPinch:ja=!0,panOnScroll:Er=!1,panOnScrollSpeed:rn=.5,panOnScrollMode:Yo=Ns.Free,zoomOnDoubleClick:Sn=!0,panOnDrag:Ca=!0,onPaneClick:dl,onPaneMouseEnter:Xt,onPaneMouseMove:Ea,onPaneMouseLeave:$r,onPaneScroll:Ni,onPaneContextMenu:Xo,paneClickDistance:$a=1,nodeClickDistance:_a=0,children:ul,onReconnect:ji,onReconnectStart:Dn,onReconnectEnd:jt,onEdgeContextMenu:Ln,onEdgeDoubleClick:qt,onEdgeMouseEnter:Ta,onEdgeMouseMove:Ci,onEdgeMouseLeave:cl,reconnectRadius:_r=10,onNodesChange:bo,onEdgesChange:Tr,noDragClassName:Qn="nodrag",noWheelClassName:Ar="nowheel",noPanClassName:Zt="nopan",fitView:Ei,fitViewOptions:Mr,connectOnClick:$i,attributionPosition:Or,proOptions:Zo,defaultEdgeOptions:Aa,elevateNodesOnSelect:Go=!0,elevateEdgesOnSelect:_i=!1,disableKeyboardA11y:Pr=!1,autoPanOnConnect:Ma,autoPanOnNodeDrag:D,autoPanOnSelection:G=!0,autoPanSpeed:ve,connectionRadius:be,isValidConnection:ke,onError:Ae,style:Xe,id:Re,nodeDragThreshold:Ue,connectionDragThreshold:mt,viewport:ze,onViewportChange:Ht,width:xt,height:xo,colorMode:Qo="light",debug:Dr,onScroll:Lr,ariaLabelConfig:Ir,zIndexMode:Ct="basic",...cu},fu){let Oa=Re||"1",Jo=jL(Qo),Rr=(0,T.useCallback)(hu=>{hu.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Lr?.(hu)},[Lr]);return(0,c.jsx)("div",{"data-testid":"rf__wrapper",...cu,onScroll:Rr,style:{...Xe,...XI},ref:fu,className:Dt(["react-flow",a,Jo]),id:Re,role:"application",children:(0,c.jsxs)(YI,{nodes:e,edges:t,width:xt,height:xo,fitView:Ei,fitViewOptions:Mr,minZoom:Bt,maxZoom:nn,nodeOrigin:kt,nodeExtent:mn,zIndexMode:Ct,children:[(0,c.jsx)(NL,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:b,onConnectStart:w,onConnectEnd:k,onClickConnectStart:S,onClickConnectEnd:N,nodesDraggable:Ye,autoPanOnNodeFocus:Ie,nodesConnectable:Be,nodesFocusable:ut,edgesFocusable:Lt,edgesReconnectable:zt,elementsSelectable:hn,elevateNodesOnSelect:Go,elevateEdgesOnSelect:_i,minZoom:Bt,maxZoom:nn,nodeExtent:mn,onNodesChange:bo,onEdgesChange:Tr,snapToGrid:de,snapGrid:me,connectionMode:pe,translateExtent:pn,connectOnClick:$i,defaultEdgeOptions:Aa,fitView:Ei,fitViewOptions:Mr,onNodesDelete:K,onEdgesDelete:B,onDelete:V,onNodeDragStart:A,onNodeDrag:M,onNodeDragStop:O,onSelectionDrag:J,onSelectionDragStart:F,onSelectionDragStop:I,onMove:v,onMoveStart:g,onMoveEnd:m,noPanClassName:Zt,nodeOrigin:kt,rfId:Oa,autoPanOnConnect:Ma,autoPanOnNodeDrag:D,autoPanSpeed:ve,onError:Ae,connectionRadius:be,isValidConnection:ke,selectNodesOnDrag:Fe,nodeDragThreshold:Ue,connectionDragThreshold:mt,onBeforeDelete:le,debug:Dr,ariaLabelConfig:Ir,zIndexMode:Ct}),(0,c.jsx)(KI,{onInit:h,onNodeClick:f,onEdgeClick:p,onNodeMouseEnter:E,onNodeMouseMove:j,onNodeMouseLeave:$,onNodeContextMenu:L,onNodeDoubleClick:z,nodeTypes:s,edgeTypes:l,connectionLineType:xe,connectionLineStyle:Ne,connectionLineComponent:we,connectionLineContainerStyle:R,selectionKeyCode:fe,selectionOnDrag:X,selectionMode:he,deleteKeyCode:Q,multiSelectionKeyCode:q,panActivationKeyCode:Z,zoomActivationKeyCode:ee,onlyRenderVisibleElements:De,defaultViewport:Ft,translateExtent:pn,minZoom:Bt,maxZoom:nn,preventScrolling:bt,zoomOnScroll:Cr,zoomOnPinch:ja,zoomOnDoubleClick:Sn,panOnScroll:Er,panOnScrollSpeed:rn,panOnScrollMode:Yo,panOnDrag:Ca,autoPanOnSelection:G,onPaneClick:dl,onPaneMouseEnter:Xt,onPaneMouseMove:Ea,onPaneMouseLeave:$r,onPaneScroll:Ni,onPaneContextMenu:Xo,paneClickDistance:$a,nodeClickDistance:_a,onSelectionContextMenu:U,onSelectionStart:W,onSelectionEnd:re,onReconnect:ji,onReconnectStart:Dn,onReconnectEnd:jt,onEdgeContextMenu:Ln,onEdgeDoubleClick:qt,onEdgeMouseEnter:Ta,onEdgeMouseMove:Ci,onEdgeMouseLeave:cl,reconnectRadius:_r,defaultMarkerColor:Uo,noDragClassName:Qn,noWheelClassName:Ar,noPanClassName:Zt,rfId:Oa,disableKeyboardA11y:Pr,nodeExtent:mn,viewport:ze,onViewportChange:Ht,nodesDraggable:Ye}),(0,c.jsx)(wL,{onSelectionChange:oe}),ul,(0,c.jsx)(gL,{proOptions:Zo,position:Or}),(0,c.jsx)(mL,{rfId:Oa,disableKeyboardA11y:Pr})]})})}var GI=xS(ZI),QI=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");function JI({children:e}){let t=Ke(QI);return t?(0,Ig.createPortal)(e,t):null}var e3=e=>e.domNode?.querySelector(".react-flow__viewport-portal");function sN({children:e}){let t=Ke(e3);return t?(0,Ig.createPortal)(e,t):null}function t3(){let e=pt();return(0,T.useCallback)(t=>{let{domNode:n,updateNodeInternals:r}=e.getState(),a=Array.isArray(t)?t:[t],s=new Map;a.forEach(l=>{let f=n?.querySelector(`.react-flow__node[data-id="${l}"]`);f&&s.set(l,{id:l,nodeElement:f,force:!0})}),requestAnimationFrame(()=>r(s,{triggerFitView:!1}))},[])}Wn.error014();function n3(e){return Ke((0,T.useCallback)(t=>t.nodeLookup.get(e),[e]),yt)}function o3({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,c.jsx)("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Dt(["react-flow__background-pattern",n,r])})}function r3({radius:e,className:t}){return(0,c.jsx)("circle",{cx:e,cy:e,r:e,className:Dt(["react-flow__background-pattern","dots",t])})}var fi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(fi||={});var i3={[fi.Dots]:1,[fi.Lines]:1,[fi.Cross]:6},a3=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function lN({id:e,variant:t=fi.Dots,gap:n=20,size:r,lineWidth:a=1,offset:s=0,color:l,bgColor:f,style:p,className:h,patternClassName:v}){let g=(0,T.useRef)(null),{transform:m,patternId:b}=Ke(a3,yt),w=r||i3[t],k=t===fi.Dots,S=t===fi.Cross,N=Array.isArray(n)?n:[n,n],E=[N[0]*m[2]||1,N[1]*m[2]||1],j=w*m[2],$=Array.isArray(s)?s:[s,s],L=S?[j,j]:E,z=[$[0]*m[2]+L[0]/2,$[1]*m[2]+L[1]/2],A=`${b}${e||""}`;return(0,c.jsxs)("svg",{className:Dt(["react-flow__background",h]),style:{...p,...ff,"--xy-background-color-props":f,"--xy-background-pattern-color-props":l},ref:g,"data-testid":"rf__background",children:[(0,c.jsx)("pattern",{id:A,x:m[0]%E[0],y:m[1]%E[1],width:E[0],height:E[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${z[0]},-${z[1]})`,children:k?(0,c.jsx)(r3,{radius:j/2,className:v}):(0,c.jsx)(o3,{dimensions:L,lineWidth:a,variant:t,className:v})}),(0,c.jsx)("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}lN.displayName="Background";var s3=(0,T.memo)(lN);function l3(){return(0,c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:(0,c.jsx)("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function d3(){return(0,c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:(0,c.jsx)("path",{d:"M0 0h32v4.2H0z"})})}function u3(){return(0,c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:(0,c.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 c3(){return(0,c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,c.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 f3(){return(0,c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,c.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 wd({children:e,className:t,...n}){return(0,c.jsx)("button",{type:"button",className:Dt(["react-flow__controls-button",t]),...n,children:e})}var h3=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function dN({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:a,onZoomIn:s,onZoomOut:l,onFitView:f,onInteractiveChange:p,className:h,children:v,position:g="bottom-left",orientation:m="vertical","aria-label":b}){let w=pt(),{isInteractive:k,minZoomReached:S,maxZoomReached:N,ariaLabelConfig:E}=Ke(h3,yt),{zoomIn:j,zoomOut:$,fitView:L}=As();return(0,c.jsxs)(_s,{className:Dt(["react-flow__controls",m==="horizontal"?"horizontal":"vertical",h]),position:g,style:e,"data-testid":"rf__controls","aria-label":b??E["controls.ariaLabel"],children:[t&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(wd,{onClick:()=>{j(),s?.()},className:"react-flow__controls-zoomin",title:E["controls.zoomIn.ariaLabel"],"aria-label":E["controls.zoomIn.ariaLabel"],disabled:N,children:(0,c.jsx)(l3,{})}),(0,c.jsx)(wd,{onClick:()=>{$(),l?.()},className:"react-flow__controls-zoomout",title:E["controls.zoomOut.ariaLabel"],"aria-label":E["controls.zoomOut.ariaLabel"],disabled:S,children:(0,c.jsx)(d3,{})})]}),n&&(0,c.jsx)(wd,{className:"react-flow__controls-fitview",onClick:()=>{L(a),f?.()},title:E["controls.fitView.ariaLabel"],"aria-label":E["controls.fitView.ariaLabel"],children:(0,c.jsx)(u3,{})}),r&&(0,c.jsx)(wd,{className:"react-flow__controls-interactive",onClick:()=>{w.setState({nodesDraggable:!k,nodesConnectable:!k,elementsSelectable:!k}),p?.(!k)},title:E["controls.interactive.ariaLabel"],"aria-label":E["controls.interactive.ariaLabel"],children:k?(0,c.jsx)(f3,{}):(0,c.jsx)(c3,{})}),v]})}dN.displayName="Controls";var p3=(0,T.memo)(dN);function m3({id:e,x:t,y:n,width:r,height:a,style:s,color:l,strokeColor:f,strokeWidth:p,className:h,borderRadius:v,shapeRendering:g,selected:m,onClick:b}){let{background:w,backgroundColor:k}=s||{},S=l||w||k;return(0,c.jsx)("rect",{className:Dt(["react-flow__minimap-node",{selected:m},h]),x:t,y:n,rx:v,ry:v,width:r,height:a,style:{fill:S,stroke:f,strokeWidth:p},shapeRendering:g,onClick:b?N=>b(N,e):void 0})}var g3=(0,T.memo)(m3),y3=e=>e.nodes.map(t=>t.id),qg=e=>e instanceof Function?e:()=>e;function v3({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:s=g3,onClick:l}){let f=Ke(y3,yt),p=qg(t),h=qg(e),v=qg(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return(0,c.jsx)(c.Fragment,{children:f.map(m=>(0,c.jsx)(x3,{id:m,nodeColorFunc:p,nodeStrokeColorFunc:h,nodeClassNameFunc:v,nodeBorderRadius:r,nodeStrokeWidth:a,NodeComponent:s,onClick:l,shapeRendering:g},m))})}function b3({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:a,nodeStrokeWidth:s,shapeRendering:l,NodeComponent:f,onClick:p}){let{node:h,x:v,y:g,width:m,height:b}=Ke(w=>{let k=w.nodeLookup.get(e);if(!k)return{node:void 0,x:0,y:0,width:0,height:0};let S=k.internals.userNode,{x:N,y:E}=k.internals.positionAbsolute,{width:j,height:$}=co(S);return{node:S,x:N,y:E,width:j,height:$}},yt);return!h||h.hidden||!k1(h)?null:(0,c.jsx)(f,{x:v,y:g,width:m,height:b,style:h.style,selected:!!h.selected,className:r(h),color:t(h),borderRadius:a,strokeColor:n(h),strokeWidth:s,shapeRendering:l,onClick:p,id:h.id})}var x3=(0,T.memo)(b3),w3=(0,T.memo)(v3),k3=200,S3=150,N3=e=>!e.hidden,j3=e=>{let 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]},n=!1;for(let r of e.nodeLookup.values())if(!r.hidden){n=!0;break}return{viewBB:t,boundingRect:n?v1(hd(e.nodeLookup,{filter:N3}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},uN=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,C3=(e,t)=>uN(e.viewBB,t.viewBB)&&uN(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,E3="react-flow__minimap-desc";function cN({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:a="",nodeBorderRadius:s=5,nodeStrokeWidth:l,nodeComponent:f,bgColor:p,maskColor:h,maskStrokeColor:v,maskStrokeWidth:g,position:m="bottom-right",onClick:b,onNodeClick:w,pannable:k=!1,zoomable:S=!1,ariaLabel:N,inversePan:E,zoomStep:j=1,offsetScale:$=5}){let L=pt(),z=(0,T.useRef)(null),{boundingRect:A,panZoom:M,viewBB:O,rfId:K,translateExtent:B,flowWidth:V,flowHeight:oe,ariaLabelConfig:F}=Ke(j3,C3),J=e?.width??k3,I=e?.height??S3,U=A.width/J,W=A.height/I,re=Math.max(U,W),le=re*J,pe=re*I,xe=$*re,Ne=A.x-(le-A.width)/2-xe,we=A.y-(pe-A.height)/2-xe,R=le+xe*2,Q=pe+xe*2,fe=`${E3}-${K}`,X=(0,T.useRef)(0),he=(0,T.useRef)();X.current=re,(0,T.useEffect)(()=>{let me=L.getState().panZoom;if(z.current&&me)return he.current=RD({domNode:z.current,panZoom:me,getTransform:()=>L.getState().transform,getViewScale:()=>X.current}),()=>{he.current?.destroy()}},[M]),(0,T.useEffect)(()=>{he.current?.update({translateExtent:B,width:V,height:oe,inversePan:E,pannable:k,zoomStep:j,zoomable:S})},[k,S,E,j,B,V,oe]);let Z=b?me=>{let[De,Fe]=he.current?.pointer(me)||[0,0];b(me,{x:De,y:Fe})}:void 0,q=(0,T.useCallback)((me,De)=>{let Fe=L.getState().nodeLookup.get(De).internals.userNode;w?.(me,Fe)},[w]),ee=w?q:void 0,de=N??F["minimap.ariaLabel"];return(0,c.jsx)(_s,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*re: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 l=="number"?l:void 0},className:Dt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:(0,c.jsxs)("svg",{width:J,height:I,viewBox:`${Ne} ${we} ${R} ${Q}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":fe,ref:z,onClick:Z,children:[de&&(0,c.jsx)("title",{id:fe,children:de}),(0,c.jsx)(w3,{onClick:ee,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:a,nodeStrokeWidth:l,nodeComponent:f}),(0,c.jsx)("path",{className:"react-flow__minimap-mask",d:`M${Ne-xe},${we-xe}h${R+xe*2}v${Q+xe*2}h${-R-xe*2}z
|
|
15
|
+
M${O.x},${O.y}h${O.width}v${O.height}h${-O.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}cN.displayName="MiniMap";var $3=(0,T.memo)(cN),_3=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,T3={[$s.Line]:"right",[$s.Handle]:"bottom-right"};function A3({nodeId:e,position:t,variant:n=$s.Handle,className:r,style:a=void 0,children:s,color:l,minWidth:f=10,minHeight:p=10,maxWidth:h=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:m,autoScale:b=!0,shouldResize:w,onResizeStart:k,onResize:S,onResizeEnd:N}){let E=ES(),j=typeof e=="string"?e:E,$=pt(),L=(0,T.useRef)(null),z=n===$s.Handle,A=Ke((0,T.useCallback)(_3(z&&b),[z,b]),yt),M=(0,T.useRef)(null),O=t??T3[n];(0,T.useEffect)(()=>{if(L.current&&j)return M.current||=JD({domNode:L.current,nodeId:j,getStoreItems:()=>{let{nodeLookup:B,transform:V,snapGrid:oe,snapToGrid:F,nodeOrigin:J,domNode:I}=$.getState();return{nodeLookup:B,transform:V,snapGrid:oe,snapToGrid:F,nodeOrigin:J,paneDomNode:I}},onChange:(B,V)=>{let{triggerNodeChanges:oe,nodeLookup:F,parentLookup:J,nodeOrigin:I}=$.getState(),U=[],W={x:B.x,y:B.y},re=F.get(j);if(re&&re.expandParent&&re.parentId){let le=re.origin??I,pe=B.width??re.measured.width??0,xe=B.height??re.measured.height??0,Ne=Mg([{id:re.id,parentId:re.parentId,rect:{width:pe,height:xe,...S1({x:B.x??re.position.x,y:B.y??re.position.y},{width:pe,height:xe},re.parentId,F,le)}}],F,J,I);U.push(...Ne),W.x=B.x?Math.max(le[0]*pe,B.x):void 0,W.y=B.y?Math.max(le[1]*xe,B.y):void 0}if(W.x!==void 0&&W.y!==void 0){let le={id:j,type:"position",position:{...W}};U.push(le)}if(B.width!==void 0&&B.height!==void 0){let le={id:j,type:"dimensions",resizing:!0,setAttributes:m?m==="horizontal"?"width":"height":!0,dimensions:{width:B.width,height:B.height}};U.push(le)}for(let le of V){let pe={...le,type:"position"};U.push(pe)}oe(U)},onEnd:({width:B,height:V})=>{let oe={id:j,type:"dimensions",resizing:!1,dimensions:{width:B,height:V}};$.getState().triggerNodeChanges([oe])}}),M.current.update({controlPosition:O,boundaries:{minWidth:f,minHeight:p,maxWidth:h,maxHeight:v},keepAspectRatio:g,resizeDirection:m,onResizeStart:k,onResize:S,onResizeEnd:N,shouldResize:w}),()=>{M.current?.destroy()}},[O,f,p,h,v,g,k,S,N,w]);let K=O.split("-");return(0,c.jsx)("div",{className:Dt(["react-flow__resize-control","nodrag",...K,n,r]),ref:L,style:{...a,scale:A,...l&&{[z?"backgroundColor":"borderColor"]:l}},children:s})}var fN=(0,T.memo)(A3);function M3({nodeId:e,isVisible:t=!0,handleClassName:n,handleStyle:r,lineClassName:a,lineStyle:s,color:l,minWidth:f=10,minHeight:p=10,maxWidth:h=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:g=!1,autoScale:m=!0,shouldResize:b,onResizeStart:w,onResize:k,onResizeEnd:S}){return t?(0,c.jsxs)(c.Fragment,{children:[YD.map(N=>(0,c.jsx)(fN,{className:a,style:s,nodeId:e,position:N,variant:$s.Line,color:l,minWidth:f,minHeight:p,maxWidth:h,maxHeight:v,onResizeStart:w,keepAspectRatio:g,autoScale:m,shouldResize:b,onResize:k,onResizeEnd:S},N)),UD.map(N=>(0,c.jsx)(fN,{className:n,style:r,nodeId:e,position:N,color:l,minWidth:f,minHeight:p,maxWidth:h,maxHeight:v,onResizeStart:w,keepAspectRatio:g,autoScale:m,shouldResize:b,onResize:k,onResizeEnd:S},N))]}):null}var sa=[{id:"inventory",label:"Inventory",hint:"Which hosts each step runs on, counted in your inventory"},{id:"data",label:"Data",hint:"What each step reads and sets, with dotted wires from where each input comes"},{id:"code",label:"Code",hint:"What each step runs (module, role or playbook) and whether your environment has it"},{id:"access",label:"Access",hint:"Who each step acts as: credential, user, become, vaulted variables"},{id:"timing",label:"Timing",hint:"Batches, timeouts and measured durations, against the maintenance window"},{id:"changes",label:"Changes",hint:"What changed since another version of the flow: HEAD, a branch or a commit"}],O3=new Set(["ready","run","launchCheck","launchRun","launchCancel","stopRun","showRun","runOutput","showRunOutput","approve","catalog","copyText","openLink","inspectResult","pngRendered","cspViolation","perf"]);function hN(e){return O3.has(e)}var P3="This view only shows and runs the flow",D3=()=>typeof acquireVsCodeApi=="function";function L3(){let e=acquireVsCodeApi();return{hostName:"VS Code",post:t=>e.postMessage(t),subscribe(t){let n=r=>t(r.data);return window.addEventListener("message",n),()=>window.removeEventListener("message",n)},getState:()=>e.getState(),setState:t=>e.setState(t)}}var pf,pN,Hg=new Set,kd=new Map,I3=1,Vg=new Set,Kg=()=>{for(let e of Vg)e(kd.size)};function R3(e){return Vg.add(e),()=>Vg.delete(e)}function z3(e){if(e&&typeof e=="object"&&"type"in e){e.type==="ack"&&(kd.get(e.reqId)?.({ok:e.ok,error:e.error,created:e.created,pasted:e.pasted}),kd.delete(e.reqId),Kg());for(let t of Hg)t(e)}}function mN(e){pN?.(),pf=e,pN=e.subscribe(z3)}D3()&&mN(L3());function Wg(){if(!pf)throw Error("The designer has no host: call setTransport() first");return pf}var Ug=!1;function F3(){Ug=!0}function je(e){(!Ug||hN(e.type))&&Wg().post(e)}function Yg(e){return Hg.add(e),()=>Hg.delete(e)}var B3=12e4;function mf(e){let t=I3++;return Ug&&!hN(e(t).type)?Promise.resolve({ok:!1,error:P3}):new Promise(n=>{let r=setTimeout(()=>{kd.delete(t)&&(Kg(),n({ok:!1,error:`${pf?.hostName??"The host"} did not answer in 2 minutes: the change may not have been made`}))},B3);kd.set(t,a=>{clearTimeout(r),n(a)}),Kg(),je(e(t))})}var q3=e=>mf(t=>({type:"driftAction",reqId:t,action:e})),gf=e=>mf(t=>({type:"scenarioEdit",reqId:t,request:e})),H3=()=>mf(e=>({type:"scenarioUndo",reqId:e})),la=e=>mf(t=>({type:"command",reqId:t,command:e}));function Ms(){return Wg().getState()??{}}function Xg(e){Wg().setState(e)}var Zg=Symbol.for("yaml.alias"),Gg=Symbol.for("yaml.document"),hi=Symbol.for("yaml.map"),gN=Symbol.for("yaml.pair"),Po=Symbol.for("yaml.scalar"),Os=Symbol.for("yaml.seq"),Un=Symbol.for("yaml.node.type"),br=e=>!!e&&typeof e=="object"&&e[Un]===Zg,Sd=e=>!!e&&typeof e=="object"&&e[Un]===Gg,Do=e=>!!e&&typeof e=="object"&&e[Un]===hi,$t=e=>!!e&&typeof e=="object"&&e[Un]===gN,rt=e=>!!e&&typeof e=="object"&&e[Un]===Po,Lo=e=>!!e&&typeof e=="object"&&e[Un]===Os;function _t(e){if(e&&typeof e=="object")switch(e[Un]){case hi:case Os:return!0}return!1}function Tt(e){if(e&&typeof e=="object")switch(e[Un]){case Zg:case hi:case Po:case Os:return!0}return!1}var yN=e=>(rt(e)||_t(e))&&!!e.anchor,da=Symbol("break visit"),V3=Symbol("skip children"),Nd=Symbol("remove node");function pi(e,t){let n=K3(t);Sd(e)?Ps(null,e.contents,n,Object.freeze([e]))===Nd&&(e.contents=null):Ps(null,e,n,Object.freeze([]))}pi.BREAK=da,pi.SKIP=V3,pi.REMOVE=Nd;function Ps(e,t,n,r){let a=W3(e,t,n,r);if(Tt(a)||$t(a))return U3(e,r,a),Ps(e,a,n,r);if(typeof a!="symbol"){if(_t(t)){r=Object.freeze(r.concat(t));for(let s=0;s<t.items.length;++s){let l=Ps(s,t.items[s],n,r);if(typeof l=="number")s=l-1;else{if(l===da)return da;l===Nd&&(t.items.splice(s,1),--s)}}}else if($t(t)){r=Object.freeze(r.concat(t));let s=Ps("key",t.key,n,r);if(s===da)return da;s===Nd&&(t.key=null);let l=Ps("value",t.value,n,r);if(l===da)return da;l===Nd&&(t.value=null)}}return a}function K3(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 W3(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(Do(t))return n.Map?.(e,t,r);if(Lo(t))return n.Seq?.(e,t,r);if($t(t))return n.Pair?.(e,t,r);if(rt(t))return n.Scalar?.(e,t,r);if(br(t))return n.Alias?.(e,t,r)}function U3(e,t,n){let r=t[t.length-1];if(_t(r))r.items[e]=n;else if($t(r))e==="key"?r.key=n:r.value=n;else if(Sd(r))r.contents=n;else{let a=br(r)?"alias":"scalar";throw Error(`Cannot replace node with ${a} parent`)}}var Y3={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},X3=e=>e.replace(/[!,[\]{}]/g,t=>Y3[t]),Ds=class jr{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},jr.defaultYaml,t),this.tags=Object.assign({},jr.defaultTags,n)}clone(){let t=new jr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new jr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:jr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},jr.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:jr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},jr.defaultTags),!1);let r=t.trim().split(/[ \t]+/),a=r.shift();switch(a){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[s,l]=r;return this.tags[s]=l,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let l=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,l),!1}}default:return n(0,`Unknown directive ${a}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let l=t.slice(2,-1);return l==="!"||l==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),l)}let[,r,a]=t.match(/^(.*!)([^!]*)$/s);a||n(`The ${t} tag has no suffix`);let s=this.tags[r];if(s)try{return s+decodeURIComponent(a)}catch(l){return n(String(l)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+X3(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),a;if(t&&r.length>0&&Tt(t.contents)){let s={};pi(t.contents,(l,f)=>{Tt(f)&&f.tag&&(s[f.tag]=!0)}),a=Object.keys(s)}else a=[];for(let[s,l]of r)s==="!!"&&l==="tag:yaml.org,2002:"||t&&!a.some(f=>f.startsWith(l))||n.push(`%TAG ${s} ${l}`);return n.join(`
|
|
16
|
+
`)}};Ds.defaultYaml={explicit:!1,version:"1.2"},Ds.defaultTags={"!!":"tag:yaml.org,2002:"};function vN(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function bN(e){let t=new Set;return pi(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function xN(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function Z3(e,t){let n=[],r=new Map,a=null;return{onAnchor:s=>{n.push(s),a??=bN(e);let l=xN(t,a);return a.add(l),l},setAnchors:()=>{for(let s of n){let l=r.get(s);if(typeof l=="object"&&l.anchor&&(rt(l.node)||_t(l.node)))l.node.anchor=l.anchor;else{let f=Error("Failed to resolve repeated object (this should not happen)");throw f.source=s,f}}},sourceObjects:r}}function Ls(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let a=0,s=r.length;a<s;++a){let l=r[a],f=Ls(e,r,String(a),l);f===void 0?delete r[a]:f!==l&&(r[a]=f)}else if(r instanceof Map)for(let a of Array.from(r.keys())){let s=r.get(a),l=Ls(e,r,a,s);l===void 0?r.delete(a):l!==s&&r.set(a,l)}else if(r instanceof Set)for(let a of Array.from(r)){let s=Ls(e,r,a,a);s===void 0?r.delete(a):s!==a&&(r.delete(a),r.add(s))}else for(let[a,s]of Object.entries(r)){let l=Ls(e,r,a,s);l===void 0?delete r[a]:l!==s&&(r[a]=l)}return e.call(t,n,r)}function Yn(e,t,n){if(Array.isArray(e))return e.map((r,a)=>Yn(r,String(a),n));if(e&&typeof e.toJSON=="function"){if(!n||!yN(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=s=>{r.res=s,delete n.onCreate};let a=e.toJSON(t,n);return n.onCreate&&n.onCreate(a),a}return typeof e=="bigint"&&!n?.keep?Number(e):e}var Qg=class{constructor(e){Object.defineProperty(this,Un,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:a}={}){if(!Sd(e))throw TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=Yn(this,"",s);if(typeof r=="function")for(let{count:f,res:p}of s.anchors.values())r(p,f);return typeof a=="function"?Ls(a,{"":l},"",l):l}},Jg=class extends Qg{constructor(e){super(Zg),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],pi(e,{Node:(a,s)=>{(br(s)||yN(s))&&n.push(s)}}),t&&(t.aliasResolveCache=n));let r;for(let a of n){if(a===this)break;a.anchor===this.source&&(r=a)}if(r&&t){let{anchors:a,doc:s,maxAliasCount:l}=t,f=a.get(r);if(f||=(Yn(r,null,t),a.get(r)),f?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(l>=0&&(f.count+=1,f.aliasCount===0&&(f.aliasCount=yf(s,r,a)),f.count*f.aliasCount>l))throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(r)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(vN(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(a)}if(e.implicitKey)return`${r} `}return r}};function yf(e,t,n){if(br(t)){let r=t.resolve(e),a=n&&r&&n.get(r);return a?a.count*a.aliasCount:0}if(_t(t)){let r=0;for(let a of t.items){let s=yf(e,a,n);s>r&&(r=s)}return r}if($t(t)){let r=yf(e,t.key,n),a=yf(e,t.value,n);return Math.max(r,a)}return 1}var wN=e=>!e||typeof e!="function"&&typeof e!="object",qe=class extends Qg{constructor(e){super(Po),this.value=e}toJSON(e,t){return t?.keep?this.value:Yn(this.value,e,t)}toString(){return String(this.value)}};qe.BLOCK_FOLDED="BLOCK_FOLDED",qe.BLOCK_LITERAL="BLOCK_LITERAL",qe.PLAIN="PLAIN",qe.QUOTE_DOUBLE="QUOTE_DOUBLE",qe.QUOTE_SINGLE="QUOTE_SINGLE";var G3="tag:yaml.org,2002:";function Q3(e,t,n){if(t){let r=n.filter(s=>s.tag===t),a=r.find(s=>!s.format)??r[0];if(!a)throw Error(`Tag ${t} not found`);return a}return n.find(r=>r.identify?.(e)&&!r.format)}function jd(e,t,n){if(Sd(e)&&(e=e.contents),Tt(e))return e;if($t(e)){let g=n.schema[hi].createNode?.(n.schema,null,n);return g.items.push(e),g}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:a,onTagObj:s,schema:l,sourceObjects:f}=n,p;if(r&&e&&typeof e=="object"){if(p=f.get(e),p)return p.anchor??(p.anchor=a(e)),new Jg(p.anchor);p={anchor:null,node:null},f.set(e,p)}t?.startsWith("!!")&&(t=G3+t.slice(2));let h=Q3(e,t,l.tags);if(!h){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let g=new qe(e);return p&&(p.node=g),g}h=e instanceof Map?l[hi]:Symbol.iterator in Object(e)?l[Os]:l[hi]}s&&(s(h),delete n.onTagObj);let v=h?.createNode?h.createNode(n.schema,e,n):typeof h?.nodeClass?.from=="function"?h.nodeClass.from(n.schema,e,n):new qe(e);return t?v.tag=t:h.default||(v.tag=h.tag),p&&(p.node=v),v}function vf(e,t,n){let r=n;for(let a=t.length-1;a>=0;--a){let s=t[a];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let l=[];l[s]=r,r=l}else r=new Map([[s,r]])}return jd(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var Cd=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,kN=class extends Qg{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>Tt(n)||$t(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Cd(e))this.add(t);else{let[n,...r]=e,a=this.get(n,!0);if(_t(a))a.addIn(r,t);else if(a===void 0&&this.schema)this.set(n,vf(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(_t(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,a=this.get(n,!0);return r.length===0?!t&&rt(a)?a.value:a:_t(a)?a.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!$t(t))return!1;let n=t.value;return n==null||e&&rt(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return _t(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let a=this.get(n,!0);if(_t(a))a.setIn(r,t);else if(a===void 0&&this.schema)this.set(n,vf(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},J3=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function xr(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var ua=(e,t,n)=>e.endsWith(`
|
|
17
|
+
`)?xr(n,t):n.includes(`
|
|
18
|
+
`)?`
|
|
19
|
+
`+xr(n,t):(e.endsWith(" ")?"":" ")+n,SN="flow",eR="block",tR="quoted";function bf(e,t,n="flow",{indentAtStart:r,lineWidth:a=80,minContentWidth:s=20,onFold:l,onOverflow:f}={}){if(!a||a<0)return e;a<s&&(s=0);let p=Math.max(1+s,1+a-t.length);if(e.length<=p)return e;let h=[],v={},g=a-t.length;typeof r=="number"&&(r>a-Math.max(2,s)?h.push(0):g=a-r);let m,b,w=!1,k=-1,S=-1,N=-1;n==="block"&&(k=NN(e,k,t.length),k!==-1&&(g=k+p));for(let j;j=e[k+=1];){if(n==="quoted"&&j==="\\"){switch(S=k,e[k+1]){case"x":k+=3;break;case"u":k+=5;break;case"U":k+=9;break;default:k+=1}N=k}if(j===`
|
|
20
|
+
`)n==="block"&&(k=NN(e,k,t.length)),g=k+t.length+p,m=void 0;else{if(j===" "&&b&&b!==" "&&b!==`
|
|
21
|
+
`&&b!==" "){let $=e[k+1];$&&$!==" "&&$!==`
|
|
22
|
+
`&&$!==" "&&(m=k)}if(k>=g)if(m)h.push(m),g=m+p,m=void 0;else if(n==="quoted"){for(;b===" "||b===" ";)b=j,j=e[k+=1],w=!0;let $=k>N+1?k-2:S-1;if(v[$])return e;h.push($),v[$]=!0,g=$+p,m=void 0}else w=!0}b=j}if(w&&f&&f(),h.length===0)return e;l&&l();let E=e.slice(0,h[0]);for(let j=0;j<h.length;++j){let $=h[j],L=h[j+1]||e.length;$===0?E=`
|
|
23
|
+
${t}${e.slice(0,L)}`:(n==="quoted"&&v[$]&&(E+=`${e[$]}\\`),E+=`
|
|
24
|
+
${t}${e.slice($+1,L)}`)}return E}function NN(e,t,n){let r=t,a=t+1,s=e[a];for(;s===" "||s===" ";)if(t<a+n)s=e[++t];else{do s=e[++t];while(s&&s!==`
|
|
25
|
+
`);r=t,a=t+1,s=e[a]}return r}var xf=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),wf=e=>/^(%|---|\.\.\.)/m.test(e);function nR(e,t,n){if(!t||t<0)return!1;let r=t-n,a=e.length;if(a<=r)return!1;for(let s=0,l=0;s<a;++s)if(e[s]===`
|
|
26
|
+
`){if(s-l>r)return!0;if(l=s+1,a-l<=r)return!1}return!0}function Ed(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,a=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(wf(e)?" ":""),l="",f=0;for(let p=0,h=n[p];h;h=n[++p])if(h===" "&&n[p+1]==="\\"&&n[p+2]==="n"&&(l+=n.slice(f,p)+"\\ ",p+=1,f=p,h="\\"),h==="\\")switch(n[p+1]){case"u":{l+=n.slice(f,p);let v=n.substr(p+2,4);switch(v){case"0000":l+="\\0";break;case"0007":l+="\\a";break;case"000b":l+="\\v";break;case"001b":l+="\\e";break;case"0085":l+="\\N";break;case"00a0":l+="\\_";break;case"2028":l+="\\L";break;case"2029":l+="\\P";break;default:v.substr(0,2)==="00"?l+="\\x"+v.substr(2):l+=n.substr(p,6)}p+=5,f=p+1}break;case"n":if(r||n[p+2]==='"'||n.length<a)p+=1;else{for(l+=n.slice(f,p)+`
|
|
27
|
+
|
|
28
|
+
`;n[p+2]==="\\"&&n[p+3]==="n"&&n[p+4]!=='"';)l+=`
|
|
29
|
+
`,p+=2;l+=s,n[p+2]===" "&&(l+="\\"),p+=1,f=p+1}break;default:p+=1}return l=f?l+n.slice(f):n,r?l:bf(l,s,tR,xf(t,!1))}function e0(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
30
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return Ed(e,t);let n=t.indent||(wf(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
31
|
+
${n}`)+"'";return t.implicitKey?r:bf(r,n,SN,xf(t,!1))}function Is(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=Ed;else{let a=e.includes('"'),s=e.includes("'");r=a&&!s?e0:s&&!a?Ed:n?e0:Ed}return r(e,t)}var t0;try{t0=RegExp(`(^|(?<!
|
|
32
|
+
))
|
|
33
|
+
+(?!
|
|
34
|
+
|$)`,"g")}catch{t0=/\n+(?!\n|$)/g}function kf({comment:e,type:t,value:n},r,a,s){let{blockQuote:l,commentString:f,lineWidth:p}=r.options;if(!l||/\n[\t ]+$/.test(n))return Is(n,r);let h=r.indent||(r.forceBlockIndent||wf(n)?" ":""),v=l==="literal"?!0:l==="folded"||t===qe.BLOCK_FOLDED?!1:t===qe.BLOCK_LITERAL||!nR(n,p,h.length);if(!n)return v?`|
|
|
35
|
+
`:`>
|
|
36
|
+
`;let g,m;for(m=n.length;m>0;--m){let $=n[m-1];if($!==`
|
|
37
|
+
`&&$!==" "&&$!==" ")break}let b=n.substring(m),w=b.indexOf(`
|
|
38
|
+
`);w===-1?g="-":n===b||w!==b.length-1?(g="+",s&&s()):g="",b&&=(n=n.slice(0,-b.length),b[b.length-1]===`
|
|
39
|
+
`&&(b=b.slice(0,-1)),b.replace(t0,`$&${h}`));let k=!1,S,N=-1;for(S=0;S<n.length;++S){let $=n[S];if($===" ")k=!0;else if($===`
|
|
40
|
+
`)N=S;else break}let E=n.substring(0,N<S?N+1:S);E&&=(n=n.substring(E.length),E.replace(/\n+/g,`$&${h}`));let j=(k?h?"2":"1":"")+g;if(e&&(j+=" "+f(e.replace(/ ?[\r\n]+/g," ")),a&&a()),!v){let $=n.replace(/\n+/g,`
|
|
41
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${h}`),L=!1,z=xf(r,!0);l!=="folded"&&t!==qe.BLOCK_FOLDED&&(z.onOverflow=()=>{L=!0});let A=bf(`${E}${$}${b}`,h,eR,z);if(!L)return`>${j}
|
|
42
|
+
${h}${A}`}return n=n.replace(/\n+/g,`$&${h}`),`|${j}
|
|
43
|
+
${h}${E}${n}${b}`}function oR(e,t,n,r){let{type:a,value:s}=e,{actualString:l,implicitKey:f,indent:p,indentStep:h,inFlow:v}=t;if(f&&s.includes(`
|
|
44
|
+
`)||v&&/[[\]{},]/.test(s))return Is(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return f||v||!s.includes(`
|
|
45
|
+
`)?Is(s,t):kf(e,t,n,r);if(!f&&!v&&a!==qe.PLAIN&&s.includes(`
|
|
46
|
+
`))return kf(e,t,n,r);if(wf(s)){if(p==="")return t.forceBlockIndent=!0,kf(e,t,n,r);if(f&&p===h)return Is(s,t)}let g=s.replace(/\n+/g,`$&
|
|
47
|
+
${p}`);if(l){let m=k=>k.default&&k.tag!=="tag:yaml.org,2002:str"&&k.test?.test(g),{compat:b,tags:w}=t.doc.schema;if(w.some(m)||b?.some(m))return Is(s,t)}return f?g:bf(g,p,SN,xf(t,!1))}function n0(e,t,n,r){let{implicitKey:a,inFlow:s}=t,l=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)}),{type:f}=e;f!==qe.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(l.value)&&(f=qe.QUOTE_DOUBLE);let p=v=>{switch(v){case qe.BLOCK_FOLDED:case qe.BLOCK_LITERAL:return a||s?Is(l.value,t):kf(l,t,n,r);case qe.QUOTE_DOUBLE:return Ed(l.value,t);case qe.QUOTE_SINGLE:return e0(l.value,t);case qe.PLAIN:return oR(l,t,n,r);default:return null}},h=p(f);if(h===null){let{defaultKeyType:v,defaultStringType:g}=t.options,m=a&&v||g;if(h=p(m),h===null)throw Error(`Unsupported default string type ${m}`)}return h}function jN(e,t){let n=Object.assign({blockQuote:!0,commentString:J3,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,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),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 rR(e,t){if(t.tag){let a=e.filter(s=>s.tag===t.tag);if(a.length>0)return a.find(s=>s.format===t.format)??a[0]}let n,r;if(rt(t)){r=t.value;let a=e.filter(s=>s.identify?.(r));if(a.length>1){let s=a.filter(l=>l.test);s.length>0&&(a=s)}n=a.find(s=>s.format===t.format)??a.find(s=>!s.format)}else r=t,n=e.find(a=>a.nodeClass&&r instanceof a.nodeClass);if(!n){let a=r?.constructor?.name??(r===null?"null":typeof r);throw Error(`Tag not resolved for ${a} value`)}return n}function iR(e,t,{anchors:n,doc:r}){if(!r.directives)return"";let a=[],s=(rt(e)||_t(e))&&e.anchor;s&&vN(s)&&(n.add(s),a.push(`&${s}`));let l=e.tag??(t.default?null:t.tag);return l&&a.push(r.directives.tagString(l)),a.join(" ")}function Rs(e,t,n,r){if($t(e))return e.toString(t,n,r);if(br(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw 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 a,s=Tt(e)?e:t.doc.createNode(e,{onTagObj:p=>a=p});a??=rR(t.doc.schema.tags,s);let l=iR(s,a,t);l.length>0&&(t.indentAtStart=(t.indentAtStart??0)+l.length+1);let f=typeof a.stringify=="function"?a.stringify(s,t,n,r):rt(s)?n0(s,t,n,r):s.toString(t,n,r);return l?rt(s)||f[0]==="{"||f[0]==="["?`${l} ${f}`:`${l}
|
|
48
|
+
${t.indent}${f}`:f}function aR({key:e,value:t},n,r,a){let{allNullValues:s,doc:l,indent:f,indentStep:p,options:{commentString:h,indentSeq:v,simpleKeys:g}}=n,m=Tt(e)&&e.comment||null;if(g){if(m)throw Error("With simple keys, key nodes cannot have comments");if(_t(e)||!Tt(e)&&typeof e=="object")throw Error("With simple keys, collection cannot be used as a key value")}let b=!g&&(!e||m&&t==null&&!n.inFlow||_t(e)||(rt(e)?e.type===qe.BLOCK_FOLDED||e.type===qe.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!b&&(g||!s),indent:f+p});let w=!1,k=!1,S=Rs(e,n,()=>w=!0,()=>k=!0);if(!b&&!n.inFlow&&S.length>1024){if(g)throw Error("With simple keys, single line scalar must not span more than 1024 characters");b=!0}if(n.inFlow){if(s||t==null)return w&&r&&r(),S===""?"?":b?`? ${S}`:S}else if(s&&!g||t==null&&b)return S=`? ${S}`,m&&!w?S+=ua(S,n.indent,h(m)):k&&a&&a(),S;w&&(m=null),b?(m&&(S+=ua(S,n.indent,h(m))),S=`? ${S}
|
|
49
|
+
${f}:`):(S=`${S}:`,m&&(S+=ua(S,n.indent,h(m))));let N,E,j;Tt(t)?(N=!!t.spaceBefore,E=t.commentBefore,j=t.comment):(N=!1,E=null,j=null,t&&typeof t=="object"&&(t=l.createNode(t))),n.implicitKey=!1,!b&&!m&&rt(t)&&(n.indentAtStart=S.length+1),k=!1,!v&&p.length>=2&&!n.inFlow&&!b&&Lo(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let $=!1,L=Rs(t,n,()=>$=!0,()=>k=!0),z=" ";if(m||N||E){if(z=N?`
|
|
50
|
+
`:"",E){let A=h(E);z+=`
|
|
51
|
+
${xr(A,n.indent)}`}L===""&&!n.inFlow?z===`
|
|
52
|
+
`&&j&&(z=`
|
|
53
|
+
|
|
54
|
+
`):z+=`
|
|
55
|
+
${n.indent}`}else if(!b&&_t(t)){let A=L[0],M=L.indexOf(`
|
|
56
|
+
`),O=M!==-1,K=n.inFlow??t.flow??t.items.length===0;if(O||!K){let B=!1;if(O&&(A==="&"||A==="!")){let V=L.indexOf(" ");A==="&"&&V!==-1&&V<M&&L[V+1]==="!"&&(V=L.indexOf(" ",V+1)),(V===-1||M<V)&&(B=!0)}B||(z=`
|
|
57
|
+
${n.indent}`)}}else(L===""||L[0]===`
|
|
58
|
+
`)&&(z="");return S+=z+L,n.inFlow?$&&r&&r():j&&!$?S+=ua(S,n.indent,h(j)):k&&a&&a(),S}function CN(e,t){(e==="debug"||e==="warn")&&console.warn(t)}var Sf="<<",wr={identify:e=>e===Sf||typeof e=="symbol"&&e.description===Sf,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new qe(Symbol(Sf)),{addToJSMap:EN}),stringify:()=>Sf},sR=(e,t)=>(wr.identify(t)||rt(t)&&(!t.type||t.type===qe.PLAIN)&&wr.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===wr.tag&&n.default);function EN(e,t,n){let r=$N(e,n);if(Lo(r))for(let a of r.items)o0(e,t,a);else if(Array.isArray(r))for(let a of r)o0(e,t,a);else o0(e,t,r)}function o0(e,t,n){let r=$N(e,n);if(!Do(r))throw Error("Merge sources must be maps or map aliases");let a=r.toJSON(null,e,Map);for(let[s,l]of a)t instanceof Map?t.has(s)||t.set(s,l):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:l,writable:!0,enumerable:!0,configurable:!0});return t}function $N(e,t){return e&&br(t)?t.resolve(e.doc,e):t}function _N(e,t,{key:n,value:r}){if(Tt(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(sR(e,n))EN(e,t,r);else{let a=Yn(n,"",e);if(t instanceof Map)t.set(a,Yn(r,a,e));else if(t instanceof Set)t.add(a);else{let s=lR(n,a,e),l=Yn(r,s,e);s in t?Object.defineProperty(t,s,{value:l,writable:!0,enumerable:!0,configurable:!0}):t[s]=l}}return t}function lR(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Tt(e)&&n?.doc){let r=jN(n.doc,{});r.anchors=new Set;for(let s of n.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;let a=e.toString(r);if(!n.mapKeyWarned){let s=JSON.stringify(a);s.length>40&&(s=s.substring(0,36)+'..."'),CN(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return a}return JSON.stringify(t)}function r0(e,t,n){return new On(jd(e,void 0,n),jd(t,void 0,n))}var On=class A_{constructor(t,n=null){Object.defineProperty(this,Un,{value:gN}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return Tt(n)&&(n=n.clone(t)),Tt(r)&&(r=r.clone(t)),new A_(n,r)}toJSON(t,n){return _N(n,n?.mapAsMap?new Map:{},this)}toString(t,n,r){return t?.doc?aR(this,t,n,r):JSON.stringify(this)}};function TN(e,t,n){return(t.inFlow??e.flow?uR:dR)(e,t,n)}function dR({comment:e,items:t},n,{blockItemPrefix:r,flowChars:a,itemIndent:s,onChompKeep:l,onComment:f}){let{indent:p,options:{commentString:h}}=n,v=Object.assign({},n,{indent:s,type:null}),g=!1,m=[];for(let w=0;w<t.length;++w){let k=t[w],S=null;if(Tt(k))!g&&k.spaceBefore&&m.push(""),Nf(n,m,k.commentBefore,g),k.comment&&(S=k.comment);else if($t(k)){let E=Tt(k.key)?k.key:null;E&&(!g&&E.spaceBefore&&m.push(""),Nf(n,m,E.commentBefore,g))}g=!1;let N=Rs(k,v,()=>S=null,()=>g=!0);S&&(N+=ua(N,s,h(S))),g&&S&&(g=!1),m.push(r+N)}let b;if(m.length===0)b=a.start+a.end;else{b=m[0];for(let w=1;w<m.length;++w){let k=m[w];b+=k?`
|
|
59
|
+
${p}${k}`:`
|
|
60
|
+
`}}return e?(b+=`
|
|
61
|
+
`+xr(h(e),p),f&&f()):g&&l&&l(),b}function uR({items:e},t,{flowChars:n,itemIndent:r}){let{indent:a,indentStep:s,flowCollectionPadding:l,options:{commentString:f}}=t;r+=s;let p=Object.assign({},t,{indent:r,inFlow:!0,type:null}),h=!1,v=0,g=[];for(let w=0;w<e.length;++w){let k=e[w],S=null;if(Tt(k))k.spaceBefore&&g.push(""),Nf(t,g,k.commentBefore,!1),k.comment&&(S=k.comment);else if($t(k)){let E=Tt(k.key)?k.key:null;E&&(E.spaceBefore&&g.push(""),Nf(t,g,E.commentBefore,!1),E.comment&&(h=!0));let j=Tt(k.value)?k.value:null;j?(j.comment&&(S=j.comment),j.commentBefore&&(h=!0)):k.value==null&&E?.comment&&(S=E.comment)}S&&(h=!0);let N=Rs(k,p,()=>S=null);h||=g.length>v||N.includes(`
|
|
62
|
+
`),w<e.length-1?N+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(h||=g.reduce((E,j)=>E+j.length+2,2)+(N.length+2)>t.options.lineWidth),h&&(N+=",")),S&&(N+=ua(N,r,f(S))),g.push(N),v=g.length}let{start:m,end:b}=n;if(g.length===0)return m+b;if(!h){let w=g.reduce((k,S)=>k+S.length+2,2);h=t.options.lineWidth>0&&w>t.options.lineWidth}if(h){let w=m;for(let k of g)w+=k?`
|
|
63
|
+
${s}${a}${k}`:`
|
|
64
|
+
`;return`${w}
|
|
65
|
+
${a}${b}`}return`${m}${l}${g.join(" ")}${l}${b}`}function Nf({indent:e,options:{commentString:t}},n,r,a){if(r&&a&&(r=r.replace(/^\n+/,"")),r){let s=xr(t(r),e);n.push(s.trimStart())}}function ca(e,t){let n=rt(t)?t.value:t;for(let r of e)if($t(r)&&(r.key===t||r.key===n||rt(r.key)&&r.key.value===n))return r}var Xn=class extends kN{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(hi,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:a}=n,s=new this(e),l=(f,p)=>{if(typeof a=="function")p=a.call(t,f,p);else if(Array.isArray(a)&&!a.includes(f))return;(p!==void 0||r)&&s.items.push(r0(f,p,n))};if(t instanceof Map)for(let[f,p]of t)l(f,p);else if(t&&typeof t=="object")for(let f of Object.keys(t))l(f,t[f]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,t){let n;n=$t(e)?e:!e||typeof e!="object"||!("key"in e)?new On(e,e?.value):new On(e.key,e.value);let r=ca(this.items,n.key),a=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);rt(r.value)&&wN(n.value)?r.value.value=n.value:r.value=n.value}else if(a){let s=this.items.findIndex(l=>a(n,l)<0);s===-1?this.items.push(n):this.items.splice(s,0,n)}else this.items.push(n)}delete(e){let t=ca(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=ca(this.items,e)?.value;return(!t&&rt(n)?n.value:n)??void 0}has(e){return!!ca(this.items,e)}set(e,t){this.add(new On(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let a of this.items)_N(t,r,a);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let r of this.items)if(!$t(r))throw Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),TN(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}},zs={collection:"map",default:!0,nodeClass:Xn,tag:"tag:yaml.org,2002:map",resolve(e,t){return Do(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Xn.from(e,t,n)},fa=class extends kN{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Os,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=jf(e);return typeof t=="number"&&this.items.splice(t,1).length>0}get(e,t){let n=jf(e);if(typeof n!="number")return;let r=this.items[n];return!t&&rt(r)?r.value:r}has(e){let t=jf(e);return typeof t=="number"&&t<this.items.length}set(e,t){let n=jf(e);if(typeof n!="number")throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];rt(r)&&wN(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let a of this.items)n.push(Yn(a,String(r++),t));return n}toString(e,t,n){return e?TN(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,a=new this(e);if(t&&Symbol.iterator in Object(t)){let s=0;for(let l of t){if(typeof r=="function"){let f=t instanceof Set?l:String(s++);l=r.call(t,f,l)}a.items.push(jd(l,void 0,n))}}return a}};function jf(e){let t=rt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}var Fs={collection:"seq",default:!0,nodeClass:fa,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Lo(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>fa.from(e,t,n)},Cf={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),n0(e,t,n,r)}},Ef={identify:e=>e==null,createNode:()=>new qe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new qe(null),stringify:({source:e},t)=>typeof e=="string"&&Ef.test.test(e)?e:t.options.nullStr},i0={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new qe(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){return e&&i0.test.test(e)&&t===(e[0]==="t"||e[0]==="T")?e:t?n.options.trueStr:n.options.falseStr}};function ho({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);let a=typeof r=="number"?r:Number(r);if(!isFinite(a))return isNaN(a)?".nan":a<0?"-.inf":".inf";let s=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let l=s.indexOf(".");l<0&&(l=s.length,s+=".");let f=t-(s.length-l-1);for(;f-- >0;)s+="0"}return s}var AN={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]==="-"?-1/0:1/0,stringify:ho},MN={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){let t=Number(e.value);return isFinite(t)?t.toExponential():ho(e)}},ON={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new qe(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:ho},$f=e=>typeof e=="bigint"||Number.isInteger(e),a0=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function PN(e,t,n){let{value:r}=e;return $f(r)&&r>=0?n+r.toString(t):ho(e)}var DN={identify:e=>$f(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>a0(e,2,8,n),stringify:e=>PN(e,8,"0o")},LN={identify:$f,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>a0(e,0,10,n),stringify:ho},IN={identify:e=>$f(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>a0(e,2,16,n),stringify:e=>PN(e,16,"0x")},cR=[zs,Fs,Cf,Ef,i0,DN,LN,IN,AN,MN,ON];function RN(e){return typeof e=="bigint"||Number.isInteger(e)}var _f=({value:e})=>JSON.stringify(e),fR=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:_f},{identify:e=>e==null,createNode:()=>new qe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:_f},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:_f},{identify:RN,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})=>RN(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:_f}],hR=[zs,Fs].concat(fR,{default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),s0={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){let n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let a=0;a<n.length;++a)r[a]=n.charCodeAt(a);return r}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,a,s){if(!n)return"";let l=n,f;if(typeof btoa=="function"){let p="";for(let h=0;h<l.length;++h)p+=String.fromCharCode(l[h]);f=btoa(p)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??=qe.BLOCK_LITERAL,t!==qe.QUOTE_DOUBLE){let p=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),h=Math.ceil(f.length/p),v=Array(h);for(let g=0,m=0;g<h;++g,m+=p)v[g]=f.substr(m,p);f=v.join(t===qe.BLOCK_LITERAL?`
|
|
66
|
+
`:" ")}return n0({comment:e,type:t,value:f},r,a,s)}};function zN(e,t){if(Lo(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!$t(r)){if(Do(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");let a=r.items[0]||new On(new qe(null));if(r.commentBefore&&(a.key.commentBefore=a.key.commentBefore?`${r.commentBefore}
|
|
67
|
+
${a.key.commentBefore}`:r.commentBefore),r.comment){let s=a.value??a.key;s.comment=s.comment?`${r.comment}
|
|
68
|
+
${s.comment}`:r.comment}r=a}e.items[n]=$t(r)?r:new On(r)}}else t("Expected a sequence for this tag");return e}function FN(e,t,n){let{replacer:r}=n,a=new fa(e);a.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let l of t){typeof r=="function"&&(l=r.call(t,String(s++),l));let f,p;if(Array.isArray(l))if(l.length===2)f=l[0],p=l[1];else throw TypeError(`Expected [key, value] tuple: ${l}`);else if(l&&l instanceof Object){let h=Object.keys(l);if(h.length===1)f=h[0],p=l[f];else throw TypeError(`Expected tuple with one key, not ${h.length} keys`)}else f=l;a.items.push(r0(f,p,n))}return a}var l0={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:zN,createNode:FN},Tf=class M_ extends fa{constructor(){super(),this.add=Xn.prototype.add.bind(this),this.delete=Xn.prototype.delete.bind(this),this.get=Xn.prototype.get.bind(this),this.has=Xn.prototype.has.bind(this),this.set=Xn.prototype.set.bind(this),this.tag=M_.tag}toJSON(t,n){if(!n)return super.toJSON(t);let r=new Map;n?.onCreate&&n.onCreate(r);for(let a of this.items){let s,l;if($t(a)?(s=Yn(a.key,"",n),l=Yn(a.value,s,n)):s=Yn(a,"",n),r.has(s))throw Error("Ordered maps must not include duplicate keys");r.set(s,l)}return r}static from(t,n,r){let a=FN(t,n,r),s=new this;return s.items=a.items,s}};Tf.tag="tag:yaml.org,2002:omap";var d0={collection:"seq",identify:e=>e instanceof Map,nodeClass:Tf,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=zN(e,t),r=[];for(let{key:a}of n.items)rt(a)&&(r.includes(a.value)?t(`Ordered maps must not include duplicate keys: ${a.value}`):r.push(a.value));return Object.assign(new Tf,n)},createNode:(e,t,n)=>Tf.from(e,t,n)};function BN({value:e,source:t},n){return t&&(e?qN:HN).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var qN={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 qe(!0),stringify:BN},HN={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 qe(!1),stringify:BN},pR={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]==="-"?-1/0:1/0,stringify:ho},mR={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){let t=Number(e.value);return isFinite(t)?t.toExponential():ho(e)}},gR={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new qe(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){let r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:ho},$d=e=>typeof e=="bigint"||Number.isInteger(e);function Af(e,t,n,{intAsBigInt:r}){let a=e[0];if((a==="-"||a==="+")&&(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}`}let l=BigInt(e);return a==="-"?BigInt(-1)*l:l}let s=parseInt(e,n);return a==="-"?-1*s:s}function u0(e,t,n){let{value:r}=e;if($d(r)){let a=r.toString(t);return r<0?"-"+n+a.substr(1):n+a}return ho(e)}var yR={identify:$d,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Af(e,2,2,n),stringify:e=>u0(e,2,"0b")},vR={identify:$d,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Af(e,1,8,n),stringify:e=>u0(e,8,"0")},bR={identify:$d,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Af(e,0,10,n),stringify:ho},xR={identify:$d,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Af(e,2,16,n),stringify:e=>u0(e,16,"0x")},Mf=class O_ extends Xn{constructor(t){super(t),this.tag=O_.tag}add(t){let n;n=$t(t)?t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?new On(t.key,null):new On(t,null),ca(this.items,n.key)||this.items.push(n)}get(t,n){let r=ca(this.items,t);return!n&&$t(r)?rt(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=ca(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new On(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 Error("Set items must all have null values")}static from(t,n,r){let{replacer:a}=r,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let l of n)typeof a=="function"&&(l=a.call(n,l,l)),s.items.push(r0(l,null,r));return s}};Mf.tag="tag:yaml.org,2002:set";var c0={collection:"map",identify:e=>e instanceof Set,nodeClass:Mf,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Mf.from(e,t,n),resolve(e,t){if(Do(e)){if(e.hasAllNullValues(!0))return Object.assign(new Mf,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function f0(e,t){let n=e[0],r=n==="-"||n==="+"?e.substring(1):e,a=l=>t?BigInt(l):Number(l),s=r.replace(/_/g,"").split(":").reduce((l,f)=>l*a(60)+a(f),a(0));return n==="-"?a(-1)*s:s}function VN(e){let{value:t}=e,n=l=>l;if(typeof t=="bigint")n=l=>BigInt(l);else if(isNaN(t)||!isFinite(t))return ho(e);let r="";t<0&&(r="-",t*=n(-1));let a=n(60),s=[t%a];return t<60?s.unshift(0):(t=(t-s[0])/a,s.unshift(t%a),t>=60&&(t=(t-s[0])/a,s.unshift(t))),r+s.map(l=>String(l).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var KN={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})=>f0(e,n),stringify:VN},WN={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=>f0(e,!1),stringify:VN},Of={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){let t=e.match(Of.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,a,s,l,f]=t.map(Number),p=t[7]?Number((t[7]+"00").substr(1,3)):0,h=Date.UTC(n,r-1,a,s||0,l||0,f||0,p),v=t[8];if(v&&v!=="Z"){let g=f0(v,!1);Math.abs(g)<30&&(g*=60),h-=6e4*g}return new Date(h)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},UN=[zs,Fs,Cf,Ef,qN,HN,yR,vR,bR,xR,pR,mR,gR,s0,wr,d0,l0,c0,KN,WN,Of],YN=new Map([["core",cR],["failsafe",[zs,Fs,Cf]],["json",hR],["yaml11",UN],["yaml-1.1",UN]]),XN={binary:s0,bool:i0,float:ON,floatExp:MN,floatNaN:AN,floatTime:WN,int:LN,intHex:IN,intOct:DN,intTime:KN,map:zs,merge:wr,null:Ef,omap:d0,pairs:l0,seq:Fs,set:c0,timestamp:Of},wR={"tag:yaml.org,2002:binary":s0,"tag:yaml.org,2002:merge":wr,"tag:yaml.org,2002:omap":d0,"tag:yaml.org,2002:pairs":l0,"tag:yaml.org,2002:set":c0,"tag:yaml.org,2002:timestamp":Of};function h0(e,t,n){let r=YN.get(t);if(r&&!e)return n&&!r.includes(wr)?r.concat(wr):r.slice();let a=r;if(!a)if(Array.isArray(e))a=[];else{let s=Array.from(YN.keys()).filter(l=>l!=="yaml11").map(l=>JSON.stringify(l)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(let s of e)a=a.concat(s);else typeof e=="function"&&(a=e(a.slice()));return n&&(a=a.concat(wr)),a.reduce((s,l)=>{let f=typeof l=="string"?XN[l]:l;if(!f){let p=JSON.stringify(l),h=Object.keys(XN).map(v=>JSON.stringify(v)).join(", ");throw Error(`Unknown custom tag ${p}; use one of ${h}`)}return s.includes(f)||s.push(f),s},[])}var kR=(e,t)=>e.key<t.key?-1:+(e.key>t.key),SR=class P_{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:a,schema:s,sortMapEntries:l,toStringDefaults:f}){this.compat=Array.isArray(t)?h0(t,"compat"):t?h0(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=a?wR:{},this.tags=h0(n,this.name,r),this.toStringOptions=f??null,Object.defineProperty(this,hi,{value:zs}),Object.defineProperty(this,Po,{value:Cf}),Object.defineProperty(this,Os,{value:Fs}),this.sortMapEntries=typeof l=="function"?l:l===!0?kR:null}clone(){let t=Object.create(P_.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function NR(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let p=e.directives.toString(e);p?(n.push(p),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");let a=jN(e,t),{commentString:s}=a.options;if(e.commentBefore){n.length!==1&&n.unshift("");let p=s(e.commentBefore);n.unshift(xr(p,""))}let l=!1,f=null;if(e.contents){if(Tt(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){let v=s(e.contents.commentBefore);n.push(xr(v,""))}a.forceBlockIndent=!!e.comment,f=e.contents.comment}let p=f?void 0:()=>l=!0,h=Rs(e.contents,a,()=>f=null,p);f&&(h+=ua(h,"",s(f))),(h[0]==="|"||h[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${h}`:n.push(h)}else n.push(Rs(e.contents,a));if(e.directives?.docEnd)if(e.comment){let p=s(e.comment);p.includes(`
|
|
69
|
+
`)?(n.push("..."),n.push(xr(p,""))):n.push(`... ${p}`)}else n.push("...");else{let p=e.comment;p&&l&&(p=p.replace(/^\n+/,"")),p&&((!l||f)&&n[n.length-1]!==""&&n.push(""),n.push(xr(s(p),"")))}return n.join(`
|
|
70
|
+
`)+`
|
|
71
|
+
`}var p0=class D_{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Un,{value:Gg});let a=null;typeof n=="function"||Array.isArray(n)?a=n:r===void 0&&n&&(r=n,n=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:l}=s;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(l=this.directives.yaml.version)):this.directives=new Ds({version:l}),this.setSchema(l,r),this.contents=t===void 0?null:this.createNode(t,a,r)}clone(){let t=Object.create(D_.prototype,{[Un]:{value:Gg}});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=Tt(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Bs(this.contents)&&this.contents.add(t)}addIn(t,n){Bs(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){let r=bN(this);t.anchor=!n||r.has(n)?xN(n||"a",r):n}return new Jg(t.anchor)}createNode(t,n,r){let a;if(typeof n=="function")t=n.call({"":t},"",t),a=n;else if(Array.isArray(n)){let S=n.filter(N=>typeof N=="number"||N instanceof String||N instanceof Number).map(String);S.length>0&&(n=n.concat(S)),a=n}else r===void 0&&n&&(r=n,n=void 0);let{aliasDuplicateObjects:s,anchorPrefix:l,flow:f,keepUndefined:p,onTagObj:h,tag:v}=r??{},{onAnchor:g,setAnchors:m,sourceObjects:b}=Z3(this,l||"a"),w={aliasDuplicateObjects:s??!0,keepUndefined:p??!1,onAnchor:g,onTagObj:h,replacer:a,schema:this.schema,sourceObjects:b},k=jd(t,v,w);return f&&_t(k)&&(k.flow=!0),m(),k}createPair(t,n,r={}){return new On(this.createNode(t,null,r),this.createNode(n,null,r))}delete(t){return Bs(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Cd(t)?this.contents!=null&&(this.contents=null,!0):Bs(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return _t(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Cd(t)?!n&&rt(this.contents)?this.contents.value:this.contents:_t(this.contents)?this.contents.getIn(t,n):void 0}has(t){return _t(this.contents)?this.contents.has(t):!1}hasIn(t){return Cd(t)?this.contents!==void 0:_t(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=vf(this.schema,[t],n):Bs(this.contents)&&this.contents.set(t,n)}setIn(t,n){Cd(t)?this.contents=n:this.contents==null?this.contents=vf(this.schema,Array.from(t),n):Bs(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 Ds({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 Ds({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let a=JSON.stringify(t);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${a}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new SR(Object.assign(r,n));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:a,onAnchor:s,reviver:l}={}){let f={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},p=Yn(this.contents,n??"",f);if(typeof s=="function")for(let{count:h,res:v}of f.anchors.values())s(v,h);return typeof l=="function"?Ls(l,{"":p},"",p):p}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){let n=JSON.stringify(t.indent);throw Error(`"indent" option must be a positive integer, not ${n}`)}return NR(this,t)}};function Bs(e){if(_t(e))return!0;throw Error("Expected a YAML collection as document contents")}var ZN=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},_d=class extends ZN{constructor(e,t,n){super("YAMLParseError",e,t,n)}},jR=class extends ZN{constructor(e,t,n){super("YAMLWarning",e,t,n)}},GN=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(f=>t.linePos(f));let{line:r,col:a}=n.linePos[0];n.message+=` at line ${r}, column ${a}`;let s=a-1,l=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&l.length>80){let f=Math.min(s-39,l.length-79);l="\u2026"+l.substring(f),s-=f-1}if(l.length>80&&(l=l.substring(0,79)+"\u2026"),r>1&&/^ *$/.test(l.substring(0,s))){let f=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);f.length>80&&(f=f.substring(0,79)+`\u2026
|
|
72
|
+
`),l=f+l}if(/[^ ]/.test(l)){let f=1,p=n.linePos[1];p?.line===r&&p.col>a&&(f=Math.max(1,Math.min(p.col-a,80-s)));let h=" ".repeat(s)+"^".repeat(f);n.message+=`:
|
|
73
|
+
|
|
74
|
+
${l}
|
|
75
|
+
${h}
|
|
76
|
+
`}};function qs(e,{flow:t,indicator:n,next:r,offset:a,onError:s,parentIndent:l,startOnNewline:f}){let p=!1,h=f,v=f,g="",m="",b=!1,w=!1,k=null,S=null,N=null,E=null,j=null,$=null,L=null;for(let M of e)switch(w&&=(M.type!=="space"&&M.type!=="newline"&&M.type!=="comma"&&s(M.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),!1),k&&=(h&&M.type!=="comment"&&M.type!=="newline"&&s(k,"TAB_AS_INDENT","Tabs are not allowed as indentation"),null),M.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&M.source.includes(" ")&&(k=M),v=!0;break;case"comment":{v||s(M,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let O=M.source.substring(1)||" ";g?g+=m+O:g=O,m="",h=!1;break}case"newline":h?g?g+=M.source:$&&n==="seq-item-ind"||(p=!0):m+=M.source,h=!0,b=!0,(S||N)&&(E=M),v=!0;break;case"anchor":S&&s(M,"MULTIPLE_ANCHORS","A node can have at most one anchor"),M.source.endsWith(":")&&s(M.offset+M.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),S=M,L??=M.offset,h=!1,v=!1,w=!0;break;case"tag":N&&s(M,"MULTIPLE_TAGS","A node can have at most one tag"),N=M,L??=M.offset,h=!1,v=!1,w=!0;break;case n:(S||N)&&s(M,"BAD_PROP_ORDER",`Anchors and tags must be after the ${M.source} indicator`),$&&s(M,"UNEXPECTED_TOKEN",`Unexpected ${M.source} in ${t??"collection"}`),$=M,h=n==="seq-item-ind"||n==="explicit-key-ind",v=!1;break;case"comma":if(t){j&&s(M,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),j=M,h=!1,v=!1;break}default:s(M,"UNEXPECTED_TOKEN",`Unexpected ${M.type} token`),h=!1,v=!1}let z=e[e.length-1],A=z?z.offset+z.source.length:a;return w&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),k&&(h&&k.indent<=l||r?.type==="block-map"||r?.type==="block-seq")&&s(k,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:j,found:$,spaceBefore:p,comment:g,hasNewline:b,anchor:S,tag:N,newlineAfterProp:E,end:A,start:L??A}}function Td(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
77
|
+
`))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let n of t.start)if(n.type==="newline")return!0;if(t.sep){for(let n of t.sep)if(n.type==="newline")return!0}if(Td(t.key)||Td(t.value))return!0}return!1;default:return!0}}function m0(e,t,n){if(t?.type==="flow-collection"){let r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Td(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function QN(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let a=typeof r=="function"?r:(s,l)=>s===l||rt(s)&&rt(l)&&s.value===l.value;return t.some(s=>a(s.key,n))}var JN="All mapping items must start at the same column";function CR({composeNode:e,composeEmptyNode:t},n,r,a,s){let l=new(s?.nodeClass??Xn)(n.schema);n.atRoot&&=!1;let f=r.offset,p=null;for(let h of r.items){let{start:v,key:g,sep:m,value:b}=h,w=qs(v,{indicator:"explicit-key-ind",next:g??m?.[0],offset:f,onError:a,parentIndent:r.indent,startOnNewline:!0}),k=!w.found;if(k){if(g&&(g.type==="block-seq"?a(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in g&&g.indent!==r.indent&&a(f,"BAD_INDENT",JN)),!w.anchor&&!w.tag&&!m){p=w.end,w.comment&&(l.comment?l.comment+=`
|
|
78
|
+
`+w.comment:l.comment=w.comment);continue}(w.newlineAfterProp||Td(g))&&a(g??v[v.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else w.found?.indent!==r.indent&&a(f,"BAD_INDENT",JN);n.atKey=!0;let S=w.end,N=g?e(n,g,w,a):t(n,S,v,null,w,a);n.schema.compat&&m0(r.indent,g,a),n.atKey=!1,QN(n,l.items,N)&&a(S,"DUPLICATE_KEY","Map keys must be unique");let E=qs(m??[],{indicator:"map-value-ind",next:b,offset:N.range[2],onError:a,parentIndent:r.indent,startOnNewline:!g||g.type==="block-scalar"});if(f=E.end,E.found){k&&(b?.type==="block-map"&&!E.hasNewline&&a(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<E.found.offset-1024&&a(N.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let j=b?e(n,b,E,a):t(n,f,m,null,E,a);n.schema.compat&&m0(r.indent,b,a),f=j.range[2];let $=new On(N,j);n.options.keepSourceTokens&&($.srcToken=h),l.items.push($)}else{k&&a(N.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),E.comment&&(N.comment?N.comment+=`
|
|
79
|
+
`+E.comment:N.comment=E.comment);let j=new On(N);n.options.keepSourceTokens&&(j.srcToken=h),l.items.push(j)}}return p&&p<f&&a(p,"IMPOSSIBLE","Map comment with trailing content"),l.range=[r.offset,f,p??f],l}function ER({composeNode:e,composeEmptyNode:t},n,r,a,s){let l=new(s?.nodeClass??fa)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let f=r.offset,p=null;for(let{start:h,value:v}of r.items){let g=qs(h,{indicator:"seq-item-ind",next:v,offset:f,onError:a,parentIndent:r.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||v)v?.type==="block-seq"?a(g.end,"BAD_INDENT","All sequence items must start at the same column"):a(f,"MISSING_CHAR","Sequence item without - indicator");else{p=g.end,g.comment&&(l.comment=g.comment);continue}let m=v?e(n,v,g,a):t(n,g.end,h,null,g,a);n.schema.compat&&m0(r.indent,v,a),f=m.range[2],l.items.push(m)}return l.range=[r.offset,f,p??f],l}function Ad(e,t,n,r){let a="";if(e){let s=!1,l="";for(let f of e){let{source:p,type:h}=f;switch(h){case"space":s=!0;break;case"comment":{n&&!s&&r(f,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let v=p.substring(1)||" ";a?a+=l+v:a=v,l="";break}case"newline":a&&(l+=p),s=!0;break;default:r(f,"UNEXPECTED_TOKEN",`Unexpected ${h} at node end`)}t+=p.length}}return{comment:a,offset:t}}var g0="Block collections are not allowed within flow collections",y0=e=>e&&(e.type==="block-map"||e.type==="block-seq");function $R({composeNode:e,composeEmptyNode:t},n,r,a,s){let l=r.start.source==="{",f=l?"flow map":"flow sequence",p=new(s?.nodeClass??(l?Xn:fa))(n.schema);p.flow=!0;let h=n.atRoot;h&&(n.atRoot=!1),n.atKey&&=!1;let v=r.offset+r.start.source.length;for(let k=0;k<r.items.length;++k){let S=r.items[k],{start:N,key:E,sep:j,value:$}=S,L=qs(N,{flow:f,indicator:"explicit-key-ind",next:E??j?.[0],offset:v,onError:a,parentIndent:r.indent,startOnNewline:!1});if(!L.found){if(!L.anchor&&!L.tag&&!j&&!$){k===0&&L.comma?a(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`):k<r.items.length-1&&a(L.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${f}`),L.comment&&(p.comment?p.comment+=`
|
|
80
|
+
`+L.comment:p.comment=L.comment),v=L.end;continue}!l&&n.options.strict&&Td(E)&&a(E,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(k===0)L.comma&&a(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`);else if(L.comma||a(L.start,"MISSING_CHAR",`Missing , between ${f} items`),L.comment){let z="";e:for(let A of N)switch(A.type){case"comma":case"space":break;case"comment":z=A.source.substring(1);break e;default:break e}if(z){let A=p.items[p.items.length-1];$t(A)&&(A=A.value??A.key),A.comment?A.comment+=`
|
|
81
|
+
`+z:A.comment=z,L.comment=L.comment.substring(z.length+1)}}if(!l&&!j&&!L.found){let z=$?e(n,$,L,a):t(n,L.end,j,null,L,a);p.items.push(z),v=z.range[2],y0($)&&a(z.range,"BLOCK_IN_FLOW",g0)}else{n.atKey=!0;let z=L.end,A=E?e(n,E,L,a):t(n,z,N,null,L,a);y0(E)&&a(A.range,"BLOCK_IN_FLOW",g0),n.atKey=!1;let M=qs(j??[],{flow:f,indicator:"map-value-ind",next:$,offset:A.range[2],onError:a,parentIndent:r.indent,startOnNewline:!1});if(M.found){if(!l&&!L.found&&n.options.strict){if(j)for(let B of j){if(B===M.found)break;if(B.type==="newline"){a(B,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}L.start<M.found.offset-1024&&a(M.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else $&&("source"in $&&$.source?.[0]===":"?a($,"MISSING_CHAR",`Missing space after : in ${f}`):a(M.start,"MISSING_CHAR",`Missing , or : between ${f} items`));let O=$?e(n,$,M,a):M.found?t(n,M.end,j,null,M,a):null;O?y0($)&&a(O.range,"BLOCK_IN_FLOW",g0):M.comment&&(A.comment?A.comment+=`
|
|
82
|
+
`+M.comment:A.comment=M.comment);let K=new On(A,O);if(n.options.keepSourceTokens&&(K.srcToken=S),l){let B=p;QN(n,B.items,A)&&a(z,"DUPLICATE_KEY","Map keys must be unique"),B.items.push(K)}else{let B=new Xn(n.schema);B.flow=!0,B.items.push(K);let V=(O??A).range;B.range=[A.range[0],V[1],V[2]],p.items.push(B)}v=O?O.range[2]:M.end}}let g=l?"}":"]",[m,...b]=r.end,w=v;if(m?.source===g)w=m.offset+m.source.length;else{let k=f[0].toUpperCase()+f.substring(1),S=h?`${k} must end with a ${g}`:`${k} in block collection must be sufficiently indented and end with a ${g}`;a(v,h?"MISSING_CHAR":"BAD_INDENT",S),m&&m.source.length!==1&&b.unshift(m)}if(b.length>0){let k=Ad(b,w,n.options.strict,a);k.comment&&(p.comment?p.comment+=`
|
|
83
|
+
`+k.comment:p.comment=k.comment),p.range=[r.offset,w,k.offset]}else p.range=[r.offset,w,w];return p}function v0(e,t,n,r,a,s){let l=n.type==="block-map"?CR(e,t,n,r,s):n.type==="block-seq"?ER(e,t,n,r,s):$R(e,t,n,r,s),f=l.constructor;return a==="!"||a===f.tagName?(l.tag=f.tagName,l):(a&&(l.tag=a),l)}function _R(e,t,n,r,a){let s=r.tag,l=s?t.directives.tagName(s.source,m=>a(s,"TAG_RESOLVE_FAILED",m)):null;if(n.type==="block-seq"){let{anchor:m,newlineAfterProp:b}=r,w=m&&s?m.offset>s.offset?m:s:m??s;w&&(!b||b.offset<w.offset)&&a(w,"MISSING_CHAR","Missing newline after block sequence props")}let f=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!l||l==="!"||l===Xn.tagName&&f==="map"||l===fa.tagName&&f==="seq")return v0(e,t,n,a,l);let p=t.schema.tags.find(m=>m.tag===l&&m.collection===f);if(!p){let m=t.schema.knownTags[l];if(m?.collection===f)t.schema.tags.push(Object.assign({},m,{default:!1})),p=m;else return m?a(s,"BAD_COLLECTION_TYPE",`${m.tag} used for ${f} collection, but expects ${m.collection??"scalar"}`,!0):a(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${l}`,!0),v0(e,t,n,a,l)}let h=v0(e,t,n,a,l,p),v=p.resolve?.(h,m=>a(s,"TAG_RESOLVE_FAILED",m),t.options)??h,g=Tt(v)?v:new qe(v);return g.range=h.range,g.tag=l,p?.format&&(g.format=p.format),g}function TR(e,t,n){let r=t.offset,a=AR(t,e.options.strict,n);if(!a)return{value:"",type:null,comment:"",range:[r,r,r]};let s=a.mode===">"?qe.BLOCK_FOLDED:qe.BLOCK_LITERAL,l=t.source?MR(t.source):[],f=l.length;for(let k=l.length-1;k>=0;--k){let S=l[k][1];if(S===""||S==="\r")f=k;else break}if(f===0){let k=a.chomp==="+"&&l.length>0?`
|
|
84
|
+
`.repeat(Math.max(1,l.length-1)):"",S=r+a.length;return t.source&&(S+=t.source.length),{value:k,type:s,comment:a.comment,range:[r,S,S]}}let p=t.indent+a.indent,h=t.offset+a.length,v=0;for(let k=0;k<f;++k){let[S,N]=l[k];if(N===""||N==="\r")a.indent===0&&S.length>p&&(p=S.length);else{S.length<p&&n(h+S.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),a.indent===0&&(p=S.length),v=k,p===0&&!e.atRoot&&n(h,"BAD_INDENT","Block scalar values in collections must be indented");break}h+=S.length+N.length+1}for(let k=l.length-1;k>=f;--k)l[k][0].length>p&&(f=k+1);let g="",m="",b=!1;for(let k=0;k<v;++k)g+=l[k][0].slice(p)+`
|
|
85
|
+
`;for(let k=v;k<f;++k){let[S,N]=l[k];h+=S.length+N.length+1;let E=N[N.length-1]==="\r";if(E&&(N=N.slice(0,-1)),N&&S.length<p){let j=`Block scalar lines must not be less indented than their ${a.indent?"explicit indentation indicator":"first line"}`;n(h-N.length-(E?2:1),"BAD_INDENT",j),S=""}s===qe.BLOCK_LITERAL?(g+=m+S.slice(p)+N,m=`
|
|
86
|
+
`):S.length>p||N[0]===" "?(m===" "?m=`
|
|
87
|
+
`:!b&&m===`
|
|
88
|
+
`&&(m=`
|
|
89
|
+
|
|
90
|
+
`),g+=m+S.slice(p)+N,m=`
|
|
91
|
+
`,b=!0):N===""?m===`
|
|
92
|
+
`?g+=`
|
|
93
|
+
`:m=`
|
|
94
|
+
`:(g+=m+N,m=" ",b=!1)}switch(a.chomp){case"-":break;case"+":for(let k=f;k<l.length;++k)g+=`
|
|
95
|
+
`+l[k][0].slice(p);g[g.length-1]!==`
|
|
96
|
+
`&&(g+=`
|
|
97
|
+
`);break;default:g+=`
|
|
98
|
+
`}let w=r+a.length+t.source.length;return{value:g,type:s,comment:a.comment,range:[r,w,w]}}function AR({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:a}=t[0],s=a[0],l=0,f="",p=-1;for(let m=1;m<a.length;++m){let b=a[m];if(!f&&(b==="-"||b==="+"))f=b;else{let w=Number(b);!l&&w?l=w:p===-1&&(p=e+m)}}p!==-1&&r(p,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${a}`);let h=!1,v="",g=a.length;for(let m=1;m<t.length;++m){let b=t[m];switch(b.type){case"space":h=!0;case"newline":g+=b.source.length;break;case"comment":n&&!h&&r(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),g+=b.source.length,v=b.source.substring(1);break;case"error":r(b,"UNEXPECTED_TOKEN",b.message),g+=b.source.length;break;default:{r(b,"UNEXPECTED_TOKEN",`Unexpected token in block scalar header: ${b.type}`);let w=b.source;w&&typeof w=="string"&&(g+=w.length)}}}return{mode:s,indent:l,chomp:f,comment:v,length:g}}function MR(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),a=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let s=1;s<t.length;s+=2)a.push([t[s],t[s+1]]);return a}function OR(e,t,n){let{offset:r,type:a,source:s,end:l}=e,f,p,h=(m,b,w)=>n(r+m,b,w);switch(a){case"scalar":f=qe.PLAIN,p=PR(s,h);break;case"single-quoted-scalar":f=qe.QUOTE_SINGLE,p=DR(s,h);break;case"double-quoted-scalar":f=qe.QUOTE_DOUBLE,p=LR(s,h);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${a}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}let v=r+s.length,g=Ad(l,v,t,n);return{value:p,type:f,comment:g.comment,range:[r,v,g.offset]}}function PR(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]}`}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),ej(e)}function DR(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),ej(e.slice(1,-1)).replace(/''/g,"'")}function ej(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,a;try{r=RegExp("(?<![ ])[ ]+$"),a=RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{r=/[ \t]+$/,a=/^[ \t]+|[ \t]+$/g}let s=n[1].replace(r,""),l=" ",f=t.lastIndex;for(;n=t.exec(e);){let h=n[1].replace(a,"");h===""?l===`
|
|
99
|
+
`?s+=l:l=`
|
|
100
|
+
`:(s+=l+h,l=" "),f=t.lastIndex}let p=/[ \t]*(.*)/sy;return p.lastIndex=f,n=p.exec(e),s+l+(n?.[1]??"")}function LR(e,t){let n="";for(let r=1;r<e.length-1;++r){let a=e[r];if(a!=="\r"||e[r+1]!==`
|
|
101
|
+
`)if(a===`
|
|
102
|
+
`){let{fold:s,offset:l}=IR(e,r);n+=s,r=l}else if(a==="\\"){let s=e[++r],l=RR[s];if(l)n+=l;else if(s===`
|
|
103
|
+
`)for(s=e[r+1];s===" "||s===" ";)s=e[++r+1];else if(s==="\r"&&e[r+1]===`
|
|
104
|
+
`)for(s=e[++r+1];s===" "||s===" ";)s=e[++r+1];else if(s==="x"||s==="u"||s==="U"){let f=s==="x"?2:s==="u"?4:8;n+=zR(e,r+1,f,t),r+=f}else{let f=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${f}`),n+=f}}else if(a===" "||a===" "){let s=r,l=e[r+1];for(;l===" "||l===" ";)l=e[++r+1];l!==`
|
|
105
|
+
`&&(l!=="\r"||e[r+2]!==`
|
|
106
|
+
`)&&(n+=r>s?e.slice(s,r+1):a)}else n+=a}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function IR(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
|
|
107
|
+
`||r==="\r")&&(r!=="\r"||e[t+2]===`
|
|
108
|
+
`);)r===`
|
|
109
|
+
`&&(n+=`
|
|
110
|
+
`),t+=1,r=e[t+1];return n||=" ",{fold:n,offset:t}}var RR={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
111
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function zR(e,t,n,r){let a=e.substr(t,n),s=a.length===n&&/^[0-9a-fA-F]+$/.test(a)?parseInt(a,16):NaN;try{return String.fromCodePoint(s)}catch{let l=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function tj(e,t,n,r){let{value:a,type:s,comment:l,range:f}=t.type==="block-scalar"?TR(e,t,r):OR(t,e.options.strict,r),p=n?e.directives.tagName(n.source,g=>r(n,"TAG_RESOLVE_FAILED",g)):null,h;h=e.options.stringKeys&&e.atKey?e.schema[Po]:p?FR(e.schema,a,p,n,r):t.type==="scalar"?BR(e,a,t,r):e.schema[Po];let v;try{let g=h.resolve(a,m=>r(n??t,"TAG_RESOLVE_FAILED",m),e.options);v=rt(g)?g:new qe(g)}catch(g){let m=g instanceof Error?g.message:String(g);r(n??t,"TAG_RESOLVE_FAILED",m),v=new qe(a)}return v.range=f,v.source=a,s&&(v.type=s),p&&(v.tag=p),h.format&&(v.format=h.format),l&&(v.comment=l),v}function FR(e,t,n,r,a){if(n==="!")return e[Po];let s=[];for(let f of e.tags)if(!f.collection&&f.tag===n)if(f.default&&f.test)s.push(f);else return f;for(let f of s)if(f.test?.test(t))return f;let l=e.knownTags[n];return l&&!l.collection?(e.tags.push(Object.assign({},l,{default:!1,test:void 0})),l):(a(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Po])}function BR({atKey:e,directives:t,schema:n},r,a,s){let l=n.tags.find(f=>(f.default===!0||e&&f.default==="key")&&f.test?.test(r))||n[Po];if(n.compat){let f=n.compat.find(p=>p.default&&p.test?.test(r))??n[Po];l.tag!==f.tag&&s(a,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${t.tagString(l.tag)} or ${t.tagString(f.tag)}`,!0)}return l}function qR(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let a=t[r];switch(a.type){case"space":case"comment":case"newline":e-=a.source.length;continue}for(a=t[++r];a?.type==="space";)e+=a.source.length,a=t[++r];break}}return e}var HR={composeNode:nj,composeEmptyNode:b0};function nj(e,t,n,r){let a=e.atKey,{spaceBefore:s,comment:l,anchor:f,tag:p}=n,h,v=!0;switch(t.type){case"alias":h=VR(e,t,r),(f||p)&&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":h=tj(e,t,p,r),f&&(h.anchor=f.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{h=_R(HR,e,t,n,r),f&&(h.anchor=f.source.substring(1))}catch(g){r(t,"RESOURCE_EXHAUSTION",g instanceof Error?g.message:String(g))}break;default:r(t,"UNEXPECTED_TOKEN",t.type==="error"?t.message:`Unsupported token (type: ${t.type})`),v=!1}return h??=b0(e,t.offset,void 0,null,n,r),f&&h.anchor===""&&r(f,"BAD_ALIAS","Anchor cannot be an empty string"),a&&e.options.stringKeys&&(!rt(h)||typeof h.value!="string"||h.tag&&h.tag!=="tag:yaml.org,2002:str")&&r(p??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(h.spaceBefore=!0),l&&(t.type==="scalar"&&t.source===""?h.comment=l:h.commentBefore=l),e.options.keepSourceTokens&&v&&(h.srcToken=t),h}function b0(e,t,n,r,{spaceBefore:a,comment:s,anchor:l,tag:f,end:p},h){let v=tj(e,{type:"scalar",offset:qR(t,n,r),indent:-1,source:""},f,h);return l&&(v.anchor=l.source.substring(1),v.anchor===""&&h(l,"BAD_ALIAS","Anchor cannot be an empty string")),a&&(v.spaceBefore=!0),s&&(v.comment=s,v.range[2]=p),v}function VR({options:e},{offset:t,source:n,end:r},a){let s=new Jg(n.substring(1));s.source===""&&a(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&a(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let l=t+n.length,f=Ad(r,l,e.strict,a);return s.range=[t,l,f.offset],f.comment&&(s.comment=f.comment),s}function KR(e,t,{offset:n,start:r,value:a,end:s},l){let f=new p0(void 0,Object.assign({_directives:t},e)),p={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},h=qs(r,{indicator:"doc-start",next:a??s?.[0],offset:n,onError:l,parentIndent:0,startOnNewline:!0});h.found&&(f.directives.docStart=!0,a&&(a.type==="block-map"||a.type==="block-seq")&&!h.hasNewline&&l(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=a?nj(p,a,h,l):b0(p,h.end,r,null,h,l);let v=f.contents.range[2],g=Ad(s,v,!1,l);return g.comment&&(f.comment=g.comment),f.range=[n,v,g.offset],f}function Md(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function oj(e){let t="",n=!1,r=!1;for(let a=0;a<e.length;++a){let s=e[a];switch(s[0]){case"#":t+=(t===""?"":r?`
|
|
112
|
+
|
|
113
|
+
`:`
|
|
114
|
+
`)+(s.substring(1)||" "),n=!0,r=!1;break;case"%":e[a+1]?.[0]!=="#"&&(a+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var WR=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,r,a)=>{let s=Md(t);a?this.warnings.push(new jR(s,n,r)):this.errors.push(new _d(s,n,r))},this.directives=new Ds({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=oj(this.prelude);if(n){let a=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
115
|
+
${n}`:n;else if(r||e.directives.docStart||!a)e.commentBefore=n;else if(_t(a)&&!a.flow&&a.items.length>0){let s=a.items[0];$t(s)&&(s=s.key);let l=s.commentBefore;s.commentBefore=l?`${n}
|
|
116
|
+
${l}`:n}else{let s=a.commentBefore;a.commentBefore=s?`${n}
|
|
117
|
+
${s}`:n}}if(t){for(let a=0;a<this.errors.length;++a)e.errors.push(this.errors[a]);for(let a=0;a<this.warnings.length;++a)e.warnings.push(this.warnings[a])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:oj(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let r of e)yield*this.next(r);yield*this.end(t,n)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,n,r)=>{let a=Md(e);a[0]+=t,this.onError(a,"BAD_DIRECTIVE",n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=KR(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new _d(Md(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){this.errors.push(new _d(Md(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=Ad(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
|
|
118
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new _d(Md(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=new p0(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,t,t],this.decorate(n,!1),yield n}}},x0=Symbol("break visit"),UR=Symbol("skip children"),rj=Symbol("remove item");function Hs(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),ij(Object.freeze([]),e,t)}Hs.BREAK=x0,Hs.SKIP=UR,Hs.REMOVE=rj,Hs.itemAtPath=(e,t)=>{let n=e;for(let[r,a]of t){let s=n?.[r];if(s&&"items"in s)n=s.items[a];else return}return n},Hs.parentCollection=(e,t)=>{let n=Hs.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],a=n?.[r];if(a&&"items"in a)return a;throw Error("Parent collection not found")};function ij(e,t,n){let r=n(t,e);if(typeof r=="symbol")return r;for(let a of["key","value"]){let s=t[a];if(s&&"items"in s){for(let l=0;l<s.items.length;++l){let f=ij(Object.freeze(e.concat([[a,l]])),s.items[l],n);if(typeof f=="number")l=f-1;else{if(f===x0)return x0;f===rj&&(s.items.splice(l,1),--l)}}typeof r=="function"&&a==="key"&&(r=r(t,e))}}return typeof r=="function"?r(t,e):r}function YR(e){switch(e){case"\uFEFF":return"byte-order-mark";case"":return"doc-mode";case"":return"flow-error-end";case"":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
119
|
+
`:case`\r
|
|
120
|
+
`: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 po(e){switch(e){case void 0:case" ":case`
|
|
121
|
+
`:case"\r":case" ":return!0;default:return!1}}var aj=new Set("0123456789ABCDEFabcdef"),XR=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Pf=new Set(",[]{}"),ZR=new Set(` ,[]{}
|
|
122
|
+
\r `),w0=e=>!e||ZR.has(e),GR=class{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(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
123
|
+
`||t==="\r"&&this.buffer[e+1]===`
|
|
124
|
+
`}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){let r=this.buffer[n+e+1];if(r===`
|
|
125
|
+
`||!r&&!this.atEnd)return e+n+1}return t===`
|
|
126
|
+
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&po(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
127
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){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 e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]==="\uFEFF"&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){let a=e[n-1];if(a===" "||a===" "){t=n-1;break}n=e.indexOf("#",n+1)}for(;;){let a=e[t-1];if(a===" "||a===" ")--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield"",yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&po(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!po(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&po(t)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);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(w0),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&r[0]!=="#"||n===0&&(r.startsWith("---")||r.startsWith("..."))&&po(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!=="]"&&r[0]!=="}"))return this.flowLevel=0,yield"",yield*this.parseLineStart();let a=0;for(;r[a]===",";)a+=yield*this.pushCount(1),a+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(a+=yield*this.pushIndicators(),r[a]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-a),"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,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(w0),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let s=this.charAt(1);if(this.flowKey||po(s)||s===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let a=0;for(;this.buffer[t-1-a]==="\\";)a+=1;if(a%2==0)break;t=this.buffer.indexOf('"',t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
|
|
128
|
+
`,this.pos);if(r!==-1){for(;r!==-1;){let a=this.continueScalar(r+1);if(a===-1)break;r=n.indexOf(`
|
|
129
|
+
`,a)}r!==-1&&(t=r-(n[r-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>po(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let a=this.pos;n=this.buffer[a];++a)switch(n){case" ":t+=1;break;case`
|
|
130
|
+
`:e=a,t=0;break;case"\r":{let s=this.buffer[a+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===`
|
|
131
|
+
`)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.indentNext=this.blockScalarIndent===-1?t:this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let a=this.continueScalar(e+1);if(a===-1)break;e=this.buffer.indexOf(`
|
|
132
|
+
`,a)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===" ";)n=this.buffer[++r];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
|
|
133
|
+
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let a=e-1,s=this.buffer[a];s==="\r"&&(s=this.buffer[--a]);let l=a;for(;s===" ";)s=this.buffer[--a];if(s===`
|
|
134
|
+
`&&a>=this.pos&&a+1+t>l)e=a;else break}while(!0);return yield"",yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===":"){let a=this.buffer[n+1];if(po(a)||e&&Pf.has(a))break;t=n}else if(po(r)){let a=this.buffer[n+1];if(r==="\r"&&(a===`
|
|
135
|
+
`?(n+=1,r=`
|
|
136
|
+
`,a=this.buffer[n+1]):t=n),a==="#"||e&&Pf.has(a))break;if(r===`
|
|
137
|
+
`){let s=this.continueScalar(n+1);if(s===-1)break;n=Math.max(n,s-2)}}else{if(e&&Pf.has(r))break;t=n}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield"",yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(w0),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,n=this.charAt(1);if(po(n)||t&&Pf.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!po(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(XR.has(t))t=this.buffer[++e];else if(t==="%"&&aj.has(this.buffer[e+1])&&aj.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
138
|
+
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
139
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},QR=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let a=t+n>>1;this.lineStarts[a]<e?t=a+1:n=a}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function mi(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function sj(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 lj(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Df(e){switch(e.type){case"document":return e.start;case"block-map":{let 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 Vs(e){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(;e[++t]?.type==="space";);return e.splice(t,e.length)}function Lf(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function dj(e){if(e.start.type==="flow-seq-start")for(let t of e.items)t.sep&&!t.value&&!mi(t.start,"explicit-key-ind")&&!mi(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,lj(t.value)?t.value.end?Lf(t.value.end,t.sep):t.value.end=t.sep:Lf(t.start,t.sep),delete t.sep)}var JR=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new GR,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=YR(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.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(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source})}else{if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&dj(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{let r=n.items[n.items.length-1];if(r.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(r.sep)r.value=t;else{Object.assign(r,{key:t,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=n.items[n.items.length-1];r.value?n.items.push({start:[],value:t}):r.value=t;break}case"flow-collection":{let r=n.items[n.items.length-1];!r||r.value?n.items.push({start:[],key:t,sep:[]}):r.sep?r.value=t:Object.assign(r,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let r=t.items[t.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&sj(r.start)===-1&&(t.indent===0||r.start.every(a=>a.type!=="comment"||a.indent<t.indent))&&(n.type==="document"?n.end=r.start:n.items.push({start:r.start}),t.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":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":sj(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=Vs(Df(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
140
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
141
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Lf(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",a=[];if(r&&t.sep&&!t.value){let s=[];for(let l=0;l<t.sep.length;++l){let f=t.sep[l];switch(f.type){case"newline":s.push(l);break;case"space":break;case"comment":f.indent>e.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(a=t.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(a.push(this.sourceToken),e.items.push({start:a}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(a.push(this.sourceToken),e.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(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(mi(t.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(lj(t.key)&&!mi(t.sep,"newline")){let s=Vs(t.start),l=t.key,f=t.sep;f.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:l,sep:f}]})}else a.length>0?t.sep=t.sep.concat(a,this.sourceToken):t.sep.push(this.sourceToken);else if(mi(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let s=Vs(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:a,key:null,sep:[this.sourceToken]}):mi(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);r||t.value?(e.items.push({start:a,key:s,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(s):(Object.assign(t,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!t.explicitKey&&t.sep&&!mi(t.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 n&&e.items.push({start:a});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Lf(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||mi(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:r,sep:[]}):t.sep?this.stack.push(r):Object.assign(t,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let r=Vs(Df(n));dj(e);let a=e.end.splice(1,e.end.length);a.push(this.sourceToken);let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
142
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
143
|
+
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){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;let t=Vs(Df(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Vs(Df(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){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;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function ez(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new QR||null,prettyErrors:t}}function tz(e,t={}){let{lineCounter:n,prettyErrors:r}=ez(t),a=new JR(n?.addNewLine),s=new WR(t),l=null;for(let f of s.compose(a.parse(e),!0,e.length))if(!l)l=f;else if(l.options.logLevel!=="silent"){l.errors.push(new _d(f.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(l.errors.forEach(GN(e,n)),l.warnings.forEach(GN(e,n))),l}function gi(e,t,n){let r;typeof t=="function"?r=t:n===void 0&&t&&typeof t=="object"&&(n=t);let a=tz(e,n);if(!a)return null;if(a.warnings.forEach(s=>CN(a.options.logLevel,s)),a.errors.length>0){if(a.options.logLevel!=="silent")throw a.errors[0];a.errors=[]}return a.toJS(Object.assign({reviver:r},n))}function nz(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"){let a=Math.round(n);n=a<1?void 0:a>8?{indent:8}:{indent:a}}if(e===void 0){let{keepUndefined:a}=n??t??{};if(!a)return}return Sd(e)&&!r?e.toString(n):new p0(e,r,n).toString(n)}var yi=class{text;constructor(e){this.text=e}},uj=class{items;constructor(e){this.items=e}};function k0(e,t){if(!e.includes(`
|
|
144
|
+
`)||/[\r\u0085\u2028\u2029\ufeff]/.test(e))return;for(let f=0;f<e.length;f++){let p=e.charCodeAt(f);if(p<32&&p!==10&&p!==9)return}let n=/\n*$/.exec(e)?.[0].length??0;if(n>1)return;let r=(n?e.slice(0,-1):e).split(`
|
|
145
|
+
`);if(/^[ \t]/.test(r[0]??"")||r.some(f=>f!==""&&f.trim()===""))return;let a=" ".repeat(Math.max(t,1)),s=n?"|":"|-",l=r.map(f=>f===""?"":a+f);try{if(gi(`k: ${s}
|
|
146
|
+
${l.join(`
|
|
147
|
+
`)}
|
|
148
|
+
`)?.k!==e)return}catch{return}return{indicator:s,lines:l}}var cj=e=>e instanceof yi?e.text:e,oz=/^[-?:,[\]{}#&*!|>'"%@`\s]/;function If(e){if(e===""||e!==e.trim()||/[\n\r\t]/.test(e)||oz.test(e)||e.includes(": ")||e.includes(" #")||e.endsWith(":"))return!1;try{return gi(e)===e&&(/^[yYnN]$/.test(e)||gi(e,{version:"1.1"})===e)}catch{return!1}}function rz(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n>=127&&n<=159||n===8232||n===8233)return!0}return!1}function Rf(e){return`'${e.replaceAll("'","''")}'`}function iz(e){let t="";for(let n of JSON.stringify(e)){let r=n.charCodeAt(0);t+=r>=127&&r<=159||r===8232||r===8233?`\\u${r.toString(16).padStart(4,"0")}`:n}return t}function S0(e,t){if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number"){if(!Number.isFinite(e))throw Error(`cannot render ${e}`);return String(e)}return rz(e)||t==="QUOTE_DOUBLE"?iz(e):t==="QUOTE_SINGLE"?Rf(e):If(e)?e:Rf(e)}function fj(e){return If(e)?e:Rf(e)}function hj(e){return typeof e!="object"||!e||e instanceof yi}function az(e){return Array.isArray(e)?e.length===0:typeof e=="object"&&!!e&&Object.keys(e).length===0}function N0(e,t){if(!(e instanceof yi&&k0(e.text,2))){if(e instanceof uj)return vi([...e.items]);if(hj(e))return S0(cj(e),t);if(az(e))return Array.isArray(e)?"[]":"{}"}}function pj(e){return If(e)&&/[,[\]{}]/.test(e)?Rf(e):e}function vi(e,t){return hj(e)?pj(S0(cj(e),t)):e instanceof uj?vi([...e.items]):Array.isArray(e)?`[${e.map(n=>vi(n)).join(", ")}]`:`{${Object.entries(e).map(([n,r])=>`${pj(fj(n))}: ${vi(r)}`).join(", ")}}`}function Io(e,t,n,r=!1){let a=" ".repeat(t),s=[],l=f=>{s.push(r&&s.length===0?f.slice(t):f)};if(Array.isArray(e)){for(let f of e){let p=f instanceof yi?S0(f.text):N0(f);if(p!==void 0){l(`${a}- ${p}`);continue}let h=Io(f,t+2,n,!0);l(`${a}- ${h[0]}`),s.push(...h.slice(1))}return s}for(let[f,p]of Object.entries(e)){let h=fj(f),v=p instanceof yi?k0(p.text,t+n.indentUnit):void 0;if(v){l(`${a}${h}: ${v.indicator}`),s.push(...v.lines);continue}let g=N0(p);if(g!==void 0){l(`${a}${h}: ${g}`);continue}l(`${a}${h}:`);let m=Array.isArray(p)&&n.seqIndentless?t:t+n.indentUnit;s.push(...Io(p,m,n))}return s}function Rt(e){let t=Number(e?.schema_version);return Number.isInteger(t)&&t>0?t:1}var mj=["id","key","type","title","status","tested","disabled","intent","condition","outcome","handler","purpose","join_mode","branches","ports","inputs","outputs","settings","approval","impl","undo","ref","origin","subflow"],sz=["id","key","kind","on","x","y","width","height","color","size","text"];function j0(e){return mj.slice(mj.indexOf(e)+1)}function Od(e){return e?.purpose??e?.handler}function C0(e){return e==="start"||e==="end"?{width:136,height:40}:e==="parallel"||e==="join"?{width:208,height:36}:{width:208,height:76}}var gj={width:200,height:120},yj={width:480,height:320},lz={s:13,m:18,l:26};function vj(e){let t=e.kind??"note";if(t==="note")return{width:e.width??gj.width,height:e.height??gj.height};if(t==="section")return{width:e.width??yj.width,height:e.height??yj.height};let n=lz[e.size??"m"],r=String(e.text??"").split(`
|
|
149
|
+
`),a=Math.max(1,...r.map(s=>s.length));return{width:e.width??Math.max(40,Math.round(a*n*.58)+8),height:e.height??Math.max(24,Math.round(r.length*n*1.35)+8)}}var bj={x:232,y:0},dz=e=>e.kind??"note";function uz(e,t,n={}){let r=[];for(let a of e.annotations){if(!a||typeof a!="object"||typeof a.id!="string")continue;let s=n[a.id]??{x:Number(a.x)||0,y:Number(a.y)||0},l=dz(a),f=l==="note"&&a.on?t.get(a.on):void 0;r.push({annotation:a,kind:l,position:f?{x:f.x+s.x,y:f.y+s.y}:s,...vj(a),...f?{on:a.on}:{}})}return r}var xj=(e,t)=>e.position.x>=t.position.x&&e.position.y>=t.position.y&&e.position.x+e.width<=t.position.x+t.width&&e.position.y+e.height<=t.position.y+t.height;function cz(e,t){let n=e.annotations.find(r=>r.annotation.id===t&&r.kind==="section");return n?{nodes:e.nodes.filter(r=>xj(r,n)).map(r=>r.node.id),annotations:e.annotations.filter(r=>r.annotation.id!==t&&!r.on&&xj(r,n)).map(r=>r.annotation.id)}:{nodes:[],annotations:[]}}var fz=(e,t,n)=>e.position.x<t.position.x+t.width+n&&t.position.x<e.position.x+e.width+n&&e.position.y<t.position.y+t.height+n&&t.position.y<e.position.y+e.height+n;function hz(e,t,n,r=16){let a={x:n.x-t.width/2,y:n.y-t.height/2},s=[];for(let l=-12;l<=12;l++)for(let f=-12;f<=12;f++)s.push({x:l*40,y:f*40});s.sort((l,f)=>Math.hypot(l.x,l.y)-Math.hypot(f.x,f.y));for(let l of s){let f={x:a.x+l.x,y:a.y+l.y};if(!e.some(p=>fz({position:f,...t},p,r)))return f}return a}function pz(e,t=24){if(e.length===0)return;let n=Math.min(...e.map(l=>l.position.x))-t,r=Math.min(...e.map(l=>l.position.y))-t-32,a=Math.max(...e.map(l=>l.position.x+l.width))+t,s=Math.max(...e.map(l=>l.position.y+l.height))+t;return{position:{x:Math.round(n),y:Math.round(r)},width:Math.round(a-n),height:Math.round(s-r)}}function mz(e,t){let n=new Set(e),r=1;for(;n.has(`${t}-${r}`);)r++;return`${t}-${r}`}function gz(e){let t={};for(let n of sz){let r=e[n];r!=null&&(t[n]=n==="text"?new yi(String(r)):r)}return t}var wj={left:"Align Left Edges",center:"Align Centers (Flow Line)",right:"Align Right Edges",top:"Align Top Edges",middle:"Align Middles",bottom:"Align Bottom Edges"},kj={vertical:"Distribute Vertically",horizontal:"Distribute Horizontally"},zf=e=>Math.round(e);function Sj(e,t){let n={};for(let r of e){let a=t(r),s={x:zf(a.x),y:zf(a.y)};(s.x!==r.x||s.y!==r.y)&&(n[r.id]=s)}return n}function yz(e,t){if(e.length<2)return{};let n=Math.min(...e.map(h=>h.x)),r=Math.max(...e.map(h=>h.x+h.width)),a=Math.min(...e.map(h=>h.y)),s=Math.max(...e.map(h=>h.y+h.height)),l=h=>e.reduce((v,g)=>v+h(g),0)/e.length,f=l(h=>h.x+h.width/2),p=l(h=>h.y+h.height/2);return Sj(e,h=>{switch(t){case"left":return{x:n,y:h.y};case"right":return{x:r-h.width,y:h.y};case"center":return{x:f-h.width/2,y:h.y};case"top":return{x:h.x,y:a};case"bottom":return{x:h.x,y:s-h.height};case"middle":return{x:h.x,y:p-h.height/2}}})}function vz(e,t){if(e.length<3)return{};let n=t==="vertical",r=g=>n?g.y:g.x,a=g=>n?g.height:g.width,s=[...e].sort((g,m)=>r(g)-r(m)||g.id.localeCompare(m.id)),l=s[0],f=s.at(-1),p=(r(f)+a(f)-r(l)-s.reduce((g,m)=>g+a(m),0))/(s.length-1),h=new Map,v=r(l);for(let g of s)h.set(g.id,v),v+=a(g)+p;return Sj(e,g=>n?{x:g.x,y:h.get(g.id)??g.y}:{x:h.get(g.id)??g.x,y:g.y})}function bz(e,t,n=6){let r=g=>t.flatMap(g),a=r(g=>[g.x,g.x+g.width/2,g.x+g.width]),s=r(g=>[g.y,g.y+g.height/2,g.y+g.height]),l=(g,m)=>{let b;for(let w of g)for(let k of m){let S=k-w;Math.abs(S)<=n&&(!b||Math.abs(S)<Math.abs(b.delta))&&(b={delta:S,line:k})}return b},f=l([e.x,e.x+e.width/2,e.x+e.width],a),p=l([e.y,e.y+e.height/2,e.y+e.height],s),h={...e,x:e.x+(f?.delta??0),y:e.y+(p?.delta??0)},v=(g,m)=>[...new Set(m.filter(b=>g.some(w=>Math.abs(w-b)<.5)))].sort((b,w)=>b-w);return{xs:v([h.x,h.x+h.width/2,h.x+h.width],a),ys:v([h.y,h.y+h.height/2,h.y+h.height],s),snap:{x:zf(h.x),y:zf(h.y)},...xz(h,t,n)}}function xz(e,t,n){for(let r of["vertical","horizontal"]){let a=r==="vertical",s=g=>a?g.x<e.x+e.width&&e.x<g.x+g.width:g.y<e.y+e.height&&e.y<g.y+g.height,l=g=>a?g.y:g.x,f=g=>a?g.y+g.height:g.x+g.width,p=t.filter(s),h=p.filter(g=>f(g)<=l(e)).sort((g,m)=>f(m)-f(g))[0],v=p.filter(g=>l(g)>=f(e)).sort((g,m)=>l(g)-l(m))[0];if(h&&v){let g=l(e)-f(h),m=l(v)-f(e);if(Math.abs(g-m)<=n)return{even:r}}}return{}}var E0=new Set(["failed_hosts","unreachable","timeout","rejected"]),Nj={start:["ok_hosts"],end:["in"],task:["in","ok_hosts","failed_hosts"],subflow:["in","ok_hosts","failed_hosts"],decision:["in","true","false"],approval:["in","approved","rejected"],join:["in","ok_hosts"]},jj=["unreachable","unchanged","always","cancelled","timeout","undo"],mo=new Set(["undo","cancelled"]),Ff={start:[],end:[],task:jj,subflow:jj,decision:[],approval:["timeout"],parallel:[],join:["failed_hosts"]},Cj=/^branch_([0-9]+)$/;function Ej(e){return e.branches&&e.branches>=2?e.branches:2}function $j(e){if(e.type==="parallel"){let t=["in"];for(let n=1;n<=Ej(e);n++)t.push(`branch_${n}`);return t}return[...Nj[e.type]]}var wz={start:["ok_hosts"],task:["ok_hosts"],subflow:["ok_hosts"],join:["ok_hosts"],decision:["true","false"],approval:["approved"]};function Bf(e){return e.type==="parallel"?Array.from({length:Ej(e)},(t,n)=>`branch_${n+1}`):wz[e.type]??[]}function _j(e){return Ff[e].filter(t=>!mo.has(t))}function qf(e){return e==="in"||e==="undo"?"in":"out"}function ha(e){return E0.has(e)}function kz(e){return e==="in"?"top":e==="undo"?"left":E0.has(e)||e==="cancelled"?"right":"bottom"}function Sz(e){switch(e){case"ok_hosts":return"ok";case"failed_hosts":return"failed";case"unreachable":case"timeout":return"unreachable";case"true":case"false":return"decision";case"approved":case"rejected":return"approval";case"undo":return"undo";default:return"neutral"}}function pa(e,t=!1){return{name:e,direction:qf(e),side:kz(e),tone:Sz(e),fail:E0.has(e),optional:t}}function Ks(e){let t=$j(e),n=Ff[e.type],r=t.map(a=>pa(a));for(let a of n)e.ports?.includes(a)&&!t.includes(a)&&r.push(pa(a,!0));for(let a of Tj(e))r.push(pa(a));return r}var Nz=new Set([...Object.values(Nj).flat(),...Object.values(Ff).flat(),"join"]);function jz(e){return/^[a-z][a-z0-9_]*$/.test(e)&&!Nz.has(e)&&!Cj.test(e)}function Tj(e){return e.type==="subflow"?Object.keys(e.subflow?.boundary?.outputs??{}).filter(jz):[]}var $0=["in","undo","always","ok_hosts","unchanged","true","false","approved","failed_hosts","rejected","unreachable","timeout","cancelled"];function Aj(e){let t=Cj.exec(e);if(t)return $0.indexOf("approved")+Number(t[1])/1e3;let n=$0.indexOf(e);return n>=0?n:$0.indexOf("unchanged")+.5}function Pd(e){let t=new Set(Ks(e).map(r=>r.name)),n=$j(e);return[...n,...Ff[e.type].filter(r=>!n.includes(r)&&(!mo.has(r)||t.has(r))),...Tj(e)].map(r=>({...pa(r,!n.includes(r)),enabled:t.has(r)})).sort((r,a)=>Aj(r.name)-Aj(a.name))}var Cz={task:"ok_hosts",subflow:"ok_hosts",join:"ok_hosts",decision:"true",approval:"approved",parallel:"branch_1"};function Mj(e,t,n=[]){let r={wires:[],exits:[],entries:[]},a=new Set(t.filter(f=>e.nodes.has(f))),s=new Set(n),l=new Set([...a].map(f=>e.nodes.get(f)?.level));for(let f of l){let p=e.levels.get(f);if(!p||p.parent&&Ez(e,p.parent,a))continue;let h=p.parent?e.nodes.get(p.parent)?.node:void 0,v=b=>$z(p,h,b,s),g=b=>{let w=new Set;for(let k=b;;){if(w.has(k))return;w.add(k);let S=e.nodes.get(k)?.node,N=S?v(S):void 0;if(!N)return;if(N.kind==="exit"||!a.has(N.to.node))return N;k=N.to.node}};for(let b of p.edges){if(!b?.from?.node||!b.to?.node||s.has(b.id)||a.has(b.from.node)||!a.has(b.to.node))continue;let w=g(b.to.node);w?.kind==="wire"?r.wires.push({edge:b.id,to:w.to}):w?.kind==="exit"&&r.exits.push({edge:b.id,subflow:w.subflow,port:w.port,from:{node:b.from.node,port:b.from.port},...w.reason?{reason:w.reason}:{}})}let m=h?.subflow?.boundary?.in;if(h&&m&&a.has(m)){let b=g(m);b?.kind==="wire"&&r.entries.push({subflow:h.id,node:b.to.node})}}return r}function Ez(e,t,n){for(let r=t;r;r=e.nodes.get(r)?.level){if(n.has(r))return!0;if(!e.nodes.has(r))return!1}return!1}function $z(e,t,n,r){let a=[];for(let s of Bf(n)){let l=e.edges.find(f=>f?.from?.node===n.id&&f.from.port===s&&!r.has(f.id));if(l?.to?.node)a.push({kind:"wire",to:{node:l.to.node,port:l.to.port}});else for(let[f,p]of Object.entries(t?.subflow?.boundary?.outputs??{})){let h=(p??[]).find(v=>v?.node===n.id&&v.port===s);h&&t&&a.push({kind:"exit",subflow:t.id,port:f,...h.reason?{reason:h.reason}:{}})}}return a.length===1?a[0]:void 0}function Oj(e){let t=e.wires.length+e.exits.length;if(t!==0||e.entries.length!==0)return t===0?"The subflow now starts at the next step":`Reconnected ${t} wire${t===1?"":"s"} across the gap`}function Pj(e,t,n){let r=e.nodes.get(t);if(!r)return"No such node";let a=Cz[r.node.type];if(!a)return`A ${r.node.type} node cannot sit on a wire`;let s=e.levels.get(r.level),l=s?.edges??[];if(l.some(p=>p?.to?.node===t))return"The node is already wired into a path";if(l.some(p=>p?.from?.node===t&&p.from.port===a))return`The node's ${a} is already wired`;let f=s?.parent?e.nodes.get(s.parent)?.node:void 0;if(f?.subflow?.boundary?.in===t)return"The node is the entry of the subflow";for(let p of Object.values(f?.subflow?.boundary?.outputs??{}))if((p??[]).some(h=>h?.node===t&&h.port===a))return`The node's ${a} already leaves the subflow`;if(n){let p=e.edges.get(n);if(!p)return"No such wire";if(p.level!==r.level)return"The node and the wire must be in the same level";if(p.edge.from.node===t||p.edge.to.node===t)return"The wire already touches the node"}}var on="root",_z={builds:0},Dj=new WeakMap;function Ee(e){let t=Dj.get(e);return t||(t=Ro(e),Dj.set(e,t)),t}function Ro(e){_z.builds++;let t={doc:e,levels:new Map,nodes:new Map,edges:new Map,annotations:new Map};return Lj(t,on,void 0,[],e),t}function Lj(e,t,n,r,a){let s=Array.isArray(a.nodes)?a.nodes:[],l=Array.isArray(a.edges)?a.edges:[],f=Array.isArray(a.annotations)?a.annotations:[],p=[...r,"nodes"],h=[...r,"edges"],v=[...r,"annotations"];e.levels.set(t,{id:t,parent:n,nodesPath:p,edgesPath:h,annotationsPath:v,nodes:s,edges:l,annotations:f}),s.forEach((g,m)=>{if(!g||typeof g!="object")return;let b=[...p,m];typeof g.id=="string"&&(e.nodes.has(g.id)||e.nodes.set(g.id,{node:g,level:t,path:b}),g.subflow&&typeof g.subflow=="object"&&Lj(e,g.id,g.id,[...b,"subflow"],g.subflow))}),l.forEach((g,m)=>{g&&typeof g=="object"&&typeof g.id=="string"&&(e.edges.has(g.id)||e.edges.set(g.id,{edge:g,level:t,path:[...h,m]}))}),f.forEach((g,m)=>{g&&typeof g=="object"&&typeof g.id=="string"&&(e.annotations.has(g.id)||e.annotations.set(g.id,{annotation:g,level:t,path:[...v,m]}))})}function Tz(e,t){let n=new Map,r=e.levels.get(t);for(;r;){for(let a of r.nodes)a&&!n.has(a.key)&&n.set(a.key,a.id);r=r.parent?e.levels.get(e.nodes.get(r.parent)?.level??""):void 0}return n}var Az=["rollback","notify-stop","exclude","retry","stop","done","escalate","report"],Hf={rollback:{id:"rollback",label:"Rollback from Backup",hint:"Undo the completed nodes for the failed hosts only (reuses the Rollback of this level)",accepts:["failed_hosts"],palette:!0},"notify-stop":{id:"notify-stop",label:"Notify On-Call and Stop",hint:"Open a ticket, page on-call, end these hosts as stopped",accepts:["failed_hosts","unreachable","timeout","rejected"],palette:!0},retry:{id:"retry",label:"Retry",hint:"Try the step again, up to 3 more times 10 s apart, before hosts leave by this port",accepts:["failed_hosts","timeout"],types:["task"],bindings:["module"],palette:!0},exclude:{id:"exclude",label:"Exclude and Report",hint:"Take these hosts out of the run and list them in the report",accepts:["failed_hosts","unreachable"],palette:!0},stop:{id:"stop",label:"Stop Flow",hint:"End these hosts with a failed outcome",accepts:["failed_hosts","unreachable","timeout","rejected"],palette:!1},done:{id:"done",label:"Connect to Done",hint:"End these hosts with a success outcome",accepts:["ok_hosts","unchanged","approved","true","false"],palette:!1},escalate:{id:"escalate",label:"Escalate Approval",hint:"Ask the next approver; approved hosts rejoin the happy path",accepts:["rejected","timeout"],types:["approval"],palette:!1},report:{id:"report",label:"Send Run Report",hint:"Send per-host results after the step, whatever the outcome",accepts:["always"],palette:!1}};function _0(e,t,n){let r=Hf[e];return r.types&&!r.types.includes(t.type)||r.bindings&&t.impl&&!r.bindings.includes(t.impl.kind)?!1:r.accepts.includes(n)||r.accepts.includes("ok_hosts")&&/^branch_[0-9]+$/.test(n)}function Ij(e){return(e?.type==="task"||e?.type==="subflow")&&(Od(e)==="rollback"||e.key==="rollback")}function Rj(e,t){return e.nodes.find(n=>n?.id!==t&&Ij(n))}function*zo(e){for(let t of e??[])t&&typeof t=="object"&&(yield t,t.subflow&&typeof t.subflow=="object"&&(yield*zo(t.subflow.nodes)))}function zj(e){return(e.subflow?.nodes??[]).flatMap(t=>t?.id?[t.id,...zj(t)]:[])}function ma(e){if(Array.isArray(e))return e.map(ma);if(typeof e=="object"&&e){let t={};for(let n of Object.keys(e).sort())t[n]=ma(e[n]);return t}return e}function Fj(e){let{status:t,tested:n,approval:r,handler:a,subflow:s,ports:l,...f}=e,p=a!==void 0&&f.purpose===void 0?{...f,purpose:a}:f,h=l?.filter(w=>!mo.has(w));if(h?.length&&(p.ports=h),!s||typeof s!="object")return p;let{layout:v,annotations:g,nodes:m,...b}=s;return{...p,subflow:{...b,nodes:(m??[]).map(Fj)}}}function Mz(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")}function Oz(e){let t={};for(let n of zo(e.nodes))t[n.id]=Mz(JSON.stringify(ma(Fj(n))));return t}function Vf(e,t){let n=Ee(e);for(let r=t;r!=="root";){let a=n.nodes.get(r);if(!a)return;if(a.node.ref)return a.node;r=a.level}}function Kf(e,t){let n=new Map,r=a=>{let s=n.get(a);return s||(s={host:a,ports:[]},n.set(a,s)),s};for(let[a,s]of Object.entries(e.nodes[t]??{}))for(let l of s)r(l).ports.push(a);for(let[a,s]of Object.entries(e.problems?.[t]??{}))r(a).problem=s;for(let a of e.failures)a.node===t&&(r(a.host).problem??={task:a.task,status:"failed",msg:a.msg});return[...n.values()].sort((a,s)=>a.host.localeCompare(s.host))}function Pz(e,t){let n=Kf(e,t),r=e.timings?.[t],a=r?r.end-r.start:void 0;if(n.length===0)return{state:r?"ok":"idle",hosts:0,failed:0,seconds:a};let s=e.failures.some(f=>f.node===t),l=n.filter(f=>f.ports.length===0||f.ports.some(ha)).length;return{state:s?"failed":l>0?"warn":"ok",hosts:n.length,failed:l,seconds:a}}function Bj(e,t,n){return e.nodes[t]?.[n]??[]}function T0(e,t,n){return e.nodes.get(n.from.node)?.node.type==="start"?t.hosts:Bj(t,n.from.node,n.from.port)}function Wf(e,t,n){let r=e.levels.get(e.nodes.get(n)?.level??""),a=new Set;for(let s of r?.edges??[])if(s.to.node===n)for(let l of T0(e,t,s))a.add(l);return[...a].sort()}function Dz(e,t){let n=Ee(e),r={};for(let{node:a}of n.nodes.values())if(a.type==="start"){let s=t.hosts.length;r[a.id]={state:s>0?"ok":"idle",hosts:s,failed:0}}else if(a.type==="end"){let s=Wf(n,t,a.id).length,l=a.outcome==="failed"?s:0;r[a.id]={state:s===0?"idle":l?"failed":"ok",hosts:s,failed:l}}else r[a.id]=Pz(t,a.id);for(let a=t.running;a&&a!=="root";a=n.nodes.get(a)?.level){let s=r[a];s&&(r[a]={...s,state:"running"})}return r}function Ut(e){if(e===void 0)return"";if(e<1)return"<1 s";if(e<60)return`${e.toFixed(+(e<10))} s`;let t=Math.floor(e/60);return`${t} min ${String(Math.round(e-t*60)).padStart(2,"0")} s`}function qj(e){let t=e.summary,n=t?Object.keys(t.outcome).length+t.failures.length:0;return{ok:e.rc===0&&n===0&&!t?.stoppedEarly,failed:n}}function Hj(e){let t=e?.summary;return!!e&&!!t&&e.state==="done"&&e.mode==="real"&&e.rc===0&&!t.stoppedEarly&&t.failures.length===0&&Object.keys(t.outcome).length===0}function Lz(e,t){if(!t||!Hj(t)||t.flowVersion!==e.flow.version)return[];let n=t.summary,r=t.design?Oz(e):void 0;return[...Ee(e).nodes.values()].map(a=>a.node).filter(a=>a.status==="implemented"&&(n.nodes[a.id]||n.timings?.[a.id])&&(!r||t.design?.[a.id]===r[a.id])).map(a=>a.id)}var Vj=44,Iz=28,Kj={view:{nodes:[],edges:[],annotations:[]},shift:{},inner:{},frames:new Set};function Rz(e,t,n){let r=e.nodes.filter(b=>b.node.type==="subflow"&&n.includes(b.node.id));if(r.length===0)return{...Kj,view:e};let a=[...r].sort((b,w)=>b.position.y-w.position.y).map(b=>b.node.id),s=new Map(e.nodes.map(b=>[b.node.id,{...b}])),l={},f=(b,w,k)=>{let S=s.get(b);if(!S||w===0&&k===0)return;S.position={x:S.position.x+w,y:S.position.y+k};let N=l[b]??{x:0,y:0};l[b]={x:N.x+w,y:N.y+k}},p={},h=new Set,v=[],g=[];for(let b of a){let w=s.get(b),k=t(b);if(!w||k.nodes.length===0)continue;let S=Math.min(...k.nodes.map(B=>B.position.x)),N=Math.min(...k.nodes.map(B=>B.position.y)),E=Math.max(...k.nodes.map(B=>B.position.x+B.width)),j=Math.max(...k.nodes.map(B=>B.position.y+B.height)),$=Math.max(w.width,E-S+56),L=j-N+Vj+Iz,z=$-w.width,A=L-w.height,M={...w.position,width:w.width,height:w.height},O=M.x+M.width/2;for(let B of s.values()){if(B.node.id===b)continue;let V=B.position.y>=M.y+M.height,oe=!V&&B.position.y+B.height>M.y&&B.position.y<M.y+L;V?f(B.node.id,0,A):oe&&f(B.node.id,B.position.x+B.width/2>=O?z/2:-z/2,0)}f(b,-z/2,0),w.width=$,w.height=L,h.add(b);let K={x:($-(E-S))/2-S,y:Vj-N};for(let B of k.nodes)p[B.node.id]=b,v.push({node:B,frame:b,rel:{x:B.position.x+K.x,y:B.position.y+K.y}});for(let B of k.edges)g.push({...B,inner:!0})}if(h.size===0)return{...Kj,view:e};let m=v.map(({node:b,frame:w,rel:k})=>{let S=s.get(w).position;return{...b,position:{x:S.x+k.x,y:S.y+k.y}}});return{view:{nodes:[...e.nodes.map(b=>s.get(b.node.id)),...m],edges:[...e.edges,...g],annotations:e.annotations},shift:l,inner:p,frames:h}}var zz=.8,A0={padding:.15,maxZoom:1};function Fz(e,t,n=e.x+e.width/2){let r={width:Math.max(1,t.width-64),height:Math.max(1,t.height-64)},a=Math.max(1,e.width),s=Math.max(1,e.height),l=Math.min(r.width/a,r.height/s,1);if(l>=.8)return{zoom:l,x:(t.width-a*l)/2-e.x*l,y:(t.height-s*l)/2-e.y*l};let f=Math.max(zz,Math.min(r.width/a,1)),p=32-e.y*f;if(a*f<=r.width)return{zoom:f,x:(t.width-a*f)/2-e.x*f,y:p};let h=t.width/2-n*f,v=32-e.x*f,g=t.width-32-(e.x+a)*f;return{zoom:f,x:Math.min(v,Math.max(g,h)),y:p}}var Wj={width:440,height:240};function Bz(e,t=Wj,n=32){return{x:e.x+e.width/2-t.width/2,y:e.y+e.height+n,...t}}function qz(e,t){let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x+e.width,t.x+t.width)-n,height:Math.max(e.y+e.height,t.y+t.height)-r}}var Hz={width:160,height:110,margin:15};function Vz(e,t,n=!1,r=Hz){let a=l=>({x:r.margin,y:l,width:r.width,height:r.height}),s=l=>!e.some(f=>f.x<l.x+l.width&&f.x+f.width>l.x&&f.y<l.y+l.height&&f.y+f.height>l.y);return!n&&s(a(t.height-r.margin-r.height))?"bottom-left":s(a(r.margin))?"top-left":null}var Kz=["port","drift","lens","check"],Wz=(e,t)=>`${e}:${t}`;function Uz(e){let t=e.indexOf(":"),n=e.slice(0,t);return t>0&&Kz.includes(n)?{area:n,what:e.slice(t+1)}:void 0}function Uj(e,t){if(!e||typeof e!="object")return;let n={index:t,...e.node?{node:e.node}:{},...e.reason===void 0?{}:{reason:e.reason},...e.by?{by:e.by}:{},..."at"in e&&e.at?{at:e.at}:{}};switch(e.kind){case"open_on_purpose":return{...n,area:"port",what:e.port};case"drift_ignored":return{...n,area:"drift",what:e.item};case"finding_accepted":return{...n,area:"lens",what:e.finding};case"accepted":{let r=Uz(e.finding);return r?{...n,...r}:void 0}default:return}}function Ws(e){return(e.decisions??[]).flatMap((t,n)=>Uj(t,n)??[])}function Yz(e){return{kind:"accepted",...e.node?{node:e.node}:{},finding:Wz(e.area,e.what),...e.reason===void 0?{}:{reason:e.reason},...e.by?{by:e.by}:{},...e.at?{at:e.at}:{}}}function Xz(e){let t=e.levels.get(on);if(!t)return;let n=t.nodes.filter(g=>!!g&&typeof g=="object"),r=new Map(n.map(g=>[g.id,g])),a=[];for(let{node:g,level:m}of e.nodes.values())g.type==="approval"&&m!=="root"&&a.push({node:g.id,message:`"${g.title}" is inside a subflow: runs that wait for a person (AWX workflows, Ansible Flow Server) split at top-level approvals only`});let s=n.filter(g=>g.type==="approval");if(s.length===0&&a.length===0)return;if(s.length===0)return{segments:[],problems:a};let l=new Map;for(let g of t.edges)g?.from?.node&&r.has(g.to?.node)&&l.set(g.from.node,[...l.get(g.from.node)??[],g]);let f=g=>{let m=new Set,b=g.flatMap(w=>(l.get(w.node)??[]).filter(k=>k.from.port===w.port).map(k=>k.to.node));for(;b.length>0;){let w=b.pop();if(!m.has(w)&&(m.add(w),r.get(w)?.type!=="approval"))for(let k of l.get(w)??[])b.push(k.to.node)}return m},p=[],h=(g,m,b,w)=>{if(p.length>=32)return;let k=n.filter(j=>j.type==="approval"&&m.has(j.id)).map(j=>j.id);k.length>1&&a.push({node:k[0],message:`${k.map(j=>`"${r.get(j)?.title}"`).join(" and ")} can wait for approval at the same time: a run that waits for a person (AWX workflow, Ansible Flow Server) waits at one approval at a time`});let S={name:g,nodes:m,entry:b,parent:w,gate:k[0]};p.push(S);let N=k.length===1?r.get(k[0]):void 0;if(!N)return;let E=g==="start"?"":`${g}_`;h(`${E}${N.key}-approved`,f([{node:N.id,port:"approved"}]),{approval:N.id,outcome:"approved"},g),h(`${E}${N.key}-rejected`,f([{node:N.id,port:"rejected"},{node:N.id,port:"timeout"}]),{approval:N.id,outcome:"rejected"},g)},v=n.find(g=>g.type==="start");return h("start",v?f([{node:v.id,port:"ok_hosts"}]):new Set),p.length>=32&&a.push({message:"The approvals split the flow into more than 32 segments"}),p.push({name:"finish",nodes:new Set,finish:!0}),{segments:p,problems:a}}var Zz=["start","end","task","subflow","decision","approval","parallel","join"],Yj=["draft","specified","implemented","tested"],Xj=["yellow","blue","green","pink","purple","gray"],Zj=e=>Yj.indexOf(e);function Us(e){return e.type!=="start"&&e.type!=="end"}function Uf(e){return(e.subflow?.nodes??[]).filter(t=>!!t&&typeof t=="object"&&Us(t))}function Gz(e){return e.type==="decision"?!!e.condition?.trim():e.type==="approval"||e.type==="parallel"||e.type==="join"}function Dd(e){let t=e.type==="subflow"?Uf(e):[];return t.length>0?Gj(t.map(n=>n.status??"draft")):e.impl||Gz(e)?"implemented":Object.keys(e.inputs??{}).length+Object.keys(e.outputs??{}).length>0?"specified":"draft"}function Gj(e){return e.reduce((t,n)=>Zj(n)<Zj(t)?n:t,"tested")}function Qz(e,t){return Rt(e)<2||!!t.tested}function M0(e,t){let n=Dd(t);return Uf(t).length>0?n:t.status==="tested"&&n==="implemented"&&Qz(e,t)?"tested":n}function Qj(e,t){return Us(t)&&Uf(t).length===0&&Dd(t)==="implemented"&&M0(e,t)!=="tested"}function Jz(e,t){if(Us(t)){if(Uf(t).length>0)return M0(e,t)==="tested"?void 0:"A subflow is as far as its least finished step";switch(M0(e,t)){case"draft":return t.type==="decision"?"Write the condition to make it implemented":"Define at least one input or output to make it specified";case"specified":return t.type==="decision"?"Write the condition to make it implemented":"Bind a module, role or playbook to make it implemented";case"implemented":return"A passing real run of this flow version makes it tested (or Mark Tested\u2026 with a reason)";default:return}}}function O0(e){let t=e.doc.flow?.runtime;if(Rt(e.doc)<2)return t?.kind;if(!t?.template)return"ansible_playbook";let n=Xz(e);return n&&n.problems.length===0&&n.segments.length>0?"awx_workflow":"awx_job"}var P0={start:"Start",end:"End",task:"Task",subflow:"Subflow",decision:"Decision",approval:"Approval",parallel:"Parallel",join:"Join"},Jj=/^\{\{-?\s*([A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_][A-Za-z0-9_]*)*)\s*-?\}\}$/,e4=/\{\{[\s\S]*?\}\}/g;function t4(e){let t=[],n=0;for(let r of e.matchAll(e4)){let a=r.index??0,s=Jj.exec(r[0])?.[1];s&&(a>n&&t.push({text:e.slice(n,a)}),t.push({ref:s,raw:r[0]}),n=a+r[0].length)}return(n<e.length||t.length===0)&&t.push({text:e.slice(n)}),t}function n4(e){return e.map(t=>"ref"in t?`{{ ${t.ref} }}`:t.text).join("")}var o4=new Set(["and","or","not","in","is","if","else","true","false","none","True","False","None"]);function D0(e){let t=[],n=0,r="";for(;n<e.length;){let a=e[n]??"";if(a==="'"||a==='"'){let l=e.indexOf(a,n+1);n=l<0?e.length:l+1,r="str";continue}let s=/^[A-Za-z_][A-Za-z0-9_]*/.exec(e.slice(n));if(s){let l=s[0],f=e.slice(n+l.length).trimStart(),p=f.startsWith("=")&&!f.startsWith("=="),h=f.startsWith("(");r==="."||r==="|"||r==="is"||p||h||o4.has(l)||t.push({name:l,start:n}),r=l==="is"||l==="not"&&r==="is"?"is":"id",n+=l.length}else/\s/.test(a)||(r=a),n++}return t}var r4=/\{\{([\s\S]*?)\}\}|\{%-?([\s\S]*?)-?%\}/g,i4=/\{#[\s\S]*?#\}/g,eC=/[A-Za-z_][A-Za-z0-9_]*/g;function a4(e){let t=/^\s*([a-z_]+)\b/.exec(e);if(!t)return{reads:[],binds:[]};let n=t[1],r=t[0].length,a=e.slice(r),s=(l,f)=>D0(l).map(p=>({name:p.name,start:p.start+f}));switch(n){case"if":case"elif":case"do":return{reads:s(a,r),binds:[]};case"set":{let l=/^\s*([A-Za-z_][\w]*(?:\s*,\s*[A-Za-z_]\w*)*)\s*(?=[=]|$)/.exec(a),f=a.indexOf("="),p=f<0?[]:s(a.slice(f+1),r+f+1);return l?{reads:p,binds:l[1]?.match(eC)??[]}:{reads:[...s(a.slice(0,f<0?void 0:f),r),...p],binds:[]}}case"for":{let l=/^\s*\(?\s*([\w\s,]+?)\s*\)?\s+in\s/.exec(a);if(!l)return{reads:s(a,r),binds:[]};let f=r+l[0].length;return{reads:s(e.slice(f),f).filter(p=>p.name!=="recursive"),binds:l[1]?.match(eC)??[]}}case"with":{let l=[...a.matchAll(/([A-Za-z_]\w*)\s*=(?!=)/g)].map(f=>f[1]);return{reads:s(a,r),binds:l}}case"macro":{let l=/^\s*([A-Za-z_]\w*)\s*\(([^)]*)\)/.exec(a),f=(l?.[2]??"").split(",").map(p=>p.split("=")[0]?.trim()??"");return{reads:[],binds:[l?.[1]??"",...f].filter(Boolean)}}default:return{reads:[],binds:[]}}}function tC(e){let t=[],n=new Set;for(let r of e.replaceAll(i4,"").matchAll(r4)){if(r[1]!==void 0){for(let s of D0(r[1]))t.includes(s.name)||t.push(s.name);continue}let a=a4(r[2]??"");for(let s of a.binds)n.add(s);for(let s of a.reads)t.includes(s.name)||t.push(s.name)}return n.size?t.filter(r=>!n.has(r)):t}function Yf(e){return typeof e=="string"&&/^\s*\{\{[\s\S]*\}\}\s*$/.test(e)}function L0(e){if(typeof e!="string")return;let t=Jj.exec(e.trim())?.[1];return t&&!t.includes(".")?t:void 0}function Xf(e,t){return typeof e=="string"?t(e):Array.isArray(e)?e.map(n=>Xf(n,t)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([n,r])=>[n,Xf(r,t)])):e}function I0(e){let t=new Set;return Xf(e,n=>{for(let r of tC(n))t.add(r);return n}),[...t]}function nC(e){let t=new Set;return Xf(e,n=>{let r=n.includes("{{")?tC(n):D0(n).map(a=>a.name);for(let a of r)t.add(a);return n}),[...t]}var s4="when.changed_when.failed_when.loop.loop_control.ignore_errors.delegate_to.delegate_facts.run_once.no_log.check_mode.diff.environment.become_user.become_method.become_flags.become_exe.connection.remote_user.port.throttle.async.poll.vars.module_defaults.debugger".split("."),Zf=/^with_[a-z_]+$/,l4=new Set(["when","changed_when","failed_when"]),d4={assert:["that"],debug:["var"]};function u4(e,t){return(d4[(e??"").replace(/^ansible\.(builtin|legacy)\./,"")]??[]).includes(t)}var c4=new Set(["when","loop","loop_control"]),f4={name:"the node title",register:"impl.register",tags:"settings.tags",become:"settings.become",timeout:"settings.timeout",retries:"settings.retries",delay:"settings.delay",until:"settings.until",notify:"a handler step with when: <register> is changed",listen:"a handler step with when: <register> is changed",ignore_unreachable:"the unreachable port",block:"a subflow",rescue:"a failure path from failed_hosts",always:"the always port or a step after both paths",action:"impl.ref and impl.params",local_action:"impl.ref with delegate_to: localhost",args:"impl.params",any_errors_fatal:"settings.max_fail_percentage: 0",collections:"a fully qualified impl.ref"};function h4(e){return s4.includes(e)||Zf.test(e)}function p4(e){if(h4(e))return;let t=f4[e];return t?`${e} is modelled by the flow: use ${t}`:`${e} is not a task keyword a binding can carry`}function m4(e){let t=Object.keys(e?.keywords??{});return[t.includes("when")?"when":"",t.some(n=>n==="loop"||Zf.test(n))?"loop":""].filter(Boolean).join(" + ")}var g4=new Set(["ok_hosts","approved","in"]);function oC(e){return!g4.has(e)}function y4(e){return e.kind==="exit"&&(!!e.exit?.reason||oC(e.exit?.port??"ok_hosts"))}function R0(e){return e.disabled?"Disabled \xB7 hosts pass through":e.type==="decision"?e.condition?`if ${e.condition}`:"Decision":[e.impl?.ref??(e.type==="task"?`${P0.task} \xB7 not implemented yet`:P0[e.type]),e.ref?`shared v${e.ref.version}`:void 0,Od(e),m4(e.impl)].filter(Boolean).join(" \xB7 ")}var Fo=(e,t=Hf[e].label)=>({kind:"pattern",label:t,hint:Hf[e].hint,pattern:e});function v4(e,t,n,r){let a=[],s=l=>_0(l,t,n);if(s("rollback")){let l=e.levels.get(r),f=l?Rj(l,t.id):void 0;f?a.push(Fo("rollback",`${f.title} (existing)`)):Ij(t)||a.push(Fo("rollback"))}return s("notify-stop")&&a.push(Fo("notify-stop",n==="rejected"?"Notify requester and stop":void 0)),s("exclude")&&a.push(Fo("exclude")),s("retry")&&a.push(Fo("retry")),s("escalate")&&a.push(Fo("escalate")),s("stop")&&a.push(Fo("stop")),a}function b4(e,t){switch(t){case"unchanged":return[Fo("done","Skip to Done"),{kind:"pick",label:"Skip to Another Node\u2026",mode:"to"}];case"always":return[{kind:"quickAdd",label:"Cleanup Task",title:"Cleanup"},Fo("report"),{kind:"pick",label:"Connect to Another Node\u2026",mode:"to"}];case"cancelled":return[];default:{let n=[{kind:"quickAdd",label:"Add Next Node"}];return _0("done",e,t)&&n.push(Fo("done",t==="false"?"Skip to Done":"Connect to Done")),n.push({kind:"pick",label:"Connect to Another Node\u2026",mode:"to"}),n}}}function Ld(e,t){let n=e.nodes.get(t.node);if(!n)return;let{node:r,level:a}=n,s=Pd(r).find(v=>v.name===t.port);if(!s)return;let l=e.levels.get(a)?.edges??[],f=(e.doc.decisions??[]).some(v=>v?.node===t.node&&v.port===t.port),p=[];if(qf(t.port)==="in"){let v=l.filter(g=>g?.to?.node===t.node&&g.to.port===t.port);t.port!=="undo"&&p.push({kind:"pick",label:"Connect from Another Node\u2026",mode:"from"});for(let g of v){let m=e.nodes.get(g.from.node)?.node;p.push({kind:"disconnect",label:`Disconnect from ${m?.title??g.from.node} \xB7 ${g.from.port}`,edge:g.id})}return s.enabled?s.optional&&v.length===0&&p.push({kind:"disable",label:"Remove Port"}):p.unshift({kind:"enable",label:"Enable Port"}),{ref:t,node:r,enabled:s.enabled,connected:v.length>0,decided:f,items:p}}let h=l.find(v=>v?.from?.node===t.node&&v.from.port===t.port);return h?(p.push({kind:"insert",label:"Insert Node on This Wire",edge:h.id},{kind:"pick",label:"Rewire to Another Node\u2026",mode:"rewire",edge:h.id},{kind:"disconnect",label:"Disconnect",edge:h.id}),{ref:t,node:r,enabled:!0,connected:!0,decided:f,items:p}):(ha(t.port)?(p.push(...v4(e,r,t.port,a)),p.push({kind:"pick",label:"Connect to Another Node\u2026",mode:"to"}),f?p.push({kind:"decide",label:"Edit Reason\u2026"},{kind:"reopen",label:"Reopen"}):s.enabled&&p.push({kind:"decide",label:"Accept with Reason\u2026"})):p.push(...b4(r,t.port)),s.enabled?s.optional&&!f&&p.push({kind:"disable",label:"Remove Port"}):p.unshift({kind:"enable",label:"Enable Port"}),{ref:t,node:r,enabled:s.enabled,connected:!1,decided:f,items:p})}function Gf(e,t){let n=e.nodes.get(t);if(!n)return;let r=e.levels.get(n.level)?.edges??[],a=p=>r.find(h=>h?.from?.node===t&&h.from.port===p),s=Bf(n.node),l=s.find(p=>!a(p));if(l)return{port:l};let f=s[0]?a(s[0]):void 0;return f&&s[0]?{port:s[0],insertOn:f.id}:void 0}function rC(e,t){let n=e.nodes.get(t);if(!n)return;let r=e.levels.get(n.level)?.edges??[],a=l=>r.some(f=>f?.from?.node===t&&f.from.port===l),s=Pd(n.node).filter(l=>l.direction==="out"&&!l.fail&&l.name!=="cancelled"&&!a(l.name));return(s.find(l=>l.enabled)??s[0])?.name}function x4(e,t,n,r){let a=e.nodes.get(t);if(!a)return;let s=e.levels.get(a.level)?.edges??[],l=p=>s.some(h=>h?.from?.node===t&&h.from.port===p),f=Pd(a.node).filter(p=>p.direction==="out"&&_0(n,a.node,p.name)&&!l(p.name));return r&&f.some(p=>p.name===r)?r:(f.find(p=>p.enabled)??f[0])?.name}function w4(e,t,n){let r=a=>n.mode==="attach"?!0:n.mode==="from"?rC(e,a.id)!==void 0:Ks(a).some(s=>s.name==="in");return t.filter(({node:a})=>a.id!==n.node&&r(a)).sort((a,s)=>a.position.y-s.position.y||a.position.x-s.position.x).map(({node:a})=>a.id)}function k4(e,t,n){if(e.length===0)return;let r=t?e.indexOf(t):-1;return r<0?n>0?e[0]:e.at(-1):e[(r+n+e.length)%e.length]}var iC=e=>{let t,n=new Set,r=(f,p)=>{let h=typeof f=="function"?f(t):f;if(!Object.is(h,t)){let v=t;t=p??(typeof h!="object"||!h)?h:Object.assign({},t,h),n.forEach(g=>g(t,v))}},a=()=>t,s={setState:r,getState:a,getInitialState:()=>l,subscribe:f=>(n.add(f),()=>n.delete(f))},l=t=e(r,a,s);return s},S4=(e=>e?iC(e):iC),N4=e=>e;function j4(e,t=N4){let n=T.useSyncExternalStore(e.subscribe,T.useCallback(()=>t(e.getState()),[e,t]),()=>t(e.getInitialState()));return T.useDebugValue(n),n}var aC=e=>{let t=S4(e),n=r=>j4(t,r);return Object.assign(n,t),n},C4=(e=>e?aC(e):aC),E4=new WeakMap;function $4(e,t){let n=new Map;for(let r of e){let a=r?.from?.node,s=r?.to?.node;if(!a||!s)continue;let[l,f]=t?[a,s]:[s,a],p=n.get(l);p?p.push(f):n.set(l,[f])}return{size:e.length,map:n}}function _4(e,t,n){let r=e.get(t);return r&&r.size===t.length||(r=$4(t,n),e.set(t,r)),r.map}function T4(e,t){return _4(E4,e,!1).get(t)??[]}function z0(e,t){let n=[],r=t;for(;r&&r!=="root";){let a=e.nodes.get(r);if(!a)break;n.push(a.node),r=a.level}return n}function sC(e,t){let n=(e.subflow?.nodes??[]).filter(s=>!!s?.key),r=e.outputs?.[t]?.from;if(r){let[s,l,...f]=r.split("."),p=n.find(h=>h.key===s);return p&&l?{inner:p,output:l,path:f}:void 0}if(!e.outputs||!(t in e.outputs))return;let a=n.filter(s=>s.outputs&&t in s.outputs);return a.length===1?{inner:a[0],output:t,path:[]}:a.length>1?{ambiguous:a.map(s=>s.key)}:void 0}function lC(e){let t=Object.keys(e??{});return t.length?` (it has ${t.join(", ")})`:" (it has none)"}function A4(e,t,n,r){return r==="outputs"&&e.levels.has(t.id)?t.id:n}function F0(e,t,n,r,a){let[s="",l="",...f]=a.trim().split(".");if(s==="flow")return l in(e.doc.flow?.inputs??{})?{kind:"flow",name:l,path:f}:{kind:"unresolved",why:`the flow has no input ${l}`};if(s==="impl")return{kind:"impl",path:[l,...f].filter(Boolean)};if(s.includes("/")){let[m="",...b]=s.split("/");return{kind:"unresolved",why:`reads a step inside subflow ${m}; from outside, read what ${m} lifts: give ${m} an output ${l} (from: ${b.join("/")}.${l}) and read ${m}.${l} (the AI tools and the @ picker lift it for you)`}}let p=A4(e,t,n,r),h=Tz(e,p).get(s),v=h?e.nodes.get(h)?.node:void 0;if(!v)return{kind:"unresolved",why:`no node "${s}" on this level or around it`};if(z0(e,p).some(m=>m.id===v.id)){let m=v.inputs?.[l];return m?{kind:"subflowInput",node:v,name:l,field:m,path:f}:{kind:"unresolved",why:`inside subflow ${s}, ${s}.<name> reads its input, and it has no input ${l}${lC(v.inputs)}`}}if(!l||v.outputs&&l in v.outputs)return{kind:"output",node:v,name:l,path:f};let g=(v.subflow?.nodes??[]).find(m=>m?.outputs&&l in m.outputs);return v.type==="subflow"&&g?{kind:"unresolved",target:v,why:`${s} does not lift ${l}; its step ${g.key} has it: give ${s} an output ${l} (from: ${g.key}.${l}), or pass the path ${s}/${g.key}.${l} to the AI tools, which lift it`}:{kind:"unresolved",target:v,why:`${s} has no output ${l}${lC(v.outputs)}`}}function dC(e,t){let n=[],r=e.nodes.get(t);for(;r;){let a=e.levels.get(r.level);if(!a)break;let s=new Set([r.node.id]),l=[r.node.id];for(let f=0;f<l.length;f++)for(let p of T4(a.edges,l[f])){if(s.has(p))continue;s.add(p),l.push(p);let h=e.nodes.get(p)?.node;h&&h.type!=="start"&&n.push(h)}r=a.parent?e.nodes.get(a.parent):void 0}return n}function M4(e){return e.toLowerCase().replaceAll(/[^a-z0-9_]/g,"_")}function Ys(e,t=e.impl){return t?.register||`${M4(e.key)}_result`}var O4=/^\[[a-z0-9-]+\] keep output [a-z][a-z0-9_]*$/,P4={s:1,m:60,h:3600,d:86400};function ga(e){if(typeof e=="number")return e>0?Math.round(e):void 0;let t=e?.trim().toLowerCase();if(!t)return;if(/^[0-9]+$/.test(t))return Number(t)||void 0;let n=[...t.matchAll(/([0-9]+)\s*([smhd])/g)];if(n.length!==0&&n.map(r=>r[0]).join("")===t.replaceAll(/\s+/g,""))return n.reduce((r,a)=>r+Number(a[1])*(P4[a[2]]??0),0)||void 0}function D4(e){let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60;return`${t?`${t}h`:""}${n?`${n}m`:""}${r?`${r}s`:""}`||"0s"}function B0(e){let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60;return[t?`${t} h`:"",n?`${n} min`:"",r?`${r} s`:""].filter(Boolean).join(" ")||"0 s"}function uC(e){return e.replaceAll(/\{[{%#]/g,t=>`{{ '${t}' }}`)}var cC=class{$flow;constructor(e){this.$flow=e}},L4=class{$comment;constructor(e){this.$comment=e}},q0=e=>new cC(e),I4=e=>e instanceof cC,fC=e=>e instanceof L4,hC=/[\u0000-\u001f\u007f-\u009f\u2028\u2029]/g,pC=e=>String(e).replaceAll(hC," ").replaceAll(/\s+/g," ").trim(),R4=e=>`# ${String(e).replaceAll(hC," ")}`.trimEnd(),z4=/^[A-Za-z_][A-Za-z0-9_./-]*$/,F4=/^(true|false|yes|no|on|off|null)$/i,Qf=new Map;function B4(e){if(z4.test(e))return!F4.test(e);let t=Qf.get(e);return t===void 0&&(t=If(e),Qf.size>5e3&&Qf.clear(),Qf.set(e,t)),t}var q4=/[\u0000-\u001f\u007f-\u009f\u2028\u2029]/;function H4(e){return JSON.stringify(e).replaceAll(/[\u007f-\u009f\u2028\u2029]/g,t=>`\\u${t.charCodeAt(0).toString(16).padStart(4,"0")}`)}function Jf(e){return e===null?"null":typeof e=="string"?!q4.test(e)&&B4(e)?e:H4(e):String(e)}function mC(e){if(typeof e!="object"||!e)return Jf(e);if(I4(e))return`[${e.$flow.map(Jf).join(", ")}]`;if(Array.isArray(e)&&e.length===0)return"[]";if(!Array.isArray(e)&&!fC(e)&&Object.keys(e).length===0)return"{}"}function eh(e,t,n=!1){let r=" ".repeat(t),a=[],s=l=>a.push(n&&a.length===0?l:r+l);if(Array.isArray(e)){for(let l of e){if(fC(l)){a.push(`${r}${R4(l.$comment)}`);continue}let f=mC(l);if(f!==void 0){s(`- ${f}`);continue}let p=eh(l,t+2,!0);s(`- ${p[0]}`),a.push(...p.slice(1))}return a}for(let[l,f]of Object.entries(e)){if(f===void 0)continue;let p=mC(f);p===void 0?(s(`${Jf(l)}:`),a.push(...eh(f,t+2))):s(`${Jf(l)}: ${p}`)}return a}function kr(e,t){return e.lastIndexOf(`
|
|
150
|
+
`,t-1)+1}function Xs(e,t){return t-kr(e,t)}function V4(e){let t=e.key;return rt(t)?String(t.value):void 0}function Id(e,t){return e.items.find(n=>V4(n)===t)}function Zs(e,t){let n=e.doc.contents,r=[],a={node:n,ancestors:r};for(let s of t){if(!n)return;if(br(n))return{node:n,ancestors:r,alias:!0};if(r.push(n),typeof s=="number"){if(!Lo(n))return;let l=n.items[s];if(l===void 0)return;a={node:l,parent:n,ancestors:[...r]},n=l}else{if(!Do(n))return;let l=Id(n,s);if(!l)return;a={node:l.value,pair:l,parent:n,ancestors:[...r]},n=l.value}}return br(a.node)&&(a.alias=!0),a}function Zn(e){return!!e&&"anchor"in e&&!!e.anchor}function Rd(e){if(!e)return!1;let t=!1;return pi(e,{Node(n,r){if(br(r)||Zn(r))return t=!0,pi.BREAK}}),t}var vt=e=>({ok:!0,edits:e}),dt=(e,t)=>({ok:!1,code:e,reason:t});function K4(e,t){if(t===0||e[t-1]===`
|
|
151
|
+
`)return t;let n=e.indexOf(`
|
|
152
|
+
`,t);return n===-1?e.length:n+1}function th(e,t,n){let r=n;for(;r>t&&(e[r-1]===`
|
|
153
|
+
`||e[r-1]==="\r");)r--;return r}function nh(e,t){let n=t.range?.[1]??0,r=e.indexOf(":",n);return r===-1?n:r+1}function gC(e){return(Do(e)||Lo(e))&&!e.flow}function yC(e){return rt(e)?e.type:void 0}function W4(e,t){if(e.alias||e.ancestors.some(Zn)||Rd(t))return dt("unsupported","edit touches YAML anchors or aliases")}function H0(e,t,n){let{eol:r}=e.style,a=n.join(r);return{start:t,end:t,newText:t===0||e.text[t-1]===`
|
|
154
|
+
`?a+r:r+a}}function zd(e,t){let n=e.range;return n?vt([{start:n[0],end:n[1],newText:vi(t)}]):dt("invalid","node has no source range")}function ya(e,t,n){let r=W4(t,t.node);if(r)return r;let{text:a,style:s}=e,l=t.node,f=t.parent,p=f?.flow?void 0:t.pair?.key,h=n instanceof yi&&!p?n.text:n,v=h instanceof yi&&p?k0(h.text,oh(e,p,h)):void 0;if(v&&p){let S=nh(a,p),N=l?.range;return vt([{start:S,end:!N||N[0]===N[1]?Math.max(S,N?.[1]??S):th(a,N[0],gC(l)?N[2]:N[1]),newText:` ${v.indicator}${s.eol}${v.lines.join(s.eol)}`}])}if(f?.flow){if(l?.range&&l.range[0]<l.range[1]){let N=vi(h,yC(l));return vt([{start:l.range[0],end:l.range[1],newText:N}])}let S=f.toJSON();return Array.isArray(S)?S[f.items.indexOf(l)]=h:t.pair&&(S[String(t.pair.key.value)]=h),zd(f,S)}let g=N0(h,yC(l)),m=t.pair?.key;if(!l?.range||l.range[0]===l.range[1]){if(!m)return dt("invalid","empty value without a key");let S=nh(a,m),N=l?.range?Math.max(S,l.range[1]):S;if(g!==void 0)return vt([{start:S,end:N,newText:` ${g}`}]);let E=oh(e,m,h);return vt([{start:S,end:N,newText:s.eol+Io(h,E,s).join(s.eol)}])}if(!gC(l)){let S=th(a,l.range[0],l.range[1]);if(g!==void 0)return vt([{start:l.range[0],end:S,newText:g}]);if(m){let E=Io(h,oh(e,m,h),s);return vt([{start:nh(a,m),end:S,newText:s.eol+E.join(s.eol)}])}let N=Io(h,Xs(a,l.range[0]),s,!0);return vt([{start:l.range[0],end:S,newText:N.join(s.eol)}])}let b=th(a,l.range[0],l.range[2]);if(g!==void 0)return vt([{start:m?nh(a,m):l.range[0],end:b,newText:m?` ${g}`:g}]);let w=Lo(l)===Array.isArray(h)||!m?Xs(a,l.range[0]):oh(e,m,h);if(m)return vt([{start:kr(a,l.range[0]),end:b,newText:Io(h,w,s).join(s.eol)}]);let k=Io(h,w,s,!0);return vt([{start:l.range[0],end:b,newText:k.join(s.eol)}])}function oh(e,t,n){let r=Xs(e.text,t.range?.[0]??0);return Array.isArray(n)&&e.style.seqIndentless?r:r+e.style.indentUnit}function Sr(e,t,n,r={}){if(t.length===0)return dt("invalid","empty path");let a=Zs(e,t);if(a)return ya(e,a,n);let s=t.slice(0,-1),l=t.at(-1),f=Zs(e,s);return f?.alias?dt("unsupported","edit touches YAML anchors or aliases"):f?typeof l=="number"?G4(e,s,l,n):Y4(e,f,l,n,r.before??[]):typeof l=="string"?Sr(e,s,{[l]:n}):dt("not-found",`no sequence at ${s.join(".")}`)}function U4(e,t,n,r){if(!t.range||e[t.range[0]]!=="{")return;if(n?.range){let l=n.range[0];return/[{,]\s*$/.test(e.slice(t.range[0],l))?{start:l,end:l,newText:`${r}, `}:void 0}let a=t.items.at(-1),s=Math.max(a?.key?.range?.[1]??0,a?.value?.range?.[1]??0);if(/^\s*[,}]/.test(e.slice(s,t.range[1])))return{start:s,end:s,newText:`, ${r}`}}function Y4(e,t,n,r,a){let s=t.node;if(s===null||rt(s)&&s.value===null)return ya(e,t,{[n]:r});if(!Do(s))return dt("invalid","parent is not a map");if(t.ancestors.some(Zn)||Zn(s))return dt("unsupported","edit touches YAML anchors or aliases");let l=a.map(m=>Id(s,m)).find(m=>m!==void 0)?.key;if(s.flow){if(s.items.length===0)return ya(e,t,{[n]:r});let m=U4(e.text,s,l,`${vi(n)}: ${vi(r)}`);return m?vt([m]):zd(s,{...s.toJSON(),[n]:r})}let{text:f,style:p}=e,h=s.items[0]?.key;if(!h?.range||!s.range)return dt("invalid","map has no source range");let v=Xs(f,h.range[0]),g=Io({[n]:r},v,p);if(l?.range){let m=kr(f,l.range[0]);if(f.slice(m,l.range[0]).trim()==="")return vt([{start:m,end:m,newText:g.join(p.eol)+p.eol}]);let b=" ".repeat(v),w=[g[0]?.slice(v)??"",...g.slice(1)].join(p.eol);return vt([{start:l.range[0],end:l.range[0],newText:w+p.eol+b}])}return vt([H0(e,s.range[2],g)])}function vC(e,t,n){let r=kr(e,t),a=K4(e,n);return a===e.length&&!e.endsWith(`
|
|
155
|
+
`)&&r>0?[r-(e[r-2]==="\r"?2:1),a]:[r,a]}function X4(e,t){let n=t.key,r=n.range?.[0]??0;return vC(e,r,t.value?.range?.[2]??n.range?.[2]??r)}function Z4(e,t,n,r){let a=Zs(e,t),s=a?.node;if(a?.alias)return dt("unsupported","edit touches YAML anchors or aliases");if(!a||!Do(s))return dt("not-found",`no map at ${t.join(".")}`);let l=Id(s,n),f=l?.key?.range;if(!l||!f)return dt("not-found",`no key ${n}`);if(Id(s,r))return dt("invalid",`key ${r} already exists`);if(a.ancestors.some(Zn)||Zn(s)||Rd(l.key))return dt("unsupported","edit touches YAML anchors or aliases");let p=/^[A-Za-z0-9][A-Za-z0-9_./-]*$/.test(r);return vt([{start:f[0],end:f[1],newText:p?r:JSON.stringify(r)}])}function Bo(e,t,n){let r=Zs(e,t),a=r?.node;if(r?.alias)return dt("unsupported","edit touches YAML anchors or aliases");if(!r||!Do(a))return dt("not-found",`no map at ${t.join(".")}`);let s=Id(a,n);if(!s)return dt("not-found",`no key ${n}`);if(r.ancestors.some(Zn)||Zn(a)||Rd(s.value)||Rd(s.key))return dt("unsupported","edit touches YAML anchors or aliases");if(a.flow){let g=a.toJSON();return delete g[n],zd(a,g)}let{text:l}=e;if(a.items.length===1){if(t.length>0)return ya(e,r,{});let g=kr(l,a.range?.[0]??0);return vt([{start:g,end:th(l,g,a.range?.[2]??l.length),newText:"{}"}])}let f=s.key.range?.[0]??0,p=kr(l,f);if(l.slice(p,f).trim()!==""){let g=a.items[a.items.indexOf(s)+1]?.key;return g?.range?vt([{start:f,end:g.range[0],newText:""}]):dt("invalid","cannot remove the only key of an item")}let[h,v]=X4(l,s);return vt([{start:h,end:v,newText:""}])}function G4(e,t,n,r){let a=Zs(e,t);if(!a)return Sr(e,t,[r]);if(a.alias)return dt("unsupported","edit touches YAML anchors or aliases");let s=a.node;if(s===null||rt(s)&&s.value===null)return ya(e,a,[r]);if(!Lo(s))return dt("invalid","not a sequence");if(a.ancestors.some(Zn)||Zn(s))return dt("unsupported","edit touches YAML anchors or aliases");let l=n==="end"?s.items.length:Math.min(n,s.items.length);if(s.flow){if(s.items.length===0)return ya(e,a,[r]);let w=s.toJSON();return w.splice(l,0,r),zd(s,w)}let{text:f,style:p}=e;if(!s.range)return dt("invalid","sequence has no source range");let h=Xs(f,s.range[0]),v=Io([r],h,p),g=s.items[l];if(!g?.range)return vt([H0(e,s.range[2],v)]);let m=kr(f,g.range[0]),b=m+h;return f.slice(m,b).trim()===""?vt([H0(e,m,v)]):vt([{start:b,end:b,newText:[v[0]?.slice(h)??"",...v.slice(1)].join(p.eol)+p.eol+" ".repeat(h)}])}function rh(e,t,n){let r=Zs(e,t),a=r?.node;if(r?.alias)return dt("unsupported","edit touches YAML anchors or aliases");if(!r||!Lo(a))return dt("not-found",`no sequence at ${t.join(".")}`);let s=a.items[n];if(!s?.range)return dt("not-found",`no item ${n}`);if(r.ancestors.some(Zn)||Zn(a)||Rd(s))return dt("unsupported","edit touches YAML anchors or aliases");if(a.flow){let g=a.toJSON();return g.splice(n,1),zd(a,g)}if(a.items.length===1)return ya(e,r,[]);let{text:l}=e,f=kr(l,s.range[0]),p=f+Xs(l,a.range?.[0]??f);if(l.slice(f,p).trim()!==""){let g=a.items[n+1];return g?.range?vt([{start:p,end:kr(l,g.range[0])+(p-f),newText:""}]):dt("invalid","cannot remove the item")}let[h,v]=vC(l,s.range[0],s.range[2]);return vt([{start:h,end:v,newText:""}])}function Q4(e){return e.replaceAll(/[^A-Za-z0-9_]/g,"_")}var J4=e=>typeof e=="string"&&/^[\w-]+(\.[\w-]+)?$/.test(e),eF=/^node_([0-9A-HJKMNP-TV-Z]{26})$/,bC=3,V0="not scanned",tF={str:"string",raw:"any",path:"string",int:"integer",float:"any",bool:"boolean",list:"list",dict:"dict"};function K0(e){let t=e.impl?.params?.tasks_from;return typeof t=="string"&&t?t:null}function nF(e,t,n){return e.roles.find(r=>r.name===t&&(r.tasks_from??null)===n)}function oF(e){let t=new Set;for(let n of e)for(let r of[...n.register,...n.facts,...n.stats])t.add(r);return[...t]}var bi=e=>e.map(t=>`\`${t}\``).join(", ");function rF(e,t){return(e.find(n=>n.origin&&(!t||t(n)))??e.find(n=>n.origin))?.origin??void 0}function iF(e,t){let n=e.nodes.get(t.id);return(n?e.levels.get(n.level)?.edges??[]:[]).some(r=>r?.to?.node===t.id&&ha(r.from?.port??""))}function xC(e,t){let n=e.nodes.get(t.id),r=n?e.levels.get(n.level):void 0;return r?r.edges.some(a=>a?.to?.node===t.id)?!0:(r.parent?e.nodes.get(r.parent)?.node:void 0)?.subflow?.boundary?.in===t.id:!1}function aF(e,t,n,r){let a=n.find(h=>h.name.startsWith(`[${t.key}]`))??n[0],s={node:t.id,matched:n.length>0,play:a?.origin??void 0},l=t.impl?.ref?t.impl:void 0;if(t.type==="subflow"&&(t.subflow?.nodes?.length??0)>0){let h=r.flatMap(g=>g.tasks),v=`${r.length} step${r.length===1?"":"s"}`;return{...s,artifact:l?`${l.kind}: ${l.ref} \xB7 ${v}`:v,tasks:h,dynamic:r.reduce((g,m)=>g+m.dynamic,0)}}if(!l){let h=t.type==="task"||t.type==="subflow"?"not bound":t.type;return{...s,artifact:h,tasks:[],dynamic:0}}if(l.kind==="module"){let h=n.flatMap(v=>v.tasks).filter(v=>v.action===l.ref&&!O4.test(v.name??""));return{...s,artifact:`module: ${l.ref}`,tasks:h,dynamic:0}}if(l.kind==="role"){let h=K0(t),v=nF(e,l.ref,h),g=(v?.tasks??[]).filter(m=>!m.auto);return{...s,artifact:`role: ${l.ref}${h?` \xB7 ${h}`:""}`,tasks:g,dynamic:g.filter(m=>m.dynamic).length,missing:v?.error??(v?void 0:V0)}}let f=e.playbooks.find(h=>h.path===l.ref.replace(/^\.\//,"")),p=(f?.plays??[]).flatMap(h=>h.tasks).filter(h=>!h.auto);return{...s,artifact:`playbook: ${l.ref.split("/").pop()}`,tasks:p,dynamic:p.filter(h=>h.dynamic).length,missing:f?f.error:V0}}function sF(e,t){let n=Ee(e),r=[],a=new Map;for(let b of Ws(e))b.area==="drift"&&a.set(`${b.node}|${b.what}`,{reason:b.reason,by:b.by});let s=b=>{let w=b.node?a.get(`${b.node}|${b.id}`):void 0;w?r.push({...b,ignored:w,actions:[{label:"Reopen",action:{kind:"unignore",node:b.node,item:b.id}}]}):(b.node&&b.actions.push({label:"Accept with Reason\u2026",action:{kind:"ignore",node:b.node,item:b.id}}),r.push(b))},l=new Map,f=t.generated;for(let b of f.plays)for(let w of b.tags){let k=eF.exec(w)?.[1];k&&(n.nodes.has(k)?l.set(k,[...l.get(k)??[],b]):r.push({id:`orphan-play:${k}:${b.name}`,kind:"code_without_design",title:b.name,label:"play without a node",detail:`\`${b.name}\` is tagged for a node that is not in this flow (node_${k}).`,severity:"warning",actions:[{label:"Regenerate",action:{kind:"regenerate"}},...b.origin?[{label:"Open Code",action:{kind:"openCode",...b.origin}}]:[]]}))}if(f.error||f.plays.length===0){let b=f.error==="not found"||!f.error;r.push({id:"generated",kind:"design_without_code",title:n.doc.flow.name,label:b?"no generated code":"generated code does not compile",detail:b?`${f.path} does not exist yet: save the flow to generate it.`:`${f.path}: ${f.error}`,severity:"warning",actions:[{label:"Regenerate",action:{kind:"regenerate"}},...b?[]:[{label:"Open Code",action:{kind:"openCode",path:f.path}}]]})}let p={},h=n.doc.flow?.inputs??{},v=b=>{let w=(b.subflow?.nodes??[]).filter(S=>!!S?.id).map(v),k=aF(t,b,l.get(b.id)??[],w);return p[b.id]=k,k};for(let b of e.nodes??[])b?.id&&v(b);let g=0,m=0;for(let{node:b}of n.nodes.values()){if(b.type==="start"||b.type==="end")continue;let w=p[b.id];w&&(m++,w.matched?g++:!f.error&&f.plays.length>0&&s({id:`unmatched:${b.id}`,kind:"design_without_code",node:b.id,title:b.title,label:"not in generated code",detail:xC(n,b)?`No play in ${f.path} is tagged node_${b.id}: save the flow to regenerate it.`:"Nothing leads to this node, so no play is generated for it.",severity:xC(n,b)?"warning":"info",actions:[{label:"Regenerate",action:{kind:"regenerate"}},{label:"Open Code",action:{kind:"openCode",path:f.path}}]}),lF(n,t,b,w,h,s))}return{items:r,nodes:p,matched:g,matchable:m}}function lF(e,t,n,r,a,s){let l=n.impl?.ref?n.impl:void 0,f=(n.subflow?.nodes?.length??0)>0,p=n.type==="task"||n.type==="subflow"&&!f,h=n.id,v=n.title;if(p&&!l)s({id:`unbound:${h}`,kind:"design_without_code",node:h,title:v,label:"no code yet",detail:iF(e,n)?"Designed and wired to a fail port, but nothing is bound.":"Nothing is bound: it runs as a TODO stub.",severity:"warning",actions:[{label:"Generate Stub",action:{kind:"generateStub",node:h,role:Q4(n.key)}},{label:"Bind Role",action:{kind:"bind",node:h,bindKind:"role"}}]});else if(l)if(r.missing===V0)s({id:`unscanned:${h}`,kind:"design_without_code",node:h,title:v,label:"not scanned yet",detail:`${l.kind} ${l.ref} was bound after the last sync.`,severity:"info",actions:[{label:"Re-sync",action:{kind:"resync"}}]});else if(l.kind==="playbook"&&r.missing)s({id:`missing:${h}`,kind:"design_without_code",node:h,title:v,label:"playbook missing",detail:`${l.ref} ${r.missing==="not found"?"does not exist":`does not load: ${r.missing}`}.`,severity:"warning",actions:[{label:"Bind Playbook",action:{kind:"bind",node:h,bindKind:"playbook"}}]});else{if(l.kind==="role"){let g=t.roleInfo.find(w=>w.name===l.ref),m=!!r.missing&&/not found|was not found/i.test(r.missing),b=/^[\w-]+\.[\w-]+\.[\w-]+$/.test(l.ref);if(m||!g&&!b){s({id:`missing:${h}`,kind:"design_without_code",node:h,title:v,label:"role missing",detail:`Role ${l.ref} is not in roles_path.`,severity:"warning",actions:[...J4(l.ref)?[{label:"Create Role",action:{kind:"generateStub",node:h,role:l.ref}}]:[],{label:"Bind Role",action:{kind:"bind",node:h,bindKind:"role"}}]});return}if(!g)return;if(f){dF(e,n,g.tasks,s,g.includes);return}uF(n,r,g,a,s)}l.kind==="module"&&cF(t,n,r,s)}}function dF(e,t,n,r,a={}){let s=t.impl?.ref??"",l=new Set([...e.nodes.values()].filter(p=>p.level===t.id&&p.node.impl?.kind==="role"&&p.node.impl.ref===s).map(p=>K0(p.node)??"main")),f=new Set(l);for(let p of[...f])for(let h=[p];h.length;)for(let v of a[h.pop()]??[])f.has(v)||(f.add(v),h.push(v));for(let p of n)p==="main"||f.has(p)||r({id:`task-file:${p}`,kind:"code_without_design",node:t.id,title:t.title,label:"task not in design",detail:`\`${p}\` exists in the role but not in the subflow.`,severity:"warning",actions:[{label:"Add to Subflow",action:{kind:"addToSubflow",subflow:t.id,role:s,tasksFrom:p}}]})}function uF(e,t,n,r,a){let s=e.id,l=e.title,f=K0(e)??"main",p=`${n.path}/tasks/${f}.yml`,h=oF(t.tasks),v=e.outputs??{},g=t.dynamic>0?" (dynamic includes are not expanded, so this may be incomplete)":"";for(let[S,N]of Object.entries(v)){if(N?.from?.startsWith("impl.")||h.includes(S))continue;let E=h.filter($=>!($ in v)).slice(0,bC),j=rF(t.tasks,$=>$.register.length+$.facts.length+$.stats.length>0);a({id:`output:${S}`,kind:"contract_mismatch",node:s,title:l,label:"outputs differ",detail:h.length?`Design expects ${bi([S])}, code registers ${bi(h)}.${g}`:`Design expects ${bi([S])}, the role sets no variables.${g}`,severity:t.dynamic>0?"info":"warning",actions:[...E.length===1?[{label:"Update Design",action:{kind:"renameOutput",node:s,from:S,to:E[0]}}]:E.map($=>({label:`Use ${$}`,action:{kind:"renameOutput",node:s,from:S,to:$}})),...E.length===0?[{label:"Remove Output",action:{kind:"removeOutput",node:s,name:S}}]:[],{label:"Open Code",action:{kind:"openCode",...j??{path:p}}}]})}let m=n.entry_points[f],b=`${n.path}/meta/argument_specs.yml`;if(!m){a({id:`no-spec:${f}`,kind:"contract_mismatch",node:s,title:l,label:"no argument spec",detail:`${n.name} has no argument_specs for \`${f}\`: its inputs are not checked.`,severity:"info",actions:[{label:"Write argument_specs",action:{kind:"writeSpecs",node:s}},{label:"Open Code",action:{kind:"openCode",path:p}}]});return}let w=e.inputs??{},k=e.impl?.params??{};for(let[S,N]of Object.entries(m.options)){if(!N.required||N.default!==void 0||S in w||S in k)continue;let E={type:tF[N.type]??"any",required:!0,...S in r?{from:`flow.${S}`}:{}};a({id:`input-required:${S}`,kind:"contract_mismatch",node:s,title:l,label:"inputs differ",detail:`The role requires ${bi([S])}; the node has no input ${bi([S])}.`,severity:"warning",actions:[{label:"Update Design",action:{kind:"addInput",node:s,name:S,field:E}},{label:"Open Code",action:{kind:"openCode",path:b}}]})}for(let S of Object.keys(w))S in m.options||a({id:`input-unknown:${S}`,kind:"contract_mismatch",node:s,title:l,label:"input unknown to the role",detail:`${bi([S])} is not an argument of ${n.name} (${f}).`,severity:"info",actions:[{label:"Update Design",action:{kind:"removeInput",node:s,name:S}},{label:"Open Code",action:{kind:"openCode",path:b}}]})}function cF(e,t,n,r){let a=t.impl?.ref??"",s=e.moduleReturns?.[a];if(s)for(let[l,f]of Object.entries(t.outputs??{})){let p=f?.from?.match(/^impl\.register\.([A-Za-z0-9_]+)/)?.[1];p&&!s.includes(p)&&r({id:`return:${l}`,kind:"contract_mismatch",node:t.id,title:t.title,label:"outputs differ",detail:`Design reads ${bi([p])} from the ${a} result, which returns ${bi(s)}.`,severity:"warning",actions:[...s.slice(0,bC).map(h=>({label:`Read ${h}`,action:{kind:"setOutputFrom",node:t.id,name:l,from:`impl.register.${h}`}})),...n.play?[{label:"Open Code",action:{kind:"openCode",...n.play}}]:[]]})}}function wC(e){let t=Object.entries(e.flow.inputs??{}).filter(([,n])=>n?.type==="host_list");return(t.find(([,n])=>n.targets)??t[0])?.[0]}function go(e,t){return e.nodes.get(t)?.node.title??t}function kC(e,t){return(e.levels.get(e.nodes.get(t)?.level??"")?.edges??[]).filter(n=>n?.to?.node===t).map(n=>({from:n.from.node,port:n.from.port}))}function SC(e,t){let n=e.levels.get(e.nodes.get(t)?.level??""),r=new Set;for(let a of n?.edges??[])a?.from?.node===t&&r.add(a.to.node),a?.to?.node===t&&r.add(a.from.node);return r.delete(t),[...r].map(a=>e.nodes.get(a)?.node).filter(a=>!!a)}function NC(e,t,n){let r=e.nodes.get(t),a=t;for(;r;){if(r.level===n)return a;if(r.level==="root")return;a=r.level,r=e.nodes.get(r.level)}}function qo(e){return e.type!=="start"&&e.type!=="end"}function jC(e,t,n=2){if(t.length!==0)return{text:`${e}${t.slice(0,n).join(", ")}${t.length>n?` +${t.length-n}`:""}`,title:t.join(", ")}}function Pn(e,t){return`${e} ${t}${e===1?"":"s"}`}function ih(e){return e.length<=1?e.join(""):e.length===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`}var fF=/\{\{\s*(?:flow\.)?([A-Za-z_][A-Za-z0-9_]*)\s*\}\}/g;function Gs(e){return e.split(/[,:]/).map(t=>t.trim()).filter(t=>t&&!t.startsWith("!")&&!t.startsWith("&"))}function W0(e,t,n,r){let a=t.settings?.inventory_target?.trim();if(a){let l=wC(e),f=a.replaceAll(fF,(p,h)=>h===l&&n?n:p);return{pattern:f,source:"inventory_target",unresolved:f.includes("{{")}}let s=r?.nodes[t.id]?.hosts;if(s&&s.length>0)return{pattern:s.join(","),source:"playbook",unresolved:s.join("").includes("{{")}}function hF(e,t,n){return n.type==="start"?t.hosts.length:n.type==="end"?Wf(e,t,n.id).length:Kf(t,n.id).length}function pF(e,t){return Object.values(e.flow.inputs??{}).some(n=>{if(n?.type!=="host_list")return!1;let r=n.default;return(Array.isArray(r)?r.map(String):typeof r=="string"?Gs(r):[]).includes(t)})}function mF(e){let t=e.toLowerCase().replaceAll(/[^a-z0-9_]/g,"_");return/^[a-z_]/.test(t)?t:`g_${t}`}function gF(e,t,n,r){let a=Ee(e),s=t?.state==="ready"?t.facts:void 0,l=s?.targets??t?.targets??"",f=wC(e)??"targets",p=n?.summary,h=A=>s?.patterns[A],v=A=>h(A)?.count,g={},m=[],b=new Map,w=(A,M,O)=>{let K=b.get(A)??{nodes:new Set,input:O};K.nodes.add(M),K.input||=O,b.set(A,K)},k=[];for(let{node:A}of a.nodes.values()){let M=p?hF(a,p,A):void 0,O=qo(A)?W0(e,A,l,r):void 0;if(A.type==="start"){g[A.id]=l?[{text:`${l} \xB7 ${v(l)??"?"}`,title:`flow input ${f}`}]:[{text:`${f}: not set`,tone:"muted",title:"Enter the flow targets in the side panel"}];for(let B of Gs(l))w(B,A.id,!0);continue}if(A.type==="end"){g[A.id]=M===void 0?[]:[{text:`\xB7 ${M}`,title:"hosts that ended here"}];continue}if(O){k.push({node:A,d:O});let B=Gs(O.pattern),V=B.map(oe=>{let F=h(oe);return O.unresolved||!F?{text:oe,title:`declared target (${O.source})`}:F.outside===0?{text:`${oe} \xB7 ${M??F.count}`}:{text:`+ ${oe} \xB7 ${F.count}`,tone:"warn",title:`${F.outside} of these hosts are outside the flow targets`}});g[A.id]=V.length>2?[V[0],{text:`+${V.length-1} more`,title:O.pattern}]:V;for(let oe of B)w(oe,A.id,!1);continue}if(!l){g[A.id]=[];continue}let K=M??v(l);g[A.id]=[{text:`${l} \xB7 ${K??"?"}`,title:M===void 0?"at most this many hosts arrive (no run yet)":"hosts at this node in the last run"}];for(let B of Gs(l))w(B,A.id,!0)}let S={};if(p)for(let A of a.edges.values())S[A.edge.id]=`${A.edge.from.port} \xB7 ${T0(a,p,A.edge).length}`;let N=new Set;for(let{node:A,d:M}of k){if(M.unresolved||!s)continue;let O=h(M.pattern);if(!O)continue;for(let oe of Gs(M.pattern))v(oe)===0&&m.push({id:`inventory:no-match:${A.id}:${oe}`,lens:"inventory",severity:"warning",title:`${A.title}: ${oe} matches no host`,detail:`The declared target ${M.pattern} names ${oe}, which is not a group or host of the inventory (${s.sources.join(", ")}).`,node:A.id,nodes:[A.id],fixes:[]});let K=kC(a,A.id),B=K.length>0&&K.every(oe=>ha(oe.port));if(O.outside===0||!(Od(A)||B))continue;N.add(A.id);let V=[...new Set(K.map(oe=>oe.port))].join(", ")||"its wires";m.push({id:`inventory:broad-target:${A.id}`,lens:"inventory",severity:"warning",title:`${A.title} targets ${M.pattern} (${O.count})`,detail:`It receives hosts from ${V}, but its ${M.source==="playbook"?"playbook runs on":"target is"} ${M.pattern}: ${Pn(O.outside,"host")} outside the flow targets${O.sample.length?` (${O.sample.join(", ")}${O.outside>O.sample.length?", \u2026":""})`:""}. One wrong condition could touch every one of them.`,node:A.id,nodes:[A.id],fixes:M.source==="inventory_target"?[{label:"Limit to Arriving Hosts",command:{kind:"updateNode",id:A.id,patch:{settings:{inventory_target:null}}}}]:[]})}if(s){let A=new Map;for(let{node:O,d:K}of k)if(!(K.unresolved||N.has(O.id)))for(let B of Gs(K.pattern)){let V=h(B);V&&V.outside!==0&&V.count!==0&&!pF(e,B)&&A.set(B,(A.get(B)??new Set).add(O.id))}for(let[O,K]of A){let B=h(O),V=[...K];m.push({id:`inventory:group-not-input:${O}`,lens:"inventory",severity:"warning",title:`${O} is not a flow input`,detail:`${ih(V.map(oe=>go(a,oe)))} ${V.length===1?"touches":"touch"} ${Pn(B.count,"host")} in ${O} that the flow targets (${l||f}) do not include. Approvers only see the flow targets.`,nodes:V,fixes:[{label:"Add to Flow Inputs",command:{kind:"setContractField",target:"flow",side:"inputs",name:mF(O),field:{type:"host_list",default:O}}}]})}let M=s.prod_groups.filter(O=>s.scope.groups[O]);M.length>0&&m.push({id:"inventory:prod",lens:"inventory",severity:"info",title:`The flow touches production groups: ${M.join(", ")}`,detail:`${M.map(O=>`${O}: ${Pn(s.scope.groups[O]??0,"host")}`).join(", ")} in scope, in groups whose names look like production. Real runs ask for confirmation.`,nodes:[],fixes:[]})}let E=[...b.entries()].map(([A,M])=>{let O=h(A),K=[Pn(M.nodes.size,"node")];return M.input&&K.push("flow input"),O?.outside&&K.push(`${O.outside} outside the targets`),{key:`group:${A}`,label:A,value:O?String(O.count):void 0,detail:K.join(" \xB7 "),nodes:[...M.nodes],tone:O?.outside?"warn":void 0}}).sort((A,M)=>Number(M.value??0)-Number(A.value??0)||A.label.localeCompare(M.label)),j=[];if(p){let A=new Set;for(let[M,O]of Object.entries(p.nodes))for(let[K,B]of Object.entries(O))if(ha(K))for(let V of B)A.has(V)||(A.add(V),j.push({key:`host:${V}`,label:V,detail:`${go(a,M)} \xB7 ${K}`,nodes:[M]}))}let $=[];!t||t.state==="idle"?$.push("The inventory has not been read yet."):t.state==="loading"?$.push("Reading the inventory\u2026"):t.state==="error"&&$.push(`The inventory could not be read: ${t.error}`),l||$.push(`Enter the flow targets (${f}) to count hosts per node.`);let L=e.flow.runtime,z=O0(Ee(e));return(z==="awx_job"||z==="awx_workflow")&&$.push(`This flow runs in AWX${L?.template?` (${L.template})`:""}; AWX may use another inventory than the local one.`),s?.dynamic.length&&$.push(`Dynamic sources read on demand: ${s.dynamic.join(", ")}.`),{lens:"inventory",chips:g,wires:p?S:void 0,stats:s?[{label:"groups touched",value:String(Object.keys(s.scope.groups).length)},{label:"hosts in scope",value:String(s.scope.count)},{label:"inventory",value:Pn(s.total,"host")}]:[],sections:[{title:"Groups used by this flow",items:E,empty:"No targets yet."},...p?[{title:"Excluded last run",items:j,empty:"No host left through a fail port."}]:[]],findings:m,notes:$}}function yF(e,t){return[...new Set([...I0(e.impl?.params??{}),...I0(e.inputs??{})])].filter(n=>n in t).sort()}function vF(e){let t=Object.keys(e?.values??{});return t.length===1?t[0]:void 0}function bF(e,t,n){let r=Ee(e),a=t?.state==="ready"?t.facts:void 0,s=a?.targets??t?.targets??"",l=a?.vaulted??{},f={},p=[],h=new Map,v=new Set,g=new Map,m=O0(r),b=m==="awx_job"||m==="awx_workflow",w=Rt(e)>=2?(e.flow.runtime?.credentials??[]).join(", "):"",k=E=>Rt(e)>=2?w||void 0:E.settings?.credential;for(let{node:E}of r.nodes.values()){if(!qo(E))continue;let j=[],$=k(E),L=W0(e,E,s,n)?.pattern??s,z=a?.access[L];if($)j.push({text:$,title:b?"AWX credential":"AWX credential (local runs use the environment)"}),h.set($,(h.get($)??new Set).add(E.id));else{let O=vF(z?.ansible_user);O&&j.push({text:`user ${O}`,title:z?.ansible_user?.origins.join(", "),tone:"muted"})}let A=z?.ansible_become?.values.true;E.settings?.become?(j.push({text:"become"}),v.add(E.id)):A&&j.push({text:"become (inventory)",title:`${Pn(A,"host")} get ansible_become`});let M=yF(E,l);for(let O of M)g.set(O,(g.get(O)??new Set).add(E.id));M.length>0&&j.push({text:`vault: ${M.join(", ")}`,title:M.map(O=>`${O} (${l[O]})`).join(`
|
|
156
|
+
`)}),f[E.id]=j.slice(0,2)}for(let{node:E}of r.nodes.values()){if(!qo(E))continue;let j=SC(r,E.id).filter(qo),$=k(E),L=j.map(A=>k(A)).filter(A=>!!A),z=[...new Set(L)];$&&L.length>=2&&z.length===1&&z[0]!==$&&p.push({id:`access:credential:${E.id}`,lens:"access",severity:"warning",title:`${E.title} uses ${$}, its neighbours use ${z[0]}`,detail:`${ih(j.filter(A=>k(A)).map(A=>A.title))} run with ${z[0]}. Check that ${E.title} needs the access ${$} gives.`,node:E.id,nodes:[E.id,...j.map(A=>A.id)],fixes:[]}),CC(r,E)&&p.push({id:`access:become:${E.id}`,lens:"access",severity:"info",title:`${E.title} escalates privileges, unlike its neighbours`,detail:`${E.title} sets become; none of the nodes wired to it do. Needs root? Accept it with a reason, so others know why.`,node:E.id,nodes:[E.id],acceptFirst:!0,fixes:[{label:"Remove Become",command:{kind:"updateNode",id:E.id,patch:{settings:{become:null}}}}]})}if(!b&&h.size>0){let E=[...h.values()].flatMap(j=>[...j]);p.push({id:"access:awx-only",lens:"access",severity:"info",title:"Node credentials apply in AWX only",detail:`${ih(E.map(j=>go(r,j)))} name an AWX credential. Local runs use the environment's keys and the inventory's connection variables.`,nodes:E,fixes:[]})}if(g.size>0){let E=[...new Set([...g.values()].flatMap(j=>[...j]))];p.push({id:"access:vault",lens:"access",severity:"info",title:`${Pn(E.length,"node")} ${E.length===1?"reads":"read"} vaulted variables`,detail:`${[...g.keys()].join(", ")}: runs need the vault password (asked per run locally, never stored).`,nodes:E,fixes:[]})}let S=[];for(let[E,j]of Object.entries(a?.access??{}))if(!/[,:]/.test(E))for(let[$,L]of Object.entries(j.ansible_user?.values??{}))S.push({key:`user:${E}:${$}`,label:$,value:String(L),detail:`${E} \xB7 ${j.ansible_user?.origins.join(", ")||"origin unknown"}`,nodes:[]});let N=[];return a||N.push("Read the inventory (Inventory lens) to see connection users and vaulted variables."),{lens:"access",chips:f,stats:[{label:"credentials",value:String(h.size)},{label:"become",value:String(v.size)},{label:"vaulted vars",value:String(g.size)}],sections:[{title:"Credentials",items:[...h.entries()].map(([E,j])=>({key:`cred:${E}`,label:E,detail:[...j].map($=>go(r,$)).join(", "),nodes:[...j]})),empty:"No node names a credential."},{title:"Privilege escalation",items:[...v].map(E=>({key:`become:${E}`,label:go(r,E),nodes:[E]})),empty:"No node sets become."},{title:"Vaulted variables",items:Object.entries(l).map(([E,j])=>({key:`vault:${E}`,label:E,detail:`${j}${g.get(E)?` \xB7 ${[...g.get(E)??[]].map($=>go(r,$)).join(", ")}`:""}`,nodes:[...g.get(E)??[]]})),empty:a?"No vaulted variables for the hosts in scope.":"Inventory not read."},{title:"Connection users",items:S,empty:a?"No ansible_user set.":"Inventory not read."}],findings:p,notes:N}}function CC(e,t){if(!t.settings?.become||!qo(t))return!1;let n=SC(e,t.id).filter(qo);return n.length>0&&!n.some(r=>r.settings?.become)}var xF=/^[0-9A-HJKMNP-TV-Z]{26}$/,Qs=e=>typeof e=="string"&&xF.test(e),Fd=e=>typeof e=="string"&&e!==""&&!Qs(e);function wF(e){let t=[],n=(r,a,s,l,f,p,h)=>{let v=Array.isArray(s)?s:[];t.push({label:a,nodesPath:[...r,"nodes"],edgesPath:[...r,"edges"],annotationsPath:[...r,"annotations"],nodes:v,edges:Array.isArray(l)?l:[],annotations:Array.isArray(f)?f:[],boundaryPath:p,boundary:h}),v.forEach((g,m)=>{if(!g||typeof g!="object"||!g.subflow||typeof g.subflow!="object")return;let b=[...r,"nodes",m,"subflow"];n(b,`subflow ${g.key}`,g.subflow.nodes,g.subflow.edges,g.subflow.annotations,[...b,"boundary"],g.subflow.boundary)})};return n([],"the top level",e.nodes,e.edges,e.annotations),t}function kF(e,t){let n=[],r=[],a=e.flow;a&&typeof a=="object"&&!Qs(a.id)&&(r.push({op:"id",of:"flow",path:["flow","id"],id:t("flow"),before:Object.keys(a)}),n.push({kind:"flow",path:["flow"],message:`Flow "${a.key??a.name??""}" has no id`}));let s=wF(e),l=new Map,f=new Map;for(let h of s){let v=new Map;h.nodes.forEach((g,m)=>{if(!g||typeof g!="object")return;let b=[...h.nodesPath,m],w=g.id;Qs(w)||(w=t(`node|${b.join(".")}|${g.key??""}`),r.push({op:"id",of:"node",path:[...b,"id"],id:w,before:Object.keys(g)}),n.push({kind:"node",path:b,message:`Node "${g.key??g.title??m}" on ${h.label} has no id`})),typeof g.key=="string"&&(v.set(g.key,v.has(g.key)?null:w),f.set(g.key,f.has(g.key)?null:w))}),l.set(h,v)}let p=(h,v,g,m)=>{let b=h.get(v);if(b)return b;n.push({kind:"ref",path:m,unresolved:!0,message:b===null?`Key "${v}" (${g}) is used by several nodes: name the node by its id`:`No node with key "${v}" (${g})`})};for(let h of s){let v=l.get(h)??new Map;h.edges.forEach((b,w)=>{if(!b||typeof b!="object")return;let k=[...h.edgesPath,w],S=[];if(!Qs(b.id)){let E=t(`wire|${k.join(".")}`);r.push({op:"id",of:"wire",path:[...k,"id"],id:E,before:Object.keys(b)}),S.push("no id")}let N=!1;for(let E of["from","to"]){let j=b[E]?.node;if(!Fd(j))continue;let $=p(v,j,`wire ${E} on ${h.label}`,[...k,E,"node"]);$&&(r.push({op:"set",path:[...k,E,"node"],id:$}),N=!0)}N&&S.push("names nodes by key"),S.length>0&&n.push({kind:"wire",path:k,message:`Wire ${b.from?.node}.${b.from?.port} -> ${b.to?.node}.${b.to?.port} on ${h.label}: ${S.join(", ")}`})});let g=h.annotations.map(b=>b&&typeof b=="object"?b.key:void 0);h.annotations.forEach((b,w)=>{if(!b||typeof b!="object")return;let k=[...h.annotationsPath,w],S=[];if(!Qs(b.id)){let N=t(`annotation|${k.join(".")}|${b.key??""}`);r.push({op:"id",of:"annotation",path:[...k,"id"],id:N,before:Object.keys(b)}),S.push("no id")}if(typeof b.key!="string"||b.key===""){let N=mz(g,b.kind??"note");g.push(N);let E=Object.keys(b).filter(j=>j!=="id");r.push({op:"id",of:"annotation",path:[...k,"key"],id:N,before:E}),S.push("no key")}if(Fd(b.on)){let N=p(v,b.on,`annotation on ${h.label}`,[...k,"on"]);N&&(r.push({op:"set",path:[...k,"on"],id:N}),S.push(`names "${b.on}" by key`))}S.length>0&&n.push({kind:"annotation",path:k,message:`${b.kind??"note"} "${b.key??w}" on ${h.label}: ${S.join(", ")}`})});let m=h.boundary;if(h.boundaryPath&&m&&typeof m=="object"){if(Fd(m.in)){let b=[...h.boundaryPath,"in"],w=p(v,m.in,`entry of ${h.label}`,b);w&&(r.push({op:"set",path:b,id:w}),n.push({kind:"ref",path:b,message:`The entry of ${h.label} names "${m.in}" by key`}))}for(let[b,w]of Object.entries(m.outputs??{}))(w??[]).forEach((k,S)=>{if(!Fd(k?.node))return;let N=[...h.boundaryPath,"outputs",b,S,"node"],E=p(v,k.node,`exit ${b} of ${h.label}`,N);E&&(r.push({op:"set",path:N,id:E}),n.push({kind:"ref",path:N,message:`Exit ${b} of ${h.label} names "${k.node}" by key`}))})}}(e.decisions??[]).forEach((h,v)=>{if(!Fd(h?.node))return;let g=["decisions",v,"node"],m=p(f,h.node,`decision ${v+1}`,g);m&&(r.push({op:"set",path:g,id:m}),n.push({kind:"ref",path:g,message:`Decision ${v+1} names "${h.node}" by key`}))});for(let h of Object.keys(e.layout??{})){if(Qs(h))continue;let v=f.get(h);v&&!Object.hasOwn(e.layout??{},v)&&(r.push({op:"rename",mapPath:["layout"],key:h,id:v}),n.push({kind:"layout",path:["layout",h],message:`Position of "${h}" is keyed by key`}))}return{gaps:n,fixes:r}}function SF(e){let t=2166136261,n=16777619;for(let a=0;a<e.length;a++)t=Math.imul(t^e.charCodeAt(a),16777619)>>>0,n=Math.imul(n^e.charCodeAt(a),1540483477)>>>0;let r="0";for(let a=0;a<25;a++){let s=a%2==0?t:n;r+="0123456789ABCDEFGHJKMNPQRSTVWXYZ"[s>>>a*5%27&31],a%2==1?t=Math.imul(t^n>>>7,16777619)>>>0:n=Math.imul(n^t>>>11,1540483477)>>>0}return r}function NF(e,t,n){let r=e;for(let a of t.slice(0,-1))r=r[a];r[t.at(-1)]=n}function EC(e){let{fixes:t}=kF(e,SF);if(t.length===0)return e;let n=structuredClone(e);for(let r of t)if(r.op==="rename"){let a=n.layout;a[r.id]=a[r.key],delete a[r.key]}else NF(n,r.path,r.id);return n}var jF=(e,t)=>JSON.stringify(ma(e))===JSON.stringify(ma(t));function $C(e,t){let{id:n,subflow:r,tested:a,handler:s,...l}=t,f={...l};s!==void 0&&f.purpose===void 0&&(f.purpose=s),r?.boundary&&(f.boundary=r.boundary);let p=Ws(e).filter(h=>h.node===t.id).map(h=>`${h.area}:${h.what}${h.reason?` (${h.reason})`:""}`).sort();return p.length>0&&(f.accepted=p),f}function U0(e,t){let n=[];for(let r of new Set([...Object.keys(e),...Object.keys(t)]))jF(e[r],t[r])||n.push({field:r,before:e[r],after:t[r]});return n}function Bd(e,t){let n=[];for(let r=t;r!==on;){let a=e.nodes.get(r);if(!a)break;n.unshift(a.node.title),r=a.level}return n}function CF(e,t,n){let r=t.nodes.get(n)?.level;return(r&&r!=="root"?t.nodes.get(r)?.node.subflow?.layout:void 0)?.[n]??e.layout?.[n]}function EF(e,t,n){return`${e}|${t.node}.${t.port}>${n.node}.${n.port}`}function _C(e,t=n=>n){let n=new Map;for(let r of e.levels.values())for(let a of r.edges)a?.from&&a.to&&n.set(EF(r.id==="root"?on:t(r.id),{...a.from,node:t(a.from.node)},{...a.to,node:t(a.to.node)}),{level:r.id,edge:a.id,from:a.from,to:a.to});return n}var Y0=(e,t)=>{let n=e.nodes.get(t);return n?`${n.level==="root"?"":Y0(e,n.level)}/${n.node.key}:${n.node.type}`:""};function $F(e,t){let n=new Map;for(let a of e.nodes.keys())t.nodes.has(a)&&n.set(a,a);let r=new Map;for(let a of t.nodes.keys())e.nodes.has(a)||r.set(Y0(t,a),a);for(let a of e.nodes.keys()){if(n.has(a))continue;let s=Y0(e,a),l=r.get(s);l&&(n.set(a,l),r.delete(s))}return n}function TC(e,t){let n=EC(e),r=EC(t),a=Ro(n),s=Ro(r),l=$F(a,s),f=new Map([...l].map(([$,L])=>[L,$])),p=[];for(let[$,{node:L,level:z}]of s.nodes){let A=f.get($),M=A?a.nodes.get(A):void 0,O={id:$,key:L.key,title:L.title,type:L.type,level:z,where:Bd(s,z)};if(!M){p.push({...O,kind:"added",fields:[]});continue}let K=U0($C(n,M.node),$C(r,L));(l.get(M.level)??M.level)!==z&&K.unshift({field:"level",before:Bd(a,M.level).join(" \u203A ")||"top level",after:O.where.join(" \u203A ")||"top level"}),K.length>0&&p.push({...O,kind:"changed",fields:K})}for(let[$,{node:L,level:z}]of a.nodes)l.has($)||p.push({id:$,kind:"removed",key:L.key,title:L.title,type:L.type,level:z,where:Bd(a,z),fields:[],position:CF(n,a,$)});let h=($,L)=>`${$.nodes.get(L.from.node)?.node.key??"?"}.${L.from.port} \u2192 ${$.nodes.get(L.to.node)?.node.key??"?"}`,v=_C(a,$=>l.get($)??$),g=_C(s),m=[...[...g].filter(([$])=>!v.has($)).map(([,$])=>({kind:"added",...$,label:h(s,$)})),...[...v].filter(([$])=>!g.has($)).map(([,$])=>({kind:"removed",...$,label:h(a,$)}))],b=_F(a,s,l,f),{version:w,id:k,...S}=n.flow,{version:N,id:E,...j}=r.flow;return{nodes:p,wires:m,annotations:b,flow:U0({...S,format:n.schema_version},{...j,format:r.schema_version})}}function AC(e,t){let n=t.kind??"note";return{kind:n,text:t.text,color:t.color??(n==="note"?"yellow":"gray"),...t.size?{size:t.size}:{},on:t.on?e.nodes.get(t.on)?.node.key??t.on:void 0}}function _F(e,t,n,r){let a=[],s=f=>String(f.text??"").split(`
|
|
157
|
+
`)[0]??"",l=new Set;for(let[f,{annotation:p,level:h}]of t.annotations){let v=h==="root"?on:r.get(h)??h,g=e.annotations.get(f)??[...e.annotations.values()].find(w=>!t.annotations.has(w.annotation.id)&&w.level===v&&w.annotation.key===p.key),m={id:f,key:p.key,annotation:p.kind??"note",label:s(p),level:h,where:Bd(t,h)};if(!g){a.push({...m,kind:"added",fields:[]});continue}l.add(g.annotation.id);let b=U0(AC(e,g.annotation),AC(t,p));b.length>0&&a.push({...m,kind:"changed",fields:b})}for(let[f,{annotation:p,level:h}]of e.annotations)l.has(f)||a.push({id:f,kind:"removed",key:p.key,annotation:p.kind??"note",label:s(p),level:n.get(h)??h,where:Bd(e,h),fields:[]});return a}function TF(e,t,n){let r=a=>{for(let s=a;s!==on;){if(s===n)return!0;let l=t.nodes.get(s);if(!l)return!1;s=l.level}return!1};return e.nodes.filter(a=>a.kind!=="removed"&&r(a.level)).length+e.nodes.filter(a=>a.kind==="removed"&&(a.level===n||r(a.level))).length}var AF={impl:"binding",settings:"settings",inputs:"inputs",outputs:"outputs",accepted:"accepted",boundary:"boundary"},X0=e=>AF[e.field]??e.field,MF=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function OF(e,t){let n={lens:"changes",chips:{},stats:[],sections:[],findings:[],notes:[]};if(!t)return n.notes.push("Reading the versions of this flow from Git\u2026"),n;if(n.stats.push({label:"Compared with",value:t.label}),t.state!=="ready"||!t.base)return n.notes.push(t.state==="loading"?`Reading ${t.label}\u2026`:t.error??`${t.label} has no version of this flow`),n;let r=TC(t.base,e),a=Ee(e),s=m=>m.length?m.join(" \u203A "):"top level",l=[],f=[],p=[];for(let m of r.nodes)if(m.kind==="changed"){let b=m.fields.map(X0);n.chips[m.id]=[{text:`changed: ${b.join(", ")}`,title:b.join(", ")}],l.push({key:m.id,label:m.title,value:b.join(", "),detail:s(m.where),nodes:[m.id]})}else m.kind==="added"?(n.chips[m.id]=[{text:"added"}],f.push({key:m.id,label:m.title,detail:s(m.where),nodes:[m.id]})):p.push({key:m.id,label:m.title,detail:`was on ${s(m.where)}`,nodes:[],tone:"muted"});for(let{node:m}of a.nodes.values()){if(m.type!=="subflow")continue;let b=TF(r,a,m.id);if(b===0)continue;let w={text:`${MF(b,"change")} inside`};n.chips[m.id]=[...n.chips[m.id]??[],w].slice(0,2)}n.ghosts=r.nodes.filter(m=>m.kind==="removed").map(m=>({id:m.id,title:m.title,type:m.type,level:m.level,position:m.position})),n.wires=Object.fromEntries(r.wires.filter(m=>m.kind==="added"&&m.edge).map(m=>[m.edge,"added"]));let h=r.wires.map(m=>({key:`${m.kind}:${m.label}`,label:`${m.kind==="added"?"+":"\u2212"} ${m.label}`,nodes:m.kind==="added"?[m.from.node,m.to.node].filter(b=>a.nodes.has(b)):[],tone:m.kind==="removed"?"muted":void 0})),v=r.flow.map(m=>({key:m.field,label:m.field,nodes:[]}));n.annotations=Object.fromEntries(r.annotations.filter(m=>m.kind!=="removed").map(m=>[m.id,m.kind]));let g=r.annotations.map(m=>({key:`annotation:${m.kind}:${m.id}`,label:`${m.kind==="added"?"+":m.kind==="removed"?"\u2212":"~"} ${m.annotation} ${m.key}: ${m.label}`,detail:m.kind==="changed"?m.fields.map(X0).join(", "):s(m.where),nodes:[],tone:m.kind==="removed"?"muted":void 0}));return n.stats.push({label:"Changed",value:String(l.length)},{label:"Added",value:String(f.length)},{label:"Removed",value:String(p.length)},{label:"Wires",value:`+${r.wires.filter(m=>m.kind==="added").length} \u2212${r.wires.filter(m=>m.kind==="removed").length}`}),r.annotations.length>0&&n.stats.push({label:"Annotations",value:["added","changed","removed"].map(m=>`${m==="added"?"+":m==="removed"?"\u2212":"~"}${r.annotations.filter(b=>b.kind===m).length}`).join(" ")}),n.sections.push({title:"Changed",items:l,empty:"No node changed"},{title:"Added",items:f,empty:"No node added"},{title:"Removed",items:p,empty:"No node removed"},{title:"Wires",items:h,empty:"No wire added or removed"},{title:"Flow",items:v,empty:"Name, goal, inputs and runtime unchanged"}),g.length>0&&n.sections.push({title:"Annotations",items:g,empty:""}),r.nodes.length+r.wires.length+r.flow.length+r.annotations.length===0&&n.notes.push(`No changes since ${t.label}`),n}function MC(e){let[t="",n]=e.trim().split(/[-+]/,2);return{nums:t.split(".").map(r=>Number.parseInt(r,10)||0),pre:n!==void 0}}function PF(e,t){let n=MC(e),r=MC(t);for(let a=0;a<Math.max(n.nums.length,r.nums.length,3);a++){let s=(n.nums[a]??0)-(r.nums[a]??0);if(s!==0)return s}return Number(r.pre)-Number(n.pre)}function DF(e,t){for(let n of t.split(",")){let r=n.trim();if(!r||r==="*")continue;let a=/^(==|!=|>=|<=|>|<)?\s*(.+)$/.exec(r);if(!a)return!1;let s=PF(e,a[2]);if(!(a[1]==="!="?s!==0:a[1]===">="?s>=0:a[1]==="<="?s<=0:a[1]===">"?s>0:a[1]==="<"?s<0:s===0))return!1}return!0}function LF(e){return e.replace(/^[a-z]+:\s*/,"")}function IF(e){return e.split(".").at(-1)??e}function RF(e,t){let n=Ee(e),r={},a=[],s=t?LF(t.environment):void 0,l=new Map,f=new Map,p=0;for(let{node:b}of n.nodes.values()){if(!qo(b))continue;let w=b.impl,k=t?.nodes[b.id],S=b.settings?.execution_environment??s,N=[];if(w?.ref){p++;let j=k?.version;N.push({text:`${IF(w.ref)}${j?` ${j}`:""}`,title:`${w.kind} ${k?.fqcn??w.ref}${k?.collection?` (${k.collection})`:""}`,tone:k&&k.state!=="ok"&&k.state!=="unknown"?"warn":void 0}),k?.collection&&l.set(k.collection,(l.get(k.collection)??new Set).add(b.id))}else(b.type==="task"||b.type==="subflow")&&N.push({text:b.subflow?.nodes?.length?"inner steps":"TODO stub",tone:"muted"});if(S&&(N.push({text:S,title:b.settings?.execution_environment?"node execution environment":"flow environment"}),f.set(S,(f.get(S)??new Set).add(b.id))),r[b.id]=N.slice(0,2),!w?.ref||!k)continue;let E={lens:"code",node:b.id,nodes:[b.id],fixes:[]};k.state==="not-in-ee"?a.push({...E,id:`code:not-in-ee:${b.id}`,severity:"warning",title:`${b.title}: ${w.ref} is not in the environment`,detail:`${t?.environment??"The environment"} has no ${w.kind} ${w.ref}${k.collection?`; ${k.collection} is not installed there`:""}. Add the collection to the EE or bind another ${w.kind}.`,fixes:[{label:"Open Details",properties:b.id}]}):(k.state==="removed"||k.state==="deprecated")&&a.push({...E,id:`code:${k.state}:${b.id}`,severity:"warning",title:`${b.title}: ${k.fqcn??w.ref} is ${k.state}`,detail:k.why?`${k.why}`:`The catalog marks ${k.fqcn??w.ref} as ${k.state}.`,fixes:[{label:"Open Details",properties:b.id}]}),b.settings?.execution_environment&&s&&b.settings.execution_environment!==s&&a.push({...E,id:`code:ee-override:${b.id}`,severity:"info",title:`${b.title} runs in ${b.settings.execution_environment}`,detail:`The flow's environment is ${s}; the catalog and checks describe that one, not ${b.settings.execution_environment}.`})}let h=t?.requirements?.pins??{},v=[...l.entries()].map(([b,w])=>{let k=t?.collections[b],S=h[b],N=!S||k!==void 0&&DF(k,S);return N||a.push({id:`code:outdated:${b}`,lens:"code",severity:"warning",title:k?`${b} ${k} does not meet requirements (${S})`:`${b} is required (${S}) but not installed`,detail:`${t?.requirements?.path??"requirements.yml"} asks for ${b} ${S}; ${t?.environment??"the environment"} has ${k??"none"}. ${ih([...w].map(E=>go(n,E)))} use it. Rebuild the EE from the requirements.`,nodes:[...w],fixes:[]}),{key:`collection:${b}`,label:b,value:k??"missing",detail:[Pn(w.size,"node"),S?`requires ${S}`:"not pinned"].join(" \xB7 "),nodes:[...w],tone:N?void 0:"warn"}}).sort((b,w)=>b.label.localeCompare(w.label)),g=[...f.entries()].map(([b,w])=>({key:`ee:${b}`,label:b,detail:Pn(w.size,"node"),nodes:[...w]})),m=[];return t?.ready||m.push(`No catalog of the environment yet: open a node's properties, or run "Rebuild Module Catalog".`),t?.ready&&!t.requirements&&m.push("No collections/requirements.yml in the repository: versions are not compared."),{lens:"code",chips:r,stats:[{label:"bound nodes",value:String(p)},{label:"collections",value:String(l.size)},...s?[{label:"environment",value:s}]:[]],sections:[{title:"Collections in use",items:v,empty:"No bound node uses a collection."},{title:"Execution environments",items:g,empty:"No environment configured."}],findings:a,notes:m}}function zF(e){let t=Ee(e),n=e.flow.inputs??{},r=t.levels.get(on)?.nodes.find(b=>b?.type==="start")?.id,a={},s=new Map,l=[],f=new Map,p=new Map,h=(b,w,k,S)=>{if(b===w)return;let N=`data:${b}>${w}`,E=s.get(N);E?E.label.split(", ").includes(k)||(E.label=`${E.label}, ${k}`,E.title=`${E.title}
|
|
158
|
+
${S}`):s.set(N,{id:N,from:b,to:w,label:k,title:S})};for(let{node:b,level:w}of t.nodes.values()){if(!qo(b))continue;let k=Object.keys(b.inputs??{}),S=Object.keys(b.outputs??{});a[b.id]=[jC("in: ",k),jC("out: ",S)].filter(E=>!!E);let N=qF(b);for(let[E,j]of Object.entries(b.inputs??{})){let $=j?.from,L=N.get(E)?.join(", "),z=L?` \xB7 ${L}`:"";if(!$){j?.default===void 0&&j?.type!=="host_list"&&l.push({id:`data:unfed:${b.id}.${E}`,lens:"data",severity:"warning",title:`${b.title} has no value for ${E}`,detail:`The input ${E} has no default and no \`from:\`. Wire it to a flow input or an upstream output.`,node:b.id,nodes:[b.id],fixes:[{label:"Open Details",properties:b.id}]});continue}let A=F0(t,b,w,"inputs",$);if(A.kind==="impl"||A.kind==="subflowInput")continue;if(A.kind==="unresolved"){l.push(FF(b.id,b.title,E,$,A.why));continue}if(A.kind==="flow"){let oe=A.name;p.set(oe,(p.get(oe)??new Set).add(b.id));let F=r?NC(t,b.id,on):void 0;r&&F&&h(r,F,oe,`flow.${oe} \u2192 ${b.title}.${E}${z}`);continue}let M=A.node.id,O=t.nodes.get(M);if(!O)continue;let K=A.name,B=`${M}.${K}`;f.set(B,(f.get(B)??new Set).add(b.id));let V=NC(t,b.id,O.level);V&&h(M,V,K===E?K:`${K} \u2192 ${E}`,`${$} \u2192 ${b.title}.${E}${z}`)}}for(let{node:b}of t.nodes.values())for(let w of b.type==="subflow"?Object.keys(b.outputs??{}):[]){let k=sC(b,w);if(!k||!("inner"in k))continue;let S=`${k.inner.id}.${k.output}`;f.set(S,(f.get(S)??new Set).add(b.id))}let v=[];for(let{node:b}of t.nodes.values())for(let w of Object.keys(b.outputs??{})){let k=[...f.get(`${b.id}.${w}`)??[]];v.push({key:`var:${b.id}.${w}`,label:`${b.key}.${w}`,detail:k.length?`read by ${k.map(S=>go(t,S)).join(", ")}`:"not read",nodes:[b.id,...k],tone:k.length?void 0:"muted"}),k.length===0&&l.push({id:`data:unused-output:${b.id}.${w}`,lens:"data",severity:"info",title:`${b.title} writes ${w}, which nothing reads`,detail:`No node input refers to ${b.key}.${w}. Remove the output, or wire it where it is needed.`,node:b.id,nodes:[b.id],fixes:[{label:"Open Details",properties:b.id}]})}let g=Object.keys(n).map(b=>{let w=[...p.get(b)??[]];return{key:`input:${b}`,label:`flow.${b}`,detail:w.length?`read by ${w.map(k=>go(t,k)).join(", ")}`:"not read by a node input",nodes:w,tone:w.length?void 0:"muted"}}),m=[...s.values()];return{lens:"data",chips:a,dataWires:m,stats:[{label:"data wires",value:String(m.length)},{label:"unresolved",value:String(l.filter(b=>b.severity==="warning").length)},{label:"unused outputs",value:String(l.filter(b=>b.id.startsWith("data:unused")).length)}],sections:[{title:"Flow inputs",items:g,empty:"The flow has no inputs."},{title:"Node outputs",items:v,empty:"No node declares outputs."}],findings:l,notes:m.length===0?["No data wires: no node input has a from: reference."]:[]}}function FF(e,t,n,r,a){return{id:`data:unresolved:${e}.${n}`,lens:"data",severity:"warning",title:`${t}: ${n} reads ${r}, which does not exist`,detail:`"${r}" ${a}.`,node:e,nodes:[e],fixes:[{label:"Open Details",properties:e}]}}var BF={retries:"Retries",delay:"Delay",timeout:"Timeout"};function qF(e){let t=new Map;for(let[n,r]of Object.entries(BF)){let a=e.settings?.[n];if(Yf(a))for(let s of nC(a))t.set(s,[...t.get(s)??[],r])}return t}function HF(e,t,n,r){let a=t?.nodes[n.id]?.[r];return a===void 0?n.type==="subflow"&&e.levels.has(n.id)?Z0(e,t,n.id,r):0:a}function Z0(e,t,n,r){let a=e.levels.get(n);if(!a)return 0;let s=new Map;for(let g of a.edges)g?.from&&g.to&&s.set(g.from.node,[...s.get(g.from.node)??[],g.to.node]);let l=new Map,f=new Set,p=g=>{let m=l.get(g);if(m!==void 0)return m;if(f.has(g))return 0;f.add(g);let b=a.nodes.find(S=>S?.id===g),w=b?HF(e,t,b,r):0,k=Math.max(0,...(s.get(g)??[]).map(p));return f.delete(g),l.set(g,w+k),w+k},h=new Set(a.edges.map(g=>g?.to?.node)),v=a.nodes.filter(g=>g&&(g.type==="start"||!h.has(g.id)));return Math.max(0,...v.map(g=>p(g.id)))}function OC(e){let t=e.settings??{},n=[];return t.serial!==void 0&&n.push(`serial ${t.serial}`),t.timeout&&n.push(n.length?t.timeout:`timeout ${t.timeout}`),n.length===0&&t.retries&&n.push(`retries ${t.retries}`),n.length?{text:n.join(" \xB7 ")}:void 0}function VF(e,t){let n=Ee(e),r={},a=[],s=[];for(let{node:w}of n.nodes.values()){if(!qo(w))continue;let k=[],S=OC(w);S&&k.push(S);let N=t?.nodes[w.id];if(N&&k.push({text:N.runs>1?`avg ${Ut(N.avg)}`:`last ${Ut(N.last)}`,title:`${Pn(N.runs,"run")}: avg ${Ut(N.avg)}, p95 ${Ut(N.p95)}`}),r[w.id]=k.slice(0,2),N){s.push({key:`node:${w.id}`,label:w.title,value:Ut(N.avg),detail:`p95 ${Ut(N.p95)} \xB7 ${Pn(N.runs,"run")}`,nodes:[w.id]});let E=ga(w.settings?.timeout);E&&N.p95>.8*E&&a.push({id:`timing:timeout:${w.id}`,lens:"timing",severity:"info",title:`${w.title} runs close to its timeout`,detail:`p95 ${Ut(N.p95)} against a timeout of ${w.settings?.timeout}: a slow host will time out.`,node:w.id,nodes:[w.id],fixes:[]})}}let l=Z0(n,t,on,"avg"),f=Z0(n,t,on,"p95"),p=e.flow.maintenance_window,h=ga(p),v=[],g=[...n.nodes.values()].filter(w=>qo(w.node)&&w.node.type!=="subflow"),m=g.filter(w=>!t?.nodes[w.node.id]).length;!t||t.runs===0?v.push("No runs in the history yet: durations appear after the first run from VS Code."):m>0&&v.push(`${Pn(m,"node")} ${m===1?"has":"have"} no measurement and count${m===1?"s":""} as 0 in the estimate.`),h||v.push("No maintenance window: set one in the flow description to check the estimate."),h&&t?.runs&&(l>h?a.push({id:"timing:window",lens:"timing",severity:"warning",title:`The flow does not fit its ${p} window`,detail:`The slowest path takes about ${Ut(l)} on average over ${Pn(t.runs,"run")} (p95 ${Ut(f)}). Raise serial, split the flow, or widen the window.`,nodes:[],fixes:[]}):f>h&&a.push({id:"timing:window-p95",lens:"timing",severity:"info",title:`Slow runs overrun the ${p} window`,detail:`On average the slowest path takes ${Ut(l)}, but p95 is ${Ut(f)}.`,nodes:[],fixes:[]}));let b=g.filter(w=>w.node.settings?.timeout||w.node.settings?.serial!==void 0).map(w=>({key:`limit:${w.node.id}`,label:go(n,w.node.id),value:OC(w.node)?.text,nodes:[w.node.id]}));return{lens:"timing",chips:r,stats:[{label:"window",value:p??"not set"},{label:"estimate",value:t?.runs?Ut(l):"-"},{label:"p95",value:t?.runs?Ut(f):"-"},{label:"runs",value:String(t?.runs??0)}],sections:[{title:"Slowest nodes",items:s.sort((w,k)=>(t?.nodes[k.nodes[0]]?.avg??0)-(t?.nodes[w.nodes[0]]?.avg??0)).slice(0,8),empty:"No measurements yet."},{title:"Serial and timeouts",items:b,empty:"No node sets serial or a timeout."}],findings:a,notes:v}}function KF(e,t,n,r){let a=e==="inventory"?gF(t,n.inventory,r,n.code):e==="data"?zF(t):e==="code"?RF(t,n.code):e==="access"?bF(t,n.inventory,n.code):e==="changes"?OF(t,n.compare):VF(t,n.timing),s=new Map(Ws(t).filter(f=>f.area==="lens").map(f=>[f.what,{reason:f.reason??"",by:f.by}])),l=f=>(f.accepted?2:0)+(f.severity==="warning"?0:1);return a.findings=a.findings.map(f=>s.has(f.id)?{...f,accepted:s.get(f.id)}:f).sort((f,p)=>l(f)-l(p)),a}function WF(e,t,n,r){let a=Ee(e),s=[],l=(w,k)=>{k&&s.push({label:w,value:k})},f=n.inventory?.state==="ready"?n.inventory.facts:void 0,p=f?.targets??n.inventory?.targets??"",h=W0(e,t,p,n.code)?.pattern??p;if(h){let w=f?.patterns[h]?.count,k=r?.summary?Kf(r.summary,t.id).length:void 0;l("hosts",`${h}${w===void 0?"":` \xB7 ${w}`}${k?` \u2192 ${k}`:""}`)}let v=kC(a,t.id);v.length>0&&l("limit",`${v[0]?.port} from ${go(a,v[0]?.from??"")}${v.length>1?` +${v.length-1}`:""}`),l("inputs",Object.keys(t.inputs??{}).join(", ")),l("outputs",Object.keys(t.outputs??{}).join(", "));let g=n.code?.nodes[t.id];t.impl?.ref&&l(t.impl.kind,`${t.impl.ref}${g?.version?` ${g.version}`:""}`),g?.collection&&l("collection",`${g.collection}${n.code?.collections[g.collection]?` ${n.code.collections[g.collection]}`:""}`),l("credential",t.settings?.credential),t.settings?.become&&l("become","yes");let m=t.settings??{};l("serial",[m.serial===void 0?"":`${m.serial}`,m.timeout?`timeout ${m.timeout}`:"",m.retries?`retries ${m.retries}`:""].filter(Boolean).join(" \xB7 "));let b=n.timing?.nodes[t.id];if(b)l("duration",`avg ${Ut(b.avg)} \xB7 p95 ${Ut(b.p95)}`);else if(ga(m.timeout)===void 0&&r?.summary?.timings?.[t.id]){let w=r.summary.timings[t.id];w&&l("duration",`last ${Ut(w.end-w.start)}`)}return s}var G0=/^[a-z0-9]+(-[a-z0-9]+)*$/;function PC(e,t="node"){return e.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||t}function UF(e,t){if(!t.has(e))return e;for(let n=2;;n++){let r=`${e}-${n}`;if(!t.has(r))return r}}function va(e){let t=Ee(e),n=new Map,r=a=>{let s=t.nodes.get(a);if(!s)return"";let l=t.nodes.get(s.level);return l?`${r(l.node.id)}/${s.node.key}`:s.node.key};for(let{node:a}of t.nodes.values())n.set(r(a.id),a);return n}function DC(e){let t=Object.entries(e.flow.inputs??{}).filter(([,n])=>n?.type==="host_list");return(t.find(([,n])=>n.targets)??t[0])?.[0]}var YF=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function LC(e,t){let n=DC(e),r=n&&YF(t?.inputs)?t.inputs[n]:void 0,a=Array.isArray(r)?r:typeof r=="string"?r.split(","):[];return[...new Set(a.map(s=>String(s).trim()).filter(Boolean))]}var IC=e=>e.filter(t=>t.severity!=="warning");function ah(e,t){if(t==="(dropped out)")return"dropped out of the run";let n=va(e),r=n.get(t);if(r)return r.title||r.key;let a=t.lastIndexOf("."),s=a>0?n.get(t.slice(0,a)):void 0;return s?`${s.title||s.key}'s open ${t.slice(a+1)}`:t}function XF(e,t,n=!1){return`${t.host} ${RC(e,t,n)}`}function RC(e,t,n=!1){let r=a=>{let s=e?ah(e,a):a;return n&&s!==a?`${s} (${a})`:s};return`${t.actual==="(dropped out)"?"dropped out of the run":t.actual==="not run"||t.actual==="no run"?"did not run":`ended at ${r(t.actual)}`}; the scenario expected ${r(t.expected)}`}var ZF={failed:"fail",unreachable:"be unreachable",timeout:"time out",unchanged:"report no change",false:"decide false"};function Q0(e,t){let n=e?va(e).get(t.step):void 0;return`the scenario forces ${n?.title||n?.key||t.step} to ${ZF[t.outcome]??t.outcome} for it (force: ${t.outcome}), so it leaves by ${t.port}`}function zC(e,t,n,r){if(!t?.length)return;let a=va(e);return t.find(s=>s.host===n&&a.get(s.step)?.id===r)}function GF(e,t,n,r=!1){let a=(n??[]).filter(s=>s.host===t.host).map(s=>Q0(e,s));return`${XF(e,t,r)}${a.length?`, because ${a.join(" and ")}`:""}`}function FC(e,t){return{id:`scenario:${e.name}`,mode:"check",state:e.summary?"done":"error",startedAt:t,finishedAt:t,source:"scenario",rc:e.passed?0:2,...e.summary?{summary:e.summary}:{},...e.error?{error:e.error}:{},scenario:{name:e.name,passed:e.passed,hosts:e.hosts,...e.error?{error:e.error}:{},...e.forced?.length?{forced:e.forced}:{}}}}function J0(e){return e.hosts.filter(t=>t.expected!==t.actual)}function QF(e,t,n,r){let a=new Set;for(let[p,h]of va(e))h.id===r&&a.add(p);let s=Ee(e).nodes.get(r)?.node.key;s&&a.add(s);let l=new Set(n.summary?Wf(Ee(e),n.summary,r):[]),f=new Map;for(let p of t.hosts){let h=a.has(p.expected);(h||l.has(p.host))&&f.set(p.host,{host:p.host,expected:h,ended:p.actual,ok:p.expected===p.actual})}for(let p of l)f.has(p)||f.set(p,{host:p,expected:!1,ended:s??"here",ok:!0});return[...f.values()].sort((p,h)=>p.host.localeCompare(h.host))}var ey=(e,t)=>JSON.stringify(ma(e))===JSON.stringify(ma(t));function JF(e,t){let n=Ee(t),r=new Set;for(let a of e.nodes)for(let s=n.nodes.get(a)?.level;s&&s!=="root";s=n.nodes.get(s)?.level)r.add(s);return[...r]}function e5(e){let t=(l,f)=>`${l} ${f}${l===1?"":"s"}`,n=[e.nodes.length?t(e.nodes.length,"step"):"",e.edges.length?t(e.edges.length,"wire"):""].filter(Boolean),r=(e.wires??[]).filter(l=>l.kind==="removed").length,a=[e.removed?`${t(e.removed,"step")} removed`:"",r?`${t(r,"wire")} removed`:"",e.flow?.length?`the flow's ${e.flow.join(", ")} changed`:""].filter(Boolean);if(!n.length){let[l="",...f]=a;return`${[`${l.charAt(0).toUpperCase()}${l.slice(1)}`,...f].join(", ")} outside the designer`}let s=a.length?`, ${a.join(", ")}`:"";return`${n.join(" and ")} changed outside the designer${s}`}function t5(e,t=new Date){let n=new Date(e),r=n.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return n.toDateString()===t.toDateString()?r:`${n.toLocaleDateString([],{day:"numeric",month:"short"})}, ${r}`}var n5={impl:"binding",accepted:"accepted findings"};function BC(e,t){let n=e??{},r=t??{};return[...new Set([...Object.keys(n),...Object.keys(r)])].filter(a=>!ey(n[a],r[a]))}function o5(e,t){let n=e,r=t;if(!n?.ref&&r?.ref)return`bound to ${r.ref}`;if(n?.ref&&!r?.ref)return"binding removed";if(n?.ref!==r?.ref)return`bound to ${r?.ref} instead of ${n?.ref}`;let a=[...BC(n?.params,r?.params),...ey(n?.register,r?.register)?[]:["register"],...ey(n?.keywords,r?.keywords)?[]:["task keywords"]];return`binding changed${a.length?` (${a.join(", ")})`:""}`}function ty(e){let t=e.where.length?`, in ${e.where[e.where.length-1]}`:"";if(e.kind==="added")return`Added ${e.title}${t}${e.after?`, after ${e.after}`:""}`;if(e.kind==="removed")return`Removed ${e.title}${t}`;let n="",r=[];for(let a of e.fields)a.field==="title"?n=`Renamed ${String(a.before)} to ${String(a.after)}${t}`:a.field==="impl"?r.push(o5(a.before,a.after)):a.field==="settings"?r.push(`settings changed (${BC(a.before,a.after).join(", ")})`):a.field==="level"?r.push("moved to another level"):r.push(`${n5[a.field]??a.field} changed`);return n?[n,...r].join("; "):`${e.title}${t}: ${r.join(", ")||"changed"}`}function r5(e){return[...(e.changes??[]).map(t=>({id:t.kind==="removed"?void 0:t.id,text:ty(t)})),...(e.wires??[]).map(t=>({text:`Wire ${t.kind==="added"?"added":"removed"}: ${t.words??t.label}`})),...(e.flow??[]).map(t=>({text:`The flow's ${t} changed`}))]}var qC={quickAdd:null,portMenu:null,contextMenu:null,pick:null,decide:null,ignore:null,accept:null,testedReason:null,cheatSheet:!1,preview:null,find:!1},i5={quickAdd:[],portMenu:["contextMenu"],contextMenu:["portMenu","preview"],pick:["portMenu"],decide:["portMenu"],ignore:[],accept:[],testedReason:["contextMenu","portMenu"],cheatSheet:["contextMenu"],preview:[],find:["contextMenu","portMenu"],details:["preview","portMenu","contextMenu","quickAdd"],level:["portMenu","contextMenu","pick","quickAdd","decide","preview"],mode:["portMenu","contextMenu","pick","quickAdd","preview"]},a5=["portMenu","contextMenu","pick","quickAdd","decide"],s5=["contextMenu","portMenu","cheatSheet","quickAdd","decide","ignore","accept","testedReason","find","pick"];function Ho(e){return Object.fromEntries(i5[e].map(t=>[t,qC[t]]))}function HC(e,t){return!!e[t]}var ba,qd,sh=!1,VC=!1,l5={info:4e3,success:4e3,error:9e3},d5=0,Hd={min:260,initial:340,max:720};function lh(e,t){return e?.doc&&t?.summary?Dz(e.doc,t.summary):null}function Js(e,t,n,r){return e?.doc&&t?KF(t,e.doc,n,r):null}function KC(e,t){return e?.doc&&t?sF(e.doc,t):null}var _=C4((e,t)=>({snapshot:null,testMode:!1,viewer:!1,runner:!1,expandSubflows:!1,expandedSubflows:[],firstFlow:null,selection:{},quickAdd:null,portMenu:null,contextMenu:null,focusRequest:null,renaming:null,zoomNonce:0,cheatSheet:!1,find:!1,findQuery:"",findNonce:0,centerOn:null,pick:null,pickAt:null,decide:null,bannerDismissedAt:null,formatDismissed:!1,optimistic:{},toasts:[],saving:!1,run:null,runAsked:!1,pastRuns:[],launch:null,scenarios:null,scenarioCheck:null,scenarioUndo:0,scenariosOpen:!1,scenariosTab:!1,scenarioEditing:null,hostPick:null,scenarioShown:null,runBeforeScenario:null,outside:null,outsideAround:[],repo:null,runNodes:null,level:on,preview:null,detailsTab:"general",bindKind:null,pendingBinding:null,leave:null,panelWidth:Hd.initial,expanded:!1,paletteCollapsed:!1,panelCollapsed:!1,annotationsHidden:!1,editingAnnotation:null,catalog:{state:"idle"},mode:"design",sync:{state:"idle"},drift:null,ignore:null,lens:null,lensTab:!1,lensScroll:0,lensFacts:{},lensView:null,highlight:null,accept:null,testedReason:null,setSnapshot(n){let r=t().snapshot;if(r&&n.docVersion<r.docVersion)return;let a=n.doc?.layout??{},s=Object.fromEntries(Object.entries(t().optimistic).filter(([S,N])=>{let E=a[S];return!(E&&E.x===Math.round(N.x)&&E.y===Math.round(N.y))})),l=n.doc?Ee(n.doc):void 0;for(let[S,N]of Object.entries(s)){let E=l?.annotations.get(S)?.annotation;E&&E.x===Math.round(N.x)&&E.y===Math.round(N.y)&&delete s[S]}let f=new Set(l?l.nodes.keys():[]),p=new Set(l?l.annotations.keys():[]),h=t().level,v=l?.levels.has(h)||l?.nodes.get(h)?.node.type==="subflow"?h:on,g=t().selection,m=g.node&&!f.has(g.node)||g.nodes?.some(S=>!f.has(S))||g.annotations?.some(S=>!p.has(S))?{}:g,b=S=>S!==void 0&&!f.has(S.node),w=t().contextMenu?.target,k=w?.kind==="node"&&!f.has(w.id)||w?.kind==="nodes"&&w.ids.some(S=>!f.has(S))||w?.kind==="edge"&&!l?.edges.has(w.id);e({snapshot:n,optimistic:s,selection:v===t().level?m:{},level:v,...b(t().portMenu?.ref)?{portMenu:null}:{},...k?{contextMenu:null}:{},...b(t().pick?.ref)?{pick:null}:{},...t().preview&&!f.has(t().preview?.node??"")?{preview:null}:{},drift:KC(n,t().sync.scan),runNodes:lh(n,t().run),lensView:Js(n,t().lens,t().lensFacts,t().run)})},setTestMode:n=>e({testMode:n}),setRunner:n=>e({runner:n}),setViewer(){t().viewer||(t().setMode("run"),e({viewer:!0,mode:"run",detailsTab:"run",leave:null}))},setExpandSubflows:n=>e({expandSubflows:n,...n?{}:{expandedSubflows:[]}}),toggleExpanded:n=>{let r=t().expandedSubflows;e({expandedSubflows:r.includes(n)?r.filter(a=>a!==n):[...r,n]})},setFirstFlow:n=>e({firstFlow:n}),select(n){let r=t().pendingBinding;if(r&&n.node!==r)return void e({leave:{kind:"select",selection:n}});let a=!!(n.node||n.nodes?.length||n.edge||n.annotations?.length),s=t().editingAnnotation;e({selection:n,...a?{lensTab:!1}:{},...s&&!n.annotations?.includes(s)?{editingAnnotation:null}:{}})},setAnnotationsHidden:n=>e({annotationsHidden:n}),editAnnotation:n=>e({editingAnnotation:n}),openQuickAdd:n=>e({quickAdd:n}),openPortMenu:n=>e({portMenu:n,...Ho("portMenu")}),openContextMenu:n=>{clearTimeout(ba),e({contextMenu:n,...Ho("contextMenu")})},requestFocus:n=>e({focusRequest:{field:n,nonce:Date.now()}}),setRenaming:n=>e({renaming:n}),zoomToSelection:()=>e({zoomNonce:t().zoomNonce+1}),showCheatSheet:n=>e({cheatSheet:n,...Ho("cheatSheet")}),setPick:n=>e({pick:n,pickAt:null,...Ho("pick")}),setPickAt:n=>e({pickAt:n}),setDecide:n=>e({decide:n,...Ho("decide")}),dismissBanner:n=>e({bannerDismissedAt:n}),setOptimistic:n=>e({optimistic:{...t().optimistic,...n}}),dropOptimistic:n=>{let r={...t().optimistic};for(let[a,s]of Object.entries(n)){let l=r[a];l&&l.x===s.x&&l.y===s.y&&delete r[a]}e({optimistic:r})},setError(n){n&&t().notify("error",n)},notify(n,r){let a=++d5;e({toasts:[...t().toasts.filter(s=>s.text!==r),{id:a,level:n,text:r}].slice(-4)}),setTimeout(()=>t().dismissToast(a),l5[n])},dismissToast:n=>e({toasts:t().toasts.filter(r=>r.id!==n)}),setRun(n){let r=t().runAsked&&!!n;(t().scenarioShown||t().scenarioEditing)&&e({scenarioShown:null,scenarioEditing:null,runBeforeScenario:null}),e({run:n,runNodes:lh(t().snapshot,n),lensView:Js(t().snapshot,t().lens,t().lensFacts,n),...r?{runAsked:!1}:{}}),r&&n?.state==="running"&&t().setMode("run")},setRunAsked:n=>e({runAsked:n}),setPastRuns:n=>e({pastRuns:n}),setRepo:n=>e({repo:n}),setOutside(n){let r=t().snapshot?.doc;e({outside:n,outsideAround:n&&r?JF(n,r):[]})},setScenarioCheck(n,r=0){e({scenarioCheck:n,scenarioUndo:r});let a=t().scenarioEditing;a&&t().editScenario(n.names.includes(a)?a:null)},openScenarios(){e({scenariosOpen:!0,scenariosTab:!0,lensTab:!1,panelCollapsed:!1})},showScenariosTab(n){e({scenariosTab:n,...n?{lensTab:!1}:{}})},closeScenarios(){t().scenarioEditing&&t().editScenario(null),e({scenariosOpen:!1,scenariosTab:!1})},editScenario(n){let{scenarioCheck:r,scenarioEditing:a,scenarioShown:s,snapshot:l,lens:f,lensFacts:p}=t(),h=n?r?.names.indexOf(n)??-1:-1,v=h>=0?r?.results[h]:void 0,g=a!==null||s!==null,m=v?FC(v,new Date().toISOString()):t().runBeforeScenario;(v||g)&&(e({...v&&!g?{runBeforeScenario:t().run}:{},...v?{}:{runBeforeScenario:null},scenarioEditing:v?v.name:null,scenarioShown:null,run:m,runNodes:lh(l,m),lensView:Js(l,f,p,m)}),v&&!a&&t().setMode("run"))},setHostPick:n=>e({hostPick:n}),setScenarios(n,r){e({scenarios:n}),r&&t().showScenario(r)},showScenario(n){let{scenarios:r,scenarioShown:a,scenarioEditing:s,snapshot:l,lens:f,lensFacts:p}=t(),h=n?r?.find(m=>m.name===n):void 0,v=a!==null||s!==null,g=h?FC(h,new Date().toISOString()):v?t().runBeforeScenario:t().run;e({...h&&!v?{runBeforeScenario:t().run}:{},...h?{}:{runBeforeScenario:null},scenarioShown:h?h.name:null,scenarioEditing:null,run:g,runNodes:lh(l,g),lensView:Js(l,f,p,g)}),h&&t().setMode("run")},setLaunch:(n,r)=>e({launch:n,launchNotice:r}),setLaunchFacts(n,r,a){let s=t().launch;s?.token===n&&e({launch:{...s,facts:r,factsError:r?void 0:a}})},setLens(n){e({lens:n,lensTab:n!==null&&!t().pendingBinding,highlight:null,lensView:Js(t().snapshot,n,t().lensFacts,t().run)})},showLensTab(n){if(n&&t().pendingBinding)return void e({leave:{kind:"lensTab"}});e({lensTab:n,...n?{scenariosTab:!1}:{}})},setLensFacts(n){let r={...t().lensFacts,...n};e({lensFacts:r,lensView:Js(t().snapshot,t().lens,r,t().run)})},setHighlight:n=>e({highlight:n}),setAccept:n=>e({accept:n}),setTestedReason:n=>e({testedReason:n,...Ho("testedReason")}),setLevel(n){if(n!==t().level){if(t().pendingBinding)return void e({leave:{kind:"level",level:n}});clearTimeout(ba),e({level:n,selection:{},...Ho("level")})}},setPreview(n){clearTimeout(ba),clearTimeout(qd),sh=!1,e({preview:n})},hoverNode(n,r){clearTimeout(ba),!n||!r?(clearTimeout(qd),qd=setTimeout(()=>{sh||e({preview:null})},200)):(clearTimeout(qd),t().preview?.node!==n&&(ba=setTimeout(()=>{let a=t();a5.some(s=>HC(a,s))||VC||e({preview:{node:n,x:r.right+12,y:r.top,left:r.left}})},400)))},portHover(n){VC=n,n&&(clearTimeout(ba),sh||e({preview:null}))},holdPreview(n){sh=n,n?clearTimeout(qd):t().hoverNode(null)},openDetails(n,r="general",a){clearTimeout(ba);let s=t().pendingBinding;if(s&&s!==n)return void e({leave:{kind:"details",node:n,tab:r,bindKind:a}});e({selection:{node:n},detailsTab:r,bindKind:a?{node:n,kind:a}:null,...Ho("details")})},setDetailsTab:n=>e({detailsTab:n}),setPendingBinding:n=>e({pendingBinding:n}),resolveLeave(n){let r=t().leave;e({leave:null}),r&&n!=="stay"&&(e({pendingBinding:null}),r.kind==="select"?t().select(r.selection):r.kind==="level"?t().setLevel(r.level):r.kind==="mode"?t().setMode(r.mode):r.kind==="reveal"?t().reveal(r.node):r.kind==="collapse"?t().setPanelCollapsed(!0):r.kind==="lensTab"?t().showLensTab(!0):t().openDetails(r.node,r.tab,r.bindKind))},setPanelWidth:n=>e({panelWidth:Math.round(Math.min(Hd.max,Math.max(Hd.min,n)))}),setExpanded:n=>e({expanded:n}),setPaletteCollapsed:n=>e({paletteCollapsed:n}),setPanelCollapsed(n){if(n&&t().pendingBinding)return void e({leave:{kind:"collapse"}});e({panelCollapsed:n})},openFind:n=>e(n?{find:!0,findNonce:t().findNonce+1,...Ho("find")}:{find:!1}),setFindQuery:n=>e({findQuery:n}),setMode(n){if(n===t().mode||t().viewer)return;if(t().pendingBinding)return void e({leave:{kind:"mode",mode:n}});let r=t().detailsTab;e({mode:n,detailsTab:n==="code"?"code":n==="run"?"run":r==="code"||r==="run"?"general":r,...Ho("mode")})},setSync(n){e({sync:n,drift:KC(t().snapshot,n.scan)})},setIgnore:n=>e({ignore:n}),setCatalog:n=>e({catalog:n}),reveal(n){let r=t().pendingBinding;if(r&&r!==n)return void e({leave:{kind:"reveal",node:n}});let a=t().snapshot?.doc,s=a?Ee(a):void 0,l=s?.annotations.get(n);if(l){t().setLevel(l.level),e({selection:{annotations:[n]},centerOn:n,annotationsHidden:!1});return}let f=s?.nodes.get(n);f&&(t().setLevel(f.level),e({selection:{node:n},centerOn:n}))}}));async function Pe(e){let t=await la(e);return t.ok||_.getState().setError(t.error??"The change was refused"),t}function WC(e){let t=_.getState();t.setMode(e),e==="code"&&t.sync.state==="idle"&&je({type:"sync"})}var u5="# Ansible Flow Designer nodes: paste them on a flow canvas (Ctrl+V)";function UC(e,t,n={},r=[]){let a=Ro(e),s=[...t.map(S=>a.nodes.get(S)),...r.map(S=>a.annotations.get(S))].find(Boolean),l=s?a.levels.get(s.level):void 0;if(!l)return"";let f=new Set(t),p=new Set(r),h=l.nodes.filter(S=>S&&f.has(S.id)),v=l.annotations.filter(S=>S&&(p.has(S.id)||S.on!==void 0&&f.has(S.on))),g=l.edges.filter(S=>f.has(S?.from?.node)&&f.has(S?.to?.node)),m=new Set(h.flatMap(S=>[S.id,...zj(S)])),b=Object.fromEntries(Object.entries({...n,...e.layout}).filter(([S])=>m.has(S))),w=(e.decisions??[]).filter((S,N)=>{let E=Uj(S,N);return E?.area==="port"&&!!E.node&&m.has(E.node)}),k={nodes:h};return g.length>0&&(k.edges=g),v.length>0&&(k.annotations=v.map(gz)),Object.keys(b).length>0&&(k.layout=b),w.length>0&&(k.decisions=w),`${u5}
|
|
159
|
+
${Io(k,0,{eol:`
|
|
160
|
+
`,indentUnit:2,seqIndentless:!0}).join(`
|
|
161
|
+
`)}
|
|
162
|
+
`}function c5(e){switch(e.type){case"start":case"end":case"decision":return;case"task":return e.impl?.kind==="playbook"?"a playbook binding runs plays of its own":e.settings?.inventory_target?.trim()?"it runs on its inventory_target, in plays of its own":e.settings?.serial===void 0?e.settings?.max_fail_percentage===void 0?void 0:"max_fail_percentage counts a play of its own":"serial batches a play of its own; the subflow sets the batch";case"subflow":return e.subflow?.nodes?.length?"a subflow with steps is a level of its own":void 0;default:return`a ${e.type} node needs plays of its own`}}function f5(e,t){let n=[],r=e.nodes.get(t.id)?.level,a=[t,...r?z0(e,r):[]].find(s=>s.settings?.inventory_target?.trim());a&&n.push({node:t,why:`its steps run on the inventory_target of ${a.title}, in plays of their own`});for(let s of e.levels.get(t.id)?.nodes??[]){if(!s)continue;let l=c5(s);l&&n.push({node:s,why:l})}return n}var ny=(e,t)=>`${e}|${t}`;function h5(e,t){return{wired:new Set(e.map(n=>ny(n?.from?.node,n?.from?.port))),exits:new Set(Object.values(t?.subflow?.boundary?.outputs??{}).flatMap(n=>(n??[]).map(r=>ny(r?.node,r?.port))))}}function YC(e,t){return!!e&&Ks(e).some(n=>n.name===t)}function p5(e,t,n){let r=ny(e,t);return!n.wired.has(r)&&!n.exits.has(r)}function m5(e,t,n,r){return ha(n)&&p5(t,n,r)&&YC(e,n)}function g5(e,t,n,r){return n.some(a=>YC(a,t)&&m5(e,a.id,t,r))}var y5=new Set(["connected","open-fail","open-purpose"]);function cn(e,t={},n=on){let r=e.doc;if(!r)return{nodes:[],edges:[],annotations:[]};let a=Ee(r),s=a.levels.get(n);if(!s)return{nodes:[],edges:[],annotations:[]};let l=new Set;for(let b of s.edges)b?.from&&b.to&&(l.add(`${b.from.node}|${b.from.port}`),l.add(`${b.to.node}|${b.to.port}`));let f=s.parent?a.nodes.get(s.parent)?.node.subflow?.boundary:void 0;f?.in&&l.add(`${f.in}|in`);for(let b of Object.values(f?.outputs??{}))for(let w of b??[])l.add(`${w?.node}|${w?.port}`);let p=new Set(e.openPorts.map(b=>`${b.node}|${b.port}`)),h=new Set((r.decisions??[]).map(b=>`${b?.node}|${b?.port}`)),v=r.layout??{},g=s.nodes.filter(b=>!!b?.id).map(b=>{let w=t[b.id]??v[b.id]??e.autoPositions[b.id]??{x:0,y:0},k=v5(Pd(b).map(({enabled:S,...N})=>{let E=`${b.id}|${N.name}`,j=S?"open":"available";return l.has(E)?j="connected":S?p.has(E)?j="open-fail":N.fail&&h.has(E)&&(j="open-purpose"):j="available",{...N,state:j,rest:y5.has(j),offset:.5}}));return{node:b,position:w,...C0(b.type),ports:k,openFail:k.filter(S=>S.state==="open-fail").length}}),m=new Set(g.map(b=>b.node.id));return{nodes:g,edges:s.edges.filter(b=>b?.from&&b.to&&m.has(b.from.node)&&m.has(b.to.node)).map(b=>{let w=pa(b.from.port);return{id:b.id,source:b.from.node,sourcePort:b.from.port,target:b.to.node,targetPort:b.to.port,tone:w.tone,problem:w.side==="right"}}),annotations:uz(s,new Map(g.map(b=>[b.node.id,b.position])),t)}}function v5(e){let t=new Map;for(let n of e)t.set(n.side,[...t.get(n.side)??[],n]);for(let n of t.values())n.forEach((r,a)=>{r.offset=(a+1)/(n.length+1)});return e}var b5="boundary:",Vd={x:64,top:72,bottom:72},oy={width:420,height:280};function ry(e,t,n){let r=e.doc;if(!r||n==="root")return;let a=Ee(r).nodes.get(n)?.node;if(!a)return;let s=a.subflow?.boundary,l=`${b5}${a.id}`,f={x:0,y:0,...oy},p=[...t.nodes,...t.annotations];if(p.length>0){let w=p.flatMap($=>[$.position.x,$.position.x+$.width]),k=p.flatMap($=>[$.position.y,$.position.y+$.height]),[S,N,E,j]=[Math.min(...w),Math.max(...w),Math.min(...k),Math.max(...k)];f={x:S-Vd.x,y:E-Vd.top,width:Math.max(oy.width,N-S+2*Vd.x),height:Math.max(oy.height,j-E+Vd.top+Vd.bottom)}}let h=t.nodes.map(w=>w.node),v=h5(t.edges.map(w=>({from:{node:w.source,port:w.sourcePort}})),a),g=[];for(let w of Pd(a)){if(w.name==="undo"||w.name==="cancelled")continue;if(w.direction==="in"){g.push({name:w.name,side:"top",tone:w.tone,fail:!1,state:s?.in?"connected":"unfed",offset:.5});continue}let k=w.enabled?"unfed":"available";(s?.outputs?.[w.name]??[]).length>0?k="connected":g5(a,w.name,h,v)&&(k="bubbled"),g.push({name:w.name,side:w.side==="right"?"right":"bottom",tone:w.tone,fail:w.fail,state:k,offset:0})}for(let w of["bottom","right"]){let k=g.filter(S=>S.side===w);k.forEach((S,N)=>{S.offset=(N+1)/(k.length+1)})}let m=[],b=new Set(h.map(w=>w.id));s?.in&&b.has(s.in)&&m.push({id:`entry:${a.id}`,kind:"entry",source:l,sourcePort:"in",target:s.in,targetPort:"in",tone:"neutral",problem:!1,label:"in"});for(let[w,k]of Object.entries(s?.outputs??{}))for(let S of k??[]){if(!S?.node||!b.has(S.node))continue;let N=pa(w);m.push({id:`exit:${a.id}|${S.node}|${S.port}|${w}`,kind:"exit",source:S.node,sourcePort:S.port,target:l,targetPort:w,tone:pa(S.port).tone,problem:N.side==="right",label:S.reason??w,exit:{from:{node:S.node,port:S.port},port:w,reason:S.reason}})}return{subflow:a,id:l,frame:f,ports:g,edges:m}}function xa(e,t){let n={};for(let r of e.nodes)t?.[r.node.id]||(n[r.node.id]={x:Math.round(r.position.x),y:Math.round(r.position.y)});return n}var dh=24;function XC(e,t,n){let r=s=>e.nodes.some(l=>s.x<l.position.x+l.width+dh&&s.x+n.width+dh>l.position.x&&s.y<l.position.y+l.height+dh&&s.y+n.height+dh>l.position.y),a={x:Math.round(t.x),y:Math.round(t.y)};for(let s=0;s<40&&r(a);s++)a.y+=40;return a}function iy(e,t,n){let r=e.nodes.find(l=>l.node.id===t);if(!r)return;let a=r.ports.find(l=>l.name===n)?.side??"bottom",s=C0("task");return XC(e,a==="right"?{x:r.position.x+r.width+90,y:r.position.y}:{x:r.position.x,y:r.position.y+r.height+70},s)}function x5(e){let t={draft:0,specified:0,implemented:0,tested:0},n=0;if(!e)return{counts:t,total:n};for(let{node:r}of Ee(e).nodes.values())r.type!=="start"&&r.type!=="end"&&(t[r.status??"draft"]++,n++);return{counts:t,total:n}}function ZC(e){return e.length}var ay=["draft","specified","implemented","tested"];function w5(e){switch(e.status??"draft"){case"draft":return"Define at least one input or output to make it specified";case"specified":return"Bind a module, role or playbook to make it implemented";case"implemented":return"A passing real run of this flow version makes it tested";default:return}}function k5(e,t){let n=Ee(e),r=[],a=t;for(;a&&a!=="root";){let s=n.nodes.get(a);if(!s)break;r.unshift({id:a,title:s.node.title}),a=s.level}return[{id:on,title:e.flow.name},...r]}function S5(e,t){let n=Ee(e),r=[],a=new Set,s=t;for(;s&&s!=="root";){let l=n.nodes.get(s);if(!l)break;let f=l.node.settings??{},p=l.node.title,h=(v,g,m)=>{a.has(v)||(a.add(v),r.push({label:m?g:`${g} \xB7 not applied`,title:m?`From ${p}: every step inside runs on it`:`Set on ${p}, but the generated plays of the steps inside do not use it: set it on the steps`,applied:m}))};f.inventory_target&&h("inventory",`inherits ${f.inventory_target}`,!0),f.credential&&Rt(e)<2&&h("credential",f.credential,!1),f.execution_environment&&Rt(e)<2&&h("ee",`EE ${f.execution_environment}`,!1),f.become&&h("become",f.become_user?`become ${f.become_user}`:"become",Rt(e)>=2),l.node.ref&&h("shared",`shared from ${l.node.ref.from} v${l.node.ref.version} \xB7 edit it there`,!0),f.rolling!==void 0&&s===t&&h("rolling",`rolling, ${f.rolling} at a time`,f5(n,l.node).length===0),s=l.level}return r}function sy(e,t){let{selection:n,snapshot:r}=_.getState(),a=e??n.nodes??(n.node?[n.node]:[]),s=t??(e?[]:n.annotations??[]);if(!r?.doc||a.length+s.length===0)return;let l=UC(r.doc,a,r.autoPositions,s);return l?{text:l,count:a.length+s.length}:void 0}function Kd(e,t){let n=sy(e,t);n?je({type:"copyText",...n}):_.getState().setError("Select the nodes to copy first")}var ly=()=>{},el;function GC(e){ly=e}function dy(){return ly()}async function QC(e,t){let n=_.getState();if(!n.snapshot?.doc)return[];if(n.mode!=="design")return n.setError(`The graph is read-only in ${n.mode==="run"?"Run":"Code"} mode: switch to Design to paste`),[];let r=t??ly();r&&el&&el.at.x===r.x&&el.at.y===r.y?el.times+=1:el=r?{at:r,times:0}:void 0;let a=(el?.times??0)*32,s=xa(cn(n.snapshot,n.optimistic,n.level),n.snapshot.doc.layout),l=await la({kind:"pasteNodes",text:e,level:n.level,...r?{position:{x:r.x+a,y:r.y+a}}:{},...Object.keys(s).length>0?{freeze:s}:{}});if(!l.ok)return _.getState().setError(l.error??"Nothing was pasted"),[];let f=l.pasted??[];return f.length>1?_.getState().select({nodes:f}):f[0]&&_.getState().select({node:f[0]}),f}function uy(){if(document.activeElement?.closest('input, textarea, select, [contenteditable="true"]'))return!0;let e=document.getSelection();if(!e?.toString())return!1;let t=e.anchorNode;return!(t instanceof Element?t:t?.parentElement)?.closest(".react-flow")}function N5(e){let t=a=>{if(uy()||!a.clipboardData)return;let s=sy();s&&(a.clipboardData.setData("text/plain",s.text),a.preventDefault())},n=a=>{if(uy()||!a.clipboardData)return;let{selection:s}=_.getState(),l=s.nodes??(s.node?[s.node]:[]),f=sy(l);f&&(a.clipboardData.setData("text/plain",f.text),a.preventDefault(),_.getState().mode==="design"?e(l):_.getState().setError("The graph is read-only outside Design mode: copied, not cut"))},r=a=>{if(uy())return;let s=a.clipboardData?.getData("text/plain");s?.trim()&&(a.preventDefault(),QC(s))};return document.addEventListener("copy",t),document.addEventListener("cut",n),document.addEventListener("paste",r),()=>{document.removeEventListener("copy",t),document.removeEventListener("cut",n),document.removeEventListener("paste",r)}}function cy(e){return e.type!=="start"&&e.type!=="end"}function Wd(){let{selection:e}=_.getState();return e.nodes??(e.node?[e.node]:[])}function fy(){return _.getState().selection.annotations??[]}function Yt(){let{mode:e,snapshot:t,level:n}=_.getState();return e==="design"&&!!t?.doc&&!t.stale&&!t.idGaps&&!Vf(t.doc,n)}function wa(){return _(e=>!e.viewer&&!!e.snapshot?.doc&&!e.snapshot.stale&&!e.snapshot.idGaps&&!Vf(e.snapshot.doc,e.level))}function JC(e){if(e.startsWith("entry:"))return{kind:"entry",subflow:e.slice(6)};if(!e.startsWith("exit:"))return;let[t,n,r,a]=e.slice(5).split("|");if(t&&n&&r&&a)return{kind:"exit",subflow:t,edge:e,from:{node:n,port:r},port:a}}function j5(e){let t=e.pasted??(e.created?[e.created]:[]);return t.length>1?_.getState().select({nodes:t}):t[0]&&_.getState().select({node:t[0]}),t}async function Ud(e,t=[],n=[],r=!0){if(!Yt())return;let a=new Set(e),s=_.getState().snapshot?.doc,l=v=>s?Ee(s).nodes.get(v)?.node.subflow?.boundary?.in:void 0,f=[];for(let v of t){let g=JC(v);if(g?.kind==="entry"){let m=l(g.subflow);m&&a.has(m)||await Pe({kind:"setBoundaryIn",subflow:g.subflow,node:null})}else g?.kind==="exit"?a.has(g.from.node)||await Pe({kind:"disconnectBoundary",subflow:g.subflow,from:g.from,port:g.port}):f.push(v)}if(e.length===0&&f.length===0&&n.length===0)return;let p=r&&e.length>0,h=p&&s?Oj(Mj(Ee(s),e,f)):void 0;(await Pe({kind:"deleteNodes",ids:e,edges:f,...n.length?{annotations:n}:{},...p?{heal:!0}:{}})).ok&&h&&_.getState().notify("info",h)}async function C5(e){let t=_.getState().snapshot?.doc;if(!Yt()||!t)return;let n=Ee(t),r=e.map(s=>n.nodes.get(s)?.node).filter(s=>!!s&&cy(s));if(r.length===0)return;let a=!r.every(s=>s.disabled);await Pe({kind:"setDisabled",ids:r.map(s=>s.id),disabled:a})}async function E5(e){let t=_.getState().snapshot?.doc;if(!Yt()||e.length===0||!t)return;let n=Oj(Mj(Ee(t),e));(await Pe({kind:"detachNodes",ids:e})).ok&&n&&_.getState().notify("info",n)}async function $5(e,t=[]){(e.length!==0||t.length!==0)&&(Kd(e,t),await Ud(e,[],t))}async function eE(e,t=[]){let n=_.getState();if(!Yt()||e.length===0&&t.length===0||!n.snapshot?.doc)return;let r=UC(n.snapshot.doc,e,n.snapshot.autoPositions,t);if(!r)return;let a=xa(cn(n.snapshot,n.optimistic,n.level),n.snapshot.doc.layout),s=await Pe({kind:"pasteNodes",text:r,level:n.level,...Object.keys(a).length>0?{freeze:a}:{}});s.ok&&j5(s)}function tE(){let e=_.getState();if(!e.snapshot)return;let t=cn(e.snapshot,e.optimistic,e.level),n=t.nodes.map(s=>s.node.id),r=e.annotationsHidden?[]:t.annotations.map(s=>s.annotation.id),a=r.length?{annotations:r}:{};n.length>1?e.select({nodes:n,...a}):n[0]?e.select({node:n[0],...a}):r.length&&e.select(a)}function hy(){let e=_.getState();if(e.level==="root"||!e.snapshot?.doc)return;let t=Ee(e.snapshot.doc).nodes.get(e.level)?.level??"root",n=e.level;e.setLevel(t),e.select({node:n})}function py(e){let t=_.getState();Yt()&&(t.select({node:e}),t.setRenaming(e))}function nE(e){let t=_.getState().snapshot?.doc;if(!t)return;let n=Ee(t),r=n.nodes.get(e),a=r?n.levels.get(r.level):void 0;return r&&a?{node:r.node,edges:a.edges.filter(s=>!!s)}:void 0}function _5(e,t){let n=nE(e);if(!n)return;let r=new Set([e]);for(let s=[e];s.length>0;){let l=s.pop();for(let f of n.edges){let[p,h]=t==="down"?[f.from.node,f.to.node]:[f.to.node,f.from.node];p===l&&!r.has(h)&&(r.add(h),s.push(h))}}let a=[...r];_.getState().select(a.length>1?{nodes:a}:{node:e})}function oE(e){let t=_.getState(),n=t.selection.node,r=n?nE(n):void 0;if(!n||!r)return!1;let a;if(e==="up")a=r.edges.find(s=>s.to.node===n)?.from.node;else{let s=r.edges.filter(f=>f.from.node===n),l=Bf(r.node);a=(s.find(f=>l.includes(f.from.port))??s[0])?.to.node}return a?(t.select({node:a}),document.querySelector(`.react-flow__node[data-id="${a}"]`)?.focus(),!0):!1}function T5(e){let t=_.getState();t.select({nodes:e}),t.requestFocus("extractTitle")}function A5(e){let t=_.getState();t.select({edge:e}),t.requestFocus("exitReason")}var M5={note:"",section:"Section",text:"Text"};async function Yd(e,t,n,r={}){let a=_.getState();if(!Yt()||!a.snapshot?.doc)return;let s=cn(a.snapshot,a.optimistic,a.level),l=M5[e],f=new Set(r.around??[]),p=e==="section"?pz([...s.nodes.filter(b=>f.has(b.node.id)),...s.annotations.filter(b=>b.kind!=="section"&&(f.has(b.annotation.id)||!!b.on&&f.has(b.on)))]):void 0,h=[...s.nodes,...s.annotations.filter(b=>e==="section"||b.kind!=="section")],v=n?bj:p?p.position:r.near&&t?hz(h,vj({kind:e,text:l}),t):t??dy()??{x:0,y:0},g=e==="section"?xa(s,a.snapshot.doc.layout):{},m=await Pe({kind:"addAnnotation",level:a.level,annotation:{kind:e,text:l,x:Math.round(v.x),y:Math.round(v.y),...p?{width:p.width,height:p.height}:{},...n?{on:n}:{}},...Object.keys(g).length?{freeze:g}:{}});m.ok&&m.created&&(_.getState().select({annotations:[m.created]}),_.getState().editAnnotation(m.created))}function uh(e){Yt()&&(_.getState().select({annotations:[e]}),_.getState().editAnnotation(e))}function O5(e,t){Pe({kind:"updateAnnotation",id:e,patch:{color:t}})}function rE(e,t){let n=_.getState();if(!n.snapshot)return{};let r=cn(n.snapshot,n.optimistic,n.level);return{at:r.annotations.find(a=>a.annotation.id===e)?.position,node:t?r.nodes.find(a=>a.node.id===t)?.position:void 0}}function iE(e){let{at:t}=rE(e);Pe({kind:"updateAnnotation",id:e,patch:{on:null,...t??{}}})}function aE(e){_.getState().setPick({mode:"attach",ref:{node:e,port:""}})}async function P5(e,t){let{at:n,node:r}=rE(e,t),a=n&&r?{x:n.x-r.x,y:n.y-r.y}:bj;await Pe({kind:"updateAnnotation",id:e,patch:{on:t,x:a.x,y:a.y}})}var yo=P0,ch={connected:"connected","open-fail":"open: not handled","open-purpose":"open on purpose",open:"open",available:"optional, not enabled"},sE="application/x-afd-node-type",lE="application/x-afd-pattern",dE="application/x-afd-annotation";function fh(e,t=Date.now()){if(!e)return"";let n=Math.max(0,Math.round((t-Date.parse(e))/1e3));return n<60?"just now":n<3600?`${Math.round(n/60)} min ago`:n<86400?`${Math.round(n/3600)} h ago`:`${Math.round(n/86400)} d ago`}function hh(){return _(e=>e.snapshot?.doc?Ee(e.snapshot.doc):void 0)}function D5(e){let t=hh();return e?t?.nodes.get(e):void 0}function ph(e){let t=_(s=>s.snapshot),n=_(s=>s.optimistic),r=_(s=>s.level),a=e??r;return(0,T.useMemo)(()=>t?cn(t,n,a):{nodes:[],edges:[],annotations:[]},[t,n,a])}function L5(e,t,n,r){let a=e.type==="subflow"&&(e.subflow?.nodes?.length??0)>0,s=t.artifact==="not bound"?void 0:`${t.tasks.length} task${t.tasks.length===1?"":"s"}`;return n?{count:s,state:`drift: ${n.label}`,tone:"warn"}:!e.impl?.ref&&!a&&(e.type==="task"||e.type==="subflow")?{count:s,state:"runs as TODO stub",tone:"neutral"}:r?.failures.some(l=>l.node===e.id)?{count:s,state:"last run failed",tone:"warn"}:r?.nodes[e.id]?{count:s,state:"last run ok",tone:"ok"}:a?{count:s,state:"open subflow",tone:"neutral"}:t.matched?{count:s,state:"matched by ID",tone:"neutral"}:{count:s,state:"not in generated code",tone:"warn"}}var uE=["type","status","has","open","tag","target"],I5={type:["task","subflow","decision","approval","parallel","join","end"],status:["draft","specified","implemented","tested"],has:["no-binding","binding","problems","errors","disabled"],open:["fail"],tag:[],target:[]},R5={"has:no-binding":"Steps not implemented yet: no module, role or playbook","has:binding":"Steps bound to a module, role or playbook","has:errors":"Steps with an error","has:problems":"Steps with an error or a warning","has:disabled":"Steps switched off: their hosts pass through","type:approval":"Approval steps","open:fail":"Steps with a fail port nothing handles","status:draft":"Draft steps, and subflows with a draft step inside"},z5={"has:no-binding":["step not implemented yet","steps not implemented yet"],"has:binding":["step bound to a module, role or playbook","steps bound to a module, role or playbook"],"has:errors":["step with an error","steps with an error"],"has:problems":["step with an error or a warning","steps with an error or a warning"],"has:disabled":["disabled step","disabled steps"],"open:fail":["step with a fail port nothing handles","steps with a fail port nothing handles"]};function F5(e,t){let n=cE(e),r=Object.entries(n.filters);if(n.words.length||r.length!==1)return;let[a,s]=r[0];if(s.length!==1)return;let l=s[0],f=t===1,p=z5[`${a}:${l}`];if(p)return`${t} ${f?p[0]:p[1]}`;if(a==="type")return`${t} ${l}${f?"":"s"}`;if(a==="status")return`${t} ${l} ${f?"step or subflow":"steps and subflows"}`}var B5=/([A-Za-z]+):"([^"]*)"|([A-Za-z]+):(\S+)|"([^"]*)"|(\S+)/g;function cE(e){let t=[],n={};for(let r of e.matchAll(B5)){let a=(r[1]??r[3])?.toLowerCase(),s=r[2]??r[4];if(a&&s!==void 0&&s!==""&&uE.includes(a)){n[a]=[...n[a]??[],s.toLowerCase()];continue}let l=(r[5]??r[0]).toLowerCase();l&&t.push(...l.split(/\s+/).filter(Boolean))}return{words:t,filters:n}}var q5=e=>Object.keys(e.filters).length>0;function H5(e,t,n={}){let r=(l,f)=>{let p=t.filters[l];return!p||p.some(f)},a=e.status??"draft",s=(n.findings??[]).filter(l=>l.node===e.id);return r("type",l=>e.type===l||l==="handler"&&!!e.purpose)&&r("status",l=>e.type!=="start"&&e.type!=="end"&&a===l)&&r("has",l=>l==="no-binding"?e.type==="task"&&!e.impl:l==="binding"?!!e.impl:l==="problems"?s.length>0:l==="errors"?s.some(f=>f.severity==="error"):l==="disabled"&&e.disabled===!0)&&r("open",l=>l==="fail"&&(n.openPorts??[]).some(f=>f.node===e.id))&&r("tag",l=>(e.settings?.tags??[]).some(f=>f.toLowerCase()===l))&&r("target",l=>(e.settings?.inventory_target??"").toLowerCase().includes(l))}function V5(e){let t=e.split(/\s+/).at(-1)??"",[n,r]=t.includes(":")?t.split(":",2):[t,void 0];return r===void 0?t?uE.filter(a=>a.startsWith(t.toLowerCase())).map(a=>`${a}:`):[]:(I5[n?.toLowerCase()]??[]).filter(a=>a.startsWith((r??"").toLowerCase())).map(a=>`${n}:${a}`)}var K5=e=>/^https?:\/\/[^\s<>"]+$/i.test(e),W5=/`([^`\n]+)`|\*\*([^*\n]+?)\*\*|\*([^*\n]+?)\*|\[([^\]\n]+)\]\(([^)\s]+)\)|(https?:\/\/[^\s<>"()[\]]*[^\s<>"()[\].,;:!?'])/g;function fE(e){let t=[],n=a=>{if(!a)return;let s=t.at(-1);s?.kind==="text"?s.text+=a:t.push({kind:"text",text:a})},r=0;for(let a of e.matchAll(W5))n(e.slice(r,a.index)),r=(a.index??0)+a[0].length,a[1]===void 0?a[2]===void 0?a[3]===void 0?a[4]!==void 0&&a[5]!==void 0?K5(a[5])?t.push({kind:"link",text:a[4],href:a[5]}):n(a[4]):a[6]!==void 0&&t.push({kind:"link",text:a[6],href:a[6]}):t.push({kind:"italic",text:a[3]}):t.push({kind:"bold",text:a[2]}):t.push({kind:"code",text:a[1]});return n(e.slice(r)),t}var hE=/^\s*[-*]\s+/;function pE(e){let t=[],n=[],r,a=()=>{n.length&&t.push({kind:"para",parts:fE(n.join(`
|
|
163
|
+
`))}),n=[]},s=()=>{r&&t.push({kind:"list",items:r}),r=void 0};for(let l of String(e??"").split(/\r?\n/))hE.test(l)?(a(),r??=[],r.push(fE(l.replace(hE,"")))):l.trim()===""?(a(),s()):(s(),n.push(l));return a(),s(),t}var mE=e=>e.map(t=>t.kind==="link"&&t.text!==t.href?`${t.text} (${t.href})`:t.text).join("");function gE(e){return pE(e).map(t=>t.kind==="para"?mE(t.parts):t.items.map(n=>`- ${mE(n)}`).join(`
|
|
164
|
+
`)).join(`
|
|
165
|
+
`)}function mh(e,t){let n=[];for(let r=t;r!==on;){let a=e.nodes.get(r);if(!a)break;n.unshift(a.node.title),r=a.level}return n}function U5(e,t){let n=e.nodes.get(t);if(!n)return;let r=mh(e,n.level);return r.length?`in ${r.join(" \u203A ")}`:"on the top level"}function Y5(e,t){return t.some(n=>{let r=n.length===1?e.nodes.get(n[0]):void 0;return!!r&&r.level!=="root"})}function X5(e,t,n){let r=new Set;for(let a of t)for(let s=a;s;){let l=e.nodes.get(s);if(!l)break;if(l.level===n){r.add(s);break}s=l.level==="root"?void 0:l.level}return[...r]}function Z5(e,t,n=50,r={}){let a=cE(t),{words:s}=a,l=q5(a);if(s.length===0&&!l)return[];let f=s.join(" "),p=[];for(let{node:h,level:v}of e.nodes.values()){let g=h.title.toLowerCase(),m=h.key?.toLowerCase()??"",b=h.impl?.ref?.toLowerCase()??"";if(!s.every(S=>g.includes(S)||m.includes(S)||b.includes(S))||l&&!H5(h,a,r))continue;let w=f?g.startsWith(f)?0:g.split(/\W+/).some(S=>S.startsWith(s[0]??""))?1:g.includes(f)?2:m.includes(f)?3:4:0,k=mh(e,v);p.push({found:{id:h.id,title:h.title,key:h.key??"",type:h.type,level:v,trail:k,...h.impl?.ref?{ref:h.impl.ref}:{}},score:w,depth:k.length})}for(let{annotation:h,level:v}of l?[]:e.annotations.values()){let g=gE(h.text??""),m=g.toLowerCase();if(!s.every(k=>m.includes(k)))continue;let b=mh(e,v),w=g.split(`
|
|
166
|
+
`)[0]??"";p.push({found:{id:h.id,title:w.length>60?`${w.slice(0,59)}\u2026`:w,key:h.key??"",type:"task",level:v,trail:b,annotation:h.kind??"note"},score:m.startsWith(f)?3:4,depth:b.length})}return p.sort((h,v)=>h.score-v.score||h.depth-v.depth||h.found.title.localeCompare(v.found.title)).slice(0,n).map(h=>h.found)}var G5={in:"Hosts arrive here",ok_hosts:"Hosts this step succeeded on continue here",failed_hosts:"Hosts that failed this step continue here",unreachable:"Hosts this step could not reach continue here",unchanged:"Hosts this step succeeded on without changing anything continue here",always:"Every host continues here after this step, whatever happened",timeout:"Hosts that ran out of time continue here",true:"Hosts the condition is true for continue here",false:"Hosts the condition is false for continue here",approved:"Hosts a person approved continue here",rejected:"Hosts a person rejected continue here"};function ka(e,t){return e==="timeout"&&t==="approval"?"Hosts with no answer in time continue here":e==="failed_hosts"&&t==="join"?"Hosts that failed on a branch continue here":/^branch_[0-9]+$/.test(e)?"Every host goes down each branch":G5[e]}var Q5=["in","ok_hosts","failed_hosts","unreachable","always"],J5={impl:"binding",inputs:"io",outputs:"io",settings:"execution",ports:"ports"};function yE(e,t,n){return e.filter(r=>r.node===t).map(r=>{let a=r.path.length>n.length&&n.every((p,h)=>r.path[h]===p)?r.path.slice(n.length).map(String):[],s=a[0],l=r.port?"ports":s&&J5[s]||"general",f=s==="settings"&&a[1]?`settings.${a[1]}`:s;return{finding:r,tab:l,...f?{field:f}:{}}})}function tl(e,t){return e.find(n=>n.field===t)?.finding.message}var e6=new Set(["open-fail-port"]),t6=4;function n6(e,t){let n=new Map,r=new Map,a=l=>{let f=n.get(l);return f||(f={errors:0,warnings:0,inside:0,severity:"warning",title:""},n.set(l,f)),f},s=t.filter(l=>l.node&&l.severity!=="info"&&!e6.has(l.code)).sort((l,f)=>+(f.severity==="error")-+(l.severity==="error"));for(let l of s){let f=e.nodes.get(l.node);if(!f)continue;let p=a(f.node.id);l.severity==="error"?(p.errors++,p.severity="error"):p.warnings++,p.tab??=yE([l],f.node.id,f.path)[0]?.tab,r.set(f.node.id,[...r.get(f.node.id)??[],l.message]);for(let h=f.level;e.nodes.has(h);h=e.nodes.get(h)?.level){let v=a(h);v.inside++,l.severity==="error"&&(v.severity="error")}}for(let[l,f]of n){let p=r.get(l)??[],h=p.slice(0,t6);p.length>h.length&&h.push(`\u2026and ${p.length-h.length} more`),f.inside>0&&h.push(`${f.inside} problem${f.inside===1?"":"s"} in the steps inside`),f.title=h.join(`
|
|
167
|
+
`)}return n}function my(e){return e.type==="subflow"||!!e.impl?.ref}function vE(e){if(!e?.ref)return;let t=e.params?.tasks_from?` \xB7 ${e.params.tasks_from}`:"";return`${e.kind} ${e.ref}${e.collection_version?` ${e.collection_version}`:""}${t}`}function bE(e){if(!e)return[];let t=[];return typeof e.retries=="string"?t.push(`${e.until?"poll":"retry"} (${L0(e.retries)??"at run time"})`):e.retries?t.push(e.until?`poll \xD7${e.retries+1}`:`retry \xD7${e.retries}`):e.until&&t.push("poll"),e.serial!==void 0&&t.push(`serial ${e.serial}`),e.timeout&&t.push(`timeout ${e.timeout}`),e.max_fail_percentage!==void 0&&t.push(`max fail ${e.max_fail_percentage}%`),e.become&&t.push("become"),e.credential&&t.push(`credential ${e.credential}`),e.execution_environment&&t.push(`EE ${e.execution_environment}`),t}function xE(e,t){let n=e?.state==="done"?e.summary?.nodes[t]:void 0;if(n)return Object.entries(n).map(([r,a])=>r==="ok_hosts"||a.length>3?`${r} ${a.length}`:`${r} ${a.length} (${a.join(", ")})`).join(" \xB7 ")}function o6(e,t){let n=new Map(e.map((l,f)=>[l.id,f])),r=new Map(e.map(l=>[l.id,0]));for(let l of t)n.has(l.to.node)&&r.set(l.to.node,(r.get(l.to.node)??0)+1);let a=e.filter(l=>r.get(l.id)===0),s=[];for(;a.length>0;){a.sort((f,p)=>(n.get(f.id)??0)-(n.get(p.id)??0));let l=a.shift();s.push(l);for(let f of t){if(f.from.node!==l.id||!n.has(f.to.node))continue;let p=(r.get(f.to.node)??0)-1;r.set(f.to.node,p),p===0&&a.push(e[n.get(f.to.node)??0])}}for(let l of e)s.includes(l)||s.push(l);return s}function r6(e,t,n){let r=Ee(e).nodes.get(t)?.node;if(!r||!my(r))return;let a=(r.subflow?.nodes??[]).filter(h=>!!h?.id),s=r.subflow?.boundary,l=new Map;for(let[h,v]of Object.entries(s?.outputs??{}))for(let g of v??[])g?.node&&l.set(g.node,[...l.get(g.node)??[],{port:h,reason:g.reason}]);let f=o6(a,(r.subflow?.edges??[]).filter(h=>h?.from&&h.to)).map(h=>({id:h.id,title:h.title,type:h.type,status:h.status,entry:s?.in===h.id,badges:[...h.impl?.ref?[h.impl.kind]:[],...h.ref?[`shared v${h.ref.version}`]:[],...bE(h.settings)],exits:l.get(h.id)??[],run:xE(n,h.id)})),p=r.type==="subflow"?a.length>0?`Subflow \xB7 ${a.length} step${a.length===1?"":"s"}`:"Subflow \xB7 no inner steps yet":`${r.type[0]?.toUpperCase()}${r.type.slice(1)}`;return{node:r,binding:vE(r.impl),subtitle:p,steps:f,undo:vE(r.undo),settings:bE(r.settings),run:xE(n,r.id),hasInner:a.length>0}}function gy(e,t){let n=e?.approvals?.[t];if(n)return{...n,label:n.status};let r=e?.awx?.approvals?.[t];if(r)return{status:r.status==="denied"?"rejected":r.status,url:r.url,label:r.status}}function wE(e){return[...new Set([...Object.keys(e?.approvals??{}),...Object.keys(e?.awx?.approvals??{})])].some(t=>gy(e,t)?.status==="waiting")}var i6={draft:"circle-large-outline",specified:"circle-large-filled",implemented:"pass",tested:"verified-filled"};function gh({status:e,label:t=!0}){let n=`Status: ${e}`;return(0,c.jsx)("span",{className:`afd-status-icon codicon codicon-${i6[e]} status-${e}`,...t?{role:"img","aria-label":n,title:n}:{"aria-hidden":!0}})}var a6={top:Ce.Top,bottom:Ce.Bottom,left:Ce.Left,right:Ce.Right},s6=e=>e.transform[2]<.45,l6=1.4,d6=e=>e.transform[2]>=l6,kE=new Set(["parallel","join"]);function SE(e,t){let n=e.getBoundingClientRect();return t==="left"?{x:n.left-8,y:n.top-8}:t==="bottom"?{x:n.left-8,y:n.bottom+8}:{x:n.right+8,y:n.top-8}}function u6({nodeId:e,type:t,port:n,focusable:r,preview:a,readOnly:s}){let l=_(m=>m.openPortMenu),f=`${Math.round(n.offset*100)}%`,p=n.side==="top"||n.side==="bottom"?{left:f}:{top:f},h=n.direction==="out",v=_(m=>m.mode!=="design")||s===!0,g=m=>{_.getState().pick||v||l({ref:{node:e,port:n.name},...SE(m,n.side)})};return(0,c.jsx)(vr,{id:n.name,type:h?"source":"target",position:a6[n.side],isConnectable:!v,isConnectableStart:h&&n.state!=="connected",isConnectableEnd:!h,className:["afd-port",`state-${n.state}`,`tone-${n.tone}`,`side-${n.side}`,n.optional?"optional":"",n.rest?"rest":"reveal"].filter(Boolean).join(" "),style:p,"data-port":n.name,"data-port-state":n.state,"data-rest":n.rest?"true":void 0,title:[n.name,ka(n.name,t),ch[n.state],"click for options"].filter(Boolean).join(" \xB7 "),"aria-label":`Port ${n.name}, ${ch[n.state]}`,role:"button","aria-haspopup":v?void 0:"menu","aria-disabled":v||void 0,tabIndex:r&&!v?0:-1,onClick:m=>g(m.currentTarget),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),m.stopPropagation(),g(m.currentTarget))},onPointerEnter:()=>_.getState().portHover(!0),onPointerLeave:m=>{let b=_.getState();b.portHover(!1);let w=m.currentTarget.closest(".react-flow__node")?.getBoundingClientRect();a&&w&&b.hoverNode(e,{left:w.left,right:w.right,top:w.top})},children:(0,c.jsx)("span",{className:"afd-port-label","aria-hidden":"true",children:n.name})})}function c6({nodeId:e,port:t,focusable:n}){let r=`${Math.round(t.offset*100)}%`;return(0,c.jsx)("button",{type:"button",className:`afd-plus afd-port-plus side-${t.side} nodrag nopan`,style:t.side==="bottom"?{left:r}:{top:r},title:`Add Next Node from ${t.name}`,"aria-label":`Add Next Node from ${t.name}`,"data-port-plus":t.name,tabIndex:n?0:-1,onPointerEnter:()=>_.getState().portHover(!0),onPointerLeave:()=>_.getState().portHover(!1),onDoubleClick:a=>a.stopPropagation(),onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&a.stopPropagation()},onClick:a=>{a.stopPropagation(),$y({node:e,port:t.name})},children:(0,c.jsx)("span",{className:"codicon codicon-add","aria-hidden":"true"})})}var yy;function f6(e,t){if(e?.doc)return yy?.snapshot!==e&&(yy={snapshot:e,badges:n6(Ee(e.doc),e.findings)}),yy?.badges.get(t)}function h6({node:e,badge:t}){let n=t.errors+t.warnings,r=n+t.inside,a=`${r} problem${r===1?"":"s"}`;return(0,c.jsxs)("button",{type:"button",className:`afd-node-problem tone-${t.severity} nodrag nopan`,"data-node-problem":t.severity,title:`${t.title}
|
|
168
|
+
${n>0?"Click for the details":"Click to open the subflow"}`,"aria-label":`${a}: ${n>0?"show in Details":"open the subflow"}`,tabIndex:-1,onDoubleClick:s=>s.stopPropagation(),onClick:s=>{s.stopPropagation();let l=_.getState();n>0?l.openDetails(e.id,t.tab??"general"):l.setLevel(e.id)},children:[(0,c.jsx)("span",{className:`codicon codicon-${t.severity==="error"?"error":"warning"}`,"aria-hidden":"true"}),r>1?r:null]})}var vy=e=>`__inner:${e}`,p6={top:Ce.Bottom,bottom:Ce.Top,right:Ce.Left,left:Ce.Right},m6={top:{top:0,bottom:"auto",transform:"translate(-50%, -50%)"},bottom:{top:"auto",bottom:0,transform:"translate(-50%, 50%)"},right:{left:"auto",right:0,transform:"translate(50%, -50%)"},left:{left:0,right:"auto",transform:"translate(-50%, -50%)"}};function g6({ports:e}){return(0,c.jsx)(c.Fragment,{children:e.map(t=>{let n=`${Math.round(t.offset*100)}%`,r=t.side==="top"||t.side==="bottom"?{left:n}:{top:n};return(0,c.jsx)(vr,{id:vy(t.name),type:t.direction==="in"?"source":"target",position:p6[t.side],isConnectable:!1,className:"afd-inner-handle",style:{...m6[t.side],...r},"aria-hidden":"true"},t.name)})})}function yh({node:e}){return _(t=>t.renaming===e.id)?(0,c.jsx)(y6,{node:e}):(0,c.jsx)("span",{className:"afd-node-title",children:e.title})}function y6({node:e}){let[t,n]=(0,T.useState)(e.title),r=(0,T.useRef)(null),a=(0,T.useRef)(!1);(0,T.useEffect)(()=>{r.current?.focus(),r.current?.select()},[]);let s=l=>{if(a.current)return;a.current=!0,_.getState().setRenaming(null);let f=t.trim();l&&f&&f!==e.title&&Pe({kind:"updateNode",id:e.id,patch:{title:f}}),r.current?.closest(".react-flow__node")?.focus()};return(0,c.jsx)("input",{ref:r,className:"afd-node-title afd-node-title-input nodrag nopan nokey","aria-label":"Node title",value:t,onChange:l=>n(l.target.value),onBlur:()=>s(!0),onKeyDown:l=>{l.stopPropagation(),l.key==="Enter"?s(!0):l.key==="Escape"&&s(!1)},onClick:l=>l.stopPropagation(),onDoubleClick:l=>l.stopPropagation()})}function v6({node:e}){let t=_(f=>f.drift?.nodes[e.id]),n=_(f=>f.drift?.items.find(p=>p.node===e.id&&!p.ignored&&p.severity==="warning")),r=_(f=>f.run?.state==="done"?f.run.summary:void 0);if(!t)return(0,c.jsx)("div",{className:"afd-node-sub muted",children:"not synced"});let{count:a,state:s,tone:l}=L5(e,t,n,r);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"afd-node-sub mono afd-node-artifact",title:t.artifact,children:t.artifact}),(0,c.jsx)("div",{className:`afd-node-code tone-${l}`,"data-code-state":s,children:a?`${a} \xB7 ${s}`:s})]})}function b6({node:e}){let t=_(l=>l.runNodes?.[e.id]),n=_(l=>l.run?.state==="running"),r=gy(_(l=>l.run),e.id);if(r){let l=t&&t.state!=="idle"?` \xB7 ${t.hosts} host${t.hosts===1?"":"s"}`:"",f=r.status==="approved"?"ok":"warn";return(0,c.jsxs)("div",{className:`afd-node-run tone-${f}`,"data-approval":r.label,children:[r.status==="waiting"?"waiting for approval":r.label,l]})}if(!t)return(0,c.jsx)("div",{className:"afd-node-run tone-neutral",children:n?"waiting":"no run"});if(t.state==="idle")return(0,c.jsx)("div",{className:"afd-node-run tone-neutral","data-run-state":"idle",children:n?"waiting":"not reached"});if(t.state==="running"){let l=[t.hosts>0?`${t.hosts} host${t.hosts===1?"":"s"}`:""];return t.failed>0&&l.push(`${t.failed} failed`),(0,c.jsx)("div",{className:"afd-node-run tone-running","data-run-state":"running",children:["running\u2026",...l.filter(Boolean)].join(" \xB7 ")})}let a=[`${t.hosts} host${t.hosts===1?"":"s"}`];t.failed>0&&a.push(`${t.failed} failed`),t.seconds!==void 0&&a.push(Ut(t.seconds));let s=t.state==="ok"?"ok":"warn";return(0,c.jsx)("div",{className:`afd-node-run tone-${s}`,"data-run-state":t.state,children:a.join(" \xB7 ")})}function vh({id:e}){let t=_(r=>r.lens),n=_(r=>r.lensView?.chips[e]);return t?(0,c.jsx)("div",{className:`afd-chips afd-lens-chips lens-${t}`,"data-lens-chips":(n??[]).map(r=>r.text).join("|"),children:(n??[]).map(r=>(0,c.jsx)("span",{className:`afd-chip afd-lens-chip${r.tone?` tone-${r.tone}`:""}`,title:r.title,children:r.text},r.text))}):null}function x6(e){let t=_(a=>a.snapshot?.doc),n=_(a=>a.lensFacts),r=_(a=>a.run);return(0,T.useMemo)(()=>t?WF(t,e,n,r):[],[t,e,n,r])}function w6({node:e,max:t,className:n}){let r=x6(e);return r.length===0?null:(0,c.jsx)("dl",{className:n,children:r.slice(0,t).map(a=>(0,c.jsxs)(T.Fragment,{children:[(0,c.jsx)("dt",{children:a.label}),(0,c.jsx)("dd",{title:a.value,children:a.value})]},a.label))})}var k6=(0,T.memo)(function({node:e,near:t}){let n=_(p=>p.mode==="code"),r=_(p=>p.mode==="run"),a=_(p=>p.lens);if(e.type==="start"||e.type==="end"||kE.has(e.type))return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(yh,{node:e}),kE.has(e.type)?null:(0,c.jsx)(vh,{id:e.id})]});let s=e.status??"draft";if(e.disabled&&!t)return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:"afd-node-head",children:[(0,c.jsx)(gh,{status:s}),(0,c.jsx)(yh,{node:e})]}),(0,c.jsx)(vh,{id:e.id}),(0,c.jsx)("div",{className:"afd-node-sub",title:R0(e),children:R0(e)})]});let l=(0,c.jsxs)("div",{className:"afd-node-head",children:[(0,c.jsx)(gh,{status:s}),(0,c.jsx)(yh,{node:e})]});if(t)return(0,c.jsxs)(c.Fragment,{children:[l,(0,c.jsx)(vh,{id:e.id}),(0,c.jsx)(w6,{node:e,max:a?1:3,className:"afd-node-summary"})]});if(a)return(0,c.jsxs)(c.Fragment,{children:[l,(0,c.jsx)(vh,{id:e.id})]});if(r)return(0,c.jsxs)(c.Fragment,{children:[l,(0,c.jsx)(b6,{node:e})]});if(n)return(0,c.jsxs)(c.Fragment,{children:[l,(0,c.jsx)(v6,{node:e})]});let f=R0(e);return(0,c.jsxs)(c.Fragment,{children:[l,(0,c.jsx)("div",{className:`afd-node-sub${e.impl?.ref||e.condition?" mono":""}`,title:f,children:f})]})}),S6=(0,T.memo)(function({data:e,selected:t}){let n=Ke(s6),r=Ke(d6),{node:a,ports:s}=e.view,l=e.role,f=_(O=>O.expandSubflows)&&a.type==="subflow"&&l!=="inner",p=_(O=>O.lens==="data"),h=t3(),v=(0,T.useRef)(p);(0,T.useEffect)(()=>{v.current!==p&&(v.current=p,h(a.id))},[p,a.id,h]);let g=(0,T.useRef)(l);(0,T.useEffect)(()=>{g.current!==l&&(g.current=l,h(a.id))},[l,a.id,h]);let m=_(O=>O.lens?(O.lensView?.chips[a.id]??[]).map(K=>K.text).join("|"):void 0),b=_(O=>{if(!O.highlight)return"";let K=O.snapshot?.doc,B=K?X5(Ee(K),O.highlight,O.level):O.highlight;return B.length===0?"":B.includes(a.id)?"lens-hit":"lens-dim"}),w=_(O=>O.portMenu?.ref.node===a.id),k=_(O=>O.pick!==null&&O.pickAt===a.id),S=_(O=>O.mode==="run"),N=_(O=>O.mode==="run"?O.runNodes?.[a.id]?.state:void 0),E=_(O=>O.outside?.nodes.includes(a.id)?"outside-mark":O.outsideAround.includes(a.id)?"outside-inside":""),j=_(O=>{let K=E==="outside-mark"&&O.outside?.changes?.find(B=>B.id===a.id);return K?`Changed outside the designer: ${ty(K)}`:void 0}),$=_(O=>f6(O.snapshot,a.id)),L=_(O=>O.mode==="design"&&!!O.snapshot?.doc&&!O.snapshot.stale&&!O.snapshot.idGaps&&!Vf(O.snapshot.doc,O.level)),z=Bf(a),A=L&&!n&&!l?s.find(O=>O.state==="open"&&z.includes(O.name)):void 0,M=[E,S?"run-mode":"",N?`run-${N}`:"","afd-node",`type-${a.type}`,`status-${a.status??"draft"}`,Od(a)?"handler":"",a.type==="end"&&a.outcome==="failed"?"outcome-failed":"",t?"selected":"",w?"active":"",k?"afd-pick-at":"",$?`has-problem problem-${$.severity}`:"",a.disabled?"disabled":"",l==="frame"?"expanded":"",l==="inner"?"inner":"",b].filter(Boolean).join(" ");return(0,c.jsxs)("div",{className:M,"data-node-id":a.id,"data-disabled":a.disabled?"true":void 0,"data-run-state":N,"data-lens":m,"data-outside":E||void 0,title:j,children:[(0,c.jsx)("div",{className:"afd-hover-zone","aria-hidden":"true"}),s.map(O=>(0,c.jsx)(u6,{nodeId:a.id,type:a.type,port:O,readOnly:l==="inner",focusable:(t||w)&&l!=="inner",preview:my(a)},O.name)),f&&!n?(0,c.jsx)("button",{type:"button",className:"afd-expand icon nodrag nopan","data-expand":l==="frame"?"open":"closed",title:l==="frame"?"Collapse: show the subflow as one step":"Expand here: show the steps inside","aria-label":l==="frame"?"Collapse the subflow":"Expand the subflow here","aria-expanded":l==="frame",tabIndex:-1,onDoubleClick:O=>O.stopPropagation(),onClick:O=>{O.stopPropagation(),_.getState().toggleExpanded(a.id)},children:(0,c.jsx)("span",{className:`codicon codicon-chevron-${l==="frame"?"up":"down"}`,"aria-hidden":"true"})}):null,$&&!n?(0,c.jsx)(h6,{node:a,badge:$}):null,l==="frame"?(0,c.jsx)(g6,{ports:s}):null,A?(0,c.jsx)(c6,{nodeId:a.id,port:A,focusable:t||w}):null,p?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(vr,{id:"__data_in",type:"target",position:Ce.Left,isConnectable:!1,className:"afd-data-handle",style:{top:"30%"}}),(0,c.jsx)(vr,{id:"__data_out",type:"source",position:Ce.Right,isConnectable:!1,className:"afd-data-handle",style:{top:"70%"}})]}):null,n?(0,c.jsx)(yh,{node:a}):(0,c.jsx)(k6,{node:a,near:r})]})}),N6=6,NE=3,j6=6;function C6(e){let t=e.query.trim().toLowerCase(),n=e.type==="task";if(!t)return n?e.used.slice(0,j6).map(h=>({kind:h.kind,ref:h.ref,label:h.ref,hint:`${h.kind}, used in this flow`})):[];let r=e.types.filter(h=>h.type!==e.type&&h.label.toLowerCase().startsWith(t)).map(h=>({kind:"type",type:h.type,label:h.label,hint:"step type"}));if(!n)return r;let a=new Set,s=h=>!a.has(h)&&!!a.add(h),l=e.used.filter(h=>h.ref.toLowerCase().includes(t)&&s(`${h.kind}:${h.ref}`)).slice(0,NE).map(h=>({kind:h.kind,ref:h.ref,label:h.ref,hint:`${h.kind}, used in this flow`})),f=e.modules.filter(h=>!h.dimmed&&s(`module:${h.fqcn}`)).slice(0,N6).map(h=>({kind:"module",ref:h.fqcn,label:h.fqcn,hint:h.short_description||"module"})),p=e.roles.filter(h=>h.toLowerCase().includes(t)&&s(`role:${h}`)).slice(0,NE).map(h=>({kind:"role",ref:h,label:h,hint:"role"}));return[...r,...l,...f,...p]}function E6(e){let t=(e.split(/[./]/).pop()??e).replace(/[_-]+/g," ").trim();return t?t.charAt(0).toUpperCase()+t.slice(1):e}function $6(e){let t=new Map;for(let{node:n}of e.nodes.values()){let r=n.impl;if(!r?.ref||r.kind!=="module"&&r.kind!=="role")continue;let a=`${r.kind}:${r.ref}`;t.delete(a),t.set(a,{kind:r.kind,ref:r.ref})}return[...t.values()].reverse()}var _6=/^(ansible\.(builtin|legacy)\.)?set_fact$/;function by(e){return!!e&&_6.test(e)}function jE(e,t){if(!t||!by(e)||!("key_value"in t))return t;let{key_value:n,...r}=t;return r}function CE(e){let t=new Set(e.flow.runtime?.credentials??[]),n=[],r=[];for(let s of zo(e.nodes)){let l=s.settings;(l?.credential||l?.execution_environment)&&(r.push(s.id),l.credential&&t.add(l.credential),l.execution_environment&&!n.includes(l.execution_environment)&&n.push(l.execution_environment))}let a=e.flow.runtime?.execution_environment??n[0];return{credentials:[...t],...a?{execution_environment:a}:{},otherEnvironments:n.filter(s=>s!==a),nodes:r}}var xy=e=>`status:tested|${e}`;function EE(e){let t={statuses:new Map,records:new Map,decisions:new Set,dropped:[]},n=new Map((e.decisions??[]).filter(a=>a?.kind==="finding_accepted").map(a=>[a.finding,a])),r=[...zo(structuredClone(e.nodes))].reverse();for(let a of r){if(!Us(a)||!a.id)continue;let s=(a.subflow?.nodes??[]).filter(h=>!!h&&Us(h)),l=s.length>0?Gj(s.map(h=>h.status??"draft")):Dd(a),f=a.status??"draft",p=f==="tested"&&l==="implemented"&&s.length===0?"tested":l;if(p!==f&&t.statuses.set(a.id,p),a.status=p,p==="tested"){let h=n.get(xy(a.id));t.records.set(a.id,h?{reason:h.reason??"Marked tested by hand",...h.by?{by:h.by}:{}}:{reason:"Tested in flow format 1, before runs were recorded",flow_version:e.flow.version})}n.has(xy(a.id))&&(t.decisions.add(xy(a.id)),p!=="tested"&&t.dropped.push(a.title||a.key))}return t}var T6={from:1,notes(e){let t=EE(e),n=[],r=[...zo(e.nodes)].filter(s=>t.statuses.has(s.id)).map(s=>`${s.title} \u2192 ${t.statuses.get(s.id)}`);r.length&&n.push(`${r.length} status${r.length===1?"":"es"} follow what the nodes have (${r.slice(0,3).join(", ")}${r.length>3?", \u2026":""})`),t.records.size&&n.push(`${t.records.size} tested node${t.records.size===1?"":"s"} keep why on the node`);let a=t.dropped;return a.length&&n.push(`${a.length} node${a.length===1?"":"s"} marked tested by hand ${a.length===1?"is":"are"} not implemented, so the mark and its reason go (${a.slice(0,3).join(", ")}${a.length>3?", \u2026":""})`),e.flow.runtime?.kind&&n.push("the runtime kind is worked out from the flow"),n},apply(e){let t=EE(e.current.doc.toJS()),n=l=>Ro(e.current.doc.toJS()).nodes.get(l)?.path;for(let[l,f]of t.statuses){let p=n(l);p&&e.apply(h=>Sr(h,[...p,"status"],f,{before:j0("status")}))}for(let[l,f]of t.records){let p=n(l);p&&e.apply(h=>Sr(h,[...p,"tested"],f,{before:j0("tested")}))}let r=e.current.doc.toJS().decisions??[],a=r.map((l,f)=>l?.kind==="finding_accepted"&&t.decisions.has(l.finding)?f:-1).filter(l=>l>=0);if(a.length===r.length&&a.length>0)e.apply(l=>Bo(l,[],"decisions"));else for(let l of a.reverse())e.apply(f=>rh(f,["decisions"],l));let s=e.current.doc.toJS().flow.runtime;s?.kind!==void 0&&(Object.keys(s).length===1?e.apply(l=>Bo(l,["flow"],"runtime")):e.apply(l=>Bo(l,["flow","runtime"],"kind")))}},A6={from:1,notes(e){let t=Ws(e).filter(n=>e.decisions?.[n.index]?.kind!=="accepted").filter(n=>!(n.area==="lens"&&n.what.startsWith("status:tested|"))).length;return t?[`${t} decision${t===1?"":"s"} become one kind: accepted`]:[]},apply(e){let t=e.current.doc.toJS(),n=Ws(t).filter(r=>t.decisions?.[r.index]?.kind!=="accepted").map(r=>a=>Sr(a,["decisions",r.index],Yz(r)));e.applyAll(n)}};function $E(e){return(e.subflow?.nodes??[]).reduce((t,n)=>!n||!Us(n)?t:n.type==="subflow"?t+(n.settings?.become===void 0?1+$E(n):0):t+ +(n.settings?.become===void 0),0)}var M6={from:1,notes(e){let t=[],n=[...zo(e.nodes)],r=n.filter(a=>a.impl?.keywords&&"become_user"in a.impl.keywords).length;r&&t.push(`become_user moves from task keywords to the Privilege settings (${r} node${r===1?"":"s"})`);for(let a of n){let s=a.type==="subflow"&&a.settings?.become?$E(a):0;s&&t.push(`become on ${a.title} now applies to its ${s} step${s===1?"":"s"}`)}return t},apply(e){let t=e.current.doc.toJS();for(let n of zo(t.nodes)){let r=n.impl?.keywords?.become_user;if(r===void 0)continue;let a=Ro(e.current.doc.toJS()).nodes.get(n.id)?.path;a&&(n.settings?e.apply(s=>Sr(s,[...a,"settings","become_user"],String(r))):e.apply(s=>Sr(s,[...a,"settings"],{become_user:String(r)},{before:j0("settings")})),Object.keys(n.impl?.keywords??{}).filter(s=>s!=="become_user").length?e.apply(s=>Bo(s,[...a,"impl","keywords"],"become_user")):e.apply(s=>Bo(s,[...a,"impl"],"keywords")))}}},O6={from:1,notes(e){let t=CE(e);return t.nodes.length===0?[]:[`${[t.credentials.length?`credentials ${t.credentials.join(", ")}`:"",t.execution_environment?`execution environment ${t.execution_environment}`:""].filter(Boolean).join(" and ")} move from ${t.nodes.length} node${t.nodes.length===1?"":"s"} to the flow, where Set Up AWX Template applies them`,...t.otherEnvironments.length?[`execution environment ${t.otherEnvironments.join(", ")} is dropped (one per template)`]:[]]},apply(e){let t=CE(e.current.doc.toJS());if(t.nodes.length!==0){for(let n of t.nodes){let r=Ro(e.current.doc.toJS()).nodes.get(n);if(!r)continue;let a=r.node.settings??{};if(Object.keys(a).filter(s=>s!=="credential"&&s!=="execution_environment").length===0)e.apply(s=>Bo(s,r.path,"settings"));else for(let s of["credential","execution_environment"])a[s]!==void 0&&e.apply(l=>Bo(l,[...r.path,"settings"],s))}if(t.credentials.length&&e.apply(n=>Sr(n,["flow","runtime","credentials"],t.credentials)),t.execution_environment){let n=t.execution_environment;e.apply(r=>Sr(r,["flow","runtime","execution_environment"],n))}}}},P6={from:1,notes(e){let t=[...zo(e.nodes)].filter(n=>n.handler!==void 0).length;return t?[`handler is called purpose (${t} node${t===1?"":"s"})`]:[]},apply(e){let t=e.current.doc.toJS(),n=Ro(t);for(let r of zo(t.nodes)){if(r.handler===void 0)continue;let a=n.nodes.get(r.id)?.path;a&&(r.purpose===void 0?e.apply(s=>Z4(s,a,"handler","purpose")):e.apply(s=>Bo(s,a,"handler")))}}},_E=e=>!!e&&(mo.has(e.from?.port??"")||mo.has(e.to?.port??"")),D6=[T6,A6,M6,O6,P6,{from:1,notes(e){let t=Ro(e),n=[...zo(e.nodes)].filter(s=>s.ports?.some(l=>mo.has(l))).length,r=[...t.levels.values()].flatMap(s=>s.edges.filter(_E)).length;if(n+r===0)return[];let a=(s,l)=>`${s} ${l}${s===1?"":"s"}`;return[`the undo and cancelled ports go (${a(n,"node")}, ${a(r,"wire")}): they were never built; Rollback wires explicit undo steps, and undo bindings stay`]},apply(e){let t=()=>Ro(e.current.doc.toJS());for(let n of t().levels.values()){let r=n.edges.flatMap((a,s)=>_E(a)?[s]:[]).reverse();for(let a of r)e.apply(s=>rh(s,n.edgesPath,a))}for(let{node:n,path:r}of t().nodes.values()){let a=n.subflow?.boundary?.outputs??{};for(let[s,l]of Object.entries(a)){let f=[...r,"subflow","boundary","outputs"];if(mo.has(s)){e.apply(h=>Bo(h,f,s));continue}let p=Array.isArray(l)?l:[];for(let h=p.length-1;h>=0;h--)mo.has(p[h]?.port??"")&&e.apply(v=>rh(v,[...f,s],h))}}for(let{node:n,path:r}of t().nodes.values()){let a=n.ports??[];if(a.some(s=>mo.has(s)))if(a.every(s=>mo.has(s)))e.apply(s=>Bo(s,r,"ports"));else for(let s=a.length-1;s>=0;s--)mo.has(a[s])&&e.apply(l=>rh(l,[...r,"ports"],s))}}}];function L6(e,t=D6){let n=Rt(e);return t.filter(r=>r.from>=n&&r.from<2).flatMap(r=>r.notes(e))}new Set("False.None.True.and.as.assert.async.await.break.class.continue.def.del.elif.else.except.false.finally.for.from.global.if.import.in.is.lambda.none.nonlocal.not.or.pass.raise.return.true.try.while.with.yield".split("."));var I6=/^(ansible_[a-z0-9_]*|inventory_hostname(_short)?|inventory_dir|inventory_file|hostvars|groups|group_names|play_hosts|playbook_dir|role_path|role_name|omit|item|ansible_loop_var|lookup|query|q|now|range|dict|namespace|loop|afd_[a-z0-9_]*|awx_[a-z0-9_]*|tower_[a-z0-9_]*)$/;function Xd(e){let t=e.impl;return{kind:t?.kind??"module",ref:t?.ref??"",collection_version:t?.collection_version,params:structuredClone(t?.params??{}),register:t?.kind==="module"||!t?Ys(e,t):"",inputs:{},outputs:{}}}var wy=e=>e===void 0||e===""||Array.isArray(e)&&e.length===0;function TE(e){if(!e.ref.trim())return null;let t=Object.fromEntries(Object.entries(e.params).filter(([,n])=>!wy(n)));return{kind:e.kind,ref:e.ref.trim(),...e.kind==="module"&&e.collection_version?{collection_version:e.collection_version}:{},...Object.keys(t).length>0?{params:t}:{},...e.kind==="module"&&e.register?{register:e.register}:{}}}function AE(e,t){let n={...e??{}};for(let[r,a]of Object.entries(t))a===null?delete n[r]:n[r]=a;return Object.keys(n).length>0?n:void 0}function Zd(e,t){let n=TE(t),r=n&&n.kind!=="playbook"?e.impl?.keywords:void 0;return{...e,impl:n&&r?{...n,keywords:r}:n,inputs:AE(e.inputs,t.inputs),outputs:AE(e.outputs,t.outputs)}}function R6(e,t){let n=Zd(e,Xd(e)),r=Zd(e,t);return JSON.stringify(r.impl??null)!==JSON.stringify(n.impl??null)||JSON.stringify(r.inputs??null)!==JSON.stringify(n.inputs??null)||JSON.stringify(r.outputs??null)!==JSON.stringify(n.outputs??null)}function z6(e,t){let n=TE(t),r=(a,s)=>Object.fromEntries(Object.entries(a).filter(([l,f])=>JSON.stringify(f)!==JSON.stringify(e[s]?.[l]??null)));return{kind:"setBinding",id:e.id,impl:n,inputs:r(t.inputs,"inputs"),outputs:r(t.outputs,"outputs")}}function F6(e){return e.type==="bool"||e.type==="boolean"?"bool":e.choices&&e.choices.length>0&&e.type!=="list"?"choice":e.type==="list"&&(!e.elements||e.elements==="str")&&!e.suboptions?"list":e.type==="int"||e.type==="float"?"number":e.type==="dict"||e.type==="list"||e.type==="json"||e.suboptions?"yaml":"text"}function ME(e,t){let n=Object.entries(e??{}).map(([a,s])=>({name:a,option:s,control:F6(s),required:!!s.required&&s.default===void 0})),r=a=>a.required||!wy(t[a.name])||(a.option.aliases??[]).some(s=>!wy(t[s]));return{shown:n.filter(r),more:n.filter(a=>!r(a))}}function B6(e,t,n=[]){let{shown:r,more:a}=ME(e,t);return{required:r.filter(s=>s.required),set:r.filter(s=>!s.required),added:n.flatMap(s=>a.filter(l=>l.name===s)),rest:a.filter(s=>!n.includes(s.name))}}function q6(e,t){let n=t.trim().toLowerCase();if(!n)return[...e];let r=a=>{let s=a.name.toLowerCase();return s===n?0:s.startsWith(n)?1:s.includes(n)?2:(a.option.aliases??[]).some(l=>l.toLowerCase().includes(n))?3:a.option.description.toLowerCase().includes(n)?4:-1};return e.map((a,s)=>({f:a,i:s,r:r(a)})).filter(a=>a.r>=0).sort((a,s)=>a.r-s.r||a.i-s.i).map(a=>a.f)}var H6=new Set(["binding-not-in-ee","binding-removed","binding-redirect","binding-deprecated"]),V6={str:"string",string:"string",int:"integer",integer:"integer",float:"any",bool:"boolean",boolean:"boolean",list:"list",dict:"dict",complex:"dict"};function K6(e){return V6[e.type]??"any"}function W6(e,t,n){let r=t.impl;if(!r)return[{state:"missing",text:"Choose a module, role or playbook"}];let a=[],s=n.plugin;if(r.kind==="module"&&s){let l=r.params??{},f=new Set(Object.keys(l)),p=Object.entries(jE(r.ref,s.options)??{}).filter(([h,v])=>v.required&&v.default===void 0&&!f.has(h)).filter(([,h])=>!(h.aliases??[]).some(v=>f.has(v))).map(([h])=>h);a.push(p.length>0?{state:"missing",text:`Required parameters missing: ${p.join(", ")}`}:{state:"ok",text:"Required parameters set"})}for(let l of I0(r.params??{})){if(I6.test(l))continue;let f=t.inputs?.[l],p=f?.from;if(!f)a.push({state:"missing",text:`${l} is not an input of this node`});else if(p?.startsWith("flow."))a.push({state:"ok",text:`${l} comes from flow inputs`});else if(p){let h=p.split(".")[0]??"",v=[...e.nodes.values()].find(g=>g.node.key===h)?.node;a.push({state:"ok",text:`${l} comes from ${v?`"${v.title}"`:p}`})}else a.push({state:"warn",text:`${l} is an input without a source (from:)`})}if(r.kind==="module"&&s){let l=s.attributes?.check_mode?.support;l==="full"?a.push({state:"ok",text:"Supports check mode, safe in skeleton runs"}):l==="partial"?a.push({state:"warn",text:"Partial check mode support: skeleton runs may differ"}):l==="none"&&a.push({state:"warn",text:"No check mode: skeleton runs skip this task"}),s.deprecated&&a.push({state:"warn",text:`Deprecated: ${s.deprecated.why||"see the docs"}`})}return r.kind==="role"&&a.push(n.roleSpec?{state:"ok",text:"The role checks its arguments (argument_specs)"}:{state:"warn",text:"No argument_specs: variables are free-form"}),r.kind==="playbook"&&a.push(n.playbookTargets?{state:"ok",text:"Its plays target {{ afd_hosts }}, the hosts arriving here"}:{state:"warn",text:"Its plays do not target {{ afd_hosts }}: they run on their own hosts"}),a}var OE=["stdout","stdout_lines","rc","stderr","json","status","content","msg"];function U6(e){let t=(e.split(`
|
|
169
|
+
`)[0]??"").trim();return(/^(.*?[.!?])(\s|$)/.exec(t)?.[1]??t).slice(0,120)}function PE(e){let t=n=>{let r=OE.indexOf(n);return r<0?OE.length:r};return Object.entries(e??{}).filter(([n])=>/^[A-Za-z_][A-Za-z0-9_]*$/.test(n)).sort(([n],[r])=>t(n)-t(r)).map(([n,r])=>({name:n,detail:U6(String(r?.description??""))}))}function ky(e,t){if(!t.has(e))return e;let n=2;for(;t.has(`${e}_${n}`);)n++;return`${e}_${n}`}function Gd(e,t,n){let r=t.inputs??{},a=new Set(Object.keys(r)),s=new Set(Object.values(r).map(w=>w?.from)),l=e.nodes.get(t.id)?.level,f=w=>{let k=w.impl?.kind==="module"?n?.(w):void 0;return k&&k.length>0?{fields:k}:{}},p=w=>{if(!w||!l||!n)return{};let k=F0(e,t,l,"inputs",w);return k.kind!=="output"||!k.name||k.path.length>0?{}:k.node.outputs?.[k.name]?.from==="impl.register"?f(k.node):{}},h=Object.entries(r).map(([w,k])=>({name:w,label:w,detail:k?.from?`input from ${k.from}`:"node input",...p(k?.from)}));for(let[w,k]of Object.entries(e.doc.flow?.inputs??{})){let S=`flow.${w}`;if(s.has(S)||k?.type==="host_list")continue;let N=ky(w,a);a.add(N),h.push({name:N,label:S,detail:"flow input \xB7 adds a node input",field:{type:k?.type??"any",from:S}})}let v=(w,k,S,N,E={})=>{if(s.has(k))return;s.add(k);let j=ky(w,a);a.add(j),h.push({name:j,label:k,detail:S,field:{type:N,from:k},...E})},g=e.nodes.get(t.id)?.level;for(let w of g?z0(e,g):[])for(let[k,S]of Object.entries(w.inputs??{}))v(k,`${w.key}.${k}`,`input of subflow "${w.title}" \xB7 adds a node input`,S?.type??"any");let m=dC(e,t.id);for(let w of m)for(let[k,S]of Object.entries(w.outputs??{}))v(k,`${w.key}.${k}`,`output of "${w.title}" \xB7 adds a node input`,S?.type??"any",S?.from==="impl.register"?f(w):{});let b=(w,k)=>{for(let S of w.subflow?.nodes??[]){if(!S?.key)continue;let N=`${k}/${S.key}`;for(let[E,j]of Object.entries(S.outputs??{}))Object.keys(w.outputs??{}).some($=>{let L=sC(w,$);return!!L&&"inner"in L&&L.inner.id===S.id&&L.output===E})||v(E,`${N}.${E}`,`output of "${S.title}" inside "${w.title}" \xB7 lifts it to ${k.split("/")[0]}`,j?.type??"any");S.subflow&&b(S,N)}};for(let w of m)w.type==="subflow"&&b(w,w.key);for(let w of m){if(w.impl?.kind!=="module"||Object.values(w.outputs??{}).some(E=>E?.from==="impl.register"))continue;let k=Ys(w),S=`${w.key}.${k}`;if(s.has(S))continue;s.add(S);let N=ky(k,a);a.add(N),h.push({name:N,label:S,detail:`result of "${w.title}" \xB7 makes it an output there`,field:{type:"dict",from:S},expose:{node:w.id,output:k},...f(w)})}return h}var Sy=new Map,Y6=1;Yg(e=>{if(e.type==="catalogStatus"&&e.status.state==="ready"&&Ny.clear(),e.type!=="catalogReply")return;let t=Sy.get(e.reqId);Sy.delete(e.reqId),t&&(e.ok?t.resolve(e.result):t.reject(Error(e.error??"The catalog request failed")))});function bh(e){let t=Y6++;return new Promise((n,r)=>{Sy.set(t,{resolve:n,reject:r}),je({type:"catalog",reqId:t,request:e})})}function xi(e,t,n=0){let[r,a]=(0,T.useState)({loading:!!e});return(0,T.useEffect)(()=>{if(!e){a({loading:!1});return}let s=!0;a(f=>({...f,loading:!0}));let l=setTimeout(()=>{bh(e).then(f=>s&&a({data:f,loading:!1}),f=>s&&a({error:f.message,loading:!1}))},n);return()=>{s=!1,clearTimeout(l)}},[t]),r}function X6(e){let t=[...new Set(e)].sort().join(","),[n,r]=(0,T.useState)({});return(0,T.useEffect)(()=>{let a=!0;for(let s of t?t.split(","):[])bh({op:"doc",fqcn:s}).then(l=>a&&r(f=>({...f,[s]:PE(l?.returns)})),()=>{});return()=>{a=!1}},[t]),n}var Ny=new Map;function jy(e){let t=Ny.get(e);return t||(t=bh({op:"names",type:e}).catch(()=>[]),Ny.set(e,t)),t}function Z6(e=!0){let[t,n]=(0,T.useState)({});return(0,T.useEffect)(()=>{if(!e)return;let r=!0;return Promise.all([jy("filter"),jy("test"),jy("lookup")]).then(([a,s,l])=>r&&n({filters:a,tests:s,lookups:l})),()=>{r=!1}},[e]),t}function DE(e,t){let n=_(r=>r.focusRequest);(0,T.useEffect)(()=>{let r=t.current;e&&n?.field===e&&r&&(r.focus(),r.select(),_.setState({focusRequest:null}))},[e,n,t])}var G6='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])';function LE(e){return[...e?.querySelectorAll(G6)??[]].filter(t=>!t.closest("[hidden], [inert]")&&t.getAttribute("aria-hidden")!=="true")}var xh=[];function IE(e=!0){let[t]=(0,T.useState)(()=>{if(!e)return null;let n=document.activeElement;return n?.closest?.('[role="menu"]')?xh.at(-1)??n:n});(0,T.useEffect)(()=>{if(t)return xh.push(t),()=>{xh.splice(xh.lastIndexOf(t),1);let n=t;(document.activeElement===document.body||!document.activeElement)&&n.isConnected&&typeof n.focus=="function"&&n.focus()}},[t])}function nl(e){return IE(),(0,T.useLayoutEffect)(()=>{let t=setTimeout(()=>{let n=e.current;n&&!n.contains(document.activeElement)&&LE(n)[0]?.focus()},0);return()=>clearTimeout(t)},[e]),t=>{if(t.key!=="Tab")return;let n=LE(e.current),r=n[0],a=n.at(-1);if(!r||!a)return;let s=document.activeElement;t.shiftKey&&(s===r||!e.current?.contains(s))?(t.preventDefault(),a.focus()):t.shiftKey||s!==a&&e.current?.contains(s)||(t.preventDefault(),r.focus())}}function RE(e){let t=[...e.currentTarget.querySelectorAll('[role="tab"]:not([disabled])')],n=t.indexOf(document.activeElement);if(n<0)return;let r=e.key==="ArrowRight"?(n+1)%t.length:e.key==="ArrowLeft"?(n-1+t.length)%t.length:e.key==="Home"?0:e.key==="End"?t.length-1:-1;r<0||(e.preventDefault(),e.stopPropagation(),t[r]?.focus(),t[r]?.click())}function Nr({id:e,summary:t,open:n=!1,defaultOpen:r=!1,lazy:a=!1,children:s}){let[l,f]=(0,T.useState)(()=>Ms().folds?.[e]??r),p=n||l;return(0,c.jsxs)("details",{className:"afd-fold","data-fold":e,open:p,onToggle:h=>{let v=h.currentTarget.open;if(v===p)return;f(v);let g=Ms();Xg({...g,folds:{...g.folds,[e]:v}})},children:[(0,c.jsx)("summary",{children:t}),p||!a?s:null]})}var Cy=["task","subflow","decision","approval","parallel","join"];function Q6(){return _(e=>e.quickAdd!==null)?(0,c.jsx)(J6,{}):null}function J6(){let e=_(q=>q.quickAdd),t=_(q=>q.snapshot),n=_(q=>q.openQuickAdd),r=_(q=>q.select),[a,s]=(0,T.useState)("task"),[l,f]=(0,T.useState)(""),[p,h]=(0,T.useState)(""),[v,g]=(0,T.useState)([]),[m,b]=(0,T.useState)([]),[w,k]=(0,T.useState)(!0),[S,N]=(0,T.useState)(null),[E,j]=(0,T.useState)(!1),[$,L]=(0,T.useState)(-1),z=(0,T.useId)(),A=(0,T.useRef)(null),M=(0,T.useRef)(null),O=nl(M);(0,T.useEffect)(()=>{e&&(s(e.type),f(e.title??""),h(""),g([]),b([]),k(!0),N(null),j(!1),L(-1),setTimeout(()=>A.current?.focus(),0))},[e]);let K=(0,T.useMemo)(()=>t?.doc?Ee(t.doc):void 0,[t]),B=_(q=>q.level),V=E&&!S?l.trim():"",oe=a==="task"&&!S,F=xi(oe&&V.length>=2?{op:"search",query:V,types:["module"]}:null,`quick-add:${oe?V:""}`,200),J=xi(oe&&E?{op:"roles"}:null,`quick-add-roles:${oe&&E}`),I=(0,T.useMemo)(()=>K?$6(K):[],[K]);if(!e||!K)return null;let U=K.levels.get(B),W=e.insertOn?K.edges.get(e.insertOn)?.edge:void 0,re=e.connectFrom??W?.from,le=re?K.nodes.get(re.node)?.node:void 0,pe=W?K.nodes.get(W.to.node)?.node:void 0,xe=new Set(U?.nodes.map(q=>q?.key)),Ne=UF(PC(l||yo[a]),xe),we=U?Rj(U):void 0,R=Ks({type:a}).some(q=>q.name==="failed_hosts"),Q=Object.entries(le?.outputs??{}),fe=Zz.filter(q=>e.insertOn?Cy.includes(q):!e.connectFrom||q!=="start"),X=S?[]:C6({query:E?l.trim():"",type:a,types:fe.map(q=>({type:q,label:yo[q]})),modules:F.data??[],roles:(J.data??[]).map(q=>q.name),used:I}),he=$<X.length?$:-1,Z=q=>{L(-1),q.kind==="type"?(s(q.type),g([]),f(""),j(!1)):(s("task"),g([]),N({kind:q.kind,ref:q.ref}),f(E6(q.ref)),setTimeout(()=>A.current?.select(),0)),A.current?.focus()};return(0,c.jsx)("div",{className:"afd-modal-backdrop",children:(0,c.jsxs)("form",{ref:M,className:"afd-modal",role:"dialog","aria-modal":"true","aria-labelledby":"afd-qa-title",onSubmit:async q=>{if(q?.preventDefault(),!l.trim())return;let ee={};for(let Fe of m)ee[Fe]={type:le?.outputs?.[Fe]?.type??"any",from:`${le?.key}.${Fe}`};let de=_.getState().snapshot,me=de?.doc&&e.position?xa(cn(de,_.getState().optimistic,B),de.doc.layout):void 0,De=await Pe({kind:"addNode",parent:B==="root"?void 0:B,type:a,title:l.trim(),intent:p.trim()||void 0,ports:v,inputs:ee,...S&&a==="task"?{impl:S}:{},position:e.position,connectFrom:e.connectFrom,insertOn:e.insertOn,freeze:me,wireFailedTo:R&&w&&we?we.id:void 0});De.ok&&(n(null),De.created&&r({node:De.created}))},onKeyDown:q=>{O(q),q.key==="Escape"&&(q.stopPropagation(),n(null))},children:[(0,c.jsx)("h2",{id:"afd-qa-title",children:"Add Node"}),(0,c.jsx)("p",{className:"muted",children:le&&W?(0,c.jsxs)(c.Fragment,{children:["Between ",(0,c.jsx)("strong",{children:le.title})," \xB7"," ",(0,c.jsx)("span",{className:"mono",children:W.from.port})," and"," ",(0,c.jsx)("strong",{children:pe?.title})]}):le&&e.connectFrom?(0,c.jsxs)(c.Fragment,{children:["After ",(0,c.jsx)("strong",{children:le.title}),", from port"," ",(0,c.jsx)("span",{className:"mono",children:e.connectFrom.port})]}):"New draft node on the canvas"}),(0,c.jsx)("fieldset",{className:"afd-type-picker","aria-label":"Node type",children:fe.map(q=>(0,c.jsx)("button",{type:"button","aria-pressed":a===q,className:a===q?"active":"",onClick:()=>{s(q),g([]),q!=="task"&&N(null)},children:yo[q]},q))}),(0,c.jsxs)("div",{className:"afd-field",children:[(0,c.jsx)("label",{htmlFor:"afd-qa-name",children:"Title"}),(0,c.jsx)("input",{id:"afd-qa-name",ref:A,className:"afd-input",value:l,placeholder:a==="task"?"A name, or a module or role to find":"e.g. Check NTP",role:"combobox","aria-expanded":X.length>0,"aria-controls":z,"aria-autocomplete":"list","aria-activedescendant":he>=0?`${z}-${he}`:void 0,autoComplete:"off",onChange:q=>{f(q.target.value),j(!0),L(-1)},onKeyDown:q=>{if(X.length!==0)if(q.key==="ArrowDown"||q.key==="ArrowUp"){q.preventDefault();let ee=q.key==="ArrowDown"?1:-1,de=he+ee;L(de>=X.length||de<-1?-1:de)}else q.key==="Enter"&&he>=0&&(q.preventDefault(),Z(X[he]))}}),S?(0,c.jsxs)("div",{className:"afd-qa-bound","data-bound":S.ref,children:[(0,c.jsxs)("span",{className:"muted",children:["Runs ",S.kind]})," ",(0,c.jsx)("span",{className:"mono",children:S.ref}),(0,c.jsx)("button",{type:"button",className:"icon","aria-label":`Do not bind to ${S.ref}`,title:"Add the step without a binding",onClick:()=>{N(null),A.current?.focus()},children:(0,c.jsx)("span",{className:"codicon codicon-close","aria-hidden":"true"})})]}):null,X.length>0?(0,c.jsx)("div",{className:"afd-qa-list",id:z,role:"listbox","aria-label":"Matching steps",children:X.map((q,ee)=>(0,c.jsxs)("div",{id:`${z}-${ee}`,role:"option","aria-selected":ee===he,className:ee===he?"active":"",onMouseDown:de=>de.preventDefault(),onClick:()=>Z(q),children:[(0,c.jsx)("span",{className:"afd-qa-what mono",children:q.label}),(0,c.jsx)("span",{className:"afd-qa-why muted",title:q.hint,children:q.hint})]},`${q.kind}:${q.kind==="type"?q.type:q.ref}`))}):null,(0,c.jsxs)("div",{className:"muted mono afd-key-preview",title:"The step's name in the file and in the generated code; its ID is made when you add it",children:["Key: ",Ne]})]}),a!=="start"&&a!=="end"?(0,c.jsxs)("div",{className:"afd-field",children:[(0,c.jsx)("label",{htmlFor:"afd-qa-intent",children:"Intent (optional)"}),(0,c.jsx)("textarea",{id:"afd-qa-intent",className:"afd-input",rows:2,value:p,placeholder:"One sentence on what the step does: a skeleton run prints it",onChange:q=>h(q.target.value)})]}):null,Q.length>0?(0,c.jsxs)("fieldset",{className:"afd-fieldset",children:[(0,c.jsxs)("legend",{children:["Inputs from ",le?.title]}),Q.map(([q,ee])=>(0,c.jsxs)("label",{className:"afd-check",children:[(0,c.jsx)("input",{type:"checkbox",checked:m.includes(q),onChange:de=>b(me=>de.target.checked?[...me,q]:me.filter(De=>De!==q))}),(0,c.jsx)("span",{className:"mono",children:q})," ",(0,c.jsx)("span",{className:"muted",children:ee?.type})]},q))]}):null,_j(a).length>0?(0,c.jsx)(Nr,{id:"quick-add-ports",open:v.length>0,summary:`Extra ports (optional)${v.length?`: ${v.join(", ")}`:""}`,children:_j(a).map(q=>(0,c.jsxs)("label",{className:"afd-check",children:[(0,c.jsx)("input",{type:"checkbox",checked:v.includes(q),onChange:ee=>g(de=>ee.target.checked?[...de,q]:de.filter(me=>me!==q))}),(0,c.jsx)("span",{className:"mono",children:q})," ",(0,c.jsx)("span",{className:"muted",children:ka(q,a)})]},q))}):null,R&&we?(0,c.jsxs)("label",{className:"afd-check",children:[(0,c.jsx)("input",{type:"checkbox",checked:w,onChange:q=>k(q.target.checked)}),"Wire ",(0,c.jsx)("span",{className:"mono",children:"failed_hosts"})," to ",(0,c.jsx)("strong",{children:we.title})]}):null,(0,c.jsxs)("div",{className:"afd-modal-actions",children:[(0,c.jsx)("button",{type:"button",className:"secondary",onClick:()=>n(null),children:"Cancel"}),(0,c.jsxs)("button",{type:"submit",disabled:!l.trim(),children:["Add ",yo[a]]})]})]})})}function wh(){let{snapshot:e,optimistic:t}=_.getState();if(!e?.doc)return;let n=cn(e,t,_.getState().level);return{doc:e.doc,view:n,freeze:xa(n,e.doc.layout)}}async function zE(e,t){let n=wh();if(!n)return;let r=await Pe({kind:"applyPattern",pattern:e,from:t,position:iy(n.view,t.node,t.port),freeze:n.freeze});r.ok&&r.created&&_.getState().select({node:r.created})}async function FE(e,t,n){let r=_.getState().snapshot?.doc;if(!r)return;let a=x4(Ee(r),t,e,n);a?await zE(e,{node:t,port:a}):_.getState().setError("This node has no open port this pattern fits")}function Ey(e){let t=wh(),n=t?.view.edges.find(l=>l.id===e),r=t?.view.nodes.find(l=>l.node.id===n?.source),a=t?.view.nodes.find(l=>l.node.id===n?.target);if(!t||!r||!a)return;let s={x:(r.position.x+a.position.x)/2+40,y:(r.position.y+a.position.y)/2};return XC(t.view,s,{width:r.width,height:r.height})}async function ol(e,t){let n=_.getState();switch(n.openPortMenu(null),e.kind){case"pattern":await zE(e.pattern,t);return;case"quickAdd":{let r=wh();n.openQuickAdd({type:"task",connectFrom:t,title:e.title,position:r?iy(r.view,t.node,t.port):void 0});return}case"insert":n.openQuickAdd({type:"task",insertOn:e.edge,position:Ey(e.edge)});return;case"pick":n.setPick({mode:e.mode,ref:t,edge:e.edge});return;case"disconnect":await Pe({kind:"disconnect",edge:e.edge});return;case"decide":n.setDecide(t);return;case"reopen":await Pe({kind:"clearDecision",node:t.node,port:t.port});return;case"enable":case"disable":await Pe({kind:"setPortEnabled",node:t.node,port:t.port,enabled:e.kind==="enable"});return;case"later":return}}function e8(e){let t=_.getState(),n=t.snapshot?.doc?Ee(t.snapshot.doc).edges.get(e)?.edge.from.node:"",r=!!n&&n in(t.snapshot?.autoPositions??{});t.openQuickAdd({type:"task",insertOn:e,...r?{}:{position:Ey(e)}})}async function t8(e,t,n){let r=_.getState(),a=r.snapshot?.doc,s=a?Ee(a).edges.get(e)?.edge:void 0;if(!a||!s)return;if(!n){await Pe({kind:"disconnect",edge:e});return}if(t==="target"){let p=n.port&&qf(n.port)==="in"?n.port:"in";if(s.to.node===n.node&&s.to.port===p)return;await Pe({kind:"rewire",edge:e,to:{node:n.node,port:p}});return}let l=Gf(Ee(a),n.node),f=n.port&&qf(n.port)==="out"?n.port:s.from.node===n.node?s.from.port:l&&!l.insertOn?l.port:void 0;f?(s.from.node!==n.node||s.from.port!==f)&&await Pe({kind:"rewireFrom",edge:e,from:{node:n.node,port:f}}):r.setError("That node has no open output to wire from")}async function BE(e){let{pick:t,snapshot:n,setPick:r,setError:a}=_.getState();if(t&&n?.doc)switch(r(null),t.mode){case"to":await Pe({kind:"connect",from:t.ref,to:{node:e,port:"in"}});return;case"rewire":t.edge&&await Pe({kind:"rewire",edge:t.edge,to:{node:e,port:"in"}});return;case"attach":await P5(t.ref.node,e);return;case"from":{let s=rC(Ee(n.doc),e);if(!s){a("That node has no free output to wire from");return}await Pe({kind:"connect",from:{node:e,port:s},to:t.ref});return}}}function $y(e,t){let n=e.node in(_.getState().snapshot?.autoPositions??{});t&&n?_.getState().openQuickAdd({type:"task",insertOn:t}):ol(t?{kind:"insert",label:"Add Next Node",edge:t}:{kind:"quickAdd",label:"Add Next Node"},e)}function _y(e){let t=_.getState(),n=t.snapshot?.doc;if(!n)return;let r=e??t.selection.node,a=r?Gf(Ee(n),r):void 0;if(r&&a)$y({node:r,port:a.port},a.insertOn);else{let s=dy();t.openQuickAdd({type:"task",...s?{position:s}:{}})}}function n8(e){let t=_.getState(),n=t.snapshot?.doc;if(!n||!Cy.includes(e))return!1;let r=Ee(n),a=r.levels.get(t.level)?.nodes??[],s=a.every(h=>h.type==="start"||h.type==="end"),l=t.selection.node??(s?a.find(h=>h.type==="start")?.id:void 0),f=l?Gf(r,l):void 0;if(!l||!f)return!1;let p=l in(t.snapshot?.autoPositions??{});if(f.insertOn)t.openQuickAdd({type:e,insertOn:f.insertOn,...p?{}:{position:Ey(f.insertOn)}});else{let h=wh();t.openQuickAdd({type:e,connectFrom:{node:l,port:f.port},position:h?iy(h.view,l,f.port):void 0})}return!0}function qE(e){_.getState().reveal(e.node),setTimeout(()=>{let t=document.querySelector(`.react-flow__node[data-id="${e.node}"] [data-port="${e.port}"]`);t&&_.getState().openPortMenu({ref:e,...SE(t,"right")})},300)}function o8(e){return e.every(t=>t.node.type==="start"||t.node.type==="end")}function HE(){let e=ph(),t=_(r=>r.mode==="design"),n=_(()=>Yt());return t&&n&&o8(e.nodes)}function r8({at:e}){let t=ph(),n=_(l=>l.level);if(!HE())return null;let r=t.nodes.find(l=>l.node.type==="start")?.node.id,a=()=>_y(r),s=n===on;return(0,c.jsxs)("section",{className:"afd-empty-level nodrag nopan","aria-label":"Start this level","data-empty-level":!0,style:{transform:`translate(${e.x}px, ${e.y}px)`,width:Wj.width},children:[(0,c.jsx)("h2",{children:s?"Start with a Step":"This subflow has no steps yet"}),(0,c.jsx)("p",{className:"muted",children:s?"Add the first step after Start, then wire what happens when it fails. Or begin from what you already have.":"Add the first step; the wires into and out of the frame lead to it."}),(0,c.jsxs)("div",{className:"afd-empty-actions",children:[(0,c.jsxs)("button",{type:"button",onClick:a,children:[(0,c.jsx)("span",{className:"codicon codicon-add","aria-hidden":"true"})," Add a Step"," ",(0,c.jsx)("kbd",{className:"afd-menu-key",children:"N"})]}),s?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("button",{type:"button",className:"secondary",onClick:()=>je({type:"startFrom",what:"playbooks"}),children:"Import Ansible Playbooks\u2026"}),(0,c.jsx)("button",{type:"button",className:"secondary",onClick:()=>je({type:"startFrom",what:"awx"}),children:"Import AWX Workflow or Job Template\u2026"}),(0,c.jsx)("button",{type:"button",className:"secondary",onClick:()=>je({type:"startFrom",what:"sample"}),children:"Open Sample Flow\u2026"})]}):null]}),s?(0,c.jsxs)("p",{className:"muted",children:["New here?"," ",(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>je({type:"startFrom",what:"tour"}),children:"Get Started"})," ","walks you through a first flow."]}):null]})}var i8={note:"Note",section:"Section",text:"Text"},Qd=50;function a8(){return _(e=>e.find)?(0,c.jsx)(s8,{}):null}function s8(){let e=hh(),t=_(k=>k.findQuery),n=_(k=>k.findNonce),r=(0,T.useRef)(null),a=_(k=>k.snapshot?.findings),s=_(k=>k.snapshot?.openPorts),l=(0,T.useMemo)(()=>e?Z5(e,t,Qd,{findings:a,openPorts:s}):[],[e,t,a,s]),f=V5(t),p=t.trim()&&l.length?F5(t,l.length)?.replace(/^\d+/,l.length===Qd?`${Qd}+`:String(l.length)):void 0,h=k=>{let S=t.replace(/\S*$/,"");_.getState().setFindQuery(`${S}${k}${k.endsWith(":")?"":" "}`),g(0),r.current?.focus()},[v,g]=(0,T.useState)(()=>Math.max(0,l.findIndex(k=>k.id===_.getState().selection.node)));(0,T.useEffect)(()=>{r.current?.focus(),r.current?.select()},[n]);let m=k=>{let S=l[k];S&&(g(k),_.getState().reveal(S.id))},b=()=>{let k=_.getState().selection.node;_.getState().openFind(!1),setTimeout(()=>document.querySelector(`.react-flow__node[data-id="${k}"]`)?.focus())},w=l[v];return(0,c.jsxs)("search",{className:"afd-find nodrag nopan nowheel","data-find":l.length,children:[(0,c.jsxs)("div",{className:"afd-find-row",children:[(0,c.jsx)("span",{className:"codicon codicon-search","aria-hidden":"true"}),(0,c.jsx)("input",{ref:r,className:"afd-input",role:"combobox","aria-label":"Find a node","aria-expanded":l.length>0,"aria-controls":"afd-find-results","aria-autocomplete":"list","aria-activedescendant":w?`afd-find-${w.id}`:void 0,placeholder:"Title, key or module; status:draft, type:approval\u2026",value:t,onChange:k=>{_.getState().setFindQuery(k.target.value),g(0)},onKeyDown:k=>{if(k.key==="ArrowDown"||k.key==="ArrowUp"){k.preventDefault();let S=k.key==="ArrowDown"?1:-1;l.length&&g((v+S+l.length)%l.length)}else k.key==="Enter"?(k.preventDefault(),m(k.shiftKey?(v-1+l.length)%l.length:v)):k.key==="Escape"&&(k.preventDefault(),k.stopPropagation(),b())}}),(0,c.jsx)("span",{className:"muted afd-find-count","aria-live":"polite",children:t.trim()?`${l.length===Qd?`${Qd}+`:l.length} found`:"every level"}),(0,c.jsx)("button",{type:"button",className:"icon","aria-label":"Close Find",title:"Close (Esc)",onClick:b,children:(0,c.jsx)("span",{className:"codicon codicon-close","aria-hidden":"true"})})]}),!t.trim()||f.length?(0,c.jsx)("div",{className:"afd-find-hints muted","data-find-hints":!0,children:(f.length?f:["has:no-binding","type:approval","open:fail","has:errors","status:draft"]).map(k=>(0,c.jsx)("button",{type:"button",className:"chip-button mono",title:R5[k],onMouseDown:S=>S.preventDefault(),onClick:()=>h(k),children:k},k))}):null,p?(0,c.jsx)("p",{className:"muted afd-find-summary","data-find-summary":!0,children:p}):null,t.trim()&&l.length?(0,c.jsx)("div",{id:"afd-find-results",role:"listbox","aria-label":"Nodes found",className:"afd-find-results",children:l.map((k,S)=>(0,c.jsxs)("div",{id:`afd-find-${k.id}`,role:"option","aria-selected":S===v,className:S===v?"active":"","data-found":k.id,onMouseDown:N=>N.preventDefault(),onClick:()=>m(S),children:[(0,c.jsx)("span",{className:"afd-find-title",children:k.title}),(0,c.jsxs)("span",{className:"muted",children:[[...k.trail,k.annotation?i8[k.annotation]:yo[k.type]].join(" \u203A "),k.ref?` \xB7 ${k.ref}`:""]})]},k.id))}):null]})}function VE(e){return(e.nodes??[]).filter(t=>t&&t.type!=="start"&&t.type!=="end").length}function l8(e,t,n){let r=VE(e);return[{id:"step",label:"Add a step",detail:"Add a Step (N) puts one between Start and Done.",done:r>0},{id:"code",label:"See the playbook it makes",detail:"One play per step, in generated/. Peek Code shows a step's play.",done:n.includes("codeSeen")},{id:"failure",label:"Decide what happens when it fails",detail:"A fail port needs a handler, or a reason to stay open.",done:r>0&&t===0},{id:"run",label:"Run it as a skeleton",detail:"Steps without code print TODO. It needs an Ansible environment.",done:n.includes("skeletonRun")}]}function d8(e){let t=VE(e);return t>=1&&t<=5}function Ty(e){_.getState().setRunAsked(!0),je({type:"run",mode:e})}function u8(e,t){_.getState().setRunAsked(!0),je({type:"runPartial",node:e,only:t})}function c8(e){je({type:"showRun",id:e})}function KE(){return _(e=>!!e.snapshot?.doc&&!!e.firstFlow&&!e.firstFlow.hidden&&e.mode==="design"&&e.level==="root"&&Yt()&&d8(e.snapshot.doc))}function f8(){let e=_(h=>h.snapshot),t=_(h=>h.firstFlow),n=KE(),r=e?.doc;if(!r||!t||!n)return null;let a=l8(r,e.openPorts.length,t.done),s=a.filter(h=>h.done).length,l=()=>je({type:"firstFlow",hidden:!0}),f=(r.nodes??[]).find(h=>h&&h.type!=="start"&&h.type!=="end"),p=h=>{let v=_.getState();h==="step"?_y((r.nodes??[]).find(g=>g?.type==="start")?.id):h==="code"&&f?(v.select({node:f.id}),je({type:"peekCode",node:f.id})):h==="failure"&&e.openPorts[0]?qE(e.openPorts[0]):h==="run"&&Ty("check")};return(0,c.jsxs)("details",{className:"afd-first-flow nodrag nopan",open:!0,"data-first-flow":s,children:[(0,c.jsxs)("summary",{children:["Your first flow \xB7 ",s," of ",a.length]}),s===a.length?(0,c.jsxs)("p",{children:["Your first flow is done. Next:"," ",(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>je({type:"openGuide",page:"tutorials/02-design-to-production.md"}),children:"Tutorial 2"}),"."]}):(0,c.jsx)("ol",{children:a.map(h=>(0,c.jsxs)("li",{className:h.done?"done":"",children:[(0,c.jsx)("span",{className:`codicon codicon-${h.done?"pass-filled":"circle-large-outline"}`,"aria-hidden":"true"}),(0,c.jsxs)("span",{children:[(0,c.jsx)("strong",{children:h.label}),h.done?null:(0,c.jsxs)("span",{className:"muted",children:[" ",h.detail]})," ",h.done||h.id!=="step"&&!f?null:(0,c.jsx)("button",{type:"button",className:"link","aria-label":`Show me: ${h.label}`,onClick:()=>p(h.id),children:"Show Me"})]})]},h.id))}),(0,c.jsx)("button",{type:"button",className:"link",onClick:l,children:"Hide Checklist"})]})}var Ay=e=>({x:e.x+e.width/2,y:e.y+e.height/2});function WE(e,t){let n=Ay(e),r=t.x-n.x,a=t.y-n.y;if(r===0&&a===0)return n;let s=Math.min(r===0?1/0:e.width/2/Math.abs(r),a===0?1/0:e.height/2/Math.abs(a));return{x:n.x+r*s,y:n.y+a*s}}var h8=(e,t)=>e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y;function p8(e,t){if(!h8(e,t))return{from:WE(e,Ay(t)),to:WE(t,Ay(e))}}function m8(e,t){e.preventDefault(),e.stopPropagation(),je({type:"openLink",url:t})}function UE({parts:e}){return(0,c.jsx)(c.Fragment,{children:e.map((t,n)=>{let r=`${n}-${t.kind}`,a=t.text.split(`
|
|
170
|
+
`).map((s,l)=>(0,c.jsxs)(T.Fragment,{children:[l>0?(0,c.jsx)("br",{}):null,s]},l));return t.kind==="bold"?(0,c.jsx)("strong",{children:a},r):t.kind==="italic"?(0,c.jsx)("em",{children:a},r):t.kind==="code"?(0,c.jsx)("code",{children:t.text},r):t.kind==="link"?(0,c.jsx)("a",{href:t.href,className:"nodrag",title:t.href,onClick:s=>m8(s,t.href),onDoubleClick:s=>s.stopPropagation(),children:t.text},r):(0,c.jsx)(T.Fragment,{children:a},r)})})}function YE({text:e}){return(0,c.jsx)(c.Fragment,{children:pE(e).map((t,n)=>t.kind==="para"?(0,c.jsx)("p",{children:(0,c.jsx)(UE,{parts:t.parts})},n):(0,c.jsx)("ul",{children:t.items.map((r,a)=>(0,c.jsx)("li",{children:(0,c.jsx)(UE,{parts:r})},a))},n))})}var g8={note:"Note",section:"Section",text:"Text"};function y8(e){let t=gE(e.annotation.text).split(`
|
|
171
|
+
`)[0]??"";return`${g8[e.kind]}: ${t.slice(0,80)||"(empty)"}`}function XE({id:e,text:t,done:n}){let[r,a]=(0,T.useState)(t),s=(0,T.useRef)(null),l=(0,T.useRef)(!1);(0,T.useEffect)(()=>{s.current?.focus(),s.current?.select()},[]);let f=()=>{l.current||(l.current=!0,r!==t&&Pe({kind:"updateAnnotation",id:e,patch:{text:r}}),n())};return(0,c.jsx)("textarea",{ref:s,className:"afd-annotation-editor nodrag nopan nowheel","aria-label":"Annotation text (Markdown); Ctrl+Enter saves, Escape cancels",value:r,onChange:p=>a(p.target.value),onBlur:f,onKeyDown:p=>{p.key==="Escape"?(p.preventDefault(),p.stopPropagation(),l.current=!0,n()):p.key==="Enter"&&(p.ctrlKey||p.metaKey)&&(p.preventDefault(),f()),p.stopPropagation()}})}var v8=(0,T.memo)(function({id:e,data:t,selected:n,parentId:r,positionAbsoluteX:a,positionAbsoluteY:s,width:l,height:f}){let{view:p,editable:h}=t,v=p.annotation,g=_($=>$.editingAnnotation===e),m=_($=>$.editAnnotation),b=n3(r??""),w=l??p.width,k=f??p.height,S;if(r&&b?.measured.width&&b.measured.height){let $={x:a-b.internals.positionAbsolute.x,y:s-b.internals.positionAbsolute.y},L=p8({...$,width:w,height:k},{x:0,y:0,width:b.measured.width,height:b.measured.height});S=L&&{from:{x:L.from.x-$.x,y:L.from.y-$.y},to:{x:L.to.x-$.x,y:L.to.y-$.y}}}let N=["afd-annotation",`afd-kind-${p.kind}`,`color-${v.color??(p.kind==="note"?"yellow":"gray")}`,p.kind==="text"?`size-${v.size??"m"}`:"",n?"selected":""].filter(Boolean).join(" "),E=()=>m(null),j=g?(0,c.jsx)(XE,{id:e,text:v.text,done:E}):(0,c.jsx)("div",{className:"afd-annotation-text",children:(0,c.jsx)(YE,{text:v.text})});return(0,c.jsxs)("div",{className:N,"data-annotation-id":v.id,"data-annotation-kind":p.kind,style:{width:w,height:k},children:[n&&h&&!g?(0,c.jsx)(M3,{minWidth:40,minHeight:24,color:"var(--afd-accent)",onResizeEnd:($,L)=>{Pe({kind:"updateAnnotation",id:e,patch:{x:Math.round(L.x),y:Math.round(L.y),width:Math.round(L.width),height:Math.round(L.height)}})}}):null,S?(0,c.jsx)("svg",{className:"afd-tie","aria-hidden":"true",overflow:"visible",width:"1",height:"1",children:(0,c.jsx)("line",{x1:S.from.x,y1:S.from.y,x2:S.to.x,y2:S.to.y})}):null,p.kind==="section"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:"afd-annotation-title",title:g?void 0:"Drag to move the section and what is inside it",children:[(0,c.jsx)("span",{className:"afd-annotation-grip codicon codicon-gripper","aria-hidden":"true"}),(0,c.jsx)("div",{className:"afd-annotation-title-text",children:g?(0,c.jsx)(XE,{id:e,text:v.text,done:E}):(0,c.jsx)(YE,{text:v.text})})]}),(0,c.jsx)("div",{className:"afd-annotation-body"})]}):j]})}),b8={top:Ce.Bottom,bottom:Ce.Top,right:Ce.Left},x8={top:{top:0,bottom:"auto",transform:"translate(-50%, -50%)"},bottom:{top:"auto",bottom:0,transform:"translate(-50%, 50%)"},right:{left:"auto",right:0,transform:"translate(50%, -50%)"}},ZE={connected:"an inner step leaves through it",bubbled:"fed by inner fail ports that bubble up",unfed:"no inner step leads here",available:"optional; wiring an exit here enables it on the subflow"};function w8({port:e}){let t=`${e.offset*100}%`,n={...x8[e.side],...e.side==="right"?{top:t}:{left:t}},r=e.name==="in"?e.state==="connected"?"in: hosts entering the subflow start at the entry step":"in: no entry step yet; drag from here to an inner step":`${e.name}: ${ZE[e.state]}`;return(0,c.jsx)(vr,{id:e.name,type:e.name==="in"?"source":"target",position:b8[e.side],style:n,className:`afd-frame-port state-${e.state} tone-${e.tone} side-${e.side}`,"data-frame-port":e.name,"data-port-state":e.state,title:r,"aria-label":`Subflow port ${e.name}, ${ZE[e.state]??e.state}`,children:(0,c.jsx)("span",{className:"afd-frame-label",children:e.name})})}function k8({data:e}){let{boundary:t,empty:n}=e;return(0,c.jsxs)("div",{className:"afd-frame","data-frame":t.subflow.id,children:[(0,c.jsxs)("span",{className:"afd-frame-title",children:["Subflow boundary \xB7 ",t.subflow.title]}),n?(0,c.jsx)("p",{className:"afd-frame-empty",children:"No steps yet."}):null,t.ports.map(r=>(0,c.jsx)(w8,{port:r},r.name))]})}var S8=(0,T.memo)(k8);function N8({data:e}){let{ghost:t}=e;return(0,c.jsxs)("div",{className:"afd-ghost","data-ghost":t.id,title:"Removed since the compared version",children:[(0,c.jsx)("div",{className:"afd-ghost-title",children:t.title}),(0,c.jsxs)("div",{className:"afd-ghost-sub",children:[yo[t.type]," \xB7 removed"]})]})}var kh=20,j8=5,rl=25,wi=8,My=40,C8=1,Sh=[{x:0,y:-1},{x:1,y:0},{x:0,y:1},{x:-1,y:0}],GE={[Ce.Top]:0,[Ce.Right]:1,[Ce.Bottom]:2,[Ce.Left]:3};function E8(e){let t=e.match(/-?\d+(\.\d+)?(e-?\d+)?/g)?.map(Number)??[],n=[];for(let r=0;r+1<t.length;r+=2)n.push({x:t[r],y:t[r+1]});return n}var Oy=(e,t)=>e.x<t.x+t.width&&t.x<e.x+e.width&&e.y<t.y+t.height&&t.y<e.y+e.height,$8=(e,t)=>({x:e.x+t,y:e.y+t,width:Math.max(0,e.width-2*t),height:Math.max(0,e.height-2*t)});function _8(e,t,n){let r=0,a=1,s=t.x-e.x,l=t.y-e.y,f=[[-s,e.x-n.x],[s,n.x+n.width-e.x],[-l,e.y-n.y],[l,n.y+n.height-e.y]];for(let[p,h]of f){if(p===0){if(h<0)return!1;continue}let v=h/p;if(p<0?r=Math.max(r,v):a=Math.min(a,v),r>a)return!1}return!0}function Py(e,t){for(let n of t){let r=$8(n,2);for(let a=0;a+1<e.length;a++)if(_8(e[a],e[a+1],r))return!0}return!1}function Dy(e,t){let n=[...e].length*6+8;return{x:t.x-n/2,y:t.y-8,width:n,height:16}}function T8(e,t,n,r,a,s){let[l,f,p]=sf({sourceX:e.x,sourceY:e.y,sourcePosition:t,targetX:n.x,targetY:n.y,targetPosition:r}),h={path:l,label:{x:f,y:p}};if(!Py(E8(l),a))return h;let v=A8(e,GE[t],n,GE[r],a);return v?{path:L8(v),label:R8(v,a,s),bends:v.slice(1,-1)}:h}function QE(e,t,n){let r=n.flat().sort((s,l)=>s-l),a=[e,t];for(let[s,l]of n)a.push(s-rl,l+rl);for(let s=0;s+1<r.length;s++){let l=r[s+1]-r[s];l>16&&l<50&&a.push((r[s]+r[s+1])/2)}return[...new Set(a)].sort((s,l)=>s-l)}function A8(e,t,n,r,a){let s=Sh[t],l=Sh[r],f={x:e.x+s.x*kh,y:e.y+s.y*kh},p={x:n.x+l.x*kh,y:n.y+l.y*kh};if(!(Py([e,f],a)||Py([p,n],a)))for(let h of[M8,1/0]){let v=O8(f,p,a,h),g=P8(f,t,p,(r+2)%4,v);if(g)return D8([e,...g,n]);if(v.length===a.length)break}}var M8=400;function O8(e,t,n,r){if(!Number.isFinite(r))return n;let a=(l,f)=>{let p=l.map(m=>m.x),h=l.map(m=>m.y),[v,g]=[Math.min(...p)-f,Math.min(...h)-f];return{x:v,y:g,width:Math.max(...p)+f-v,height:Math.max(...h)+f-g}},s=n.filter(l=>Oy(l,a([e,t],r)));for(;;){let l=a([e,t,...s.flatMap(p=>[p,{x:p.x+p.width,y:p.y+p.height}])],33),f=n.filter(p=>s.includes(p)||Oy(p,l));if(f.length===s.length)return s;s=f}}function P8(e,t,n,r,a){let s=QE(e.x,n.x,a.map(O=>[O.x,O.x+O.width])),l=QE(e.y,n.y,a.map(O=>[O.y,O.y+O.height])),f=s.length,p=l.length,h=new Float32Array(f*p),v=new Float32Array(f*p),g=(O,K,B,V,oe,F,J,I,U)=>{V<=J||B>=I||O[K]<0||(O[K]=U&&V>oe&&B<F?-1:Math.max(O[K],Math.min(V,I)-Math.max(B,J)))};for(let O of a){let[K,B,V,oe]=[O.x-wi,O.x+O.width+wi,O.y-wi,O.y+O.height+wi],[F,J,I,U]=[O.x-rl,O.x+O.width+rl,O.y-rl,O.y+O.height+rl];for(let W=0;W<p;W++){let re=l[W];if(!(re<=I||re>=U))for(let le=0;le+1<f;le++)g(h,le*p+W,s[le],s[le+1],K,B,F,J,re>V&&re<oe)}for(let W=0;W<f;W++){let re=s[W];if(!(re<=F||re>=J))for(let le=0;le+1<p;le++)g(v,W*p+le,l[le],l[le+1],V,oe,I,U,re>K&&re<B)}}let m=O=>a.some(K=>O.x>K.x-wi&&O.x<K.x+K.width+wi&&O.y>K.y-wi&&O.y<K.y+K.height+wi);if(m(e)||m(n))return;let b=s.indexOf(e.x),w=l.indexOf(e.y),k=s.indexOf(n.x),S=l.indexOf(n.y),N=f*p*4,E=new Float64Array(N).fill(1/0),j=new Int32Array(N).fill(-1),$=(O,K,B)=>{let V=n.x-s[O],oe=n.y-l[K];if(V===0&&oe===0)return 0;let F=Sh[B],J=B===r?V*F.y===oe*F.x&&V*F.x+oe*F.y>=0?0:2:B===(r+2)%4?2:1;return Math.abs(V)+Math.abs(oe)+J*My},L=new z8,z=(b*p+w)*4+t;E[z]=0,L.push($(b,w,t),0,z);let A=-1;for(;L.size>0;){let{key:O,value:K}=L.pop(),B=K%4,V=(K-B)/4,oe=Math.floor(V/p),F=V%p;if(!(O>E[K]+$(oe,F,B))){if(oe===k&&F===S){A=K;break}for(let J=0;J<4;J++){if(J===(B+2)%4)continue;let I=Sh[J],U=oe+I.x,W=F+I.y;if(U<0||W<0||U>=f||W>=p)continue;let re=J%2==1,le=re?h[Math.min(oe,U)*p+F]:v[oe*p+Math.min(F,W)];if(le<0)continue;let pe=s[oe],xe=l[F],Ne=Math.abs(re?s[U]-pe:l[W]-xe),we=re?xe===e.y||xe===n.y:pe===e.x||pe===n.x,R=E[K]+Ne*(we?1:1.01)+le*C8+(J===B?0:My),Q=(U*p+W)*4+J;if(U===k&&W===S){if(J===(r+2)%4)continue;J!==r&&(R+=My)}R<E[Q]&&(E[Q]=R,j[Q]=K,L.push(R+$(U,W,J),R,Q))}}}if(A<0)return;let M=[];for(let O=A;O>=0;O=j[O]){let K=(O-O%4)/4;M.push({x:s[Math.floor(K/p)],y:l[K%p]})}return M.reverse()}function D8(e){let t=[];for(let n of e){let r=t.at(-1);if(r&&r.x===n.x&&r.y===n.y)continue;let a=t.at(-2);a&&r&&(a.x===r.x&&r.x===n.x||a.y===r.y&&r.y===n.y)&&t.pop(),t.push(n)}return t}function L8(e){let t=e[0],n=e.at(-1),r=`M${t.x} ${t.y}`;for(let a=1;a<e.length-1;a++)r+=I8(e[a-1],e[a],e[a+1]);return`${r}L${n.x} ${n.y}`}function I8(e,t,n){let r=Math.min(Math.hypot(e.x-t.x,e.y-t.y)/2,Math.hypot(t.x-n.x,t.y-n.y)/2,j8),{x:a,y:s}=t;if(e.x===a&&a===n.x||e.y===s&&s===n.y)return`L${a} ${s}`;if(e.y===s){let f=e.x<n.x?-1:1,p=e.y<n.y?1:-1;return`L ${a+r*f},${s}Q ${a},${s} ${a},${s+r*p}`}let l=e.x<n.x?1:-1;return`L ${a},${s+r*(e.y<n.y?-1:1)}Q ${a},${s} ${a+r*l},${s}`}var JE=(e,t)=>Math.abs(t.x-e.x)+Math.abs(t.y-e.y);function R8(e,t,n){for(let s=0;n&&s+1<e.length;s++){let l=e[s],f=e[s+1],p=JE(l,f),h=(p-(l.y===f.y?Dy(n,l).width:16)-8)/2,v=Math.sign(f.x-l.x),g=Math.sign(f.y-l.y);for(let m=0;m<=h;m+=8)for(let b of m?[-1,1]:[1]){let w=p/2+b*m,k={x:l.x+v*w,y:l.y+g*w},S=Dy(n,k);if(!t.some(N=>Oy(S,N)))return k}}let r=e.slice(1).map((s,l)=>JE(e[l],s)),a=r.reduce((s,l)=>s+l,0)/2;for(let s=0;s+1<e.length;s++){let l=e[s],f=e[s+1],p=r[s];if(a<=p)return{x:l.x+Math.sign(f.x-l.x)*a,y:l.y+Math.sign(f.y-l.y)*a};a-=p}return e[0]}var z8=class{heap=[];keys=[];depths=[];values=[];get size(){return this.heap.length}push(e,t,n){let r=this.keys.length;this.keys.push(e),this.depths.push(t),this.values.push(n);let a=this.heap,s=a.length;for(a.push(r);s>0;){let l=s-1>>1;if(!this.before(r,a[l]))break;a[s]=a[l],s=l}a[s]=r}pop(){let e=this.heap,t=e[0],n=e.pop();if(e.length>0){let r=0;for(;;){let a=2*r+1;if(a>=e.length)break;let s=a+1,l=s<e.length&&this.before(e[s],e[a])?s:a;if(!this.before(e[l],n))break;e[r]=e[l],r=l}e[r]=n}return{key:this.keys[t],value:this.values[t]}}before(e,t){let n=this.keys[e],r=this.keys[t];if(n!==r)return n<r;let a=this.depths[e],s=this.depths[t];return a===s?e<t:a>s}},e$=(0,T.createContext)([]),t$=(0,T.createContext)(()=>{}),F8=(0,T.memo)(function({id:e,data:t,sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:l,targetPosition:f,label:p,labelStyle:h,labelShowBg:v,labelBgStyle:g,labelBgPadding:m,labelBgBorderRadius:b,style:w,markerEnd:k,markerStart:S,interactionWidth:N}){let E=(0,T.useContext)(e$),j=(0,T.useContext)(t$),$=typeof p=="string"?p:void 0,L=(0,T.useMemo)(()=>T8({x:n,y:r},a,{x:s,y:l},f,E,$),[n,r,a,s,l,f,E,$]),z=t?.plus,A=$?Dy($,L.label):void 0,M={x:A?A.x+A.width+12:L.label.x,y:L.label.y};return(0,c.jsxs)(c.Fragment,{children:[z?(0,c.jsx)(JI,{children:(0,c.jsx)("button",{type:"button",className:"afd-plus afd-wire-plus nodrag nopan",style:{transform:`translate(-50%, -50%) translate(${M.x}px, ${M.y}px)`},title:"Insert a node on this wire","aria-label":"Insert a node on this wire","data-wire-plus":e,onMouseEnter:()=>j(e),onMouseLeave:()=>j(null),onClick:O=>{O.stopPropagation(),e8(e)},children:(0,c.jsx)("span",{className:"codicon codicon-add","aria-hidden":"true"})})}):null,(0,c.jsx)(xd,{path:L.path,labelX:L.label.x,labelY:L.label.y,label:p,labelStyle:h,labelShowBg:v,labelBgStyle:g,labelBgPadding:m,labelBgBorderRadius:b,style:w,markerEnd:k,markerStart:S,interactionWidth:N})]})}),B8={flow:S6,boundary:S8,ghost:N8,annotation:v8},q8={routed:F8},H8=[],V8=[],K8=()=>{},n$=e=>e.type==="annotation"?e.data.view.kind:void 0,ki={section:-2,frame:-1,note:0,node:1,tied:2,innerWire:2,inner:3};function W8(e,t,n,r,a,s){let l=e.annotation,f=e.on&&r.has(e.on)?e.on:void 0;return{id:l.id,type:"annotation",position:f?a[l.id]??{x:l.x,y:l.y}:e.position,...f?{parentId:f}:{},width:e.width,height:e.height,measured:{width:e.width,height:e.height},data:{view:e,editable:n},selected:t,zIndex:e.kind==="section"?ki.section:f?ki.tied:ki.note,...e.kind==="section"?{dragHandle:".afd-annotation-title",style:{pointerEvents:"none"}}:{},ariaLabel:y8(e),...s?{className:`afd-mark-${s}`}:{},draggable:n,deletable:!1,connectable:!1}}function U8({node:e,ports:t}){let n=e.type==="start"||e.type==="end"?"":`, ${e.status??"draft"}`,r=t.filter(s=>s.state==="open-fail").length,a=r?`, ${r} open fail port${r===1?"":"s"}`:"";return`${yo[e.type]} ${e.title}${n}${a}`}function Y8(e,t){let n=Math.max(0,...t.map(s=>s.position.x+s.width))+80,r=Math.min(...t.map(s=>s.position.y),0),a=0;return e.map(s=>({id:`ghost:${s.id}`,type:"ghost",position:s.position??{x:n,y:r+90*a++},data:{ghost:s},selectable:!1,draggable:!1,connectable:!1,deletable:!1,focusable:!1}))}function o$(e,t,n){return{id:e.node.id,type:"flow",position:e.position,width:e.width,height:e.height,data:{view:e,...n?{role:n}:{}},ariaLabel:U8(e),selected:t,deletable:!n,...n?{draggable:!1,connectable:!1}:{},zIndex:n==="inner"?ki.inner:ki.node}}var X8={shift:{},inner:{},frames:new Set},Z8=e=>`${e} host${e===1?"":"s"}`;function G8({cull:e=!0}){let t=_(D=>D.snapshot),n=_(D=>D.optimistic),r=_(D=>D.selection),a=_(D=>D.select),s=_(D=>D.setOptimistic),l=_(D=>D.openQuickAdd),f=_(D=>D.setError),p=_(D=>D.pick!==null),h=_(D=>D.setPick),v=_(D=>D.openPortMenu),g=_(D=>D.openContextMenu),m=_(D=>D.level),b=_(D=>D.setLevel),[w,k]=(0,T.useState)(!1),[S,N]=(0,T.useState)(null),E=(0,T.useRef)(!1),j=_(D=>D.testMode),[$,L]=(0,T.useState)(null),z=(0,T.useRef)(void 0),A=(0,T.useCallback)(D=>{clearTimeout(z.current),D?L(D):z.current=setTimeout(()=>L(null),250)},[]);(0,T.useEffect)(()=>()=>clearTimeout(z.current),[]);let M=(0,T.useRef)(null),[O,K]=(0,T.useState)(null),B=(0,T.useCallback)((D,G)=>oC(G)||D===$||D===r.edge,[$,r.edge]),{screenToFlowPosition:V,setViewport:oe,fitView:F,getViewport:J,setCenter:I}=As(),U=_(D=>D.centerOn),W=hh(),re=_(D=>D.pick?D.pickAt:null),le=Ke(D=>D.width),pe=Ke(D=>D.height),xe=_(D=>D.mode!=="design"||!!D.snapshot?.doc&&!!Vf(D.snapshot.doc,D.level)),Ne=_(D=>!!D.snapshot?.idGaps),we=_(D=>D.mode==="run"?D.run?.summary:void 0),R=_(D=>D.lens!==null||D.mode==="run"),Q=_(D=>D.lensView?.wires),fe=_(D=>D.lensView?.dataWires),X=_(D=>D.lens==="data"),he=_(D=>D.lens==="changes"?D.lensView?.ghosts:void 0),Z=(0,T.useMemo)(()=>(he??[]).filter(D=>D.level===m),[he,m]),q=ph(),ee=_(D=>D.expandSubflows?D.expandedSubflows:V8),de=(0,T.useMemo)(()=>ee.length>0&&t?Rz(q,D=>cn(t,n,D),ee):{...X8,view:q},[q,ee,t,n]),me=de.view,De=(0,T.useRef)(de);De.current=de;let Fe=_(D=>D.annotationsHidden),Ye=_(D=>D.optimistic),Ie=!xe&&!Ne,Be=_(D=>D.lens==="changes"?D.lensView?.annotations:void 0),ut=Fe?H8:me.annotations,kt=(0,T.useMemo)(()=>{let D=[...me.nodes.map(G=>o$(G,!1)),...ut.map(G=>({position:G.position,width:G.width,height:G.height}))];return D.length?ef(D):null},[me.nodes,ut]),Lt=HE(),zt=(0,T.useMemo)(()=>Lt?Bz(kt??{x:0,y:0,width:0,height:0}):null,[Lt,kt]),hn=KE(),Ft=Ke(D=>{let[G,ve,be]=D.transform;return Vz(me.nodes.map(ke=>({x:ke.position.x*be+G,y:ke.position.y*be+ve,width:ke.width*be,height:ke.height*be})),{width:D.width,height:D.height},hn)}),[Bt,nn]=(0,T.useState)(!1),pn=Ke(D=>{if(!kt||D.width<=0)return!1;let[G,ve,be]=D.transform,ke=kt.x*be+G,Ae=kt.y*be+ve;return ke<0||Ae<0||ke+kt.width*be>D.width||Ae+kt.height*be>D.height}),bt=(0,T.useMemo)(()=>t?ry(t,me,m):void 0,[t,me,m]),mn=bt?JSON.stringify([bt.frame,bt.ports,me.nodes.length,Lt]):"",Uo=(0,T.useMemo)(()=>bt?{id:bt.id,type:"boundary",position:{x:bt.frame.x,y:bt.frame.y},width:bt.frame.width,height:bt.frame.height,data:{boundary:bt,empty:me.nodes.length===0&&!Lt},draggable:!1,selectable:!1,deletable:!1,focusable:!1,zIndex:ki.frame,style:{pointerEvents:"none"}}:void 0,[mn]),Cr=(0,T.useRef)(new Map),ja=(0,T.useRef)(new Map),Er=(0,T.useMemo)(()=>{let D=new Map,G=new Map,ve=me.nodes.map(Re=>{let Ue=r.node===Re.node.id||!!r.nodes?.includes(Re.node.id),mt=de.inner[Re.node.id]?"inner":de.frames.has(Re.node.id)?"frame":void 0,ze=JSON.stringify([Re,Ue,mt]),Ht=Cr.current.get(Re.node.id),xt=Ht&&Ht.key===ze?Ht:{key:ze,node:o$(Re,Ue,mt)};return D.set(Re.node.id,xt),xt.node});Cr.current=D;let be=new Set(me.nodes.map(Re=>Re.node.id)),ke=new Set(r.annotations??[]),Ae=ut.map(Re=>{let Ue=ke.has(Re.annotation.id),mt=Be?.[Re.annotation.id],ze=JSON.stringify([Re,Ue,Ie,Ye[Re.annotation.id],mt]),Ht=ja.current.get(Re.annotation.id),xt=Ht&&Ht.key===ze?Ht:{key:ze,node:W8(Re,Ue,Ie,be,Ye,mt)};return G.set(Re.annotation.id,xt),xt.node});ja.current=G;let Xe=Uo?[Uo,...ve,...Ae]:[...ve,...Ae];return Z.length>0?[...Xe,...Y8(Z,me.nodes)]:Xe},[me.nodes,de,r.node,r.nodes,r.annotations,Uo,Z,ut,Ie,Ye,Be]),[rn,Yo]=(0,T.useState)(Er);(0,T.useEffect)(()=>Yo(Er),[Er]);let Sn=(0,T.useRef)(rn);Sn.current=rn;let Ca=rn.filter(D=>D.type==="flow"&&D.data.role!=="frame"),dl=Ca.map(D=>`${D.position.x},${D.position.y},${D.width},${D.height}`).join(";"),Xt=(0,T.useMemo)(()=>Ca.map(D=>({x:D.position.x,y:D.position.y,width:D.width??0,height:D.height??0})),[dl]),Ea=_(D=>D.outside?.edges),$r=(0,T.useMemo)(()=>{let D=new Set(me.nodes.filter(G=>G.node.type==="start").map(G=>G.node.id));return(G,ve)=>D.has(ve.source)?G.hosts:Bj(G,ve.source,ve.sourcePort)},[me.nodes]),Ni=(0,T.useMemo)(()=>me.edges.map(D=>({id:D.id,source:D.source,sourceHandle:D.sourcePort,target:D.target,targetHandle:D.targetPort,type:"routed",label:we?Z8($r(we,D).length):Q?.[D.id]??(B(D.id,D.sourcePort)?D.sourcePort:void 0),className:`afd-edge tone-${D.tone}${D.problem?" problem":""}${we?$r(we,D).length>0?" run-taken":" run-idle":""}${X?" lens-control":""}${Ea?.includes(D.id)?" outside-mark":""}${O===D.id?" drop-target":""}`,markerEnd:{type:na.ArrowClosed,color:`var(--afd-${D.tone==="neutral"?"neutral":D.tone})`},selected:r.edge===D.id,deletable:!xe&&!D.inner,reconnectable:Ie&&!D.inner,data:{plus:Ie&&!D.inner&&($===D.id||r.edge===D.id)},...D.inner?{selectable:!1,focusable:!1,zIndex:ki.innerWire}:{}})),[me.edges,r.edge,we,xe,Ie,$,$r,Q,X,B,Ea,O]),Xo=(0,T.useMemo)(()=>{if(!X||!fe)return[];let D=new Set(me.nodes.map(G=>G.node.id));return fe.filter(G=>D.has(G.from)&&D.has(G.to)).map(G=>({id:G.id,source:G.from,sourceHandle:"__data_out",target:G.to,targetHandle:"__data_in",type:"default",label:G.label,className:"afd-edge afd-data-edge",data:{title:G.title},markerEnd:{type:na.ArrowClosed,color:"var(--afd-lens-data)"},selectable:!1,deletable:!1,focusable:!1,reconnectable:!1}))},[X,fe,me.nodes]),$a=(0,T.useMemo)(()=>{if(!t||de.frames.size===0)return[];let D=[];for(let G of de.frames){let ve=ry(t,cn(t,n,G),G);for(let be of ve?.edges??[]){let ke=be.kind==="entry";D.push({id:`inline:${be.id}`,source:ke?G:be.source,sourceHandle:ke?vy(be.sourcePort):be.sourcePort,target:ke?be.target:G,targetHandle:ke?be.targetPort:vy(be.targetPort),type:"routed",className:`afd-edge afd-boundary-edge afd-inline-edge tone-${be.tone}${be.problem?" problem":""}`,markerEnd:{type:na.ArrowClosed,color:`var(--afd-${be.tone==="neutral"?"neutral":be.tone})`},selectable:!1,focusable:!1,deletable:!1,reconnectable:!1,zIndex:ki.innerWire})}}return D},[t,de.frames,n]),_a=(0,T.useMemo)(()=>[...Ni,...Xo,...$a,...(bt?.edges??[]).map(D=>({id:D.id,source:D.source,sourceHandle:D.sourcePort,target:D.target,targetHandle:D.targetPort,type:"routed",label:y4(D)||B(D.id,"in")?D.label:void 0,className:`afd-edge afd-boundary-edge tone-${D.tone}${D.problem?" problem":""}`,markerEnd:{type:na.ArrowClosed,color:`var(--afd-${D.tone==="neutral"?"neutral":D.tone})`},selected:r.edge===D.id,deletable:!0,reconnectable:!1}))],[Ni,Xo,$a,bt,r.edge,B]),ul=(0,T.useCallback)(D=>{let G=D.filter(ve=>ve.type==="select");if(G.length>0){let ve=Rg(G,Sn.current).filter(Ue=>Ue.selected),be=ve.filter(Ue=>Ue.type==="flow").map(Ue=>Ue.id),ke=ve.filter(Ue=>Ue.type==="annotation").map(Ue=>Ue.id),Ae=_.getState().selection,Xe=ke.length?{annotations:ke}:{},Re=(Ue,mt)=>(Ue??[]).length===mt.length&&mt.every(ze=>Ue?.includes(ze));be.length>1?a({nodes:be,...Xe}):be.length===1?Ae.node===be[0]&&Re(Ae.annotations,ke)||a({node:be[0],...Xe}):ke.length?(Ae.node||Ae.nodes||!Re(Ae.annotations,ke))&&a(Xe):(Ae.node||Ae.nodes||Ae.annotations?.length)&&a({})}Yo(ve=>Rg(D.filter(be=>be.type!=="remove"),ve))},[a]),ji=(0,T.useRef)(!1),Dn=(0,T.useCallback)((D,G)=>{if(D.length===0)return;let ve={},be={},ke=ze=>({x:Math.round(ze.x),y:Math.round(ze.y)}),{shift:Ae,inner:Xe}=De.current,Re=ze=>ke({x:ze.position.x-(Ae[ze.id]?.x??0),y:ze.position.y-(Ae[ze.id]?.y??0)});for(let ze of D)ze.type==="annotation"?be[ze.id]=ke(ze.position):ze.type==="flow"&&!Xe[ze.id]&&(ve[ze.id]=Re(ze));let Ue=_.getState().snapshot?.doc?.layout??{};for(let ze of Sn.current)ze.type!=="flow"||Xe[ze.id]||Ue[ze.id]||ve[ze.id]||(ve[ze.id]=Re(ze));let mt={...ve,...be};s(mt),la(G?{kind:"spliceNode",...G,positions:ve}:{kind:"moveNodes",positions:ve,...Object.keys(be).length?{annotations:be}:{}}).then(ze=>{ze.ok||(_.getState().dropOptimistic(mt),f(ze.error??"Move failed"))})},[s,f]),jt=(0,T.useRef)(null),Ln=(0,T.useCallback)((D,G)=>{if(_.getState().setPreview(null),jt.current=null,ji.current=G.type==="flow"&&Ie&&!!W&&!Pj(W,G.id),G.type!=="annotation"||G.data.view.kind!=="section")return;let ve=cz(me,G.id),be=new Map;for(let ke of Sn.current)(ve.nodes.includes(ke.id)||ve.annotations.includes(ke.id))&&be.set(ke.id,ke.position);jt.current={id:G.id,from:G.position,items:be}},[me,Ie,W]),[qt,Ta]=(0,T.useState)(null),Ci=(0,T.useRef)(null),cl=(0,T.useCallback)((D,G,ve=[G])=>{let be=jt.current;if(!be||be.id!==G.id){if(G.type!=="flow"||ve.length!==1)return;let Xe=D,Re=null;if(ji.current&&W&&Xe.clientX!==void 0&&Xe.clientY!==void 0)for(let xt of document.elementsFromPoint?.(Xe.clientX,Xe.clientY)??[]){let xo=xt.closest(".react-flow__edge")?.dataset.id;if(xo&&!Pj(W,G.id,xo)){Re=xo;break}}Re!==M.current&&(M.current=Re,K(Re));let Ue=xt=>({id:xt.id,x:xt.position.x,y:xt.position.y,width:xt.data.view.width,height:xt.data.view.height}),mt=Sn.current.filter(xt=>xt.type==="flow"&&xt.id!==G.id).map(Ue),ze=bz(Ue(G),mt),Ht=ze.xs.length>0||ze.ys.length>0;Ci.current=Ht?{id:G.id,at:ze.snap}:null,Ta(Ht||ze.even?{...ze,box:{...Ue(G),...ze.snap}}:null);return}M.current&&(M.current=null,K(null));let ke=G.position.x-be.from.x,Ae=G.position.y-be.from.y;Yo(Xe=>Xe.map(Re=>{let Ue=be.items.get(Re.id);return Ue?{...Re,position:{x:Ue.x+ke,y:Ue.y+Ae}}:Re}))},[W]),_r=(0,T.useCallback)((D,G,ve)=>{let be=jt.current;jt.current=null;let ke=Ci.current;Ci.current=null,Ta(null);let Ae=ke?ve.map(mt=>mt.id===ke.id?{...mt,position:ke.at}:mt):ve,Xe=be?Sn.current.filter(mt=>be.items.has(mt.id)):[],Re=M.current;M.current=null,K(null);let Ue=ve.length===1&&ve[0]?.type==="flow"?ve[0].id:void 0;Dn([...Ae,...Xe.filter(mt=>!Ae.some(ze=>ze.id===mt.id))],Re&&Ue&&ji.current?{node:Ue,edge:Re}:void 0)},[Dn]),bo=(0,T.useRef)(void 0);(0,T.useEffect)(()=>()=>clearTimeout(bo.current),[]);let Tr=(0,T.useCallback)(D=>{!D.key.startsWith("Arrow")||D.altKey||D.ctrlKey||D.metaKey||xe||D.target.closest?.(".react-flow__node, .react-flow__nodesselection")&&(clearTimeout(bo.current),bo.current=setTimeout(()=>Dn(Sn.current.filter(G=>(G.type==="flow"||G.type==="annotation")&&G.selected)),500))},[Dn,xe]),Qn=(0,T.useCallback)(D=>{if(!D.sourceHandle||!D.targetHandle)return;let G=bt?.subflow.id;G&&D.source===bt.id?la({kind:"setBoundaryIn",subflow:G,node:D.target}).then(ve=>{ve.ok||f(ve.error??"Could not set the entry")}):G&&D.target===bt.id?la({kind:"connectBoundary",subflow:G,from:{node:D.source,port:D.sourceHandle},port:D.targetHandle}).then(ve=>{ve.ok||f(ve.error??"Could not add the exit")}):la({kind:"connect",from:{node:D.source,port:D.sourceHandle},to:{node:D.target,port:D.targetHandle}}).then(ve=>{ve.ok||f(ve.error??"Could not connect")})},[f,bt]),Ar=(0,T.useCallback)((D,G)=>{if(k(!1),E.current||G.isValid||!G.fromNode||G.fromNode.type!=="flow"||G.fromHandle?.type!=="source"||!G.fromHandle.id)return;let ve="changedTouches"in D?D.changedTouches[0]:D;ve&&l({type:"task",position:V({x:ve.clientX,y:ve.clientY}),connectFrom:{node:G.fromNode.id,port:G.fromHandle.id}})},[l,V]),Zt=(0,T.useCallback)((D,G)=>{D.preventDefault();let{clientX:ve,clientY:be}=D;if(ve===0&&be===0&&D.target instanceof Element){let Ae=D.target.getBoundingClientRect();ve=Ae.left+12,be=Ae.bottom}let ke=V({x:ve,y:be});g({target:G,x:ve,y:be,at:{x:Math.round(ke.x),y:Math.round(ke.y)}})},[g,V]);(0,T.useEffect)(()=>{let D=()=>{M.current=null,K(null)};return window.addEventListener("dragend",D),()=>window.removeEventListener("dragend",D)},[]);let Ei=(0,T.useCallback)(D=>{let G=D.dataTransfer.getData(lE);if(Az.includes(G)){D.preventDefault();let Xe=document.elementFromPoint(D.clientX,D.clientY),Re=Xe?.closest("[data-port]")?.dataset.port,Ue=Xe?.closest("[data-node-id]")?.dataset.nodeId;Ue?FE(G,Ue,Re):f("Drop a failure pattern onto an open fail port");return}let ve=D.dataTransfer.getData(dE);if(ve){D.preventDefault();let Xe=document.elementFromPoint(D.clientX,D.clientY)?.closest("[data-node-id]")?.dataset.nodeId,Re=V({x:D.clientX,y:D.clientY});ve==="note"&&Xe?Yd("note",void 0,Xe):Yd(ve,{x:Math.round(Re.x),y:Math.round(Re.y)});return}let be=D.dataTransfer.getData(sE),ke=M.current;if(M.current=null,K(null),!be)return;D.preventDefault();let Ae=ke&&Cy.includes(be)?{insertOn:ke}:{};l({type:be,position:V({x:D.clientX,y:D.clientY}),...Ae})},[l,V,f]),Mr=(0,T.useRef)(null),$i=(0,T.useRef)(null);(0,T.useEffect)(()=>(GC(()=>{let D=document.querySelector(".react-flow")?.getBoundingClientRect(),G=D&&D.width>0?{x:D.left+D.width/2,y:D.top+D.height/2}:void 0,ve=Mr.current??$i.current??G;if(!ve)return;let be=V(ve);return{x:Math.round(be.x),y:Math.round(be.y)}}),()=>GC(()=>{})),[V]);let Or=(0,T.useMemo)(()=>Ms(),[]),Zo=Or.viewports?.[m]??(m==="root"?Or.viewport:void 0),Aa=(0,T.useRef)(!!Zo);(0,T.useEffect)(()=>{if(Aa.current||rn.length===0||le<=0||pe<=0)return;Aa.current=!0;let D=rn.filter(G=>G.type==="flow").reduce((G,ve)=>!G||ve.position.y<G.position.y?ve:G,void 0);oe(Fz(zt?qz(ef(rn),zt):ef(rn),{width:le,height:pe},D?D.position.x+(D.width??0)/2:void 0))},[rn,le,pe,oe,zt]),(0,T.useEffect)(()=>{if(!U||le<=0||pe<=0)return;let D=me.nodes.find(G=>G.node.id===U)??me.annotations.find(G=>G.annotation.id===U);D&&(_.setState({centerOn:null}),I(D.position.x+D.width/2,D.position.y+D.height/2,{zoom:Math.max(J().zoom,1)}))},[U,me.nodes,me.annotations,le,pe,I,J]),(0,T.useEffect)(()=>{let D=G=>{if(!(G.defaultPrevented||G.ctrlKey||G.metaKey||G.altKey)&&!G.target?.closest('input, textarea, select, button, [contenteditable="true"], [role="menu"], [role="dialog"]'))if(G.key==="Enter"&&!G.shiftKey){let ve=_.getState().selection,be=!ve.node&&ve.annotations?.length===1?ve.annotations[0]:void 0;if(be&&Ie){G.preventDefault(),uh(be);return}let ke=me.nodes.find(Ae=>Ae.node.id===ve.node)?.node;if(!ke)return;G.preventDefault(),ke.type==="subflow"?b(ke.id):setTimeout(()=>document.querySelector('[role="tablist"][aria-label="Details"] [aria-selected="true"]')?.focus())}else G.shiftKey&&G.code==="Digit1"?(G.preventDefault(),F(A0)):G.shiftKey&&G.code==="Digit2"&&(G.preventDefault(),_.getState().zoomToSelection())};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[me.nodes,b,F,Ie]);let Go=_(D=>D.zoomNonce),_i=(0,T.useRef)(Go);(0,T.useEffect)(()=>{if(_i.current===Go)return;_i.current=Go;let D=_.getState().selection,G=[...D.nodes??(D.node?[D.node]:[]),...D.annotations??[]];G.length!==0&&F({nodes:G.map(ve=>({id:ve})),padding:.25,maxZoom:1.5,duration:200})},[Go,F]);let Pr=(0,T.useMemo)(()=>{let D=_.getState().pick;return p&&D&&W?w4(W,me.nodes,{mode:D.mode,node:D.ref.node}):[]},[p,W,me.nodes]);(0,T.useEffect)(()=>{if(!p)return;let D=G=>{if(G.ctrlKey||G.metaKey||G.altKey||G.target?.closest('input, textarea, select, [contenteditable="true"], [role="menu"], [role="dialog"]'))return;let ve=_.getState(),be=G.key==="Tab"&&G.shiftKey||G.key==="ArrowUp"||G.key==="ArrowLeft",ke=G.key==="Tab"&&!G.shiftKey||G.key==="ArrowDown"||G.key==="ArrowRight";if(be||ke){let Ae=k4(Pr,ve.pickAt,be?-1:1);if(!Ae)return;G.preventDefault(),G.stopPropagation(),ve.setPickAt(Ae)}else(G.key==="Enter"||G.key===" ")&&ve.pickAt&&(G.preventDefault(),G.stopPropagation(),BE(ve.pickAt))};return window.addEventListener("keydown",D,!0),()=>window.removeEventListener("keydown",D,!0)},[p,Pr]),(0,T.useEffect)(()=>{let D=re?me.nodes.find(Xe=>Xe.node.id===re):void 0;if(!D||le<=0)return;let{x:G,y:ve,zoom:be}=J(),ke=D.position.x*be+G,Ae=D.position.y*be+ve;ke>=0&&Ae>=0&&ke+D.width*be<=le&&Ae+D.height*be<=pe||I(D.position.x+D.width/2,D.position.y+D.height/2,{zoom:be})},[re,me.nodes,le,pe,J,I]);let Ma=(0,c.jsxs)(GI,{nodes:rn,edges:_a,nodeTypes:B8,edgeTypes:q8,onNodesChange:ul,onEdgesChange:D=>{let G=D.filter(ke=>ke.type==="select"),ve=G.findLast(ke=>ke.selected),be=_.getState().selection;ve?be.edge!==ve.id&&a({edge:ve.id}):be.edge&&G.some(ke=>ke.id===be.edge)&&a({})},onEdgeMouseEnter:(D,G)=>A(G.id),onEdgeMouseLeave:()=>A(null),onNodeDragStart:Ln,onNodeDrag:cl,onNodeDragStop:_r,onConnect:Qn,onConnectStart:()=>{k(!0),_.getState().setPreview(null)},onConnectEnd:Ar,onReconnect:K8,onReconnectStart:(D,G,ve)=>{E.current=!0,N(ve==="target"?"source":"target")},onReconnectEnd:(D,G,ve)=>{E.current=!1,N(null);let be="changedTouches"in D?D.changedTouches[0]:D;if(!be)return;let ke=document.elementFromPoint(be.clientX,be.clientY);if(!ke?.closest(".react-flow")||ke.closest(".react-flow__node-boundary")||ke.closest(".react-flow__panel, .react-flow__minimap, .react-flow__controls")||ke.closest(".react-flow__edge")?.dataset.id===G.id)return;let Ae=ke.closest("[data-node-id]")?.dataset.nodeId,Xe=ke.closest("[data-port]")?.dataset.port;t8(G.id,ve==="target"?"source":"target",Ae?{node:Ae,...Xe?{port:Xe}:{}}:null)},reconnectRadius:9,connectOnClick:!1,connectionDragThreshold:4,onNodeClick:(D,G)=>{p&&G.type==="flow"&&BE(G.id)},onNodeMouseEnter:(D,G)=>{if(G.type!=="flow"||!my(G.data.view.node))return;let ve=D.currentTarget.getBoundingClientRect();_.getState().hoverNode(G.id,{left:ve.left,right:ve.right,top:ve.top})},onNodeMouseLeave:()=>_.getState().hoverNode(null),onNodeDoubleClick:(D,G)=>{G.type==="flow"&&Ie&&D.target.closest?.(".afd-node-title")?py(G.id):G.type==="flow"&&G.data.view.node.type==="subflow"&&b(G.id),G.type==="annotation"&&Ie&&uh(G.id)},zoomOnDoubleClick:!1,onDoubleClick:D=>{Ie&&D.target.classList?.contains("react-flow__pane")&&l({type:"task",position:V({x:D.clientX,y:D.clientY})})},onPaneClick:D=>{$i.current={x:D.clientX,y:D.clientY},p&&h(null)},onNodeContextMenu:(D,G)=>{if(G.type==="annotation"){_.getState().selection.annotations?.includes(G.id)||a({annotations:[G.id]}),Zt(D,{kind:"annotation",id:G.id});return}if(G.type!=="flow"){Zt(D,{kind:"pane"});return}let ve=D.target.closest?.("[data-port]")?.dataset.port;if(ve&&!xe){D.preventDefault(),v({ref:{node:G.id,port:ve},x:D.clientX,y:D.clientY});return}let be=_.getState().selection;be.nodes?.includes(G.id)&&be.nodes.length>1?Zt(D,{kind:"nodes",ids:be.nodes}):(be.node!==G.id&&a({node:G.id}),Zt(D,{kind:"node",id:G.id}))},onSelectionContextMenu:(D,G)=>{let ve=G.filter(Ae=>Ae.type==="flow").map(Ae=>Ae.id),be=G.filter(Ae=>Ae.type==="annotation").map(Ae=>Ae.id),ke=ve[0];Zt(D,ve.length>1||ke&&be.length?{kind:"nodes",ids:ve,...be.length?{annotations:be}:{}}:ke?{kind:"node",id:ke}:be.length>1?{kind:"annotations",ids:be}:be[0]?{kind:"annotation",id:be[0]}:{kind:"pane"})},onEdgeContextMenu:(D,G)=>{G.className?.includes("afd-data-edge")?Zt(D,{kind:"pane"}):(_.getState().selection.edge!==G.id&&a({edge:G.id}),Zt(D,JC(G.id)??{kind:"edge",id:G.id}))},onPaneContextMenu:D=>Zt(D,{kind:"pane"}),onKeyDownCapture:D=>{D.key.startsWith("Arrow")&&(D.altKey||D.ctrlKey||D.metaKey)&&(D.target.closest?.('input, textarea, [contenteditable="true"]')||(D.preventDefault(),D.stopPropagation(),D.altKey?D.key==="ArrowUp"&&hy():oE(D.key==="ArrowUp"||D.key==="ArrowLeft"?"up":"down")))},onKeyDown:Tr,onMoveStart:()=>{v(null),_.getState().openContextMenu(null),_.getState().setPreview(null)},className:[w&&S!=="source"?"afd-connecting":"",S==="source"?"afd-reconnect-source":"",p?"afd-picking":"",R?"afd-dim-annotations":""].filter(Boolean).join(" "),zIndexMode:"manual",onDragOver:D=>{if(D.dataTransfer.types.includes("application/x-afd-node-type")&&!xe){let G=document.elementFromPoint(D.clientX,D.clientY)?.closest(".react-flow__edge")?.dataset.id??null,ve=G&&me.edges.some(be=>be.id===G)?G:null;ve!==M.current&&(M.current=ve,K(ve))}(D.dataTransfer.types.includes("application/x-afd-node-type")||D.dataTransfer.types.includes("application/x-afd-pattern")||D.dataTransfer.types.includes("application/x-afd-annotation"))&&D.preventDefault()},onDrop:Ei,onMouseMove:D=>{Mr.current={x:D.clientX,y:D.clientY}},onMouseLeave:()=>{Mr.current=null},onMoveEnd:(D,G)=>{let ve=Ms();Xg({...ve,viewports:{...ve.viewports,[m]:G}})},isValidConnection:D=>D.source!==D.target,nodesConnectable:!xe&&!Ne,nodesDraggable:!xe&&!Ne,deleteKeyCode:null,onlyRenderVisibleElements:e&&!j,defaultViewport:Zo,fitViewOptions:A0,minZoom:.2,maxZoom:2,proOptions:{hideAttribution:!0},children:[(0,c.jsx)(s3,{variant:fi.Dots,gap:16,size:1}),(0,c.jsx)(_s,{position:"bottom-left",children:(0,c.jsx)(f8,{})}),(0,c.jsx)(_s,{position:"top-right",children:(0,c.jsx)(a8,{})}),zt?(0,c.jsx)(sN,{children:(0,c.jsx)(r8,{at:zt})}):null,qt?(0,c.jsx)(sN,{children:(0,c.jsx)(Q8,{guide:qt})}):null,(0,c.jsx)(p3,{showInteractive:!1,position:"bottom-right",children:pn&&!Ft?(0,c.jsx)(wd,{onClick:()=>nn(!Bt),"aria-label":Bt?"Hide Mini Map":"Show Mini Map",title:Bt?"Hide Mini Map":"Show Mini Map: it would cover steps here",children:(0,c.jsx)("span",{className:"codicon codicon-map","aria-hidden":"true"})}):null}),pn&&(Ft||Bt)?(0,c.jsx)($3,{position:Ft??"bottom-left",pannable:!0,zoomable:!0,ariaLabel:"Mini map of the level",className:"afd-minimap",style:{width:160,height:110},bgColor:"var(--afd-minimap-bg)",maskColor:"var(--afd-minimap-mask)",nodeColor:D=>{let G=n$(D);return D.type==="boundary"||G&&G!=="note"?"transparent":G?"var(--afd-note-yellow)":"var(--afd-minimap-node)"},nodeStrokeColor:D=>D.type==="boundary"||n$(D)==="section"?"var(--afd-neutral)":"transparent",nodeBorderRadius:4}):null]});return(0,c.jsx)(t$.Provider,{value:A,children:(0,c.jsx)(e$.Provider,{value:Xt,children:Ma})})}function Q8({guide:e}){let{box:t}=e,n=2e3;return(0,c.jsxs)("div",{className:"afd-guides","aria-hidden":"true","data-guides":e.xs.length+e.ys.length,children:[e.xs.map(r=>(0,c.jsx)("div",{className:"afd-guide v",style:{left:r,top:t.y-n,height:2*n}},`x${r}`)),e.ys.map(r=>(0,c.jsx)("div",{className:"afd-guide h",style:{top:r,left:t.x-n,width:2*n}},`y${r}`)),e.even?(0,c.jsx)("div",{className:"afd-guide-even","data-even":e.even,style:e.even==="vertical"?{left:t.x+t.width+8,top:t.y+t.height/2-9}:{left:t.x+t.width/2-30,top:t.y+t.height+6},children:"even gaps"}):null]})}var J8=140;function eB(e,t=3e3){let n=()=>{let r=_.getState().snapshot?.doc;return!!r&&Ee(r).nodes.has(e)};return new Promise(r=>{let a=()=>{s(),clearTimeout(l),_.getState().reveal(e),r()},s=_.subscribe((f,p)=>{f.snapshot!==p.snapshot&&n()&&a()}),l=setTimeout(()=>{s(),r()},t);n()&&a()})}function tB(e){let t=e.replaceAll(/[_-]+/g," ").trim();return t.charAt(0).toUpperCase()+t.slice(1)}async function nB(e){let t=_.getState(),n=t.snapshot?.doc;if(!n)return;let r=Ee(n),a="node"in e?r.nodes.get(e.node)?.node:void 0;switch(e.kind){case"renameOutput":{let s=a?.outputs?.[e.from];return s?Pe({kind:"setContractField",target:e.node,side:"outputs",name:e.from,rename:e.to,field:s}):void 0}case"removeOutput":return Pe({kind:"setContractField",target:e.node,side:"outputs",name:e.name,field:null});case"setOutputFrom":{let s=a?.outputs?.[e.name];return s?Pe({kind:"setContractField",target:e.node,side:"outputs",name:e.name,field:{...s,from:e.from}}):void 0}case"addInput":return Pe({kind:"setContractField",target:e.node,side:"inputs",name:e.name,field:e.field});case"removeInput":return Pe({kind:"setContractField",target:e.node,side:"inputs",name:e.name,field:null});case"openCode":je({type:"openCode",path:e.path,line:e.line});return;case"addToSubflow":{let s=(r.levels.get(e.subflow)?.nodes??[]).map(h=>h?n.layout?.[h.id]??t.snapshot?.autoPositions[h.id]:void 0).filter(h=>!!h),l=s.reduce((h,v)=>v.y>h.y?v:h,s[0]??{x:40,y:-100}),f=await Pe({kind:"addNode",parent:e.subflow,type:"task",title:tB(e.tasksFrom),impl:{kind:"role",ref:e.role,params:{tasks_from:e.tasksFrom}},position:{x:Math.round(l.x),y:Math.round(l.y+J8)}}),p=f.created;return f.ok&&p&&await eB(p),f}case"ignore":{let s=t.drift?.items.find(l=>l.node===e.node&&l.id===e.item);t.setIgnore({node:e.node,item:e.item,title:s?.title??"",label:s?.label??""});return}case"unignore":return Pe({kind:"clearDriftIgnore",node:e.node,item:e.item});case"bind":t.openDetails(e.node,"binding",e.bindKind);return;default:{let s=await q3(e);return s.ok||_.getState().setError(s.error??"The action failed"),s}}}var oB={canvas:"how-to/canvas-basics.md",patterns:"how-to/ports-and-failure-patterns.md",binding:"how-to/binding-and-catalog.md",io:"how-to/data-between-steps.md",execution:"how-to/polling-and-retries.md",runs:"how-to/runs-and-environments.md",code:"how-to/code-mode.md",lenses:"how-to/lenses.md",scenarios:"how-to/scenario-tests.md"};function Sa({topic:e,about:t}){return _(n=>n.viewer)?null:(0,c.jsx)("button",{type:"button",className:"icon afd-help-link","aria-label":`Help: ${t}`,title:`The guide on ${t}`,onClick:()=>je({type:"openGuide",page:oB[e]}),children:(0,c.jsx)("span",{className:"codicon codicon-question","aria-hidden":"true"})})}function Nh({id:e,title:t,children:n,placeholder:r,submit:a,initial:s,target:l,record:f,close:p}){let[h,v]=(0,T.useState)(""),g=(0,T.useRef)(null),m=(0,T.useRef)(null),b=nl(m);return(0,T.useEffect)(()=>{v(s??""),setTimeout(()=>g.current?.focus(),0)},[l]),(0,c.jsx)("div",{className:"afd-modal-backdrop",children:(0,c.jsxs)("form",{ref:m,className:"afd-modal",role:"dialog","aria-modal":"true","aria-labelledby":`${e}-title`,onSubmit:async w=>{w?.preventDefault(),h.trim()&&(await f(h)).ok&&p()},onKeyDown:w=>{b(w),w.key==="Escape"&&(w.stopPropagation(),p())},children:[(0,c.jsx)("h2",{id:`${e}-title`,children:t}),(0,c.jsx)("p",{className:"muted",children:n}),(0,c.jsxs)("div",{className:"afd-field",children:[(0,c.jsx)("label",{htmlFor:`${e}-reason`,children:"Reason (required)"}),(0,c.jsx)("textarea",{id:`${e}-reason`,ref:g,className:"afd-input",rows:3,value:h,placeholder:r,onChange:w=>v(w.target.value)})]}),(0,c.jsxs)("div",{className:"afd-modal-actions",children:[(0,c.jsx)("button",{type:"button",className:"secondary",onClick:p,children:"Cancel"}),(0,c.jsx)("button",{type:"submit",disabled:!h.trim(),children:a})]})]})})}function rB(){let e=_(r=>r.sync),t=e.scan,n=t?.git;return(0,c.jsxs)("div",{className:"afd-sync-source","data-sync-state":e.state,children:[n?.commit?(0,c.jsxs)("span",{children:[(0,c.jsx)("span",{className:"codicon codicon-git-commit","aria-hidden":"true"})," git"," ",(0,c.jsx)("span",{className:"mono",children:n.branch??"detached"})," @"," ",(0,c.jsx)("span",{className:"mono",children:n.commit}),n.when?(0,c.jsxs)("span",{className:"muted",children:[" \xB7 ",fh(n.when)]}):null]}):t?(0,c.jsx)("span",{className:"muted",children:"Not a Git repository: the working tree as it is"}):null,n&&n.dirty.length>0?(0,c.jsxs)("span",{className:"afd-badge tone-warn",title:n.dirty.join(`
|
|
172
|
+
`),children:[n.dirty.length," uncommitted"]}):null,t?(0,c.jsxs)("span",{className:"muted afd-sync-env",children:[t.environment," \xB7 scanned ",fh(t.at)]}):null,e.state==="syncing"?(0,c.jsxs)("span",{className:"muted",role:"status",children:[(0,c.jsx)("span",{className:"codicon codicon-loading codicon-modifier-spin","aria-hidden":"true"})," ","Compiling the code in the environment\u2026"]}):null,e.state==="error"?(0,c.jsx)("span",{className:"afd-catalog-error",role:"alert",children:e.error}):null]})}function jh({item:e}){let t=_(a=>a.reveal),[n,r]=(0,T.useState)(!1);return(0,c.jsxs)("li",{className:`afd-drift-item kind-${e.kind} sev-${e.severity}${e.ignored?" ignored":""}`,"data-drift":e.id,children:[(0,c.jsxs)("div",{className:"afd-drift-head",children:[e.node?(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>t(e.node),children:e.title}):(0,c.jsx)("strong",{children:e.title}),(0,c.jsxs)("span",{className:"muted",children:[" \xB7 ",e.label]})]}),(0,c.jsx)("p",{className:"afd-drift-detail",children:e.detail}),e.ignored?(0,c.jsxs)("p",{className:"muted afd-drift-ignored",children:["Ignored",e.ignored.by?` by ${e.ignored.by}`:"",": ",e.ignored.reason]}):null,(0,c.jsx)("div",{className:"afd-drift-actions",children:e.actions.map((a,s)=>(0,c.jsx)("button",{type:"button",className:s===0&&!e.ignored?"":"secondary",disabled:n,onClick:async()=>{r(!0),await nB(a.action),r(!1)},children:a.label},`${a.label}|${JSON.stringify(a.action)}`))})]})}function iB({run:e,nodes:t}){let n=e?.state==="done"?e.summary:void 0;if(!n)return null;let r=new Set(n.failures.map(l=>l.node)),a=0,s=0;for(let l of t)r.has(l.node)?s++:n.nodes[l.node]&&a++;return(0,c.jsxs)("section",{className:"afd-section","data-last-run-summary":!0,children:[(0,c.jsxs)("h3",{children:["Last ",e?.mode==="check"?"skeleton run":"run"]}),(0,c.jsxs)("p",{children:["ok ",a," \xB7 failed ",s," \xB7 not run ",t.length-a-s,(0,c.jsxs)("span",{className:"muted",children:[" \xB7 ",fh(e?.finishedAt??e?.startedAt)]})]})]})}function aB(){let e=_(v=>v.drift),t=_(v=>v.sync),n=_(v=>v.run),[r,a]=(0,T.useState)(!1),[s,l]=(0,T.useState)(!1),f=e?.items.filter(v=>!v.ignored&&v.severity==="warning")??[],p=e?.items.filter(v=>!v.ignored&&v.severity==="info")??[],h=e?.items.filter(v=>v.ignored)??[];return(0,c.jsxs)("div",{className:"afd-panel-body","data-drift-panel":!0,children:[(0,c.jsxs)("div",{className:"afd-panel-head",children:[(0,c.jsxs)("h2",{className:"afd-panel-title",children:["Design vs code ",(0,c.jsx)(Sa,{topic:"code",about:"Code mode"})]}),(0,c.jsxs)("button",{type:"button",disabled:t.state==="syncing",onClick:()=>je({type:"sync"}),title:"Compile the generated code and the bound roles and playbooks in the environment, and compare them with the design",children:[(0,c.jsx)("span",{className:`codicon ${t.state==="syncing"?"codicon-loading codicon-modifier-spin":"codicon-sync"}`,"aria-hidden":"true"})," ",t.state==="syncing"?"Syncing\u2026":"Re-sync from Git"]})]}),(0,c.jsx)(rB,{}),!e&&t.state!=="syncing"?(0,c.jsx)("p",{className:"muted",children:"Re-sync to compile the generated code and every bound role and playbook in the environment, then compare them with the design."}):null,e?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("p",{className:"afd-matched","data-matched":`${e.matched}/${e.matchable}`,children:[(0,c.jsxs)("strong",{children:[e.matched," / ",e.matchable]})," ","nodes matched by ID"]}),(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:f.length})," drift item",f.length===1?"":"s"]}),(0,c.jsx)("ul",{className:"afd-drift-list",children:f.map(v=>(0,c.jsx)(jh,{item:v},`${v.node}|${v.id}`))}),p.length>0?(0,c.jsxs)("section",{className:"afd-section","data-drift-notes":p.length,children:[(0,c.jsxs)("button",{type:"button",className:"link",onClick:()=>l(!s),children:[s?"Hide":"Show"," ",p.length," note",p.length===1?"":"s"]}),s?(0,c.jsx)("ul",{className:"afd-drift-list",children:p.map(v=>(0,c.jsx)(jh,{item:v},`${v.node}|${v.id}`))}):null]}):null,h.length>0?(0,c.jsxs)("section",{className:"afd-section",children:[(0,c.jsxs)("button",{type:"button",className:"link",onClick:()=>a(!r),children:[r?"Hide":"Show"," ",h.length," ignored"]}),r?(0,c.jsx)("ul",{className:"afd-drift-list",children:h.map(v=>(0,c.jsx)(jh,{item:v},`${v.node}|${v.id}`))}):null]}):null,(0,c.jsx)(iB,{run:n,nodes:Object.values(e.nodes).filter(v=>v.artifact!=="start"&&v.artifact!=="end")})]}):null]})}function sB({id:e}){let t=_(l=>l.drift),n=_(l=>l.snapshot?.doc),r=_(l=>l.select);if(!(n&&Ee(n).nodes.get(e)?.node))return null;let a=t?.nodes[e],s=t?.items.filter(l=>l.node===e)??[];return(0,c.jsxs)("div",{className:"afd-panel-body","data-node-code":e,children:[(0,c.jsx)("div",{className:"afd-inspector-head",children:(0,c.jsxs)("button",{type:"button",className:"link",onClick:()=>r({}),children:[(0,c.jsx)("span",{className:"codicon codicon-arrow-left","aria-hidden":"true"})," All drift"]})}),a?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{className:"mono",children:a.artifact}),(0,c.jsx)("p",{children:a.matched?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"codicon codicon-pass","aria-hidden":"true"})," Matched by ID in the generated code"," ",a.play?(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>je({type:"openCode",path:a.play?.path??"",line:a.play?.line}),children:"open play"}):null]}):(0,c.jsx)("span",{className:"muted",children:"No generated play is tagged with this node."})}),a.missing&&a.missing!=="not scanned"?(0,c.jsx)("p",{className:"afd-catalog-error",children:a.missing}):null,a.tasks.length>0?(0,c.jsxs)("section",{className:"afd-section",children:[(0,c.jsxs)("h3",{children:[a.tasks.length," task",a.tasks.length===1?"":"s",a.dynamic>0?(0,c.jsxs)("span",{className:"muted",children:[" \xB7 ",a.dynamic," dynamic include, not expanded"]}):null]}),(0,c.jsx)("ul",{className:"afd-code-tasks",children:a.tasks.map((l,f)=>(0,c.jsxs)("li",{className:l.dynamic?"dynamic":"",children:[(0,c.jsx)("span",{children:l.name||l.action})," ",(0,c.jsx)("span",{className:"muted mono",children:l.action}),l.origin?(0,c.jsxs)("button",{type:"button",className:"link mono",onClick:()=>je({type:"openCode",path:l.origin?.path??"",line:l.origin?.line}),children:[l.origin.path.split("/").slice(-2).join("/"),":",l.origin.line]}):null]},f))})]}):null]}):(0,c.jsx)("p",{className:"muted",children:"Re-sync to see the code this node runs."}),s.length>0?(0,c.jsx)("ul",{className:"afd-drift-list",children:s.map(l=>(0,c.jsx)(jh,{item:l},l.id))}):null]})}function lB(){let e=_(n=>n.ignore),t=_(n=>n.setIgnore);return e?(0,c.jsxs)(Nh,{id:"afd-ignore",title:"Accept with Reason",placeholder:"e.g. The role runs it from main",submit:"Accept",target:e,record:n=>Pe({kind:"ignoreDrift",node:e.node,item:e.item,reason:n}),close:()=>t(null),children:[(0,c.jsx)("strong",{children:e.title})," \xB7 ",e.label,". Code and design stay as they are; the item moves to the ignored list. The decision is recorded in the flow with your Git user name."]}):null}var dB=new Set(["tasks_from","vars_from","defaults_from","handlers_from","public","allow_duplicates","rolespec_validate"]),uB=new Set(["when","loop","loop_control","vars","ignore_errors","no_log","run_once","debugger"]);function cB(e){return/^(ansible\.(builtin|legacy)\.)?include_tasks$/.test(e??"")}function fB(e,t,n){let r=`node_${e.id}`,a=Object.entries(t.keywords??{});if(t.kind==="role"){let v={name:t.ref},g={};for(let[w,k]of Object.entries(t.params??{}))(dB.has(w)?v:g)[w]=k;let m={},b={};for(let[w,k]of a)w!=="vars"&&((c4.has(w)||Zf.test(w)?m:b)[w]=k);return v.apply={tags:q0([r]),timeout:n,...b},{name:`[${e.key}] Apply role`,"ansible.builtin.include_role":v,...m,vars:Object.keys(g).length>0?g:void 0}}let s=Ys(e,t);if(cB(t.ref)){let v={},g={};for(let[b,w]of a)(uB.has(b)||Zf.test(b)?v:g)[b]=w;let m=typeof t.params=="string"?{file:t.params}:t.params??{};return{name:`[${e.key}] ${uC(pC(e.title))}`,[t.ref]:{...m,apply:{tags:q0([r]),timeout:n,...g}},...v,register:s}}let{retries:l,delay:f,until:p}=e.settings??{},h=p?.trim()||(l?`${s} is succeeded`:void 0);return{name:`[${e.key}] ${uC(pC(e.title))}`,[t.ref]:t.params??{},...Object.fromEntries(a),register:s,ignore_unreachable:!0,timeout:n,retries:l,delay:h?f:void 0,until:h}}function hB(e,t){if(t.kind==="playbook")return eh([{import_playbook:t.ref,vars:{afd_hosts:"<hosts arriving here>"}}],0).join(`
|
|
173
|
+
`);let n=fB(e,t);return t.kind==="module"&&(delete n.ignore_unreachable,n.tags=q0([`node_${e.id}`])),eh([n],0).join(`
|
|
174
|
+
`)}var pB=e=>e.withErrors+e.editedByHand>0;function mB(e){let t=[],n=(r,a)=>{if(!r)return;let s=t.length?"":r===1?"flow ":"flows ";t.push(`${r} ${s}${a}`)};return n(e.withErrors,"with errors"),n(e.editedByHand,"with code edited by hand"),n(e.outOfDate,"with code out of date"),t.length?`In this workspace: ${t.join(", ")}`:e.flows>1?"Other flows of this workspace have no problems":"No other flows in this workspace"}var vo=typeof navigator<"u"&&/Mac|iPhone|iPad/i.test(navigator.platform||navigator.userAgent),Vo=vo?"\u2318":"Ctrl+",Ly=[{id:"copy",keys:`${Vo}C`,label:"Copy the selected nodes, as YAML text",group:"Edit"},{id:"cut",keys:`${Vo}X`,label:"Cut the selected nodes",group:"Edit"},{id:"paste",keys:`${Vo}V`,label:"Paste nodes at the pointer",group:"Edit"},{id:"duplicate",keys:`${Vo}D`,label:"Duplicate the selected nodes",group:"Edit"},{id:"delete",keys:"Delete",label:"Delete the selection: the path closes behind it (Shift+Delete leaves the gap)",group:"Edit"},{id:"rename",keys:"F2",label:"Rename the selected node on the canvas, or edit a note's text",group:"Edit"},{id:"undo",keys:`${Vo}Z`,label:"Undo (VS Code keeps one step per change)",group:"Edit"},{id:"redo",keys:vo?"\u21E7\u2318Z":"Ctrl+Y",label:"Redo",group:"Edit"},{id:"disable",keys:"D",label:"Disable the selected steps (their hosts pass through), or enable them again",group:"Edit"},{id:"addNode",keys:"N",label:"Add a node: after the selected one, else at the pointer",group:"Edit"},{id:"addNote",keys:"Shift+N",label:"Add a note: on the selected node, else at the pointer",group:"Edit"},{id:"open",keys:"Enter",label:"Open the selected subflow, or go to the node's Details",group:"Move around"},{id:"up",keys:vo?"\u2325\u2191":"Alt+\u2191",label:"Up to the parent level",group:"Move around"},{id:"menu",keys:"Shift+F10",label:"Menu for the selection, or the canvas",group:"Move around"},{id:"find",keys:`${Vo}F`,label:"Find a node on any level",group:"Move around"},{id:"follow",keys:`${Vo}\u2193 / ${Vo}\u2191`,label:"Follow a wire: the next step, or the one before",group:"Move around"},{id:"ports",keys:"Tab, Enter",label:"The selected node's ports; Enter opens a port's menu",group:"Move around"},{id:"pick",keys:"Tab or arrows, Enter",label:"While connecting: show a node, then wire it",group:"Move around"},{id:"modes",keys:vo?"\u23251, \u23252, \u23253":"Alt+1, Alt+2, Alt+3",label:"Design, Code or Run mode",group:"Move around"},{id:"nudge",keys:"Arrow keys",label:"Nudge the focused node (Shift: further)",group:"Canvas"},{id:"select",keys:`${Vo}click, Shift+drag`,label:"Select several nodes",group:"Canvas"},{id:"selectAll",keys:`${Vo}A`,label:"Select every node of the level",group:"Canvas"},{id:"alignCenter",keys:vo?"\u21E7\u2325A":"Shift+Alt+A",label:"Line the selected steps up on the flow line (Align Centers)",group:"Canvas"},{id:"distribute",keys:vo?"\u21E7\u2325D":"Shift+Alt+D",label:"Space three or more selected steps evenly, top to bottom",group:"Canvas"},{id:"fit",keys:"Shift+1",label:"Fit the whole level in view",group:"Canvas"},{id:"zoomSelection",keys:"Shift+2",label:"Zoom to the selection",group:"Canvas"},{id:"escape",keys:"Esc",label:"Close the menu or dialog; else clear the selection",group:"Canvas"},{id:"help",keys:"?",label:"This list",group:"Canvas"},{id:"runSkeleton",keys:"Ctrl+F5",label:"Run as Skeleton",group:"Flow"},{id:"stopRun",keys:"Shift+F5",label:"Stop Run",group:"Flow"},{id:"generate",keys:vo?"\u21E7\u2318B":"Ctrl+Shift+B",label:"Generate Code",group:"Flow"},{id:"tidyUp",keys:vo?"\u21E7\u2325F":"Shift+Alt+F",label:"Tidy Up",group:"Flow"},{id:"check",keys:"F7",label:"Check Flow",group:"Flow"}];function Na(e){return e?Ly.find(t=>t.id===e)?.keys:void 0}function gB(e,t,n,r){let a=e.nodes.get(t.id);if(!a)return r;let s=F0(e,t,a.level,n,r),l=f=>f.length?` \xB7 ${f.join(".")}`:"";switch(s.kind){case"flow":return`flow input ${s.name}${l(s.path)}`;case"impl":return`this step's result${l(s.path[0]==="register"?s.path.slice(1):s.path)}`;case"output":case"subflowInput":return`"${s.node.title}" \xB7 ${s.name}${l(s.path)}`;case"unresolved":return r}}function yB(e){return e==null?"":Array.isArray(e)?e.map(String).join(", "):typeof e=="object"?JSON.stringify(e):String(e)}function vB(e,t){let n=t.trim();if(!n)return{};switch(e){case"integer":return/^-?[0-9]+$/.test(n)?{value:Number(n)}:{problem:"A whole number"};case"boolean":{let r=n.toLowerCase();return["true","yes"].includes(r)?{value:!0}:["false","no"].includes(r)?{value:!1}:{problem:"true or false"}}case"list":case"host_list":return{value:n.split(/[,\n]/).map(r=>r.trim()).filter(Boolean)};case"dict":try{let r=gi(n);if(r&&typeof r=="object"&&!Array.isArray(r))return{value:r}}catch{}return{problem:"A map, like {site: fra1}"};case"any":try{return{value:gi(n)}}catch{return{value:n}}default:return{value:n}}}var bB=["string","integer","boolean","list","dict","host_list","any"];function xB({name:e,value:t,onCommit:n}){let[r,a]=(0,T.useState)(t),[s,l]=(0,T.useState)(t);t!==s&&(l(t),a(t));let f=()=>r.trim()!==t&&n(r.trim());return(0,c.jsx)("input",{className:"afd-input afd-contract-description","aria-label":`What ${e} is for`,placeholder:"What it is for (shown when a run asks)",value:r,"data-input-description":e,onChange:p=>a(p.target.value),onBlur:f,onKeyDown:p=>p.key==="Enter"&&f()})}function wB({name:e,type:t,value:n,onCommit:r}){let a=yB(n),[s,l]=(0,T.useState)(a),[f,p]=(0,T.useState)(a),[h,v]=(0,T.useState)();a!==f&&(p(a),l(a));let g=()=>{if(s.trim()===a)return v(void 0);let m=vB(t,s);v(m.problem),m.problem||r(m.value)};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("input",{className:`afd-input mono afd-contract-default${h?" invalid":""}`,"aria-label":`Default for ${e}`,"aria-invalid":!!h,placeholder:"Default (when a run gives none)",value:s,"data-input-default":e,onChange:m=>l(m.target.value),onBlur:g,onKeyDown:m=>m.key==="Enter"&&g()}),h?(0,c.jsx)("span",{className:"afd-field-error",children:h}):null]})}var Iy=/^[A-Za-z_][A-Za-z0-9_]*$/;function Ry({title:e,target:t,side:n,contract:r,withFrom:a,hint:s}){let[l,f]=(0,T.useState)(""),p=_(b=>b.snapshot?.doc),h=(b,w)=>{let k=p?Ee(p):void 0,S=t==="flow"?void 0:k?.nodes.get(t)?.node;return k&&S?gB(k,S,b,w):w},v=Object.entries(r??{}),g=(b,w,k)=>Pe({kind:"setContractField",target:t,side:n,name:b,field:w,rename:k}),m=()=>{let b=l.trim();!Iy.test(b)||b in(r??{})||g(b,t==="flow"&&n==="inputs"?{type:"string",required:!0}:{type:"string"}).then(w=>w.ok&&f(""))};return(0,c.jsxs)("section",{className:"afd-section",children:[(0,c.jsx)("h3",{children:e}),s?(0,c.jsx)("p",{className:"muted",children:s}):null,v.length===0?(0,c.jsx)("p",{className:"muted",children:"None yet."}):null,(0,c.jsx)("ul",{className:"afd-contract",children:v.map(([b,w])=>(0,c.jsxs)("li",{children:[(0,c.jsx)("span",{className:"mono afd-contract-name",children:b}),(0,c.jsx)("select",{"aria-label":`Type of ${b}`,value:w?.type??"any",onChange:k=>{g(b,{...w,type:k.target.value})},children:bB.map(k=>(0,c.jsx)("option",{value:k,children:k},k))}),n==="inputs"?(0,c.jsxs)("label",{className:"afd-check",title:"Required",children:[(0,c.jsx)("input",{type:"checkbox",checked:!!w?.required,onChange:k=>{g(b,{...w,required:k.target.checked||void 0})}}),"required"]}):null,a&&w?.from?(0,c.jsxs)("span",{className:"muted afd-contract-from",title:`Source of the value: ${w.from}`,children:["\u2190 ",h(n,w.from)]}):null,(0,c.jsx)("button",{type:"button",className:"icon","aria-label":`Remove ${b}`,onClick:()=>{g(b,null)},children:(0,c.jsx)("span",{className:"codicon codicon-trash","aria-hidden":"true"})}),t==="flow"&&n==="inputs"&&!w?.targets?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(xB,{name:b,value:w?.description??"",onCommit:k=>{g(b,{...w,description:k||void 0})}}),(0,c.jsx)(wB,{name:b,type:w?.type??"any",value:w?.default,onCommit:k=>{let S={...w};k===void 0?delete S.default:(S.default=k,delete S.required),g(b,S)}})]}):null]},b))}),(0,c.jsxs)("div",{className:"afd-inline-add",children:[(0,c.jsx)("input",{className:`afd-input mono${l&&!Iy.test(l.trim())?" invalid":""}`,placeholder:"new_name","aria-label":`New ${n.slice(0,-1)} name`,value:l,onChange:b=>f(b.target.value),onKeyDown:b=>b.key==="Enter"&&m()}),(0,c.jsx)("button",{type:"button",className:"secondary",onClick:m,disabled:!Iy.test(l.trim()),children:"Add"})]})]})}function fn({label:e,value:t,onCommit:n,multiline:r,mono:a,placeholder:s,validate:l,focusKey:f,problem:p,suggestions:h}){let v=(0,T.useId)(),g=(0,T.useRef)(null);DE(f,g);let[m,b]=(0,T.useState)(t);(0,T.useEffect)(()=>b(t),[t]);let w=(0,T.useRef)(!1),k=m===t?p:l?.(m),S=()=>{w.current?w.current=!1:m!==t&&(l?.(m)?b(t):n(m))},N={id:v,ref:g,value:m,placeholder:s,className:`afd-input${a?" mono":""}${k?" invalid":""}`,onBlur:S,onKeyDown:E=>{E.key==="Escape"?(E.preventDefault(),w.current=!0,b(t),E.target.blur(),w.current=!1):E.key==="Enter"&&(!r||E.ctrlKey||E.metaKey)&&(E.preventDefault(),S())},"aria-invalid":!!k,"aria-describedby":k?`${v}-error`:void 0};return(0,c.jsxs)("div",{className:"afd-field",children:[(0,c.jsx)("label",{htmlFor:v,children:e}),r?(0,c.jsx)("textarea",{...N,rows:3,onChange:E=>b(E.target.value)}):(0,c.jsx)("input",{...N,list:h?.length?`${v}-list`:void 0,onChange:E=>b(E.target.value)}),h?.length?(0,c.jsx)("datalist",{id:`${v}-list`,children:h.map(E=>(0,c.jsx)("option",{value:E},E))}):null,k?(0,c.jsx)("div",{className:"afd-field-error",id:`${v}-error`,children:k}):null]})}function il({label:e,value:t,mono:n}){return(0,c.jsxs)("div",{className:"afd-field",children:[(0,c.jsx)("span",{className:"afd-label",children:e}),(0,c.jsx)("span",{className:`afd-readonly${n?" mono":""}`,children:t})]})}function r$({repo:e,hook:t}){return(0,c.jsxs)("p",{className:"muted",[t]:"",children:[e?`${mB(e)}: `:"Other flows of this workspace, with their problems and code state: ",(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>je({type:"showFlows"}),children:"Flows View"})]})}function kB(){let e=_(p=>p.snapshot),t=_(p=>p.repo),n=wa(),r=e?.doc;if(!r?.flow)return(0,c.jsx)("p",{className:"muted",children:"No flow loaded."});let{flow:a}=r,s=Ee(r),l=x5(r),f=p=>Pe({kind:"updateFlow",patch:p});return(0,c.jsxs)("div",{className:"afd-panel-body",children:[(0,c.jsx)("h2",{children:"Flow"}),t&&pB(t)?(0,c.jsx)(r$,{repo:t,hook:"data-repo-line"}):null,(0,c.jsxs)("fieldset",{className:"afd-editable",disabled:!n,children:[(0,c.jsx)(fn,{label:"Name",value:a.name??"",onCommit:p=>{f({name:p})},validate:p=>p.trim()?void 0:"Required"}),(0,c.jsx)(fn,{label:"Goal",value:a.goal??"",multiline:!0,placeholder:"What this flow achieves, in one sentence",onCommit:p=>{f({goal:p.trim()?p:null})}}),(0,c.jsx)(Ry,{title:"Inputs",target:"flow",side:"inputs",contract:a.inputs,hint:"What the flow asks for when it runs. devices: the hosts it runs on."}),(0,c.jsxs)(Nr,{id:"flow-details",open:!G0.test(a.key??""),summary:`More details: ${a.key} \xB7 version ${a.version}${a.owner?` \xB7 owner ${a.owner}`:""}`,children:[(0,c.jsx)(fn,{label:"Key",value:a.key??"",mono:!0,onCommit:p=>{f({key:p})},validate:p=>G0.test(p)?void 0:"Lowercase words joined by dashes"}),(0,c.jsx)(il,{label:"ID (fixed)",value:a.id,mono:!0}),(0,c.jsx)(il,{label:"Version",value:String(a.version)}),(0,c.jsx)(fn,{label:"Owner",value:a.owner??"",onCommit:p=>{f({owner:p.trim()?p:null})}}),(0,c.jsx)(il,{label:"Runtime",value:a.runtime&&s?[O0(s),a.runtime.template,a.runtime.credentials?.length?`credentials ${a.runtime.credentials.join(", ")}`:"",a.runtime.execution_environment?`EE ${a.runtime.execution_environment}`:""].filter(Boolean).join(" \xB7 "):"not set"}),a.imported_from&&(0,c.jsx)(il,{label:"Imported from",value:NB(a.imported_from)}),(0,c.jsx)(fn,{label:"Maintenance window",value:a.maintenance_window??"",mono:!0,placeholder:"e.g. 4h or 2h30m",onCommit:p=>{f({maintenance_window:p.trim()?p:null})},validate:p=>!p.trim()||/^([0-9]+[smhd])+$/.test(p.trim().toLowerCase().replaceAll(/\s+/g,""))?void 0:"A duration like 4h, 90m or 2h30m"})]})]}),l.total>0?(0,c.jsxs)("section",{className:"afd-section",children:[(0,c.jsx)("h3",{children:"Readiness"}),(0,c.jsxs)("ul",{className:"afd-readiness",children:[ay.map(p=>(0,c.jsx)("li",{children:(0,c.jsxs)("button",{type:"button",className:"afd-readiness-link","data-find-filter":`status:${p}`,title:`List the ${p} steps on every level (Find status:${p})`,onClick:()=>a$(`status:${p}`),children:[(0,c.jsx)(gh,{status:p,label:!1}),p,(0,c.jsx)("strong",{children:l.counts[p]})]})},p)),(0,c.jsx)("li",{children:(0,c.jsxs)("button",{type:"button",className:"afd-readiness-link","data-find-filter":"open:fail",title:"List the steps with an open fail port (Find open:fail)",onClick:()=>a$("open:fail"),children:[(0,c.jsx)("span",{className:"codicon codicon-warning","aria-hidden":"true"}),"open fail ports",(0,c.jsx)("strong",{children:e?ZC(e.openPorts):0})]})})]}),l.total>=2?(0,c.jsx)(i$,{}):null,(0,c.jsx)(r$,{repo:t,hook:"data-flows-link"})]}):null]})}function i$(){return(0,c.jsxs)("p",{className:"muted","data-select-hint":!0,children:["To work on several steps at once, select them with"," ",Ly.find(e=>e.id==="select")?.keys,": then line them up, space them evenly, copy them or make them a subflow."]})}function a$(e){let t=_.getState();t.openFind(!0),t.setFindQuery(e)}var SB={awx_workflow:"AWX workflow",awx_job_template:"AWX job template",playbook:"Playbook"};function NB(e){let t=e.template?`"${e.template}"`:e.path??"",n=e.id===void 0?"":` (id ${e.id})`,r=e.template&&e.path?` \xB7 ${e.path}`:"";return`${SB[e.kind]??e.kind} ${t}${n}${r}`.trim()}function s$(e){let t=_.getState().setHighlight;return{onMouseEnter:()=>t(e.length?e:null),onMouseLeave:()=>t(null),onFocus:()=>t(e.length?e:null),onBlur:()=>t(null)}}var jB=e=>e.length===1?e[0]:void 0,l$=e=>e.node?[e.node]:e.nodes;function d$(e,t){let n=_(a=>a.snapshot?.doc),r=jB(e);return t&&n&&r?U5(Ee(n),r):void 0}function u$(e,t){return e?Y5(Ee(e),t):!1}function c$({f:e,onStep:t,onFixed:n,places:r=!1}){let a=_(v=>v.setAccept),s=_(v=>v.reveal),l=_(v=>v.openDetails),f=_(v=>v.setError),p=d$(l$(e),r),h=t?{"data-node-finding":e.id}:{"data-finding":e.id};return(0,c.jsxs)("li",{className:`afd-finding severity-${e.severity}${e.accepted?" accepted":""}`,...h,"data-accepted":e.accepted?"true":void 0,...s$(e.nodes),children:[(0,c.jsxs)("div",{className:"afd-finding-title",children:[(0,c.jsx)("span",{className:`codicon ${e.accepted?"codicon-pass":e.severity==="warning"?"codicon-warning":"codicon-info"}`,"aria-hidden":"true"})," ",e.title,p?(0,c.jsxs)("span",{className:"afd-finding-place muted","data-finding-place":!0,children:[" ","\xB7 ",p]}):null]}),(0,c.jsx)("p",{className:"afd-finding-detail",children:e.detail}),e.accepted?(0,c.jsxs)("p",{className:"afd-finding-accepted muted",children:["Expected: ",e.accepted.reason,e.accepted.by?` (${e.accepted.by})`:""," ",(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>{Pe({kind:"clearFindingAccept",finding:e.id})},children:"Reopen"})]}):(0,c.jsxs)("div",{className:"afd-finding-actions",children:[e.acceptFirst?(0,c.jsx)("button",{type:"button","data-accept-first":!0,onClick:()=>a({id:e.id,node:e.node,title:e.title}),children:"Accept with Reason\u2026"}):null,e.fixes.map(v=>"command"in v?(0,c.jsx)("button",{type:"button",onClick:()=>{Pe(v.command).then(g=>{if(!g.ok)return f(g.error??"The fix failed");_.getState().setHighlight(null),n?.(e)})},children:v.label},v.label):(0,c.jsx)("button",{type:"button",className:"secondary",onClick:()=>{s(v.properties),l(v.properties)},children:v.label},v.label)),e.acceptFirst?null:(0,c.jsx)("button",{type:"button",className:"secondary",onClick:()=>a({id:e.id,node:e.node,title:e.title}),children:"Accept with Reason\u2026"})]})]})}function f$(e,t,n=()=>!1){let r=t?e.findIndex(a=>a.id===t)+1:0;return[...e.slice(r),...e.slice(0,r)].find(a=>!a.accepted&&a.id!==t&&!n(a))}function CB({id:e}){let t=_(h=>h.lens),n=_(h=>h.lensView),[r,a]=(0,T.useState)(null);if(!t||!n)return null;let s=h=>h.node===e||h.nodes.includes(e),l=n.findings.filter(s),f=sa.find(h=>h.id===t)?.label??t,p=r?f$(n.findings,r,s):void 0;return l.length===0&&!r?null:(0,c.jsxs)("div",{className:"afd-step-findings","data-step-findings":e,children:[l.length>0?(0,c.jsx)(Nr,{id:`lens-${t}`,summary:`Lens: ${f} \xB7 ${l.length} on this step`,open:l.some(h=>!h.accepted),children:(0,c.jsx)("ul",{className:"afd-findings",children:l.map(h=>(0,c.jsx)(c$,{f:h,onStep:!0,onFixed:v=>a(v.id)},h.id))})}):(0,c.jsxs)("p",{className:"muted",role:"status",children:["No ",f," findings left on this step."]}),p&&!l.some(h=>!h.accepted)?(0,c.jsxs)("button",{type:"button",className:"link","data-next-finding":p.id,onClick:()=>{let h=p.node??p.nodes[0];h&&_.getState().reveal(h)},children:["Next Finding: ",p.title]}):null]})}function EB(e,t){let n=new Date(e.startedAt);return`${Number.isNaN(n.getTime())?e.id:n.toLocaleString(t,{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})} \xB7 ${e.partial?"part of the flow":e.mode==="check"?"skeleton":"real run"} \xB7 ${`${e.hosts} host${e.hosts===1?"":"s"}`}, ${e.ok?e.failed?`${e.failed} failed`:"all passed":"did not finish"}`}var zy=new Map,$B=1;Yg(e=>{if(e.type!=="runOutputReply")return;let t=zy.get(e.reqId);zy.delete(e.reqId),t?.({entries:e.entries,error:e.error})});function _B(e,t){let n=$B++;return new Promise(r=>{zy.set(n,r),je({type:"runOutput",reqId:n,node:e,host:t})})}function Fy({run:e}){let t=_(s=>s.pastRuns),n=_(s=>s.snapshot?.doc?.flow.version);if(t.length===0||t.length===1&&t[0]?.id===e?.id)return null;let r=t.some(s=>s.id===e?.id)?e?.id:"",a=e?.past&&e.flowVersion!==void 0&&n!==void 0&&e.flowVersion!==n;return(0,c.jsxs)("div",{className:"afd-field afd-past-runs","data-past-runs":t.length,children:[(0,c.jsx)("label",{htmlFor:"afd-past-run",children:"Earlier runs"}),(0,c.jsxs)("select",{id:"afd-past-run",className:"afd-input",value:r??"",onChange:s=>s.target.value&&c8(s.target.value),children:[r?null:(0,c.jsx)("option",{value:"",children:"The run shown is not among the kept runs"}),t.map(s=>(0,c.jsx)("option",{value:s.id,title:s.partial,children:EB(s)},s.id))]}),a?(0,c.jsxs)("p",{className:"muted","data-past-version":e?.flowVersion,children:[(0,c.jsx)("span",{className:"codicon codicon-history","aria-hidden":"true"})," This run is of version"," ",e?.flowVersion," of the flow; it is at version ",n," now, so steps may have changed since."]}):null]})}function TB(e){return e.scenario?`Scenario: ${e.scenario.name} (stubs, local connection)`:e.partial?`Local skeleton run of part of the flow. ${e.partial.line}`:e.source==="awx"&&e.awx?`AWX ${e.awx.workflow?"workflow":"job"} #${e.awx.jobId} \xB7 ${e.awx.template}`:e.mode==="check"?"Local skeleton run (check mode)":"Local real run"}function AB(e){if(e.state==="running")return{label:e.awx?`running (${e.awx.status})`:e.quiet?"running \xB7 no new events for 20 s":"running",tone:e.quiet?"warn":"neutral"};if(e.scenario)return e.scenario.passed?{label:"passed: every host ended where expected",tone:"ok"}:{label:e.scenario.error??`${J0(e.scenario).length} host(s) ended elsewhere`,tone:"warn"};if(e.state==="error")return{label:e.error??"failed",tone:"warn"};if(Hj(e))return{label:`passed \xB7 exit ${e.rc}`,tone:"ok"};let{ok:t,failed:n}=qj(e),r=n?` \xB7 ${n} failed`:"";return{label:e.awx?`${e.awx.status} \xB7 exit ${e.rc}${r}`:`exit ${e.rc}${r}`,tone:t?"ok":"warn"}}function h$({run:e}){return(0,c.jsxs)("button",{type:"button",className:"secondary",onClick:()=>je({type:"showRunOutput"}),title:e.awx?e.awx.url:"Show the terminal of the run",children:[(0,c.jsx)("span",{className:`codicon ${e.awx?"codicon-link-external":"codicon-terminal"}`,"aria-hidden":"true"})," ",e.awx?"Open in AWX":"Show Terminal"]})}function MB({run:e}){let t=_(a=>a.snapshot?.doc);if(!t)return null;let n=Lz(t,e);if(n.length===0)return null;let r=Ee(t);return(0,c.jsxs)("section",{className:"afd-section","data-tested-proposal":n.length,children:[(0,c.jsx)("h3",{children:"Tested"}),(0,c.jsxs)("p",{children:["This run passed on flow version ",e.flowVersion,". Mark the implemented nodes it ran as tested? Saving the flow records it."]}),(0,c.jsx)("ul",{className:"afd-run-hosts",children:n.map(a=>(0,c.jsx)("li",{children:r.nodes.get(a)?.node.title??a},a))}),(0,c.jsxs)("button",{type:"button",onClick:()=>{Pe({kind:"setStatuses",statuses:Object.fromEntries(n.map(a=>[a,"tested"])),run:{id:e.id,...e.flowVersion===void 0?{}:{flowVersion:e.flowVersion},...e.awx?.revision?{commit:e.awx.revision}:{}}})},children:[(0,c.jsx)("span",{className:"codicon codicon-verified","aria-hidden":"true"})," Mark ",n.length," Node",n.length===1?"":"s"," Tested"]})]})}function OB(){let e=_(a=>a.runNodes),t=_(a=>a.snapshot?.doc);if(!e||!t)return null;let n=Ee(t),r=Object.entries(e).filter(([a,s])=>s.failed>0&&n.nodes.get(a)?.node.type!=="subflow").map(([a,s])=>{let l=n.nodes.get(a);return{id:a,r:s,title:l?.node.title??a,trail:l?mh(n,l.level):[]}}).sort((a,s)=>a.trail.join("/").localeCompare(s.trail.join("/"))||a.title.localeCompare(s.title));return r.length===0?null:(0,c.jsxs)("section",{className:"afd-section","data-failed-steps":r.length,children:[(0,c.jsx)("h3",{children:"Failed steps"}),(0,c.jsx)("ul",{className:"afd-run-hosts",children:r.map(({id:a,r:s,title:l,trail:f})=>(0,c.jsxs)("li",{children:[(0,c.jsx)("button",{type:"button",className:"link","data-failed-step":a,onClick:()=>_.getState().reveal(a),children:l})," ",(0,c.jsxs)("span",{className:"muted",children:[f.length?`${f.join(" \u203A ")} \xB7 `:"",s.failed," of ",s.hosts," host",s.hosts===1?"":"s"," failed"]})]},a))})]})}function p$(){let e=_(s=>s.scenarios),t=_(s=>s.scenarioShown),n=_(s=>s.showScenario),r=_(s=>s.snapshot?.doc);if(!e?.length)return null;let a=e.filter(s=>!s.passed).length;return(0,c.jsxs)("section",{className:"afd-section","data-run-scenarios":e.length,children:[(0,c.jsxs)("h3",{children:["Scenarios \xB7"," ",a?`${a} of ${e.length} failed`:`all ${e.length} pass`]}),t?(0,c.jsxs)("p",{"data-scenario-shown":t,children:["On the canvas: scenario ",(0,c.jsx)("strong",{children:t}),"."," ",(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>n(null),children:"Back to Last Run"})]}):null,(0,c.jsx)("ul",{className:"afd-lens-items",children:e.map(s=>{let l=J0(s);return(0,c.jsx)("li",{className:s.passed?"tone-ok":"tone-warn","data-scenario":s.name,children:(0,c.jsxs)("button",{type:"button",className:"afd-lens-item-button","aria-pressed":t===s.name,onClick:()=>n(s.name),title:"Show this scenario on the canvas",children:[(0,c.jsxs)("span",{className:"afd-lens-item-label",children:[s.passed?"pass":"fail"," \xB7 ",s.name]}),s.error?(0,c.jsx)("span",{className:"afd-lens-item-detail muted",children:s.error}):l.length?(0,c.jsx)("span",{className:"afd-lens-item-detail muted","data-scenario-misses":!0,children:l.map(f=>GF(r??void 0,f,s.forced)).join(". ")}):null]})},s.name)})})]})}function PB(){let e=_(l=>l.run),t=_(l=>l.snapshot?.doc),n=_(l=>l.viewer);if(!e&&n)return(0,c.jsxs)("div",{className:"afd-panel-body","data-run-panel":"none",children:[(0,c.jsx)("h2",{className:"afd-panel-title",children:"Run"}),(0,c.jsx)("p",{className:"muted",children:"No run of this flow yet. Run it from the bar above; nodes and wires then show what each host did."}),(0,c.jsx)(Fy,{run:null})]});if(!e)return(0,c.jsxs)("div",{className:"afd-panel-body","data-run-panel":"none",children:[(0,c.jsxs)("h2",{className:"afd-panel-title",children:["Run ",(0,c.jsx)(Sa,{topic:"runs",about:"runs"})]}),(0,c.jsx)("p",{className:"muted",children:"No run of this flow yet. Launch it in AWX, or run it as a skeleton in the local environment; nodes and wires then show what each host did."}),(0,c.jsx)(Fy,{run:null}),(0,c.jsx)(p$,{})]});let r=AB(e),a=e.summary,s=Object.entries(a?.outcome??{});return(0,c.jsxs)("div",{className:"afd-panel-body","data-run-panel":e.state,children:[(0,c.jsxs)("h2",{className:"afd-panel-title",children:["Run ",(0,c.jsx)(Sa,{topic:"runs",about:"runs"})]}),(0,c.jsx)(p$,{}),(0,c.jsx)(Fy,{run:e}),(0,c.jsxs)("dl",{className:"afd-run-facts",children:[(0,c.jsx)("dt",{children:"Run"}),(0,c.jsx)("dd",{children:TB(e)}),(0,c.jsx)("dt",{children:"Status"}),(0,c.jsx)("dd",{className:`tone-${r.tone}`,"data-run-status":e.awx?.status??e.state,children:r.label}),(0,c.jsx)("dt",{children:"When"}),(0,c.jsx)("dd",{title:e.finishedAt??e.startedAt,children:fh(e.finishedAt??e.startedAt)}),e.environment?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("dt",{children:"Where"}),(0,c.jsx)("dd",{className:"mono",children:e.environment})]}):null,e.awx?.revision?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("dt",{children:"Commit"}),(0,c.jsx)("dd",{className:"mono",title:e.awx.revision,children:e.awx.revision.slice(0,10)})]}):null,e.flowVersion===void 0?null:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("dt",{children:"Flow"}),(0,c.jsxs)("dd",{children:["v",e.flowVersion,t&&t.flow.version!==e.flowVersion?(0,c.jsxs)("span",{className:"muted",children:[" (now v",t.flow.version,")"]}):null]})]})]}),e.awx?.revisionMismatch?(0,c.jsxs)("p",{className:"afd-run-warning","data-revision-mismatch":!0,children:[(0,c.jsx)("span",{className:"codicon codicon-warning","aria-hidden":"true"})," AWX ran another commit than your HEAD: push your changes to the project's remote so the run matches the design."]}):null,e.scenario?null:(0,c.jsx)(h$,{run:e}),(0,c.jsx)(OB,{}),e.awx?.segments?.length?(0,c.jsxs)("section",{className:"afd-section","data-run-segments":e.awx.segments.length,children:[(0,c.jsx)("h3",{children:"Segments"}),(0,c.jsx)("ul",{className:"afd-run-hosts",children:e.awx.segments.map(l=>(0,c.jsxs)("li",{children:[(0,c.jsx)("span",{className:"mono",children:l.name})," ",(0,c.jsxs)("span",{className:"muted",children:["job #",l.job," \xB7 ",l.status]})]},l.job))})]}):null,a?(0,c.jsxs)("section",{className:"afd-section",children:[(0,c.jsx)("h3",{children:"Hosts"}),(0,c.jsxs)("p",{children:[a.hosts.length," host",a.hosts.length===1?"":"s",a.stoppedEarly?" \xB7 stopped early":""]}),s.length>0?(0,c.jsx)("ul",{className:"afd-run-hosts","data-run-outcome":s.length,children:s.map(([l,f])=>(0,c.jsxs)("li",{children:[(0,c.jsx)("span",{className:"mono",children:l})," ",(0,c.jsx)("span",{className:"muted",children:f})]},l))}):null,a.failures.length>0?(0,c.jsx)("ul",{className:"afd-run-hosts","data-run-failures":a.failures.length,children:a.failures.map(l=>{let f=e.scenario&&t&&l.node?zC(t,e.scenario.forced,l.host,l.node):void 0;return(0,c.jsxs)("li",{"data-forced":f?"true":void 0,children:[(0,c.jsx)("span",{className:"mono",children:l.host}),f?`: ${Q0(t??void 0,f)}`:(0,c.jsxs)(c.Fragment,{children:[" ","failed in ",l.task,l.msg?(0,c.jsxs)("span",{className:"muted",children:[" \xB7 ",l.msg]}):null]})]},`${l.host}|${l.task}`)})}):null]}):null,(0,c.jsx)(MB,{run:e})]})}function DB({id:e}){let[t,n]=(0,T.useState)(null),r=_(m=>m.snapshot?.doc),a=_(m=>m.run),s=_(m=>m.runNodes?.[e]),l=gy(a,e),f=r?Ee(r):void 0,p=f?.nodes.get(e)?.node;if(!f||!p)return null;let h=a?.summary,v=a?.source==="local"&&a.state!=="running"&&p.type!=="start"&&p.type!=="end",g=h?p.type==="start"?h.hosts.map(m=>({host:m,ports:["ok_hosts"]})):p.type==="end"?Wf(f,h,e).map(m=>({host:m,ports:[],ended:h.outcome[m]??(p.outcome==="failed"?"failed here":"ended here")})):Kf(h,e):[];if(a?.scenario&&r&&p.type==="end"){let m=QF(r,a.scenario,a,e);return(0,c.jsxs)("div",{className:"afd-panel-body","data-node-run":e,"data-scenario-end":a.scenario.name,children:[(0,c.jsxs)("p",{children:["Scenario ",(0,c.jsx)("strong",{children:a.scenario.name})]}),m.length===0?(0,c.jsx)("p",{className:"muted",children:"The scenario expected no host here, and none came."}):(0,c.jsxs)("table",{className:"afd-run-table","data-end-rows":m.length,children:[(0,c.jsx)("thead",{children:(0,c.jsxs)("tr",{children:[(0,c.jsx)("th",{children:"Host"}),(0,c.jsx)("th",{children:"Expected"}),(0,c.jsx)("th",{children:"Ended"})]})}),(0,c.jsx)("tbody",{children:m.map(b=>(0,c.jsxs)("tr",{"data-host":b.host,className:b.ok?"":"tone-warn",children:[(0,c.jsx)("td",{className:"mono",children:b.host}),(0,c.jsx)("td",{children:b.expected?"here":"elsewhere"}),(0,c.jsx)("td",{title:b.ended,children:ah(r,b.ended)})]},b.host))})]})]})}return(0,c.jsxs)("div",{className:"afd-panel-body","data-node-run":e,children:[h?s?.state==="idle"?(0,c.jsx)("p",{className:"muted",children:"The last run did not reach this node."}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("p",{children:[s?.hosts," host",s?.hosts===1?"":"s"," \xB7 ",s?.failed," failed",s?.seconds===void 0?"":` \xB7 ${Ut(s.seconds)}`]}),(0,c.jsxs)("table",{className:"afd-run-table","data-run-hosts":g.length,children:[(0,c.jsx)("thead",{children:(0,c.jsxs)("tr",{children:[(0,c.jsx)("th",{children:"Host"}),(0,c.jsx)("th",{children:"Left through"}),(0,c.jsx)("th",{children:"Result"}),v?(0,c.jsx)("th",{children:(0,c.jsx)("span",{className:"afd-sr-only",children:"Output"})}):null]})}),(0,c.jsx)("tbody",{children:g.map(m=>{let b=m.problem&&a?.scenario&&r?zC(r,a.scenario.forced,m.host,p.id):void 0,w=b?a?.scenario?.hosts.find(k=>k.host===m.host&&k.expected!==k.actual):void 0;return(0,c.jsxs)(T.Fragment,{children:[(0,c.jsxs)("tr",{"data-host":m.host,"data-port":m.ports.join(","),children:[(0,c.jsx)("td",{className:"mono",children:m.host}),(0,c.jsx)("td",{className:"mono afd-run-port",children:m.ports.join(", ")||(m.ended?"-":"(no route)")}),(0,c.jsx)("td",{children:m.ended?(0,c.jsx)("span",{className:p.outcome==="failed"?"tone-warn":"tone-ok",children:m.ended}):b?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("span",{className:"tone-warn","data-forced":!0,title:Q0(r??void 0,b),children:["Forced by the scenario (",b.outcome,")"]}),w?(0,c.jsxs)("span",{className:"muted","data-forced-miss":!0,children:[" ","\xB7 ",RC(r??void 0,w)]}):null]}):m.problem?(0,c.jsxs)("span",{title:m.problem.msg,children:[m.problem.status," in ",m.problem.task,m.problem.msg?(0,c.jsxs)("span",{className:"muted",children:[" \xB7 ",m.problem.msg]}):null]}):(0,c.jsx)("span",{className:"tone-ok",children:"ok"})}),v?(0,c.jsx)("td",{children:(0,c.jsx)("button",{type:"button",className:"icon","aria-expanded":t===m.host,"aria-label":`Output of ${m.host}`,title:`Output of ${m.host}`,"data-output-toggle":m.host,onClick:()=>n(t===m.host?null:m.host),children:(0,c.jsx)("span",{className:"codicon codicon-output","aria-hidden":"true"})})}):null]}),t===m.host?(0,c.jsx)(zB,{node:e,host:m.host}):null]},m.host)})})]})]}):(0,c.jsx)("p",{className:"muted",children:"No run yet."}),l&&a?.awx?(0,c.jsxs)("p",{"data-approval":l.label,children:["AWX approval: ",(0,c.jsx)("strong",{children:l.label})," ",(0,c.jsxs)("button",{type:"button",className:"secondary",onClick:()=>je({type:"showRunOutput",approval:e}),title:l.url,children:[(0,c.jsx)("span",{className:"codicon codicon-link-external","aria-hidden":"true"})," Open approval in AWX"]})]}):l?(0,c.jsx)(LB,{id:e,approval:l,message:p.approval?.message}):null,a&&!a.scenario?(0,c.jsx)(h$,{run:a}):null]})}function LB({id:e,approval:t,message:n}){let[r,a]=(0,T.useState)(""),[s,l]=(0,T.useState)(),f=h=>{l(h),je({type:"approve",node:e,decision:h,...r.trim()?{comment:r.trim()}:{}})},p=t.at?new Date(t.at).toLocaleString():void 0;return(0,c.jsxs)("section",{className:"afd-approval","data-approval":t.label,children:[(0,c.jsxs)("p",{children:["Approval:"," ",(0,c.jsx)("strong",{children:t.status==="waiting"?"waiting for a decision":t.label}),t.by?` by ${t.by}`:"",p?`, ${p}`:""]}),t.comment?(0,c.jsx)("blockquote",{children:t.comment}):null,n&&t.status==="waiting"?(0,c.jsx)("p",{className:"muted",children:n}):null,t.status==="waiting"&&t.mayDecide?s?(0,c.jsxs)("p",{role:"status",children:["Sent: ",s,". The run goes on once the server has it."]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("label",{htmlFor:`afd-approval-${e}`,children:"Comment"}),(0,c.jsx)("textarea",{id:`afd-approval-${e}`,rows:2,value:r,onChange:h=>a(h.target.value),placeholder:"Why, for the record"}),(0,c.jsxs)("div",{className:"afd-approval-actions",children:[(0,c.jsx)("button",{type:"button",onClick:()=>f("approved"),children:"Approve"}),(0,c.jsx)("button",{type:"button",className:"secondary",onClick:()=>f("rejected"),children:"Reject"})]})]}):t.status==="waiting"?(0,c.jsx)("p",{className:"muted",children:"Someone allowed to approve decides it."}):null]})}function IB(e,t){for(let n of e){let r=n.find(a=>a.id===t);if(r)return r}}function RB({edge:e}){let t=_(p=>p.snapshot?.doc),n=_(p=>p.run?.summary);if(!t)return null;let r=Ee(t),a=IB([...r.levels.values()].map(p=>p.edges),e);if(!a)return null;let s=r.nodes.get(a.from.node)?.node,l=r.nodes.get(a.to.node)?.node,f=n?T0(r,n,a):[];return(0,c.jsxs)("div",{className:"afd-panel-body","data-wire-run":e,children:[(0,c.jsxs)("h2",{className:"afd-panel-title",children:[s?.title," ",(0,c.jsx)("span",{className:"mono",children:a.from.port})," \u2192 ",l?.title]}),n?f.length===0?(0,c.jsx)("p",{className:"muted",children:"No host took this wire in the last run."}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("p",{children:[f.length," host",f.length===1?"":"s"," took this wire"]}),(0,c.jsx)("ul",{className:"afd-run-hosts mono","data-wire-hosts":f.join(","),children:f.map(p=>(0,c.jsx)("li",{children:p},p))})]}):(0,c.jsx)("p",{className:"muted",children:"No run yet."})]})}function zB({node:e,host:t}){let[n,r]=(0,T.useState)(null);return(0,T.useEffect)(()=>{let a=!0;return _B(e,t).then(s=>a&&r(s)),()=>{a=!1}},[e,t]),(0,c.jsx)("tr",{className:"afd-run-output","data-run-output":t,children:(0,c.jsx)("td",{colSpan:4,children:n?n.error?(0,c.jsx)("p",{className:"muted",children:n.error}):n.entries?.length?n.entries.map((a,s)=>(0,c.jsxs)("div",{className:"afd-output-entry","data-output-task":a.task,children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"mono",children:a.task})," ",(0,c.jsxs)("span",{className:a.status==="ok"?"tone-ok":a.status==="skipped"?"muted":"tone-warn",children:[a.status,a.changed?" \xB7 changed":"",a.rc===void 0?"":` \xB7 rc ${a.rc}`,a.item?" \xB7 loop item":""]})]}),a.censored?(0,c.jsx)("p",{className:"muted",children:"Output hidden (no_log)."}):null,a.msg&&!a.out?.msg?(0,c.jsx)("pre",{className:"afd-code",children:a.msg}):null,["msg","stdout","stderr"].map(l=>a.out?.[l]?(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"muted",children:l}),(0,c.jsx)("pre",{className:"afd-code",children:a.out[l]})]},l):null)]},s)):(0,c.jsxs)("p",{className:"muted",children:["No task results for ",t," here."]}):(0,c.jsx)("p",{className:"muted",children:"Reading the output\u2026"})})})}var FB=new Set(["and","or","not","in","is","if","else","elif","for","recursive","as","with","without","context","import","from","ignore","missing"]),BB=new Set(["true","false","none","True","False","None"]),m$=/[A-Za-z_][A-Za-z0-9_]*/y,g$=/0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|[0-9][0-9_]*(?:\.[0-9_]+)?(?:[eE][+-]?[0-9]+)?/y,qB=["**","//","==","!=","<=",">=","+","-","*","/","%","<",">","=","~","|"],HB="()[]{},.:",VB=/%[-_0^#]?[A-Za-z%]/g;function Jd(e,t){return t&&!e.includes("{{")?"expr":"template"}function al(e,t){let n=[],r=t.yamlQuote,a=t.mode==="expr"?"expr":"text",s=[],l=0,f,p,h,v=!1,g=0,m=(N,E)=>{if(N<=g)return;let j={text:e.slice(g,N),start:g,...E?{kind:E}:{}},$=n[n.length-1];!E&&$&&!$.kind&&$.start+$.text.length===g?$.text+=j.text:n.push(j),E&&(v=h?.kind==="keyword"&&h.text==="is"&&j.text==="not",h=j),g=N},b=N=>{if(r==="'"&&e.startsWith("''",N))return{q:"'",len:2};if(r==='"'&&e.startsWith('\\"',N))return{q:'"',len:2};let E=e[N];if(E==="'"&&r!=="'"||E==='"'&&r!=='"')return{q:E,len:1}},w=N=>{let E=g,j=g+N.len,$=!1;for(;j<e.length;){let M=b(j);if(M&&M.q===N.q){j+=M.len,$=!0;break}e[j]==="\\"&&(r!=='"'||e[j+1]!=='"')?j+=2:j++}let L=Math.min(j,e.length),z=e.slice(E,L),A=0;for(let M of z.matchAll(VB)){let O=M.index??0;O>A&&m(E+O,"string"),m(E+O+M[0].length,"format"),A=O+M[0].length}m(L,"string"),$||(p={quote:N.q,start:E})},k=(N,E)=>{if(a==="stmt"&&!f)return"keyword";if(BB.has(N))return"constant";let j=h;if(j?.text==="|")return"filter";if(j?.kind==="keyword"&&j.text==="is"&&N!=="not"||v)return"test";if(FB.has(N))return"keyword";let $=/^\s*(\(|=(?!=))?/.exec(e.slice(E))?.[1];return j?.text==="."?$==="("?"method":"attr":$==="="&&s[s.length-1]?.open==="("?"kwarg":$==="("?"func":"var"},S=()=>{if(s.length>0)return 0;let N=a==="expr"?/[-+]?\}\}/y:/[-+]?%\}/y;return N.lastIndex=g,N.test(e)?N.lastIndex-g:0};for(;g<e.length;){if(a==="text"||a==="raw"){let A=a==="raw"?/\{%[-+]?\s*endraw\s*[-+]?%\}/g:/\{\{|\{%|\{#/g;A.lastIndex=g;let M=A.exec(e);if(!M){m(e.length);break}if(m(M.index),a==="raw"){m(g+M[0].length,"delim"),a="text";continue}if(M[0]==="{#"){let K=e.indexOf("#}",g+2);if(K<0){m(e.length,"comment"),a="comment";break}m(K+2,"comment");continue}let O=/[-+]?/y;O.lastIndex=g+2,O.test(e),m(O.lastIndex,"delim"),a=M[0]==="{{"?"expr":"stmt",l=g,f=void 0,s=[],h=void 0,v=!1;continue}let N=t.mode==="expr"?0:S();if(N){m(g+N,"delim"),a=f==="raw"?"raw":"text",h=void 0;continue}let E=e[g];if(/\s/.test(E)){let A=/\s+/y;A.lastIndex=g,A.test(e),m(A.lastIndex);continue}let j=b(g);if(j){w(j);continue}m$.lastIndex=g;let $=m$.exec(e);if($){let A=g+$[0].length,M=k($[0],A);a==="stmt"&&!f&&(f=$[0]);let O=s[s.length-1];M==="kwarg"&&O&&(O.kwarg=$[0]),m(A,M);continue}g$.lastIndex=g;let L=g$.exec(e);if(L){m(g+L[0].length,"number");continue}if(HB.includes(E)){let A=s[s.length-1];if(E==="("||E==="["||E==="{"){let M=E==="("&&h&&h.start+h.text.length===g&&(h.kind==="func"||h.kind==="method"||h.kind==="filter"||h.kind==="test")?h:void 0;s.push({open:E,arg:0,...M?{callee:M.text,calleeKind:M.kind,calleeStart:M.start}:{}})}else E===","&&A?(A.arg++,delete A.kwarg):A&&(E===")"&&A.open==="("||E==="]"&&A.open==="["||E==="}"&&A.open==="{")&&s.pop();m(g+1,"punct");continue}let z=qB.find(A=>e.startsWith(A,g));m(g+(z?.length??1),z?"op":"punct")}return{tokens:n,end:{where:a,...p?{string:p}:{},stack:s.map(N=>({...N})),exprStart:l,...f?{stmtWord:f}:{}}}}var y$={delim:"delim",comment:"comment",keyword:"keyword",constant:"constant",var:"var",attr:"var",kwarg:"var",func:"func",method:"func",filter:"func",test:"func",string:"string",format:"format",number:"number"};function KB(e,t){let n=[];for(let r of al(e,t).tokens){let a=r.kind&&y$[r.kind];if(!a)continue;let s=n[n.length-1];s&&s.colour===a&&s.end===r.start?s.end=r.start+r.text.length:n.push({start:r.start,end:r.start+r.text.length,colour:a})}return n}function Gn(e,t,n,r={}){let a=`${e}(${t})`,s=t.indexOf("''");return{name:e,insert:a,...s>=0?{caret:e.length+1+s+1,again:!0}:t?{caret:e.length+1}:{},doc:n,...r}}var eu=[{name:"now",insert:"now()",sig:"now(utc=False, fmt=None)",doc:"The current date and time on the controller, as a datetime.",returns:"datetime"},{name:"now",insert:"now(utc=true)",sig:"now(utc=False, fmt=None)",doc:"The current date and time in UTC, as a datetime.",returns:"datetime"},{name:"now",insert:"now(fmt='')",caret:9,again:!0,sig:"now(utc=False, fmt=None)",doc:"The current date and time as text, formatted with strftime codes.",returns:"str"},Gn("lookup","''","Runs a lookup plugin on the controller; the results joined as text.",{sig:"lookup(name, *terms, wantlist=False, **options)"}),Gn("query","''","Runs a lookup plugin on the controller; the results as a list.",{sig:"query(name, *terms, **options)",returns:"list"}),Gn("q","''","Short for query: a lookup whose results are a list.",{sig:"q(name, *terms, **options)",returns:"list"}),Gn("range","","A sequence of whole numbers.",{sig:"range([start,] stop[, step])",returns:"list"}),Gn("dict","","A dictionary made from keyword arguments.",{sig:"dict(**items)",returns:"dict"}),Gn("namespace","","An object a loop can change: {% set ns.total = ns.total + 1 %}.",{sig:"namespace(**attributes)"}),Gn("lipsum","","Placeholder text.",{sig:"lipsum(n=5, html=True, min=20, max=100)"}),Gn("cycler","","Cycles through its values with .next().",{sig:"cycler(*items)"}),Gn("joiner","', '","Gives the separator from its second call on.",{sig:"joiner(sep=', ')"}),Gn("undef","","An undefined value with a hint, for a default that must be set.",{sig:"undef(hint=None)"})],By=[{name:"inventory_hostname",doc:"The host's name in the inventory.",returns:"str"},{name:"inventory_hostname_short",doc:"The host's inventory name up to the first dot.",returns:"str"},{name:"hostvars",doc:"Every host's variables, by host name.",returns:"dict"},{name:"groups",doc:"Every group's hosts, by group name.",returns:"dict"},{name:"group_names",doc:"The groups this host is in.",returns:"list"},{name:"ansible_facts",doc:"The facts gathered from this host.",returns:"dict"},{name:"ansible_host",doc:"The address Ansible connects to.",returns:"str"},{name:"ansible_play_hosts",doc:"The play hosts that have not failed.",returns:"list"},{name:"ansible_play_hosts_all",doc:"Every host the play started with.",returns:"list"},{name:"ansible_play_batch",doc:"The hosts of the current batch (serial).",returns:"list"},{name:"ansible_check_mode",doc:"Whether the run is in check mode.",returns:"bool"},{name:"ansible_diff_mode",doc:"Whether the run shows diffs.",returns:"bool"},{name:"ansible_version",doc:"Ansible's version: full, major, minor, revision.",returns:"dict"},{name:"ansible_run_tags",doc:"The tags the run was asked for.",returns:"list"},{name:"ansible_skip_tags",doc:"The tags the run skips.",returns:"list"},{name:"ansible_limit",doc:"The --limit of the run.",returns:"str"},{name:"inventory_dir",doc:"The folder of the host's inventory source.",returns:"str"},{name:"inventory_file",doc:"The host's inventory source.",returns:"str"},{name:"role_path",doc:"The running role's folder.",returns:"str"},{name:"role_name",doc:"The running role's name.",returns:"str"},{name:"omit",doc:"As a parameter value: leaves the parameter out."},{name:"item",doc:"The loop's current item."},{name:"ansible_loop",doc:"Loop details (index, first, last\u2026) with loop_control.extended.",returns:"loop"},{name:"afd_repo_root",doc:"The repository's root: generated plays run from generated/, so paths start here.",returns:"str"},{name:"afd_failed_result",doc:"On a failure path: the result of the step that failed.",returns:"dict"},{name:"afd_failed_task",doc:"On a failure path: the task that failed.",returns:"str"},{name:"afd_failed_node",doc:"On a failure path: the key of the step that failed.",returns:"str"}],WB=[{name:"true",doc:"True.",returns:"bool"},{name:"false",doc:"False.",returns:"bool"},{name:"none",doc:"No value (Python None)."}],v$=[{name:"and",doc:"Both sides are true."},{name:"or",doc:"Either side is true."},{name:"not",doc:"The opposite."},{name:"in",doc:"Contained in a list, string or dict."},{name:"is",insert:"is ",doc:"Applies a test: x is defined.",again:!0},{name:"if",doc:"A value if a condition holds: a if c else b."},{name:"else",doc:"The value when the condition does not hold."}],UB=[{name:"if",doc:"Renders what follows when a condition holds."},{name:"elif",doc:"Another condition."},{name:"else",doc:"When no condition held."},{name:"endif",doc:"Ends an if."},{name:"for",insert:"for in ",caret:4,doc:"Renders what follows for each item."},{name:"endfor",doc:"Ends a for."},{name:"set",insert:"set = ",caret:4,doc:"Sets a variable of the template."},{name:"endset",doc:"Ends a set block."},{name:"with",doc:"Variables for the block that follows."},{name:"endwith",doc:"Ends a with."},{name:"macro",doc:"Defines a reusable piece of template."},{name:"endmacro",doc:"Ends a macro."},{name:"filter",doc:"Applies a filter to the block."},{name:"endfilter",doc:"Ends a filter block."},{name:"raw",doc:"Leaves what follows unrendered."},{name:"endraw",doc:"Ends raw."},{name:"break",doc:"Leaves the loop."},{name:"continue",doc:"Skips to the next item."}],ae=(e,t,n,r,a)=>({...t===""?{name:e}:Gn(e,t,n),doc:n,sig:a??(t===""?e:`${e}(${t.replaceAll("''","\u2026")})`),...r?{returns:r}:{}}),Ch=[ae("default","''","The value, or this one when it is undefined.",void 0,"default(value='', boolean=False)"),ae("d","''","Short for default.",void 0,"d(value='', boolean=False)"),ae("mandatory","","Fails when the value is undefined."),ae("string","","As text.","str"),ae("int","","As a whole number.","int","int(default=0, base=10)"),ae("float","","As a number with a fraction.",void 0,"float(default=0.0)"),ae("bool","",'As true or false ("yes", "on", 1 count as true).',"bool"),ae("length","","How many items or characters.","int"),ae("count","","How many items or characters.","int"),ae("lower","","In lower case.","str"),ae("upper","","In upper case.","str"),ae("capitalize","","The first letter in upper case, the rest lower.","str"),ae("title","","Each word capitalized.","str"),ae("trim","","Without leading and trailing whitespace.","str"),ae("replace","'', ''","Each occurrence of the first text replaced with the second.","str","replace(old, new, count=None)"),ae("regex_replace","'', ''","Each match of a regular expression replaced.","str","regex_replace(pattern, replacement='', ignorecase=False, multiline=False)"),ae("regex_search","''","The first match of a regular expression, or none.","str","regex_search(pattern, *groups, ignorecase=False, multiline=False)"),ae("regex_findall","''","Every match of a regular expression.","list","regex_findall(pattern, ignorecase=False, multiline=False)"),ae("regex_escape","","The text with regular expression characters escaped.","str"),ae("split","''","The text split into a list.","list","split(separator=None, maxsplit=-1)"),ae("join","''","The items joined into text.","str","join(separator='', attribute=None)"),ae("first","","The first item."),ae("last","","The last item."),ae("list","","As a list.","list"),ae("sort","","The items in order.","list","sort(reverse=False, case_sensitive=False, attribute=None)"),ae("reverse","","The items or characters in reverse order."),ae("unique","","The items without repeats.","list"),ae("flatten","","Nested lists made into one list.","list","flatten(levels=None)"),ae("map","''","Applies a filter, or takes an attribute, of each item.","list","map(filter, *args) or map(attribute=name)"),ae("select","''","The items a test passes.","list","select(test, *args)"),ae("reject","''","The items a test fails.","list","reject(test, *args)"),ae("selectattr","''","The items whose attribute passes a test.","list","selectattr(attribute, test, *args)"),ae("rejectattr","''","The items whose attribute fails a test.","list","rejectattr(attribute, test, *args)"),ae("groupby","''","The items grouped by an attribute.","list","groupby(attribute)"),ae("sum","","The sum of the items.",void 0,"sum(attribute=None, start=0)"),ae("min","","The smallest item."),ae("max","","The largest item."),ae("abs","","The absolute value."),ae("round","","Rounded.",void 0,"round(precision=0, method='common')"),ae("random","","A random item, or a random number below the value."),ae("shuffle","","The items in random order.","list"),ae("batch","","The items in lists of n.","list","batch(n, fill_with=None)"),ae("slice","","The items in n lists.","list","slice(n, fill_with=None)"),ae("dictsort","","A dict as (key, value) pairs, sorted.","list"),ae("items","","A dict's (key, value) pairs.","list"),ae("dict2items","","A dict as a list of {key, value}.","list","dict2items(key_name='key', value_name='value')"),ae("items2dict","","A list of {key, value} as a dict.","dict","items2dict(key_name='key', value_name='value')"),ae("combine","","Dicts merged; later ones win.","dict","combine(*dicts, recursive=False, list_merge='replace')"),ae("zip","","Lists paired item by item.","list","zip(*lists)"),ae("zip_longest","","Lists paired to the longest one.","list","zip_longest(*lists, fillvalue=None)"),ae("difference","","The items not in the other list.","list","difference(other)"),ae("intersect","","The items also in the other list.","list","intersect(other)"),ae("union","","The items of both lists, once each.","list","union(other)"),ae("symmetric_difference","","The items in only one of the lists.","list","symmetric_difference(other)"),ae("subelements","''","Each item paired with each element of its sub-list.","list","subelements(key, skip_missing=False)"),ae("extract","","The values of these keys in a container.",void 0,"extract(container, morekeys=None)"),ae("ternary","'', ''","The first value if true, else the second.",void 0,"ternary(true_val, false_val, none_val=None)"),ae("to_json","","As JSON text.","str","to_json(indent=None, sort_keys=False)"),ae("to_nice_json","","As indented JSON text.","str","to_nice_json(indent=4, sort_keys=True)"),ae("from_json","","JSON text as data."),ae("to_yaml","","As YAML text.","str"),ae("to_nice_yaml","","As indented YAML text.","str","to_nice_yaml(indent=4)"),ae("from_yaml","","YAML text as data."),ae("from_yaml_all","","Each document of YAML text, as data.","list"),ae("b64encode","","As Base64.","str"),ae("b64decode","","Base64 decoded.","str"),ae("hash","''","A hash of the text.","str","hash(hashtype='sha1')"),ae("checksum","","The SHA-1 checksum of the text.","str"),ae("md5","","The MD5 hash of the text.","str"),ae("sha1","","The SHA-1 hash of the text.","str"),ae("password_hash","''","A password hash for /etc/shadow.","str","password_hash(hashtype='sha512', salt=None)"),ae("to_uuid","","A UUID made from the text.","str"),ae("quote","","Quoted for a shell.","str"),ae("comment","","As a comment block.","str","comment(style='plain')"),ae("indent","","Each line after the first indented.","str","indent(width=4, first=False, blank=False)"),ae("center","","Centred in a width.","str","center(width=80)"),ae("truncate","","Cut to a length.","str","truncate(length=255, killwords=False, end='...')"),ae("wordcount","","How many words.","int"),ae("wordwrap","","Wrapped at a width.","str","wordwrap(width=79)"),ae("format","",'printf-style formatting: "%s-%d" | format(a, b).',"str","format(*args)"),ae("basename","","The last part of a path.","str"),ae("dirname","","A path without its last part.","str"),ae("path_join","","Parts joined into a path.","str"),ae("splitext","","A path split into (root, extension).","list"),ae("realpath","","The path with links resolved (on the controller).","str"),ae("relpath","''","The path relative to a start.","str","relpath(start)"),ae("expanduser","","The path with ~ expanded.","str"),ae("expandvars","","The path with environment variables expanded.","str"),ae("fileglob","","The controller files matching a pattern.","list"),ae("urlsplit","''","A URL split into parts, or one part.",void 0,"urlsplit(query=None)"),ae("urlencode","","Encoded for a URL.","str"),ae("urldecode","","Decoded from a URL.","str"),ae("human_readable","","A byte count as text (1.0 KB).","str"),ae("human_to_bytes","","Text like 1 KB as a byte count.","int"),ae("to_datetime","''","Text as a datetime, read with strftime codes.","datetime","to_datetime(format='%Y-%m-%d %H:%M:%S')"),ae("strftime","","Seconds since 1970 (or now) formatted with the codes in the value: '%Y-%m-%d' | strftime.","str","strftime(second=None, utc=False)"),ae("type_debug","","The Python type of the value.","str"),ae("tojson","","As JSON text (Jinja).","str"),ae("pprint","","Pretty-printed, for debugging.","str"),ae("attr","''","An attribute of the object.",void 0,"attr(name)"),ae("xmlattr","","A dict as XML attributes.","str"),ae("escape","","HTML-escaped.","str"),ae("safe","","Marked safe: not escaped.","str"),ae("striptags","","Without HTML or XML tags.","str"),ae("urlize","","URLs made into links.","str"),ae("filesizeformat","","A byte count as text (1.0 kB).","str"),ae("log","","The logarithm.",void 0,"log(base=e)"),ae("pow","","Raised to a power.",void 0,"pow(exponent)"),ae("root","","A root.",void 0,"root(base=2)"),ae("product","","The cartesian product of lists.","list"),ae("permutations","","The permutations of the items.","list"),ae("combinations","","The combinations of n items.","list","combinations(n)"),ae("vault","''","Encrypted with a vault secret.","str","vault(secret, vault_id=None)"),ae("unvault","''","Decrypted with a vault secret.","str","unvault(secret, vault_id=None)")],qy=[ae("defined","","The variable is defined."),ae("undefined","","The variable is not defined."),ae("none","","The value is none."),ae("truthy","","The value counts as true."),ae("falsy","","The value counts as false."),ae("true","","The value is true."),ae("false","","The value is false."),ae("boolean","","The value is true or false."),ae("string","","The value is text."),ae("number","","The value is a number."),ae("integer","","The value is a whole number."),ae("float","","The value is a number with a fraction."),ae("mapping","","The value is a dict."),ae("sequence","","The value is a list or text."),ae("iterable","","The value can be looped over."),ae("callable","","The value can be called."),ae("even","","An even number."),ae("odd","","An odd number."),ae("divisibleby","","Divisible by a number.",void 0,"divisibleby(num)"),ae("eq","","Equal to.",void 0,"eq(other)"),ae("ne","","Not equal to.",void 0,"ne(other)"),ae("lt","","Less than.",void 0,"lt(other)"),ae("le","","Less than or equal to.",void 0,"le(other)"),ae("gt","","Greater than.",void 0,"gt(other)"),ae("ge","","Greater than or equal to.",void 0,"ge(other)"),ae("in","","In a list or text.",void 0,"in(container)"),ae("lower","","All lower case."),ae("upper","","All upper case."),ae("sameas","","The same object.",void 0,"sameas(other)"),ae("match","''","A regular expression matches at the start.",void 0,"match(pattern, ignorecase=False, multiline=False)"),ae("search","''","A regular expression matches anywhere.",void 0,"search(pattern, ignorecase=False, multiline=False)"),ae("regex","''","A regular expression matches.",void 0,"regex(pattern, ignorecase=False, multiline=False, match_type='search')"),ae("contains","","The list contains the item.",void 0,"contains(item)"),ae("any","","Any item is true."),ae("all","","Every item is true."),ae("subset","","Every item is in the other list.",void 0,"subset(other)"),ae("superset","","Holds every item of the other list.",void 0,"superset(other)"),ae("version","'', ''","Compares versions: x is version('17.9', '<').",void 0,"version(version, operator='eq', strict=False, version_type=None)"),ae("changed","","A task result that changed something."),ae("failed","","A task result that failed."),ae("succeeded","","A task result that succeeded."),ae("success","","A task result that succeeded."),ae("skipped","","A task result that was skipped."),ae("reachable","","A task result whose host was reachable."),ae("unreachable","","A task result whose host was unreachable."),ae("finished","","An async result that finished."),ae("started","","An async result that started."),ae("timedout","","A task result that timed out."),ae("exists","","The path exists on the controller."),ae("file","","The path is a file on the controller."),ae("directory","","The path is a folder on the controller."),ae("link","","The path is a link on the controller."),ae("abs","","The path is absolute."),ae("same_file","","Both paths are the same file.",void 0,"same_file(other)"),ae("mount","","The path is a mount point on the controller."),ae("url","","The text is a URL."),ae("uri","","The text is a URI."),ae("vault_encrypted","","The value is vault-encrypted."),ae("nan","","Not a number.")],b$=[{name:"env",doc:"An environment variable on the controller: lookup('env', 'HOME')."},{name:"file",doc:"The text of controller files."},{name:"template",doc:"Controller templates, rendered."},{name:"vars",doc:"Variables by name."},{name:"varnames",doc:"The names of variables matching a pattern."},{name:"pipe",doc:"The output of a command on the controller."},{name:"lines",doc:"The output of a command, line by line."},{name:"password",doc:"A random password, kept in a controller file."},{name:"url",doc:"The content of URLs."},{name:"fileglob",doc:"Controller files matching a pattern."},{name:"first_found",doc:"The first controller file that exists."},{name:"ini",doc:"Values from an INI file."},{name:"csvfile",doc:"Values from a CSV file."},{name:"sequence",doc:"A sequence of numbers as text."},{name:"items",doc:"The items of lists."},{name:"list",doc:"The terms as a list."},{name:"dict",doc:"A dict's items as {key, value}."},{name:"indexed_items",doc:"The items with their index."},{name:"nested",doc:"Every combination of the lists."},{name:"together",doc:"The lists paired item by item."},{name:"subelements",doc:"Items with each element of a sub-list."},{name:"random_choice",doc:"One of the terms, at random."},{name:"inventory_hostnames",doc:"The hosts matching an inventory pattern."},{name:"config",doc:"An Ansible configuration setting."},{name:"unvault",doc:"The text of vault-encrypted files."}],$e=(e,t,n,r,a)=>t===void 0?{name:e,doc:n,...r?{returns:r}:{}}:{...Gn(e,t,n),sig:a??`${e}(${t})`,...r?{returns:r}:{}},tu={datetime:[$e("strftime","''","Formatted with strftime codes.","str","strftime(format)"),$e("isoformat","","As ISO 8601 text.","str"),$e("timestamp","","Seconds since 1970.",void 0),$e("date","","The date part.","date"),$e("time","","The time part.","time"),$e("year",void 0,"The year.","int"),$e("month",void 0,"The month, 1 to 12.","int"),$e("day",void 0,"The day of the month.","int"),$e("hour",void 0,"The hour, 0 to 23.","int"),$e("minute",void 0,"The minute.","int"),$e("second",void 0,"The second.","int"),$e("microsecond",void 0,"The microsecond.","int"),$e("weekday","","The day of the week, Monday 0.","int"),$e("isoweekday","","The day of the week, Monday 1.","int"),$e("replace","","The same date and time with some parts changed.","datetime","replace(year=\u2026, month=\u2026, day=\u2026, hour=\u2026, \u2026)"),$e("ctime","",'As text like "Thu Nov 12 10:15:30 2026".',"str")],date:[$e("strftime","''","Formatted with strftime codes.","str","strftime(format)"),$e("isoformat","","As ISO 8601 text.","str"),$e("year",void 0,"The year.","int"),$e("month",void 0,"The month, 1 to 12.","int"),$e("day",void 0,"The day of the month.","int"),$e("weekday","","The day of the week, Monday 0.","int"),$e("isoweekday","","The day of the week, Monday 1.","int")],time:[$e("strftime","''","Formatted with strftime codes.","str","strftime(format)"),$e("isoformat","","As ISO 8601 text.","str"),$e("hour",void 0,"The hour, 0 to 23.","int"),$e("minute",void 0,"The minute.","int"),$e("second",void 0,"The second.","int")],timedelta:[$e("days",void 0,"Whole days.","int"),$e("seconds",void 0,"Seconds past the whole days.","int"),$e("total_seconds","","The whole duration in seconds.")],str:[$e("upper","","In upper case.","str"),$e("lower","","In lower case.","str"),$e("strip","","Without leading and trailing whitespace (or these characters).","str","strip(chars=None)"),$e("lstrip","","Without leading whitespace.","str","lstrip(chars=None)"),$e("rstrip","","Without trailing whitespace.","str","rstrip(chars=None)"),$e("split","","Split into a list, at whitespace or a separator.","list","split(sep=None, maxsplit=-1)"),$e("rsplit","","Split from the right.","list","rsplit(sep=None, maxsplit=-1)"),$e("splitlines","","Split into lines.","list"),$e("replace","'', ''","Each occurrence replaced.","str","replace(old, new, count=-1)"),$e("startswith","''","Starts with the text.","bool","startswith(prefix)"),$e("endswith","''","Ends with the text.","bool","endswith(suffix)"),$e("find","''","Where the text first is, or -1.","int","find(sub)"),$e("count","''","How many times the text occurs.","int","count(sub)"),$e("join","","The items joined with this text.","str","join(items)"),$e("format","","With {} placeholders filled.","str","format(*args, **kwargs)"),$e("capitalize","","The first letter in upper case.","str"),$e("title","","Each word capitalized.","str"),$e("zfill","","Padded with zeros to a width.","str","zfill(width)"),$e("ljust","","Padded on the right to a width.","str","ljust(width)"),$e("rjust","","Padded on the left to a width.","str","rjust(width)"),$e("isdigit","","Only digits.","bool")],list:[$e("index","","Where the item first is.","int","index(item)"),$e("count","","How many times the item occurs.","int","count(item)")],dict:[$e("keys","","The keys.","list"),$e("values","","The values.","list"),$e("items","","The (key, value) pairs.","list"),$e("get","''","The value of a key, or a default.",void 0,"get(key, default=None)")],int:[],bool:[],loop:[$e("index",void 0,"The iteration, from 1.","int"),$e("index0",void 0,"The iteration, from 0.","int"),$e("revindex",void 0,"Iterations left, to 1.","int"),$e("revindex0",void 0,"Iterations left, to 0.","int"),$e("first",void 0,"The first iteration.","bool"),$e("last",void 0,"The last iteration.","bool"),$e("length",void 0,"How many items.","int"),$e("previtem",void 0,"The previous item."),$e("nextitem",void 0,"The next item."),$e("cycle","","One of the values in turn.",void 0,"cycle(*values)")]},Hy=Object.fromEntries(Ch.flatMap(e=>e.returns?[[e.name,e.returns]]:[])),x$={stdout:"str",stderr:"str",msg:"str",stdout_lines:"list",stderr_lines:"list",results:"list",rc:"int",changed:"bool",failed:"bool",json:"dict"},w$=[{code:"%Y",doc:"Year, 4 digits"},{code:"%y",doc:"Year, 2 digits"},{code:"%m",doc:"Month, 01 to 12"},{code:"%d",doc:"Day of the month, 01 to 31"},{code:"%H",doc:"Hour, 00 to 23"},{code:"%I",doc:"Hour, 01 to 12"},{code:"%p",doc:"AM or PM"},{code:"%M",doc:"Minute, 00 to 59"},{code:"%S",doc:"Second, 00 to 59"},{code:"%f",doc:"Microsecond, 6 digits"},{code:"%a",doc:"Weekday, short name"},{code:"%A",doc:"Weekday, full name"},{code:"%w",doc:"Weekday, Sunday 0 to Saturday 6"},{code:"%u",doc:"Weekday, Monday 1 to Sunday 7"},{code:"%b",doc:"Month, short name"},{code:"%B",doc:"Month, full name"},{code:"%j",doc:"Day of the year, 001 to 366"},{code:"%U",doc:"Week of the year, weeks start on Sunday"},{code:"%W",doc:"Week of the year, weeks start on Monday"},{code:"%V",doc:"ISO week, 01 to 53"},{code:"%G",doc:"ISO year (with %V)"},{code:"%z",doc:"UTC offset; empty for a date without a time zone"},{code:"%Z",doc:"Time zone name; empty for a date without a time zone"},{code:"%s",doc:"Seconds since 1970 (Linux)"},{code:"%c",doc:"Date and time, locale style"},{code:"%x",doc:"Date, locale style"},{code:"%X",doc:"Time, locale style"},{code:"%%",doc:"A % sign"}],k$=[{format:"%Y-%m-%d %H:%M:%S",doc:"Date and time"},{format:"%Y%m%d_%H%M%S",doc:"A stamp for file names"},{format:"%Y-%m-%d",doc:"Date"},{format:"%H:%M:%S",doc:"Time"},{format:"%Y-%m-%dT%H:%M:%S",doc:"ISO 8601 date and time"},{format:"%Y%m%d",doc:"Compact date"},{format:"%d %b %Y",doc:"Day, month name, year"},{format:"%s",doc:"Seconds since 1970 (Linux)"}],S$=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],N$=["January","February","March","April","May","June","July","August","September","October","November","December"];function nu(e,t,n=!1){let r={Y:n?t.getUTCFullYear():t.getFullYear(),m:(n?t.getUTCMonth():t.getMonth())+1,d:n?t.getUTCDate():t.getDate(),H:n?t.getUTCHours():t.getHours(),M:n?t.getUTCMinutes():t.getMinutes(),S:n?t.getUTCSeconds():t.getSeconds(),ms:n?t.getUTCMilliseconds():t.getMilliseconds(),w:n?t.getUTCDay():t.getDay()},a=(m,b=2)=>String(m).padStart(b,"0"),s=Date.UTC(r.Y,0,1),l=Date.UTC(r.Y,r.m-1,r.d),f=Math.round((l-s)/864e5)+1,p=m=>Math.floor((f-1+7-(r.w-m+7)%7)/7),h=()=>{let m=new Date(l),b=(r.w+6)%7;m.setUTCDate(m.getUTCDate()-b+3);let w=m.getUTCFullYear(),k=new Date(Date.UTC(w,0,4));return{year:w,week:1+Math.round(((m.getTime()-k.getTime())/864e5-3+(k.getUTCDay()+6)%7)/7)}},v=r.H%12==0?12:r.H%12,g=m=>{switch(m){case"Y":return String(r.Y);case"y":return a(r.Y%100);case"m":return a(r.m);case"d":return a(r.d);case"e":return String(r.d).padStart(2," ");case"H":return a(r.H);case"I":return a(v);case"p":return r.H<12?"AM":"PM";case"M":return a(r.M);case"S":return a(r.S);case"f":return a(r.ms*1e3,6);case"a":return(S$[r.w]??"").slice(0,3);case"A":return S$[r.w]??"";case"w":return String(r.w);case"u":return String(r.w===0?7:r.w);case"b":case"h":return(N$[r.m-1]??"").slice(0,3);case"B":return N$[r.m-1]??"";case"j":return a(f,3);case"U":return a(p(0));case"W":return a(p(1));case"V":return a(h().week);case"G":return String(h().year);case"z":case"Z":return"";case"s":return String(Math.floor(t.getTime()/1e3));case"c":return`${g("a")} ${g("b")} ${String(r.d).padStart(2," ")} ${g("H")}:${g("M")}:${g("S")} ${r.Y}`;case"x":return`${g("m")}/${g("d")}/${g("y")}`;case"X":return`${g("H")}:${g("M")}:${g("S")}`;case"D":return`${g("m")}/${g("d")}/${g("y")}`;case"F":return`${r.Y}-${g("m")}-${g("d")}`;case"T":return`${g("H")}:${g("M")}:${g("S")}`;case"%":return"%";default:return}};return e.replace(/%([-_0^#]?)([A-Za-z%])/g,(m,b,w)=>{let k=g(w);return k===void 0?m:(b==="-"?k=k.replace(/^[0 ]+(?=.)/,""):b==="_"?k=k.replace(/^0+(?=.)/,S=>" ".repeat(S.length)):b==="^"&&(k=k.toUpperCase()),k)})}var YB=new Set(["var","func","method","attr","filter","test","kwarg","keyword","constant"]),j$=60;function Si(e,t,n){let r=t.toLowerCase();if(!r)return e.slice(0,j$);let a=s=>{let l=n(s).toLowerCase();return l===r?0:l.startsWith(r)?1:l.split(".").at(-1)?.startsWith(r)?2:l.includes(r)?3:-1};return e.map((s,l)=>({t:s,i:l,r:a(s)})).filter(s=>s.r>=0).sort((s,l)=>s.r-l.r||s.i-l.i).slice(0,j$).map(s=>s.t)}var Ko=(e,t,n)=>({label:e.insert&&(t==="function"||t==="method")?e.insert:e.name,insert:e.insert??e.name,...e.caret===void 0?{}:{caret:e.caret},kind:t,...n?{detail:n}:{},doc:e.doc,...e.sig?{sig:e.sig}:{},...e.again?{again:!0}:{}});function sl(e,t=[]){let n=[...e],r=new Set(e.map(a=>a.name));for(let a of t)r.has(a.name)||(r.add(a.name),n.push({name:a.name,doc:a.doc??a.fqcn}));return n}function Wo(e,t){for(let n=t-1;n>=0;n--){let r=e[n];if(r.kind)return{t:r,i:n};if(r.text.trim())return}}function XB(e,t){let n={")":"(","]":"[","}":"{"}[e[t]?.text??""],r=0;for(let a=t;a>=0;a--){let s=e[a];if(s.kind==="punct"){if(s.text===e[t]?.text)r++;else if(s.text===n&&--r===0)return a}}return-1}function Vy(e,t,n){let r=e[t];if(!r)return{};if(r.kind==="string")return{type:"str"};if(r.text===")"){let a=XB(e,t),s=a>0?Wo(e,a):void 0,l=e.slice(a+1,t);if(s&&s.t.start+s.t.text.length===e[a]?.start){let p=s.t.text;if(s.t.kind==="func"&&p==="now")return{type:l.some(h=>h.kind==="kwarg"&&h.text==="fmt")?"str":"datetime"};if(s.t.kind==="func")return{type:eu.find(h=>h.name===p)?.returns};if(s.t.kind==="filter")return{type:Hy[p]};if(s.t.kind==="method"){let h=Wo(e,s.i),v=h?.t.text==="."?Wo(e,h.i):void 0,g=v?Vy(e,v.i,n).type:void 0;return{type:g?tu[g].find(m=>m.name===p)?.returns:void 0}}}let f=0;for(let p=t-1;p>a;p--){let h=e[p];if(h.text===")"||h.text==="]")f++;else if(h.text==="("||h.text==="[")f--;else if(f===0&&h.kind==="filter")return{type:Hy[h.text]}}return{}}if(r.kind==="filter")return{type:Hy[r.text]};if(r.kind==="var"){let a=n.vars.find(s=>s.name===r.text);return a?{choice:a}:r.text==="loop"?{type:"loop"}:{type:By.find(s=>s.name===r.text)?.returns}}if(r.kind==="attr"){let a=Wo(e,e.indexOf(r)),s=a?.t.text==="."?Wo(e,a.i):void 0;if(s?.t.kind==="var"&&n.vars.some(l=>l.name===s.t.text&&l.fields))return{type:x$[r.text]};if(s){let l=Vy(e,s.i,n).type;if(l)return{type:tu[l].find(f=>f.name===r.text)?.returns}}}return{}}function ZB(e,t,n,r){let a=t?k$.map(l=>({label:l.format,insert:l.format,kind:"format",detail:l.doc,doc:`${l.doc}: ${l.format}`,preview:nu(l.format,n,r)})):[],s=w$.filter(l=>!e||l.code.startsWith(e)).map(l=>({label:l.code,insert:l.code,kind:"format",detail:l.doc,doc:l.doc,preview:nu(l.code,n,r),again:!0}));return[...a,...s]}function Ky(e){let t=e.map(n=>n.text).join("");return/now\(\s*utc\s*=\s*(true|True)\s*\)\s*\.\s*strftime\(\s*['"][^'"]*$/.test(t)}function GB(e,t){if(t==="func")return eu.find(n=>n.name===e&&n.sig);if(t==="filter")return Ch.find(n=>n.name===e);if(t==="test")return qy.find(n=>n.name===e);if(t==="method")for(let n of Object.values(tu)){let r=n.find(a=>a.name===e&&a.sig);if(r)return r}}function Wy(e,t,n,r={}){let{tokens:a,end:s}=al(e.slice(0,t),n);if(s.where!=="expr"&&s.where!=="stmt")return;let l=[...s.stack].reverse().find(h=>h.open==="("&&h.callee);if(!l?.callee)return;let f=GB(l.callee,l.calleeKind);if(!f?.sig)return;let p={label:f.sig,doc:f.doc,arg:l.arg};return(l.callee==="strftime"&&l.calleeKind==="method"||l.callee==="now"&&l.kwarg==="fmt"||l.callee==="to_datetime"&&l.calleeKind==="filter")&&s.string&&(p.preview=nu(e.slice(s.string.start+1,t)+(/^[^'"]*/.exec(e.slice(t))?.[0]??""),r.now??new Date,Ky(a))),p}function C$(e,t,n,r){let a=e.slice(0,t),{tokens:s,end:l}=al(a,n);if(l.where!=="expr"&&l.where!=="stmt")return;let f=r.now??new Date,p=Wy(e,t,n,r),h=/^[A-Za-z0-9_]*/.exec(e.slice(t))?.[0]??"";if(l.string){let j=l.stack[l.stack.length-1],$=a.slice(l.string.start+1);if(j&&(j.callee==="strftime"&&j.calleeKind==="method"&&j.arg===0||j.callee==="now"&&j.kwarg==="fmt"||j.callee==="to_datetime"&&j.calleeKind==="filter"&&j.arg===0)){let L=/%[-_0^#]?[A-Za-z]?$/.exec($)?.[0]??"",z=ZB(L,$==="",f,Ky(s));return z.length?{from:t-L.length,to:t,items:z,context:"format",...p?{hint:p}:{}}:void 0}if(j&&j.calleeKind==="func"&&["lookup","query","q"].includes(j.callee??"")&&j.arg===0){let L=Si(sl(b$,r.lookups),$,z=>z.name).map(z=>Ko({...z,insert:z.name},"lookup"));return L.length?{from:l.string.start+1,to:t+h.length,items:L,context:"lookup",...p?{hint:p}:{}}:void 0}return}let v=s[s.length-1],g=v?.kind&&YB.has(v.kind)&&v.start+v.text.length===t?v:void 0,m=g?.text??"",b=g?g.start:t,w=t+h.length,k=Wo(s,g?s.length-1:s.length),S=(j,$)=>j.length?{from:b,to:w,items:j,context:$,...p?{hint:p}:{}}:void 0;if(l.where==="stmt"&&(!l.stmtWord||g&&k?.t.kind==="delim"))return S(Si(UB,m,j=>j.name).map(j=>Ko(j,"keyword")),"statement");if(k?.t.text==="|")return S(Si(sl(Ch,r.filters),m,j=>j.name).map(j=>Ko(j,"filter")),"filter");if(k?.t.kind==="keyword"&&k.t.text==="is"||k?.t.kind==="keyword"&&k.t.text==="not"&&Wo(s,k.i)?.t.text==="is")return S(Si(sl(qy,r.tests),m,j=>j.name).map(j=>Ko(j,"test")),"test");if(k?.t.text==="."){let j=Wo(s,k.i);if(!j)return;let{type:$,choice:L}=Vy(s,j.i,r);if(L?.fields)return S(Si(L.fields,m,M=>M.name).map(M=>({label:M.name,insert:M.name,kind:"field",detail:x$[M.name],doc:M.detail})),"member");if(!$)return;let z=[],A=/utc\s*=\s*(true|True)/.test(s.slice(Math.max(0,j.i-8),j.i+1).map(M=>M.text).join(""));for(let M of Si(tu[$],m,O=>O.name)){if(M.name==="strftime")for(let O of k$)z.push({label:`strftime('${O.format}')`,insert:`strftime('${O.format}')`,kind:"method",detail:O.doc,doc:M.doc,sig:M.sig,preview:nu(O.format,f,A)});z.push(Ko(M,M.insert?"method":"field",M.returns))}return S(z,"member")}if(k&&(k.t.kind==="var"||k.t.kind==="attr"||k.t.kind==="string"||k.t.kind==="number"||k.t.kind==="constant"||k.t.kind==="filter"||k.t.kind==="test"||k.t.text===")"||k.t.text==="]"))return m?S(Si(v$,m,j=>j.name).map(j=>Ko(j,"keyword")),"operator"):void 0;let N=[...r.vars.map(j=>({label:j.name,insert:j.name,kind:"variable",detail:j.label===j.name?j.detail:j.label,doc:j.detail,...j.field?{choice:j}:{}})),...By.map(j=>Ko(j,"variable")),...eu.map(j=>Ko(j,"function",j.returns)),...WB.map(j=>Ko(j,"keyword")),Ko(v$[2],"keyword")],E=new Set;return S(Si(N.filter(j=>!E.has(j.insert)&&E.add(j.insert)),m,j=>j.insert).map(j=>j),"value")}function Uy(e,t,n,r){let{tokens:a}=al(e,n),s=a.findIndex(p=>p.start<=t&&t<p.start+p.text.length),l=a[s];if(!l?.kind)return;let f=p=>p?{label:p.sig??p.name,doc:p.doc}:void 0;switch(l.kind){case"func":return f(eu.find(p=>p.name===l.text&&p.sig)??eu.find(p=>p.name===l.text));case"method":case"attr":for(let p of Object.values(tu)){let h=p.find(v=>v.name===l.text);if(h)return f(h)}return;case"filter":return f(sl(Ch,r.filters).find(p=>p.name===l.text));case"test":return f(sl(qy,r.tests).find(p=>p.name===l.text));case"var":{let p=r.vars.find(h=>h.name===l.text);return p?{label:p.name,doc:p.detail}:f(By.find(h=>h.name===l.text))}case"format":{let p=w$.find(h=>h.code===l.text.replace(/^%[-_0^#]/,"%"));return p?{label:l.text,doc:p.doc,preview:nu(l.text,r.now??new Date,Ky(a.slice(0,s)))}:void 0}case"string":{let p=Wo(a,s),h=p?.t.text==="("?Wo(a,p.i):void 0;if(h?.t.kind==="func"&&["lookup","query","q"].includes(h.t.text)){let v=l.text.replace(/^['"]|['"]$/g,"");return f(sl(b$,r.lookups).find(g=>g.name===v))}return}default:return}}var E$=4;function $$(e,t,n,r){let a=Math.max(E$,Math.min(e.left,r.width-E$-n.width)),s=!(e.bottom+2+n.height<=r.height)&&e.top-2-n.height>=0;return{left:a-t.left,top:s?e.top-t.top-2-n.height:e.bottom-t.top+2,above:s}}var QB=e=>`{{ ${e} }}`;function ou(e){let t=[],n=0,r=a=>{for(let s of a.childNodes)if(s instanceof HTMLElement&&s.dataset.ref){let l=QB(s.dataset.ref).length;t.push({node:s,start:n,end:n+l,chip:s}),n+=l}else if(s.nodeType===Node.TEXT_NODE){let l=(s.textContent??"").length;t.push({node:s,start:n,end:n+l}),n+=l}else s instanceof HTMLElement&&s.tagName!=="BR"&&r(s)};return r(e),t}function ru(e){return n4(ou(e).map(t=>t.chip?{ref:t.chip.dataset.ref??"",raw:""}:{text:(t.node.textContent??"").replaceAll(`
|
|
175
|
+
`," ")}))}function Yy(e,t,n,r=ou(e)){let a=r.find(f=>f.chip&&(f.chip===t||f.chip.contains(t)));if(a)return a.end;if(t.nodeType===Node.TEXT_NODE){let f=r.find(p=>p.node===t);if(f)return f.start+Math.min(n,f.end-f.start)}let s=[...t.childNodes];for(let f of s.slice(n)){let p=r.find(h=>h.node===f||f.contains(h.node));if(p)return p.start}let l=0;for(let f of r){let p=t.compareDocumentPosition(f.node);(t.contains(f.node)||p&Node.DOCUMENT_POSITION_PRECEDING)&&(l=f.end)}return l}function _$(e){let t=window.getSelection(),n=t?.focusNode;if(t&&n&&e.contains(n))return Yy(e,n,t.focusOffset)}function Xy(e,t,n=ou(e)){let r=n.find(s=>!s.chip&&s.start<=t&&t<=s.end);if(r)return[r.node,t-r.start];let a=n.find(s=>s.chip&&s.start<=t&&t<=s.end);if(a?.chip){let s=a.chip.parentNode,l=[...s.childNodes].indexOf(a.chip);return[s,t<=a.start?l:l+1]}return[e,t<=0?0:e.childNodes.length]}function JB(e,t,n){let r=ou(e),a=document.createRange();return a.setStart(...Xy(e,t,r)),a.setEnd(...Xy(e,n,r)),a}function e9(e,t){let n=document.createRange();n.setStart(...Xy(e,t)),n.collapse(!0);let r=window.getSelection();r?.removeAllRanges(),r?.addRange(n)}function t9(e,t,n,r,a=r.length){let s=JB(e,t,n),l=window.getSelection();if(l?.removeAllRanges(),l?.addRange(s),!(typeof document.execCommand=="function"&&document.execCommand("insertText",!1,r))){s.deleteContents();let f=document.createTextNode(r);s.insertNode(f),e.normalize()}e9(e,t+a)}function n9(){let e=window.getSelection();if(!e||e.rangeCount===0)return;let t=e.getRangeAt(0);if(typeof t.getBoundingClientRect!="function")return;let n=t.getBoundingClientRect();return n.height>0?n:t.getClientRects?.()[0]}var o9={variable:"symbol-variable",function:"symbol-method",method:"symbol-method",field:"symbol-field",filter:"filter",test:"beaker",lookup:"search",keyword:"symbol-keyword",format:"calendar"},r9={value:"Variables and functions",filter:"Filters",test:"Tests",member:"Members",format:"Date formats",lookup:"Lookups",statement:"Statements",operator:"Operators"};function T$(e){return{vars:e,...Z6()}}function i9(e,t){let n=e.indexOf("("),r=e.lastIndexOf(")");if(n<0||r<n)return e;let a=e.slice(n+1,r).split(/,\s*/);return(0,c.jsxs)(c.Fragment,{children:[e.slice(0,n+1),a.map((s,l)=>(0,c.jsxs)(T.Fragment,{children:[l>0?", ":"",l===t?(0,c.jsx)("strong",{children:s}):s]},l)),e.slice(r)]})}var A$=(0,T.forwardRef)(function({id:e,completion:t,active:n,onPick:r,style:a},s){let l=t.items[n];return(0,c.jsxs)("div",{ref:s,className:"afd-jinja-popup",style:a,"data-jinja-context":t.context,children:[(0,c.jsx)("div",{className:"afd-ref-menu afd-jinja-menu",role:"listbox",id:e,"aria-label":r9[t.context],children:t.items.map((f,p)=>(0,c.jsxs)("div",{id:`${e}-${p}`,role:"option",tabIndex:-1,"aria-selected":p===n,className:p===n?"active":"",onMouseDown:h=>{h.preventDefault(),r(f)},children:[(0,c.jsx)("span",{className:`codicon codicon-${o9[f.kind]}`,"aria-hidden":"true"}),(0,c.jsx)("span",{className:"mono afd-jinja-label",children:f.label}),f.preview===void 0?f.detail?(0,c.jsx)("span",{className:"muted",children:f.detail}):null:(0,c.jsxs)("span",{className:"mono afd-jinja-preview",children:["\u2192 ",f.preview||"(empty)"]})]},`${f.label}|${p}`))}),l&&(l.sig||l.doc)?(0,c.jsxs)("div",{className:"afd-jinja-doc","aria-live":"polite",children:[l.sig?(0,c.jsx)("div",{className:"mono",children:l.sig}):null,l.doc?(0,c.jsx)("div",{className:"muted",children:l.doc}):null]}):null]})});function M$({hint:e}){return(0,c.jsxs)("div",{className:"afd-jinja-hint","data-jinja-hint":!0,children:[(0,c.jsx)("span",{className:"mono",children:i9(e.label,e.arg)}),e.preview===void 0?null:(0,c.jsxs)("span",{className:"mono afd-jinja-preview",children:[" \u2192 ",e.preview||"(empty)"]}),e.doc?(0,c.jsxs)("span",{className:"muted",children:[" ",e.doc]}):null]})}function O$({tip:e,style:t}){return(0,c.jsxs)("div",{className:"afd-jinja-tip",role:"tooltip",style:t,children:[(0,c.jsx)("div",{className:"mono",children:e.label}),e.doc?(0,c.jsx)("div",{className:"muted",children:e.doc}):null,e.preview===void 0?null:(0,c.jsxs)("div",{className:"mono afd-jinja-preview",children:["\u2192 ",e.preview||"(empty)"]})]})}function P$(e,t,n){if(e.nativeEvent.isComposing||e.keyCode===229)return!1;let r=()=>{e.preventDefault(),e.stopPropagation()};if(e.key===" "&&e.ctrlKey&&!e.altKey&&!e.metaKey)return r(),n.force(),!0;if(!t||t.count===0)return!1;if(e.key==="ArrowDown"||e.key==="ArrowUp"){r();let a=e.key==="ArrowDown"?1:t.count-1;return n.move((t.active+a)%t.count),!0}return(e.key==="Enter"||e.key==="Tab")&&!e.shiftKey&&!e.ctrlKey&&!e.altKey?(r(),n.pick(),!0):e.key==="Escape"&&(r(),n.close(),!0)}function D$(e,t){let n=e?.slice(-1);return!n||!t?!1:/[A-Za-z0-9_.|'"%({]/.test(n)?!0:n===" "&&(t.context==="test"||t.context==="filter")}function L$(e,t,n,r){let a=n.caret??n.insert.length,s=e.slice(t.to).split("{{")[0]??"",l=/\{\{(?![\s\S]*\}\})[\s\S]*$/.test(e.slice(0,t.from));return r&&l&&!s.includes("}}")&&t.context!=="format"&&t.context!=="lookup"?{text:`${n.insert} }}`,caret:a}:{text:n.insert,caret:a}}var I$=()=>typeof CSS<"u"&&"highlights"in CSS?CSS.highlights:void 0,R$=()=>globalThis.Highlight,z$=()=>!!I$()&&!!R$(),Zy=new Map,Gy=new Map;function a9(e){let t=Zy.get(e),n=R$(),r=I$();return!t&&n&&r&&(t=new n,Zy.set(e,t),r.set(`afd-syn-${e}`,t)),t}function s9(e,t){if(z$()){F$(e);for(let n of t)a9(n.colour)?.add(n.range);Gy.set(e,t)}}function F$(e){for(let t of Gy.get(e)??[])Zy.get(t.colour)?.delete(t.range);Gy.delete(e)}function Qy(e){let t=document.createElement("span");return t.className="afd-ref-chip",t.contentEditable="false",t.dataset.ref=e,t.textContent=e,t}function l9(e,t,n){n==="expr"?e.replaceChildren(...t?[document.createTextNode(t)]:[]):e.replaceChildren(...t4(t).map(r=>"ref"in r?Qy(r.ref):document.createTextNode(r.text)))}function B$(e,t,n,r){if(!z$())return;let a=ou(t).filter(l=>!l.chip&&l.end>l.start),s=[];for(let l of KB(n,{mode:Jd(n,r==="expr")}))for(let f of a){let p=Math.max(l.start,f.start),h=Math.min(l.end,f.end);if(p>=h)continue;let v=document.createRange();v.setStart(f.node,p-f.start),v.setEnd(f.node,h-f.start),s.push({colour:l.colour,range:v})}s9(e,s)}function d9(e,t){let n=window.getSelection(),r=n&&n.rangeCount>0&&e.contains(n.getRangeAt(0).commonAncestorContainer)?n.getRangeAt(0):void 0,a=document.createTextNode(t);r?(r.deleteContents(),r.insertNode(a)):e.append(a);let s=document.createRange();s.setStartAfter(a),s.collapse(!0),n?.removeAllRanges(),n?.addRange(s)}function u9(e){let t=window.getSelection();if(!t||t.rangeCount===0)return;let n=t.getRangeAt(0);return e.contains(n.startContainer)&&e.contains(n.endContainer)?n.cloneRange():void 0}function q$(e){let t=document.createRange();t.setStartAfter(e),t.collapse(!0);let n=window.getSelection();n?.removeAllRanges(),n?.addRange(t)}function Jy(e){let t=window.getSelection(),n=t?.anchorNode;if(!t||!n||n.nodeType!==Node.TEXT_NODE||!e.contains(n))return;let r=(n.textContent??"").slice(0,t.anchorOffset),a=/@([A-Za-z0-9_.]*)$/.exec(r);return a?{node:n,start:r.length-a[0].length,query:a[1]??""}:void 0}function H$(e){let t=window.getSelection(),n=t?.anchorNode;if(!t||!n||n.nodeType!==Node.TEXT_NODE||!e.contains(n))return;let r=n.previousSibling;for(;r instanceof Text&&!r.textContent;)r=r.previousSibling;if(!(r instanceof HTMLElement)||!r.dataset.ref)return;let a=/^\.([A-Za-z0-9_]*)$/.exec((n.textContent??"").slice(0,t.anchorOffset));return a?{chip:r,node:n,query:a[1]??""}:void 0}function V$(e,t,n){let r=t.node.splitText(t.start);r.textContent=(r.textContent??"").slice(1+t.query.length),e.insertBefore(n,r),r.textContent||r.remove()}var ev=(e,t)=>e.toLowerCase().includes(t.toLowerCase());function iu({id:e,value:t,onChange:n,choices:r,onAddInput:a,placeholder:s,label:l,onEnter:f,onEscape:p,onLeave:h,mode:v="template"}){let g=(0,T.useRef)(null),m=(0,T.useRef)(null),b=(0,T.useRef)(null),[w,k]=(0,T.useState)(null),S=(0,T.useRef)(void 0),[N,E]=(0,T.useState)(null),[j,$]=(0,T.useState)(null),[L,z]=(0,T.useState)(null),A=(0,T.useRef)(!1),M=(0,T.useRef)(null),O=(0,T.useRef)(null),K=(0,T.useRef)(void 0),B=(0,T.useId)(),V=T$(r),oe=Z=>({mode:Jd(Z,v==="expr")});(0,T.useLayoutEffect)(()=>{let Z=g.current;Z&&t!==b.current&&(l9(Z,t,v),B$(g,Z,t,v)),b.current=t},[t,v]),(0,T.useEffect)(()=>()=>F$(g),[]);let F=()=>{let Z=g.current;if(!Z)return;let q=ru(Z);b.current=q,B$(g,Z,q,v),q!==t&&n(q)},J=w?.kind==="refs"?r.filter(Z=>ev(Z.name,w.query)||ev(Z.label,w.query)):[],I=w?.kind==="fields"?(w.of.fields??[]).filter(Z=>ev(Z.name,w.query)):[],U=w?.kind==="fields"?I.length:J.length,W=(Z,q,ee,de)=>k({kind:"fields",of:Z,query:q,active:0,chip:ee,typed:de}),re=(Z,q)=>{if(v==="expr")return!0;let ee=q?Yy(Z,q.node,q.start):_$(Z);if(ee===void 0)return!1;let de=al(ru(Z).slice(0,ee),{mode:"template"}).end.where;return de==="expr"||de==="stmt"},le=Z=>{let q=g.current;if(!q)return;let ee=w?.kind==="refs"&&w.caret?Jy(q):void 0,de=re(q,ee)?document.createTextNode(Z.name):Qy(Z.name),me=!ee&&S.current&&q.contains(S.current.startContainer)?S.current:void 0;ee?V$(q,ee,de):me?(me.deleteContents(),me.insertNode(de)):q.append(de),S.current=void 0,Z.field&&a(Z),Z.fields&&de instanceof HTMLElement?W(Z,"",de,!1):k(null),F(),q.focus(),q$(de)},pe=Z=>{let q=g.current;if(!q||w?.kind!=="fields")return;let ee=`${w.of.name}.${Z.name}`,de=w.chip&&q.contains(w.chip)?w.chip:void 0;if(de){let me=H$(q);me&&me.chip===de&&(me.node.textContent=(me.node.textContent??"").slice(1+me.query.length),me.node.textContent||me.node.remove()),de.dataset.ref=ee,de.textContent=ee}else{let me=Jy(q);de=re(q,me)?document.createTextNode(ee):Qy(ee),me?V$(q,me,de):q.append(de),w.of.field&&a(w.of)}k(null),F(),q.focus(),q$(de)},xe=()=>{if(w)if(w.kind==="fields"){let Z=I[w.active];Z&&pe(Z)}else{let Z=J[w.active];Z&&le(Z)}};(0,T.useEffect)(()=>{w&&U>0&&w.active>=U&&k({...w,active:0})},[w,U]),(0,T.useEffect)(()=>{w&&m.current?.querySelector('[aria-selected="true"]')?.scrollIntoView?.({block:"nearest"})},[w]);let Ne=Z=>{let q=g.current,ee=q?_$(q):void 0;if(!q||ee===void 0){E(null),$(null);return}let de=ru(q),me=C$(de,ee,oe(de),{...V,now:new Date}),De=typeof Z=="function"?Z(me):Z;E(Fe=>me&&me.items.length>0&&(De||Fe)?{c:me,active:Fe&&Fe.c.from===me.from&&Fe.c.context===me.context?Math.min(Fe.active,me.items.length-1):0}:null),$(Wy(de,ee,oe(de),{now:new Date})??null)},we=Z=>{let q=g.current;if(!q||!N)return;let ee=ru(q),{text:de,caret:me}=L$(ee,N.c,Z,oe(ee).mode==="template");A.current=!0;try{t9(q,N.c.from,N.c.to,de,me)}finally{A.current=!1}Z.choice&&a(Z.choice),F(),q.focus(),E(null),Ne(!!Z.again)},R=Z=>{if(z(null),w||!P$(Z,N?{count:N.c.items.length,active:N.active}:null,{move:q=>E(ee=>ee&&{...ee,active:q}),pick:()=>{let q=N?.c.items[N.active];q&&we(q)},close:()=>E(null),force:()=>Ne(!0)})){if(w&&U>0){if(Z.key==="ArrowDown"||Z.key==="ArrowUp"){Z.preventDefault();let q=Z.key==="ArrowDown"?1:U-1;k({...w,active:(w.active+q)%U});return}if(Z.key==="Enter"||Z.key==="Tab"){Z.preventDefault(),xe();return}}Z.key==="Escape"&&w?(Z.preventDefault(),Z.stopPropagation(),k(null)):Z.key==="Escape"&&p?(Z.preventDefault(),Z.stopPropagation(),p()):Z.key==="Enter"&&(Z.preventDefault(),f?.())}},Q=Z=>{if(F(),A.current)return;let q=g.current;if(!q)return;z(null);let ee=Jy(q);if(ee){E(null);let Ye=ee.query.lastIndexOf("."),Ie=Ye>0?ee.query.slice(0,Ye):"",Be=Ie?r.find(ut=>ut.fields&&(ut.name===Ie||ut.label===Ie)):void 0;Be?W(Be,ee.query.slice(Ye+1),void 0,!0):k({kind:"refs",query:ee.query,active:0,caret:!0});return}let de=H$(q),me=de?r.find(Ye=>Ye.fields&&Ye.name===de.chip.dataset.ref):void 0;if(de&&me){W(me,de.query,de.chip,!0),E(null);return}k(null);let De=Z?.nativeEvent,Fe=De?.inputType?.startsWith("insert")?De.data:null;Ne(Ye=>D$(Fe,Ye))},fe=()=>Ne(!1);(0,T.useLayoutEffect)(()=>{let Z=M.current,q=O.current;if(!N||!Z||!q)return;let ee=q.getBoundingClientRect(),de=$$(n9()??{left:ee.left,top:ee.top,bottom:ee.bottom},{left:0,top:0},{width:Z.offsetWidth,height:Z.offsetHeight},{width:window.innerWidth,height:window.innerHeight});Z.style.left=`${de.left}px`,Z.style.top=`${de.top}px`},[N]),(0,T.useEffect)(()=>{N&&M.current?.querySelector('[aria-selected="true"]')?.scrollIntoView?.({block:"nearest"})},[N]);let X=(Z,q)=>{clearTimeout(K.current),K.current=setTimeout(()=>{let ee=g.current,de=O.current,me=document.caretRangeFromPoint?.(Z,q);if(!ee||!de||!me||!ee.contains(me.startContainer)||N){z(null);return}let De=ru(ee),Fe=Yy(ee,me.startContainer,me.startOffset),Ye=new Date,Ie=Uy(De,Fe,oe(De),{...V,now:Ye})??(Fe>0?Uy(De,Fe-1,oe(De),{...V,now:Ye}):void 0);z(Ie?{d:Ie,left:Z,top:q+16}:null)},300)};(0,T.useEffect)(()=>()=>clearTimeout(K.current),[]);let he=(Z,q,ee,de)=>(0,c.jsx)("div",{role:"option",tabIndex:-1,"aria-selected":q===w?.active,className:q===w?.active?"active":"",onMouseDown:me=>{me.preventDefault(),ee()},children:de},Z);return(0,c.jsxs)("div",{className:"afd-chipfield",ref:O,children:[(0,c.jsx)("div",{ref:g,id:e,className:`afd-input afd-chipfield-input${v==="expr"?" mono":""}`,contentEditable:!0,suppressContentEditableWarning:!0,role:"textbox",tabIndex:0,"aria-label":l,"aria-autocomplete":"list",spellCheck:!1,"aria-controls":N?B:void 0,"aria-activedescendant":N?`${B}-${N.active}`:void 0,"data-placeholder":s,onInput:Q,onKeyDown:R,onKeyUp:Z=>{["ArrowLeft","ArrowRight","Home","End"].includes(Z.key)&&fe()},onMouseUp:fe,onMouseMove:Z=>X(Z.clientX,Z.clientY),onMouseLeave:()=>{clearTimeout(K.current),z(null)},onBlur:()=>{setTimeout(()=>k(null),150),E(null),$(null),z(null),h?.()},onPaste:Z=>{Z.preventDefault();let q=Z.clipboardData.getData("text/plain").replaceAll("\r","");q&&(d9(Z.currentTarget,q),Q())}}),(0,c.jsx)("button",{type:"button",className:"icon afd-chipfield-at",title:"Insert an input (@)","aria-label":`Insert an input into ${l??"the value"}`,onMouseDown:Z=>{Z.preventDefault(),S.current=g.current?u9(g.current):void 0},onClick:()=>k(w?null:{kind:"refs",query:"",active:0,caret:!1}),children:"@"}),w?.kind==="refs"?(0,c.jsx)("div",{ref:m,className:"afd-ref-menu",role:"listbox","aria-label":"Inputs",children:J.length===0?(0,c.jsx)("div",{className:"muted",children:"No inputs match. Add inputs on the Inputs and outputs tab."}):J.map((Z,q)=>he(`${Z.label}|${Z.name}`,q,()=>le(Z),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"afd-ref-chip",children:Z.name})," ",(0,c.jsx)("span",{className:"mono",children:Z.label===Z.name?"":Z.label})," ",(0,c.jsx)("span",{className:"muted",children:Z.detail})]})))}):null,N&&!w?(0,c.jsx)(A$,{ref:M,id:B,completion:N.c,active:N.active,onPick:we}):null,j&&!N&&!w?(0,c.jsx)(M$,{hint:j}):null,L&&!N?(0,c.jsx)(O$,{tip:L.d,style:{left:L.left,top:L.top}}):null,w?.kind==="fields"?(0,c.jsxs)("div",{ref:m,className:"afd-ref-menu",role:"listbox","aria-label":`Fields of ${w.of.name}`,"data-ref-fields":w.of.name,children:[(0,c.jsx)("p",{className:"afd-ref-menu-head muted",children:w.typed?`Fields of ${w.of.name}`:`Read one field of ${w.of.name}, or go on typing to keep the whole result`}),I.length===0?(0,c.jsx)("div",{className:"muted",children:"No documented field matches."}):I.map((Z,q)=>he(Z.name,q,()=>pe(Z),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"afd-ref-chip",children:`${w.of.name}.${Z.name}`})," ",(0,c.jsx)("span",{className:"muted",children:Z.detail})]})))]}):null]})}function c9({fields:e,onPick:t}){let n=(0,T.useId)(),[r,a]=(0,T.useState)(""),[s,l]=(0,T.useState)(!1),[f,p]=(0,T.useState)(0),h=s?q6(e,r):[],v=Math.min(f,Math.max(0,h.length-1)),g=`${n}-list`,m=w=>`${n}-opt-${w}`,b=w=>{w&&(a(""),l(!1),p(0),t(w.name))};return(0,c.jsxs)("div",{className:"afd-field afd-param-picker","data-param-picker":e.length,children:[(0,c.jsx)("label",{htmlFor:n,children:"Add a parameter"}),(0,c.jsxs)("div",{className:"afd-chipfield",children:[(0,c.jsx)("input",{id:n,className:"afd-input",role:"combobox","aria-expanded":s,"aria-controls":g,"aria-autocomplete":"list","aria-activedescendant":s&&h[v]?m(v):void 0,placeholder:`${e.length} more: a name or what it does`,value:r,autoComplete:"off",spellCheck:!1,onChange:w=>{a(w.target.value),l(!0),p(0)},onClick:()=>l(!0),onBlur:()=>setTimeout(()=>l(!1),150),onKeyDown:w=>{if(w.key==="ArrowDown"||w.key==="ArrowUp"){if(w.preventDefault(),!s)return l(!0);let k=h.length;k>0&&p((v+(w.key==="ArrowDown"?1:k-1))%k)}else w.key==="Enter"&&s?(w.preventDefault(),b(h[v])):w.key==="Escape"&&s&&(w.preventDefault(),w.stopPropagation(),l(!1))}}),s?(0,c.jsx)("div",{id:g,className:"afd-ref-menu afd-param-list",role:"listbox","aria-label":"Parameters",children:h.length===0?(0,c.jsxs)("div",{className:"muted",children:["No parameter matches \u201C",r.trim(),"\u201D."]}):h.map((w,k)=>(0,c.jsxs)("div",{id:m(k),role:"option",tabIndex:-1,"aria-selected":k===v,className:k===v?"active":"","data-param-option":w.name,onMouseDown:S=>{S.preventDefault(),b(w)},children:[(0,c.jsx)("span",{className:"mono",children:w.name}),(0,c.jsx)("span",{className:"muted",children:w.option.type}),(0,c.jsx)("span",{className:"afd-param-desc",children:w.option.description.split(`
|
|
176
|
+
`)[0]})]},w.name))}):null]})]})}var f9=/^(true|false|yes|no|null|~|-?[0-9]+(?:[.][0-9]+)?)$/i;function Eh(e,t){let n=e[t];for(let r=t+1;r<e.length;r++){let a=e[r];if(n==='"'&&a==="\\")r++;else if(a===n)if(n==="'"&&e[r+1]==="'")r++;else return r+1}return e.length}function h9(e,t){let n="",r=()=>{if(!n)return;let s=n.length-n.trimStart().length,l=n.trim(),f=n.length-s-l.length;s&&t.push({text:n.slice(0,s)}),l&&t.push({text:l,kind:f9.test(l)?"scalar":void 0}),f&&t.push({text:n.slice(s+l.length)}),n=""},a=0;for(;a<e.length;){let s=e[a];if(s==="#"&&(a===0||e[a-1]===" ")){r(),t.push({text:e.slice(a),kind:"comment"});return}if(s==='"'||s==="'"){let l=Eh(e,a);r(),t.push({text:e.slice(a,l),kind:"string"}),a=l}else n+=s,a++}r()}function p9(e){let t=[],n=e.length-e.trimStart().length;n&&t.push({text:e.slice(0,n)});let r=e.slice(n);if(r.startsWith("#"))return t.push({text:r,kind:"comment"}),t;let a=/^(-(?: |$))+/.exec(r);a&&(t.push({text:a[0],kind:"dash"}),r=r.slice(a[0].length));let s=/^("[^"]*"|'[^']*'|[^\s#'"][^:#]*?)(:)(?= |$)/.exec(r);return s&&(t.push({text:s[1],kind:"key"}),t.push({text:":",kind:"punct"}),r=r.slice(s[0].length)),h9(r,t),t}var K$=/\{\{|\{%|\{#/;function W$(e,t,n,r){return al(e,{mode:Jd(e,t),yamlQuote:n}).tokens.map(a=>{let s=a.kind?y$[a.kind]:a.text.trim()?r:void 0;return s?{text:a.text,colour:s}:{text:a.text}})}function $h(e){return p9(e).map(t=>t.kind==="key"?{text:t.text,colour:"key"}:t.kind==="comment"?{text:t.text,colour:"comment"}:t.kind==="dash"||t.kind==="punct"?{text:t.text,colour:"muted"}:t.kind==="string"?{text:t.text,colour:"string"}:t.kind==="scalar"?{text:t.text,colour:/^-?[0-9]/.test(t.text)?"number":"constant"}:{text:t.text})}function U$(e){let t=e.length-e.trimStart().length;if(e.startsWith("#",t))return;let n=/^(-(?: |$))+/.exec(e.slice(t));n&&(t+=n[0].length);let r=/^("[^"]*"|'[^']*'|[^\s#'"][^:#]*?)(:)(?= |$)/.exec(e.slice(t));for(r&&(t+=r[0].length);e[t]===" ";)t++;if(t>=e.length)return{start:e.length,end:e.length};let a=e[t];if(a==='"'||a==="'")return{start:t,end:Eh(e,t),quote:a};let s=/\s#/.exec(e.slice(t)),l=s?t+s.index:e.length;for(;l>t&&e[l-1]===" ";)l--;return{start:t,end:l}}function m9(e,t,n){let r=U$(e);if(!r)return;if(r.quote){let s=r.end-r.start>1&&e[r.end-1]===r.quote&&Eh(e,r.start)===r.end?r.end-1:r.end;if(t<=r.start||t>s)return;let l=e.slice(r.start+1,s);return{text:l,base:r.start+1,opts:{mode:Jd(l,n),yamlQuote:r.quote}}}if(t<r.start||t>r.end)return;let a=e.slice(r.start,r.end);return{text:a,base:r.start,opts:{mode:Jd(a,n)}}}function g9(e,t=!1){let n=U$(e);if(!n||n.start===n.end)return $h(e);let r=$h(e.slice(0,n.start)),a=e.slice(n.start,n.end);if(n.quote){let s=a.length>1&&Eh(a,0)===a.length&&a.endsWith(n.quote),l=a.slice(1,s?-1:void 0);!t&&!K$.test(l)?r.push({text:a,colour:"string"}):(r.push({text:n.quote,colour:"string"}),r.push(...W$(l,t,n.quote,t?void 0:"string")),s&&r.push({text:n.quote,colour:"string"}))}else t||K$.test(a)?r.push(...W$(a,t,void 0,void 0)):r.push(...$h(a));return r.push(...$h(e.slice(n.end))),r}function Y$(e){let t;return e.map(n=>{let r=/^([A-Za-z_][\w-]*)\s*:(?= |$)/.exec(n);return r?t=r[1]:n.trim()&&!/^\s/.test(n)&&!n.startsWith("-")&&!n.startsWith("#")&&(t=void 0),t})}function y9(e){let t=e.length-e.trimStart().length,n=s=>" ".repeat(s),r=/^(\s*)- ?(.*)$/.exec(e);if(r){let s=r[2].trim();if(!s)return{text:n(Math.max(0,t-2)),clear:!0};let l=t+2;return/^[^#'"\s][^#]*:$/.test(s)?{text:`
|
|
177
|
+
${n(l+2)}`}:/^[^#'"\s][^:#]*: /.test(s)?{text:`
|
|
178
|
+
${n(l)}`}:{text:`
|
|
179
|
+
${n(t)}- `}}let a=e.replace(/\s+#.*$/,"").trimEnd();return/^\s*[^#'"\s][^#]*:$/.test(a)?{text:`
|
|
180
|
+
${n(t+2)}`}:{text:`
|
|
181
|
+
${n(t)}`}}function X$(e,t){if(e.trim())try{let n=t?.(gi(e));return n?{message:n}:void 0}catch(n){let r=n.linePos?.[0]?.line;return{message:(n instanceof Error?n.message.split(`
|
|
182
|
+
`)[0]??"":"").replace(/:$/,"")||"Not YAML",line:r}}}var v9=[];function b9(e,t,n,r){let a=[],s=0,l=n===void 0,f=(p,h,v,g)=>h?(0,c.jsx)("span",{className:`afd-syn-${h}`,"data-at":t+g,children:p},v):p;return e.forEach((p,h)=>{let v=s+p.text.length;if(!l&&n!==void 0&&n>=s&&n<=v){let g=n-s;g>0&&a.push(f(p.text.slice(0,g),p.colour,`${h}a`,s)),a.push(r),g<p.text.length&&a.push(f(p.text.slice(g),p.colour,`${h}b`,n)),l=!0}else a.push(f(p.text,p.colour,String(h),s));s=v}),l||a.push(r),a}var tv=(0,T.forwardRef)(function({id:e,value:t,onChange:n,validate:r,rows:a=3,placeholder:s,bareKeys:l,choices:f,onAddInput:p},h){let v=t===void 0?"":nz(t).trimEnd(),[g,m]=(0,T.useState)(v),[b,w]=(0,T.useState)(),k=(0,T.useRef)(null),S=(0,T.useRef)(null),N=(0,T.useRef)(null),E=(0,T.useId)(),[j,$]=(0,T.useState)(null),[L,z]=(0,T.useState)(null),[A,M]=(0,T.useState)(null),O=(0,T.useRef)(null),K=(0,T.useRef)(null),B=(0,T.useRef)(null),V=(0,T.useRef)(void 0),oe=(0,T.useId)(),F=T$(f??v9),J=(0,T.useRef)(r);J.current=r,(0,T.useEffect)(()=>{let R=setTimeout(()=>w(X$(g,J.current)),300);return()=>clearTimeout(R)},[g]),(0,T.useLayoutEffect)(()=>{N.current&&k.current&&(k.current.setSelectionRange(...N.current),N.current=null)});let I=R=>{if(!R.trim()){w(void 0),n(void 0);return}let Q=X$(R,r);w(Q),Q||n(gi(R))};(0,T.useImperativeHandle)(h,()=>({add(R,Q){let fe=g.trimEnd()?`${g.trimEnd()}
|
|
183
|
+
${R}`:R;m(fe),Q?.commit?I(fe):(k.current?.focus(),N.current=[fe.length-(Q?.select??0),fe.length])}}));let U=(R,Q)=>{let fe=R.lastIndexOf(`
|
|
184
|
+
`,Q-1)+1,X=R.indexOf(`
|
|
185
|
+
`,Q),he=R.slice(fe,X<0?void 0:X),Z=R.slice(0,fe).split(`
|
|
186
|
+
`).length-1,q=l?Y$(R.split(`
|
|
187
|
+
`))[Z]:void 0,ee=m9(he,Q-fe,!!l?.has(q??""));return ee?{...ee,line:fe,index:Z,col:Q-fe}:void 0},W=(R,Q=g)=>{let fe=k.current;if(!fe||document.activeElement!==fe||fe.selectionStart!==fe.selectionEnd){$(null),z(null);return}let X=fe.selectionStart,he=U(Q,X),Z=new Date,q=he?C$(he.text,he.col-he.base,he.opts,{...F,now:Z}):void 0,ee=typeof R=="function"?R(q):R;$(de=>he&&q&&q.items.length>0&&(ee||de)?{c:q,text:he.text,opts:he.opts,start:he.line+he.base,index:he.index,col:he.col,active:de&&de.c.from===q.from&&de.c.context===q.context?Math.min(de.active,q.items.length-1):0}:null),z((he&&Wy(he.text,he.col-he.base,he.opts,{now:Z}))??null)},re=R=>{let Q=k.current;if(!Q||!j)return;let fe=L$(j.text,j.c,R,j.opts.mode==="template"),X=j.opts.yamlQuote,he=De=>X==="'"?De.replaceAll("'","''"):X==='"'?De.replaceAll('"','\\"'):De,Z=he(fe.text),q=he(fe.text.slice(0,fe.caret)).length,ee=j.start+j.c.from,de=j.start+j.c.to;Q.focus(),Q.setSelectionRange(ee,de);let me=g.slice(0,ee)+Z+g.slice(de);typeof document.execCommand=="function"&&document.execCommand("insertText",!1,Z)||m(me),Q.setSelectionRange(ee+q,ee+q),N.current=[ee+q,ee+q],R.choice&&p?.(R.choice),$(null),R.again?setTimeout(()=>W(!0,me)):z(null)},le=R=>{if(M(null),P$(R,j?{count:j.c.items.length,active:j.active}:null,{move:ee=>$(de=>de&&{...de,active:ee}),pick:()=>{let ee=j?.c.items[j.active];ee&&re(ee)},close:()=>$(null),force:()=>W(!0)})||R.key!=="Enter"||R.shiftKey||R.ctrlKey||R.metaKey||R.altKey||R.nativeEvent.isComposing)return;let Q=R.currentTarget,fe=Q.selectionStart,X=g.lastIndexOf(`
|
|
188
|
+
`,fe-1)+1,he=y9(g.slice(X,fe));R.preventDefault();let Z=he.clear?g.slice(0,X)+he.text+g.slice(Q.selectionEnd):g.slice(0,fe)+he.text+g.slice(Q.selectionEnd),q=(he.clear?X:fe)+he.text.length;N.current=[q,q],m(Z)};(0,T.useLayoutEffect)(()=>{let R=O.current,Q=K.current?.getBoundingClientRect();if(!j||!R||!Q||Q.height===0)return;let fe=$$({left:Q.left,top:Q.top,bottom:Q.top+18},{left:0,top:0},{width:R.offsetWidth,height:R.offsetHeight},{width:window.innerWidth,height:window.innerHeight});R.style.left=`${fe.left}px`,R.style.top=`${fe.top}px`},[j]),(0,T.useEffect)(()=>{j&&O.current?.querySelector('[aria-selected="true"]')?.scrollIntoView?.({block:"nearest"})},[j]),(0,T.useEffect)(()=>()=>clearTimeout(V.current),[]);let pe=(R,Q)=>{clearTimeout(V.current),V.current=setTimeout(()=>{let fe=[...S.current?.querySelectorAll("[data-at]")??[]].find(q=>[...q.getClientRects()].some(ee=>R>=ee.left&&R<=ee.right&&Q>=ee.top&&Q<=ee.bottom)),X=fe?Number(fe.dataset.at):NaN,he=Number.isNaN(X)||j?void 0:U(g,X),Z=he?Uy(he.text,he.col-he.base,he.opts,{...F,now:new Date}):void 0;M(Z?{d:Z,left:R,top:Q+16}:null)},300)},xe=g.split(`
|
|
189
|
+
`),Ne=l?Y$(xe):[],we=0;return(0,c.jsxs)("div",{className:"afd-yaml",children:[(0,c.jsxs)("div",{className:"afd-yaml-box",ref:B,children:[(0,c.jsx)("pre",{ref:S,className:"afd-input mono afd-yaml-layer","aria-hidden":"true",children:xe.map((R,Q)=>{let fe=we;return we+=R.length+1,(0,c.jsxs)("span",{className:b?.line===Q+1?"afd-yaml-line error":"afd-yaml-line",children:[b9(g9(R,!!l?.has(Ne[Q]??"")),fe,j?.index===Q?j.col:void 0,(0,c.jsx)("span",{ref:K,className:"afd-yaml-caret"},"caret")),Q<xe.length-1?`
|
|
190
|
+
`:" "]},Q)})}),(0,c.jsx)("textarea",{ref:k,id:e,className:`afd-input mono afd-yaml-text${b?" invalid":""}`,rows:a,value:g,placeholder:s,spellCheck:!1,"aria-invalid":!!b,"aria-describedby":b?E:void 0,"aria-autocomplete":"list","aria-controls":j?oe:void 0,"aria-activedescendant":j?`${oe}-${j.active}`:void 0,onChange:R=>{m(R.target.value),M(null);let Q=R.nativeEvent,fe=Q?.inputType?.startsWith("insert")?Q.data:null,X=R.target.value;setTimeout(()=>W(he=>D$(fe,he),X))},onKeyDown:le,onKeyUp:R=>{(["ArrowLeft","ArrowRight","Home","End"].includes(R.key)||!j&&["ArrowUp","ArrowDown"].includes(R.key))&&W(!1)},onMouseUp:()=>W(!1),onMouseMove:R=>pe(R.clientX,R.clientY),onMouseLeave:()=>{clearTimeout(V.current),M(null)},onScroll:R=>{S.current&&(S.current.scrollTop=R.currentTarget.scrollTop,S.current.scrollLeft=R.currentTarget.scrollLeft)},onBlur:()=>{$(null),z(null),M(null),I(g)}}),j?(0,c.jsx)(A$,{ref:O,id:oe,completion:j.c,active:j.active,onPick:re}):null,A&&!j?(0,c.jsx)(O$,{tip:A.d,style:{left:A.left,top:A.top}}):null]}),L&&!j?(0,c.jsx)(M$,{hint:L}):null,b?(0,c.jsx)("div",{className:"afd-field-error",id:E,children:b.message}):null]})}),Z$={"check-mode":{text:"check mode",tone:"ok"},"check-mode-partial":{text:"check mode: partial",tone:"warn"},"no-check-mode":{text:"no check mode",tone:"warn"},diff:{text:"diff",tone:"ok"},"read-only":{text:"read-only",tone:"neutral"},"other-platform":{text:"other platform",tone:"warn"},deprecated:{text:"deprecated",tone:"warn"}},x9=[{kind:"module",label:"Module"},{kind:"role",label:"Role"},{kind:"playbook",label:"Playbook"}];function w9(e){let{draft:t}=e,[n,r]=(0,T.useState)([]),a=E=>{n.includes(E)||r([...n,E]),requestAnimationFrame(()=>document.querySelector(`[data-param="${E}"] input, [data-param="${E}"] textarea, [data-param="${E}"] select, [data-param="${E}"] [contenteditable]`)?.focus())},s=xi(t.kind==="module"&&t.ref?{op:"doc",fqcn:t.ref}:null,`doc:${t.kind}:${t.ref}`),l=xi(t.kind==="role"?{op:"roles"}:null,`roles:${t.kind}`),f=xi(t.kind==="playbook"?{op:"playbooks"}:null,`playbooks:${t.kind}`),p=l.data?.find(E=>E.name===t.ref),h=f.data?.find(E=>E.path===t.ref),v=_(E=>E.snapshot?.findings),g=_(E=>E.expanded),m=(0,c.jsx)(k9,{...e,roles:l,playbooks:f});if(!t.ref)return(0,c.jsx)("div",{className:"afd-impl afd-impl-unbound",children:(0,c.jsx)("section",{className:"afd-impl-find","aria-label":"Find",children:m})});let{node:b}=e,w=t.kind==="module"?"module":t.kind,k=b.impl?.kind!==t.kind||b.impl?.ref!==t.ref,S=t.kind==="module"&&!s.loading&&(!!s.error||!s.data),N=(v??[]).some(E=>E.node===b.id&&H6.has(E.code));return(0,c.jsxs)("div",{className:"afd-impl",children:[(0,c.jsx)("section",{className:"afd-impl-configure","aria-label":"Configure",children:(0,c.jsx)($9,{...e,doc:s.data??null,docLoading:s.loading,role:p,playbook:h,extra:n,addParam:a})}),(0,c.jsx)("section",{className:"afd-impl-find","aria-label":`Change ${w}`,children:(0,c.jsx)(Nr,{id:"binding-change",lazy:!0,open:g||k||S||N,summary:(0,c.jsxs)(c.Fragment,{children:["Change ",w," \xB7 ",(0,c.jsx)("span",{className:"mono",children:t.ref})]}),children:m})}),(0,c.jsx)("section",{className:"afd-impl-about","aria-label":"About",children:(0,c.jsx)(Nr,{id:"binding-about",open:g,summary:(0,c.jsxs)(c.Fragment,{children:["About ",(0,c.jsx)("span",{className:"mono",children:t.ref})]}),children:t.kind==="module"?(0,c.jsx)(j9,{...e,doc:s.data??null,loading:s.loading,error:s.error,extra:n,addParam:a}):t.kind==="role"?(0,c.jsx)(C9,{...e,role:p}):(0,c.jsx)(E9,{playbook:h})})})]})}function k9({node:e,draft:t,setDraft:n,roles:r,playbooks:a}){let s=(0,T.useId)(),[l,f]=(0,T.useState)(""),p=_(w=>w.catalog),h=(e.intent||e.title).trim(),v=l.trim()||h,g=xi(t.kind==="module"&&v?{op:"search",query:v,types:["module"]}:null,`search:${t.kind}:${v}`,l?200:0),m=(w,k,S={})=>n({...t,kind:w,ref:k,params:k===t.ref&&w===t.kind?t.params:{},register:w==="module"?t.register||Ys(e):"",...S}),b=l.trim().toLowerCase();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"afd-label",children:"Bind to"}),(0,c.jsx)("fieldset",{className:"afd-segmented afd-kind","aria-label":"Bind to",children:x9.map(w=>(0,c.jsx)("button",{type:"button",className:t.kind===w.kind?"active":"","aria-pressed":t.kind===w.kind,onClick:()=>t.kind!==w.kind&&m(w.kind,""),children:w.label},w.kind))}),(0,c.jsx)("label",{htmlFor:s,className:"afd-label",children:t.kind==="module"?"Search modules":t.kind==="role"?"Filter roles":"Filter playbooks"}),(0,c.jsx)("input",{id:s,className:"afd-input",value:l,placeholder:t.kind==="module"?h||"vlan, restart service\u2026":"",onChange:w=>f(w.target.value),"data-catalog-search":!0}),(0,c.jsxs)("div",{className:"afd-chips",children:[p.environment?(0,c.jsxs)("span",{className:"afd-chip afd-ctx",children:["in ",p.environment]}):null,(p.platforms??[]).map(w=>(0,c.jsxs)("span",{className:"afd-chip afd-ctx",children:["platform: ",w.split(".")[1]??w]},w))]}),p.state==="loading"?(0,c.jsxs)("p",{className:"muted",role:"status",children:[(0,c.jsx)("span",{className:"codicon codicon-loading codicon-modifier-spin","aria-hidden":"true"})," ",p.message??"Loading the catalog\u2026"]}):null,t.kind==="module"?(0,c.jsxs)(c.Fragment,{children:[!l.trim()&&h?(0,c.jsxs)("p",{className:"muted afd-suggested",children:["Suggested from intent: \u201C",h,"\u201D"]}):null,g.error?(0,c.jsx)(_h,{message:g.error}):null,g.data?(0,c.jsxs)("span",{className:"muted",children:[g.data.length," results \xB7 ranked by node intent, collections in use and platform"]}):null,(0,c.jsx)("ul",{className:"afd-results","aria-label":"Modules",children:(g.data??[]).map(w=>(0,c.jsx)("li",{children:(0,c.jsx)(S9,{hit:w,selected:t.ref===w.fqcn,onPick:()=>m("module",w.fqcn)})},w.fqcn))})]}):t.kind==="role"?(0,c.jsxs)(c.Fragment,{children:[r.error?(0,c.jsx)(_h,{message:r.error}):null,r.loading?(0,c.jsx)("p",{className:"muted",children:"Reading roles\u2026"}):null,r.data&&r.data.length===0?(0,c.jsx)("p",{className:"muted",children:"No roles in this repository."}):null,(0,c.jsx)("ul",{className:"afd-results","aria-label":"Roles",children:(r.data??[]).filter(w=>!b||w.name.toLowerCase().includes(b)).map(w=>(0,c.jsx)("li",{children:(0,c.jsxs)("button",{type:"button",className:`afd-result${t.ref===w.name?" selected":""}`,onClick:()=>m("role",w.name),children:[(0,c.jsx)("span",{className:"mono afd-result-name",children:w.name}),(0,c.jsx)("span",{className:"afd-result-text",children:w.entry_points.main?.short_description||w.path}),(0,c.jsx)("span",{className:"afd-chips",children:(0,c.jsx)("span",{className:`afd-badge tone-${Object.keys(w.entry_points).length?"ok":"warn"}`,children:Object.keys(w.entry_points).length?"argument specs":"no argument specs"})})]})},w.name))})]}):(0,c.jsxs)(c.Fragment,{children:[a.error?(0,c.jsx)(_h,{message:a.error}):null,a.data&&a.data.length===0?(0,c.jsx)("p",{className:"muted",children:"No playbooks in this repository."}):null,(0,c.jsx)("ul",{className:"afd-results","aria-label":"Playbooks",children:(a.data??[]).filter(w=>!b||w.path.toLowerCase().includes(b)).map(w=>(0,c.jsx)("li",{children:(0,c.jsxs)("button",{type:"button",className:`afd-result${t.ref===w.path?" selected":""}`,onClick:()=>m("playbook",w.path),children:[(0,c.jsx)("span",{className:"mono afd-result-name",children:w.path}),(0,c.jsx)("span",{className:"afd-result-text",children:w.plays.map(k=>k.name||k.hosts).filter(Boolean).join(" \xB7 ")||"no plays"})]})},w.path))})]})]})}function S9({hit:e,selected:t,onPick:n}){return(0,c.jsxs)("button",{type:"button",className:`afd-result${t?" selected":""}${e.dimmed?" dimmed":""}`,onClick:n,"data-hit":e.fqcn,title:e.match,children:[(0,c.jsx)("span",{className:"mono afd-result-name",children:e.fqcn}),(0,c.jsx)("span",{className:"afd-result-text",children:e.short_description}),(0,c.jsxs)("span",{className:"afd-chips",children:[(0,c.jsx)("span",{className:"afd-badge tone-ok",children:"in EE"}),e.badges.map(r=>(0,c.jsx)("span",{className:`afd-badge tone-${Z$[r].tone}`,children:Z$[r].text},r))]})]})}function _h({message:e}){let[t,n]=(0,T.useState)(!1);return(0,c.jsxs)("div",{className:"afd-catalog-error",role:"alert",children:[(0,c.jsx)("p",{children:e}),(0,c.jsx)("button",{type:"button",className:"secondary",disabled:t,onClick:()=>{n(!0),bh({op:"rebuild"}).finally(()=>n(!1))},children:"Rebuild Catalog"})]})}var nv=6;function N9(e){let[t,n,r]=e.split(".");if(t&&n&&r)return`https://docs.ansible.com/ansible/latest/collections/${t}/${n}/${r}_module.html`}function j9({draft:e,setDraft:t,node:n,doc:r,loading:a,error:s,extra:l,addParam:f}){let[p,h]=(0,T.useState)(!1);if(!e.ref)return(0,c.jsx)("p",{className:"muted afd-empty",children:"Choose a module to see what it does and how to configure it."});if(s)return(0,c.jsx)(_h,{message:s});if(!r)return(0,c.jsx)("p",{className:"muted",children:a?"Reading the docs\u2026":`${e.ref} is not in this environment.`});let v=Object.entries(r.options??{}),g=p?v:v.slice(0,nv),m=new Set([...ME(r.options,e.params).shown.map(S=>S.name),...l]),b=N9(r.fqcn),w=Zd(n,e).outputs??{},k=(S,N)=>{let E=`impl.register.${S}`,j=w[S]?.from===E?null:{type:N,from:E},$={...e.outputs};j===null&&!n.outputs?.[S]?delete $[S]:$[S]=j,t({...e,outputs:$})};return(0,c.jsxs)("div",{className:"afd-doc","data-doc":r.fqcn,children:[b?(0,c.jsx)("a",{href:b,className:"afd-docs-link",children:"Full Docs \u2197"}):null,(0,c.jsx)("h3",{className:"mono",children:r.fqcn}),(0,c.jsx)("p",{children:r.short_description}),(0,c.jsxs)("div",{className:"afd-chips",children:[(0,c.jsxs)("span",{className:"afd-badge tone-neutral",children:[r.collection," ",r.collection_version??""]}),(0,c.jsx)("span",{className:"afd-badge tone-ok",children:"in your EE"}),r.attributes?.check_mode?.support?(0,c.jsxs)("span",{className:`afd-badge tone-${r.attributes.check_mode.support==="full"?"ok":"warn"}`,children:["check mode: ",r.attributes.check_mode.support]}):null,r.attributes?.diff_mode?.support?(0,c.jsxs)("span",{className:"afd-badge tone-neutral",children:["diff mode: ",r.attributes.diff_mode.support]}):null,r.deprecated?(0,c.jsx)("span",{className:"afd-badge tone-warn",children:"deprecated"}):null]}),r.description?(0,c.jsx)("p",{className:"afd-doc-text",children:r.description.split(`
|
|
191
|
+
`)[0]}):null,(0,c.jsxs)("table",{className:"afd-params",children:[(0,c.jsx)("thead",{children:(0,c.jsxs)("tr",{children:[(0,c.jsx)("th",{children:"Parameter"}),(0,c.jsx)("th",{children:"Type"}),(0,c.jsx)("th",{children:"Description"}),(0,c.jsx)("th",{children:(0,c.jsx)("span",{className:"afd-sr-only",children:"Add"})})]})}),(0,c.jsx)("tbody",{children:g.map(([S,N])=>(0,c.jsxs)("tr",{children:[(0,c.jsxs)("td",{className:"mono",children:[S,N.required?(0,c.jsx)("abbr",{title:"required",children:" *"}):null]}),(0,c.jsx)("td",{className:"muted",children:N.type}),(0,c.jsxs)("td",{children:[N.description.split(`
|
|
192
|
+
`)[0],(0,c.jsx)(G$,{option:N})]}),(0,c.jsx)("td",{children:(0,c.jsx)("button",{type:"button",className:"icon","aria-label":`Add ${S} to the parameters`,title:m.has(S)?`${S} is in Configure`:`Add ${S}`,disabled:m.has(S),"data-add-param":S,onClick:()=>f(S),children:(0,c.jsx)("span",{className:"codicon codicon-add","aria-hidden":"true"})})})]},S))})]}),v.length>nv?(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>h(!p),children:p?"Show Fewer Parameters":`Show ${v.length-nv} More Parameters`}):null,r.returns&&Object.keys(r.returns).length>0?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("h4",{children:"Returns \xB7 usable as node outputs"}),(0,c.jsx)("div",{className:"afd-chips",children:Object.entries(r.returns).map(([S,N])=>{let E=w[S]?.from===`impl.register.${S}`;return(0,c.jsx)("button",{type:"button",className:`chip-button mono${E?" active":""}`,"aria-pressed":E,title:`${N.description}${E?" (node output)":" \xB7 add as node output"}`,onClick:()=>k(S,K6(N)),children:S},S)})})]}):null,r.examples?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("h4",{children:"Example from docs"}),(0,c.jsx)("pre",{className:"afd-code",children:r.examples.split(`
|
|
193
|
+
|
|
194
|
+
`)[0]?.trim()})]}):null]})}function G$({option:e}){let t=[];return e.choices?.length&&t.push(e.choices.map(String).join(" \xB7 ")),e.default!==void 0&&e.default!==null&&t.push(`default ${String(e.default)}`),e.aliases?.length&&t.push(`alias: ${e.aliases.join(", ")}`),t.length>0?(0,c.jsxs)("span",{className:"muted afd-facts",children:[" ",t.join(", ")]}):null}function C9({draft:e,setDraft:t,role:n}){if(!e.ref)return(0,c.jsx)("p",{className:"muted afd-empty",children:"Choose a role from this repository."});if(!n)return(0,c.jsxs)("p",{className:"muted",children:["Reading ",e.ref,"\u2026"]});let r=Object.keys(n.entry_points),a=String(e.params.tasks_from??"main"),s=n.entry_points[a];return(0,c.jsxs)("div",{className:"afd-doc","data-doc":n.name,children:[(0,c.jsx)("h3",{className:"mono",children:n.name}),(0,c.jsx)("p",{className:"muted mono",children:n.path}),r.length>1||n.tasks.length>1?(0,c.jsxs)("div",{className:"afd-field",children:[(0,c.jsx)("label",{htmlFor:"afd-role-entry",children:"Entry point (tasks_from)"}),(0,c.jsx)("select",{id:"afd-role-entry",value:a,onChange:l=>{let f={...e.params};l.target.value==="main"?delete f.tasks_from:f.tasks_from=l.target.value,t({...e,params:f})},children:[...new Set(["main",...r,...n.tasks])].map(l=>(0,c.jsx)("option",{value:l,children:l},l))})]}):null,s?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{children:s.short_description}),s.description?(0,c.jsx)("p",{className:"afd-doc-text",children:s.description.split(`
|
|
195
|
+
`)[0]}):null,(0,c.jsx)("table",{className:"afd-params",children:(0,c.jsx)("tbody",{children:Object.entries(s.options).map(([l,f])=>(0,c.jsxs)("tr",{children:[(0,c.jsxs)("td",{className:"mono",children:[l,f.required?(0,c.jsx)("abbr",{title:"required",children:" *"}):null]}),(0,c.jsx)("td",{className:"muted",children:f.type}),(0,c.jsxs)("td",{children:[f.description.split(`
|
|
196
|
+
`)[0],(0,c.jsx)(G$,{option:f})]})]},l))})})]}):(0,c.jsx)("p",{className:"muted",children:"This entry point has no argument spec (meta/argument_specs.yml): its variables are free-form."})]})}function E9({playbook:e}){return e?(0,c.jsxs)("div",{className:"afd-doc","data-doc":e.path,children:[(0,c.jsx)("h3",{className:"mono",children:e.path}),(0,c.jsxs)("p",{children:["The node imports this playbook with ",(0,c.jsx)("span",{className:"mono",children:"afd_hosts"})," set to the hosts arriving here; hosts still running afterwards leave through ok_hosts. Failures inside it stop those hosts."]}),(0,c.jsx)("ul",{className:"afd-plays",children:e.plays.map((t,n)=>(0,c.jsxs)("li",{children:[t.name??"unnamed play"," ",(0,c.jsxs)("span",{className:"muted mono",children:["hosts: ",t.hosts??"?"]})]},n))})]}):(0,c.jsx)("p",{className:"muted afd-empty",children:"Choose a playbook from this repository."})}function $9({node:e,model:t,draft:n,setDraft:r,doc:a,docLoading:s,role:l,playbook:f,extra:p,addParam:h}){let v=Zd(e,n),g=X6(dC(t,e.id).flatMap(B=>B.impl?.kind==="module"&&B.impl.ref?[B.impl.ref]:[])),m=Gd(t,v,B=>B.impl?.ref?g[B.impl.ref]:void 0),b={current:n},w=B=>{b.current=B,r(B)},k=B=>{B.field&&w({...b.current,inputs:{...b.current.inputs,[B.name]:B.field}}),B.expose&&Pe({kind:"setContractField",target:B.expose.node,side:"outputs",name:B.expose.output,field:{type:"dict",from:"impl.register"}})},S=(B,V)=>{let oe={...b.current.params};V===void 0?delete oe[B]:oe[B]=V,w({...b.current,params:oe})},N=String(n.params.tasks_from??"main"),E=n.kind==="module"?jE(n.ref,a?.options):n.kind==="role"?l?.entry_points[N]?.options:void 0,j=B6(E,n.params,p),$=[...j.set,...j.added],L=new Set(Object.keys(E??{})),z=Object.keys(n.params).filter(B=>!L.has(B)&&B!=="tasks_from"),A=v.impl,M=W6(t,v,{plugin:a,roleSpec:!!l?.entry_points[N],playbookTargets:f?.plays.some(B=>(B.hosts??"").includes("afd_hosts"))});if(!n.ref)return(0,c.jsx)("p",{className:"muted afd-empty",children:"Configure appears once something is chosen."});if(n.kind==="module"&&!a&&s)return(0,c.jsx)("p",{className:"muted",children:"Reading the docs\u2026"});let O={choices:m,onAddInput:k},K=B=>B.map(V=>(0,c.jsx)(T9,{field:V,bare:n.kind==="module"&&u4(n.ref,V.name),value:n.params[V.name],onChange:oe=>S(V.name,oe),...O},V.name));return(0,c.jsxs)("div",{className:"afd-configure",children:[j.required.length>0?(0,c.jsxs)("div",{className:"afd-param-group","data-param-group":"required",children:[(0,c.jsx)("h4",{children:"Required"}),K(j.required)]}):null,$.length>0?(0,c.jsxs)("div",{className:"afd-param-group","data-param-group":"optional",children:[(0,c.jsx)("h4",{children:"Optional"}),K($)]}):null,j.rest.length>0?(0,c.jsx)(c9,{fields:j.rest,onPick:h}):null,n.kind!=="module"||!E||by(n.ref)?(0,c.jsx)(M9,{names:z,params:n.params,onChange:S,label:n.kind==="playbook"?"Extra vars for the playbook":by(n.ref)?"Facts":"Variables",...O}):null,n.kind==="module"?(0,c.jsx)(_9,{node:e,draft:n,setDraft:r}):null,(0,c.jsx)("ul",{className:"afd-checklist","aria-label":"Checks",children:M.map(B=>(0,c.jsxs)("li",{className:`check-${B.state}`,children:[(0,c.jsx)("span",{className:`codicon codicon-${B.state==="ok"?"check":B.state==="warn"?"warning":"circle-large-outline"}`,"aria-hidden":"true"})," ",B.text]},B.text))}),A?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("h4",{children:"Generated task"}),(0,c.jsx)("pre",{className:"afd-code","data-binding-preview":!0,children:hB(v,A)})]}):null]})}function _9({node:e,draft:t,setDraft:n}){let r=(0,T.useId)(),a=(Zd(e,t).outputs??{})[t.register]?.from==="impl.register",s=/^[A-Za-z_][A-Za-z0-9_]*$/.test(t.register),l=(f,p=t.register)=>{let h={...t.outputs};return f?h[p]={type:"dict",from:"impl.register"}:e.outputs?.[p]?h[p]=null:delete h[p],h};return(0,c.jsxs)("div",{className:"afd-field afd-register",children:[(0,c.jsx)("label",{htmlFor:r,children:"Register result as"}),(0,c.jsx)("input",{id:r,className:`afd-input mono${s?"":" invalid"}`,value:t.register,onChange:f=>{let p=f.target.value,h=t.outputs;a&&(h=l(!1),/^[A-Za-z_][A-Za-z0-9_]*$/.test(p)&&(h={...h,[p]:{type:"dict",from:"impl.register"}})),n({...t,register:p,outputs:h})}}),(0,c.jsxs)("label",{className:"afd-check",children:[(0,c.jsx)("input",{type:"checkbox",checked:a,disabled:!s,onChange:f=>n({...t,outputs:l(f.target.checked)})}),"Expose as node output"]})]})}function T9({field:e,bare:t,value:n,onChange:r,choices:a,onAddInput:s}){let l=(0,T.useId)(),f=e.option,p=(0,c.jsxs)("label",{htmlFor:l,children:[(0,c.jsx)("span",{className:"mono",children:e.name}),e.required?(0,c.jsx)("abbr",{title:"required",children:" *"}):null]}),h=(0,c.jsx)("span",{className:"afd-help",children:f.description.split(`
|
|
197
|
+
`)[0]}),v={choices:a,onAddInput:s,mode:t?"expr":void 0},g;switch(e.control){case"bool":g=(0,c.jsxs)("select",{id:l,value:n===!0?"true":n===!1?"false":"",onChange:m=>r(m.target.value===""?void 0:m.target.value==="true"),children:[(0,c.jsx)("option",{value:"",children:f.default===void 0?"not set":`default (${String(f.default)})`}),(0,c.jsx)("option",{value:"true",children:"true"}),(0,c.jsx)("option",{value:"false",children:"false"})]});break;case"choice":g=(0,c.jsxs)("select",{id:l,value:n===void 0?"":String(n),onChange:m=>r(m.target.value===""?void 0:(f.choices??[]).find(b=>String(b)===m.target.value)),children:[(0,c.jsx)("option",{value:"",children:f.default===void 0?"not set":`default (${String(f.default)})`}),(f.choices??[]).map(m=>(0,c.jsx)("option",{value:String(m),children:String(m)},String(m)))]});break;case"list":g=(0,c.jsx)(A9,{id:l,name:e.name,value:Array.isArray(n)?n.map(String):n===void 0?[]:[String(n)],onChange:m=>r(m.length>0?m:void 0),...v});break;case"yaml":g=(0,c.jsx)(tv,{id:l,value:n,onChange:r});break;default:g=(0,c.jsx)(iu,{id:l,label:e.name,value:n===void 0?"":String(n),placeholder:f.default===void 0?void 0:`default ${String(f.default)}`,onChange:m=>r(m===""?void 0:e.control==="number"&&/^-?[0-9]+(\.[0-9]+)?$/.test(m)?Number(m):m),...v})}return(0,c.jsxs)("div",{className:"afd-field","data-param":e.name,children:[p,g,h]})}function A9({id:e,name:t,value:n,onChange:r,choices:a,onAddInput:s,mode:l}){let[f,p]=(0,T.useState)(n.length>0?n:[""]),h=n.join("\0");(0,T.useEffect)(()=>{p(g=>g.filter(m=>m!=="").join("\0")===h?g:h?h.split("\0"):[""])},[h]);let v=g=>{p(g.length>0?g:[""]),r(g.filter(m=>m!==""))};return(0,c.jsxs)("div",{className:"afd-list",id:e,children:[f.map((g,m)=>(0,c.jsxs)("div",{className:"afd-list-row",children:[(0,c.jsx)(iu,{id:`${e}-${m}`,label:`${t} ${m+1}`,value:g,onChange:b=>v(f.map((w,k)=>k===m?b:w)),choices:a,onAddInput:s,mode:l}),f.length>1?(0,c.jsx)("button",{type:"button",className:"icon","aria-label":`Remove ${t} ${m+1}`,onClick:()=>v(f.filter((b,w)=>w!==m)),children:(0,c.jsx)("span",{className:"codicon codicon-close","aria-hidden":"true"})}):null]},m)),(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>p([...f,""]),children:"Add Line"})]})}function M9({names:e,params:t,onChange:n,label:r,choices:a,onAddInput:s}){let[l,f]=(0,T.useState)(""),p=/^[A-Za-z_][A-Za-z0-9_]*$/.test(l)&&!(l in t);return(0,c.jsxs)("fieldset",{className:"afd-fieldset afd-freevars",children:[(0,c.jsx)("legend",{children:r}),e.map(h=>(0,c.jsxs)("div",{className:"afd-list-row","data-param":h,children:[(0,c.jsx)("span",{className:"mono afd-freevar-name",children:h}),typeof t[h]=="string"?(0,c.jsx)(iu,{id:`afd-var-${h}`,label:h,value:t[h],onChange:v=>n(h,v),choices:a,onAddInput:s}):(0,c.jsx)(tv,{id:`afd-var-${h}`,value:t[h],rows:1,onChange:v=>n(h,v===void 0?"":v)}),(0,c.jsx)("button",{type:"button",className:"icon","aria-label":`Remove ${h}`,onClick:()=>n(h,void 0),children:(0,c.jsx)("span",{className:"codicon codicon-close","aria-hidden":"true"})})]},h)),(0,c.jsxs)("div",{className:"afd-list-row",children:[(0,c.jsx)("input",{className:"afd-input mono","aria-label":"New variable name",placeholder:"variable_name",value:l,onChange:h=>f(h.target.value)}),(0,c.jsx)("button",{type:"button",className:"secondary",disabled:!p,onClick:()=>{n(l,""),f("")},children:"Add"})]})]})}var O9=["Targeting","Privilege","Timing","Tags"],P9=[{key:"timeout",group:"Timing",label:"Timeout",kind:"text",help:"Limit for one try: 30s, 15m, 1h30m (hosts that run over take the timeout port)"},{key:"retries",group:"Timing",label:"Retries",kind:"int",help:"Tries again up to this many times after the first try: until Until holds, or until the step succeeds"},{key:"until",group:"Timing",label:"Until",kind:"text",help:"Try again until this test holds (Jinja, no braces)"},{key:"delay",group:"Timing",label:"Delay",kind:"seconds",help:"Wait between tries: 10s, 1m, or a number of seconds (Ansible default 5s)"},{key:"serial",group:"Targeting",label:"Serial",kind:"text",help:"Hosts per batch: a number or a percentage"},{key:"rolling",group:"Targeting",label:"Rolling batch",kind:"text",help:"Hosts per batch through every step inside, one batch after another: a number or a percentage",types:["subflow"]},{key:"max_fail_percentage",group:"Targeting",label:"Max fail percentage",kind:"int",help:"Stop the flow when more hosts fail"},{key:"become",group:"Privilege",label:"Become",kind:"bool",help:"Run with privilege escalation; on a subflow, the steps inside too (format 2)"},{key:"become_user",group:"Privilege",label:"Become user",kind:"text",help:"Whom to become (default root); on a subflow, the steps inside too",format:2},{key:"tags",group:"Tags",label:"Tags",kind:"list",help:"Extra play tags, comma separated"},{key:"credential",formatMax:1,group:"Privilege",label:"Credential (AWX)",kind:"text",help:"AWX credential name; local runs use the environment"},{key:"inventory_target",group:"Targeting",label:"Inventory target",kind:"text",help:"Run the work on these hosts (an inventory pattern) instead of the arriving ones; steps inside a subflow inherit it"}],D9=["serial","become","become_user","tags","credential"],L9=["rolling","become","become_user","inventory_target","credential"];function Q$(e,t){return e.types&&!e.types.includes(t.type)?!1:t.type==="subflow"&&(t.subflow?.nodes?.length??0)>0?L9.includes(e.key):t.type==="approval"&&e.key==="timeout"||!["decision","approval","parallel","join"].includes(t.type)||D9.includes(e.key)}function J$(e){return/^0+\s*s?$/i.test(e.trim())?0:ga(e)}var ov=["retries","delay","timeout"];function Th(e,t,n=!0){let r=t.trim(),a=n&&ov.includes(e.key);if(a&&Yf(r))return;let s=a?", or an input with @":"";if(e.kind==="int"&&r&&!/^[0-9]+$/.test(r))return`A whole number${s}`;if(e.kind==="seconds"&&r&&J$(r)===void 0)return`A duration: 10s, 1m, 1m30s, a number of seconds${s}`;if(e.key==="timeout"&&r&&ga(r)===void 0)return`A duration: 30s, 15m, 1h30m${s}`;if(e.key==="rolling"&&r&&!/^[1-9][0-9]*%?$/.test(r))return"A number of hosts, or a percentage like 25%"}function rv(e,t){let n=t.trim();return n?ov.includes(e.key)&&Yf(n)?n:e.kind==="int"?Number(n):e.kind==="seconds"?J$(n)??null:e.kind==="list"?n.split(",").map(r=>r.trim()).filter(Boolean):/^[0-9]+$/.test(n)&&(e.key==="serial"||e.key==="rolling")?Number(n):n:null}function iv(e,t){return t?.kind==="seconds"&&typeof e=="number"?D4(e):Array.isArray(e)?e.join(", "):e===void 0?"":String(e)}function av(e,t,n){if(e===void 0||e==="")return;if(typeof e=="number")return{n:e};if(!Yf(e))return{n:t(e)};let r=L0(e);return r?{ref:r,n:n?.(r)}:{expr:e.trim().slice(2,-2).trim()}}function e_(e,t=""){let n=e.ref&&e.n!==void 0?` (${B0(e.n)} by default)`:"";return e.ref?`${e.ref} s${t}${n}`:e.expr?`${e.expr} s${t}`:`${B0(e.n??0)}${t}`}function I9(e,t,n){let r=e.until?.trim(),a=typeof e.timeout=="string"?e.timeout.trim():e.timeout;if(!r&&!e.retries&&e.delay===void 0&&!a)return;let s=[],l=av(e.retries,()=>{},n),f=av(e.delay,()=>{},n)??{n:5},p=av(a,ga,n),h=r?`until ${r}`:`until it succeeds (${t} is succeeded)`,v=!!r||!!e.retries,g;if(v){let m=l??{n:3};g=m.n===void 0?void 0:1+Math.max(0,m.n);let b=e_(f," apart");m.expr?s.push(`Tries up to 1 + ${m.expr} times, worked out at run time, ${b}, ${h}`):m.ref?s.push(`Tries up to ${m.ref} + 1 times (${g===void 0?`${m.ref} is given at run time`:`${g} with its default ${m.n}`}), ${b}, ${h}`):g===1?s.push(`Tries once (Retries 0), and fails unless ${r}`):s.push(`Tries up to ${g} times (once, then ${m.n} ${m.n===1?"retry":"retries"}${l===void 0?", Ansible's default":""}), ${b}, ${h}`)}else s.push("Runs once"),e.delay!==void 0&&s.push("Delay applies only with Retries or Until");if(p){let m=v&&g!==1?", and a try that runs over ends the step":"";p.ref||p.expr?s.push(`each try at most ${e_(p)}${m}`):p.n===void 0?s.push(`"${a}" is not a duration, so no try has a limit`):s.push(`each try at most ${a}${m}`)}if(v&&g!==void 0&&g>1&&p?.n!==void 0&&f.n!==void 0){let m=g*p.n+(g-1)*f.n,b=[l,f,p].some(w=>w?.ref);s.push(`the step takes at most ${B0(m)} in all${b?" with the defaults":""}`)}return`${s.join("; ")}.`}var R9=["integer","string","any"];function z9(e,t){let n=r=>typeof r=="number"&&Number.isInteger(r)?r:typeof r=="string"&&/^[0-9]+$/.test(r.trim())?Number(r):void 0;return r=>{let a=t.inputs?.[r];if(a?.default!==void 0)return n(a.default);let s=a?.from;return s?.startsWith("flow.")?n(e.inputs?.[s.slice(5)]?.default):void 0}}function F9(e,t){return e.filter(n=>{if(n.fields||n.expose)return!1;let r=n.field?.type??t.inputs?.[n.name]?.type;return r===void 0||R9.includes(r)})}function B9(e,t){let n=L0(e),r=n?t.inputs?.[n]?.from:void 0;return n&&r?.startsWith("flow.")?{input:n,flow:r.slice(5)}:void 0}function t_(e,t){let[n,r]=(0,T.useState)(e),a=(0,T.useRef)(n),s=(0,T.useRef)({});(0,T.useEffect)(()=>{a.current=e,s.current={},r(e)},[e]);let l=p=>{a.current=p,r(p)},f=()=>{s.current={},l(e)};return{draft:n,change:l,revert:f,commit:()=>{let p=a.current;if(p===e&&Object.keys(s.current).length===0)return;if(t.invalid?.(p)){f();return}let h=new Set(nC(p)),v=Object.fromEntries(Object.entries(s.current).filter(([g])=>h.has(g)));s.current={},t.onCommit(p,v)},addInput:p=>{p.field&&(s.current={...s.current,[p.name]:p.field})}}}function n_({label:e,value:t,choices:n,placeholder:r,problem:a,validate:s,onCommit:l}){let f=(0,T.useId)(),p=t_(t,{invalid:s,onCommit:l}),h=p.draft===t?a:s?.(p.draft);return(0,c.jsxs)("div",{className:"afd-field","data-expr-field":!0,children:[(0,c.jsx)("label",{htmlFor:f,children:e}),(0,c.jsx)(iu,{id:f,label:e,mode:"expr",value:p.draft,onChange:p.change,choices:n,onAddInput:p.addInput,onEnter:p.commit,onEscape:p.revert,onLeave:p.commit,placeholder:r}),h?(0,c.jsx)("div",{className:"afd-field-error",children:h}):null]})}function q9({node:e,flow:t,field:n,label:r,choices:a,problem:s,onCommit:l}){let f=(0,T.useId)(),p=e.settings?.[n.key],h=iv(p,n),[v,g]=(0,T.useState)(!1),{draft:m,change:b,revert:w,commit:k,addInput:S}=t_(h,{invalid:j=>Th(n,j),onCommit:(j,$)=>l(rv(n,j),$)}),N=m===h?s:Th(n,m),E=B9(p,e);return(0,c.jsxs)("div",{className:"afd-field afd-timing-field","data-timing-field":n.key,children:[(0,c.jsx)("label",{htmlFor:f,children:r}),(0,c.jsx)(iu,{id:f,label:r,value:m,onChange:b,choices:a,onAddInput:S,onEnter:k,onEscape:w,onLeave:k}),N?(0,c.jsx)("div",{className:"afd-field-error",id:`${f}-error`,children:N}):null,E?(0,c.jsxs)("p",{className:"muted afd-timing-asked","data-timing-asked":n.key,children:["Asked at run time: the flow input ",E.flow,H9(t?.inputs?.[E.flow]?.default,n.key),"."]}):v?(0,c.jsx)(W9,{node:e,field:n,value:p,onDone:()=>g(!1)}):(0,c.jsx)("button",{type:"button",className:"link afd-timing-ask","data-timing-ask":n.key,onClick:()=>g(!0),children:"Ask at Run Time\u2026"})]})}function H9(e,t){return e===void 0?", no default: whoever runs the flow gives it":`, default ${String(e)}${t==="retries"?"":" s"}`}var V9={retries:e=>`How many more times ${e} tries`,delay:e=>`Seconds between the tries of ${e}`,timeout:e=>`Seconds one try of ${e} may take`};function K9(e,t){if(typeof t=="number")return String(t);if(e==="timeout"&&typeof t=="string"){let n=ga(t);if(n!==void 0)return String(n)}return e==="retries"?"3":e==="delay"?"5":""}function W9({node:e,field:t,value:n,onDone:r}){let a=(0,T.useId)(),[s,l]=(0,T.useState)(`${e.key.replaceAll("-","_")}_${t.key}`),[f,p]=(0,T.useState)(V9[t.key](e.title)),[h,v]=(0,T.useState)(K9(t.key,n)),g=/^[A-Za-z_][A-Za-z0-9_]*$/.test(s)?void 0:"A variable name: letters, digits and _",m=/^[0-9]*$/.test(h.trim())?void 0:"A whole number, or empty";return(0,c.jsxs)("fieldset",{className:"afd-timing-askform","data-timing-askform":t.key,children:[(0,c.jsxs)("legend",{children:["Ask for ",t.label," at run time"]}),(0,c.jsxs)("p",{className:"muted",children:["A flow input, asked for when the flow runs (the launch dialog, an AWX survey), feeds this step's ",t.label,t.key==="retries"?"":" in seconds","."]}),(0,c.jsxs)("div",{className:"afd-field",children:[(0,c.jsx)("label",{htmlFor:`${a}-name`,children:"Input name"}),(0,c.jsx)("input",{id:`${a}-name`,className:`afd-input mono${g?" invalid":""}`,value:s,onChange:b=>l(b.target.value)}),g?(0,c.jsx)("div",{className:"afd-field-error",children:g}):null]}),(0,c.jsxs)("div",{className:"afd-field",children:[(0,c.jsx)("label",{htmlFor:`${a}-description`,children:"What it is for"}),(0,c.jsx)("input",{id:`${a}-description`,className:"afd-input",value:f,onChange:b=>p(b.target.value)})]}),(0,c.jsxs)("div",{className:"afd-field",children:[(0,c.jsxs)("label",{htmlFor:`${a}-default`,children:["Default",t.key==="retries"?"":" (seconds)","; empty: required"]}),(0,c.jsx)("input",{id:`${a}-default`,className:`afd-input mono${m?" invalid":""}`,inputMode:"numeric",value:h,onChange:b=>v(b.target.value)}),m?(0,c.jsx)("div",{className:"afd-field-error",children:m}):null]}),(0,c.jsxs)("div",{className:"afd-timing-askform-buttons",children:[(0,c.jsx)("button",{type:"button",disabled:!!g||!!m,onClick:()=>{g||m||(Pe({kind:"askAtRunTime",id:e.id,setting:t.key,name:s,...f.trim()?{description:f.trim()}:{},...h.trim()?{default:Number(h.trim())}:{}}),r())},children:"Ask at Run Time"}),(0,c.jsx)("button",{type:"button",className:"secondary",onClick:r,children:"Cancel"})]})]})}var U9=["","rollback","notify","retry","exclude"],o_=e=>{if(e==null)return"(none)";let t=typeof e=="string"?e:JSON.stringify(e);return t.length>140?`${t.slice(0,139)}\u2026`:t};function Y9({id:e}){let t=_(n=>n.outside?.changes?.find(r=>r.id===e));return!t||t.kind==="removed"?null:(0,c.jsxs)("p",{className:"afd-outside-step","data-outside-change":t.kind,children:[(0,c.jsx)("span",{className:"afd-swatch outside","aria-hidden":"true"})," Changed outside the designer:"," ",ty(t)]})}function X9({id:e}){let t=_(s=>s.lens==="changes"),n=_(s=>s.lensFacts.compare),r=_(s=>s.snapshot?.doc),a=(0,T.useMemo)(()=>t&&n?.state==="ready"&&n.base&&r?TC(n.base,r).nodes.find(s=>s.id===e):void 0,[t,n,r,e]);return!a||!n?null:(0,c.jsxs)("section",{className:"afd-section afd-node-changes","data-node-changes":a.kind,children:[(0,c.jsxs)("h3",{children:["Since ",n.label]}),a.kind==="added"?(0,c.jsx)("p",{className:"muted",children:"Added"}):(0,c.jsx)("dl",{children:a.fields.map(s=>(0,c.jsxs)("div",{children:[(0,c.jsx)("dt",{children:X0(s)}),(0,c.jsxs)("dd",{className:"mono",children:[o_(s.before)," \u2192 ",o_(s.after)]})]},s.field))})]})}function Z9({node:e,context:t,problems:n=[]}){let r=s=>{au(e.id,s)},a=e.type!=="start"&&e.type!=="end";return(0,c.jsxs)("div",{className:"afd-details-page",children:[(0,c.jsx)(X9,{id:e.id}),(0,c.jsx)(Y9,{id:e.id}),t?(0,c.jsx)("p",{className:"muted","data-level-context":e.id,children:"You are inside this subflow. Select a step to edit it; the subflow itself is described here."}):null,(0,c.jsx)(fn,{label:"Title",focusKey:"title",value:e.title,problem:tl(n,"title"),onCommit:s=>r({title:s}),validate:s=>s.trim()?void 0:"Required"}),(0,c.jsx)(fn,{label:"Key",value:e.key,mono:!0,problem:tl(n,"key"),onCommit:s=>r({key:s}),validate:s=>G0.test(s)?void 0:"Lowercase words joined by dashes"}),a?(0,c.jsx)(fn,{label:"Intent",value:e.intent??"",multiline:!0,onCommit:s=>r({intent:s.trim()?s:null})}):null,a?(0,c.jsx)(e7,{node:e,onSet:s=>s==="tested"?_.getState().setTestedReason(e.id):r({status:s})}):null,(0,c.jsx)(n7,{node:e,patch:r}),e.type==="subflow"&&!t?(0,c.jsxs)("section",{className:"afd-section",children:[(0,c.jsx)("h3",{children:"Inner steps"}),(0,c.jsx)("p",{className:"muted",children:e.subflow?.nodes?.length?`${e.subflow.nodes.length} step(s) inside.`:"No inner steps yet: open it and add the first one."}),(0,c.jsxs)("button",{type:"button",onClick:()=>_.getState().setLevel(e.id),children:[(0,c.jsx)("span",{className:"codicon codicon-arrow-right","aria-hidden":"true"})," Open Subflow"]})]}):null,(0,c.jsx)(Nr,{id:"node-details",summary:"More details: the ID",children:(0,c.jsx)(il,{label:"ID (fixed)",value:e.id,mono:!0})}),(0,c.jsx)(Q9,{id:e.id})]})}function G9({node:e}){return(0,c.jsxs)("div",{className:"afd-details-page",children:[(0,c.jsx)(Ry,{title:"Inputs",target:e.id,side:"inputs",contract:e.inputs,withFrom:!0}),(0,c.jsx)(Ry,{title:"Outputs",target:e.id,side:"outputs",contract:e.outputs,withFrom:!0})]})}function Q9({id:e}){let t=_(a=>a.run),n=t?.summary?.nodes[e],r=t?.summary?.failures.filter(a=>a.node===e)??[];return t?.state!=="done"||!n&&r.length===0?null:(0,c.jsxs)("section",{className:"afd-section","data-last-run":e,children:[(0,c.jsxs)("h3",{children:["Last ",t.mode==="check"?"skeleton run":"run"]}),(0,c.jsxs)("ul",{className:"afd-run-ports",children:[Object.entries(n??{}).map(([a,s])=>(0,c.jsxs)("li",{title:s.join(", "),children:[(0,c.jsx)("span",{className:"mono",children:a})," ",(0,c.jsx)("span",{className:"afd-chip",children:s.length})," ",(0,c.jsxs)("span",{className:"muted",children:[s.slice(0,4).join(", "),s.length>4?", \u2026":""]})]},a)),r.map(a=>(0,c.jsxs)("li",{className:"afd-run-failure",children:[(0,c.jsx)("span",{className:"codicon codicon-error","aria-hidden":"true"})," ",a.host,":"," ",a.msg??a.task]},`${a.host}|${a.task}`))]})]})}function au(e,t){return Pe({kind:"updateNode",id:e,patch:t})}function J9(e){if(e.run)return`Tested by run ${e.run}${e.flow_version===void 0?"":` of flow version ${e.flow_version}`}${e.commit?` at ${e.commit.slice(0,10)}`:""}`;let t=[e.by,e.at].filter(Boolean).join(", ");return`Tested by hand: ${e.reason??""}${t?` (${t})`:""}`}function e7({node:e,onSet:t}){let n=_(f=>f.snapshot?.doc),r=!!n&&Rt(n)>=2,a=e.status??"draft",s=ay.indexOf(a),l=r&&n?Jz(n,e):w5(e);return(0,c.jsxs)("section",{className:"afd-section","data-lifecycle":r?"derived":"manual",children:[(0,c.jsx)("h3",{children:"Lifecycle"}),(0,c.jsx)("ol",{className:`afd-stepper${r?" read":""}`,children:ay.map((f,p)=>(0,c.jsx)("li",{className:p<s?"done":p===s?"current":"",children:r?(0,c.jsx)("span",{"aria-current":p===s?"step":void 0,children:f}):(0,c.jsx)("button",{type:"button",onClick:()=>t(f),"aria-current":p===s?"step":void 0,title:`Set status to ${f}`,children:f})},f))}),r&&e.tested?(0,c.jsx)("p",{className:"muted","data-tested-record":!0,children:J9(e.tested)}):null,l?(0,c.jsxs)("p",{className:"muted",children:["Next: ",l]}):null,r&&n&&(a==="tested"||Qj(n,e))?(0,c.jsx)("div",{className:"afd-inline-actions",children:a==="tested"?(0,c.jsx)("button",{type:"button",className:"secondary",onClick:()=>t(Dd(e)),children:"Clear Tested"}):(0,c.jsxs)("button",{type:"button",className:"secondary",onClick:()=>t("tested"),children:[(0,c.jsx)("span",{className:"codicon codicon-verified","aria-hidden":"true"})," Mark Tested\u2026"]})}):null]})}function t7({node:e,patch:t}){let n=_(a=>a.snapshot?.doc),r=(0,T.useMemo)(()=>n?Gd(Ee(n),e).filter(a=>!a.expose):[],[n,e]);return(0,c.jsx)(n_,{label:"Condition (evaluated per host)",value:e.condition??"",choices:r,placeholder:"facts.version is version('17.9', '<')",onCommit:(a,s)=>t({condition:a.trim()?a:null,...Object.keys(s).length?{inputs:s}:{}})})}function r_(e,t){return{name:e,label:e,detail:"this step's result",fields:PE(t)}}function n7({node:e,patch:t}){switch(e.type){case"decision":return(0,c.jsx)(t7,{node:e,patch:t});case"end":return(0,c.jsxs)("div",{className:"afd-field",children:[(0,c.jsx)("label",{htmlFor:"afd-outcome",children:"Outcome"}),(0,c.jsxs)("select",{id:"afd-outcome",value:e.outcome??"success",onChange:n=>t({outcome:n.target.value}),children:[(0,c.jsx)("option",{value:"success",children:"success"}),(0,c.jsx)("option",{value:"failed",children:"failed"})]})]});case"join":return(0,c.jsxs)("div",{className:"afd-field",children:[(0,c.jsx)("label",{htmlFor:"afd-join",children:"Join mode (per host)"}),(0,c.jsxs)("select",{id:"afd-join",value:e.join_mode??"all",onChange:n=>t({join_mode:n.target.value}),children:[(0,c.jsx)("option",{value:"all",children:"all: every branch delivered the host"}),(0,c.jsx)("option",{value:"any",children:"any: at least one branch"})]})]});case"parallel":return(0,c.jsx)(fn,{label:"Branches",value:String(e.branches??2),onCommit:n=>t({branches:Number(n)}),validate:n=>/^[0-9]+$/.test(n)&&Number(n)>=2?void 0:"At least 2"});case"approval":return(0,c.jsx)(o7,{node:e,patch:t});case"task":case"subflow":return(0,c.jsxs)("div",{className:"afd-field",children:[(0,c.jsx)("label",{htmlFor:"afd-purpose",children:"Purpose in failure handling"}),(0,c.jsx)("select",{id:"afd-purpose",value:Od(e)??"",onChange:n=>t({purpose:n.target.value||null}),children:U9.map(n=>(0,c.jsx)("option",{value:n,children:n||"none"},n))})]});default:return null}}var i_=e=>e.split(/[,\n]/).map(t=>t.trim()).filter(Boolean);function o7({node:e,patch:t}){let n=e.approval??{},r=a=>t({approval:{...n,...a}});return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(fn,{label:"Approvers \xB7 users or groups who may decide (commas between); empty: whoever the runner lets approve",value:(n.approvers??[]).join(", "),placeholder:"change-board, dana",onCommit:a=>r({approvers:i_(a)})}),(0,c.jsx)(fn,{label:"Notify \xB7 users or groups told it waits, beside the approvers",value:(n.notify??[]).join(", "),placeholder:"netops-oncall",onCommit:a=>r({notify:i_(a)})}),(0,c.jsx)(fn,{label:"Message \xB7 what the approvers check before deciding",value:n.message??"",multiline:!0,placeholder:"Check the change ticket and the maintenance window",onCommit:a=>r({message:a})}),(0,c.jsx)("p",{className:"muted","data-approval-note":!0,children:"Ansible Flow Server asks these people. AWX workflows set their approvers in AWX; local runs approve by themselves."})]})}function r7({model:e,node:t,port:n,target:r,reason:a}){let s=_(v=>v.openPortMenu),l={node:t,port:n.name},f=n.state==="connected"&&n.direction==="out",p=ch[n.state];f?p=`\u2192 ${r}`:a?p=`${ch[n.state]}: ${a}`:n.state==="open-fail"&&(p="open: wire it to a handler, or Accept with Reason\u2026");let h=n.state==="open-fail"?(Ld(e,l)?.items??[]).filter((v,g)=>v.kind==="pattern"&&g<2||v.kind==="decide"):[];return(0,c.jsxs)("li",{className:`state-${n.state}`,"data-port-row":n.name,children:[(0,c.jsx)("span",{className:`afd-swatch port state-${n.state} tone-${n.tone}`,"aria-hidden":"true"}),(0,c.jsx)("span",{className:"mono",title:ka(n.name,e.nodes.get(t)?.node.type),children:n.name}),(0,c.jsx)("span",{className:"muted",children:p}),(0,c.jsx)("button",{type:"button",className:"icon","aria-label":`Options for port ${n.name}`,title:"Options",onClick:v=>{let g=v.currentTarget.getBoundingClientRect();s({ref:l,x:g.left-230,y:g.bottom+4})},children:(0,c.jsx)("span",{className:"codicon codicon-ellipsis","aria-hidden":"true"})}),h.length>0?(0,c.jsx)("span",{className:"afd-port-quick",children:h.map(v=>(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>{ol(v,l)},children:v.label},v.label))}):null]})}function i7({id:e}){let t=_(f=>f.snapshot);if(!t?.doc)return null;let n=Ee(t.doc),r=n.nodes.get(e);if(!r)return null;let a=cn(t,{},r.level).nodes.find(f=>f.node.id===e),s=n.levels.get(r.level)?.edges??[],l=t.doc.decisions??[];return(0,c.jsx)("div",{className:"afd-details-page",children:(0,c.jsx)("ul",{className:"afd-ports",children:a?.ports.map(f=>(0,c.jsx)(r7,{model:n,node:e,port:f,target:n.nodes.get(s.find(p=>p?.from?.node===e&&p.from.port===f.name)?.to.node??"")?.node.title??"",reason:l.find(p=>p?.node===e&&p.port===f.name)?.reason},f.name))})})}var a7=e=>e.charAt(0).toLowerCase()+e.slice(1);function s7(e,t,n){return`${e}${t.length===1&&t[0]?.toLowerCase()===e.toLowerCase()?"":`: ${t.join(", ")}`}${n?` \xB7 ${n} set`:""}`}function l7({node:e,problems:t=[]}){let n=(j,$)=>{au(e.id,{settings:{[j]:$}})},r=e.settings??{},a=_(j=>j.snapshot?.doc?Rt(j.snapshot.doc):1),s=e.type==="task"||e.type==="subflow"&&!e.subflow?.nodes?.length,l=j=>P9.filter($=>$.group===j&&($.format??1)<=a&&a<=($.formatMax??a)&&(Q$($,e)||r[$.key]!==void 0)),f=O9.filter(j=>l(j).length>0),p=j=>l(j).filter($=>r[$.key]!==void 0).length,h=e.impl?.kind==="module"&&e.impl.ref?e.impl.ref:void 0,v=xi(h?{op:"doc",fqcn:h}:null,`doc:module:${h}`),g=Ys(e),m=Object.keys(v.data?.returns??{}),b=m.includes("stdout")?`'ready' in ${g}.stdout`:m.includes("rc")?`${g}.rc == 0`:`${g} is succeeded`,w=_(j=>j.snapshot?.doc),k=I9(r,g,w?z9(w.flow,e):void 0),S=(0,T.useMemo)(()=>w?F9(Gd(Ee(w),e),e):[],[w,e]),N=(0,T.useMemo)(()=>[...w?Gd(Ee(w),e).filter(j=>!j.expose):[],r_(g,v.data?.returns)],[w,e,g,v.data]),E=(0,T.useMemo)(()=>!!w&&CC(Ee(w),e)&&!Ws(w).some(j=>j.area==="lens"&&j.what===`access:become:${e.id}`),[w,e]);return(0,c.jsxs)("div",{className:"afd-details-page",children:[f.map(j=>(0,c.jsx)("section",{className:"afd-section","data-setting-group":j,children:(0,c.jsxs)(Nr,{id:`execution-${j}`,open:f.length===1||p(j)>0||l(j).some($=>tl(t,`settings.${$.key}`)),defaultOpen:j==="Timing"&&!!h,summary:s7(j,l(j).map($=>a7($.label)),p(j)),children:[l(j).map($=>{let L=r[$.key],z=Q$($,e)?void 0:(0,c.jsxs)("p",{className:"muted","data-setting-unused":$.key,children:["Not used on a ",yo[e.type].toLowerCase()," node: clear it."]});if($.kind==="bool")return(0,c.jsxs)("div",{children:[(0,c.jsxs)("label",{className:"afd-check",children:[(0,c.jsx)("input",{type:"checkbox",checked:L===!0,onChange:M=>n($.key,M.target.checked?!0:null)}),$.label," ",(0,c.jsx)("span",{className:"muted",children:$.help})]}),z]},$.key);let A=$.key==="until";return ov.includes($.key)&&e.type!=="approval"&&!z?(0,c.jsxs)("div",{children:[(0,c.jsx)(q9,{node:e,flow:w?.flow,field:$,label:`${$.label} \xB7 ${$.help}`,choices:S,problem:tl(t,`settings.${$.key}`),onCommit:(M,O)=>{au(e.id,{settings:{[$.key]:M},...Object.keys(O).length?{inputs:O}:{}})}}),z]},$.key):A?(0,c.jsxs)("div",{children:[(0,c.jsx)(n_,{label:`${$.label} \xB7 ${$.help}; it reads ${g} (the result) and the inputs`,value:iv(L,$),choices:N,placeholder:b,problem:tl(t,`settings.${$.key}`),validate:M=>Th($,M,e.type!=="approval"),onCommit:(M,O)=>{au(e.id,{settings:{[$.key]:rv($,M)},...Object.keys(O).length?{inputs:O}:{}})}}),z]},$.key):(0,c.jsxs)("div",{children:[(0,c.jsx)(fn,{label:`${$.label} \xB7 ${$.key==="timeout"&&e.type==="approval"?"How long the approval waits (in AWX or on the server) before its hosts take the timeout port (30m, 4h)":$.help}`,value:iv(L,$),mono:!0,problem:tl(t,`settings.${$.key}`),validate:M=>Th($,M,e.type!=="approval"),onCommit:M=>n($.key,rv($,M))}),z]},$.key)}),j==="Privilege"&&E?(0,c.jsxs)("p",{className:"muted","data-become-flagged":!0,children:["The Access lens flags this step's Become: none of the steps wired to it run as root. If it needs root, accept the finding with a reason, so others know why."," ",(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>_.getState().setAccept({id:`access:become:${e.id}`,node:e.id,title:`${e.title} escalates privileges, unlike its neighbours`}),children:"Accept with Reason\u2026"})]}):null,j==="Timing"&&k?(0,c.jsx)("p",{className:"muted afd-timing-text","data-timing-text":!0,children:k}):null]})},j)),s?(0,c.jsx)(u7,{node:e}):null]})}var d7=[{key:"when",line:"when: ",help:"Run only on hosts where this test holds (no braces)"},{key:"loop",line:`loop:
|
|
198
|
+
- `,help:"Run once for each item of a list: parameters read the item as {{ item }}"},{key:"no_log",line:"no_log: true",help:"Keep what the step reads and returns out of logs and run output",commit:!0},{key:"ignore_errors",line:"ignore_errors: true",help:"A failure does not stop the host: it goes on through ok_hosts",commit:!0},{key:"delegate_to",line:"delegate_to: localhost",help:"Run the task on another host (like localhost), once for each host that arrives",select:9},{key:"run_once",line:"run_once: true",help:"Run the task on one host only, for all of them",commit:!0},{key:"changed_when",line:"changed_when: false",help:"When the step counts as changed (false: never, for a step that only reads)",select:5}];function u7({node:e}){let t=(0,T.useId)(),n=(0,T.useRef)(null),r=e.impl,a=_(m=>m.snapshot?.doc),s=r?.kind==="module"&&r.ref?r.ref:void 0,l=xi(s?{op:"doc",fqcn:s}:null,`doc:module:${s}`),f=Ys(e),p=(0,T.useMemo)(()=>[...a?Gd(Ee(a),e).filter(m=>!m.expose):[],...s?[r_(f,l.data?.returns)]:[]],[a,e,s,f,l.data]),h=(0,T.useRef)({}),v=Object.keys(r?.keywords??{}),g=r?.ref?r.kind==="playbook"?"A playbook binding takes no task keywords (import_playbook has none).":void 0:"Bind a module or role first: task keywords go on the task the binding generates.";return(0,c.jsx)("section",{className:"afd-section","data-keywords":!0,children:(0,c.jsx)(Nr,{id:"execution-keywords",open:v.length>0,summary:`Task keywords: when, loop, no_log\u2026${v.length?` \xB7 ${v.length} set`:""}`,children:g||!r?(0,c.jsxs)("div",{className:"afd-field","data-keywords-blocked":!0,children:[(0,c.jsx)("label",{htmlFor:t,children:"Task keywords"}),(0,c.jsx)("textarea",{id:t,className:"afd-input mono",rows:2,disabled:!0,"aria-describedby":`${t}-why`}),(0,c.jsx)("p",{id:`${t}-why`,className:"muted",children:g})]}):(0,c.jsxs)("div",{className:"afd-field",children:[(0,c.jsxs)("label",{htmlFor:t,children:["Task keywords \xB7 ",(0,c.jsx)("span",{className:"muted",children:"YAML written on the generated task"})]}),(0,c.jsxs)("fieldset",{className:"afd-keyword-chips",children:[(0,c.jsx)("legend",{className:"afd-sr-only",children:"Add a task keyword"}),d7.map(m=>(0,c.jsxs)("button",{type:"button",className:"chip-button mono",title:m.help,"data-keyword-chip":m.key,disabled:v.includes(m.key),onClick:()=>n.current?.add(m.line,{commit:m.commit,select:m.select}),children:["+ ",m.key]},m.key))]}),(0,c.jsx)(tv,{ref:n,id:t,rows:4,bareKeys:l4,choices:p,onAddInput:m=>{m.field&&(h.current={...h.current,[m.name]:m.field})},value:r.keywords,placeholder:`when: version_check.stdout is version("17.9", "<")
|
|
199
|
+
loop: "{{ interfaces }}"`,validate:m=>{if(m!=null){if(typeof m!="object"||Array.isArray(m))return"A map of keyword: value";for(let b of Object.keys(m)){let w=p4(b);if(w)return w}}},onChange:m=>{let b=JSON.stringify(m??null),w=Object.fromEntries(Object.entries(h.current).filter(([k])=>RegExp(`\\b${k}\\b`).test(b)));h.current={},au(e.id,{keywords:m??null,...Object.keys(w).length?{inputs:w}:{}})}},JSON.stringify(r.keywords??null))]})})})}var a_={code:"Code",run:"Run",general:"General",binding:"Binding",io:"Inputs and outputs",ports:"Ports",execution:"Execution"};function c7(e,t){let n=e.type==="task"||e.type==="subflow",r=e.type!=="start"&&e.type!=="end",a=["general"];return n&&a.push("binding"),r&&a.push("io"),a.push("ports"),r&&a.push("execution"),t==="code"?["code",...a]:t==="run"?["run",...a]:a}var f7={code:"code",run:"runs",general:"canvas",binding:"binding",io:"io",ports:"patterns",execution:"execution"};function h7({id:e,context:t}){let n=_(I=>I.snapshot),r=_(I=>I.mode),a=_(I=>!!I.run),s=_(I=>I.detailsTab),l=_(I=>I.setDetailsTab),f=_(I=>I.expanded),p=_(I=>I.leave),h=_(I=>I.bindKind?.node===e?I.bindKind.kind:void 0),v=wa(),g=hh(),m=D5(e),b=m?.node,[w,k]=(0,T.useState)(()=>b?{...Xd(b),...h&&!b.impl?{kind:h}:{}}:void 0),[S,N]=(0,T.useState)(!1),E=n?.docVersion??0,[j,$]=(0,T.useState)(null);(0,T.useEffect)(()=>{j!==null&&E>j&&b&&(k(Xd(b)),$(null))},[j,E,b]),(0,T.useEffect)(()=>{b&&!w&&k(Xd(b))},[b,w]);let L=b?.type==="task"||b?.type==="subflow",z=!!b&&!!w&&L&&R6(b,w);if((0,T.useEffect)(()=>{_.getState().setPendingBinding(z?e:null)},[z,e]),(0,T.useEffect)(()=>()=>{_.getState().pendingBinding===e&&_.getState().setPendingBinding(null)},[e]),!n?.doc||!g||!m||!b||!w)return null;let A=c7(b,r),M=A.includes(s)?s:A[0],O=n.plays?.[e],K=yE(n.findings,e,m.path),B=v&&!!n.doc&&Rt(n.doc)>=2,V=new Set(K.map(I=>I.tab)),oe=!v||r==="run"||r==="code"&&M!=="binding",F=async()=>{N(!0);let I=E,U=await Pe(z6(b,w));return N(!1),U.ok&&$(I),U.ok},J=()=>k(Xd(b));return(0,c.jsxs)("div",{className:"afd-details","data-details":e,"data-inspector":e,children:[r==="run"&&a?(0,c.jsx)("div",{className:"afd-inspector-head","data-back-to-run":!0,children:(0,c.jsxs)("button",{type:"button",className:"link",onClick:()=>_.getState().select({}),children:[(0,c.jsx)("span",{className:"codicon codicon-arrow-left","aria-hidden":"true"})," Run Results"]})}):null,(0,c.jsxs)("header",{className:"afd-details-head",children:[(0,c.jsxs)("div",{className:"afd-details-name",children:[(0,c.jsx)(gh,{status:b.status??"draft"}),(0,c.jsx)("h2",{children:b.title})]}),(0,c.jsxs)("div",{className:"afd-details-bar",children:[(0,c.jsxs)("span",{className:"afd-chip",children:[yo[b.type]," \xB7 ",b.status??"draft"]}),(0,c.jsxs)("div",{className:"afd-details-actions",children:[(0,c.jsx)(Sa,{topic:f7[M],about:`the ${a_[M]} tab`}),O?(0,c.jsx)("button",{type:"button",className:"icon",title:"Peek Code: the node's play in its generated file","aria-label":"Peek Code",onClick:()=>je({type:"peekCode",node:e}),children:(0,c.jsx)("span",{className:"codicon codicon-code","aria-hidden":"true"})}):null,(0,c.jsx)("button",{type:"button",className:"icon",title:"Open in Text Editor","aria-label":"Open in Text Editor",onClick:()=>je({type:"openText",path:m.path}),children:(0,c.jsx)("span",{className:"codicon codicon-go-to-file","aria-hidden":"true"})}),(0,c.jsx)("button",{type:"button",className:"icon",title:`Copy (${Na("copy")}): paste on a flow (${Na("paste")}) or in a text file`,"aria-label":"Copy node",onClick:()=>Kd(),children:(0,c.jsx)("span",{className:"codicon codicon-copy","aria-hidden":"true"})}),r==="run"?null:(0,c.jsx)("button",{type:"button",className:"icon",title:"Delete node","aria-label":"Delete node",disabled:!v,onClick:()=>{Ud([e])},children:(0,c.jsx)("span",{className:"codicon codicon-trash","aria-hidden":"true"})}),(0,c.jsx)("button",{type:"button",className:"icon",title:f?"Narrow the panel again":"Widen the panel (for the catalog docs)","aria-label":f?"Collapse the panel":"Expand the panel","aria-pressed":f,onClick:()=>_.getState().setExpanded(!f),children:(0,c.jsx)("span",{className:`codicon codicon-${f?"screen-normal":"screen-full"}`,"aria-hidden":"true"})})]})]})]}),z?(0,c.jsxs)("div",{className:"afd-pending",role:"status","data-pending-binding":e,children:[(0,c.jsx)("span",{children:"The binding is not saved."}),(0,c.jsx)("button",{type:"button",className:"secondary",onClick:J,children:"Discard"}),(0,c.jsx)("button",{type:"button",disabled:S,onClick:()=>{F()},"data-save-binding":!0,children:"Save Binding"})]}):null,K.length>0?(0,c.jsx)("ul",{className:"afd-node-problems","aria-label":"Problems of this node","data-node-problems":e,children:K.map(I=>(0,c.jsxs)("li",{children:[(0,c.jsxs)("button",{type:"button",className:"link",onClick:()=>A.includes(I.tab)&&l(I.tab),children:[(0,c.jsx)("span",{className:`codicon codicon-${I.finding.severity==="error"?"error":"warning"}`,role:"img","aria-label":I.finding.severity})," ",I.finding.message]}),B&&I.finding.severity==="warning"&&I.finding.code!=="open-fail-port"?(0,c.jsx)("button",{type:"button",className:"link afd-accept-problem",title:"Keep it as it is, with a reason",onClick:()=>_.getState().setAccept({id:`${I.finding.code}|${I.finding.subject??""}`,node:e,title:I.finding.message,check:{code:I.finding.code,...I.finding.subject?{subject:I.finding.subject}:{}}}),children:"Accept\u2026"}):null]},`${I.finding.code}|${I.finding.path.join(".")}|${I.finding.port??""}`))}):null,(0,c.jsx)("div",{className:"afd-props-tabs",role:"tablist","aria-label":"Details",onKeyDown:RE,children:A.map(I=>(0,c.jsxs)("button",{type:"button",role:"tab",id:`afd-tab-${I}`,"aria-selected":M===I,tabIndex:M===I?0:-1,"aria-controls":"afd-details-panel",className:M===I?"active":"",onClick:()=>l(I),children:[a_[I],I==="binding"&&z?(0,c.jsx)("span",{className:"afd-dirty",title:"Not saved"}):null,V.has(I)?(0,c.jsx)("span",{className:"afd-tab-problem",title:"Has problems"}):null]},I))}),(0,c.jsxs)("div",{className:"afd-details-body",role:"tabpanel",id:"afd-details-panel","aria-labelledby":`afd-tab-${M}`,children:[(0,c.jsx)(CB,{id:e},e),M==="code"?(0,c.jsx)(sB,{id:e}):M==="run"?(0,c.jsx)(DB,{id:e}):(0,c.jsx)("fieldset",{className:"afd-editable",disabled:oe,children:M==="binding"?(0,c.jsx)(w9,{node:b,model:g,draft:w,setDraft:k}):M==="io"?(0,c.jsx)(G9,{node:b}):M==="ports"?(0,c.jsx)(i7,{id:e}):M==="execution"?(0,c.jsx)(l7,{node:b,problems:K}):(0,c.jsx)(Z9,{node:b,context:t,problems:K})})]}),r==="design"&&g&&p7(g,e)>=3?(0,c.jsx)("div",{className:"afd-details-page afd-details-hint",children:(0,c.jsx)(i$,{})}):null,p&&z?(0,c.jsx)(m7,{title:b.title,saving:S,save:F,discard:J}):null]})}function p7(e,t){let n=e.nodes.get(t)?.level;return[...e.nodes.values()].filter(r=>r.level===n&&r.node.type!=="start"&&r.node.type!=="end").length}function m7(e){let t=(0,T.useRef)(null),n=nl(t);return(0,c.jsx)("div",{className:"afd-modal-backdrop",children:(0,c.jsxs)("div",{ref:t,className:"afd-modal",role:"alertdialog","aria-modal":"true","aria-labelledby":"afd-leave-title","data-leave-binding":!0,onKeyDown:n,children:[(0,c.jsx)("h2",{id:"afd-leave-title",children:"Discard the binding change?"}),(0,c.jsxs)("p",{className:"muted",children:['The binding of "',e.title,'" has a change that is not saved yet. Leaving now drops it.']}),(0,c.jsxs)("div",{className:"afd-modal-actions",children:[(0,c.jsx)("button",{type:"button",className:"secondary",autoFocus:!0,onClick:()=>_.getState().resolveLeave("stay"),children:"Keep Editing"}),(0,c.jsx)("button",{type:"button",className:"secondary","data-leave-discard":!0,onClick:()=>{e.discard(),_.getState().resolveLeave("go")},children:"Discard"}),(0,c.jsx)("button",{type:"button",disabled:e.saving,onClick:()=>{e.save().then(r=>r&&_.getState().resolveLeave("go"))},children:"Save Binding"})]})]})})}function g7(e){let t=[...document.querySelectorAll("[data-node-id]")].map(s=>{let l=[...s.querySelectorAll("[data-port]")],f=p=>l.filter(p).map(h=>h.dataset.port??"");return{id:s.dataset.nodeId??"",legal:f(()=>!0),ports:f(p=>p.dataset.portState!=="available"),rest:f(p=>p.dataset.rest==="true")}}),n=document.querySelector("[data-banner-count]"),r=document.querySelector("[data-frame]"),a=document.querySelector("[data-id-gaps]");return{docVersion:e,level:_.getState().level,nodes:t,edges:document.querySelectorAll(".react-flow__edge").length,wires:Object.fromEntries([...document.querySelectorAll(".react-flow__edge[data-id]")].map(s=>[s.dataset.id??"",s.querySelector(".react-flow__edge-path")?.getAttribute("d")??""])),annotations:document.querySelectorAll("[data-annotation-id]").length,banner:n?Number(n.dataset.bannerCount):null,idGaps:a?Number(a.dataset.idGaps):null,frame:r?{ports:[...r.querySelectorAll("[data-frame-port]")].filter(s=>s.dataset.portState!=="available").map(s=>s.dataset.framePort??""),wires:document.querySelectorAll(".afd-boundary-edge").length}:null,run:_.getState().mode==="run"?{nodes:Object.fromEntries([...document.querySelectorAll("[data-node-id]")].map(s=>[s.dataset.nodeId??"",s.dataset.runState??""])),wires:Object.fromEntries([...document.querySelectorAll(".react-flow__edge[data-id]")].map(s=>[s.dataset.id??"",s.querySelector(".react-flow__edge-text")?.textContent??""]))}:void 0,lens:y7()}}function y7(){let e=_.getState();if(!e.lens)return;let t=[...document.querySelectorAll("[data-node-id]")];return{lens:e.lens,chips:Object.fromEntries(t.map(n=>{let r=n.dataset.lens??"";return[n.dataset.nodeId??"",r?r.split("|"):[]]})),findings:[...document.querySelectorAll("[data-finding]")].map(n=>`${n.dataset.finding}${n.dataset.accepted?" (accepted)":""}`),dataWires:document.querySelectorAll(".afd-data-edge").length,highlighted:t.filter(n=>n.classList.contains("lens-hit")).map(n=>n.dataset.nodeId??""),card:[...document.querySelectorAll("[data-summary-card] dt")].map(n=>`${n.textContent}: ${n.nextElementSibling?.textContent??""}`)}}function s_(e){let t=_.getState();return t.snapshot?cn(t.snapshot,t.optimistic,t.level).nodes.filter(n=>e.includes(n.node.id)).map(n=>({id:n.node.id,x:Math.round(n.position.x),y:Math.round(n.position.y),...C0(n.node.type)})):[]}async function l_(e,t){let n=_.getState();if(!n.snapshot?.doc)return;if(Object.keys(e).length===0){n.notify("info",t);return}let r={...xa(cn(n.snapshot,n.optimistic,n.level),n.snapshot.doc.layout),...e};n.setOptimistic(r);let a=await Pe({kind:"moveNodes",positions:r});a.ok||(_.getState().dropOptimistic(r),n.setError(a.error??"The steps could not be moved"))}function sv(e,t=_.getState().selection.nodes??[]){if(!(!Yt()||t.length<2))return l_(yz(s_(t),e),"The steps are lined up already")}function lv(e,t=_.getState().selection.nodes??[]){if(!(!Yt()||t.length<3))return l_(vz(s_(t),e),"The gaps are even already")}async function d_(e){let t=_.getState(),n=e.filter(a=>t.snapshot?.doc?.layout?.[a]);if(!Yt()||n.length===0)return;let r=await Pe({kind:"unplaceNodes",ids:n});r.ok||t.setError(r.error??"The positions could not be reset")}var v7='input, textarea, select, [contenteditable="true"]';function b7(){let e=_.getState(),t=s5.find(n=>HC(e,n));if(t)_.setState({[t]:qC[t]});else if(e.leave)e.resolveLeave("stay");else if(e.preview)e.setPreview(null);else if(e.selection.node||e.selection.nodes||e.selection.edge||e.selection.annotations?.length)e.select({});else return!1;return!0}function x7(){let e=_.getState(),{selection:t}=e,n=s=>document.querySelector(s)?.getBoundingClientRect(),r=n(".react-flow");if(!r)return;let a={x:r.left+r.width/2,y:r.top+r.height/3};if(t.nodes?.length){let s=n(`.react-flow__node[data-id="${t.nodes[0]}"]`);e.openContextMenu({target:{kind:"nodes",ids:t.nodes},x:s?s.left+12:a.x,y:s?s.bottom:a.y})}else if(t.node){let s=n(`.react-flow__node[data-id="${t.node}"]`);e.openContextMenu({target:{kind:"node",id:t.node},x:s?s.left+12:a.x,y:s?s.bottom:a.y})}else if(t.annotations?.length){let[s]=t.annotations,l=n(`.react-flow__node[data-id="${s}"]`);e.openContextMenu({target:t.annotations.length>1?{kind:"annotations",ids:t.annotations}:{kind:"annotation",id:s},x:l?l.left+12:a.x,y:l?l.bottom:a.y})}else e.openContextMenu({target:{kind:"pane"},x:a.x,y:a.y})}var u_={Digit1:"design",Digit2:"code",Digit3:"run"};function w7(){let e=n=>{if(n.defaultPrevented)return;let r=n.target,a=()=>{n.preventDefault(),n.stopPropagation()};if((vo?n.metaKey:n.ctrlKey)&&!n.altKey&&!n.shiftKey&&n.key.toLowerCase()==="f"){a(),_.getState().openFind(!0);return}if(r?.closest?.(v7))return;if(n.key==="Escape"){b7()&&a();return}if(r?.closest?.(".nokey"))return;let s=_.getState(),l=vo?n.metaKey:n.ctrlKey;if((n.key==="Delete"||n.key==="Backspace")&&!l&&!n.altKey){if(n.repeat)return a();let f=Wd(),p=fy(),h=s.selection.edge;Yt()&&(f.length>0||p.length>0||h)&&(a(),Ud(f,h?[h]:[],p,!n.shiftKey))}else if(n.key==="F2"&&!l&&!n.altKey){let f=Wd(),p=fy();f.length===1&&f[0]&&s.mode==="design"?(a(),py(f[0])):f.length===0&&p.length===1&&p[0]&&Yt()&&(a(),uh(p[0]))}else if(l&&!n.altKey&&!n.shiftKey&&n.key.toLowerCase()==="d"){if(n.repeat)return a();let f=Wd(),p=fy();f.length+p.length>0&&(a(),eE(f,p))}else if(l&&!n.altKey&&!n.shiftKey&&n.key.startsWith("Arrow"))oE(n.key==="ArrowUp"||n.key==="ArrowLeft"?"up":"down")&&a();else if(n.altKey&&!l&&n.key==="ArrowUp")a(),hy();else if(n.key==="?"&&!l&&!n.altKey)a(),s.showCheatSheet(!0);else if(l&&!n.altKey&&!n.shiftKey&&n.key.toLowerCase()==="a"){if(r&&r!==document.body&&!r.closest?.(".react-flow"))return;a(),tE()}else if(n.key.toLowerCase()==="d"&&!l&&!n.altKey&&!n.shiftKey){let f=Wd();if(!Yt()||f.length===0)return;if(n.repeat)return a();a(),C5(f)}else if(n.key.toLowerCase()==="n"&&!l&&!n.altKey&&n.shiftKey){if(!Yt())return;a();let f=s.selection.node;Yd("note",f?void 0:dy(),f)}else if(n.key.toLowerCase()==="n"&&!l&&!n.altKey&&!n.shiftKey){if(!Yt())return;a(),_y()}else if(n.altKey&&n.shiftKey&&!l&&(n.code==="KeyA"||n.code==="KeyD")){let f=Wd();if(!Yt()||f.length<(n.code==="KeyA"?2:3))return;a(),n.code==="KeyA"?sv("center",f):lv("vertical",f)}else n.altKey&&!l&&!n.shiftKey&&u_[n.code]&&(a(),WC(u_[n.code]))},t=n=>{n.defaultPrevented||(n.target===document.body||n.target===document.documentElement)&&(n.preventDefault(),x7())};return document.addEventListener("keydown",e),document.addEventListener("contextmenu",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("contextmenu",t)}}var c_={failed:"Fail for",unreachable:"Unreachable for",timeout:"Time Out for",unchanged:"Unchanged for"};function k7(e,t,n){let r=e.nodes.get(t)?.node,a=n.path(t);if(!r||!a)return[];let s=(v,g)=>`${v}\u2026${g.length?` (${g.join(", ")})`:""}`,l=new Set(Ks(r).map(v=>v.name)),f=[],p=(v,g,m)=>{let b=n.forced(a,v);f.push(Te(s(g,b),{do:"scenarioForce",step:a,outcome:v,title:g},{icon:m,checked:b.length>0}))},h=r.type==="subflow"&&(r.subflow?.nodes?.length??0)>0;if(r.type==="task"||r.type==="subflow"&&!h){p("failed",c_.failed,"error");for(let v of["unreachable","timeout","unchanged"])l.has(v)&&p(v,c_[v],"warning")}else if(r.type==="decision")p("false","Take False for","git-compare");else if(r.type==="approval"){let v=n.approval(a);for(let[g,m]of[["approved","Approved"],["rejected","Rejected"],["timeout","Timed Out"]])(g==="approved"||l.has(g))&&f.push(Te(`${m} in This Scenario`,{do:"scenarioApproval",approval:a,pick:g},{checked:v===g}))}else if(r.type==="end")for(let v of n.hosts)f.push(Te(`Expect ${v} Here`,{do:"scenarioExpect",host:v,where:a},{checked:n.expect[v]===a}));return f.length===0?[]:[{type:"submenu",label:`In "${n.name}"`,icon:"beaker",items:f}]}var su="Fix the YAML errors first";function Te(e,t,n={}){return{type:"item",label:e,action:t,...n}}function lu(...e){let t=[];for(let n of e.filter(r=>r.length>0))t.length>0&&t.push({type:"separator"}),t.push(...n);return t}var S7={pattern:"zap",quickAdd:"add",insert:"insert",pick:"link",disconnect:"debug-disconnect",decide:"pass",reopen:"discard"};function f_(e,t,n){return(Ld(e,t)?.items??[]).filter(r=>r.kind!=="later"&&(!n||n.includes(r.kind))).map(r=>Te(r.label,{do:"port",ref:t,item:r},{icon:S7[r.kind]}))}function h_(e,t){let n=new Set(t);return(e.levels.get(e.nodes.get(t[0])?.level??"root")?.edges??[]).some(r=>r&&n.has(r.from?.node)!==n.has(r.to?.node))}function N7(e,t,n){let r=e.nodes.get(t)?.node;if(!r)return[];let a=n.mode==="design",s=n.stale?{disabled:n.why??su}:{},l=r.type==="start"||r.type==="end",f=[];r.type==="subflow"&&f.push(Te("Open Subflow",{do:"openSubflow",node:t},{icon:"arrow-right",shortcut:"open"})),(r.type==="task"||r.type==="subflow")&&(f.push(Te("Details\u2026",{do:"properties",node:t},{icon:"settings-gear",...r.type==="subflow"?{}:{shortcut:"open"}})),n.mode!=="run"&&f.push(Te("Binding\u2026",{do:"properties",node:t,tab:"binding"},{icon:"plug"})));let p=e.levels.get(e.nodes.get(t)?.level??"root"),h=[];a&&(p?.edges??[]).some(N=>N?.to?.node===t)&&h.push(Te("Select Upstream",{do:"selectFlow",node:t,dir:"up"},{icon:"arrow-up"})),a&&(p?.edges??[]).some(N=>N?.from?.node===t)&&h.push(Te("Select Downstream",{do:"selectFlow",node:t,dir:"down"},{icon:"arrow-down"}));let v=[];if(n.mode==="design"&&v.push(Te("Rename",{do:"rename",node:t},{icon:"edit",shortcut:"rename",...s})),a&&!l&&Rt(e.doc)>=2?r.status==="tested"?v.push(Te("Clear Tested",{do:"setStatus",node:t,status:Dd(r)},{icon:"circle-large-outline",...s})):Qj(e.doc,r)&&v.push(Te("Mark Tested\u2026",{do:"setStatus",node:t,status:"tested"},{icon:"verified",...s})):a&&!l&&v.push({type:"submenu",label:"Status",icon:"circle-large-outline",items:Yj.map(N=>Te(N,{do:"setStatus",node:t,status:N},{checked:r.status===N,...s}))}),a&&!n.stale)for(let N of n.openPorts.filter(E=>E.node===t))v.push({type:"submenu",label:`Open Port ${N.port}`,icon:"warning",items:f_(e,{node:t,port:N.port})});let g=a?Gf(e,t):void 0;if(g&&v.push(Te("Add Next Node\u2026",{do:"addNext",from:{node:t,port:g.port},insertOn:g.insertOn},{icon:"add",shortcut:"addNode",...s})),a&&cy(r)&&v.push(Te(r.disabled?"Enable":"Disable",{do:"setDisabled",nodes:[t],disabled:!r.disabled},{icon:r.disabled?"circle-large-outline":"circle-slash",shortcut:"disable",...s})),a&&!l&&h_(e,[t])&&v.push(Te("Detach from Path",{do:"detach",nodes:[t]},{icon:"debug-disconnect",...s})),a&&r.type==="subflow"){let N=r.ref?"A shared subflow is edited in its source flow":(r.subflow?.nodes??[]).length===0?"The subflow has no steps to move up":void 0;v.push(Te("Dissolve Subflow",{do:"dissolve",node:t},{icon:"ungroup-by-ref-type",...N?{disabled:N}:s}))}a&&e.doc.layout?.[t]&&v.push(Te("Reset Position",{do:"resetPosition",nodes:[t]},{icon:"discard",...s})),a&&Rt(e.doc)>=2&&v.push(Te("Add Note to This Node",{do:"addAnnotation",kind:"note",on:t},{icon:"note",shortcut:"addNote",...s}));let m=[t],b=[];a&&r.type!=="start"&&b.push(Te("Cut",{do:"cut",nodes:m},{shortcut:"cut",...s})),b.push(Te("Copy",{do:"copy",nodes:m},{icon:"copy",shortcut:"copy"})),a&&r.type!=="start"&&b.push(Te("Duplicate",{do:"duplicate",nodes:m},{icon:"files",shortcut:"duplicate",...s}));let w=[Te("Open in Text Editor",{do:"showInText",node:t},{icon:"go-to-file"})];n.hasPlay(t)&&w.push(Te("Peek Code",{do:"peekCode",node:t},{icon:"code"}));let k=[];n.level==="root"&&!l&&!r.disabled&&k.push(Te("Run from Here (Skeleton)",{do:"runPartial",node:t,only:!1},{icon:"debug-start",...s}),Te("Run This Step (Skeleton)",{do:"runPartial",node:t,only:!0},{icon:"debug-step-over",...s}));let S=a?[Te("Delete",{do:"delete",nodes:m},{icon:"trash",shortcut:"delete",...s})]:[];return lu(n.scenario?k7(e,t,n.scenario):[],f,v,h,b,w,k,S)}function j7(e,t,n,r=[]){let a=t.map(g=>e.nodes.get(g)?.node).filter(g=>!!g),s=n.mode==="design",l=n.stale?{disabled:n.why??su}:{},f=r.length?{annotations:r}:{},p=[];s&&p.push(Te("Cut",{do:"cut",nodes:t,...f},{shortcut:"cut",...l})),p.push(Te("Copy",{do:"copy",nodes:t,...f},{icon:"copy",shortcut:"copy"})),s&&p.push(Te("Duplicate",{do:"duplicate",nodes:t,...f},{icon:"files",shortcut:"duplicate",...l}));let h=[];if(s&&Rt(e.doc)>=2&&h.push(Te("Add Section Around",{do:"addAnnotation",kind:"section",around:[...t,...r]},{icon:"layout-panel",...l})),n.mode==="design"){let g=a.some(m=>m.type==="start"||m.type==="end");h.push(Te("Extract into Subflow\u2026",{do:"extract",nodes:t},{icon:"type-hierarchy-sub",...g?{disabled:"Start and end nodes stay on their level"}:l}))}let v=a.filter(cy);if(s&&v.length>0){let g=v.every(m=>m.disabled);h.push(Te(g?"Enable":"Disable",{do:"setDisabled",nodes:v.map(m=>m.id),disabled:!g},{icon:g?"circle-large-outline":"circle-slash",shortcut:"disable",...l}))}if(s&&h_(e,t)&&!a.some(g=>g.type==="start"||g.type==="end")&&h.push(Te("Detach from Path",{do:"detach",nodes:t},{icon:"debug-disconnect",...l})),s&&t.length>=2){let g=t.length<3?{disabled:"Select three steps or more"}:l,m=t.some(b=>e.doc.layout?.[b]);h.push({type:"submenu",label:"Arrange",icon:"layout",items:[...["center","left","right"].map(b=>Te(wj[b],{do:"align",nodes:t,how:b},{...b==="center"?{shortcut:"alignCenter"}:{},...l})),{type:"separator"},...["top","middle","bottom"].map(b=>Te(wj[b],{do:"align",nodes:t,how:b},l)),{type:"separator"},Te(kj.vertical,{do:"distribute",nodes:t,how:"vertical"},{shortcut:"distribute",...g}),Te(kj.horizontal,{do:"distribute",nodes:t,how:"horizontal"},g),...m?[{type:"separator"},Te("Reset Position",{do:"resetPosition",nodes:t},l)]:[]]})}return lu(p,h,s?[Te("Delete",{do:"delete",nodes:t,...f},{icon:"trash",shortcut:"delete",...l})]:[])}var C7={yellow:"Yellow",blue:"Blue",green:"Green",pink:"Pink",purple:"Purple",gray:"Gray"};function E7(e,t,n){let r=e.annotations.get(t)?.annotation;if(!r)return ll(n);let a=r.kind??"note",s=n.mode==="design",l=n.stale?{disabled:n.why??su}:{},f={nodes:[],annotations:[t]},p=s?[Te("Edit Text",{do:"editAnnotation",id:t},{icon:"edit",shortcut:"rename",...l}),{type:"submenu",label:"Color",icon:"symbol-color",items:Xj.map(g=>Te(C7[g],{do:"colorAnnotation",id:t,color:g},{checked:(r.color??(a==="note"?"yellow":"gray"))===g,...l}))}]:[],h=s&&a==="note"?[r.on?Te("Detach from Node",{do:"detachAnnotation",id:t},{icon:"debug-disconnect",...l}):Te("Attach to Node\u2026",{do:"attachAnnotation",id:t},{icon:"link",...l})]:[],v=[];return s&&v.push(Te("Cut",{do:"cut",...f},{shortcut:"cut",...l})),v.push(Te("Copy",{do:"copy",...f},{icon:"copy",shortcut:"copy"})),s&&v.push(Te("Duplicate",{do:"duplicate",...f},{icon:"files",shortcut:"duplicate",...l})),lu(p,h,v,s?[Te("Delete",{do:"delete",...f},{icon:"trash",shortcut:"delete",...l})]:[])}function ll(e){let t=e.mode==="design",n=e.stale?{disabled:e.why??su}:{},r=t?[Te("Paste Here",{do:"paste"},{icon:"clippy",shortcut:"paste",...n}),Te("Add Node Here\u2026",{do:"addNode"},{icon:"add",shortcut:"addNode",...n}),Te("Insert Shared Subflow\u2026",{do:"insertShared"},{icon:"references",...n})]:[],a=t&&(e.format??1)>=2?[Te("Add Note Here",{do:"addAnnotation",kind:"note"},{icon:"note",shortcut:"addNote",...n}),Te("Add Section Here",{do:"addAnnotation",kind:"section"},{icon:"layout-panel",...n}),Te("Add Text Here",{do:"addAnnotation",kind:"text"},{icon:"text-size",...n})]:[],s=[Te("Select All",{do:"selectAll"},{icon:"selection",shortcut:"selectAll"})];return t&&s.push(Te("Tidy Up",{do:"tidyUp"},{icon:"layout",...n})),s.push(Te("Fit View",{do:"fitView"},{icon:"screen-full",shortcut:"fit"})),s.push(Te("Find Node\u2026",{do:"find"},{icon:"search",shortcut:"find"})),lu(r,a,s,e.level==="root"?[]:[Te("Up to Parent",{do:"upLevel"},{icon:"arrow-up",shortcut:"up"})])}function $7(e,t,n){let r={...n,format:n.format??Rt(e.doc)},a=r.mode==="design"&&!r.stale;switch(t.kind){case"node":return N7(e,t.id,r);case"nodes":return j7(e,t.ids,r,t.annotations);case"annotation":return E7(e,t.id,r);case"annotations":{let s=r.stale?{disabled:r.why??su}:{},l={nodes:[],annotations:t.ids};return r.mode==="design"?lu([Te("Cut",{do:"cut",...l},{shortcut:"cut",...s}),Te("Copy",{do:"copy",...l},{icon:"copy",shortcut:"copy"}),Te("Duplicate",{do:"duplicate",...l},{icon:"files",shortcut:"duplicate",...s})],[Te("Delete",{do:"delete",...l},{icon:"trash",shortcut:"delete",...s})]):[Te("Copy",{do:"copy",...l},{icon:"copy",shortcut:"copy"})]}case"edge":{let s=e.edges.get(t.id)?.edge;if(!s||!a)return ll(r);let l=f_(e,s.from,["insert","pick","disconnect"]);return l.length>0?l:ll(r)}case"entry":return a?[Te("Remove Entry",{do:"removeEntry",subflow:t.subflow},{icon:"debug-disconnect"})]:ll(r);case"exit":return a?[...r.mode==="design"?[Te("Edit Reason\u2026",{do:"editReason",edge:t.edge},{icon:"edit"})]:[],Te("Remove Exit",{do:"removeExit",subflow:t.subflow,from:t.from,port:t.port},{icon:"debug-disconnect"})]:ll(r);case"pane":return ll(r)}}function _7(e){if(!e?.file||e.names.length===0)return{label:"Add Scenarios",tone:"none",title:"Say where each host must end when chosen steps fail, and check it as you change the flow"};if(e.error||IC(e.problems).length)return{label:"Scenarios \xB7 fix the file",tone:"error",title:"The scenarios file does not fit the flow: see the Scenarios tab or Problems"};let t=e.results.filter(n=>!n.passed).length;return t?{label:`Scenarios \xB7 ${t} failing`,tone:"warn",title:`${t} of ${e.results.length} scenarios end elsewhere in the simulation`}:{label:`Scenarios \xB7 ${e.results.length} pass`,tone:"ok",title:"Every scenario ends where it should in the simulation"}}var T7={failed:"fails",unreachable:"is unreachable",timeout:"times out",unchanged:"changes nothing",false:"takes false"};function A7(e,t){let n=va(e),r=s=>n.get(s)?.title||s,a=[];for(let[s,l]of Object.entries(t.force??{}))for(let[f,p]of Object.entries(l??{}))Array.isArray(p)&&p.length&&a.push(`${r(s)} ${T7[f]??f} for ${p.join(", ")}`);for(let[s,l]of Object.entries(t.approvals??{}))a.push(`${r(s)} is ${l==="timeout"?"timed out":l}`);return a}function M7(e,t){return t.scenarios.map((n,r)=>{let a=t.results[r],s=t.verified[n.name];return{name:n.name,hosts:LC(e,n),verdict:!a||a.error?"error":a.passed?"pass":"fail",misses:a?J0(a).map(l=>`${l.host} now ${l.actual==="not run"?"does not run":`ends at ${ah(e,l.actual)}`}; expected ${ah(e,l.expected)}`):[],...a?.error?{error:a.error}:{},bestEffort:(a?.needsAnsible??[]).map(l=>l.message),...s?{verified:{at:s.at,stale:s.stale,passed:s.result.passed}}:{},planted:A7(e,n)}})}function p_(e,t,n){let r=t.scenarios.find(s=>s.name===n);if(!r)return;let a=new Map;for(let[s,l]of va(e))a.set(l.id,s);return{name:n,hosts:LC(e,r),path:s=>a.get(s),forced:(s,l)=>{let f=r.force?.[s]?.[l];return Array.isArray(f)?f:[]},approval:s=>r.approvals?.[s]??"approved",expect:r.expect??{}}}function O7(e){let t=new Set(e?.names??[]),n=t.size+1;for(;t.has(`Scenario ${n}`);)n++;return`Scenario ${n}`}var m_=e=>Array.from({length:Math.max(1,Math.min(e,50))},(t,n)=>`host-${String(n+1).padStart(2,"0")}`);function P7(e,t,n){let r=DC(e)??"devices",a={[r]:m_(n)};for(let[s,l]of Object.entries(e.flow.inputs??{}))s!==r&&l?.required&&(a[s]=l.default===void 0?l.type==="integer"?1:l.type==="boolean"?!1:l.type==="host_list"||l.type==="list"?[]:"example":l.default);return{name:t,inputs:a,expect:{}}}var Ah=8,D7='[role^="menuitem"]';function g_(e){return[...e?.querySelectorAll(`:scope > ${D7}`)??[]].filter(t=>t.getAttribute("aria-disabled")!=="true")}function Mh(e){let{x:t,y:n,label:r,items:a,onClose:s,header:l,className:f,data:p,opener:h,flipX:v,onBack:g}=e,m=(0,T.useRef)(null),[b,w]=(0,T.useState)(null),[k,S]=(0,T.useState)(null),N=(0,T.useRef)(void 0);IE(!g),(0,T.useLayoutEffect)(()=>{if(!m.current)return;let{width:A,height:M}=m.current.getBoundingClientRect(),O=t+A+Ah>window.innerWidth?(v??t-16)-A:t,K=Math.min(n,window.innerHeight-M-Ah);w({left:Math.max(Ah,O),top:Math.max(Ah,K)})},[t,n,v]);let E=b!==null;(0,T.useEffect)(()=>{E&&g_(m.current)[0]?.focus()},[E]),(0,T.useEffect)(()=>()=>clearTimeout(N.current),[]),(0,T.useEffect)(()=>{if(g)return;let A=K=>{let B=K;return!B?.closest?.(".afd-menu")&&!(h&&B instanceof Node&&h.contains(B))},M=K=>{A(K.target)&&s()},O=K=>{K.target instanceof Element&&A(K.target)&&s()};return document.addEventListener("pointerdown",M,!0),document.addEventListener("focusin",O,!0),()=>{document.removeEventListener("pointerdown",M,!0),document.removeEventListener("focusin",O,!0)}},[s,h,g]);let j=(A,M)=>{let O=M.getBoundingClientRect();S({index:A,x:O.right-2,y:O.top-4,flipX:O.left+2})},$=A=>{A.disabled||(s(),A.onSelect())},L=A=>{if(A.ctrlKey||A.metaKey)return;A.stopPropagation();let M=g_(m.current),O=M.indexOf(document.activeElement),K=B=>M[(B+M.length)%M.length]?.focus();switch(A.key){case"ArrowDown":A.preventDefault(),K(O+1);break;case"ArrowUp":A.preventDefault(),K(O<0?M.length-1:O-1);break;case"Home":A.preventDefault(),K(0);break;case"End":A.preventDefault(),K(M.length-1);break;case"ArrowRight":{let B=document.activeElement;B?.getAttribute("aria-haspopup")==="menu"&&(A.preventDefault(),j(Number(B.dataset.index),B));break}case"ArrowLeft":g&&(A.preventDefault(),g());break;case"Escape":A.preventDefault(),g?g():s();break;case"Tab":A.preventDefault(),s()}},z=k?a[k.index]:void 0;return(0,Ig.createPortal)((0,c.jsxs)("div",{ref:m,className:["afd-menu","nokey",f].filter(Boolean).join(" "),role:"menu","aria-label":r,...p,style:b?{left:b.left,top:b.top}:{left:t,top:n,visibility:"hidden"},onKeyDown:L,onContextMenu:A=>A.preventDefault(),children:[l,a.map((A,M)=>{if(A.type==="separator")return(0,c.jsx)("hr",{className:"afd-menu-sep"},`sep-${M}`);let O=A.icon?(0,c.jsx)("span",{className:`codicon codicon-${A.icon}`,"aria-hidden":"true"}):null;if(A.type==="submenu")return(0,c.jsxs)("button",{type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":k?.index===M,"data-index":M,className:k?.index===M?"afd-menu-open":void 0,onClick:V=>j(M,V.currentTarget),onMouseEnter:V=>{let oe=V.currentTarget;clearTimeout(N.current),N.current=setTimeout(()=>j(M,oe),180)},children:[(0,c.jsx)("span",{className:"afd-menu-icon",children:O}),(0,c.jsx)("span",{className:"afd-menu-label",children:A.label}),(0,c.jsx)("span",{className:"codicon codicon-chevron-right afd-menu-more","aria-hidden":"true"})]},`sub-${A.label}`);let K={type:"button","aria-disabled":A.disabled?!0:void 0,"aria-label":A.shortcut||A.note?A.label:void 0,"aria-keyshortcuts":A.shortcut,title:A.disabled??A.title,onClick:()=>$(A),onMouseEnter:()=>{clearTimeout(N.current),N.current=setTimeout(()=>S(null),180)}},B=V=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"afd-menu-icon",children:V}),(0,c.jsxs)("span",{className:"afd-menu-label",children:[A.label,A.note?(0,c.jsx)("span",{className:"afd-menu-why",children:A.note}):null]}),A.shortcut?(0,c.jsx)("kbd",{className:"afd-menu-key",children:A.shortcut}):null]});return A.checked===void 0?(0,c.jsx)("button",{...K,role:"menuitem",children:B(O)},`item-${A.label}`):(0,c.jsx)("button",{...K,role:"menuitemradio","aria-checked":A.checked,children:B(A.checked?(0,c.jsx)("span",{className:"codicon codicon-check","aria-hidden":"true"}):null)},`item-${A.label}`)}),z?.type==="submenu"&&k?(0,c.jsx)(Mh,{x:k.x,y:k.y,flipX:k.flipX,label:z.label,items:z.items,onClose:s,onBack:()=>{let A=k.index;S(null),m.current?.querySelector(`[data-index="${A}"]`)?.focus()}}):null]}),document.body)}function L7(e,t){switch(t.kind){case"node":return e.nodes.get(t.id)?.node.title??"Node";case"nodes":return`${t.ids.length} nodes`;case"annotation":{let n=e.annotations.get(t.id)?.annotation.kind??"note";return n==="section"?"Section":n==="text"?"Text":"Note"}case"annotations":return`${t.ids.length} annotations`;case"edge":case"entry":case"exit":return"Wire";case"pane":return"Canvas"}}function I7(e,t,n,r){let a=_.getState();switch(e.do){case"openSubflow":a.setLevel(e.node);return;case"scenarioForce":a.scenarioEditing&&a.setHostPick({scenario:a.scenarioEditing,step:e.step,outcome:e.outcome,title:e.title});return;case"scenarioApproval":a.scenarioEditing&&gf({kind:"setApproval",name:a.scenarioEditing,approval:e.approval,pick:e.pick}).then(s=>a.setError(s.ok?null:s.error??"The scenario did not change"));return;case"scenarioExpect":a.scenarioEditing&&gf({kind:"expectHost",name:a.scenarioEditing,host:e.host,where:e.where}).then(s=>a.setError(s.ok?null:s.error??"The scenario did not change"));return;case"properties":a.openDetails(e.node,e.tab);return;case"rename":py(e.node);return;case"setStatus":e.status==="tested"?a.setTestedReason(e.node):Pe({kind:"updateNode",id:e.node,patch:{status:e.status}});return;case"port":ol(e.item,e.ref);return;case"addNext":$y(e.from,e.insertOn);return;case"cut":$5(e.nodes,e.annotations);return;case"copy":Kd(e.nodes,e.annotations??[]);return;case"duplicate":eE(e.nodes,e.annotations);return;case"delete":Ud(e.nodes,e.edges,e.annotations);return;case"addAnnotation":Yd(e.kind,t.at,e.on,e.around?{around:e.around}:{});return;case"editAnnotation":uh(e.id);return;case"colorAnnotation":O5(e.id,e.color);return;case"attachAnnotation":aE(e.id);return;case"detachAnnotation":iE(e.id);return;case"extract":T5(e.nodes);return;case"detach":E5(e.nodes);return;case"setDisabled":Pe({kind:"setDisabled",ids:e.nodes,disabled:e.disabled});return;case"dissolve":Pe({kind:"dissolveSubflow",id:e.node,place:!0});return;case"selectFlow":_5(e.node,e.dir);return;case"zoomSelection":a.zoomToSelection();return;case"align":sv(e.how,e.nodes);return;case"distribute":lv(e.how,e.nodes);return;case"resetPosition":d_(e.nodes);return;case"showInText":{let s=n.nodes.get(e.node)?.path;je({type:"openText",...s?{path:s}:{}});return}case"peekCode":je({type:"peekCode",node:e.node});return;case"runPartial":u8(e.node,e.only);return;case"removeEntry":Pe({kind:"setBoundaryIn",subflow:e.subflow,node:null});return;case"removeExit":Pe({kind:"disconnectBoundary",subflow:e.subflow,from:e.from,port:e.port});return;case"editReason":A5(e.edge);return;case"paste":je({type:"requestPaste",...t.at?{at:t.at}:{}});return;case"addNode":a.openQuickAdd({type:"task",...t.at?{position:t.at}:{}});return;case"insertShared":je({type:"insertShared",level:a.level,...t.at?{at:t.at}:{}});return;case"selectAll":tE();return;case"tidyUp":je({type:"tidyUp",level:a.level});return;case"fitView":r();return;case"find":a.openFind(!0);return;case"upLevel":hy();return}}function R7(){let e=_(w=>w.contextMenu),t=_(w=>w.snapshot),n=_(w=>w.mode),r=_(w=>w.level),a=_(w=>w.openContextMenu),s=_(w=>w.scenarioEditing),l=_(w=>w.scenarioCheck),f=As(),p=_(w=>w.viewer);if(!e||!t?.doc||p)return null;let h=Ee(t.doc),v=s&&l?p_(t.doc,l,s):void 0,g=$7(h,e.target,{mode:n,level:r,stale:t.stale||!!t.idGaps,...t.idGaps?{why:"Complete IDs first (the banner above the canvas)"}:{},openPorts:t.openPorts,hasPlay:w=>!!t.plays?.[w],...v?{scenario:v}:{}});if(g.length===0)return null;let m=()=>{f.fitView(A0)},b=w=>w.type==="separator"?w:w.type==="submenu"?{...w,items:w.items.map(b)}:{type:"item",label:w.label,icon:w.icon,shortcut:Na(w.shortcut),checked:w.checked,disabled:w.disabled,note:w.disabled,onSelect:()=>I7(w.action,e,h,m)};return(0,c.jsx)(Mh,{x:e.x,y:e.y,label:L7(h,e.target),data:{"data-canvas-menu":e.target.kind},items:g.map(b),onClose:()=>a(null)})}var z7={note:"Note",section:"Section",text:"Text"},y_={s:"Small",m:"Medium",l:"Large"};function F7({id:e}){let t=_(v=>v.snapshot),n=_(v=>v.mode==="design"),r=wa()&&n;if(!t?.doc)return null;let a=Ee(t.doc),s=a.annotations.get(e)?.annotation;if(!s)return null;let l=s.kind??"note",f=s.color??(l==="note"?"yellow":"gray"),p=s.on?a.nodes.get(s.on)?.node:void 0,h=v=>{Pe({kind:"updateAnnotation",id:e,patch:B7(v)})};return(0,c.jsxs)("div",{className:"afd-panel-body","data-annotation-panel":l,children:[(0,c.jsx)("h2",{className:"afd-panel-title",children:z7[l]}),(0,c.jsxs)("p",{className:"muted",children:["Explains the flow and never runs: changing it keeps the flow's version.",l==="note"&&p?" Its text is a comment above the code of the node it is on.":"",l==="section"?" Drag its title bar to move it with what is wholly inside; the arrow keys move it alone.":""]}),(0,c.jsxs)("fieldset",{className:"afd-editable",disabled:!r,children:[(0,c.jsx)(fn,{label:l==="section"?"Title (Markdown)":"Text (Markdown)",focusKey:"annotationText",multiline:l!=="section",value:s.text,placeholder:"**bold**, *italic*, `code`, - lists, [links](https://...)",onCommit:v=>h({text:v})}),(0,c.jsxs)("div",{className:"afd-field",children:[(0,c.jsx)("label",{htmlFor:"afd-annotation-color",children:"Color"}),(0,c.jsx)("select",{id:"afd-annotation-color",value:f,onChange:v=>h({color:v.target.value}),children:Xj.map(v=>(0,c.jsxs)("option",{value:v,children:[v[0]?.toUpperCase(),v.slice(1)]},v))})]}),l==="text"?(0,c.jsxs)("div",{className:"afd-field",children:[(0,c.jsx)("label",{htmlFor:"afd-annotation-size",children:"Size"}),(0,c.jsx)("select",{id:"afd-annotation-size",value:s.size??"m",onChange:v=>h({size:v.target.value}),children:Object.keys(y_).map(v=>(0,c.jsx)("option",{value:v,children:y_[v]},v))})]}):null]}),l==="note"?(0,c.jsxs)("div",{className:"afd-field",children:[(0,c.jsx)(il,{label:"On node",value:p?p.title:"None (free on the canvas)"}),r?p?(0,c.jsx)("button",{type:"button",className:"secondary",onClick:()=>iE(e),children:"Detach from Node"}):(0,c.jsx)("button",{type:"button",className:"secondary",onClick:()=>aE(e),children:"Attach to Node\u2026"}):null]}):null]})}function B7(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}var q7={failed_hosts:"fails",unreachable:"cannot reach a host",timeout:"runs out of time",rejected:"is rejected"};function H7(){let e=_(s=>s.snapshot),t=_(s=>s.bannerDismissedAt),n=_(s=>s.dismissBanner),r=_(s=>s.reveal),a=_(s=>s.viewer);if(!e)return null;if(a)return e.stale?(0,c.jsxs)("div",{className:"afd-banner error",role:"alert","data-read-only-banner":!0,children:[(0,c.jsx)("span",{className:"codicon codicon-error","aria-hidden":"true"}),(0,c.jsxs)("span",{children:["The flow file has YAML errors (",e.parseError,"). This is its last valid version."]})]}):null;if(e.stale)return(0,c.jsxs)("div",{className:"afd-banner error",role:"alert","data-read-only-banner":!0,children:[(0,c.jsx)("span",{className:"codicon codicon-error","aria-hidden":"true"}),(0,c.jsxs)("span",{children:[(0,c.jsx)("strong",{children:"Read-only:"})," the text has YAML errors (",e.parseError,"). This is the last valid version; fix the text to edit again."]}),(0,c.jsx)("button",{type:"button",onClick:()=>je({type:"openText"}),children:"Open in Text Editor"})]});if(e.idGaps){let s=e.idGaps;return(0,c.jsxs)("div",{className:"afd-banner warning",role:"status","data-id-gaps":s,children:[(0,c.jsx)("span",{className:"codicon codicon-edit","aria-hidden":"true"}),(0,c.jsx)("strong",{children:"Written by hand:"}),(0,c.jsxs)("span",{className:"muted",children:[s," ",s===1?"item needs an ID":"items need IDs"," before the canvas can edit this flow."]}),(0,c.jsx)("button",{type:"button",onClick:()=>je({type:"completeIds"}),children:"Complete IDs"})]})}return(0,c.jsx)(V7,{reveal:r,dismiss:n,dismissedAt:t})}function V7({reveal:e,dismiss:t,dismissedAt:n}){let r=_(N=>N.snapshot),a=wa(),[s,l]=(0,T.useState)(0),f=r?ZC(r.openPorts):0;if(!r?.doc||f===0||n===f)return(0,c.jsx)("span",{hidden:!0,"data-banner-count":f});let p=r.openPorts[s%f],h=Ee(r.doc),v=p?h?.nodes.get(p.node)?.node:void 0,g=p?{node:p.node,port:p.port}:void 0,m=g&&h&&a?Ld(h,g)?.items??[]:[],b=m.filter(N=>N.kind==="pattern"),w=b.find(N=>N.kind==="pattern"&&N.pattern==="stop"),k=b.slice(0,2),S=[...k,...w&&!k.includes(w)?[w]:[],...m.filter(N=>N.kind==="decide")];return(0,c.jsxs)("div",{className:"afd-banner warning",role:"status","data-banner-count":f,children:[(0,c.jsx)("span",{className:"codicon codicon-warning","aria-hidden":"true"}),(0,c.jsxs)("strong",{children:[f," open fail port",f===1?"":"s"]}),(0,c.jsxs)("span",{title:"Hosts that fail there have nowhere to go, so they fail the run",children:["What should happen when"," ",(0,c.jsxs)("button",{type:"button",className:"link",onClick:()=>p&&e(p.node),children:['"',v?.title??p?.node,'"']})," ",q7[p?.port??""]??`takes ${p?.port}`,"?"]}),g?S.map(N=>(0,c.jsx)("button",{type:"button",className:"secondary",title:"hint"in N?N.hint:void 0,onClick:()=>{ol(N,g)},children:N.label},N.label)):null,a?(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>g&&qE(g),children:"Other Choices"}):null,f>1?(0,c.jsxs)("button",{type:"button",className:"link",onClick:()=>{let N=r.openPorts[(s+1)%f];l(s+1),N&&e(N.node)},children:["Next (",(s+1)%f+1," of ",f,")"]}):null,(0,c.jsx)("button",{type:"button",className:"icon","aria-label":"Dismiss",onClick:()=>t(f),children:(0,c.jsx)("span",{className:"codicon codicon-close","aria-hidden":"true"})})]})}function K7(){let e=_(s=>s.snapshot?.doc),t=_(s=>s.formatDismissed),n=wa();if(!e||t||!n||Rt(e)>=2)return null;let r=L6(e),a=async()=>{(await Pe({kind:"upgradeFormat"})).ok&&_.getState().notify("success","Upgraded to flow format 2. Undo reverts it.")};return(0,c.jsxs)("div",{className:"afd-banner info",role:"status","data-format-banner":Rt(e),children:[(0,c.jsx)("span",{className:"codicon codicon-arrow-circle-up","aria-hidden":"true"}),(0,c.jsxs)("span",{children:[(0,c.jsxs)("strong",{children:["Flow format ",Rt(e),"."]})," ",r.length?`Upgrading changes: ${r.join("; ")}.`:"Format 2 is what newer features use; the design stays as it is."," ","One undo step reverts it."]}),(0,c.jsx)("button",{type:"button",onClick:()=>{a()},children:"Upgrade Flow Format"}),(0,c.jsx)("button",{type:"button",className:"icon","aria-label":"Hide the format message",title:"Hide",onClick:()=>_.setState({formatDismissed:!0}),children:(0,c.jsx)("span",{className:"codicon codicon-close","aria-hidden":"true"})})]})}function W7({edge:e}){let t=_(v=>v.snapshot),n=_(v=>v.level),r=_(v=>v.select);if(!t?.doc)return null;let a=ry(t,cn(t,{},n),n),s=a?.edges.find(v=>v.id===e);if(!a||!s)return null;let l=Ee(t.doc),f=v=>l.nodes.get(v)?.node.title??v,p=a.subflow.id;if(!s.exit)return(0,c.jsxs)("div",{className:"afd-panel-body","data-boundary-panel":"entry",children:[(0,c.jsxs)("h2",{className:"afd-panel-title",children:["Entry of ",a.subflow.title]}),(0,c.jsxs)("p",{className:"muted",children:["Hosts entering ",(0,c.jsx)("strong",{children:a.subflow.title})," start at"," ",(0,c.jsx)("strong",{children:f(s.target)}),". Drag from the frame's"," ",(0,c.jsx)("span",{className:"mono",children:"in"})," to another step to move the entry."]}),(0,c.jsx)("button",{type:"button",className:"secondary",onClick:()=>{r({}),Pe({kind:"setBoundaryIn",subflow:p,node:null})},children:"Remove entry"})]});let h=s.exit;return(0,c.jsxs)("div",{className:"afd-panel-body","data-boundary-panel":"exit",children:[(0,c.jsxs)("h2",{className:"afd-panel-title",children:["Exit to ",h.port]}),(0,c.jsxs)("p",{className:"muted",children:["Hosts leaving ",(0,c.jsx)("strong",{children:f(h.from.node)})," \xB7"," ",(0,c.jsx)("span",{className:"mono",children:h.from.port})," leave ",(0,c.jsx)("strong",{children:a.subflow.title})," ","through ",(0,c.jsx)("span",{className:"mono",children:h.port}),"."]}),(0,c.jsx)(fn,{label:"Reason (shown on the wire)",focusKey:"exitReason",value:h.reason??"",placeholder:"e.g. SSH timeout",onCommit:v=>{Pe({kind:"setExitReason",subflow:p,from:h.from,port:h.port,reason:v})}}),(0,c.jsx)("button",{type:"button",className:"secondary",onClick:()=>{r({}),Pe({kind:"disconnectBoundary",subflow:p,from:h.from,port:h.port})},children:"Remove exit"})]})}var U7={inventory:"No step on this level runs on hosts of its own.",data:"No step on this level reads an input or sets an output.",code:"No step on this level is bound to a module, role or playbook yet.",access:"No step on this level sets a credential, a user, become or vaulted variables: each acts as the run does.",timing:"No step on this level has batches or timeouts, and no run has timed it yet.",changes:"Nothing on this level changed since the version it compares with."};function Y7(e,t,n,r){let a=sa.find(f=>f.id===e),s={lens:e,label:a?.label??e,what:a?.hint??""};if(e==="inventory"&&!r?.trim())return{...s,empty:"The flow targets are not set, so the lens cannot count the hosts each step runs on.",setTargets:!0};if(!t)return s;let l=n.filter(f=>f.type!=="start"&&f.type!=="end");return l.some(f=>(t.chips[f.id]?.length??0)>0)||e==="changes"&&(t.ghosts?.length??0)>0||l.length===0?s:{...s,empty:t.notes[0]??U7[e]}}var dv=[{id:"design",label:"Design",hint:"Draw the flow: steps, wires, and what happens when a step fails"},{id:"code",label:"Code",hint:"What each step runs, and where the code differs from the design"},{id:"run",label:"Run",hint:"The last run on the canvas: how many hosts took each wire, and which steps failed"}];function X7(){let e=_(v=>v.mode),t=_(v=>v.lens),n=_(v=>v.lensView),r=_(v=>v.snapshot?.doc),a=_(v=>v.level),s=_(v=>v.lensFacts.inventory?.targets),l=_(v=>v.viewer);if(!r||l||e==="design"&&!t)return null;let f=dv.find(v=>v.id===e),p=(Ee(r).levels.get(a)?.nodes??[]).map(v=>({id:v.id,type:v.type})),h=t?Y7(t,n,p,s):void 0;return(0,c.jsxs)("div",{className:"afd-canvas-caption",role:"status","data-canvas-caption":t??e,children:[e!=="design"&&f?(0,c.jsxs)("p",{"data-caption-mode":e,children:[(0,c.jsxs)("strong",{children:[f.label," mode"]})," \xB7 ",f.hint,". The graph only reads here; Design changes it."]}):null,h?(0,c.jsxs)("p",{"data-caption-lens":h.lens,children:[(0,c.jsxs)("strong",{children:[h.label," lens"]})," \xB7 ",h.what,".",h.empty?(0,c.jsxs)(c.Fragment,{children:[" ",(0,c.jsx)("span",{className:"afd-caption-empty","data-lens-empty":!0,children:h.empty})]}):null,h.setTargets?(0,c.jsxs)(c.Fragment,{children:[" ",(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>je({type:"setTargets"}),children:"Set Targets\u2026"})]}):null]}):null]})}var Z7=["Edit","Move around","Canvas","Flow"];function G7(){return _(e=>e.cheatSheet)?(0,c.jsx)(Q7,{}):null}function Q7(){let e=_(r=>r.showCheatSheet),t=(0,T.useRef)(null),n=nl(t);return(0,c.jsx)("div",{className:"afd-modal-backdrop nokey",children:(0,c.jsxs)("div",{ref:t,className:"afd-modal afd-cheatsheet",role:"dialog","aria-modal":"true","aria-label":"Keyboard Shortcuts",onKeyDown:r=>{n(r),r.key==="Escape"&&(r.stopPropagation(),e(!1))},children:[(0,c.jsxs)("div",{className:"afd-cheatsheet-head",children:[(0,c.jsx)("h2",{children:"Keyboard Shortcuts"}),(0,c.jsx)("button",{type:"button",className:"icon","aria-label":"Close",autoFocus:!0,onClick:()=>e(!1),children:(0,c.jsx)("span",{className:"codicon codicon-close","aria-hidden":"true"})})]}),Z7.map(r=>(0,c.jsxs)("section",{children:[(0,c.jsx)("h3",{children:r}),(0,c.jsx)("dl",{children:Ly.filter(a=>a.group===r).map(a=>(0,c.jsxs)("div",{"data-shortcut":a.id,children:[(0,c.jsx)("dt",{children:(0,c.jsx)("kbd",{children:a.keys})}),(0,c.jsx)("dd",{children:a.label})]},a.id))})]},r)),(0,c.jsx)("p",{className:"muted",children:"Right-click a node, a wire or the canvas for everything you can do there."})]})})}function J7(){let e=_(l=>l.decide),t=_(l=>l.snapshot),n=_(l=>l.setDecide);if(!e)return null;let r=(t?.doc?.decisions??[]).find(l=>l?.node===e.node&&l.port===e.port),a=t?.doc,s=a?Ee(a).nodes.get(e.node)?.node:void 0;return(0,c.jsxs)(Nh,{id:"afd-decide",title:"Accept with Reason",placeholder:"e.g. Fails before any change; stopping is safe",submit:r?"Save Reason":"Accept",initial:r?.reason,target:e,record:l=>Pe({kind:"setDecision",node:e.node,port:e.port,reason:l}),close:()=>n(null),children:[(0,c.jsx)("strong",{children:s?.title??e.node})," \xB7 ",(0,c.jsx)("span",{className:"mono",children:e.port})," ","stays unwired: hosts that take it fail the run visibly and stop there. The warning goes away and the decision is recorded in the flow with your Git user name."]})}function eq(){let e=_(v=>v.hostPick),t=()=>_.getState().setHostPick(null),n=_(v=>v.snapshot?.doc),r=_(v=>v.scenarioCheck),a=e&&n&&r?p_(n,r,e.scenario):void 0,[s,l]=(0,T.useState)(new Set),f=(0,T.useRef)(null),p=nl(f);if((0,T.useEffect)(()=>{l(new Set(a&&e?a.forced(e.step,e.outcome):[])),setTimeout(()=>f.current?.querySelector("input")?.focus(),0)},[e]),!e||!a||!n)return null;let h=va(n).get(e.step);return(0,c.jsx)("div",{className:"afd-modal-backdrop",children:(0,c.jsxs)("form",{ref:f,className:"afd-modal",role:"dialog","aria-modal":"true","aria-labelledby":"afd-host-pick-title","data-host-pick":e.outcome,onSubmit:async v=>{v.preventDefault();let g=a.hosts.filter(b=>s.has(b)),m=await gf({kind:"force",name:e.scenario,step:e.step,outcome:e.outcome,hosts:g});m.ok?t():_.getState().setError(m.error??"The scenario did not change")},onKeyDown:v=>{p(v),v.key==="Escape"&&(v.stopPropagation(),t())},children:[(0,c.jsxs)("h2",{id:"afd-host-pick-title",children:[h?.title??e.step,": ",e.title,"\u2026"]}),(0,c.jsxs)("p",{className:"muted",children:["In scenario ",(0,c.jsx)("strong",{children:e.scenario}),", the hosts ticked here take this outcome at"," ",h?.title??e.step,"; the rest go on as usual."]}),(0,c.jsxs)("fieldset",{className:"afd-host-pick",children:[(0,c.jsx)("legend",{className:"afd-sr-only",children:"Hosts"}),a.hosts.map(v=>(0,c.jsxs)("label",{className:"afd-check",children:[(0,c.jsx)("input",{type:"checkbox",checked:s.has(v),onChange:g=>{let m=new Set(s);g.target.checked?m.add(v):m.delete(v),l(m)}})," ",v]},v))]}),(0,c.jsxs)("div",{className:"afd-modal-actions",children:[(0,c.jsx)("button",{type:"button",className:"secondary",onClick:t,children:"Cancel"}),(0,c.jsx)("button",{type:"submit",children:"Save"})]})]})})}function v_(e,t){let n=t.trim();switch(e){case"host_list":return{value:n.split(/[,\s]+/).map(r=>r.trim()).filter(Boolean)};case"integer":return/^-?[0-9]+$/.test(n)?{value:Number(n)}:{error:"a whole number"};case"boolean":return/^(true|yes|1)$/i.test(n)?{value:!0}:/^(false|no|0)$/i.test(n)?{value:!1}:{error:"true or false"};case"list":if(n.startsWith("["))try{let r=JSON.parse(n);return Array.isArray(r)?{value:r}:{error:"a list"}}catch{return{error:"a JSON list, or items separated by commas"}}return{value:n.split(",").map(r=>r.trim()).filter(Boolean)};case"dict":if(!n)return{value:{}};try{let r=n.startsWith("{")?JSON.parse(n):gi(n);return r&&typeof r=="object"&&!Array.isArray(r)?{value:r}:{error:"key: value pairs, as YAML or JSON"}}catch{return{error:"key: value pairs, as YAML or JSON"}}default:return{value:n}}}function tq(e,t){let n=v_(e,t);return"error"in n?`Expected ${n.error}`:Array.isArray(n.value)?n.value.length===0?"An empty list":`${n.value.length} item${n.value.length===1?"":"s"}: ${n.value.map(r=>JSON.stringify(r)).join(", ")}`:JSON.stringify(n.value)}function b_(e,t){let n={};for(let r of e){let a=t[r.name]??r.text;if(!a.trim()){if(r.required)return{error:`${r.name} is required`,field:r.name};continue}let s=v_(r.type,a);if("error"in s)return{error:`${r.name}: expected ${s.error}`,field:r.name};n[r.name]=s.value}return{inputs:n}}function nq(e,t){let n={};for(let r of e){let a=b_([r],t);if("inputs"in a)Object.assign(n,a.inputs);else if(r.type==="host_list")return a}return{inputs:n}}function oq(e){return e.map(t=>{let n=t.nodes.map(a=>`[${a}]`).join(", "),r=t.count===void 0?"resolved at run time":t.count===0?"matches no host, so those nodes fail every arriving host":`${t.count} host(s)`;return`Also on inventory_target ${t.pattern??t.declared}: ${r} (${n})`})}var rq=e=>e.uses.reduce((t,n)=>t+(n.count??0),0);function iq(e,t){let n=rq(t);return`Run "${e}" for real on ${t.count} host(s)${n?` and ${n} inventory_target host(s)`:""}?`}function aq(e){let t=e.hosts.slice(0,8).join(", ")+(e.count>8?", \u2026":"");return["This is not check mode: bound nodes change the devices.",`Inventory: ${e.sources.join(", ")}`,`Hosts: ${e.count} (${t})`,e.unknown.length?`Not in the inventory: ${e.unknown.join(", ")}`:"",...oq(e.uses),e.prod.length?`Production-looking: ${e.prod.slice(0,8).join(", ")}`:"No production-looking groups or hosts",`Environment: ${e.environment}`].filter(Boolean)}var sq={host_list:"hosts or groups, comma-separated",list:"items separated by commas, or a JSON list",dict:"key: value lines (YAML) or JSON",integer:"a whole number",boolean:"true or false"};function lq(){let e=_(t=>t.launch);return e?(0,c.jsx)(dq,{plan:e},e.token):null}function dq({plan:e}){let t=_(j=>j.launchNotice),n=(0,T.useRef)(null),r=nl(n),a=(0,T.useId)(),[s,l]=(0,T.useState)(()=>Object.fromEntries(e.fields.map(j=>[j.name,j.text]))),[f,p]=(0,T.useState)(""),[h,v]=(0,T.useState)(null),g=e.mode==="real",m=e.fields.filter(j=>j.type==="host_list").map(j=>s[j.name]??"").join("|"),b=(0,T.useRef)(!0);(0,T.useEffect)(()=>{if(b.current){b.current=!1;return}let j=setTimeout(()=>{let $=nq(e.fields.filter(L=>!L.secret),s);"inputs"in $?je({type:"launchCheck",token:e.token,inputs:$.inputs}):_.getState().setLaunchFacts(e.token,void 0,$.error)},400);return()=>clearTimeout(j)},[m]);let w=_(j=>j.viewer),k=()=>{je({type:"launchCancel",token:e.token}),_.getState().setLaunch(null)},S=j=>{je({type:"launchSwitch",token:e.token,mode:e.mode,what:j}),_.getState().setLaunch(null)},N=()=>{let j=b_(e.fields,s);"error"in j?(v({field:j.field,text:j.error}),document.getElementById(`afd-launch-${j.field}`)?.focus()):e.vault&&!f?(v({field:"__vault",text:"The vault password is needed for this run"}),document.getElementById("afd-launch-__vault")?.focus()):(_.getState().setRunAsked(!0),je({type:"launchRun",token:e.token,inputs:j.inputs,...e.vault?{vaultPassword:f}:{}}),p(""),_.getState().setLaunch(null))},E=g?"Run for Real":"Run as Skeleton";return(0,c.jsx)("div",{className:"afd-modal-backdrop",children:(0,c.jsxs)("div",{ref:n,className:`afd-modal afd-launch${g?" real":""}`,role:"dialog","aria-modal":"true","aria-labelledby":a,"data-launch":e.mode,onKeyDown:j=>{r(j),j.key==="Escape"&&(j.stopPropagation(),k())},children:[(0,c.jsxs)("h2",{id:a,children:[E,": ",e.flow]}),(0,c.jsxs)("p",{className:"muted",children:[g?"Not check mode: bound steps change the devices.":"Check mode: bound steps report what they would change, and change nothing."," "]}),(0,c.jsxs)("p",{className:"muted afd-launch-where",children:["Runs in: ",(0,c.jsx)("span",{"data-launch-environment":!0,children:e.environment})," ",w?null:(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>S("environment"),children:"Change"}),e.inventory?(0,c.jsxs)(c.Fragment,{children:[" \xB7 ","Inventory: ",(0,c.jsx)("span",{"data-launch-inventory":!0,children:e.inventory})," ",w?null:(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>S("inventory"),children:"Change"})]}):null]}),t?(0,c.jsx)("p",{className:"afd-launch-notice",role:"alert",children:t}):null,(0,c.jsxs)("form",{onSubmit:j=>{j.preventDefault(),N()},children:[e.fields.length===0?(0,c.jsx)("p",{className:"muted",children:"This flow has no inputs."}):null,e.fields.map(j=>(0,c.jsx)(cq,{field:j,text:s[j.name]??"",groups:j.type==="host_list"?e.groups:[],groupHosts:e.groupHosts,problem:h?.field===j.name?h.text:void 0,onChange:$=>{l(L=>({...L,[j.name]:$})),h?.field===j.name&&v(null)}},j.name)),e.vault?(0,c.jsxs)("div",{className:"afd-field",children:[(0,c.jsx)("label",{htmlFor:"afd-launch-__vault",children:"Vault password"}),(0,c.jsx)("input",{id:"afd-launch-__vault",className:"afd-input",type:"password",autoComplete:"off",value:f,"aria-invalid":h?.field==="__vault",onChange:j=>p(j.target.value)}),(0,c.jsx)("span",{className:"afd-help",children:h?.field==="__vault"?h.text:"For this run only; never stored or logged."})]}):null,(0,c.jsx)(fq,{plan:e}),(0,c.jsxs)("div",{className:"afd-modal-actions",children:[(0,c.jsx)("button",{type:"button",className:"secondary",onClick:k,children:"Cancel"}),(0,c.jsx)("button",{type:"submit",disabled:!!e.factsError,"data-launch-run":!0,children:E})]})]})]})})}function uq(e,t){if(!t)return`Add the inventory group ${e}`;let n=t.count>t.hosts.length?", \u2026":"";return`${e}: ${t.count} host${t.count===1?"":"s"}: ${t.hosts.join(", ")}${n}`}function cq({field:e,text:t,groups:n,groupHosts:r,problem:a,onChange:s}){let l=`afd-launch-${e.name}`,f=e.type??"string",p=sq[f],h=e.type==="list"||e.type==="dict"?tq(f,t):"",v=t.split(/[,\s]+/).filter(Boolean);return(0,c.jsxs)("div",{className:"afd-field","data-launch-field":e.name,children:[(0,c.jsxs)("label",{htmlFor:l,children:[(0,c.jsx)("span",{className:"mono",children:e.name})," ",(0,c.jsx)("span",{className:"muted",children:f}),e.required?(0,c.jsx)("abbr",{title:"required",children:" *"}):null]}),e.type==="dict"?(0,c.jsx)("textarea",{id:l,className:"afd-input mono",rows:3,value:t,"aria-invalid":!!a,onChange:g=>s(g.target.value)}):(0,c.jsx)("input",{id:l,className:"afd-input",type:e.secret?"password":"text",autoComplete:"off",spellCheck:!1,value:t,placeholder:p,"aria-invalid":!!a,onChange:g=>s(g.target.value)}),n.length>0?(0,c.jsxs)("fieldset",{className:"afd-chips afd-launch-groups",children:[(0,c.jsxs)("legend",{className:"muted afd-launch-groups-label",children:["Inventory groups",(0,c.jsxs)("span",{className:"afd-sr-only",children:[" for ",e.name]})]}),n.slice(0,12).map(g=>(0,c.jsxs)("button",{type:"button",className:`chip-button mono${v.includes(g)?" active":""}`,"aria-pressed":v.includes(g),title:uq(g,r?.[g]),"data-group-hosts":r?.[g]?.count,onClick:()=>s(v.includes(g)?v.filter(m=>m!==g).join(", "):[...v,g].join(", ")),children:[g,r?.[g]?(0,c.jsxs)("span",{className:"afd-chip-count","aria-hidden":"true",children:[" ","\xB7 ",r[g].count]}):null]},g))]}):null,(0,c.jsx)("span",{className:`afd-help${a?" tone-warn":""}`,"data-launch-help":!0,children:a??[e.description,e.secret?"Typed hidden; not remembered.":h||(e.description?"":p?`${p[0]?.toUpperCase()}${p.slice(1)}`:"")].filter(Boolean).join(" \xB7 ")})]})}function fq({plan:e}){if(e.factsError)return(0,c.jsx)("p",{className:"afd-launch-facts tone-warn",role:"status","data-launch-facts":"error",children:e.factsError});let t=e.facts;if(!t)return null;let n=aq(t);return(0,c.jsxs)("div",{className:"afd-launch-facts",role:"status","data-launch-facts":e.mode,"data-launch-hosts":t.count,children:[e.mode==="real"?(0,c.jsx)("strong",{children:iq(e.flow,t)}):null,(0,c.jsx)("ul",{children:(e.mode==="real"?n.slice(1):n.slice(1,-2)).map(r=>(0,c.jsx)("li",{className:r.startsWith("Production-looking")?"tone-warn":"",children:r},r))})]})}var hq="#none-left",uv=e=>sa.find(t=>t.id===e)?.label??e;function pq({item:e,places:t}){let n=_(s=>s.reveal),r=e.nodes.length===1?e.nodes[0]:void 0,a=d$(e.nodes,t);return(0,c.jsx)("li",{className:`afd-lens-item${e.tone?` tone-${e.tone}`:""}`,"data-lens-item":e.key,...s$(e.nodes),children:(0,c.jsxs)("button",{type:"button",className:"afd-lens-item-button",disabled:!r,onClick:()=>r&&n(r),title:r?"Show the node":`${e.nodes.length} nodes`,children:[(0,c.jsx)("span",{className:"afd-lens-item-label mono",children:e.label}),e.value===void 0?null:(0,c.jsx)("span",{className:"afd-lens-item-value",children:e.value}),e.detail?(0,c.jsx)("span",{className:"afd-lens-item-detail muted",children:e.detail}):null,a?(0,c.jsx)("span",{className:"afd-lens-item-detail muted","data-finding-place":!0,children:a}):null]})})}function mq(){let e=_(t=>t.lensFacts.compare);return e?(0,c.jsxs)("div",{className:"afd-lens-source",children:[(0,c.jsx)("label",{htmlFor:"afd-compare-ref",children:"Compare with"}),(0,c.jsxs)("select",{id:"afd-compare-ref",value:e.ref,disabled:e.refs.length===0,onChange:t=>je({type:"compareWith",ref:t.target.value}),children:[e.refs.length===0?(0,c.jsx)("option",{value:e.ref,children:e.label}):null,e.refs.map(t=>(0,c.jsx)("option",{value:t.ref,children:t.label},t.ref))]})]}):(0,c.jsx)("p",{className:"muted",children:"Reading the versions of this flow\u2026"})}function gq(){let e=_(s=>s.lensView),t=_(s=>s.lens),n=_(s=>s.lensFacts.inventory),r=_(s=>s.snapshot?.doc);if(!e||!t)return null;let a=t==="inventory"||t==="access";return(0,c.jsxs)("section",{className:"afd-panel-body afd-lens-browser","aria-label":`${uv(t)} lens`,children:[(0,c.jsxs)("h2",{className:"afd-panel-title",children:[uv(t)," ",(0,c.jsx)(Sa,{topic:"lenses",about:"lenses"})]}),(0,c.jsxs)("p",{className:"muted","data-lens-what":!0,children:[sa.find(s=>s.id===t)?.hint,"."]}),a?(0,c.jsxs)("div",{className:"afd-lens-source",children:[(0,c.jsx)("p",{className:"muted",children:n?.facts?`${n.facts.sources.join(", ")} \xB7 ${n.facts.total} hosts`:n?.state==="loading"?"Reading the inventory\u2026":"Inventory not read"}),(0,c.jsxs)("p",{children:["Targets: ",(0,c.jsx)("span",{className:"mono",children:n?.targets||"not set"})," ",(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>je({type:"setTargets"}),children:"Set Targets\u2026"})]})]}):null,t==="changes"?(0,c.jsx)(mq,{}):null,e.notes.length>0&&t==="changes"?(0,c.jsx)("p",{className:"muted","data-compare-note":!0,children:e.notes.join(" ")}):null,e.sections.map(s=>{let l=u$(r,s.items.map(f=>f.nodes));return(0,c.jsxs)("section",{className:"afd-section",children:[(0,c.jsx)("h3",{children:s.title}),s.items.length===0?(0,c.jsx)("p",{className:"muted",children:s.empty}):(0,c.jsx)("ul",{className:"afd-lens-items",children:s.items.map(f=>(0,c.jsx)(pq,{item:f,places:l},f.key))})]},s.title)})]})}function yq(){let e=_(p=>p.lensView),t=_(p=>p.lens),[n,r]=(0,T.useState)(null),a=(0,T.useRef)(null),s=_(p=>p.snapshot?.doc);if((0,T.useEffect)(()=>{n&&(r(null),([...document.querySelectorAll("[data-finding]")].find(p=>p.dataset.finding===n)?.querySelector("button")??a.current)?.focus())},[n]),!e||!t)return null;let l=e.findings.filter(p=>!p.accepted).length,f=u$(s,e.findings.map(l$));return(0,c.jsxs)("div",{className:"afd-panel-body","data-lens-panel":t,children:[(0,c.jsxs)("h2",{className:"afd-panel-title",children:[uv(t)," lens",(0,c.jsx)("button",{type:"button",className:"secondary afd-lens-refresh",title:"Read the facts again",onClick:()=>je({type:"lens",lens:t,refresh:!0}),children:(0,c.jsx)("span",{className:"codicon codicon-refresh","aria-hidden":"true"})})]}),e.stats.length>0?(0,c.jsx)("dl",{className:"afd-lens-stats",children:e.stats.map(p=>(0,c.jsxs)("div",{children:[(0,c.jsx)("dd",{children:p.value}),(0,c.jsx)("dt",{children:p.label})]},p.label))}):null,e.notes.map(p=>(0,c.jsx)("p",{className:"muted afd-lens-note",children:p},p)),(0,c.jsxs)("section",{className:"afd-section",children:[(0,c.jsxs)("h3",{ref:a,tabIndex:-1,children:["Findings ",l>0?`(${l})`:""]}),e.findings.length===0?(0,c.jsx)("p",{className:"muted",children:"Nothing to report for this lens."}):(0,c.jsx)("ul",{className:"afd-findings",children:e.findings.map(p=>(0,c.jsx)(c$,{f:p,places:f,onFixed:h=>r(f$(e.findings,h.id)?.id??hq)},p.id))})]})]})}function vq(){let e=_(n=>n.accept),t=_(n=>n.setAccept);return e?(0,c.jsxs)(Nh,{id:"afd-accept",title:"Accept with Reason",placeholder:"e.g. The spines must drain while the edge switch reboots",submit:"Accept",target:e,record:n=>e.check&&e.node?Pe({kind:"acceptCheck",node:e.node,...e.check,reason:n}):Pe({kind:"acceptFinding",finding:e.id,node:e.node,reason:n}),close:()=>t(null),children:[(0,c.jsx)("strong",{children:e.title}),"."," ",e.check?"The problem stops showing for this node; the decision is recorded in the flow with your Git user name.":"The finding stays visible as expected; the decision is recorded in the flow with your Git user name."]}):null}function bq({snapshot:e}){let t=e.file??"This file";return(0,c.jsxs)("div",{className:"afd-not-a-flow","data-not-a-flow":e.empty?"empty":"invalid",children:[(0,c.jsxs)("h1",{children:[(0,c.jsx)("span",{className:"codicon codicon-type-hierarchy","aria-hidden":"true"})," Ansible Flow Designer"]}),(0,c.jsxs)("p",{className:"muted",children:["Files named ",(0,c.jsx)("code",{children:"*.flow.yaml"})," open here, as a flow you design on a canvas."]}),e.empty?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("p",{children:[(0,c.jsx)("code",{children:t})," is empty. Create a flow in it: a start, an end and a"," ",(0,c.jsx)("code",{children:"devices"})," input for the target hosts, named after the file."]}),(0,c.jsxs)("div",{className:"afd-not-a-flow-actions",children:[(0,c.jsxs)("button",{type:"button",onClick:()=>je({type:"initFlow"}),children:[(0,c.jsx)("span",{className:"codicon codicon-add","aria-hidden":"true"})," Create a flow here"]}),(0,c.jsx)("button",{type:"button",className:"secondary",onClick:()=>je({type:"openText"}),children:"Open in Text Editor"})]})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("p",{role:"alert",children:[(0,c.jsx)("code",{children:t})," is not a flow document yet:"]}),(0,c.jsx)("pre",{className:"afd-not-a-flow-error",children:e.parseError}),(0,c.jsxs)("p",{className:"muted",children:["Fix it in the text editor, or start a new flow with ",(0,c.jsx)("em",{children:"Ansible Flow: New Flow\u2026"})," in the Command Palette."]}),(0,c.jsx)("div",{className:"afd-not-a-flow-actions",children:(0,c.jsx)("button",{type:"button",onClick:()=>je({type:"openText"}),children:"Open in Text Editor"})})]})]})}function xq(){let e=_(r=>r.outside);if(!e)return null;let t=t5(e.since),n=r5(e);return(0,c.jsxs)("div",{className:"afd-outside-note",role:"status","data-outside-note":e.nodes.length,"data-outside-closed":e.closed?"true":void 0,children:[(0,c.jsx)("span",{className:"afd-swatch outside","aria-hidden":"true"})," ",(0,c.jsxs)("span",{children:[e5(e)," ",e.closed?`since you last had this flow open (${t}).`:`since you opened it (first at ${t}).`]})," ",e.nodes.length?(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>{let r=_.getState(),a=e.nodes[0];a&&r.reveal(a),r.setHighlight(e.nodes)},children:"Show"}):null," ",(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>{_.getState().setHighlight(null),je({type:"clearOutside"})},children:"Clear"}),n.length?(0,c.jsxs)("details",{className:"afd-outside-list",open:!0,"data-outside-list":n.length,children:[(0,c.jsxs)("summary",{children:["What changed (",n.length,")"]}),(0,c.jsx)("ul",{children:n.map(r=>(0,c.jsx)("li",{children:r.id?(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>{let a=_.getState();r.id&&(a.reveal(r.id),a.setHighlight([r.id]))},children:r.text}):r.text},`${r.id??""}|${r.text}`))})]}):null]})}var wq={rollback:"discard","notify-stop":"bell",retry:"refresh",exclude:"circle-slash"},kq=Object.values(Hf).filter(e=>e.palette),x_="afd-dragging-pattern",w_=[{type:"task",icon:"symbol-event",hint:"One step: a module, role or playbook"},{type:"subflow",icon:"type-hierarchy-sub",hint:"A step with its own inner graph"},{type:"decision",icon:"git-compare",hint:"Route each host on a condition"},{type:"approval",icon:"pass",hint:"Wait for an approval"},{type:"parallel",icon:"split-horizontal",hint:"Send the hosts down several branches"},{type:"join",icon:"merge",hint:"Bring branches back together"},{type:"start",icon:"debug-start",hint:"Entry point of the flow"},{type:"end",icon:"debug-stop",hint:"Exit of the flow"}],k_=new Set(["task","subflow","decision","approval"]),Sq=[{kind:"note",label:"Note",icon:"note",hint:"A sticky note; drop it on a node to tie it"},{kind:"section",label:"Section",icon:"layout-panel",hint:"A titled region behind steps; moving it moves what is inside"},{kind:"text",label:"Text",icon:"text-size",hint:"A heading or caption"}];function Nq(){let e=_(m=>m.openQuickAdd),t=_(m=>m.mode==="run"),n=_(m=>!!m.snapshot?.doc&&Rt(m.snapshot.doc)<2),r=_(m=>m.paletteCollapsed),a=ph(),s=a.nodes.some(m=>Ks(m.node).some(b=>ha(b.name))),l=a.nodes.some(m=>m.node.type==="parallel"||m.node.type==="join"),{screenToFlowPosition:f}=As(),p=m=>{let b=document.querySelector(".react-flow")?.getBoundingClientRect(),w=b?f({x:b.left+b.width/2,y:b.top+b.height/3}):void 0;e({type:m,position:w})},h=(m,b)=>r?{"aria-label":m,title:`${m}: ${b}`}:{title:b},v=m=>(0,c.jsx)("li",{children:(0,c.jsxs)("button",{type:"button",draggable:!t,disabled:t,onDragStart:b=>{b.dataTransfer.setData(sE,m.type),b.dataTransfer.effectAllowed="copy"},onClick:()=>n8(m.type)||p(m.type),...h(yo[m.type],m.hint),children:[(0,c.jsx)("span",{className:`codicon codicon-${m.icon}`,"aria-hidden":"true"}),r?null:yo[m.type]]})},m.type),g=(0,c.jsxs)(c.Fragment,{children:[r?null:(0,c.jsxs)("h2",{children:["Failure patterns ",(0,c.jsx)(Sa,{topic:"patterns",about:"failure patterns"})]}),(0,c.jsx)("p",{className:`afd-palette-hint muted${r?" afd-sr-only":""}`,id:"afd-pattern-hint",children:"Drop onto an open fail port, or select a node and click"}),(0,c.jsx)("ul",{className:"afd-palette",children:kq.map(m=>(0,c.jsx)("li",{children:(0,c.jsxs)("button",{type:"button",draggable:!t,disabled:t,"data-pattern":m.id,"aria-describedby":"afd-pattern-hint",onDragStart:b=>{b.dataTransfer.setData(lE,m.id),b.dataTransfer.effectAllowed="copy",document.body.classList.add(x_)},onDragEnd:()=>document.body.classList.remove(x_),onClick:()=>{let b=_.getState().selection.node;b?FE(m.id,b):_.getState().setError("Select a node first, or drag the pattern onto a port")},...h(m.label,`${m.hint}. Accepts: ${m.accepts.join(", ")}`),children:[(0,c.jsx)("span",{className:`codicon codicon-${wq[m.id]??"symbol-event"}`,"aria-hidden":"true"}),r?null:m.label]})},m.id))})]});return(0,c.jsxs)("aside",{className:`afd-left${r?" collapsed":""}`,"aria-label":"Palette",children:[(0,c.jsxs)("div",{className:"afd-palette-head",children:[r?null:(0,c.jsx)("h2",{children:"Nodes"}),(0,c.jsx)("button",{type:"button",className:"icon","aria-label":r?"Expand Palette":"Collapse Palette","aria-expanded":!r,title:r?"Show the names":"Icons only, for a wider canvas",onClick:()=>_.getState().setPaletteCollapsed(!r),children:(0,c.jsx)("span",{className:`codicon codicon-chevron-${r?"right":"left"}`,"aria-hidden":"true"})})]}),t?(0,c.jsx)("p",{className:"afd-palette-hint muted",children:"Run mode is read-only"}):null,(0,c.jsx)("ul",{className:"afd-palette",children:w_.filter(m=>r||k_.has(m.type)).map(v)}),r?null:(0,c.jsx)(Nr,{id:"palette-more",open:l,summary:"More node types",children:(0,c.jsx)("ul",{className:"afd-palette",children:w_.filter(m=>!k_.has(m.type)).map(v)})}),s?g:null,r?null:(0,c.jsx)("h2",{children:"Annotate"}),(0,c.jsx)("ul",{className:"afd-palette","aria-label":"Annotate",children:Sq.map(m=>(0,c.jsx)("li",{children:(0,c.jsxs)("button",{type:"button",draggable:!t&&!n,disabled:t||n,"data-annotation-kind":m.kind,onDragStart:b=>{b.dataTransfer.setData(dE,m.kind),b.dataTransfer.effectAllowed="copy"},onClick:()=>{let b=document.querySelector(".react-flow")?.getBoundingClientRect(),w=b?f({x:b.left+b.width/2,y:b.top+b.height/2}):void 0,k=_.getState().selection,S=m.kind==="note"?k.node:void 0,N=[...k.nodes??(k.node?[k.node]:[]),...k.annotations??[]];Yd(m.kind,w,S,{near:!0,...m.kind==="section"&&N.length?{around:N}:{}})},...h(m.label,n?"Annotations need flow format 2: Upgrade Flow Format":m.hint),children:[(0,c.jsx)("span",{className:`codicon codicon-${m.icon}`,"aria-hidden":"true"}),r?null:m.label]})},m.kind))}),(0,c.jsx)(jq,{collapsed:r})]})}function jq({collapsed:e}){let[t,n]=(0,T.useState)(!1),r=(0,T.useRef)(null),a=(0,T.useRef)(null);(0,T.useEffect)(()=>{if(!t)return;a.current?.focus();let l=f=>{let p=f.target;!a.current?.contains(p)&&!r.current?.contains(p)&&n(!1)};return document.addEventListener("pointerdown",l,!0),()=>document.removeEventListener("pointerdown",l,!0)},[t]);let s=()=>{n(!1),r.current?.focus()};return(0,c.jsxs)("div",{className:"afd-legend-wrap",children:[(0,c.jsxs)("button",{ref:r,type:"button",className:"secondary afd-legend-button","aria-expanded":t,"aria-controls":"afd-legend","aria-label":"Legend",title:"What the port and wire styles mean",onClick:()=>t?s():n(!0),onKeyDown:l=>{l.key==="Escape"&&t&&(l.stopPropagation(),s())},children:[(0,c.jsx)("span",{className:"codicon codicon-question","aria-hidden":"true"}),e?null:" Legend"]}),t?(0,c.jsxs)("div",{ref:a,id:"afd-legend",className:"afd-legend-popover",role:"dialog","aria-label":"Legend",tabIndex:-1,onKeyDown:l=>{l.key==="Escape"&&(l.stopPropagation(),s())},children:[(0,c.jsxs)("ul",{className:"afd-legend",children:[(0,c.jsxs)("li",{children:[(0,c.jsx)("span",{className:"afd-swatch port state-connected tone-ok"})," Connected port"]}),(0,c.jsxs)("li",{children:[(0,c.jsx)("span",{className:"afd-swatch port state-open-fail tone-failed"})," Open fail port (wire it or accept it)"]}),(0,c.jsxs)("li",{children:[(0,c.jsx)("span",{className:"afd-swatch port state-open-purpose tone-failed"})," Open on purpose"]}),(0,c.jsxs)("li",{children:[(0,c.jsx)("span",{className:"afd-swatch port state-open tone-ok optional"})," Optional port, shown on hover"]}),(0,c.jsxs)("li",{children:[(0,c.jsx)("span",{className:"afd-swatch wire"})," Normal outcome"]}),(0,c.jsxs)("li",{children:[(0,c.jsx)("span",{className:"afd-swatch wire problem"})," Problem path"]}),(0,c.jsxs)("li",{children:[(0,c.jsx)("span",{className:"afd-swatch outside"})," Changed outside the designer (dashed)"]})]}),(0,c.jsx)("p",{className:"muted",children:"Hosts travel along wires, from port to port:"}),(0,c.jsx)("dl",{className:"afd-legend-ports",children:Q5.map(l=>(0,c.jsxs)("div",{children:[(0,c.jsx)("dt",{className:"mono",children:l}),(0,c.jsx)("dd",{children:ka(l)})]},l))})]}):null]})}var S_={to:"Click the node to wire",rewire:"Click the new target of",from:"Click the node that feeds",attach:"Click the node this note is about"};function Cq(){let e=_(f=>f.pick),t=_(f=>f.snapshot),n=_(f=>f.setPick),r=_(f=>f.pickAt);if(!e)return null;let a=t?.doc,s=f=>(a&&Ee(a).nodes.get(f)?.node.title)??f,l=s(e.ref.node);return(0,c.jsxs)("div",{className:"afd-banner info",role:"status","data-pick":e.mode,children:[(0,c.jsx)("span",{className:"codicon codicon-target","aria-hidden":"true"}),(0,c.jsx)("span",{children:e.mode==="attach"?S_.attach:(0,c.jsxs)(c.Fragment,{children:[S_[e.mode]," ",(0,c.jsx)("strong",{children:l})," \xB7"," ",(0,c.jsx)("span",{className:"mono",children:e.ref.port})]})}),(0,c.jsx)("span",{className:"muted","data-pick-at":r??void 0,children:r?(0,c.jsxs)(c.Fragment,{children:["Enter: ",(0,c.jsx)("strong",{children:s(r)})," \xB7 Esc to cancel"]}):"Tab or the arrow keys choose a node \xB7 Esc to cancel"}),(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>n(null),children:"Cancel"})]})}function Eq(){let e=_(s=>s.portMenu),t=_(s=>s.snapshot),n=_(s=>s.openPortMenu),r=(0,T.useMemo)(()=>e&&t?.doc?Ld(Ee(t.doc),e.ref):void 0,[e,t]);if(!e||!r)return null;let a=(t?.doc?.decisions??[]).find(s=>s?.node===e.ref.node&&s.port===e.ref.port)?.reason;return(0,c.jsx)(Mh,{x:e.x,y:e.y,label:`${r.node.title} \xB7 ${e.ref.port}`,className:"afd-port-menu",data:{"data-port-menu":`${e.ref.node}|${e.ref.port}`},onClose:()=>n(null),header:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:"afd-port-menu-head",children:[(0,c.jsxs)("span",{children:[(0,c.jsx)("strong",{children:r.node.title})," \xB7 ",(0,c.jsx)("span",{className:"mono",children:e.ref.port})]}),(0,c.jsx)("button",{type:"button",className:"icon","aria-label":"Close menu",onClick:()=>n(null),children:(0,c.jsx)("span",{className:"codicon codicon-close","aria-hidden":"true"})})]}),ka(e.ref.port,r.node.type)?(0,c.jsx)("p",{className:"afd-port-menu-note muted",children:ka(e.ref.port,r.node.type)}):null,a?(0,c.jsxs)("p",{className:"afd-port-menu-note",children:["Open on purpose: ",a]}):null]}),items:r.items.map(s=>({type:"item",label:s.label,...s.kind==="later"?{disabled:s.hint}:{},title:"hint"in s?s.hint:void 0,onSelect:()=>{ol(s,e.ref)}}))})}var du=8;function $q(){let e=_(v=>v.preview),t=_(v=>v.snapshot),n=_(v=>v.run),r=_(v=>v.setPreview),a=_(v=>v.setLevel),s=(0,T.useRef)(null),[l,f]=(0,T.useState)(null),p=(0,T.useMemo)(()=>e&&t?.doc?r6(t.doc,e.node,n):void 0,[e,t,n]);if((0,T.useLayoutEffect)(()=>{if(!e||!s.current){f(null);return}let{width:v,height:g}=s.current.getBoundingClientRect(),m=e.x+v+du>window.innerWidth?e.left-v-du:e.x,b=Math.min(e.y,window.innerHeight-g-du);f({left:Math.max(du,m),top:Math.max(du,b)})},[e]),!e||!p)return null;let{node:h}=p;return(0,c.jsxs)("div",{ref:s,className:"afd-preview",role:"dialog","aria-label":`Preview of ${h.title}`,"data-preview":h.id,style:l?{left:l.left,top:l.top}:{visibility:"hidden"},onMouseEnter:()=>_.getState().holdPreview(!0),onMouseLeave:()=>_.getState().holdPreview(!1),children:[(0,c.jsxs)("header",{className:"afd-preview-head",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("strong",{children:h.title}),(0,c.jsx)("div",{className:"mono muted",children:p.binding??p.subtitle})]}),h.status?(0,c.jsx)("span",{className:`afd-chip status-${h.status}`,children:h.status}):null]}),p.steps.length>0?(0,c.jsxs)("section",{children:[(0,c.jsxs)("h4",{children:["Inside",n?.state==="done"?" \xB7 last run":""]}),(0,c.jsx)("ol",{className:"afd-preview-steps",children:p.steps.map(v=>(0,c.jsxs)("li",{"data-preview-step":v.id,children:[(0,c.jsxs)("span",{className:"afd-preview-step-title",children:[v.title,v.entry?(0,c.jsx)("span",{className:"afd-chip",children:"entry"}):null,v.badges.map(g=>(0,c.jsx)("span",{className:"afd-chip",children:g},g))]}),v.exits.map(g=>(0,c.jsxs)("span",{className:"afd-preview-exit","data-exit":g.port,children:["\u2192 ",g.port,g.reason?` \xB7 ${g.reason}`:""]},g.port)),v.run?(0,c.jsx)("span",{className:"muted afd-preview-run",children:v.run}):null]},v.id))})]}):null,(0,c.jsxs)("dl",{className:"afd-preview-facts",children:[!p.hasInner&&p.run?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("dt",{children:"Last run"}),(0,c.jsx)("dd",{children:p.run})]}):null,p.undo?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("dt",{children:"Undo"}),(0,c.jsx)("dd",{className:"mono",children:p.undo})]}):null,p.settings.length>0?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("dt",{children:"Settings"}),(0,c.jsx)("dd",{children:p.settings.join(" \xB7 ")})]}):null]}),(0,c.jsxs)("footer",{className:"afd-preview-actions",children:[h.type==="subflow"?(0,c.jsx)("span",{className:"muted",children:"Double-click or Enter to open"}):(0,c.jsx)("span",{}),h.type==="subflow"?(0,c.jsx)("button",{type:"button",onClick:()=>{r(null),a(h.id)},children:"Open Subflow"}):null]})]})}async function uu(e){let t=await gf(e);return t.ok||_.getState().setError(t.error??"The scenarios file did not change"),t.ok}function _q(e){let t=Math.max(0,Math.round((Date.now()-Date.parse(e))/1e3));return Number.isFinite(t)?t<60?"just now":t<3600?`${Math.round(t/60)} min ago`:t<86400?`${Math.round(t/3600)} h ago`:new Date(e).toLocaleDateString():e}function Tq({close:e}){let t=_(p=>p.scenarioCheck),n=_(p=>p.snapshot?.doc),r=_(p=>p.editScenario),[a,s]=(0,T.useState)(()=>O7(t)),[l,f]=(0,T.useState)(3);return(0,c.jsxs)("form",{className:"afd-section afd-scenario-new",onSubmit:async p=>{p.preventDefault();let h=a.trim();h&&n&&await uu({kind:"add",scenario:P7(n,h,l)})&&(e(),r(h))},"data-scenario-new":!0,children:[(0,c.jsx)("h3",{children:"New Scenario"}),(0,c.jsxs)("div",{className:"afd-field",children:[(0,c.jsx)("label",{htmlFor:"afd-scenario-name",children:"Name"}),(0,c.jsx)("input",{id:"afd-scenario-name",className:"afd-input",value:a,autoFocus:!0,onChange:p=>s(p.target.value)})]}),(0,c.jsxs)("div",{className:"afd-field",children:[(0,c.jsx)("label",{htmlFor:"afd-scenario-hosts",children:"Hosts"}),(0,c.jsx)("input",{id:"afd-scenario-hosts",className:"afd-input",type:"number",min:1,max:50,value:l,onChange:p=>f(Number(p.target.value)||1)}),(0,c.jsxs)("p",{className:"muted",children:[m_(l).join(", "),": names only, they run on this machine with every step as its stub."]})]}),(0,c.jsx)("p",{className:"muted",children:"It starts with every host where the flow sends it now. Then plant failures: right-click a step on the canvas."}),(0,c.jsxs)("div",{className:"afd-modal-actions",children:[(0,c.jsx)("button",{type:"button",className:"secondary",onClick:e,children:"Cancel"}),(0,c.jsx)("button",{type:"submit",disabled:!a.trim(),children:"Add Scenario"})]})]})}function Aq({name:e,close:t}){let[n,r]=(0,T.useState)(e),a=_(l=>l.editScenario),s=_(l=>l.scenarioEditing);return(0,c.jsxs)("form",{className:"afd-inline-form",onSubmit:async l=>{if(l.preventDefault(),!n.trim()||n===e)return t();await uu({kind:"rename",name:e,to:n.trim()})&&(s===e&&a(n.trim()),t())},children:[(0,c.jsx)("input",{className:"afd-input","aria-label":`New name for ${e}`,value:n,autoFocus:!0,onChange:l=>r(l.target.value),onKeyDown:l=>{l.key==="Escape"&&(l.stopPropagation(),t())}}),(0,c.jsx)("button",{type:"submit",children:"Rename"})]})}function Mq(){let e=_(b=>b.snapshot?.doc),t=_(b=>b.scenarioCheck),n=_(b=>b.scenarioUndo),r=_(b=>b.scenarioEditing),a=_(b=>b.editScenario),s=_(b=>b.closeScenarios),[l,f]=(0,T.useState)(!1),[p,h]=(0,T.useState)(null);if(!e)return null;let v=t?M7(e,t):[],g=t?IC(t.problems):[],m=v.filter(b=>b.verdict!=="pass").length;return(0,c.jsxs)("div",{className:"afd-panel-body","data-scenarios-panel":v.length,children:[(0,c.jsxs)("h2",{className:"afd-panel-title",children:["Scenarios ",(0,c.jsx)(Sa,{topic:"scenarios",about:"scenario tests"}),(0,c.jsx)("button",{type:"button",className:"icon afd-tab-close","aria-label":"Close the Scenarios tab",title:"Close the Scenarios tab (the chip in the top bar opens it again)",onClick:s,children:(0,c.jsx)("span",{className:"codicon codicon-close","aria-hidden":"true"})})]}),(0,c.jsx)("p",{className:"muted",children:"Where each host must end when chosen steps fail. Checked in a simulation as you change the flow; Verify in Ansible runs them for real, every step as its stub."}),(0,c.jsxs)("div",{className:"afd-row-actions",children:[(0,c.jsxs)("button",{type:"button",onClick:()=>f(!0),disabled:l,children:[(0,c.jsx)("span",{className:"codicon codicon-add","aria-hidden":"true"})," New Scenario"]}),v.length?(0,c.jsxs)("button",{type:"button",className:"secondary",onClick:()=>je({type:"runScenarios"}),title:"Run every scenario in the run environment, every step as its stub",children:[(0,c.jsx)("span",{className:"codicon codicon-play","aria-hidden":"true"})," Verify All in Ansible"]}):null,n?(0,c.jsxs)("button",{type:"button",className:"secondary","data-scenario-undo":n,onClick:async()=>{let b=await H3();b.ok||_.getState().setError(b.error??"Nothing to undo")},title:"Take back the last change to the scenarios made here",children:[(0,c.jsx)("span",{className:"codicon codicon-discard","aria-hidden":"true"})," Undo"]}):null,t?.file?(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>je({type:"openScenarios"}),title:"The scenarios file in the text editor",children:"Open File"}):null]}),l?(0,c.jsx)(Tq,{close:()=>f(!1)}):null,t?.error||g.length?(0,c.jsxs)("section",{className:"afd-section tone-error","data-scenarios-errors":g.length||1,children:[(0,c.jsx)("h3",{children:"The file does not fit the flow"}),(0,c.jsxs)("ul",{children:[t?.error?(0,c.jsx)("li",{children:t.error}):null,g.map(b=>(0,c.jsx)("li",{children:b.message},`${b.scenario}:${b.path.join(".")}:${b.message}`))]}),(0,c.jsx)("p",{className:"muted",children:"Fix it in the file (Open File); Problems lists the same."})]}):null,r?(0,c.jsxs)("p",{className:"afd-scenario-editing","data-scenario-editing":r,children:["On the canvas: ",(0,c.jsx)("strong",{children:r}),", simulated. Right-click a step to make it fail for chosen hosts."," ",(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>a(null),children:"Done"})]}):null,v.length===0&&!l?(0,c.jsx)("p",{className:"muted","data-scenarios-empty":!0,children:"No scenarios yet. A scenario names some hosts, plants a failure or two, and says where each host must end, so a later change to the flow cannot quietly send them elsewhere."}):null,v.length?(0,c.jsxs)("h3",{className:"afd-subtitle",children:[m?`${m} of ${v.length} failing`:`All ${v.length} pass`," ",(0,c.jsx)("span",{className:"muted",children:"(simulated)"})]}):null,(0,c.jsx)("ul",{className:"afd-scenario-list",children:v.map(b=>(0,c.jsxs)("li",{className:`afd-scenario tone-${b.verdict==="pass"?"ok":b.verdict==="fail"?"warn":"error"}${r===b.name?" active":""}`,"data-scenario":b.name,"data-verdict":b.verdict,children:[p===b.name?(0,c.jsx)(Aq,{name:b.name,close:()=>h(null)}):(0,c.jsxs)("div",{className:"afd-scenario-head",children:[(0,c.jsx)("span",{className:"afd-scenario-verdict",children:b.verdict==="pass"?"pass":b.verdict==="fail"?"fail":"cannot tell"}),(0,c.jsx)("strong",{children:b.name}),(0,c.jsxs)("span",{className:"muted",children:[" \xB7 ",b.hosts.length," hosts"]})]}),b.planted.length?(0,c.jsx)("p",{className:"muted","data-scenario-planted":!0,children:b.planted.join("; ")}):null,b.error?(0,c.jsx)("p",{className:"tone-error",children:b.error}):null,b.misses.length?(0,c.jsx)("ul",{className:"afd-scenario-misses","data-scenario-misses":b.misses.length,children:b.misses.map(w=>(0,c.jsx)("li",{children:w},w))}):null,b.bestEffort.length?(0,c.jsxs)("p",{className:"muted","data-scenario-best-effort":!0,title:b.bestEffort.join(`
|
|
200
|
+
`),children:["Simulated as a best effort: ",b.bestEffort[0],". Verify it in Ansible."]}):null,b.verified?(0,c.jsxs)("p",{className:"muted","data-scenario-verified":b.verified.stale?"stale":"current",children:["Ansible: ",b.verified.passed?"passed":"failed"," ",_q(b.verified.at),b.verified.stale?" \xB7 out of date: the flow or the scenario changed since":""]}):null,(0,c.jsxs)("div",{className:"afd-row-actions",children:[(0,c.jsx)("button",{type:"button",className:r===b.name?"":"secondary","aria-pressed":r===b.name,onClick:()=>a(r===b.name?null:b.name),title:"Show this scenario's simulation on the canvas, and plant outcomes there",children:"Show on Canvas"}),b.verdict==="fail"?(0,c.jsx)("button",{type:"button",className:"secondary","data-accept-ends":!0,onClick:()=>{uu({kind:"acceptEnds",name:b.name})},title:"Expect each host where the flow now sends it",children:"Accept New Ends"}):null,(0,c.jsx)("button",{type:"button",className:"secondary",onClick:()=>je({type:"runScenarios",names:[b.name]}),title:"Run this scenario in the run environment, every step as its stub",children:"Verify in Ansible"}),(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>h(b.name),children:"Rename"}),(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>{uu({kind:"duplicate",name:b.name,to:`${b.name} (copy)`})},children:"Duplicate"}),(0,c.jsx)("button",{type:"button",className:"link",onClick:async()=>{await uu({kind:"delete",name:b.name})&&r===b.name&&a(null)},children:"Delete"})]})]},b.name))})]})}function Oq({ids:e}){let t=_(E=>E.snapshot),n=_(E=>E.select),[r,a]=(0,T.useState)(""),[s,l]=(0,T.useState)(null),[f,p]=(0,T.useState)(!1),h=(0,T.useRef)(null);DE("extractTitle",h);let v=wa(),g=_(E=>E.mode),m=t?.doc;if(!m)return null;let b=Ee(m),w=e.map(E=>b.nodes.get(E)?.node).filter(E=>!!E),k=r.trim()||"Subflow",S=w.map(E=>m.layout?.[E.id]??t?.autoPositions[E.id]).filter(E=>!!E),N=async()=>{p(!0),l(null);let{optimistic:E,level:j}=_.getState(),$=t?xa(cn(t,E,j),m.layout):{},L=await la({kind:"extractSubflow",nodes:e,title:k,...S.length>0?{position:{x:Math.min(...S.map(z=>z.x)),y:Math.min(...S.map(z=>z.y))}}:{},...Object.keys($).length>0?{freeze:$}:{}});p(!1),L.ok?L.created&&n({node:L.created}):l(L.error??"The nodes could not be extracted")};return(0,c.jsxs)("div",{className:"afd-panel-body","data-selection-panel":w.length,children:[(0,c.jsxs)("h2",{className:"afd-panel-title",children:[w.length," node",w.length===1?"":"s"," selected"]}),(0,c.jsx)("ul",{className:"afd-selection-list",children:w.map(E=>(0,c.jsxs)("li",{children:[E.title," ",(0,c.jsx)("span",{className:"mono muted",children:E.key})]},E.id))}),v&&g==="design"?(0,c.jsxs)("section",{className:"afd-section","data-arrange":!0,children:[(0,c.jsx)("h3",{children:"Arrange"}),(0,c.jsxs)("div",{className:"afd-arrange",children:[(0,c.jsxs)("button",{type:"button",title:`Line them up on the flow line (${Na("alignCenter")})`,onClick:()=>{sv("center",e)},children:[(0,c.jsx)("span",{className:"codicon codicon-layout-centered","aria-hidden":"true"})," Align Centers"]}),(0,c.jsxs)("button",{type:"button",disabled:w.length<3,title:w.length<3?"Select three steps or more":`Equal gaps, top to bottom (${Na("distribute")})`,onClick:()=>{lv("vertical",e)},children:[(0,c.jsx)("span",{className:"codicon codicon-list-flat","aria-hidden":"true"})," Distribute Vertically"]}),w.some(E=>m.layout?.[E.id])?(0,c.jsx)("button",{type:"button",className:"secondary",title:"Let the canvas place them again",onClick:()=>{d_(e)},children:"Reset Position"}):null]}),(0,c.jsx)("p",{className:"muted",children:"The selection's menu (right-click) also aligns left, right, top, middle or bottom edges and spaces them across. One undo puts them back."})]}):null,(0,c.jsxs)("section",{className:"afd-section",children:[(0,c.jsx)("p",{className:"muted",children:"Copy takes the nodes, the wires between them and their layout as text: paste them on any flow canvas, or keep them in a text file as a snippet."}),(0,c.jsxs)("button",{type:"button",onClick:()=>Kd(),children:[(0,c.jsx)("span",{className:"codicon codicon-copy","aria-hidden":"true"})," Copy nodes"]})]}),(0,c.jsxs)("section",{className:"afd-section",children:[(0,c.jsx)("h3",{children:"Extract into Subflow"}),(0,c.jsx)("p",{className:"muted",children:"The nodes and the wires between them move into a new subflow, with their IDs. Wires into the selection must reach one node; wires out leave through the subflow's ports."}),(0,c.jsxs)("label",{className:"afd-field",children:[(0,c.jsx)("span",{className:"afd-label",children:"Title"}),(0,c.jsx)("input",{ref:h,type:"text",value:r,placeholder:"Subflow",onChange:E=>a(E.target.value),onKeyDown:E=>{E.key==="Enter"&&!f&&N()}})]}),(0,c.jsxs)("p",{className:"muted",children:["Key ",(0,c.jsx)("span",{className:"mono",children:PC(k,"subflow")})]}),(0,c.jsxs)("button",{type:"button",disabled:f,onClick:()=>{N()},children:[(0,c.jsx)("span",{className:"codicon codicon-type-hierarchy-sub","aria-hidden":"true"})," Extract into Subflow"]}),s?(0,c.jsxs)("p",{className:"afd-run-warning",role:"alert","data-extract-error":!0,children:[(0,c.jsx)("span",{className:"codicon codicon-warning","aria-hidden":"true"})," ",s]}):null]})]})}function Pq(){let e=_(a=>a.testedReason),t=_(a=>a.snapshot?.doc),n=_(a=>a.setTestedReason);if(!e)return null;let r=t?Ee(t).nodes.get(e)?.node:void 0;return(0,c.jsxs)(Nh,{id:"afd-tested",title:"Mark Tested",placeholder:"e.g. Ran by hand on sw-lab-01 with the same parameters",submit:"Mark Tested",target:e,record:a=>Pe({kind:"markTested",id:e,reason:a}),close:()=>n(null),children:[(0,c.jsx)("strong",{children:r?.title??e})," counts as tested without a passing run of this flow. A passing real run marks nodes tested by itself (Run mode); here, say why. The reason is recorded in the flow with your Git user name, and goes when the node's design changes."]})}var Dq={info:"info",success:"pass",error:"error"};function Lq(){let e=_(n=>n.toasts),t=_(n=>n.dismissToast);return(0,c.jsxs)("div",{className:"afd-toasts","aria-live":"polite",children:[(0,c.jsx)(Iq,{}),e.map(n=>(0,c.jsxs)("div",{className:`afd-toast level-${n.level}`,role:n.level==="error"?"alert":"status","data-toast":n.level,children:[(0,c.jsx)("span",{className:`codicon codicon-${Dq[n.level]}`,"aria-hidden":"true"}),(0,c.jsx)("span",{className:"afd-toast-text",children:n.text}),(0,c.jsx)("button",{type:"button",className:"icon","aria-label":"Close message",title:"Close",onClick:()=>t(n.id),children:(0,c.jsx)("span",{className:"codicon codicon-close","aria-hidden":"true"})})]},n.id))]})}function Iq(){let e=_(r=>r.saving),[t,n]=(0,T.useState)(!1);return(0,T.useEffect)(()=>{if(!e){n(!1);return}let r=setTimeout(()=>n(!0),250);return()=>clearTimeout(r)},[e]),t?(0,c.jsxs)("div",{className:"afd-toast afd-saving",role:"status","data-saving":!0,children:[(0,c.jsx)("span",{className:"codicon codicon-loading codicon-modifier-spin","aria-hidden":"true"}),(0,c.jsx)("span",{className:"afd-toast-text",children:"Saving\u2026"})]}):null}function cv({label:e,children:t,items:n,className:r,title:a,disabled:s}){let l=(0,T.useRef)(null),[f,p]=(0,T.useState)(null),h=()=>{let v=l.current?.getBoundingClientRect();v&&p({x:v.left,y:v.bottom+2})};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("button",{ref:l,type:"button",className:r,"aria-label":e,"aria-haspopup":"menu","aria-expanded":f!==null,title:a,disabled:s,onClick:()=>f?p(null):h(),onKeyDown:v=>{v.key==="ArrowDown"&&(v.preventDefault(),h())},children:t}),f?(0,c.jsx)(Mh,{x:f.x,y:f.y,label:e,items:n(),opener:l.current,onClose:()=>p(null)}):null]})}function Rq(){let e=_(b=>b.snapshot?.doc),t=e?.flow,n=_(b=>b.level),r=_(b=>b.setLevel),a=e?k5(e,n):[],s=e?S5(e,n):[],l=_(b=>b.run),f=l?.state==="running",p=_(b=>b.snapshot?.findings.filter(w=>w.severity==="error").length??0),h=_(b=>b.mode),v=_(b=>b.viewer),g=_(b=>b.lens),m=_(b=>b.setLens);return(0,c.jsxs)("header",{className:"afd-topbar",children:[(0,c.jsxs)("nav",{className:"afd-breadcrumb","aria-label":"Breadcrumb",children:[n==="root"?null:(0,c.jsxs)("button",{type:"button",className:"secondary afd-back",onClick:()=>r(a.at(-2)?.id??"root"),title:"Back to the enclosing level",children:[(0,c.jsx)("span",{className:"codicon codicon-arrow-left","aria-hidden":"true"})," Back"]}),a.map((b,w)=>(0,c.jsxs)("span",{className:"afd-crumb",children:[w>0?(0,c.jsx)("span",{className:"muted",children:"/"}):null,w<a.length-1?(0,c.jsx)("button",{type:"button",className:"link",onClick:()=>r(b.id),children:w===0?t?.name??"Untitled flow":b.title}):(0,c.jsx)("span",{className:"afd-flow-name","aria-current":"location",children:w===0?t?.name??"Untitled flow":b.title})]},b.id)),s.map(b=>(0,c.jsx)("span",{className:`afd-chip afd-context${b.applied?"":" muted"}`,title:b.title,"data-applied":b.applied,children:b.label},b.label)),t?(0,c.jsxs)("span",{className:"afd-chip mono",title:"Flow key and version",children:[t.key," \xB7 v",t.version]}):null,v?null:(0,c.jsx)(zq,{})]}),(0,c.jsx)("fieldset",{className:"afd-segmented","aria-label":"Mode",style:v?{display:"none"}:void 0,children:dv.map(b=>(0,c.jsx)("button",{type:"button",className:b.id===h?"active":"","aria-pressed":b.id===h,disabled:!!b.soon,onClick:()=>WC(b.id),title:b.soon?`${b.label} mode arrives in ${b.soon}`:`${b.hint} (${vo?"\u2325":"Alt+"}${dv.indexOf(b)+1})`,children:b.label},b.id))}),v?null:g||e?.nodes?.some(b=>b?.type!=="start"&&b?.type!=="end")?(0,c.jsx)(Fq,{lens:g,pick:b=>{m(b),je({type:"lens",lens:b})}}):null,(0,c.jsxs)("div",{className:"afd-actions",children:[(0,c.jsx)(Yq,{run:l}),(0,c.jsx)(Wq,{running:f,viewer:v}),v?null:(0,c.jsx)(Kq,{icon:"file-code",label:"Generate Code",title:"Write the playbooks in generated/ now",unavailable:p>0?`Fix the ${p} error${p===1?"":"s"} first (see Problems)`:void 0,onClick:()=>je({type:"generate"})}),(0,c.jsx)(cv,{label:"More actions",className:"secondary icon",title:"More actions",items:()=>v?Hq():qq(h,n),children:(0,c.jsx)("span",{className:"codicon codicon-ellipsis","aria-hidden":"true"})})]})]})}function zq(){let e=_(r=>r.scenarioCheck),t=_(r=>r.openScenarios);if(!_(r=>r.snapshot?.doc?.nodes?.some(a=>a?.type!=="start"&&a?.type!=="end"))&&!e?.file)return null;let n=_7(e);return(0,c.jsxs)("button",{type:"button",className:`afd-chip afd-scenario-chip tone-${n.tone}`,title:n.title,"data-scenario-chip":n.tone,onClick:t,children:[(0,c.jsx)("span",{className:"codicon codicon-beaker","aria-hidden":"true"})," ",n.label]})}function Fq({lens:e,pick:t}){let n=sa.find(r=>r.id===e);return(0,c.jsxs)("div",{className:"afd-lens-pick",children:[(0,c.jsxs)(cv,{label:n?`Lens: ${n.label}`:"Lens: none",className:`secondary${n?" afd-lens-on":""}`,title:"Lenses show chips, wires and findings across the flow",items:()=>[{type:"item",label:"None",checked:e===null,title:"No lens: the mode decides what nodes show",onSelect:()=>t(null)},{type:"separator"},...sa.map(r=>({type:"item",label:r.label,checked:r.id===e,title:r.hint,onSelect:()=>t(r.id)}))],children:[(0,c.jsx)("span",{className:"codicon codicon-eye","aria-hidden":"true"})," ",n?`Lens: ${n.label}`:"Lens"," ",(0,c.jsx)("span",{className:"codicon codicon-chevron-down","aria-hidden":"true"})]}),n?(0,c.jsx)("button",{type:"button",className:"icon","aria-label":"Clear lens",title:"Clear lens",onClick:()=>t(null),children:(0,c.jsx)("span",{className:"codicon codicon-close","aria-hidden":"true"})}):null]})}function Bq(e){return e==="run"?"Run mode only reads: switch to Design to change the flow":e==="code"?"The graph is read-only in Code mode (bindings stay editable): switch to Design":void 0}function N_(e){let t=_.getState(),n={type:"item",label:t.panelCollapsed?"Show Side Panel":"Hide Side Panel",icon:"layout-sidebar-right",onSelect:()=>t.setPanelCollapsed(!t.panelCollapsed)},r={type:"item",label:t.annotationsHidden?"Show Annotations":"Hide Annotations",icon:"note",title:"Notes, sections and text on the canvas",onSelect:()=>t.setAnnotationsHidden(!t.annotationsHidden)};if(e!=="design")return[n,r];let a=t.firstFlow?.hidden??!1,s={type:"item",label:a?"Show First-Flow Checklist":"Hide First-Flow Checklist",icon:"checklist",title:"Four things that make a first flow, on flows with one to five steps",onSelect:()=>je({type:"firstFlow",hidden:!a})};return[{type:"item",label:t.paletteCollapsed?"Expand Palette":"Collapse Palette",icon:"layout-sidebar-left",onSelect:()=>t.setPaletteCollapsed(!t.paletteCollapsed)},n,r,s]}function qq(e,t){return[{type:"item",label:"Tidy Up",icon:"layout",title:"Lay out the whole level again",disabled:Bq(e),onSelect:()=>je({type:"tidyUp",level:t})},{type:"item",label:"Open in Text Editor",icon:"go-to-file",title:"Open the flow file in the text editor",onSelect:()=>je({type:"openText"})},{type:"item",label:"Check Flow",icon:"check-all",title:"Check the design, then the generated code in the Ansible environment",onSelect:()=>je({type:"validate"})},{type:"item",label:"Find Node\u2026",icon:"search",shortcut:Na("find"),title:"Find a node on any level by title, key or binding",onSelect:()=>_.getState().openFind(!0)},...Vq(t),{type:"separator"},...N_(e),{type:"separator"},{type:"item",label:"Keyboard Shortcuts",icon:"keyboard",shortcut:"?",onSelect:()=>_.getState().showCheatSheet(!0)},{type:"item",label:"User Guide",icon:"book",title:"Tutorials and how-to pages, in a Markdown preview",onSelect:()=>je({type:"openGuide"})},{type:"item",label:"Send Feedback\u2026",icon:"feedback",title:"A short form: what works, what is missing (opens in the browser)",onSelect:()=>je({type:"sendFeedback"})}]}function Hq(){return[{type:"item",label:"Find Node\u2026",icon:"search",shortcut:Na("find"),title:"Find a node on any level by title, key or binding",onSelect:()=>_.getState().openFind(!0)},{type:"separator"},...N_("run"),{type:"separator"},{type:"item",label:"Keyboard Shortcuts",icon:"keyboard",shortcut:"?",onSelect:()=>_.getState().showCheatSheet(!0)}]}function Vq(e){return[{type:"item",label:"Export as draw.io Diagram\u2026",icon:"export",title:"Every level as a page of a draw.io diagram, with the node details as shape data",onSelect:()=>je({type:"export",format:"drawio",level:e})},{type:"item",label:"Export as Image\u2026",icon:"file-media",title:"This level as an SVG or PNG image that draw.io also opens as a diagram",onSelect:()=>je({type:"export",format:"image",level:e})}]}function Kq({icon:e,label:t,title:n,unavailable:r,onClick:a}){return(0,c.jsxs)("button",{type:"button",className:"secondary","aria-disabled":r?!0:void 0,title:r??n,onClick:()=>!r&&a(),children:[(0,c.jsx)("span",{className:`codicon codicon-${e}`,"aria-hidden":"true"})," ",t]})}function Wq({running:e,viewer:t}){let n=_(a=>a.runner),r=e?"A run is going: stop it first":void 0;return(0,c.jsxs)("div",{className:"afd-split",children:[(0,c.jsxs)("button",{type:"button",onClick:()=>e?je({type:"stopRun"}):Ty("check"),title:e?"Stop the run: end the local run, or cancel the job or workflow in AWX":t?"Run the flow in check mode: bound steps report what they would change":"Generate the code and run it in check mode in the local Ansible environment",children:[(0,c.jsx)("span",{className:`codicon ${e?"codicon-debug-stop":"codicon-play"}`,"aria-hidden":"true"})," ",e?"Stop":"Run as Skeleton"]}),(0,c.jsx)(cv,{label:"More run options",title:"More run options",items:()=>[{type:"item",label:"Run for Real\u2026",icon:"debug-alt",title:"Run for real (not check mode), after a confirmation naming inventory and hosts",disabled:r,onSelect:()=>Ty("real")},...t?[]:[{type:"item",label:"Run Scenarios",icon:"beaker",title:"Run the scenario tests next to the flow: every step as its stub on local hosts, then where each host ended",disabled:r,onSelect:()=>je({type:"runScenarios"})},{type:"item",label:"Launch in AWX",icon:"rocket",title:"Launch the flow's AWX job template (the pushed commit of the AWX project) and follow its job events",disabled:r,onSelect:()=>je({type:"launchAwx"})},...n?[{type:"item",label:"Run on Server",icon:"cloud-upload",title:"Run the flow on Ansible Flow Server: its launch configuration, at the server's commit, followed here",disabled:r,onSelect:()=>je({type:"launchRunner"})}]:[]]],children:(0,c.jsx)("span",{className:"codicon codicon-chevron-down","aria-hidden":"true"})})]})}function Uq({run:e}){let t=_(a=>a.snapshot?.doc),n=e.summary?.running,r=n&&t?Ee(t).nodes.get(n)?.node.title:void 0;return(0,c.jsxs)("button",{type:"button",className:`afd-run-status${e.quiet?" warn":""}`,"data-run-state":"running","data-run-quiet":e.quiet?"true":void 0,onClick:()=>je({type:"showRunOutput"}),title:e.quiet?"No new events from the run for 20 s: a step may be slow, or waiting for input. Show the terminal.":"Show the terminal of the run.",children:[(0,c.jsx)("span",{className:"codicon codicon-loading codicon-modifier-spin","aria-hidden":"true"})," ",wE(e)?"Waiting for approval":e.quiet?"No new events for 20 s \xB7 Show Terminal":r?`Running: ${r}`:"Running\u2026"]})}function Yq({run:e}){if(e?.state==="running"&&e.awx)return(0,c.jsxs)("button",{type:"button",className:"afd-run-status","data-run-state":"running",onClick:()=>je({type:"showRunOutput"}),title:`AWX ${e.awx.workflow?"workflow":"job"} ${e.awx.jobId} (${e.awx.status}). Open it in AWX.`,children:[(0,c.jsx)("span",{className:"codicon codicon-loading codicon-modifier-spin","aria-hidden":"true"})," AWX"," ",e.awx.workflow?"workflow":"job"," #",e.awx.jobId,wE(e)?" \xB7 waiting for approval":""]});if(e?.state==="running")return(0,c.jsx)(Uq,{run:e});if(!e)return null;if(e.scenario)return(0,c.jsxs)("span",{className:`afd-run-status ${e.scenario.passed?"ok":"warn"}`,"data-run-state":"scenario",children:[(0,c.jsx)("span",{className:`codicon ${e.scenario.passed?"codicon-pass":"codicon-warning"}`,"aria-hidden":"true"})," ","Scenario: ",e.scenario.name," \xB7 ",e.scenario.passed?"passed":"failed"]});if(e.state==="error")return(0,c.jsxs)("span",{className:"afd-run-status error",title:e.error,"data-run-state":"error",children:[(0,c.jsx)("span",{className:"codicon codicon-error","aria-hidden":"true"})," ",e.awx||e.summary?"Run interrupted":"Run not started"]});let t=e.summary,{ok:n,failed:r}=qj(e),a=e.awx?`AWX #${e.awx.jobId} \xB7 `:"",s=t?.stoppedEarly?`${a}Stopped early \xB7 exit ${e.rc}`:`${a}${t?.hosts.length??0} hosts \xB7 ${r} failed \xB7 exit ${e.rc}`;return(0,c.jsxs)("button",{type:"button",className:`afd-run-status ${n?"ok":"warn"}`,"data-run-state":e.state,onClick:()=>je({type:"showRunOutput"}),title:`${e.mode==="check"?"Skeleton run (check mode)":"Real run"} at ${e.finishedAt??e.startedAt} in ${e.environment??"the environment"}. ${e.awx?"Open the job in AWX.":"Show the terminal."}`,children:[(0,c.jsx)("span",{className:`codicon ${n?"codicon-pass":"codicon-warning"}`,"aria-hidden":"true"})," ",s]})}function Xq({edge:e}){let t=_(v=>v.snapshot?.doc),n=wa(),r=t?Ee(t):void 0,a=r?.edges.get(e)?.edge;if(!r||!a)return null;let s=r.nodes.get(a.from.node)?.node,l=r.nodes.get(a.to.node)?.node,f={node:a.from.node,port:a.from.port},p=ka(a.from.port,s?.type),h=n?Ld(r,f)?.items??[]:[];return(0,c.jsxs)("div",{className:"afd-panel-body","data-wire-panel":e,children:[(0,c.jsx)("h2",{children:"Wire"}),(0,c.jsxs)("p",{children:["Hosts that leave ",(0,c.jsx)("strong",{children:s?.title})," by"," ",(0,c.jsx)("span",{className:"mono",children:a.from.port})," go to ",(0,c.jsx)("strong",{children:l?.title}),"."]}),p?(0,c.jsxs)("p",{className:"muted",children:[p,"."]}):null,(0,c.jsx)("div",{className:"afd-panel-actions",children:h.map(v=>(0,c.jsx)("button",{type:"button",className:"secondary",onClick:()=>{ol(v,f)},children:v.label},v.label))})]})}var Zq=16e3,Gq=12e7;async function Qq(e,t,n){let r=Math.max(.25,Math.min(2,Zq/Math.max(t,n),Math.sqrt(Gq/(t*n)))),a=new Image;a.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,await a.decode();let s=document.createElement("canvas");s.width=Math.round(t*r),s.height=Math.round(n*r);let l=s.getContext("2d");if(!l)throw Error("no 2D canvas");l.fillStyle="#ffffff",l.fillRect(0,0,s.width,s.height),l.drawImage(a,0,0,s.width,s.height);let f=await new Promise((v,g)=>s.toBlob(m=>m?v(m):g(Error("PNG encoding failed")),"image/png")),p=new Uint8Array(await f.arrayBuffer()),h="";for(let v=0;v<p.length;v+=8192)h+=String.fromCharCode(...p.subarray(v,v+8192));return btoa(h)}var j_=e=>!!e&&/^(entry|exit):/.test(e);function Jq(e){let{node:t,edge:n,nodes:r,annotations:a}=e.selection;if(t)return{kind:"details",id:t};let s=!r?.length&&a?.length===1?a[0]:void 0;return s?{kind:"annotation",id:s}:e.mode==="code"?{kind:"drift"}:e.mode==="run"?n&&!j_(n)?{kind:"wireRun",edge:n}:{kind:"run"}:r?.length?{kind:"selection",ids:r}:n&&j_(n)?{kind:"boundary",edge:n}:n?{kind:"wire",edge:n}:e.level==="root"?{kind:"flow"}:{kind:"details",id:e.level,context:!0}}function C_(e){switch(e.kind){case"drift":return"Design vs code";case"wireRun":case"run":return"Run results";case"selection":return"Selected nodes";case"details":return e.context?"Subflow details":"Details";case"boundary":return"Subflow boundary";case"wire":return"Wire";case"annotation":return"Annotation";case"flow":return"Flow description"}}var eH={light:{ok:"#2f855a",failed:"#c2410c",unreachable:"#b45309",decision:"#3b62c4",approval:"#6b5bd2",undo:"#0f766e",neutral:"#6b7280",accent:"#1d4ed8"},dark:{ok:"#4fbf83",failed:"#f07a4a",unreachable:"#f0a742",decision:"#7f9cf5",approval:"#a99cf0",undo:"#3cc2b4",neutral:"#9aa0a6",accent:"#5b8def"},"hc-dark":{ok:"#57e389",failed:"#ff8c5a",unreachable:"#ffc457",decision:"#9db4ff",approval:"#c4b8ff",undo:"#4ee0d0",neutral:"#c8c8c8",accent:"#f38518"},"hc-light":{ok:"#1b6b44",failed:"#a3330a",unreachable:"#8a4b00",decision:"#2349a8",approval:"#4f3fb0",undo:"#0b5c56",neutral:"#4b5058",accent:"#0f4a85"}},tH={light:{"fill-specified":"#f3f0ff","fill-implemented":"#e9f7f1","fill-tested":"#dcf2e6","fill-decision":"#eaf1fb","fill-approval":"#f1effc","fill-handler":"#fdf2e7","fill-failed-end":"#fdecec"},dark:{"fill-specified":"#2c2645","fill-implemented":"#1c3329","fill-tested":"#1a3d2c","fill-decision":"#1e2a40","fill-approval":"#2a2542","fill-handler":"#3a2a17","fill-failed-end":"#3d1f1f"},"hc-dark":{"fill-specified":"transparent","fill-implemented":"transparent","fill-tested":"transparent","fill-decision":"transparent","fill-approval":"transparent","fill-handler":"transparent","fill-failed-end":"transparent"},"hc-light":{"fill-specified":"transparent","fill-implemented":"transparent","fill-tested":"transparent","fill-decision":"transparent","fill-approval":"transparent","fill-handler":"transparent","fill-failed-end":"transparent"}},nH={light:{yellow:{fill:"#fff4c2",ink:"#7a5600"},blue:{fill:"#e2edff",ink:"#1f4e9e"},green:{fill:"#e0f5e7",ink:"#1d6336"},pink:{fill:"#fde6ef",ink:"#9b2358"},purple:{fill:"#eee7ff",ink:"#5536b0"},gray:{fill:"#eceef1",ink:"#4b5058"}},dark:{yellow:{fill:"#4a3e10",ink:"#f2d46b"},blue:{fill:"#1c2d4a",ink:"#8ab4ff"},green:{fill:"#1a3925",ink:"#7ed49a"},pink:{fill:"#45202f",ink:"#f59ac0"},purple:{fill:"#2f2550",ink:"#c1aaff"},gray:{fill:"#2e3137",ink:"#c3c7cd"}},"hc-dark":{yellow:{fill:"transparent",ink:"#ffff00"},blue:{fill:"transparent",ink:"#8ab4ff"},green:{fill:"transparent",ink:"#89d185"},pink:{fill:"transparent",ink:"#ff9ccf"},purple:{fill:"transparent",ink:"#d0b8ff"},gray:{fill:"transparent",ink:"#ffffff"}},"hc-light":{yellow:{fill:"transparent",ink:"#5c4400"},blue:{fill:"transparent",ink:"#0f3d8a"},green:{fill:"transparent",ink:"#0f5223"},pink:{fill:"transparent",ink:"#8a1846"},purple:{fill:"transparent",ink:"#45249c"},gray:{fill:"transparent",ink:"#292929"}}},E_={light:{inventory:{bg:"#e8f1fb",fg:"#1e4f86"},data:{bg:"#f3f0ff",fg:"#4c3fa8"},code:{bg:"#e9f7f1",fg:"#0f5a43"},access:{bg:"#fdf2e7",fg:"#8a4b0a"},timing:{bg:"#f1f2f4",fg:"#3d444d"},changes:{bg:"#e7f3f8",fg:"#0b4f6c"}},dark:{inventory:{bg:"#1b2c42",fg:"#9cc3f0"},data:{bg:"#2c2645",fg:"#c3b8ff"},code:{bg:"#1c3329",fg:"#8fdcb7"},access:{bg:"#3a2a17",fg:"#f2c48a"},timing:{bg:"#2b2e33",fg:"#c9ced6"},changes:{bg:"#173240",fg:"#9fd3ea"}},"hc-dark":{inventory:{bg:"transparent",fg:"#9db4ff"},data:{bg:"transparent",fg:"#c4b8ff"},code:{bg:"transparent",fg:"#57e389"},access:{bg:"transparent",fg:"#ffc457"},timing:{bg:"transparent",fg:"#ffffff"},changes:{bg:"transparent",fg:"#7fdbff"}},"hc-light":{inventory:{bg:"transparent",fg:"#0f4a85"},data:{bg:"transparent",fg:"#4f3fb0"},code:{bg:"transparent",fg:"#1b6b44"},access:{bg:"transparent",fg:"#8a4b00"},timing:{bg:"transparent",fg:"#292929"},changes:{bg:"transparent",fg:"#004b6b"}}},oH={light:{delim:"#0000ff",keyword:"#af00db",constant:"#0000ff",var:"#001080",func:"#795e26",string:"#a31515",format:"#ee0000",number:"#098658",comment:"#008000",key:"#800000"},dark:{delim:"#5ca1db",keyword:"#c586c0",constant:"#5ca1db",var:"#9cdcfe",func:"#dcdcaa",string:"#ce9178",format:"#d7ba7d",number:"#b5cea8",comment:"#7ca668",key:"#5ca1db"},"hc-dark":{delim:"#569cd6",keyword:"#c586c0",constant:"#569cd6",var:"#9cdcfe",func:"#dcdcaa",string:"#ce9178",format:"#d7ba7d",number:"#b5cea8",comment:"#7ca668",key:"#569cd6"},"hc-light":{delim:"#0f4a85",keyword:"#b5200d",constant:"#0f4a85",var:"#001080",func:"#5e2cbc",string:"#0f4a85",format:"#ee0000",number:"#096d48",comment:"#515151",key:"#0f4a85"}};function rH(e){return e.classList.contains("vscode-high-contrast-light")?"hc-light":e.classList.contains("vscode-high-contrast")?"hc-dark":e.classList.contains("vscode-dark")?"dark":"light"}function iH(e,t){for(let[n,r]of Object.entries(eH[t]))e.style.setProperty(`--afd-${n}`,r);for(let[n,r]of Object.entries(tH[t]))e.style.setProperty(`--afd-${n}`,r);for(let[n,r]of Object.entries(E_[t]))e.style.setProperty(`--afd-lens-${n}-bg`,r.bg),e.style.setProperty(`--afd-lens-${n}-fg`,r.fg);for(let[n,r]of Object.entries(nH[t]))e.style.setProperty(`--afd-note-${n}`,r.fill),e.style.setProperty(`--afd-note-${n}-ink`,r.ink);for(let[n,r]of Object.entries(oH[t]))e.style.setProperty(`--afd-syn-${n}`,r);e.style.setProperty("--afd-lens-data",E_[t].data.fg),e.dataset.theme=t}function $_(){F3(),_.getState().setViewer()}function aH(){(0,T.useEffect)(()=>{let e=()=>iH(document.documentElement,rH(document.body));e();let t=new MutationObserver(e);return t.observe(document.body,{attributes:!0,attributeFilter:["class"]}),()=>t.disconnect()},[])}function sH(){let e=(0,T.useRef)(null),t=(0,T.useRef)(!1);(0,T.useEffect)(()=>{let a=Yg(h=>{let v=_.getState();h.type==="snapshot"?(e.current={version:h.snapshot.docVersion,at:performance.now()},v.setSnapshot(h.snapshot)):h.type==="run"?v.setRun(h.run):h.type==="runs"?v.setPastRuns(h.runs):h.type==="launch"?v.setLaunch(h.plan,h.notice):h.type==="launchFacts"?v.setLaunchFacts(h.token,h.facts,h.error):h.type==="scenarios"?v.setScenarios(h.results,h.show):h.type==="scenarioCheck"?v.setScenarioCheck(h.check,h.undo):h.type==="outsideMarks"?v.setOutside(h.marks):h.type==="repoState"?v.setRepo(h.state):h.type==="config"?(v.setTestMode(h.testMode),v.setRunner(h.runner===!0),v.setExpandSubflows(h.expandSubflows===!0),h.viewer&&$_()):h.type==="firstFlow"?v.setFirstFlow({hidden:h.hidden,done:h.done}):h.type==="reveal"?v.reveal(h.node):h.type==="setMode"?v.setMode(h.mode):h.type==="openLevel"?v.setLevel(h.level):h.type==="catalogStatus"?v.setCatalog(h.status):h.type==="sync"?v.setSync({state:h.state,scan:h.scan,error:h.error}):h.type==="lensFacts"?v.setLensFacts(h.facts):h.type==="setLens"?v.setLens(h.lens):h.type==="clipboard"?h.action==="copy"?Kd():QC(h.text,h.at):h.type==="notify"?v.notify(h.level,h.text):h.type==="openDetails"?(v.reveal(h.node),v.openDetails(h.node,h.tab)):h.type==="inspect"?je({type:"inspectResult",reqId:h.reqId,result:g7(v.snapshot?.docVersion??-1)}):h.type==="renderPng"&&Qq(h.svg,h.width,h.height).then(g=>je({type:"pngRendered",reqId:h.reqId,data:g}),g=>je({type:"pngRendered",reqId:h.reqId,error:g.message}))}),s=h=>je({type:"cspViolation",detail:`${h.violatedDirective} ${h.blockedURI}`});document.addEventListener("securitypolicyviolation",s);let l=N5(h=>{Ud(h)}),f=w7(),p=R3(h=>_.setState({saving:h>0}));return je({type:"ready"}),()=>{a(),l(),f(),p(),document.removeEventListener("securitypolicyviolation",s)}},[]);let n=_(a=>a.snapshot),r=_(a=>a.testMode);(0,T.useLayoutEffect)(()=>{if(!n||!e.current||e.current.version!==n.docVersion)return;let{at:a,version:s}=e.current;requestAnimationFrame(()=>{if(!r)return;let l=t.current?"render":"firstRender";t.current=!0,je({type:"perf",event:l,ms:performance.now()-a,docVersion:s});let f=0,p=()=>{if(document.querySelector('.react-flow__node[style*="visibility: hidden"]')&&f++<60)return requestAnimationFrame(p);requestAnimationFrame(()=>je({type:"perf",event:"drawn",ms:performance.now()-a,docVersion:s}))};p()})},[n,r])}function lH({panel:e}){switch(e.kind){case"drift":return(0,c.jsx)(aB,{});case"wireRun":return(0,c.jsx)(RB,{edge:e.edge});case"run":return(0,c.jsx)(PB,{});case"selection":return(0,c.jsx)(Oq,{ids:e.ids});case"details":return(0,c.jsx)(h7,{id:e.id,context:e.context},e.id);case"boundary":return(0,c.jsx)(W7,{edge:e.edge});case"wire":return(0,c.jsx)(Xq,{edge:e.edge});case"annotation":return(0,c.jsx)(F7,{id:e.id});case"flow":return(0,c.jsx)(kB,{})}}function dH(){(0,T.useEffect)(()=>{let e=Ms();return typeof e.panelWidth=="number"&&_.getState().setPanelWidth(e.panelWidth),e.expanded&&_.getState().setExpanded(!0),e.paletteCollapsed&&_.getState().setPaletteCollapsed(!0),e.panelCollapsed&&_.getState().setPanelCollapsed(!0),e.annotationsHidden&&_.getState().setAnnotationsHidden(!0),_.subscribe((t,n)=>{(t.panelWidth!==n.panelWidth||t.expanded!==n.expanded||t.paletteCollapsed!==n.paletteCollapsed||t.panelCollapsed!==n.panelCollapsed||t.annotationsHidden!==n.annotationsHidden)&&Xg({...Ms(),panelWidth:t.panelWidth,expanded:t.expanded,paletteCollapsed:t.paletteCollapsed,panelCollapsed:t.panelCollapsed,annotationsHidden:t.annotationsHidden})})},[])}function uH(){let e=_(r=>r.panelWidth),t=_(r=>r.expanded),n=r=>{_.getState().setExpanded(!1),_.getState().setPanelWidth(r)};return(0,c.jsx)("div",{className:"afd-resizer",role:"separator","aria-orientation":"vertical","aria-label":"Resize the side panel","aria-valuemin":Hd.min,"aria-valuemax":Hd.max,"aria-valuenow":e,tabIndex:0,onKeyDown:r=>{let a=r.shiftKey?64:16;if(r.key==="ArrowLeft")n(e+a);else if(r.key==="ArrowRight")n(e-a);else if(r.key==="Enter")_.getState().setPanelCollapsed(!0);else return;r.preventDefault()},onDoubleClick:()=>_.getState().setPanelCollapsed(!0),onPointerDown:r=>{r.preventDefault();let a=r.clientX,s=r.currentTarget,l=t?s.parentElement?.getBoundingClientRect().width??e:e,f=()=>{s.removeEventListener("pointermove",p),s.removeEventListener("pointerup",f),s.removeEventListener("pointercancel",f),s.removeEventListener("lostpointercapture",f),s.hasPointerCapture?.(r.pointerId)&&s.releasePointerCapture(r.pointerId)},p=h=>{h.buttons===0?f():n(l+(a-h.clientX))};s.setPointerCapture?.(r.pointerId),s.addEventListener("pointermove",p),s.addEventListener("pointerup",f),s.addEventListener("pointercancel",f),s.addEventListener("lostpointercapture",f)}})}function cH({label:e,lensTab:t}){let n=_(m=>m.lens),r=_(m=>m.lensView?.findings.length??0),a=_(m=>m.showLensTab),s=_(m=>m.scenariosOpen),l=_(m=>m.scenariosTab),f=_(m=>m.showScenariosTab),p=_(m=>m.scenarioCheck?.results.filter(b=>!b.passed).length??0),h=m=>{f(!1),a(m)},v=!t&&!l,g=sa.find(m=>m.id===n)?.label??n;return(0,c.jsxs)("div",{className:"afd-props-tabs afd-right-tabs",role:"tablist","aria-label":"Side panel",onKeyDown:RE,children:[(0,c.jsx)("button",{type:"button",role:"tab","aria-selected":v,tabIndex:v?0:-1,className:v?"active":"",onClick:()=>h(!1),children:e}),n?(0,c.jsxs)("button",{type:"button",role:"tab","aria-selected":t,tabIndex:t?0:-1,className:t?"active":"",onClick:()=>h(!0),children:["Lens: ",g," ",r?(0,c.jsx)("span",{className:"afd-chip",children:r}):null]}):null,s?(0,c.jsxs)("button",{type:"button",role:"tab","aria-selected":l,tabIndex:l?0:-1,className:l?"active":"","data-tab":"scenarios",onClick:()=>f(!0),children:["Scenarios ",p?(0,c.jsx)("span",{className:"afd-chip",children:p}):null]}):null]})}function fH(){aH(),sH();let e=_(N=>N.snapshot),t=_(N=>N.selection.node),n=_(N=>N.selection.edge),r=_(N=>N.selection.nodes),a=_(N=>N.selection.annotations),s=_(N=>N.level),l=_(N=>N.panelWidth),f=_(N=>N.lens!==null&&N.lensTab),p=_(N=>N.scenariosOpen),h=_(N=>N.scenariosOpen&&N.scenariosTab),v=(0,T.useRef)(null);(0,T.useLayoutEffect)(()=>{v.current&&(v.current.scrollTop=f?_.getState().lensScroll:0)},[f]);let g=_(N=>N.expanded),m=_(N=>N.panelCollapsed),b=_(N=>N.paletteCollapsed);dH();let w=_(N=>N.mode),k=_(N=>N.lens),S=Jq({lens:k,mode:w,selection:{node:t,edge:n,nodes:r,annotations:a},level:s});return e?e.doc?(0,c.jsx)(aN,{children:(0,c.jsxs)("div",{className:"afd-shell",style:{"--afd-right-width":m?"var(--afd-collapsed-width)":g?"min(1100px, 80vw)":`${l}px`,...w==="design"?b?{"--afd-left-width":"var(--afd-collapsed-width)"}:{}:{"--afd-left-width":"0px"}},children:[(0,c.jsx)(Rq,{}),w==="design"?(0,c.jsx)(Nq,{}):null,(0,c.jsxs)("main",{className:"afd-center",children:[(0,c.jsx)(H7,{}),(0,c.jsx)(K7,{}),(0,c.jsx)(Cq,{}),(0,c.jsx)(X7,{}),(0,c.jsx)(xq,{}),(0,c.jsx)(G8,{}),(0,c.jsx)(Lq,{})]}),m?(0,c.jsx)("aside",{className:"afd-right collapsed","aria-label":"Side panel, hidden",children:(0,c.jsx)("button",{type:"button",className:"icon","aria-label":"Show Side Panel",title:"Show the side panel",onClick:()=>_.getState().setPanelCollapsed(!1),children:(0,c.jsx)("span",{className:"codicon codicon-layout-sidebar-right","aria-hidden":"true"})})}):(0,c.jsxs)("aside",{ref:v,className:"afd-right","aria-label":f?"Lens":h?"Scenarios":C_(S),onScroll:N=>{N.currentTarget.style.setProperty("--afd-right-scroll",`${N.currentTarget.scrollTop}px`),f&&_.setState({lensScroll:N.currentTarget.scrollTop})},children:[(0,c.jsx)(uH,{}),k||p?(0,c.jsx)(cH,{label:C_(S),lensTab:f}):null,f?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(gq,{}),(0,c.jsx)(yq,{})]}):h?(0,c.jsx)(Mq,{}):(0,c.jsx)(lH,{panel:S})]}),(0,c.jsx)(Q6,{}),(0,c.jsx)(J7,{}),(0,c.jsx)(lB,{}),(0,c.jsx)(vq,{}),(0,c.jsx)(Pq,{}),(0,c.jsx)(eq,{}),(0,c.jsx)(Eq,{}),(0,c.jsx)(R7,{}),(0,c.jsx)(G7,{}),(0,c.jsx)(lq,{}),(0,c.jsx)($q,{})]})},s):(0,c.jsx)(bq,{snapshot:e}):(0,c.jsx)("div",{className:"afd-loading",children:"Loading flow\u2026"})}var __={light:"vscode-light",dark:"vscode-dark","hc-dark":"vscode-high-contrast","hc-light":"vscode-high-contrast-light"},T_={light:{"--vscode-editor-background":"#ffffff","--vscode-editor-foreground":"#3b3b3b","--vscode-sideBar-background":"#f8f8f8","--vscode-panel-border":"#e5e5e5","--vscode-descriptionForeground":"#717171","--vscode-focusBorder":"#005fb8","--vscode-button-background":"#005fb8","--vscode-button-foreground":"#ffffff","--vscode-input-background":"#ffffff","--vscode-input-border":"#cecece"},dark:{"--vscode-editor-background":"#1f1f1f","--vscode-editor-foreground":"#cccccc","--vscode-sideBar-background":"#181818","--vscode-panel-border":"#2b2b2b","--vscode-descriptionForeground":"#9d9d9d","--vscode-focusBorder":"#0078d4","--vscode-button-background":"#0078d4","--vscode-button-foreground":"#ffffff","--vscode-input-background":"#313131","--vscode-input-border":"#3c3c3c","--vscode-editorLineNumber-foreground":"#4a4a4a"},"hc-dark":{"--vscode-editor-background":"#000000","--vscode-editor-foreground":"#ffffff","--vscode-sideBar-background":"#000000","--vscode-panel-border":"#6fc3df","--vscode-descriptionForeground":"#ffffff","--vscode-focusBorder":"#f38518","--vscode-button-background":"#000000","--vscode-button-border":"#6fc3df","--vscode-contrastBorder":"#6fc3df","--vscode-input-background":"#000000","--vscode-input-border":"#6fc3df"},"hc-light":{"--vscode-editor-background":"#ffffff","--vscode-editor-foreground":"#292929","--vscode-sideBar-background":"#ffffff","--vscode-panel-border":"#0f4a85","--vscode-descriptionForeground":"#292929","--vscode-focusBorder":"#006bbd","--vscode-button-background":"#0f4a85","--vscode-button-foreground":"#ffffff","--vscode-button-border":"#0f4a85","--vscode-contrastBorder":"#0f4a85","--vscode-input-background":"#ffffff","--vscode-input-border":"#0f4a85"}};function hH(e,t){let n=T_[t];for(let r of Object.values(__))e.body.classList.remove(r);e.body.classList.add(__[t]);for(let[r,a]of Object.entries(n))e.documentElement.style.setProperty(r,a);for(let r of Object.values(T_))for(let a of Object.keys(r))a in n||e.documentElement.style.removeProperty(a)}function pH(e,t){mN(t.transport),t.viewer&&$_();let n=e.ownerDocument,r=n.defaultView?.matchMedia?.("(prefers-color-scheme: dark)"),a=t.theme??"auto",s=()=>hH(n,a==="auto"?r?.matches?"dark":"light":a);s(),r?.addEventListener("change",s),e.style.height="100%";let l=(0,kA.createRoot)(e);return l.render((0,c.jsx)(fH,{})),{setTheme(f){a=f,s()},unmount(){r?.removeEventListener("change",s),l.unmount()}}}export{pH as mount};
|